aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml28
-rw-r--r--CMakeLists.txt25
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--README.md2
-rw-r--r--cmake/compiler/clang/settings.cmake15
-rw-r--r--cmake/compiler/gcc/settings.cmake14
-rw-r--r--cmake/compiler/msvc/settings.cmake41
-rw-r--r--cmake/genrev.cmake2
-rw-r--r--cmake/macros/AutoCollect.cmake71
-rw-r--r--cmake/macros/ConfigureScripts.cmake104
-rw-r--r--cmake/macros/FindBoost.cmake5
-rw-r--r--cmake/macros/FindPCHSupport.cmake111
-rw-r--r--cmake/macros/FindReadline.cmake18
-rw-r--r--cmake/macros/GroupSources.cmake9
-rw-r--r--cmake/options.cmake39
-rw-r--r--cmake/platform/unix/settings.cmake11
-rw-r--r--cmake/platform/win/settings.cmake21
-rw-r--r--cmake/showoptions.cmake45
-rw-r--r--contrib/check_updates.sh5
-rw-r--r--contrib/extractor.bat51
-rw-r--r--contrib/grafana/1_General.json889
-rw-r--r--contrib/grafana/2_Maps.json339
-rw-r--r--contrib/grafana/3_Network.json242
-rw-r--r--contrib/merge_updates_windows.bat2
-rw-r--r--dep/CMakeLists.txt31
-rw-r--r--dep/PackageList.txt20
-rw-r--r--dep/SFMT/CMakeLists.txt (renamed from src/server/scripts/World/CMakeLists.txt)11
-rw-r--r--dep/boost/CMakeLists.txt (renamed from cmake/macros/ConfigureBoost.cmake)55
-rw-r--r--dep/bzip2/CMakeLists.txt33
-rw-r--r--dep/cppformat/CMakeLists.txt48
-rw-r--r--dep/cppformat/README.rst29
-rw-r--r--dep/cppformat/cppformat/format.cc (renamed from dep/cppformat/format.cc)118
-rw-r--r--dep/cppformat/cppformat/format.h (renamed from dep/cppformat/format.h)531
-rw-r--r--dep/cppformat/cppformat/posix.cc (renamed from dep/cppformat/posix.cc)4
-rw-r--r--dep/cppformat/cppformat/posix.h (renamed from dep/cppformat/posix.h)63
-rw-r--r--dep/efsw/.hg_archival.txt5
-rw-r--r--dep/efsw/CMakeLists.txt85
-rw-r--r--dep/efsw/LICENSE22
-rw-r--r--dep/efsw/README.md138
-rw-r--r--dep/efsw/include/efsw/efsw.h151
-rw-r--r--dep/efsw/include/efsw/efsw.hpp197
-rw-r--r--dep/efsw/src/efsw/Debug.cpp85
-rw-r--r--dep/efsw/src/efsw/Debug.hpp50
-rw-r--r--dep/efsw/src/efsw/DirWatcherGeneric.cpp451
-rw-r--r--dep/efsw/src/efsw/DirWatcherGeneric.hpp55
-rw-r--r--dep/efsw/src/efsw/DirectorySnapshot.cpp261
-rw-r--r--dep/efsw/src/efsw/DirectorySnapshot.hpp46
-rw-r--r--dep/efsw/src/efsw/DirectorySnapshotDiff.cpp29
-rw-r--r--dep/efsw/src/efsw/DirectorySnapshotDiff.hpp35
-rw-r--r--dep/efsw/src/efsw/FileInfo.cpp274
-rw-r--r--dep/efsw/src/efsw/FileInfo.hpp66
-rw-r--r--dep/efsw/src/efsw/FileSystem.cpp124
-rw-r--r--dep/efsw/src/efsw/FileSystem.hpp40
-rw-r--r--dep/efsw/src/efsw/FileWatcher.cpp145
-rw-r--r--dep/efsw/src/efsw/FileWatcherCWrapper.cpp132
-rw-r--r--dep/efsw/src/efsw/FileWatcherFSEvents.cpp278
-rw-r--r--dep/efsw/src/efsw/FileWatcherFSEvents.hpp107
-rw-r--r--dep/efsw/src/efsw/FileWatcherGeneric.cpp197
-rw-r--r--dep/efsw/src/efsw/FileWatcherGeneric.hpp59
-rw-r--r--dep/efsw/src/efsw/FileWatcherImpl.cpp29
-rw-r--r--dep/efsw/src/efsw/FileWatcherImpl.hpp54
-rw-r--r--dep/efsw/src/efsw/FileWatcherInotify.cpp531
-rw-r--r--dep/efsw/src/efsw/FileWatcherInotify.hpp73
-rw-r--r--dep/efsw/src/efsw/FileWatcherKqueue.cpp274
-rw-r--r--dep/efsw/src/efsw/FileWatcherKqueue.hpp78
-rw-r--r--dep/efsw/src/efsw/FileWatcherWin32.cpp291
-rw-r--r--dep/efsw/src/efsw/FileWatcherWin32.hpp69
-rw-r--r--dep/efsw/src/efsw/Log.cpp27
-rw-r--r--dep/efsw/src/efsw/Mutex.cpp26
-rw-r--r--dep/efsw/src/efsw/Mutex.hpp28
-rw-r--r--dep/efsw/src/efsw/String.cpp813
-rw-r--r--dep/efsw/src/efsw/String.hpp629
-rw-r--r--dep/efsw/src/efsw/System.cpp26
-rw-r--r--dep/efsw/src/efsw/System.hpp26
-rw-r--r--dep/efsw/src/efsw/Thread.cpp51
-rw-r--r--dep/efsw/src/efsw/Thread.hpp111
-rw-r--r--dep/efsw/src/efsw/Utf.hpp748
-rw-r--r--dep/efsw/src/efsw/Utf.inl671
-rw-r--r--dep/efsw/src/efsw/Watcher.cpp21
-rw-r--r--dep/efsw/src/efsw/Watcher.hpp30
-rw-r--r--dep/efsw/src/efsw/WatcherFSEvents.cpp264
-rw-r--r--dep/efsw/src/efsw/WatcherFSEvents.hpp70
-rw-r--r--dep/efsw/src/efsw/WatcherGeneric.cpp40
-rw-r--r--dep/efsw/src/efsw/WatcherGeneric.hpp30
-rw-r--r--dep/efsw/src/efsw/WatcherInotify.cpp35
-rw-r--r--dep/efsw/src/efsw/WatcherInotify.hpp25
-rw-r--r--dep/efsw/src/efsw/WatcherKqueue.cpp667
-rw-r--r--dep/efsw/src/efsw/WatcherKqueue.hpp94
-rw-r--r--dep/efsw/src/efsw/WatcherWin32.cpp150
-rw-r--r--dep/efsw/src/efsw/WatcherWin32.hpp77
-rw-r--r--dep/efsw/src/efsw/base.hpp110
-rw-r--r--dep/efsw/src/efsw/inotify-nosys.h159
-rw-r--r--dep/efsw/src/efsw/platform/platformimpl.hpp20
-rw-r--r--dep/efsw/src/efsw/platform/posix/FileSystemImpl.cpp144
-rw-r--r--dep/efsw/src/efsw/platform/posix/FileSystemImpl.hpp27
-rw-r--r--dep/efsw/src/efsw/platform/posix/MutexImpl.cpp32
-rw-r--r--dep/efsw/src/efsw/platform/posix/MutexImpl.hpp31
-rw-r--r--dep/efsw/src/efsw/platform/posix/SystemImpl.cpp180
-rw-r--r--dep/efsw/src/efsw/platform/posix/SystemImpl.hpp26
-rw-r--r--dep/efsw/src/efsw/platform/posix/ThreadImpl.cpp68
-rw-r--r--dep/efsw/src/efsw/platform/posix/ThreadImpl.hpp35
-rw-r--r--dep/efsw/src/efsw/platform/win/FileSystemImpl.cpp89
-rw-r--r--dep/efsw/src/efsw/platform/win/FileSystemImpl.hpp28
-rw-r--r--dep/efsw/src/efsw/platform/win/MutexImpl.cpp29
-rw-r--r--dep/efsw/src/efsw/platform/win/MutexImpl.hpp34
-rw-r--r--dep/efsw/src/efsw/platform/win/SystemImpl.cpp50
-rw-r--r--dep/efsw/src/efsw/platform/win/SystemImpl.hpp26
-rw-r--r--dep/efsw/src/efsw/platform/win/ThreadImpl.cpp56
-rw-r--r--dep/efsw/src/efsw/platform/win/ThreadImpl.hpp39
-rw-r--r--dep/efsw/src/efsw/sophist.h147
-rw-r--r--dep/efsw/src/test/efsw-test.cpp151
-rw-r--r--dep/g3dlite/CMakeLists.txt27
-rw-r--r--dep/gsoap/CMakeLists.txt25
-rw-r--r--dep/gsoap/soapC.cpp754
-rw-r--r--dep/gsoap/soapH.h701
-rw-r--r--dep/gsoap/soapServer.cpp19
-rw-r--r--dep/gsoap/soapStub.h337
-rw-r--r--dep/gsoap/stdsoap2.cpp7262
-rw-r--r--dep/gsoap/stdsoap2.h1708
-rw-r--r--dep/gsoap/tc_changes.diff16
-rw-r--r--dep/gsoap/tc_upgrades.txt3
-rw-r--r--dep/jemalloc/CMakeLists.txt123
-rw-r--r--dep/libmpq/CMakeLists.txt38
-rw-r--r--dep/mysql/CMakeLists.txt22
-rw-r--r--dep/openssl/CMakeLists.txt26
-rw-r--r--dep/process/CMakeLists.txt (renamed from src/server/scripts/Commands/CMakeLists.txt)13
-rw-r--r--dep/readline/CMakeLists.txt38
-rw-r--r--dep/recastnavigation/CMakeLists.txt2
-rw-r--r--dep/recastnavigation/Detour/CMakeLists.txt20
-rw-r--r--dep/recastnavigation/Recast/CMakeLists.txt21
-rw-r--r--dep/threads/CMakeLists.txt (renamed from src/server/scripts/Events/CMakeLists.txt)12
-rw-r--r--dep/utf8cpp/CMakeLists.txt (renamed from src/server/scripts/Custom/CMakeLists.txt)11
-rw-r--r--dep/valgrind/CMakeLists.txt15
-rw-r--r--dep/zlib/CMakeLists.txt55
-rw-r--r--issue_template.md23
-rw-r--r--pull_request_template.md16
-rw-r--r--revision_data.h.in.cmake10
-rw-r--r--sql/base/auth_database.sql10
-rw-r--r--sql/base/characters_database.sql17
-rw-r--r--sql/base/dev/README.TXT1
-rw-r--r--sql/base/dev/world_database.sql6
-rw-r--r--sql/old/3.3.5a/auth/60_2016_04_11/2015_11_07_00_auth.sql (renamed from sql/updates/auth/2015_11_07_00_auth.sql)0
-rw-r--r--sql/old/3.3.5a/auth/60_2016_04_11/2016_01_13_00_auth.sql (renamed from sql/updates/auth/2016_01_13_00_auth.sql)0
-rw-r--r--sql/old/3.3.5a/characters/60_2016_04_11/2015_11_07_00_characters.sql (renamed from sql/updates/characters/2015_11_07_00_characters.sql)0
-rw-r--r--sql/old/3.3.5a/characters/60_2016_04_11/2016_02_10_00_characters.sql (renamed from sql/updates/characters/2016_02_10_00_characters.sql)0
-rw-r--r--sql/old/3.3.5a/characters/60_2016_04_11/2016_03_13_2016_01_05_00_characters.sql19
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_07_02_world.sql (renamed from sql/updates/world/2015_11_07_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_08_00_world.sql (renamed from sql/updates/world/2015_11_08_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_08_01_world.sql (renamed from sql/updates/world/2015_11_08_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_09_00_world.sql (renamed from sql/updates/world/2015_11_09_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_09_01_world.sql (renamed from sql/updates/world/2015_11_09_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_09_02_world_335.sql (renamed from sql/updates/world/2015_11_09_02_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_10_00_world.sql (renamed from sql/updates/world/2015_11_10_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_10_01_world.sql (renamed from sql/updates/world/2015_11_10_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_10_02_world.sql (renamed from sql/updates/world/2015_11_10_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_11_00_world.sql (renamed from sql/updates/world/2015_11_11_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_11_01_world.sql (renamed from sql/updates/world/2015_11_11_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_12_00_world.sql (renamed from sql/updates/world/2015_11_12_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_12_01_world.sql (renamed from sql/updates/world/2015_11_12_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_20_00_world.sql (renamed from sql/updates/world/2015_11_20_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_00_world.sql (renamed from sql/updates/world/2015_11_22_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_01_world.sql (renamed from sql/updates/world/2015_11_22_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_02_world.sql (renamed from sql/updates/world/2015_11_22_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_03_world_355.sql (renamed from sql/updates/world/2015_11_22_03_world_355.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_00_world_335.sql (renamed from sql/updates/world/2015_11_23_00_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_01_world_335.sql (renamed from sql/updates/world/2015_11_23_01_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_02_world_335.sql (renamed from sql/updates/world/2015_11_23_02_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_03_world_335.sql (renamed from sql/updates/world/2015_11_23_03_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_04_world_335.sql (renamed from sql/updates/world/2015_11_23_04_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_05_world.sql (renamed from sql/updates/world/2015_11_23_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_24_00_world_355.sql (renamed from sql/updates/world/2015_11_24_00_world_355.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_27_00_world.sql (renamed from sql/updates/world/2015_11_27_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_28_00_world.sql (renamed from sql/updates/world/2015_11_28_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_28_01_world_335.sql (renamed from sql/updates/world/2015_11_28_01_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_29_00_world.sql (renamed from sql/updates/world/2015_11_29_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_11_29_01_world.sql (renamed from sql/updates/world/2015_11_29_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_01_00_world.sql (renamed from sql/updates/world/2015_12_01_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_04_00_world.sql (renamed from sql/updates/world/2015_12_04_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_05_00_world.sql (renamed from sql/updates/world/2015_12_05_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_06_00_world.sql (renamed from sql/updates/world/2015_12_06_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_08_00_world_335.sql (renamed from sql/updates/world/2015_12_08_00_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_08_01_world.sql (renamed from sql/updates/world/2015_12_08_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_08_02_world.sql (renamed from sql/updates/world/2015_12_08_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_09_00_world.sql (renamed from sql/updates/world/2015_12_09_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_09_01_world.sql (renamed from sql/updates/world/2015_12_09_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_11_00_world.sql (renamed from sql/updates/world/2015_12_11_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_14_00_world.sql (renamed from sql/updates/world/2015_12_14_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_00_world.sql (renamed from sql/updates/world/2015_12_15_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_01_world.sql (renamed from sql/updates/world/2015_12_15_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_02_world.sql (renamed from sql/updates/world/2015_12_15_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_03_world.sql (renamed from sql/updates/world/2015_12_15_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_16_00_world.sql (renamed from sql/updates/world/2015_12_16_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_16_01_world.sql (renamed from sql/updates/world/2015_12_16_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_16_02_world_335.sql (renamed from sql/updates/world/2015_12_16_02_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_17_00_world.sql (renamed from sql/updates/world/2015_12_17_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_00_world_335.sql (renamed from sql/updates/world/2015_12_18_00_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_01_world.sql (renamed from sql/updates/world/2015_12_18_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_02_world.sql (renamed from sql/updates/world/2015_12_18_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_03_world_335.sql (renamed from sql/updates/world/2015_12_18_03_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_04_world.sql (renamed from sql/updates/world/2015_12_18_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_20_00_world.sql (renamed from sql/updates/world/2015_12_20_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_24_00_world.sql (renamed from sql/updates/world/2015_12_24_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_26_00_world.sql (renamed from sql/updates/world/2015_12_26_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_26_01_world.sql (renamed from sql/updates/world/2015_12_26_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_26_02_world.sql (renamed from sql/updates/world/2015_12_26_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_00_world.sql (renamed from sql/updates/world/2015_12_29_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_01_world.sql (renamed from sql/updates/world/2015_12_29_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_02_world.sql (renamed from sql/updates/world/2015_12_29_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_03_world.sql (renamed from sql/updates/world/2015_12_29_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_04_world.sql (renamed from sql/updates/world/2015_12_29_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_05_world.sql (renamed from sql/updates/world/2015_12_29_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_06_world.sql (renamed from sql/updates/world/2015_12_29_06_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_07_world.sql (renamed from sql/updates/world/2015_12_29_07_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_08_world.sql (renamed from sql/updates/world/2015_12_29_08_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_09_world.sql (renamed from sql/updates/world/2015_12_29_09_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_10_world.sql (renamed from sql/updates/world/2015_12_29_10_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_11_world.sql (renamed from sql/updates/world/2015_12_29_11_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_12_world.sql (renamed from sql/updates/world/2015_12_29_12_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_13_world.sql (renamed from sql/updates/world/2015_12_29_13_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_31_00_world.sql (renamed from sql/updates/world/2015_12_31_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2015_12_31_01_world.sql (renamed from sql/updates/world/2015_12_31_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_01_00_world.sql (renamed from sql/updates/world/2016_01_01_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_01_01_world.sql (renamed from sql/updates/world/2016_01_01_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_02_00_world_335.sql (renamed from sql/updates/world/2016_01_02_00_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_02_01_world.sql (renamed from sql/updates/world/2016_01_02_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_00_world_335.sql (renamed from sql/updates/world/2016_01_03_00_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_01_world.sql (renamed from sql/updates/world/2016_01_03_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_02_world.sql (renamed from sql/updates/world/2016_01_03_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_03_world.sql (renamed from sql/updates/world/2016_01_03_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_04_world.sql (renamed from sql/updates/world/2016_01_03_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_05_world.sql (renamed from sql/updates/world/2016_01_03_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_04_00_world.sql (renamed from sql/updates/world/2016_01_04_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_05_00_world.sql (renamed from sql/updates/world/2016_01_05_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_05_01_world.sql (renamed from sql/updates/world/2016_01_05_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_05_02_world.sql (renamed from sql/updates/world/2016_01_05_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_07_00_world.sql (renamed from sql/updates/world/2016_01_07_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_07_01_world.sql (renamed from sql/updates/world/2016_01_07_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_07_02_world.sql (renamed from sql/updates/world/2016_01_07_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_00_world.sql (renamed from sql/updates/world/2016_01_08_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_01_world.sql (renamed from sql/updates/world/2016_01_08_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_02_world.sql (renamed from sql/updates/world/2016_01_08_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_03_world.sql (renamed from sql/updates/world/2016_01_08_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_09_00_world.sql (renamed from sql/updates/world/2016_01_09_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_00_world.sql (renamed from sql/updates/world/2016_01_10_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_01_world.sql (renamed from sql/updates/world/2016_01_10_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_02_world.sql (renamed from sql/updates/world/2016_01_10_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_03_world.sql (renamed from sql/updates/world/2016_01_10_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_04_world.sql (renamed from sql/updates/world/2016_01_10_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_05_world_335.sql (renamed from sql/updates/world/2016_01_10_05_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_00_world.sql (renamed from sql/updates/world/2016_01_12_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_01_world_335.sql (renamed from sql/updates/world/2016_01_12_01_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_02_world_335.sql (renamed from sql/updates/world/2016_01_12_02_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_03_world.sql (renamed from sql/updates/world/2016_01_12_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_04_world.sql (renamed from sql/updates/world/2016_01_12_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_13_00_world.sql (renamed from sql/updates/world/2016_01_13_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_15_00_world.sql (renamed from sql/updates/world/2016_01_15_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_00_world_335.sql (renamed from sql/updates/world/2016_01_16_00_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_01_world.sql (renamed from sql/updates/world/2016_01_16_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_02_world.sql (renamed from sql/updates/world/2016_01_16_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_03_world.sql (renamed from sql/updates/world/2016_01_16_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_04_world.sql (renamed from sql/updates/world/2016_01_16_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_05_world.sql (renamed from sql/updates/world/2016_01_16_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_00_world_335.sql (renamed from sql/updates/world/2016_01_17_00_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_01_world.sql (renamed from sql/updates/world/2016_01_17_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_02_world.sql (renamed from sql/updates/world/2016_01_17_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_03_world.sql (renamed from sql/updates/world/2016_01_17_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_04_world.sql (renamed from sql/updates/world/2016_01_17_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_05_world.sql (renamed from sql/updates/world/2016_01_17_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_06_world.sql (renamed from sql/updates/world/2016_01_17_06_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_07_world.sql (renamed from sql/updates/world/2016_01_17_07_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_08_world.sql (renamed from sql/updates/world/2016_01_17_08_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_09_world.sql (renamed from sql/updates/world/2016_01_17_09_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_10_world.sql (renamed from sql/updates/world/2016_01_17_10_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_11_world.sql (renamed from sql/updates/world/2016_01_17_11_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_12_world.sql (renamed from sql/updates/world/2016_01_17_12_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_13_world.sql (renamed from sql/updates/world/2016_01_17_13_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_14_world.sql (renamed from sql/updates/world/2016_01_17_14_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_15_world.sql (renamed from sql/updates/world/2016_01_17_15_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_00_world.sql (renamed from sql/updates/world/2016_01_18_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_01_world.sql (renamed from sql/updates/world/2016_01_18_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_02_world.sql (renamed from sql/updates/world/2016_01_18_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_03_world.sql (renamed from sql/updates/world/2016_01_18_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_04_world.sql (renamed from sql/updates/world/2016_01_18_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_05_world.sql (renamed from sql/updates/world/2016_01_18_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_06_world.sql (renamed from sql/updates/world/2016_01_18_06_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_00_world.sql (renamed from sql/updates/world/2016_01_19_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_01_world.sql (renamed from sql/updates/world/2016_01_19_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_02_world.sql (renamed from sql/updates/world/2016_01_19_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_03_world.sql (renamed from sql/updates/world/2016_01_19_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_04_world.sql (renamed from sql/updates/world/2016_01_19_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_05_world.sql (renamed from sql/updates/world/2016_01_19_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_06_world.sql (renamed from sql/updates/world/2016_01_19_06_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_07_world.sql (renamed from sql/updates/world/2016_01_19_07_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_08_world.sql (renamed from sql/updates/world/2016_01_19_08_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_20_00_world.sql (renamed from sql/updates/world/2016_01_20_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_20_01_world.sql (renamed from sql/updates/world/2016_01_20_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_20_02_world.sql (renamed from sql/updates/world/2016_01_20_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_23_00_world.sql (renamed from sql/updates/world/2016_01_23_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_24_00_world.sql (renamed from sql/updates/world/2016_01_24_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_26_00_world.sql (renamed from sql/updates/world/2016_01_26_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_28_00_world_335.sql (renamed from sql/updates/world/2016_01_28_00_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_28_01_world.sql (renamed from sql/updates/world/2016_01_28_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_00_world_335.sql (renamed from sql/updates/world/2016_01_30_00_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_01_world.sql (renamed from sql/updates/world/2016_01_30_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_02_world.sql (renamed from sql/updates/world/2016_01_30_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_03_world.sql (renamed from sql/updates/world/2016_01_30_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_04_world.sql (renamed from sql/updates/world/2016_01_30_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_05_world.sql (renamed from sql/updates/world/2016_01_30_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_01_31_00_world.sql (renamed from sql/updates/world/2016_01_31_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_02_00_world.sql (renamed from sql/updates/world/2016_02_02_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_02_01_world.sql (renamed from sql/updates/world/2016_02_02_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_04_00_world.sql (renamed from sql/updates/world/2016_02_04_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_05_00_world.sql (renamed from sql/updates/world/2016_02_05_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_00_world.sql (renamed from sql/updates/world/2016_02_06_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_01_world.sql (renamed from sql/updates/world/2016_02_06_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_02_world.sql (renamed from sql/updates/world/2016_02_06_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_03_world.sql (renamed from sql/updates/world/2016_02_06_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_04_world.sql (renamed from sql/updates/world/2016_02_06_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_05_world.sql (renamed from sql/updates/world/2016_02_06_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_06_world.sql (renamed from sql/updates/world/2016_02_06_06_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_07_world.sql (renamed from sql/updates/world/2016_02_06_07_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_08_world.sql (renamed from sql/updates/world/2016_02_06_08_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_09_world.sql (renamed from sql/updates/world/2016_02_06_09_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_10_world.sql (renamed from sql/updates/world/2016_02_06_10_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_11_world.sql (renamed from sql/updates/world/2016_02_06_11_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_12_world.sql (renamed from sql/updates/world/2016_02_06_12_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_13_world_335.sql (renamed from sql/updates/world/2016_02_06_13_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_14_world.sql (renamed from sql/updates/world/2016_02_06_14_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_00_world.sql (renamed from sql/updates/world/2016_02_07_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_01_world_335.sql (renamed from sql/updates/world/2016_02_07_01_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_02_world_335.sql (renamed from sql/updates/world/2016_02_07_02_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_03_world_335.sql (renamed from sql/updates/world/2016_02_07_03_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_04_world.sql (renamed from sql/updates/world/2016_02_07_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_05_world_335.sql (renamed from sql/updates/world/2016_02_07_05_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_06_world.sql (renamed from sql/updates/world/2016_02_07_06_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_07_world_335.sql (renamed from sql/updates/world/2016_02_07_07_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_08_world_335.sql (renamed from sql/updates/world/2016_02_07_08_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_09_world.sql (renamed from sql/updates/world/2016_02_07_09_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_10_world.sql (renamed from sql/updates/world/2016_02_07_10_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_11_world.sql (renamed from sql/updates/world/2016_02_07_11_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_12_world.sql (renamed from sql/updates/world/2016_02_07_12_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_13_world.sql (renamed from sql/updates/world/2016_02_07_13_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_14_world.sql (renamed from sql/updates/world/2016_02_07_14_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_15_world.sql (renamed from sql/updates/world/2016_02_07_15_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_00_world_335.sql (renamed from sql/updates/world/2016_02_08_00_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_01_world.sql (renamed from sql/updates/world/2016_02_08_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_02_world.sql (renamed from sql/updates/world/2016_02_08_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_03_world.sql (renamed from sql/updates/world/2016_02_08_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_04_world.sql (renamed from sql/updates/world/2016_02_08_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_05_world.sql (renamed from sql/updates/world/2016_02_08_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_06_world.sql (renamed from sql/updates/world/2016_02_08_06_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_07_world.sql (renamed from sql/updates/world/2016_02_08_07_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_08_world.sql (renamed from sql/updates/world/2016_02_08_08_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_00_world.sql (renamed from sql/updates/world/2016_02_09_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_01_world.sql (renamed from sql/updates/world/2016_02_09_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_02_world.sql (renamed from sql/updates/world/2016_02_09_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_02_world_335.sql (renamed from sql/updates/world/2016_02_09_02_world_335.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_03_world.sql (renamed from sql/updates/world/2016_02_09_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_04_world.sql (renamed from sql/updates/world/2016_02_09_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_05_world.sql (renamed from sql/updates/world/2016_02_09_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_06_world.sql (renamed from sql/updates/world/2016_02_09_06_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_07_world.sql (renamed from sql/updates/world/2016_02_09_07_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_08_world.sql (renamed from sql/updates/world/2016_02_09_08_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_00_world.sql (renamed from sql/updates/world/2016_02_10_00_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_01_world.sql (renamed from sql/updates/world/2016_02_10_01_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_02_world.sql (renamed from sql/updates/world/2016_02_10_02_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_03_world.sql (renamed from sql/updates/world/2016_02_10_03_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_04_world.sql (renamed from sql/updates/world/2016_02_10_04_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_05_world.sql (renamed from sql/updates/world/2016_02_10_05_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_06_world.sql (renamed from sql/updates/world/2016_02_10_06_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_07_world.sql (renamed from sql/updates/world/2016_02_10_07_world.sql)0
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_00_world.sql6
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_01_world.sql5
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_02_world.sql18
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_03_world.sql11
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_04_world.sql4
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_05_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_06_world.sql206
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_07_world.sql145
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_12_00_world.sql7
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_00_world.sql4
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_01_world.sql206
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_02_world.sql74
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_03_world.sql166
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_04_world.sql51
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_00_world.sql3
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_01_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_02_world.sql16
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_03_world.sql3
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_04_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_15_00_world.sql73
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_00_world.sql343
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_01_world.sql40
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_02_world.sql21
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_00_world.sql7
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_01_world.sql49
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_02_world.sql5
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_19_00_world.sql9
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_19_01_world_335.sql8
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_00_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_01_world.sql26
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_02_world.sql34
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_00_world.sql1
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_01_world.sql119
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_02_world.sql6
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_24_00_world.sql1966
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_00_world.sql5
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_01_world_335.sql25
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_02_world.sql109
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_26_00_world.sql17
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_26_01_world.sql1
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_27_00_world.sql4
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_28_00_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_29_00_world.sql27
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_02_29_01_world.sql1
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_01_00_world_335.sql75
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_02_00_world_335.sql3
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_03_00_world.sql93
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_03_01_world.sql57
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_00_world.sql32
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_01_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_02_world_335.sql20
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_03_world.sql4
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_05_00_world.sql34
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_06_00_world.sql3
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_06_01_world.sql7
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_07_00_world.sql10
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_07_01_world.sql112
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_09_00_world.sql38
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_10_00_world.sql4
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_10_01_world.sql4
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_12_2015_11_14_00_world.sql3
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_13_00_world.sql3
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_13_01_world.sql106
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_15_00_world.sql4
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_00_world.sql66
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_01_world.sql64
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_02_world.sql16
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_00_world.sql13
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_01_world.sql62
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_02_world.sql40
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_21_00_world.sql80
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_23_00_world.sql164
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_00_world_335.sql9
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_01_world_335.sql9
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_02_world.sql4
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_26_00_world.sql516
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_27_00_world.sql3
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_28_00_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_28_01_world.sql1
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_03_29_00_world_335.sql11
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_01_00_world.sql89
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_01_01_world.sql67
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_00_world.sql14
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_01_world.sql17
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_02_world.sql3
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_00_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_01_world.sql36
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_02_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_04_00_world.sql149
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_05_00_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_05_01_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_08_00_world.sql133
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_00_world_2016_03_28_00_world.sql3
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_01_world.sql2
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_02_world.sql44
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_03_world.sql5
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_04_world.sql9
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_05_world.sql41
-rw-r--r--sql/old/3.3.5a/world/60_2016_04_11/2016_04_10_00_world.sql20
-rw-r--r--sql/updates/auth/3.3.5/2016_04_11_00_auth.sql1
-rw-r--r--sql/updates/auth/3.3.5/2016_05_11_00_auth.sql6
-rw-r--r--sql/updates/auth/3.3.5/2016_06_06_00_auth.sql5
-rw-r--r--sql/updates/auth/3.3.5/dummy (renamed from sql/updates/auth/dummy)0
-rw-r--r--sql/updates/characters/3.3.5/2016_04_11_00_characters.sql1
-rw-r--r--sql/updates/characters/3.3.5/dummy (renamed from sql/updates/characters/dummy)0
-rw-r--r--sql/updates/world/3.3.5/2016_04_11_00_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_04_11_01_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_04_11_02_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_04_15_03_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_04_16_00_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_04_16_01_world.sql307
-rw-r--r--sql/updates/world/3.3.5/2016_04_16_02_world.sql39
-rw-r--r--sql/updates/world/3.3.5/2016_04_16_03_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_04_16_04_world.sql33
-rw-r--r--sql/updates/world/3.3.5/2016_04_17_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_04_17_01_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_04_17_02_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_04_17_03_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_04_17_04_world.sql27
-rw-r--r--sql/updates/world/3.3.5/2016_04_20_00_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_04_20_01_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_04_20_02_world.sql89
-rw-r--r--sql/updates/world/3.3.5/2016_04_20_03_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_04_22_00_world.sql20
-rw-r--r--sql/updates/world/3.3.5/2016_04_23_00_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_04_23_01_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_04_23_02_world.sql19
-rw-r--r--sql/updates/world/3.3.5/2016_04_24_00_world_335.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_04_24_01_world.sql22
-rw-r--r--sql/updates/world/3.3.5/2016_04_25_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_04_25_01_world.sql42
-rw-r--r--sql/updates/world/3.3.5/2016_04_25_02_world.sql48
-rw-r--r--sql/updates/world/3.3.5/2016_04_25_03_world.sql47
-rw-r--r--sql/updates/world/3.3.5/2016_04_26_00_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_04_26_01_world.sql57
-rw-r--r--sql/updates/world/3.3.5/2016_04_26_02_world.sql16
-rw-r--r--sql/updates/world/3.3.5/2016_04_26_03_world.sql99
-rw-r--r--sql/updates/world/3.3.5/2016_04_28_00_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_04_29_00_world.sql55
-rw-r--r--sql/updates/world/3.3.5/2016_04_29_01_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_05_01_00_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_05_01_01_world.sql68
-rw-r--r--sql/updates/world/3.3.5/2016_05_02_00_world.sql14
-rw-r--r--sql/updates/world/3.3.5/2016_05_02_01_world.sql18
-rw-r--r--sql/updates/world/3.3.5/2016_05_04_00_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_05_04_01_world.sql69
-rw-r--r--sql/updates/world/3.3.5/2016_05_04_02_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_05_00_world.sql13
-rw-r--r--sql/updates/world/3.3.5/2016_05_05_01_world.sql71
-rw-r--r--sql/updates/world/3.3.5/2016_05_07_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_07_01_world.sql31
-rw-r--r--sql/updates/world/3.3.5/2016_05_08_00_world.sql11
-rw-r--r--sql/updates/world/3.3.5/2016_05_09_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_09_01_world.sql21
-rw-r--r--sql/updates/world/3.3.5/2016_05_09_02_world.sql41
-rw-r--r--sql/updates/world/3.3.5/2016_05_09_03_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_05_09_04_world.sql41
-rw-r--r--sql/updates/world/3.3.5/2016_05_11_00_world.sql33
-rw-r--r--sql/updates/world/3.3.5/2016_05_11_01_world.sql16
-rw-r--r--sql/updates/world/3.3.5/2016_05_20_00_world.sql37
-rw-r--r--sql/updates/world/3.3.5/2016_05_23_00_world.sql225
-rw-r--r--sql/updates/world/3.3.5/2016_05_24_00_world.sql14
-rw-r--r--sql/updates/world/3.3.5/2016_05_24_01_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_05_25_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_25_01_world_335.sql592
-rw-r--r--sql/updates/world/3.3.5/2016_05_26_00_world.sql19
-rw-r--r--sql/updates/world/3.3.5/2016_05_26_01_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_05_26_02_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_26_03_world.sql21
-rw-r--r--sql/updates/world/3.3.5/2016_05_26_04_world.sql27
-rw-r--r--sql/updates/world/3.3.5/2016_05_26_05_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_05_26_06_world_335.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_05_26_07_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_05_26_08_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_05_26_09_world.sql14
-rw-r--r--sql/updates/world/3.3.5/2016_05_28_00_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_05_28_01_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_05_28_02_world_335.sql240
-rw-r--r--sql/updates/world/3.3.5/2016_05_28_03_world.sql25
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_01_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_02_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_03_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_04_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_05_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_06_world.sql12
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_07_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_08_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_09_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_05_30_10_world.sql26
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_00_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_01_world_335.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_02_world.sql19
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_03_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_04_world.sql15
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_05_world.sql12
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_06_world.sql10
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_07_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_08_world.sql13
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_09_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_10_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_11_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_12_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_13_world.sql23
-rw-r--r--sql/updates/world/3.3.5/2016_05_31_14_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_01_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_02_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_03_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_04_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_05_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_06_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_07_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_08_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_09_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_10_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_11_world.sql81
-rw-r--r--sql/updates/world/3.3.5/2016_06_01_12_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_02_00_world.sql20
-rw-r--r--sql/updates/world/3.3.5/2016_06_02_01_world.sql10
-rw-r--r--sql/updates/world/3.3.5/2016_06_04_00_world.sql19
-rw-r--r--sql/updates/world/3.3.5/2016_06_04_01_world.sql12
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_01_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_02_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_03_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_04_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_05_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_06_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_07_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_08_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_09_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_10_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_11_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_06_05_12_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_06_00_world.sql83
-rw-r--r--sql/updates/world/3.3.5/2016_06_06_01_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_06_07_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_07_01_world.sql622
-rw-r--r--sql/updates/world/3.3.5/2016_06_09_00_world.sql33
-rw-r--r--sql/updates/world/3.3.5/2016_06_09_01_world.sql14
-rw-r--r--sql/updates/world/3.3.5/2016_06_09_02_world.sql21
-rw-r--r--sql/updates/world/3.3.5/2016_06_09_03_world_335.sql23
-rw-r--r--sql/updates/world/3.3.5/2016_06_09_04_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_06_09_05_world.sql82
-rw-r--r--sql/updates/world/3.3.5/2016_06_09_06_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_00_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_01_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_02_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_03_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_04_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_05_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_06_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_07_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_08_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_09_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_10_world.sql50
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_11_world.sql32
-rw-r--r--sql/updates/world/3.3.5/2016_06_11_12_world.sql24
-rw-r--r--sql/updates/world/3.3.5/2016_06_12_00_world_335.sql27
-rw-r--r--sql/updates/world/3.3.5/2016_06_12_01_world.sql45
-rw-r--r--sql/updates/world/3.3.5/2016_06_12_02_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_12_03_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_12_04_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_12_05_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_12_06_world.sql52
-rw-r--r--sql/updates/world/3.3.5/2016_06_12_07_world.sql33
-rw-r--r--sql/updates/world/3.3.5/2016_06_12_08_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_12_09_world.sql35
-rw-r--r--sql/updates/world/3.3.5/2016_06_13_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_13_01_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_13_02_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_13_03_world_335.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_13_04_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_13_05_world.sql55
-rw-r--r--sql/updates/world/3.3.5/2016_06_13_06_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_14_00_world.sql78
-rw-r--r--sql/updates/world/3.3.5/2016_06_14_01_world.sql104
-rw-r--r--sql/updates/world/3.3.5/2016_06_14_02_world.sql14
-rw-r--r--sql/updates/world/3.3.5/2016_06_14_03_world.sql385
-rw-r--r--sql/updates/world/3.3.5/2016_06_14_05_world.sql18
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_00_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_01_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_02_world.sql18
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_03_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_04_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_05_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_06_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_07_world.sql18
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_08_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_09_world_335.sql11
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_10_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_11_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_12_world.sql99
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_13_world_335.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_14_world.sql27
-rw-r--r--sql/updates/world/3.3.5/2016_06_15_15_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_16_00_world.sql16
-rw-r--r--sql/updates/world/3.3.5/2016_06_17_00_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_18_00_world.sql134
-rw-r--r--sql/updates/world/3.3.5/2016_06_18_01_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_06_18_02_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_20_00_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_20_01_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_20_02_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_20_03_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_20_04_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_06_22_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_22_01_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_22_02_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_22_03_world.sql3321
-rw-r--r--sql/updates/world/3.3.5/2016_06_23_00_world.sql50
-rw-r--r--sql/updates/world/3.3.5/2016_06_25_00_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_25_01_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_06_25_02_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_25_03_world.sql19
-rw-r--r--sql/updates/world/3.3.5/2016_06_26_00_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_06_26_01_world.sql10
-rw-r--r--sql/updates/world/3.3.5/2016_06_26_02_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_06_27_00_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_06_27_01_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_06_27_02_world.sql107
-rw-r--r--sql/updates/world/3.3.5/2016_06_29_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_06_29_01_world.sql2702
-rw-r--r--sql/updates/world/3.3.5/2016_06_30_00_world_335.sql103
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_00_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_01_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_02_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_03_world.sql12
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_04_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_05_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_06_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_07_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_08_world.sql13
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_09_world.sql12
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_10_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_11_world.sql20
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_12_world.sql27
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_13_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_04_14_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_07_05_00_world.sql21
-rw-r--r--sql/updates/world/3.3.5/2016_07_05_01_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_07_05_02_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_07_05_03_world.sql22
-rw-r--r--sql/updates/world/3.3.5/2016_07_06_00_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_07_06_01_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_06_02_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_06_03_world.sql24
-rw-r--r--sql/updates/world/3.3.5/2016_07_07_00_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_07_07_01_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_07_02_world.sql82
-rw-r--r--sql/updates/world/3.3.5/2016_07_07_03_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_07_07_04_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_07_05_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_09_00_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_10_00_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_07_10_01_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_10_02_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_10_03_world.sql13
-rw-r--r--sql/updates/world/3.3.5/2016_07_10_04_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_10_05_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_07_10_06_world.sql13
-rw-r--r--sql/updates/world/3.3.5/2016_07_10_07_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_10_09_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_12_00_world.sql24
-rw-r--r--sql/updates/world/3.3.5/2016_07_12_01_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_07_12_02_world.sql19
-rw-r--r--sql/updates/world/3.3.5/2016_07_13_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_13_01_world_335.sql44
-rw-r--r--sql/updates/world/3.3.5/2016_07_14_00_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_00_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_01_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_02_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_03_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_04_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_05_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_06_world.sql63
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_07_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_08_world.sql40
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_09_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_10_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_15_11_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_07_16_00_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_07_16_01_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_16_02_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_07_16_03_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_16_04_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_16_05_world_335.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_07_16_06_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_07_16_07_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_07_16_08_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_07_18_00_world.sql13
-rw-r--r--sql/updates/world/3.3.5/2016_07_18_01_world.sql40
-rw-r--r--sql/updates/world/3.3.5/2016_07_19_00_world.sql20
-rw-r--r--sql/updates/world/3.3.5/2016_07_19_01_world.sql21
-rw-r--r--sql/updates/world/3.3.5/2016_07_19_02_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_07_19_03_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_07_19_04_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_19_05_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_19_06_world.sql15
-rw-r--r--sql/updates/world/3.3.5/2016_07_19_07_world.sql79
-rw-r--r--sql/updates/world/3.3.5/2016_07_20_00_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_20_01_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_07_20_02_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_07_22_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_07_25_00_world.sql15
-rw-r--r--sql/updates/world/3.3.5/2016_07_28_00_world.sql53
-rw-r--r--sql/updates/world/3.3.5/2016_07_29_00_world.sql59
-rw-r--r--sql/updates/world/3.3.5/2016_07_30_00_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_07_30_01_world.sql767
-rw-r--r--sql/updates/world/3.3.5/2016_07_31_00_world_335.sql47
-rw-r--r--sql/updates/world/3.3.5/2016_07_31_01_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_08_01_01_world.sql88
-rw-r--r--sql/updates/world/3.3.5/2016_08_02_00_world.sql82
-rw-r--r--sql/updates/world/3.3.5/2016_08_03_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_08_03_01_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_08_03_02_world.sql303
-rw-r--r--sql/updates/world/3.3.5/2016_08_04_00_world_335.sql63
-rw-r--r--sql/updates/world/3.3.5/2016_08_04_01_world.sql (renamed from sql/updates/world/2016_02_12_13_world_335.sql)0
-rw-r--r--sql/updates/world/3.3.5/dummy0
-rw-r--r--src/common/CMakeLists.txt115
-rw-r--r--src/common/Collision/BoundingIntervalHierarchy.h6
-rw-r--r--src/common/Collision/DynamicTree.cpp2
-rw-r--r--src/common/Collision/DynamicTree.h2
-rw-r--r--src/common/Collision/Management/IVMapManager.h2
-rw-r--r--src/common/Collision/Management/MMapFactory.h3
-rw-r--r--src/common/Collision/Management/MMapManager.cpp51
-rw-r--r--src/common/Collision/Management/MMapManager.h11
-rw-r--r--src/common/Collision/Management/VMapFactory.h2
-rw-r--r--src/common/Collision/Management/VMapManager2.h4
-rw-r--r--src/common/Collision/Maps/MapDefines.h2
-rw-r--r--src/common/Collision/Maps/MapTree.cpp5
-rw-r--r--src/common/Collision/Maps/MapTree.h8
-rw-r--r--src/common/Collision/Maps/TileAssembler.cpp26
-rw-r--r--src/common/Collision/Maps/TileAssembler.h10
-rw-r--r--src/common/Collision/Models/GameObjectModel.h6
-rw-r--r--src/common/Collision/Models/ModelInstance.h4
-rw-r--r--src/common/Collision/Models/WorldModel.h8
-rw-r--r--src/common/Collision/RegularGrid.h4
-rw-r--r--src/common/Common.h43
-rw-r--r--src/common/Configuration/BuiltInConfig.cpp52
-rw-r--r--src/common/Configuration/BuiltInConfig.h43
-rw-r--r--src/common/Configuration/Config.cpp76
-rw-r--r--src/common/Configuration/Config.h34
-rw-r--r--src/common/Cryptography/ARC4.cpp4
-rw-r--r--src/common/Cryptography/ARC4.h6
-rw-r--r--src/common/Cryptography/Authentication/AuthCrypt.h2
-rw-r--r--src/common/Cryptography/BigNumber.cpp21
-rw-r--r--src/common/Cryptography/BigNumber.h10
-rw-r--r--src/common/Cryptography/HMACSHA1.h2
-rw-r--r--src/common/Cryptography/OpenSSLCrypto.h8
-rw-r--r--src/common/Cryptography/SHA1.cpp8
-rw-r--r--src/common/Cryptography/SHA1.h7
-rw-r--r--src/common/Debugging/Errors.cpp7
-rw-r--r--src/common/Debugging/Errors.h14
-rw-r--r--src/common/Debugging/WheatyExceptionReport.cpp19
-rw-r--r--src/common/Debugging/WheatyExceptionReport.h4
-rw-r--r--src/common/Define.h39
-rw-r--r--src/common/GitRevision.cpp52
-rw-r--r--src/common/GitRevision.h27
-rw-r--r--src/common/Logging/Appender.h8
-rw-r--r--src/common/Logging/AppenderConsole.h2
-rw-r--r--src/common/Logging/AppenderFile.h2
-rw-r--r--src/common/Logging/Log.cpp25
-rw-r--r--src/common/Logging/Log.h9
-rw-r--r--src/common/Logging/LogOperation.h3
-rw-r--r--src/common/Logging/Logger.h2
-rw-r--r--src/common/Metric/Metric.cpp235
-rw-r--r--src/common/Metric/Metric.h141
-rw-r--r--src/common/Platform/ServiceWin32.cpp (renamed from src/server/shared/Service/ServiceWin32.cpp)1
-rw-r--r--src/common/Platform/ServiceWin32.h (renamed from src/server/shared/Service/ServiceWin32.h)1
-rw-r--r--src/common/Threading/LockedQueue.h8
-rw-r--r--src/common/Threading/MPSCQueue.h83
-rw-r--r--src/common/Utilities/Containers.h23
-rw-r--r--src/common/Utilities/EventMap.h14
-rw-r--r--src/common/Utilities/EventProcessor.cpp80
-rw-r--r--src/common/Utilities/EventProcessor.h40
-rw-r--r--src/common/Utilities/MessageBuffer.h (renamed from src/server/shared/Networking/MessageBuffer.h)3
-rw-r--r--src/common/Utilities/Random.cpp8
-rw-r--r--src/common/Utilities/Random.h20
-rw-r--r--src/common/Utilities/StartProcess.cpp269
-rw-r--r--src/common/Utilities/StartProcess.h67
-rw-r--r--src/common/Utilities/StringFormat.h2
-rw-r--r--src/common/Utilities/TaskScheduler.h8
-rw-r--r--src/common/Utilities/Timer.h4
-rw-r--r--src/common/Utilities/Util.cpp76
-rw-r--r--src/common/Utilities/Util.h49
-rw-r--r--src/genrev/CMakeLists.txt5
-rw-r--r--src/server/CMakeLists.txt15
-rw-r--r--src/server/authserver/CMakeLists.txt95
-rw-r--r--src/server/authserver/Main.cpp46
-rw-r--r--src/server/authserver/Realms/RealmList.h97
-rw-r--r--src/server/authserver/Server/AuthSession.cpp768
-rw-r--r--src/server/authserver/Server/AuthSession.h60
-rw-r--r--src/server/authserver/Server/AuthSocketMgr.h19
-rw-r--r--src/server/authserver/authserver.conf.dist55
-rw-r--r--src/server/database/CMakeLists.txt90
-rw-r--r--src/server/database/Database/AdhocStatement.h2
-rw-r--r--src/server/database/Database/DatabaseEnv.cpp22
-rw-r--r--src/server/database/Database/DatabaseEnv.h10
-rw-r--r--src/server/database/Database/DatabaseLoader.cpp79
-rw-r--r--src/server/database/Database/DatabaseLoader.h17
-rw-r--r--src/server/database/Database/DatabaseWorker.h2
-rw-r--r--src/server/database/Database/DatabaseWorkerPool.cpp322
-rw-r--r--src/server/database/Database/DatabaseWorkerPool.h319
-rw-r--r--src/server/database/Database/Field.h4
-rw-r--r--src/server/database/Database/Implementation/CharacterDatabase.cpp19
-rw-r--r--src/server/database/Database/Implementation/CharacterDatabase.h7
-rw-r--r--src/server/database/Database/Implementation/LoginDatabase.cpp15
-rw-r--r--src/server/database/Database/Implementation/LoginDatabase.h9
-rw-r--r--src/server/database/Database/Implementation/WorldDatabase.cpp4
-rw-r--r--src/server/database/Database/Implementation/WorldDatabase.h2
-rw-r--r--src/server/database/Database/MySQLConnection.cpp87
-rw-r--r--src/server/database/Database/MySQLConnection.h12
-rw-r--r--src/server/database/Database/MySQLThreading.h2
-rw-r--r--src/server/database/Database/PreparedStatement.cpp2
-rw-r--r--src/server/database/Database/PreparedStatement.h6
-rw-r--r--src/server/database/Database/QueryCallback.h (renamed from src/common/Threading/Callback.h)6
-rw-r--r--src/server/database/Database/QueryHolder.h4
-rw-r--r--src/server/database/Database/QueryResult.cpp2
-rw-r--r--src/server/database/Database/QueryResult.h4
-rw-r--r--src/server/database/Database/SQLOperation.h2
-rw-r--r--src/server/database/Database/Transaction.h4
-rw-r--r--src/server/database/Logging/AppenderDB.h2
-rw-r--r--src/server/database/Updater/DBUpdater.cpp124
-rw-r--r--src/server/database/Updater/DBUpdater.h10
-rw-r--r--src/server/database/Updater/UpdateFetcher.cpp47
-rw-r--r--src/server/database/Updater/UpdateFetcher.h9
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.cpp2
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.h12
-rw-r--r--src/server/game/AI/CoreAI/GameObjectAI.h4
-rw-r--r--src/server/game/AI/CoreAI/GuardAI.h2
-rw-r--r--src/server/game/AI/CoreAI/PassiveAI.cpp6
-rw-r--r--src/server/game/AI/CoreAI/PassiveAI.h12
-rw-r--r--src/server/game/AI/CoreAI/PetAI.cpp39
-rw-r--r--src/server/game/AI/CoreAI/PetAI.h4
-rw-r--r--src/server/game/AI/CoreAI/ReactorAI.h2
-rw-r--r--src/server/game/AI/CoreAI/TotemAI.h2
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.cpp95
-rw-r--r--src/server/game/AI/CoreAI/UnitAI.h52
-rw-r--r--src/server/game/AI/CreatureAI.cpp43
-rw-r--r--src/server/game/AI/CreatureAI.h17
-rw-r--r--src/server/game/AI/CreatureAISelector.h6
-rw-r--r--src/server/game/AI/PlayerAI/PlayerAI.cpp1367
-rw-r--r--src/server/game/AI/PlayerAI/PlayerAI.h118
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp63
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.h27
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.h2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h2
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp18
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h8
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp118
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp37
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h33
-rw-r--r--src/server/game/Accounts/AccountMgr.cpp102
-rw-r--r--src/server/game/Accounts/AccountMgr.h14
-rw-r--r--src/server/game/Accounts/RBAC.cpp6
-rw-r--r--src/server/game/Accounts/RBAC.h23
-rw-r--r--src/server/game/Achievements/AchievementMgr.cpp141
-rw-r--r--src/server/game/Achievements/AchievementMgr.h12
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.cpp8
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.h12
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBot.cpp12
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBot.h16
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp2
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.h2
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp41
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h4
-rw-r--r--src/server/game/Battlefield/Battlefield.cpp25
-rw-r--r--src/server/game/Battlefield/Battlefield.h6
-rw-r--r--src/server/game/Battlefield/BattlefieldMgr.cpp6
-rw-r--r--src/server/game/Battlefield/BattlefieldMgr.h8
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.h6
-rw-r--r--src/server/game/Battlegrounds/Arena.h2
-rw-r--r--src/server/game/Battlegrounds/ArenaScore.h4
-rw-r--r--src/server/game/Battlegrounds/ArenaTeam.h4
-rw-r--r--src/server/game/Battlegrounds/ArenaTeamMgr.cpp8
-rw-r--r--src/server/game/Battlegrounds/ArenaTeamMgr.h8
-rw-r--r--src/server/game/Battlegrounds/Battleground.cpp19
-rw-r--r--src/server/game/Battlegrounds/Battleground.h2
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp22
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.h8
-rw-r--r--src/server/game/Battlegrounds/BattlegroundQueue.cpp10
-rw-r--r--src/server/game/Battlegrounds/BattlegroundQueue.h6
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp22
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp6
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp4
-rw-r--r--src/server/game/CMakeLists.txt250
-rw-r--r--src/server/game/Calendar/CalendarMgr.cpp6
-rw-r--r--src/server/game/Calendar/CalendarMgr.h12
-rw-r--r--src/server/game/Chat/Channels/Channel.cpp296
-rw-r--r--src/server/game/Chat/Channels/Channel.h196
-rw-r--r--src/server/game/Chat/Channels/ChannelMgr.cpp8
-rw-r--r--src/server/game/Chat/Channels/ChannelMgr.h2
-rw-r--r--src/server/game/Chat/Chat.cpp146
-rw-r--r--src/server/game/Chat/Chat.h40
-rw-r--r--src/server/game/Chat/ChatLink.cpp26
-rw-r--r--src/server/game/Chat/ChatLink.h38
-rw-r--r--src/server/game/Combat/HostileRefManager.h2
-rw-r--r--src/server/game/Combat/ThreatManager.cpp5
-rw-r--r--src/server/game/Combat/ThreatManager.h10
-rw-r--r--src/server/game/Combat/UnitEvents.h2
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp80
-rw-r--r--src/server/game/Conditions/ConditionMgr.h22
-rw-r--r--src/server/game/Conditions/DisableMgr.h10
-rw-r--r--src/server/game/DataStores/DBCEnums.h16
-rw-r--r--src/server/game/DataStores/DBCStores.cpp35
-rw-r--r--src/server/game/DataStores/DBCStores.h289
-rw-r--r--src/server/game/DataStores/DBCStructure.h16
-rw-r--r--src/server/game/DataStores/DBCfmt.h3
-rw-r--r--src/server/game/DataStores/M2Stores.cpp266
-rw-r--r--src/server/game/DataStores/M2Stores.h36
-rw-r--r--src/server/game/DataStores/M2Structure.h133
-rw-r--r--src/server/game/DungeonFinding/LFG.h6
-rw-r--r--src/server/game/DungeonFinding/LFGGroupData.h2
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp30
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.h8
-rw-r--r--src/server/game/DungeonFinding/LFGPlayerData.h2
-rw-r--r--src/server/game/DungeonFinding/LFGQueue.cpp12
-rw-r--r--src/server/game/DungeonFinding/LFGQueue.h5
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.cpp6
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.h6
-rw-r--r--src/server/game/Entities/Corpse/Corpse.cpp2
-rw-r--r--src/server/game/Entities/Corpse/Corpse.h2
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp232
-rw-r--r--src/server/game/Entities/Creature/Creature.h66
-rw-r--r--src/server/game/Entities/Creature/CreatureGroups.cpp6
-rw-r--r--src/server/game/Entities/Creature/CreatureGroups.h10
-rw-r--r--src/server/game/Entities/Creature/GossipDef.h6
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.cpp5
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.h11
-rw-r--r--src/server/game/Entities/DynamicObject/DynamicObject.h2
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp171
-rw-r--r--src/server/game/Entities/GameObject/GameObject.h68
-rw-r--r--src/server/game/Entities/Item/Container/Bag.h4
-rw-r--r--src/server/game/Entities/Item/Item.cpp37
-rw-r--r--src/server/game/Entities/Item/Item.h4
-rw-r--r--src/server/game/Entities/Item/ItemEnchantmentMgr.h7
-rw-r--r--src/server/game/Entities/Item/ItemTemplate.cpp124
-rw-r--r--src/server/game/Entities/Item/ItemTemplate.h (renamed from src/server/game/Entities/Item/ItemPrototype.h)94
-rw-r--r--src/server/game/Entities/Object/Object.cpp108
-rw-r--r--src/server/game/Entities/Object/Object.h31
-rw-r--r--src/server/game/Entities/Object/ObjectGuid.cpp17
-rw-r--r--src/server/game/Entities/Object/ObjectGuid.h19
-rw-r--r--src/server/game/Entities/Object/ObjectPosSelector.h2
-rw-r--r--src/server/game/Entities/Object/Position.h14
-rw-r--r--src/server/game/Entities/Object/Updates/UpdateFieldFlags.h10
-rw-r--r--src/server/game/Entities/Pet/Pet.cpp16
-rw-r--r--src/server/game/Entities/Pet/Pet.h2
-rw-r--r--src/server/game/Entities/Player/CinematicMgr.cpp174
-rw-r--r--src/server/game/Entities/Player/CinematicMgr.h60
-rw-r--r--src/server/game/Entities/Player/KillRewarder.h2
-rw-r--r--src/server/game/Entities/Player/Player.cpp2232
-rw-r--r--src/server/game/Entities/Player/Player.h461
-rw-r--r--src/server/game/Entities/Player/SocialMgr.cpp6
-rw-r--r--src/server/game/Entities/Player/SocialMgr.h8
-rw-r--r--src/server/game/Entities/Player/TradeData.h2
-rw-r--r--src/server/game/Entities/Totem/Totem.h2
-rw-r--r--src/server/game/Entities/Transport/Transport.cpp3
-rw-r--r--src/server/game/Entities/Transport/Transport.h2
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp4
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp1256
-rw-r--r--src/server/game/Entities/Unit/Unit.h119
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.cpp18
-rw-r--r--src/server/game/Entities/Vehicle/Vehicle.h4
-rw-r--r--src/server/game/Events/GameEventMgr.cpp106
-rw-r--r--src/server/game/Events/GameEventMgr.h12
-rw-r--r--src/server/game/Globals/ObjectAccessor.cpp63
-rw-r--r--src/server/game/Globals/ObjectAccessor.h83
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp303
-rw-r--r--src/server/game/Globals/ObjectMgr.h31
-rw-r--r--src/server/game/Grids/GridReference.h6
-rw-r--r--src/server/game/Grids/GridStates.h10
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.cpp2
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h23
-rw-r--r--src/server/game/Grids/ObjectGridLoader.h6
-rw-r--r--src/server/game/Groups/Group.h2
-rw-r--r--src/server/game/Groups/GroupMgr.cpp6
-rw-r--r--src/server/game/Groups/GroupMgr.h8
-rw-r--r--src/server/game/Groups/GroupReference.h2
-rw-r--r--src/server/game/Guilds/Guild.cpp10
-rw-r--r--src/server/game/Guilds/Guild.h4
-rw-r--r--src/server/game/Guilds/GuildMgr.cpp6
-rw-r--r--src/server/game/Guilds/GuildMgr.h8
-rw-r--r--src/server/game/Handlers/AddonHandler.cpp6
-rw-r--r--src/server/game/Handlers/AddonHandler.h6
-rw-r--r--src/server/game/Handlers/BattleGroundHandler.cpp2
-rw-r--r--src/server/game/Handlers/CalendarHandler.cpp2
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp88
-rw-r--r--src/server/game/Handlers/ChatHandler.cpp72
-rw-r--r--src/server/game/Handlers/GroupHandler.cpp33
-rw-r--r--src/server/game/Handlers/GuildHandler.cpp4
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp2
-rw-r--r--src/server/game/Handlers/LootHandler.cpp9
-rw-r--r--src/server/game/Handlers/MailHandler.cpp6
-rw-r--r--src/server/game/Handlers/MiscHandler.cpp42
-rw-r--r--src/server/game/Handlers/MovementHandler.cpp2
-rw-r--r--src/server/game/Handlers/NPCHandler.cpp24
-rw-r--r--src/server/game/Handlers/PetHandler.cpp2
-rw-r--r--src/server/game/Handlers/QueryHandler.cpp4
-rw-r--r--src/server/game/Handlers/QuestHandler.cpp42
-rw-r--r--src/server/game/Handlers/SpellHandler.cpp12
-rw-r--r--src/server/game/Instances/InstanceSaveMgr.cpp8
-rw-r--r--src/server/game/Instances/InstanceSaveMgr.h10
-rw-r--r--src/server/game/Instances/InstanceScript.cpp14
-rw-r--r--src/server/game/Instances/InstanceScript.h12
-rw-r--r--src/server/game/Loot/LootMgr.cpp38
-rw-r--r--src/server/game/Loot/LootMgr.h86
-rw-r--r--src/server/game/Mails/Mail.cpp11
-rw-r--r--src/server/game/Mails/Mail.h9
-rw-r--r--src/server/game/Maps/AreaBoundary.h16
-rw-r--r--src/server/game/Maps/Map.cpp62
-rw-r--r--src/server/game/Maps/Map.h15
-rw-r--r--src/server/game/Maps/MapInstanced.cpp3
-rw-r--r--src/server/game/Maps/MapInstanced.h2
-rw-r--r--src/server/game/Maps/MapManager.cpp8
-rw-r--r--src/server/game/Maps/MapManager.h16
-rw-r--r--src/server/game/Maps/MapScripts.cpp (renamed from src/server/game/Scripting/MapScripts.cpp)7
-rw-r--r--src/server/game/Maps/MapUpdater.h2
-rw-r--r--src/server/game/Maps/TransportMgr.cpp6
-rw-r--r--src/server/game/Maps/TransportMgr.h12
-rw-r--r--src/server/game/Miscellaneous/Language.h18
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h76
-rw-r--r--src/server/game/Movement/MotionMaster.cpp87
-rw-r--r--src/server/game/Movement/MotionMaster.h8
-rwxr-xr-xsrc/server/game/Movement/MovementGenerator.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp5
-rw-r--r--src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp6
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/IdleMovementGenerator.h2
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp15
-rw-r--r--src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp38
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp6
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h2
-rw-r--r--src/server/game/Movement/PathGenerator.cpp8
-rw-r--r--src/server/game/Movement/PathGenerator.h3
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.cpp2
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.h2
-rw-r--r--src/server/game/Movement/Spline/MoveSplineInit.h4
-rw-r--r--src/server/game/Movement/Spline/MovementTypedefs.h4
-rw-r--r--src/server/game/Movement/Waypoints/WaypointManager.cpp6
-rw-r--r--src/server/game/Movement/Waypoints/WaypointManager.h8
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvP.cpp15
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvP.h4
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp12
-rw-r--r--src/server/game/OutdoorPvP/OutdoorPvPMgr.h8
-rw-r--r--src/server/game/Pools/PoolMgr.cpp11
-rw-r--r--src/server/game/Pools/PoolMgr.h12
-rw-r--r--src/server/game/Quests/QuestDef.cpp36
-rw-r--r--src/server/game/Quests/QuestDef.h9
-rw-r--r--src/server/game/Reputation/ReputationMgr.h2
-rw-r--r--src/server/game/Scripting/ScriptLoader.cpp1421
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp1217
-rw-r--r--src/server/game/Scripting/ScriptMgr.h153
-rw-r--r--src/server/game/Scripting/ScriptReloadMgr.cpp1641
-rw-r--r--src/server/game/Scripting/ScriptReloadMgr.h81
-rw-r--r--src/server/game/Scripting/ScriptSystem.cpp8
-rw-r--r--src/server/game/Scripting/ScriptSystem.h8
-rw-r--r--src/server/game/Server/Protocol/Opcodes.h2
-rw-r--r--src/server/game/Server/Protocol/PacketLog.cpp10
-rw-r--r--src/server/game/Server/Protocol/PacketLog.h8
-rw-r--r--src/server/game/Server/WorldSession.cpp236
-rw-r--r--src/server/game/Server/WorldSession.h4
-rw-r--r--src/server/game/Server/WorldSocket.cpp134
-rw-r--r--src/server/game/Server/WorldSocket.h7
-rw-r--r--src/server/game/Server/WorldSocketMgr.cpp22
-rw-r--r--src/server/game/Server/WorldSocketMgr.h12
-rw-r--r--src/server/game/Skills/SkillDiscovery.cpp16
-rw-r--r--src/server/game/Skills/SkillDiscovery.h9
-rw-r--r--src/server/game/Skills/SkillExtraItems.cpp18
-rw-r--r--src/server/game/Skills/SkillExtraItems.h10
-rw-r--r--src/server/game/Spells/Auras/SpellAuraDefines.h4
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp81
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp34
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.h22
-rw-r--r--src/server/game/Spells/Spell.cpp306
-rw-r--r--src/server/game/Spells/Spell.h28
-rw-r--r--src/server/game/Spells/SpellEffects.cpp153
-rw-r--r--src/server/game/Spells/SpellHistory.cpp10
-rw-r--r--src/server/game/Spells/SpellHistory.h2
-rw-r--r--src/server/game/Spells/SpellInfo.cpp23
-rw-r--r--src/server/game/Spells/SpellInfo.h7
-rw-r--r--src/server/game/Spells/SpellMgr.cpp316
-rw-r--r--src/server/game/Spells/SpellMgr.h50
-rw-r--r--src/server/game/Spells/SpellScript.cpp7
-rw-r--r--src/server/game/Spells/SpellScript.h71
-rw-r--r--src/server/game/Texts/CreatureTextMgr.cpp6
-rw-r--r--src/server/game/Texts/CreatureTextMgr.h8
-rw-r--r--src/server/game/Tickets/TicketMgr.cpp6
-rw-r--r--src/server/game/Tickets/TicketMgr.h10
-rw-r--r--src/server/game/Tools/CharacterDatabaseCleaner.h22
-rw-r--r--src/server/game/Tools/PlayerDump.cpp10
-rw-r--r--src/server/game/Tools/PlayerDump.h6
-rw-r--r--src/server/game/Warden/Warden.h2
-rw-r--r--src/server/game/Warden/WardenCheckMgr.cpp6
-rw-r--r--src/server/game/Warden/WardenCheckMgr.h8
-rw-r--r--src/server/game/Warden/WardenMac.h2
-rw-r--r--src/server/game/Warden/WardenWin.h2
-rw-r--r--src/server/game/Weather/Weather.cpp2
-rw-r--r--src/server/game/Weather/Weather.h2
-rw-r--r--src/server/game/Weather/WeatherMgr.h12
-rw-r--r--src/server/game/World/World.cpp128
-rw-r--r--src/server/game/World/World.h49
-rw-r--r--src/server/scripts/CMakeLists.txt338
-rw-r--r--src/server/scripts/Commands/cs_account.cpp62
-rw-r--r--src/server/scripts/Commands/cs_ahbot.cpp2
-rw-r--r--src/server/scripts/Commands/cs_ban.cpp6
-rw-r--r--src/server/scripts/Commands/cs_character.cpp16
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp82
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp2
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp41
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp2
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp38
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp460
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp121
-rw-r--r--src/server/scripts/Commands/cs_pet.cpp63
-rw-r--r--src/server/scripts/Commands/cs_rbac.cpp6
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp12
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp2
-rw-r--r--src/server/scripts/Commands/cs_script_loader.cpp104
-rw-r--r--src/server/scripts/Commands/cs_send.cpp10
-rw-r--r--src/server/scripts/Commands/cs_server.cpp79
-rw-r--r--src/server/scripts/Commands/cs_ticket.cpp13
-rw-r--r--src/server/scripts/Commands/cs_titles.cpp2
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp102
-rw-r--r--src/server/scripts/Custom/custom_script_loader.cpp25
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp170
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp11
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp34
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp45
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/CMakeLists.txt204
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp111
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/deadmines.h13
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp45
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp17
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp472
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp87
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp341
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/karazhan.h59
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp34
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp42
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp833
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h3
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp14
-rw-r--r--src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp8
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp137
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp116
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp9
-rw-r--r--src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp368
-rw-r--r--src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp87
-rw-r--r--src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp57
-rw-r--r--src/server/scripts/EasternKingdoms/zone_loch_modan.cpp106
-rw-r--r--src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp114
-rw-r--r--src/server/scripts/Events/childrens_week.cpp19
-rw-r--r--src/server/scripts/Events/events_script_loader.cpp26
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CMakeLists.txt121
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp12
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h18
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h6
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp16
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp46
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp52
-rw-r--r--src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp37
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp6
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp6
-rw-r--r--src/server/scripts/Kalimdor/kalimdor_script_loader.cpp208
-rw-r--r--src/server/scripts/Kalimdor/zone_azshara.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp24
-rw-r--r--src/server/scripts/Kalimdor/zone_desolace.cpp31
-rw-r--r--src/server/scripts/Kalimdor/zone_durotar.cpp4
-rw-r--r--src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp45
-rw-r--r--src/server/scripts/Kalimdor/zone_felwood.cpp73
-rw-r--r--src/server/scripts/Kalimdor/zone_feralas.cpp62
-rw-r--r--src/server/scripts/Kalimdor/zone_moonglade.cpp131
-rw-r--r--src/server/scripts/Kalimdor/zone_orgrimmar.cpp616
-rw-r--r--src/server/scripts/Kalimdor/zone_silithus.cpp717
-rw-r--r--src/server/scripts/Kalimdor/zone_tanaris.cpp116
-rw-r--r--src/server/scripts/Kalimdor/zone_the_barrens.cpp45
-rw-r--r--src/server/scripts/Kalimdor/zone_thousand_needles.cpp184
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp9
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp4
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp2
-rw-r--r--src/server/scripts/Northrend/CMakeLists.txt199
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp580
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp16
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp51
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h1
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp6
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp12
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp34
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp74
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp217
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp16
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp94
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h6
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp6
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp12
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp30
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp6
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp20
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp134
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp64
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp6
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp2
-rw-r--r--src/server/scripts/Northrend/IsleOfConquest/boss_ioc_horde_alliance.cpp132
-rw-r--r--src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp (renamed from src/server/scripts/Northrend/isle_of_conquest.cpp)55
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp29
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp18
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp42
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp431
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp42
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp14
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp104
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp6
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp94
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp22
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_noth.cpp40
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp12
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp22
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp501
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp132
-rw-r--r--src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp173
-rw-r--r--src/server/scripts/Northrend/Naxxramas/naxxramas.h22
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp33
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp10
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp1
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp38
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp24
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp24
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp16
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp17
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp6
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp4
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp1
-rw-r--r--src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp2
-rw-r--r--src/server/scripts/Northrend/northrend_script_loader.cpp376
-rw-r--r--src/server/scripts/Northrend/zone_borean_tundra.cpp7
-rw-r--r--src/server/scripts/Northrend/zone_dragonblight.cpp4
-rw-r--r--src/server/scripts/Northrend/zone_grizzly_hills.cpp260
-rw-r--r--src/server/scripts/Northrend/zone_icecrown.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_sholazar_basin.cpp6
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp10
-rw-r--r--src/server/scripts/OutdoorPvP/CMakeLists.txt27
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPHP.h18
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPNA.h14
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp4
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPSI.h18
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPScriptLoader.cpp36
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPTF.h18
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPZM.h18
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp16
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp528
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp4
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp17
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp1211
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_supremus.cpp4
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp32
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/illidari_council.cpp15
-rw-r--r--src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp15
-rw-r--r--src/server/scripts/Outland/CMakeLists.txt128
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp4
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp1046
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp120
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h38
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp19
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp6
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp7
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp151
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp12
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp146
-rw-r--r--src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp4
-rw-r--r--src/server/scripts/Outland/outland_script_loader.cpp258
-rw-r--r--src/server/scripts/Outland/zone_blades_edge_mountains.cpp2
-rw-r--r--src/server/scripts/Outland/zone_hellfire_peninsula.cpp8
-rw-r--r--src/server/scripts/Outland/zone_netherstorm.cpp53
-rw-r--r--src/server/scripts/Outland/zone_shadowmoon_valley.cpp125
-rw-r--r--src/server/scripts/Outland/zone_shattrath_city.cpp201
-rw-r--r--src/server/scripts/Outland/zone_terokkar_forest.cpp221
-rw-r--r--src/server/scripts/Pet/CMakeLists.txt21
-rw-r--r--src/server/scripts/Pet/pet_dk.cpp4
-rw-r--r--src/server/scripts/Pet/pet_generic.cpp232
-rw-r--r--src/server/scripts/Pet/pet_script_loader.cpp36
-rw-r--r--src/server/scripts/ScriptLoader.cpp.in.cmake64
-rw-r--r--src/server/scripts/ScriptLoader.h (renamed from src/server/game/Scripting/ScriptLoader.h)12
-rw-r--r--src/server/scripts/ScriptPCH.cpp (renamed from src/server/scripts/PrecompiledHeaders/ScriptPCH.cpp)0
-rw-r--r--src/server/scripts/ScriptPCH.h (renamed from src/server/scripts/PrecompiledHeaders/ScriptPCH.h)0
-rw-r--r--src/server/scripts/Spells/CMakeLists.txt30
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp296
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp263
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp97
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp335
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp224
-rw-r--r--src/server/scripts/Spells/spell_item.cpp507
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp42
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp59
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp6
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp48
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp44
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp40
-rw-r--r--src/server/scripts/Spells/spell_script_loader.cpp52
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp109
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp102
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp2
-rw-r--r--src/server/scripts/World/boss_emerald_dragons.cpp2
-rw-r--r--src/server/scripts/World/duel_reset.cpp16
-rw-r--r--src/server/scripts/World/go_scripts.cpp28
-rw-r--r--src/server/scripts/World/item_scripts.cpp16
-rw-r--r--src/server/scripts/World/npcs_special.cpp570
-rw-r--r--src/server/scripts/World/world_script_loader.cpp59
-rw-r--r--src/server/shared/CMakeLists.txt90
-rw-r--r--src/server/shared/DataStores/DBCFileLoader.h2
-rw-r--r--src/server/shared/Networking/AsyncAcceptor.h41
-rw-r--r--src/server/shared/Networking/NetworkThread.h84
-rw-r--r--src/server/shared/Networking/Socket.h103
-rw-r--r--src/server/shared/Networking/SocketMgr.h49
-rw-r--r--src/server/shared/Packets/ByteBuffer.h29
-rw-r--r--src/server/shared/Realm/Realm.cpp53
-rw-r--r--src/server/shared/Realm/Realm.h87
-rw-r--r--src/server/shared/Realm/RealmList.cpp (renamed from src/server/authserver/Realms/RealmList.cpp)128
-rw-r--r--src/server/shared/Realm/RealmList.h61
-rw-r--r--src/server/worldserver/CMakeLists.txt157
-rw-r--r--src/server/worldserver/Main.cpp130
-rw-r--r--src/server/worldserver/RemoteAccess/RASession.cpp6
-rw-r--r--src/server/worldserver/worldserver.conf.dist329
-rw-r--r--src/tools/map_extractor/CMakeLists.txt57
-rw-r--r--src/tools/map_extractor/System.cpp74
-rw-r--r--src/tools/mmaps_generator/CMakeLists.txt62
-rw-r--r--src/tools/mmaps_generator/MapBuilder.cpp4
-rw-r--r--src/tools/vmap4_assembler/CMakeLists.txt20
-rw-r--r--src/tools/vmap4_extractor/CMakeLists.txt36
1448 files changed, 68312 insertions, 21388 deletions
diff --git a/.gitignore b/.gitignore
index 9378a13bf11..48fa31fa9d2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@ CMakeLists.txt.user
*.BASE.*
*.LOCAL.*
nbproject/*
+.idea/*
diff --git a/.travis.yml b/.travis.yml
index 23c378a1169..583318ef1fa 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,6 @@
+sudo: required
+dist: trusty
+
language: cpp
compiler:
- clang
@@ -6,34 +9,33 @@ git:
depth: 1
before_install:
- - echo "yes" | sudo add-apt-repository ppa:kalakris/cmake
- - echo "yes" | sudo add-apt-repository ppa:boost-latest/ppa
- - echo "yes" | sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- - echo "yes" | sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main'
- - wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
- - sudo apt-get -qq update
- - sudo apt-get -qq install build-essential libtool gcc-4.8 g++-4.8 make cmake openssl clang-3.5
+ - sudo apt-get -qq install build-essential libtool make cmake cmake-data openssl
- sudo apt-get -qq install libssl-dev libmysqlclient-dev libmysql++-dev libreadline6-dev zlib1g-dev libbz2-dev
- sudo apt-get -qq install libboost1.55-dev libboost-thread1.55-dev libboost-filesystem1.55-dev libboost-system1.55-dev libboost-program-options1.55-dev libboost-iostreams1.55-dev
- - export CC=clang-3.5 CXX=clang++-3.5
+ - sudo apt-get -qq install mysql-server
+ - git config user.email "travis@build.bot" && git config user.name "Travis CI"
+ - git tag -a -m "Travis build" init
install:
- mysql -uroot -e 'create database test_mysql;'
- mkdir bin
- cd bin
- - cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=1 -DSERVERS=1 -DNOJEM=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"
+ - cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS="dynamic" -DSERVERS=1 -DNOJEM=1 -DWITH_DYNAMIC_LINKING=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_INSTALL_PREFIX=check_install
- cd ..
- - sudo chmod +x contrib/check_updates.sh
+ - chmod +x contrib/check_updates.sh
script:
- $CXX --version
- mysql -uroot < sql/create/create_mysql.sql
- mysql -utrinity -ptrinity auth < sql/base/auth_database.sql
- - ./contrib/check_updates.sh auth auth
+ - ./contrib/check_updates.sh auth 3.3.5 auth
- mysql -utrinity -ptrinity characters < sql/base/characters_database.sql
- - ./contrib/check_updates.sh characters characters
+ - ./contrib/check_updates.sh characters 3.3.5 characters
- mysql -utrinity -ptrinity world < sql/base/dev/world_database.sql
- cat sql/updates/world/*.sql | mysql -utrinity -ptrinity world
- mysql -uroot < sql/create/drop_mysql.sql
- cd bin
- - make -j 10 -k
+ - make -j 8 -k && make install
+ - cd check_install/bin
+ - ./authserver --version
+ - ./worldserver --version
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5eeb5911ca9..de08fe3181f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,15 +8,21 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# We require CMake >= 3.0
+cmake_minimum_required(VERSION 3.0)
+
# Set projectname (must be done AFTER setting configurationtypes)
project(TrinityCore)
# CMake policies (can not be handled elsewhere)
-cmake_minimum_required(VERSION 2.8.9)
cmake_policy(SET CMP0005 OLD)
if(POLICY CMP0043)
cmake_policy(SET CMP0043 OLD) # Disable 'Ignore COMPILE_DEFINITIONS_<Config> properties'
-endif(POLICY CMP0043)
+endif()
+
+if(POLICY CMP0054)
+ cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted - prevents intepreting if (SOME_STRING_VARIABLE MATCHES "MSVC") as if (SOME_STRING_VARIABLE MATCHES "1")
+endif()
# add this options before PROJECT keyword
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
@@ -38,6 +44,7 @@ endif()
include(CheckCXXSourceRuns)
include(CheckIncludeFiles)
+include(ConfigureScripts)
# set default buildoptions and print them
include(cmake/options.cmake)
@@ -51,23 +58,11 @@ endif()
include(CheckPlatform)
include(GroupSources)
-
-# basic packagesearching and setup (further support will be needed, this is a preliminary release!)
-set(OPENSSL_EXPECTED_VERSION 1.0.0)
+include(AutoCollect)
find_package(PCHSupport)
-find_package(OpenSSL REQUIRED)
-find_package(Threads REQUIRED)
find_package(MySQL)
-include(ConfigureBoost)
-
-if( UNIX )
- find_package(Readline)
- find_package(ZLIB)
- find_package(BZip2)
-endif()
-
if(NOT WITHOUT_GIT)
find_package(Git)
endif()
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4baa1197965..e7bd9263a70 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -8,7 +8,7 @@ Issues
======
Read [this](http://www.trinitycore.org/f/topic/37-the-trinitycore-issuetracker-and-you/) before creating a ticket.
-If you have problems with TrinityCore instalation, read [this](http://www.trinitycore.org/f/topic/1518-trouble-with-your-trinity-install-readme-1st-faqs/)
+If you have problems with TrinityCore installation, read [this](http://www.trinitycore.org/f/topic/1518-trouble-with-your-trinity-install-readme-1st-faqs/).
Mandatory things when creating a ticket:
========================================
diff --git a/README.md b/README.md
index 066249f0628..d8fd3e323c7 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# ![logo](http://www.trinitycore.org/f/public/style_images/1_trinitycore.png) TrinityCore
+# ![logo](https://community.trinitycore.org/public/style_images/1_trinitycore.png) TrinityCore
[![Issue Stats](http://www.issuestats.com/github/TrinityCore/TrinityCore/badge/issue)](http://www.issuestats.com/github/TrinityCore/TrinityCore) [![Issue Stats](http://www.issuestats.com/github/TrinityCore/TrinityCore/badge/pr)](http://www.issuestats.com/github/TrinityCore/TrinityCore) [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=1310)](https://www.bountysource.com/trackers/1310-trinity-core?utm_source=1310&utm_medium=shield&utm_campaign=TRACKER_BADGE)
diff --git a/cmake/compiler/clang/settings.cmake b/cmake/compiler/clang/settings.cmake
index 4dad4cb7820..1cd95bbf703 100644
--- a/cmake/compiler/clang/settings.cmake
+++ b/cmake/compiler/clang/settings.cmake
@@ -1,5 +1,5 @@
# Set build-directive (used in core to tell which buildtype we used)
-add_definitions(-D_BUILD_DIRECTIVE='"$(CONFIGURATION)"')
+add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"')
if(WITH_WARNINGS)
set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Wfatal-errors -Wno-mismatched-tags")
@@ -18,3 +18,16 @@ endif()
# -Wno-deprecated-register is needed to suppress 185 gsoap warnings on Unix systems.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing -Wno-deprecated-register")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG=1")
+
+if (BUILD_SHARED_LIBS)
+ # -fPIC is needed to allow static linking in shared libs.
+ # -fvisibility=hidden sets the default visibility to hidden to prevent exporting of all symbols.
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -fvisibility=hidden")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fvisibility=hidden")
+
+ # --no-undefined to throw errors when there are undefined symbols
+ # (caused through missing TRINITY_*_API macros).
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --no-undefined")
+
+ message(STATUS "Clang: Disallow undefined symbols")
+endif()
diff --git a/cmake/compiler/gcc/settings.cmake b/cmake/compiler/gcc/settings.cmake
index acd71e82fd9..a0c2b737475 100644
--- a/cmake/compiler/gcc/settings.cmake
+++ b/cmake/compiler/gcc/settings.cmake
@@ -1,7 +1,7 @@
# Set build-directive (used in core to tell which buildtype we used)
add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"')
-set(GCC_EXPECTED_VERSION 4.7.2)
+set(GCC_EXPECTED_VERSION 4.9.0)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_EXPECTED_VERSION)
message(FATAL_ERROR "GCC: TrinityCore requires version ${GCC_EXPECTED_VERSION} to build but found ${CMAKE_CXX_COMPILER_VERSION}")
@@ -34,3 +34,15 @@ if( WITH_COREDEBUG )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
message(STATUS "GCC: Debug-flags set (-g3)")
endif()
+
+if (BUILD_SHARED_LIBS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -fvisibility=hidden -Wno-attributes")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fvisibility=hidden -Wno-attributes")
+
+ # Should break the build when there are TRINITY_*_API macros missing
+ # but it complains about missing references in precompiled headers.
+ # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--no-undefined")
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined")
+
+ message(STATUS "GCC: Enabled shared linking")
+endif()
diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake
index be8028da024..afde70b0f79 100644
--- a/cmake/compiler/msvc/settings.cmake
+++ b/cmake/compiler/msvc/settings.cmake
@@ -18,11 +18,6 @@ if(PLATFORM EQUAL 64)
add_definitions("-D_WIN64")
message(STATUS "MSVC: 64-bit platform, enforced -D_WIN64 parameter")
- if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.23026.0)
- #Enable extended object support for debug compiles on X64 (not required on X86)
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
- message(STATUS "MSVC: Enabled increased number of sections in object files")
- endif()
else()
# mark 32 bit executables large address aware so they can use > 2GB address space
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
@@ -36,20 +31,31 @@ else()
endif()
# Set build-directive (used in core to tell which buildtype we used)
-add_definitions(-D_BUILD_DIRECTIVE=\\"$(ConfigurationName)\\")
+# msbuild/devenv don't set CMAKE_MAKE_PROGRAM, you can choose build type from a dropdown after generating projects
+if("${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild")
+ add_definitions(-D_BUILD_DIRECTIVE=\\"$(ConfigurationName)\\")
+else()
+ # while all make-like generators do (nmake, ninja)
+ add_definitions(-D_BUILD_DIRECTIVE=\\"${CMAKE_BUILD_TYPE}\\")
+endif()
# multithreaded compiling on VS
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+if((PLATFORM EQUAL 64) OR (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.23026.0) OR BUILD_SHARED_LIBS)
+ # Enable extended object support
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
+ message(STATUS "MSVC: Enabled increased number of sections in object files")
+endif()
+
# /Zc:throwingNew.
# When you specify Zc:throwingNew on the command line, it instructs the compiler to assume
# that the program will eventually be linked with a conforming operator new implementation,
# and can omit all of these extra null checks from your program.
# http://blogs.msdn.com/b/vcblog/archive/2015/08/06/new-in-vs-2015-zc-throwingnew.aspx
if(NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.23026.0))
- # also enable /bigobj for ALL builds under visual studio 2015, increased number of templates in standard library
# makes this flag a requirement to build TC at all
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:throwingNew /bigobj")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:throwingNew")
endif()
# Define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES - eliminates the warning by changing the strcpy call to strcpy_s, which prevents buffer overruns
@@ -74,6 +80,13 @@ if(NOT WITH_WARNINGS)
message(STATUS "MSVC: Disabled generic compiletime warnings")
endif()
+if (BUILD_SHARED_LIBS)
+ # C4251: needs to have dll-interface to be used by clients of class '...'
+ # C4275: non dll-interface class ...' used as base for dll-interface class '...'
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4275")
+ message(STATUS "MSVC: Enabled shared linking")
+endif()
+
# Specify the maximum PreCompiled Header memory allocation limit
# Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012, hence we need to set an upper limit with /Zm to avoid discrepancies)
# (And yes, this is a verified , unresolved bug with MSVC... *sigh*)
@@ -84,3 +97,15 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500")
# 'function' : member function does not override any base class virtual member function
# 'virtual_function' : no override available for virtual member function from base 'class'; function is hidden
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /we4263 /we4264")
+
+# Disable incremental linking in debug builds.
+# To prevent linking getting stuck (which might be fixed in a later VS version).
+macro(DisableIncrementalLinking variable)
+ string(REGEX REPLACE "/INCREMENTAL *" "" ${variable} "${${variable}}")
+ set(${variable} "${${variable}} /INCREMENTAL:NO")
+endmacro()
+
+DisableIncrementalLinking(CMAKE_EXE_LINKER_FLAGS_DEBUG)
+DisableIncrementalLinking(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO)
+DisableIncrementalLinking(CMAKE_SHARED_LINKER_FLAGS_DEBUG)
+DisableIncrementalLinking(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO)
diff --git a/cmake/genrev.cmake b/cmake/genrev.cmake
index 5c013756f09..d123153e975 100644
--- a/cmake/genrev.cmake
+++ b/cmake/genrev.cmake
@@ -24,7 +24,7 @@ else()
if(GIT_EXECUTABLE)
# Create a revision-string that we can use
execute_process(
- COMMAND "${GIT_EXECUTABLE}" describe --match init --dirty=+ --abbrev=12
+ COMMAND "${GIT_EXECUTABLE}" describe --long --match init --dirty=+ --abbrev=12
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE rev_info
OUTPUT_STRIP_TRAILING_WHITESPACE
diff --git a/cmake/macros/AutoCollect.cmake b/cmake/macros/AutoCollect.cmake
new file mode 100644
index 00000000000..cddd3a20290
--- /dev/null
+++ b/cmake/macros/AutoCollect.cmake
@@ -0,0 +1,71 @@
+# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# Collects all source files into the given variable,
+# which is useful to include all sources in subdirectories.
+# Ignores full qualified directories listed in the variadic arguments.
+#
+# Use it like:
+# CollectSourceFiles(
+# ${CMAKE_CURRENT_SOURCE_DIR}
+# COMMON_PRIVATE_SOURCES
+# # Exclude
+# ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders
+# ${CMAKE_CURRENT_SOURCE_DIR}/Platform)
+#
+function(CollectSourceFiles current_dir variable)
+ list(FIND ARGN "${current_dir}" IS_EXCLUDED)
+ if(IS_EXCLUDED EQUAL -1)
+ file(GLOB COLLECTED_SOURCES
+ ${current_dir}/*.c
+ ${current_dir}/*.cc
+ ${current_dir}/*.cpp
+ ${current_dir}/*.inl
+ ${current_dir}/*.def
+ ${current_dir}/*.h
+ ${current_dir}/*.hh
+ ${current_dir}/*.hpp)
+ list(APPEND ${variable} ${COLLECTED_SOURCES})
+
+ file(GLOB SUB_DIRECTORIES ${current_dir}/*)
+ foreach(SUB_DIRECTORY ${SUB_DIRECTORIES})
+ if (IS_DIRECTORY ${SUB_DIRECTORY})
+ CollectSourceFiles("${SUB_DIRECTORY}" "${variable}" "${ARGN}")
+ endif()
+ endforeach()
+ set(${variable} ${${variable}} PARENT_SCOPE)
+ endif()
+endfunction()
+
+# Collects all subdirectoroies into the given variable,
+# which is useful to include all subdirectories.
+# Ignores full qualified directories listed in the variadic arguments.
+#
+# Use it like:
+# CollectIncludeDirectories(
+# ${CMAKE_CURRENT_SOURCE_DIR}
+# COMMON_PUBLIC_INCLUDES
+# # Exclude
+# ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders
+# ${CMAKE_CURRENT_SOURCE_DIR}/Platform)
+#
+function(CollectIncludeDirectories current_dir variable)
+ list(FIND ARGN "${current_dir}" IS_EXCLUDED)
+ if(IS_EXCLUDED EQUAL -1)
+ list(APPEND ${variable} ${current_dir})
+ file(GLOB SUB_DIRECTORIES ${current_dir}/*)
+ foreach(SUB_DIRECTORY ${SUB_DIRECTORIES})
+ if (IS_DIRECTORY ${SUB_DIRECTORY})
+ CollectIncludeDirectories("${SUB_DIRECTORY}" "${variable}" "${ARGN}")
+ endif()
+ endforeach()
+ set(${variable} ${${variable}} PARENT_SCOPE)
+ endif()
+endfunction()
diff --git a/cmake/macros/ConfigureScripts.cmake b/cmake/macros/ConfigureScripts.cmake
new file mode 100644
index 00000000000..5260d3a1afe
--- /dev/null
+++ b/cmake/macros/ConfigureScripts.cmake
@@ -0,0 +1,104 @@
+# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# Returns the base path to the script directory in the source directory
+function(WarnAboutSpacesInBuildPath)
+ # Only check win32 since unix doesn't allow spaces in paths
+ if (WIN32)
+ string(FIND "${CMAKE_BINARY_DIR}" " " SPACE_INDEX_POS)
+
+ if (SPACE_INDEX_POS GREATER -1)
+ message("")
+ message(WARNING " *** WARNING!\n"
+ " *** Your selected build directory contains spaces!\n"
+ " *** Please note that this will cause issues!")
+ endif()
+ endif()
+endfunction()
+
+# Returns the base path to the script directory in the source directory
+function(GetScriptsBasePath variable)
+ set(${variable} "${CMAKE_SOURCE_DIR}/src/server/scripts" PARENT_SCOPE)
+endfunction()
+
+# Stores the absolut path of the given module in the variable
+function(GetPathToScriptModule module variable)
+ GetScriptsBasePath(SCRIPTS_BASE_PATH)
+ set(${variable} "${SCRIPTS_BASE_PATH}/${module}" PARENT_SCOPE)
+endfunction()
+
+# Stores the project name of the given module in the variable
+function(GetProjectNameOfScriptModule module variable)
+ string(TOLOWER "scripts_${SCRIPT_MODULE}" GENERATED_NAME)
+ set(${variable} "${GENERATED_NAME}" PARENT_SCOPE)
+endfunction()
+
+# Creates a list of all script modules
+# and stores it in the given variable.
+function(GetScriptModuleList variable)
+ GetScriptsBasePath(BASE_PATH)
+ file(GLOB LOCALE_SCRIPT_MODULE_LIST RELATIVE
+ ${BASE_PATH}
+ ${BASE_PATH}/*)
+
+ set(${variable})
+ foreach(SCRIPT_MODULE ${LOCALE_SCRIPT_MODULE_LIST})
+ GetPathToScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PATH)
+ if (IS_DIRECTORY ${SCRIPT_MODULE_PATH})
+ list(APPEND ${variable} ${SCRIPT_MODULE})
+ endif()
+ endforeach()
+ set(${variable} ${${variable}} PARENT_SCOPE)
+endfunction()
+
+# Converts the given script module name into it's
+# variable name which holds the linkage type.
+function(ScriptModuleNameToVariable module variable)
+ string(TOUPPER ${module} ${variable})
+ set(${variable} "SCRIPTS_${${variable}}")
+ set(${variable} ${${variable}} PARENT_SCOPE)
+endfunction()
+
+# Stores in the given variable whether dynamic linking is required
+function(IsDynamicLinkingRequired variable)
+ if(SCRIPTS MATCHES "dynamic")
+ set(IS_DEFAULT_VALUE_DYNAMIC ON)
+ endif()
+
+ GetScriptModuleList(SCRIPT_MODULE_LIST)
+ set(IS_REQUIRED OFF)
+ foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
+ ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE)
+ if ((${SCRIPT_MODULE_VARIABLE} STREQUAL "dynamic") OR
+ (${SCRIPT_MODULE_VARIABLE} STREQUAL "default" AND IS_DEFAULT_VALUE_DYNAMIC))
+ set(IS_REQUIRED ON)
+ break()
+ endif()
+ endforeach()
+ set(${variable} ${IS_REQUIRED} PARENT_SCOPE)
+endfunction()
+
+# Stores the native variable name
+function(GetNativeSharedLibraryName module variable)
+ if(WIN32)
+ set(${variable} "${module}.dll" PARENT_SCOPE)
+ else()
+ set(${variable} "lib${module}.so" PARENT_SCOPE)
+ endif()
+endfunction()
+
+# Stores the native install path in the variable
+function(GetInstallOffset variable)
+ if(WIN32)
+ set(${variable} "${CMAKE_INSTALL_PREFIX}/scripts" PARENT_SCOPE)
+ else()
+ set(${variable} "${CMAKE_INSTALL_PREFIX}/bin/scripts" PARENT_SCOPE)
+ endif()
+endfunction()
diff --git a/cmake/macros/FindBoost.cmake b/cmake/macros/FindBoost.cmake
index 997336261d3..9be5b4a1c03 100644
--- a/cmake/macros/FindBoost.cmake
+++ b/cmake/macros/FindBoost.cmake
@@ -478,6 +478,7 @@ else()
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
+ "1.61.0" "1.61"
"1.60.0" "1.60" "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56"
"1.55.0" "1.55" "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
"1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1"
@@ -1110,10 +1111,10 @@ if(Boost_FOUND)
list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
set(Boost_ERROR_REASON
- "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
+ "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost. If you still have problems search on forum for TCE00020.")
else ()
set(Boost_ERROR_REASON
- "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
+ "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost. If you still have problems search on forum for TCE00021.")
endif ()
endif ()
diff --git a/cmake/macros/FindPCHSupport.cmake b/cmake/macros/FindPCHSupport.cmake
index b068b69c26b..9cc39a13b04 100644
--- a/cmake/macros/FindPCHSupport.cmake
+++ b/cmake/macros/FindPCHSupport.cmake
@@ -1,17 +1,49 @@
-FUNCTION(GET_COMMON_PCH_PARAMS PCH_HEADER PCH_FE INCLUDE_PREFIX)
+FUNCTION(GET_COMMON_PCH_PARAMS TARGET_NAME_LIST PCH_HEADER PCH_FE INCLUDE_PREFIX)
GET_FILENAME_COMPONENT(PCH_HEADER_N ${PCH_HEADER} NAME)
GET_DIRECTORY_PROPERTY(TARGET_INCLUDES INCLUDE_DIRECTORIES)
+ # Stores the inherited dependency definitions and include directories
+ # from the given target into the given variables
+ MACRO(CollectIncludes target inherited_includes inherited_definitions)
+ # Append the includes and definitions of the current target to the list
+ get_property(included TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+ LIST(APPEND "${inherited_includes}" ${included})
+ get_property(definitions TARGET ${target} PROPERTY INTERFACE_COMPILE_DEFINITIONS)
+ FOREACH(def ${definitions})
+ LIST(APPEND "${inherited_definitions}" "-D${def}")
+ ENDFOREACH()
+ # Add all inherited link targets which weren't included already
+ get_property(links TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES)
+ # TODO Maybe catch circular dependencies?
+ FOREACH(target_link ${links})
+ IF(TARGET ${target_link})
+ CollectIncludes(${target_link} "${inherited_includes}" "${inherited_definitions}")
+ ENDIF()
+ ENDFOREACH()
+ ENDMACRO()
+
+ FOREACH(TARGET_NAME ${TARGET_NAME_LIST})
+ CollectIncludes(${TARGET_NAME} TARGET_INCLUDES TARGET_DEFINITIONS)
+ ENDFOREACH()
+
+ LIST(REMOVE_DUPLICATES TARGET_INCLUDES)
+ LIST(REMOVE_DUPLICATES TARGET_DEFINITIONS)
+
FOREACH(ITEM ${TARGET_INCLUDES})
LIST(APPEND INCLUDE_FLAGS_LIST "${INCLUDE_PREFIX}\"${ITEM}\" ")
ENDFOREACH(ITEM)
+ SET(PCH_INCLUDES ${TARGET_INCLUDES} PARENT_SCOPE)
+ SET(PCH_DEFINITIONS ${TARGET_DEFINITIONS} PARENT_SCOPE)
SET(PCH_HEADER_NAME ${PCH_HEADER_N} PARENT_SCOPE)
SET(PCH_HEADER_OUT ${CMAKE_CURRENT_BINARY_DIR}/${PCH_HEADER_N}.${PCH_FE} PARENT_SCOPE)
SET(INCLUDE_FLAGS ${INCLUDE_FLAGS_LIST} PARENT_SCOPE)
ENDFUNCTION(GET_COMMON_PCH_PARAMS)
-FUNCTION(GENERATE_CXX_PCH_COMMAND TARGET_NAME INCLUDE_FLAGS IN PCH_SRC OUT)
+FUNCTION(GENERATE_CXX_PCH_COMMAND TARGET_NAME_LIST INCLUDE_FLAGS IN PCH_SRC OUT)
+ include_directories(${PCH_INCLUDES})
+ add_definitions(${PCH_DEFINITIONS})
+
IF (CMAKE_BUILD_TYPE)
STRING(TOUPPER _${CMAKE_BUILD_TYPE} CURRENT_BUILD_TYPE)
ENDIF ()
@@ -55,50 +87,69 @@ FUNCTION(GENERATE_CXX_PCH_COMMAND TARGET_NAME INCLUDE_FLAGS IN PCH_SRC OUT)
DEPENDS ${OUT}
)
- ADD_DEPENDENCIES(${TARGET_NAME} generate_${PCH_SRC_N})
+ FOREACH(TARGET_NAME ${TARGET_NAME_LIST})
+ ADD_DEPENDENCIES(${TARGET_NAME} generate_${PCH_SRC_N})
+ ENDFOREACH()
+
ENDFUNCTION(GENERATE_CXX_PCH_COMMAND)
-FUNCTION(ADD_CXX_PCH_GCC TARGET_NAME PCH_HEADER PCH_SOURCE)
- GET_COMMON_PCH_PARAMS(${PCH_HEADER} "gch" "-I")
- GENERATE_CXX_PCH_COMMAND(${TARGET_NAME} "${INCLUDE_FLAGS}" ${PCH_HEADER} ${PCH_SOURCE} ${PCH_HEADER_OUT})
- SET_TARGET_PROPERTIES(
- ${TARGET_NAME} PROPERTIES
- COMPILE_FLAGS "-include ${CMAKE_CURRENT_BINARY_DIR}/${PCH_HEADER_NAME}"
- )
+FUNCTION(ADD_CXX_PCH_GCC TARGET_NAME_LIST PCH_HEADER PCH_SOURCE)
+ GET_COMMON_PCH_PARAMS("${TARGET_NAME_LIST}" ${PCH_HEADER} "gch" "-I")
+ GENERATE_CXX_PCH_COMMAND("${TARGET_NAME_LIST}" "${INCLUDE_FLAGS}" ${PCH_HEADER} ${PCH_SOURCE} ${PCH_HEADER_OUT})
+
+ FOREACH(TARGET_NAME ${TARGET_NAME_LIST})
+ SET_TARGET_PROPERTIES(
+ ${TARGET_NAME} PROPERTIES
+ COMPILE_FLAGS "-include ${CMAKE_CURRENT_BINARY_DIR}/${PCH_HEADER_NAME}"
+ )
+ ENDFOREACH()
ENDFUNCTION(ADD_CXX_PCH_GCC)
-FUNCTION(ADD_CXX_PCH_CLANG TARGET_NAME PCH_HEADER PCH_SOURCE)
- GET_COMMON_PCH_PARAMS(${PCH_HEADER} "pch" "-I")
- GENERATE_CXX_PCH_COMMAND(${TARGET_NAME} "${INCLUDE_FLAGS}" ${PCH_HEADER} ${PCH_SOURCE} ${PCH_HEADER_OUT})
- SET_TARGET_PROPERTIES(
- ${TARGET_NAME} PROPERTIES
- COMPILE_FLAGS "-include-pch ${PCH_HEADER_OUT}"
- )
+FUNCTION(ADD_CXX_PCH_CLANG TARGET_NAME_LIST PCH_HEADER PCH_SOURCE)
+ GET_COMMON_PCH_PARAMS("${TARGET_NAME_LIST}" ${PCH_HEADER} "pch" "-I")
+ GENERATE_CXX_PCH_COMMAND("${TARGET_NAME_LIST}" "${INCLUDE_FLAGS}" ${PCH_HEADER} ${PCH_SOURCE} ${PCH_HEADER_OUT})
+
+ FOREACH(TARGET_NAME ${TARGET_NAME_LIST})
+ SET_TARGET_PROPERTIES(
+ ${TARGET_NAME} PROPERTIES
+ COMPILE_FLAGS "-include-pch ${PCH_HEADER_OUT}"
+ )
+ ENDFOREACH()
ENDFUNCTION(ADD_CXX_PCH_CLANG)
-FUNCTION(ADD_CXX_PCH_MSVC TARGET_NAME PCH_HEADER PCH_SOURCE)
- GET_COMMON_PCH_PARAMS(${PCH_HEADER} "pch" "/I")
- SET_TARGET_PROPERTIES(
- ${TARGET_NAME} PROPERTIES
- COMPILE_FLAGS "/FI${PCH_HEADER_NAME} /Yu${PCH_HEADER_NAME}"
- )
+FUNCTION(ADD_CXX_PCH_MSVC TARGET_NAME_LIST PCH_HEADER PCH_SOURCE)
+ GET_COMMON_PCH_PARAMS("${TARGET_NAME_LIST}" ${PCH_HEADER} "pch" "/I")
+
+ FOREACH(TARGET_NAME ${TARGET_NAME_LIST})
+ SET_TARGET_PROPERTIES(
+ ${TARGET_NAME} PROPERTIES
+ COMPILE_FLAGS "/FI${PCH_HEADER_NAME} /Yu${PCH_HEADER_NAME}"
+ )
+ ENDFOREACH()
+
SET_SOURCE_FILES_PROPERTIES(
${PCH_SOURCE} PROPERTIES
COMPILE_FLAGS "/Yc${PCH_HEADER_NAME}"
)
ENDFUNCTION(ADD_CXX_PCH_MSVC)
-FUNCTION(ADD_CXX_PCH TARGET_NAME PCH_HEADER PCH_SOURCE)
- IF (MSVC)
- ADD_CXX_PCH_MSVC(${TARGET_NAME} ${PCH_HEADER} ${PCH_SOURCE})
- ELSEIF ("${CMAKE_GENERATOR}" MATCHES "Xcode")
- SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+FUNCTION(ADD_CXX_PCH_XCODE TARGET_NAME_LIST PCH_HEADER PCH_SOURCE)
+ FOREACH(TARGET_NAME ${TARGET_NAME_LIST})
+ SET_TARGET_PROPERTIES("${TARGET_NAME}" PROPERTIES
XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES
XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/${PCH_HEADER}"
)
+ ENDFOREACH()
+ENDFUNCTION(ADD_CXX_PCH_XCODE)
+
+FUNCTION(ADD_CXX_PCH TARGET_NAME_LIST PCH_HEADER PCH_SOURCE)
+ IF (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ ADD_CXX_PCH_MSVC("${TARGET_NAME_LIST}" ${PCH_HEADER} ${PCH_SOURCE})
+ ELSEIF ("${CMAKE_GENERATOR}" MATCHES "Xcode")
+ ADD_CXX_PCH_XCODE("${TARGET_NAME_LIST}" ${PCH_HEADER} ${PCH_SOURCE})
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
- ADD_CXX_PCH_CLANG(${TARGET_NAME} ${PCH_HEADER} ${PCH_SOURCE})
+ ADD_CXX_PCH_CLANG("${TARGET_NAME_LIST}" ${PCH_HEADER} ${PCH_SOURCE})
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
- ADD_CXX_PCH_GCC(${TARGET_NAME} ${PCH_HEADER} ${PCH_SOURCE})
+ ADD_CXX_PCH_GCC("${TARGET_NAME_LIST}" ${PCH_HEADER} ${PCH_SOURCE})
ENDIF ()
ENDFUNCTION(ADD_CXX_PCH)
diff --git a/cmake/macros/FindReadline.cmake b/cmake/macros/FindReadline.cmake
deleted file mode 100644
index 34af35204b5..00000000000
--- a/cmake/macros/FindReadline.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
-# find Readline (terminal input library) includes and library
-#
-# READLINE_INCLUDE_DIR - where the directory containing the READLINE headers can be found
-# READLINE_LIBRARY - full path to the READLINE library
-# READLINE_FOUND - TRUE if READLINE was found
-
-FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h)
-FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
-
-IF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
- SET(READLINE_FOUND TRUE)
- MESSAGE(STATUS "Found Readline library: ${READLINE_LIBRARY}")
- MESSAGE(STATUS "Include dir is: ${READLINE_INCLUDE_DIR}")
- INCLUDE_DIRECTORIES(${READLINE_INCLUDE_DIR})
-ELSE (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
- SET(READLINE_FOUND FALSE)
- MESSAGE(FATAL_ERROR "** Readline library not found!\n** Your distro may provide a binary for Readline e.g. for ubuntu try apt-get install libreadline5-dev")
-ENDIF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
diff --git a/cmake/macros/GroupSources.cmake b/cmake/macros/GroupSources.cmake
index 198d8c3e187..f8e252fe41a 100644
--- a/cmake/macros/GroupSources.cmake
+++ b/cmake/macros/GroupSources.cmake
@@ -10,7 +10,7 @@
macro(GroupSources dir)
# Skip this if WITH_SOURCE_TREE is not set (empty string).
- if (NOT ${_WITH_SOURCE_TREE} STREQUAL "")
+ if (NOT ${WITH_SOURCE_TREE} STREQUAL "")
# Include all header and c files
file(GLOB_RECURSE elements RELATIVE ${dir} *.h *.hpp *.c *.cpp *.cc)
@@ -21,7 +21,7 @@ macro(GroupSources dir)
if (NOT ${element_dir} STREQUAL "")
# If the file is in a subdirectory use it as source group.
- if (${_WITH_SOURCE_TREE} STREQUAL "flat")
+ if (${WITH_SOURCE_TREE} STREQUAL "flat")
# Build flat structure by using only the first subdirectory.
string(FIND ${element_dir} "/" delemiter_pos)
if (NOT ${delemiter_pos} EQUAL -1)
@@ -44,3 +44,8 @@ macro(GroupSources dir)
endforeach()
endif()
endmacro()
+
+if (WITH_SOURCE_TREE STREQUAL "hierarchical-folders")
+ # Use folders
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+endif()
diff --git a/cmake/options.cmake b/cmake/options.cmake
index 19615001307..80f07b182fc 100644
--- a/cmake/options.cmake
+++ b/cmake/options.cmake
@@ -9,12 +9,45 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
option(SERVERS "Build worldserver and authserver" 1)
-option(SCRIPTS "Build core with scripts included" 1)
+
+set(SCRIPTS_AVAILABLE_OPTIONS none static dynamic minimal-static minimal-dynamic)
+
+# Log a fatal error when the value of the SCRIPTS variable isn't a valid option.
+if (SCRIPTS)
+ list (FIND SCRIPTS_AVAILABLE_OPTIONS "${SCRIPTS}" SCRIPTS_INDEX)
+ if (${SCRIPTS_INDEX} EQUAL -1)
+ message(FATAL_ERROR "The value (${SCRIPTS}) of your SCRIPTS variable is invalid! "
+ "Allowed values are: ${SCRIPTS_AVAILABLE_OPTIONS} if you still "
+ "have problems search on forum for TCE00019.")
+ endif()
+endif()
+
+set(SCRIPTS "static" CACHE STRING "Build core with scripts")
+set_property(CACHE SCRIPTS PROPERTY STRINGS ${SCRIPTS_AVAILABLE_OPTIONS})
+
+# Build a list of all script modules when -DSCRIPT="custom" is selected
+GetScriptModuleList(SCRIPT_MODULE_LIST)
+foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
+ ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE)
+ set(${SCRIPT_MODULE_VARIABLE} "default" CACHE STRING "Build type of the ${SCRIPT_MODULE} module.")
+ set_property(CACHE ${SCRIPT_MODULE_VARIABLE} PROPERTY STRINGS default disabled static dynamic)
+endforeach()
+
option(TOOLS "Build map/vmap/mmap extraction/assembler tools" 0)
option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1)
option(USE_COREPCH "Use precompiled headers when compiling servers" 1)
+option(WITH_DYNAMIC_LINKING "Enable dynamic library linking." 0)
+IsDynamicLinkingRequired(WITH_DYNAMIC_LINKING_FORCED)
+if (WITH_DYNAMIC_LINKING AND WITH_DYNAMIC_LINKING_FORCED)
+ set(WITH_DYNAMIC_LINKING_FORCED OFF)
+endif()
+if (WITH_DYNAMIC_LINKING OR WITH_DYNAMIC_LINKING_FORCED)
+ set(BUILD_SHARED_LIBS ON)
+else()
+ set(BUILD_SHARED_LIBS OFF)
+endif()
option(WITH_WARNINGS "Show all warnings during compile" 0)
option(WITH_COREDEBUG "Include additional debug-code in core" 0)
-set(WITH_SOURCE_TREE "no" CACHE STRING "Build the source tree for IDE's.")
-set_property(CACHE WITH_SOURCE_TREE PROPERTY STRINGS no flat hierarchical)
+set(WITH_SOURCE_TREE "hierarchical" CACHE STRING "Build the source tree for IDE's.")
+set_property(CACHE WITH_SOURCE_TREE PROPERTY STRINGS no flat hierarchical hierarchical-folders)
option(WITHOUT_GIT "Disable the GIT testing routines" 0)
diff --git a/cmake/platform/unix/settings.cmake b/cmake/platform/unix/settings.cmake
index 754ff450fcc..79b426d7e03 100644
--- a/cmake/platform/unix/settings.cmake
+++ b/cmake/platform/unix/settings.cmake
@@ -1,12 +1,3 @@
-# Package overloads - Linux
-if(CMAKE_SYSTEM_NAME MATCHES "Linux")
- if (NOT NOJEM)
- set(JEMALLOC_LIBRARY "jemalloc")
- add_definitions(-DNO_BUFFERPOOL)
- message(STATUS "UNIX: Using jemalloc")
- endif()
-endif()
-
# set default configuration directory
if( NOT CONF_DIR )
set(CONF_DIR ${CMAKE_INSTALL_PREFIX}/etc)
@@ -38,7 +29,7 @@ if(CMAKE_C_COMPILER MATCHES "gcc" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
include(${CMAKE_SOURCE_DIR}/cmake/compiler/gcc/settings.cmake)
elseif(CMAKE_C_COMPILER MATCHES "icc")
include(${CMAKE_SOURCE_DIR}/cmake/compiler/icc/settings.cmake)
-elseif(CMAKE_C_COMPILER MATCHES "clang" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
+elseif(CMAKE_C_COMPILER MATCHES "clang" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
include(${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake)
else()
add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"')
diff --git a/cmake/platform/win/settings.cmake b/cmake/platform/win/settings.cmake
index c68d7bc51cc..0c1a103304a 100644
--- a/cmake/platform/win/settings.cmake
+++ b/cmake/platform/win/settings.cmake
@@ -1,20 +1,9 @@
-# Package overloads
-set(BZIP2_LIBRARIES "bzip2")
-set(ZLIB_LIBRARIES "zlib")
+add_definitions(-D_WIN32_WINNT=0x0601)
-# check the CMake preload parameters (commented out by default)
-
-# overload CMAKE_INSTALL_PREFIX if not being set properly
-#if( WIN32 )
-# if( NOT CYGWIN )
-# if( NOT CMAKE_INSTALL_PREFIX )
-# set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/bin")
-# endif()
-# endif()
-#endif()
-
-if ( MSVC )
+if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake)
-elseif ( MINGW )
+elseif (CMAKE_CXX_PLATFORM_ID MATCHES "MinGW")
include(${CMAKE_SOURCE_DIR}/cmake/compiler/mingw/settings.cmake)
+elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ include(${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake)
endif()
diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake
index 110b2f01a64..9229590381a 100644
--- a/cmake/showoptions.cmake
+++ b/cmake/showoptions.cmake
@@ -23,9 +23,8 @@ else()
message("* Build world/authserver : No")
endif()
-if( SCRIPTS )
- message("* Build with scripts : Yes (default)")
- add_definitions(-DSCRIPTS)
+if(SCRIPTS AND (NOT SCRIPTS STREQUAL "none"))
+ message("* Build with scripts : Yes (${SCRIPTS})")
else()
message("* Build with scripts : No")
endif()
@@ -69,27 +68,10 @@ else()
message("* Use coreside debug : No (default)")
endif()
-if( WITH_SOURCE_TREE STREQUAL "flat" OR WITH_SOURCE_TREE STREQUAL "hierarchical" )
- # TODO: Remove this after Debian 8 is released and set general required version to 2.8.12
- # Debian 7 is shipped with CMake 2.8.9 . But DIRECTORY flag of get_filename_component requires 2.8.12 .
- if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
- message("* Show source tree : Yes - ${WITH_SOURCE_TREE}")
- set(_WITH_SOURCE_TREE ${WITH_SOURCE_TREE} CACHE INTERNAL "WITH_SOURCE_TREE support enabled.")
- else()
- message("* Show source tree : No (default)")
-
- message("")
- message(" *** WITH_SOURCE_TREE - WARNING!")
- message(" *** This functionality is ONLY supported on CMake 2.8.12 or higher.")
- message(" *** You are running ${CMAKE_VERSION}, which does not have the functions needed")
- message(" *** to create a sourcetree - this option is thus forced to disabled!")
- message("")
-
- set(_WITH_SOURCE_TREE "" CACHE INTERNAL "WITH_SOURCE_TREE support disabled.")
- endif()
+if( NOT WITH_SOURCE_TREE STREQUAL "no" )
+ message("* Show source tree : Yes (${WITH_SOURCE_TREE})")
else()
- message("* Show source tree : No (default)")
- set(_WITH_SOURCE_TREE "" CACHE INTERNAL "WITH_SOURCE_TREE support disabled.")
+ message("* Show source tree : No")
endif()
if ( WITHOUT_GIT )
@@ -104,7 +86,7 @@ if ( WITHOUT_GIT )
message(" *** version of git for the revision-hash to work, and be allowede to ask for")
message(" *** support if needed.")
else()
- message("* Use GIT revision hash : Yes")
+ message("* Use GIT revision hash : Yes (default)")
endif()
if ( NOJEM )
@@ -130,5 +112,18 @@ if ( HELGRIND )
add_definitions(-DHELGRIND)
endif()
-message("")
+if (BUILD_SHARED_LIBS)
+ message("")
+ message(" *** WITH_DYNAMIC_LINKING - INFO!")
+ message(" *** Will link against shared libraries!")
+ message(" *** Please note that this is an experimental feature!")
+ if (WITH_DYNAMIC_LINKING_FORCED)
+ message("")
+ message(" *** Dynamic linking was enforced through a dynamic script module!")
+ endif()
+ add_definitions(-DTRINITY_API_USE_DYNAMIC_LINKING)
+ WarnAboutSpacesInBuildPath()
+endif()
+
+message("")
diff --git a/contrib/check_updates.sh b/contrib/check_updates.sh
index 017542eb807..6c33d07ae8b 100644
--- a/contrib/check_updates.sh
+++ b/contrib/check_updates.sh
@@ -1,6 +1,7 @@
#!/bin/sh
name=$1
-database=$2
+branch=$2
+database=$3
echo "Database Updater check script:"
echo " Checking database '${name}' for missing filenames in tables..."
@@ -9,7 +10,7 @@ echo
# Select all entries which are in the updates table
entries=$(mysql -uroot ${database} -e "SELECT name FROM updates" | grep ".sql")
-cd sql/updates/${name}
+cd sql/updates/${name}/${branch}
error=0
updates=0
diff --git a/contrib/extractor.bat b/contrib/extractor.bat
new file mode 100644
index 00000000000..eb7c99e5c0b
--- /dev/null
+++ b/contrib/extractor.bat
@@ -0,0 +1,51 @@
+@ECHO OFF
+CLS
+:MENU
+ECHO.
+ECHO ...............................................
+ECHO Trinitycore dbc/db2, maps, vmaps, mmaps extractor
+ECHO ...............................................
+ECHO PRESS 1, 2, 3 OR 4 to select your task, or 5 to EXIT.
+ECHO ...............................................
+ECHO.
+ECHO 1 - Extract dbc/db2 and maps
+ECHO 2 - Extract vmaps (needs maps to be extracted before you run this)
+ECHO 3 - Extract mmaps (needs vmaps to be extracted before you run this, may take hours)
+ECHO 4 - Extract all (may take hours)
+ECHO 5 - EXIT
+ECHO.
+SET /P M=Type 1, 2, 3, 4 or 5 then press ENTER:
+IF %M%==1 GOTO MAPS
+IF %M%==2 GOTO VMAPS
+IF %M%==3 GOTO MMAPS
+IF %M%==4 GOTO ALL
+IF %M%==5 GOTO EOF
+:MAPS
+start mapextractor.exe
+pause
+GOTO MENU
+:VMAPS
+start vmap4extractor.exe
+md vmaps
+start vmap4assembler.exe Buildings vmaps
+pause
+GOTO MENU
+:MMAPS
+md mmaps
+start mmaps_generator.exe
+pause
+GOTO MENU
+:ALL
+start mapextractor.exe
+ECHO wait before mapextractor.exe closes before continue
+pause
+start vmap4extractor.exe
+md vmaps
+start vmap4assembler.exe Buildings vmaps
+rmdir Buildings /s /q
+ECHO wait before vmap4assembler.exe closes before continue
+pause
+md mmaps
+start mmaps_generator.exe
+pause
+GOTO MENU
diff --git a/contrib/grafana/1_General.json b/contrib/grafana/1_General.json
new file mode 100644
index 00000000000..e54791f190e
--- /dev/null
+++ b/contrib/grafana/1_General.json
@@ -0,0 +1,889 @@
+{
+ "id": 1,
+ "title": "General info",
+ "originalTitle": "General info",
+ "tags": [],
+ "style": "dark",
+ "timezone": "browser",
+ "editable": true,
+ "hideControls": false,
+ "sharedCrosshair": false,
+ "rows": [
+ {
+ "collapse": false,
+ "editable": true,
+ "height": "25px",
+ "panels": [
+ {
+ "cacheTimeout": null,
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "rgba(245, 54, 54, 0.9)",
+ "rgba(237, 129, 40, 0.89)",
+ "rgba(50, 172, 45, 0.97)"
+ ],
+ "datasource": "Influx",
+ "editable": true,
+ "error": false,
+ "format": "none",
+ "id": 5,
+ "interval": null,
+ "isNew": true,
+ "links": [],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "nullText": null,
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "span": 3,
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": false
+ },
+ "targets": [
+ {
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "auto"
+ ],
+ "type": "time"
+ }
+ ],
+ "measurement": "online_players",
+ "policy": "default",
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "type": "field",
+ "params": [
+ "value"
+ ]
+ },
+ {
+ "type": "last",
+ "params": []
+ }
+ ]
+ ],
+ "tags": [
+ {
+ "key": "realm",
+ "operator": "=~",
+ "value": "/^$realm$/"
+ }
+ ]
+ }
+ ],
+ "thresholds": "",
+ "title": "Online players",
+ "type": "singlestat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "current",
+ "timeFrom": null,
+ "timeShift": null,
+ "hideTimeOverride": false
+ },
+ {
+ "cacheTimeout": null,
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "rgba(245, 54, 54, 0.9)",
+ "rgba(237, 129, 40, 0.89)",
+ "rgba(50, 172, 45, 0.97)"
+ ],
+ "datasource": "Influx",
+ "editable": true,
+ "error": false,
+ "format": "none",
+ "id": 6,
+ "interval": null,
+ "isNew": true,
+ "links": [],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "nullText": null,
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "span": 3,
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": false
+ },
+ "targets": [
+ {
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "auto"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "update_time_diff",
+ "policy": "default",
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ }
+ ]
+ ],
+ "tags": [
+ {
+ "key": "realm",
+ "operator": "=~",
+ "value": "/^$realm$/"
+ }
+ ]
+ }
+ ],
+ "thresholds": "",
+ "title": "Update diff (avg)",
+ "type": "singlestat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "avg",
+ "timeFrom": "1m"
+ },
+ {
+ "cacheTimeout": null,
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "rgba(245, 54, 54, 0.9)",
+ "rgba(237, 129, 40, 0.89)",
+ "rgba(50, 172, 45, 0.97)"
+ ],
+ "datasource": "Influx",
+ "editable": true,
+ "error": false,
+ "format": "none",
+ "id": 7,
+ "interval": null,
+ "isNew": true,
+ "links": [],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "nullText": null,
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "span": 3,
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": false
+ },
+ "targets": [
+ {
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "auto"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "update_time_diff",
+ "policy": "default",
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ }
+ ]
+ ],
+ "tags": []
+ }
+ ],
+ "thresholds": "",
+ "title": "Update diff (avg)",
+ "transparent": false,
+ "type": "singlestat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "avg",
+ "timeFrom": "5m"
+ },
+ {
+ "cacheTimeout": null,
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "rgba(245, 54, 54, 0.9)",
+ "rgba(237, 129, 40, 0.89)",
+ "rgba(50, 172, 45, 0.97)"
+ ],
+ "datasource": "Influx",
+ "editable": true,
+ "error": false,
+ "format": "none",
+ "id": 8,
+ "interval": null,
+ "isNew": true,
+ "links": [],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "nullText": null,
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "span": 3,
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": false
+ },
+ "targets": [
+ {
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "auto"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "update_time_diff",
+ "policy": "default",
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ }
+ ]
+ ],
+ "tags": [
+ {
+ "key": "realm",
+ "operator": "=~",
+ "value": "/^$realm$/"
+ }
+ ]
+ }
+ ],
+ "thresholds": "",
+ "title": "Update diff (avg)",
+ "type": "singlestat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "avg",
+ "timeFrom": "15m",
+ "timeShift": null
+ }
+ ],
+ "title": "New row"
+ },
+ {
+ "collapse": false,
+ "editable": true,
+ "height": "250px",
+ "panels": [
+ {
+ "aliasColors": {},
+ "bars": false,
+ "datasource": "Influx",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null,
+ "threshold1": null,
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
+ "threshold2": null,
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
+ },
+ "id": 1,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "span": 12,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "alias": "Update diff",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "update_time_diff",
+ "policy": "default",
+ "query": "SELECT mean(\"value\") FROM \"update_time_diff\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(null)",
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ }
+ ]
+ ],
+ "tags": [
+ {
+ "key": "realm",
+ "operator": "=~",
+ "value": "/$realm$/"
+ }
+ ]
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Update diff",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "show": true
+ },
+ "y-axis": true,
+ "y_formats": [
+ "ms",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ }
+ ],
+ "title": "Row"
+ },
+ {
+ "collapse": false,
+ "editable": true,
+ "height": "250px",
+ "panels": [
+ {
+ "aliasColors": {},
+ "bars": false,
+ "datasource": "Influx",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null,
+ "threshold1": null,
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
+ "threshold2": null,
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
+ },
+ "id": 4,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "span": 12,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "alias": "Online players",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "online_players",
+ "policy": "default",
+ "query": "SELECT mean(\"value\") FROM \"online_players\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(null)",
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ }
+ ]
+ ],
+ "tags": [
+ {
+ "key": "realm",
+ "operator": "=~",
+ "value": "/$realm$/"
+ }
+ ]
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Online players",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "show": true
+ },
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ }
+ ],
+ "title": "New row"
+ },
+ {
+ "collapse": false,
+ "editable": true,
+ "height": "250px",
+ "panels": [
+ {
+ "aliasColors": {},
+ "bars": false,
+ "datasource": "Influx",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null,
+ "threshold1": null,
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
+ "threshold2": null,
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
+ },
+ "id": 3,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [
+ {
+ "alias": "Logouts",
+ "transform": "negative-Y"
+ }
+ ],
+ "span": 12,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "alias": "Logins",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "player_events",
+ "policy": "default",
+ "query": "SELECT count(\"text\") FROM \"player_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'Login' AND $timeFilter GROUP BY time($interval) fill(0)",
+ "rawQuery": true,
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "text"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "count"
+ }
+ ]
+ ],
+ "tags": [
+ {
+ "key": "realm",
+ "operator": "=",
+ "value": "Trinity"
+ }
+ ]
+ },
+ {
+ "alias": "Logouts",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "policy": "default",
+ "query": "SELECT count(\"text\") FROM \"player_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'Logout' AND $timeFilter GROUP BY time($interval) fill(0)",
+ "rawQuery": true,
+ "refId": "B",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ }
+ ]
+ ],
+ "tags": []
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Player login/logout",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "show": true
+ },
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ }
+ ],
+ "title": "New row"
+ }
+ ],
+ "time": {
+ "from": "now-15m",
+ "to": "now"
+ },
+ "timepicker": {
+ "now": true,
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ],
+ "time_options": [
+ "5m",
+ "15m",
+ "1h",
+ "6h",
+ "12h",
+ "24h",
+ "2d",
+ "7d",
+ "30d"
+ ]
+ },
+ "templating": {
+ "list": [
+ {
+ "allFormat": "regex values",
+ "current": {
+ "text": "Trinity",
+ "value": "Trinity"
+ },
+ "datasource": "Influx",
+ "includeAll": false,
+ "multi": false,
+ "multiFormat": "regex values",
+ "name": "realm",
+ "options": [
+ {
+ "text": "Trinity",
+ "value": "Trinity",
+ "selected": true
+ }
+ ],
+ "query": "show tag values from events with key = realm",
+ "refresh": 1,
+ "regex": "",
+ "type": "query"
+ }
+ ]
+ },
+ "annotations": {
+ "list": [
+ {
+ "datasource": "Influx",
+ "enable": true,
+ "iconColor": "#C0C6BE",
+ "iconSize": 13,
+ "lineColor": "rgba(255, 96, 96, 0.592157)",
+ "name": "Global Events",
+ "query": "select title, text from events where $timeFilter and realm =~ /$realm$/",
+ "showLine": true,
+ "textColumn": "text",
+ "titleColumn": "title"
+ }
+ ]
+ },
+ "refresh": "1m",
+ "schemaVersion": 12,
+ "version": 7,
+ "links": []
+} \ No newline at end of file
diff --git a/contrib/grafana/2_Maps.json b/contrib/grafana/2_Maps.json
new file mode 100644
index 00000000000..6c2cecb1035
--- /dev/null
+++ b/contrib/grafana/2_Maps.json
@@ -0,0 +1,339 @@
+{
+ "id": 2,
+ "title": "Maps, vmaps and mmaps",
+ "originalTitle": "Maps, vmaps and mmaps",
+ "tags": [],
+ "style": "dark",
+ "timezone": "browser",
+ "editable": true,
+ "hideControls": false,
+ "sharedCrosshair": false,
+ "rows": [
+ {
+ "collapse": false,
+ "editable": true,
+ "height": "250px",
+ "panels": [
+ {
+ "aliasColors": {},
+ "bars": false,
+ "datasource": "Influx",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null,
+ "threshold1": null,
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
+ "threshold2": null,
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
+ },
+ "id": 2,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [
+ {
+ "alias": "Unload tile",
+ "transform": "negative-Y"
+ }
+ ],
+ "span": 12,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "alias": "Load tile",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "0"
+ ],
+ "type": "fill"
+ }
+ ],
+ "query": "SELECT count(\"title\") FROM \"map_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'LoadMapTile' AND $timeFilter GROUP BY time($interval) fill(0)",
+ "rawQuery": true,
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ }
+ ]
+ ],
+ "tags": []
+ },
+ {
+ "alias": "Unload tile",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "query": "SELECT count(\"title\") FROM \"map_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'UnloadMapTile' AND $timeFilter GROUP BY time($interval) fill(0)",
+ "rawQuery": true,
+ "refId": "B",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ }
+ ]
+ ],
+ "tags": []
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Map",
+ "tooltip": {
+ "shared": true,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ]
+ }
+ ],
+ "title": "Row"
+ },
+ {
+ "collapse": false,
+ "editable": true,
+ "height": "250px",
+ "panels": [
+ {
+ "aliasColors": {},
+ "bars": false,
+ "datasource": "Influx",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null,
+ "threshold1": null,
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
+ "threshold2": null,
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
+ },
+ "id": 1,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "span": 12,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "alias": "Pathfinding queries",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "query": "SELECT count(\"title\") FROM \"mmap_events\" WHERE \"realm\" =~ /$realm$/ AND \"title\" = 'CalculatePath' AND $timeFilter GROUP BY time($interval) fill(0)",
+ "rawQuery": true,
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ }
+ ]
+ ],
+ "tags": []
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "MMap",
+ "tooltip": {
+ "shared": true,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ]
+ }
+ ],
+ "title": "New row"
+ }
+ ],
+ "time": {
+ "from": "now-15m",
+ "to": "now"
+ },
+ "timepicker": {
+ "now": true,
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ],
+ "time_options": [
+ "5m",
+ "15m",
+ "1h",
+ "6h",
+ "12h",
+ "24h",
+ "2d",
+ "7d",
+ "30d"
+ ]
+ },
+ "templating": {
+ "list": [
+ {
+ "allFormat": "regex values",
+ "current": {
+ "text": "Trinity",
+ "value": "Trinity"
+ },
+ "datasource": "Influx",
+ "includeAll": false,
+ "multi": false,
+ "multiFormat": "regex values",
+ "name": "realm",
+ "options": [
+ {
+ "text": "Trinity",
+ "value": "Trinity",
+ "selected": true
+ }
+ ],
+ "query": "show tag values from events with key = realm",
+ "refresh": true,
+ "type": "query"
+ }
+ ]
+ },
+ "annotations": {
+ "list": [
+ {
+ "datasource": "Influx",
+ "enable": true,
+ "iconColor": "#C0C6BE",
+ "iconSize": 13,
+ "lineColor": "rgba(255, 96, 96, 0.592157)",
+ "name": "Global Events",
+ "query": "select title, text from events where $timeFilter and realm =~ /$realm$/",
+ "showLine": true,
+ "textColumn": "text",
+ "titleColumn": "title"
+ }
+ ]
+ },
+ "refresh": "1m",
+ "schemaVersion": 8,
+ "version": 11,
+ "links": []
+} \ No newline at end of file
diff --git a/contrib/grafana/3_Network.json b/contrib/grafana/3_Network.json
new file mode 100644
index 00000000000..98c190e1185
--- /dev/null
+++ b/contrib/grafana/3_Network.json
@@ -0,0 +1,242 @@
+{
+ "id": 3,
+ "title": "Network",
+ "originalTitle": "Network",
+ "tags": [],
+ "style": "dark",
+ "timezone": "browser",
+ "editable": true,
+ "hideControls": false,
+ "sharedCrosshair": false,
+ "rows": [
+ {
+ "collapse": false,
+ "editable": true,
+ "height": "250px",
+ "panels": [
+ {
+ "aliasColors": {},
+ "bars": false,
+ "datasource": "Influx",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null,
+ "threshold1": null,
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
+ "threshold2": null,
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
+ },
+ "id": 1,
+ "isNew": true,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "span": 12,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "alias": "Processed packets",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "0"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "processed_packets",
+ "query": "SELECT sum(\"value\") FROM \"processed_packets\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(0)",
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "sum"
+ }
+ ]
+ ],
+ "tags": [
+ {
+ "key": "realm",
+ "operator": "=~",
+ "value": "/$realm$/"
+ }
+ ]
+ },
+ {
+ "alias": "Processed packets / mean per session",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "0"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "processed_packets",
+ "query": "SELECT mean(\"value\") FROM \"processed_packets\" WHERE \"realm\" =~ /$realm$/ AND $timeFilter GROUP BY time($interval) fill(0)",
+ "refId": "B",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "value"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ }
+ ]
+ ],
+ "tags": [
+ {
+ "key": "realm",
+ "operator": "=~",
+ "value": "/$realm$/"
+ }
+ ]
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Processed packets",
+ "tooltip": {
+ "shared": true,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ]
+ }
+ ],
+ "title": "Row"
+ }
+ ],
+ "time": {
+ "from": "now-15m",
+ "to": "now"
+ },
+ "timepicker": {
+ "now": true,
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ],
+ "time_options": [
+ "5m",
+ "15m",
+ "1h",
+ "6h",
+ "12h",
+ "24h",
+ "2d",
+ "7d",
+ "30d"
+ ]
+ },
+ "templating": {
+ "list": [
+ {
+ "allFormat": "regex values",
+ "current": {
+ "text": "Trinity",
+ "value": "Trinity"
+ },
+ "datasource": "Influx",
+ "includeAll": false,
+ "multi": false,
+ "multiFormat": "regex values",
+ "name": "realm",
+ "options": [
+ {
+ "text": "Trinity",
+ "value": "Trinity",
+ "selected": true
+ }
+ ],
+ "query": "show tag values from events with key = realm",
+ "refresh": true,
+ "type": "query"
+ }
+ ]
+ },
+ "annotations": {
+ "list": [
+ {
+ "datasource": "Influx",
+ "enable": true,
+ "iconColor": "#C0C6BE",
+ "iconSize": 13,
+ "lineColor": "rgba(255, 96, 96, 0.592157)",
+ "name": "Global Events",
+ "query": "select title, text from events where $timeFilter and realm =~ /$realm$/",
+ "showLine": true,
+ "textColumn": "text",
+ "titleColumn": "title"
+ }
+ ]
+ },
+ "refresh": "1m",
+ "schemaVersion": 8,
+ "version": 7,
+ "links": []
+} \ No newline at end of file
diff --git a/contrib/merge_updates_windows.bat b/contrib/merge_updates_windows.bat
index c43d4adf907..78b0b768a07 100644
--- a/contrib/merge_updates_windows.bat
+++ b/contrib/merge_updates_windows.bat
@@ -1 +1 @@
-copy /a ..\sql\updates\world\*.sql /b world_updates.sql
+copy /a ..\sql\updates\world\3.3.5\*.sql /b world_updates.sql
diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt
index 7f4f1cd884c..48be56bc9ef 100644
--- a/dep/CMakeLists.txt
+++ b/dep/CMakeLists.txt
@@ -8,37 +8,38 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-if( MSVC )
+if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ string(REGEX REPLACE "/W[0-4] " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ string(REGEX REPLACE "/W[0-4] " "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
add_definitions(/W0)
else()
add_definitions(-w)
endif()
-if(CMAKE_SYSTEM_NAME MATCHES "Linux")
- if(SERVERS AND NOT NOJEM)
- add_subdirectory(jemalloc)
- endif()
-endif()
-
-if(CMAKE_SYSTEM_NAME MATCHES "Windows")
- if(TOOLS)
- add_subdirectory(bzip2)
- endif()
- if(SERVERS OR TOOLS)
- add_subdirectory(zlib)
- endif()
-endif()
+add_subdirectory(threads)
if(SERVERS OR TOOLS)
+ add_subdirectory(boost)
+ add_subdirectory(process)
+ add_subdirectory(zlib)
add_subdirectory(g3dlite)
add_subdirectory(recastnavigation)
add_subdirectory(cppformat)
+ add_subdirectory(SFMT)
+ add_subdirectory(utf8cpp)
+ add_subdirectory(valgrind)
+ add_subdirectory(openssl)
+ add_subdirectory(jemalloc)
endif()
if(SERVERS)
+ add_subdirectory(mysql)
+ add_subdirectory(readline)
add_subdirectory(gsoap)
+ add_subdirectory(efsw)
endif()
if(TOOLS)
+ add_subdirectory(bzip2)
add_subdirectory(libmpq)
endif()
diff --git a/dep/PackageList.txt b/dep/PackageList.txt
index e84fef8d3b2..b01af04f6fa 100644
--- a/dep/PackageList.txt
+++ b/dep/PackageList.txt
@@ -1,6 +1,6 @@
TrinityCore uses (parts of or in whole) the following opensource software :
-Boost
+Boost (external)
http://www.boost.org
Version: 1.55
@@ -14,7 +14,11 @@ bzip2 (a freely available, patent free, high-quality data compressor)
cppformat (type safe format library)
https://github.com/cppformat/cppformat
- Version: 5c76d107cbaf5e851bd66b6c563e4fc7c90be7ad
+ Version: 5174b8ca281426af604b85fdf53be8a748b33f56
+
+efws (Entropia File System Watcher - crossplatform file system watcher)
+ https://bitbucket.org/SpartanJ/efsw
+ ff0b69daeca1edf7785a8a580518e462be5a6f3d
G3D (a commercial-grade C++ 3D engine available as Open Source (BSD License)
http://g3d.sourceforge.net/
@@ -23,11 +27,19 @@ G3D (a commercial-grade C++ 3D engine available as Open Source (BSD License)
jemalloc (a general-purpose scalable concurrent malloc-implementation)
http://www.canonware.com/jemalloc/
Version: 3.6.0
-
+
libMPQ (a library for reading MPQ files)
https://github.com/mbroemme/libmpq/
Version: d59b4cf1d107b5f6a0f67d6bc545c6c6ebef3d74
+libreadline (command line editing library)
+ https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
+ Version: external
+
+OpenSSL (general-purpose cryptography library)
+ https://www.openssl.org/
+ Version: external
+
SFMT (SIMD-oriented Fast Mersenne Twister)
Based on http://agner.org/random/
Version: 2010-Aug-03
@@ -42,7 +54,7 @@ zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library)
gSOAP (a portable development toolkit for C and C++ XML Web services and XML data bindings)
http://gsoap2.sourceforge.net/
- Version: 2.8.17r
+ Version: 2.8.33
recastnavigation (Recast is state of the art navigation mesh construction toolset for games)
https://github.com/memononen/recastnavigation
diff --git a/src/server/scripts/World/CMakeLists.txt b/dep/SFMT/CMakeLists.txt
index 17b3f2d8492..5cf1b9bf972 100644
--- a/src/server/scripts/World/CMakeLists.txt
+++ b/dep/SFMT/CMakeLists.txt
@@ -8,11 +8,8 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-file(GLOB_RECURSE sources_World World/*.cpp World/*.h)
+add_library(sfmt INTERFACE)
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- ${sources_World}
-)
-
-message(" -> Prepared: World")
+target_include_directories(sfmt
+ INTERFACE
+ ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/cmake/macros/ConfigureBoost.cmake b/dep/boost/CMakeLists.txt
index b3a71b8a682..fc20347c2c8 100644
--- a/cmake/macros/ConfigureBoost.cmake
+++ b/dep/boost/CMakeLists.txt
@@ -1,3 +1,13 @@
+# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
if(WIN32)
set(BOOST_DEBUG ON)
if(DEFINED ENV{BOOST_ROOT})
@@ -14,14 +24,9 @@ if(WIN32)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
-
- add_definitions(-D_WIN32_WINNT=0x0601)
endif()
-find_package(Boost 1.49 REQUIRED system filesystem thread program_options iostreams regex)
-add_definitions(-DBOOST_DATE_TIME_NO_LIB)
-add_definitions(-DBOOST_REGEX_NO_LIB)
-add_definitions(-DBOOST_CHRONO_NO_LIB)
+find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams)
# Find if Boost was compiled in C++03 mode because it requires -DBOOST_NO_CXX11_SCOPED_ENUMS
@@ -30,24 +35,36 @@ include (CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_INCLUDES ${Boost_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_IOSTREAMS_LIBRARY})
set(CMAKE_REQUIRED_FLAGS "-std=c++11")
-unset(boost_filesystem_copy_links_without_NO_SCOPED_ENUM CACHE)
check_cxx_source_compiles("
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
int main() { boost::filesystem::copy_file(boost::filesystem::path(), boost::filesystem::path()); }"
boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
-unset(CMAKE_REQUIRED_INCLUDES CACHE)
-unset(CMAKE_REQUIRED_LIBRARIES CACHE)
-unset(CMAKE_REQUIRED_FLAGS CACHE)
+unset(CMAKE_REQUIRED_INCLUDES)
+unset(CMAKE_REQUIRED_LIBRARIES)
+unset(CMAKE_REQUIRED_FLAGS)
-if (NOT boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
- if (Boost_VERSION LESS 105100) # 1.51
- add_definitions(-DBOOST_NO_SCOPED_ENUMS)
- else()
- add_definitions(-DBOOST_NO_CXX11_SCOPED_ENUMS)
- endif()
-endif()
+add_library(boost INTERFACE)
+
+target_link_libraries(boost
+ INTERFACE
+ ${Boost_LIBRARIES})
+
+target_include_directories(boost
+ INTERFACE
+ ${Boost_INCLUDE_DIRS})
-if(Boost_FOUND)
- include_directories(${Boost_INCLUDE_DIRS})
+if (boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
+ target_compile_definitions(boost
+ INTERFACE
+ -DBOOST_DATE_TIME_NO_LIB
+ -DBOOST_REGEX_NO_LIB
+ -DBOOST_CHRONO_NO_LIB)
+else()
+ target_compile_definitions(boost
+ INTERFACE
+ -DBOOST_DATE_TIME_NO_LIB
+ -DBOOST_REGEX_NO_LIB
+ -DBOOST_CHRONO_NO_LIB
+ -DBOOST_NO_CXX11_SCOPED_ENUMS)
endif()
diff --git a/dep/bzip2/CMakeLists.txt b/dep/bzip2/CMakeLists.txt
index d3aadbe002e..d5a7414f383 100644
--- a/dep/bzip2/CMakeLists.txt
+++ b/dep/bzip2/CMakeLists.txt
@@ -8,15 +8,30 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-file(GLOB sources *.c)
+if(UNIX)
+ # Look for an installed bzip2 on unix
+ find_package(BZip2 REQUIRED)
-set(bzip2_STAT_SRCS
- ${sources}
-)
+ add_library(bzip2 SHARED IMPORTED GLOBAL)
-include_directories(
- ${CMAKE_SOURCE_DIR}/dep/zlib
- ${CMAKE_CURRENT_SOURCE_DIR}
-)
+ set_target_properties(bzip2
+ PROPERTIES
+ IMPORTED_LOCATION
+ "${BZIP2_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES
+ "${BZIP2_INCLUDE_DIRS}")
+else()
+ # Use the bundled source on windows
+ file(GLOB sources *.c)
+ add_library(bzip2 STATIC
+ ${sources})
-add_library(bzip2 STATIC ${bzip2_STAT_SRCS})
+ target_include_directories(bzip2
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR})
+
+ set_target_properties(bzip2
+ PROPERTIES
+ FOLDER
+ "dep")
+endif()
diff --git a/dep/cppformat/CMakeLists.txt b/dep/cppformat/CMakeLists.txt
index 3be3e5f6dbb..1cbff49b871 100644
--- a/dep/cppformat/CMakeLists.txt
+++ b/dep/cppformat/CMakeLists.txt
@@ -1,31 +1,37 @@
-include(CheckCXXCompilerFlag)
-include(CheckSymbolExists)
-
-set(FMT_SOURCES format.cc format.h)
-
-# Use variadic templates
-add_definitions(-DFMT_VARIADIC_TEMPLATES=1)
-
-# Use deleted functions
-add_definitions(-DFMT_USE_DELETED_FUNCTIONS=1)
-
-# Use static assert
-add_definitions(-DFMT_USE_STATIC_ASSERT=1)
+# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+include(CheckSymbolExists)
if (WIN32)
check_symbol_exists(open io.h HAVE_OPEN)
else ()
check_symbol_exists(open fcntl.h HAVE_OPEN)
endif ()
+set(FMT_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/cppformat/format.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/cppformat/format.cc)
+
if (HAVE_OPEN)
- add_definitions(-DFMT_USE_FILE_DESCRIPTORS=1)
- set(FMT_SOURCES ${FMT_SOURCES} posix.cc posix.h)
-endif ()
+ set(FMT_SOURCES ${FMT_SOURCES}
+ ${CMAKE_CURRENT_SOURCE_DIR}/cppformat/posix.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/cppformat/posix.cc)
+endif()
-add_library(format STATIC ${FMT_SOURCES})
+add_library(cppformat STATIC ${FMT_SOURCES})
-if (CMAKE_COMPILER_IS_GNUCXX)
- set_target_properties(format PROPERTIES COMPILE_FLAGS
- "-Wall -Wextra -Wshadow -pedantic")
-endif ()
+target_include_directories(cppformat
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR})
+
+set_target_properties(cppformat
+ PROPERTIES
+ FOLDER
+ "dep")
diff --git a/dep/cppformat/README.rst b/dep/cppformat/README.rst
index fb4399f0af4..e859f909466 100644
--- a/dep/cppformat/README.rst
+++ b/dep/cppformat/README.rst
@@ -28,9 +28,9 @@ Features
* Format API with `format string syntax
<http://cppformat.github.io/latest/syntax.html>`_
similar to the one used by `str.format
- <http://docs.python.org/2/library/stdtypes.html#str.format>`_ in Python.
+ <https://docs.python.org/2/library/stdtypes.html#str.format>`_ in Python.
* Safe `printf implementation
- <http://cppformat.github.io/latest/reference.html#printf-formatting-functions>`_
+ <http://cppformat.github.io/latest/api.html#printf-formatting-functions>`_
including the POSIX extension for positional arguments.
* Support for user-defined types.
* High speed: performance of the format API is close to that of
@@ -103,10 +103,10 @@ An object of any user-defined type for which there is an overloaded
// s == "The date is 2012-12-9"
You can use the `FMT_VARIADIC
-<http://cppformat.github.io/latest/reference.html#utilities>`_
+<http://cppformat.github.io/latest/api.html#utilities>`_
macro to create your own functions similar to `format
-<http://cppformat.github.io/latest/reference.html#format>`_ and
-`print <http://cppformat.github.io/latest/reference.html#print>`_
+<http://cppformat.github.io/latest/api.html#format>`_ and
+`print <http://cppformat.github.io/latest/api.html#print>`_
which take arbitrary arguments:
.. code:: c++
@@ -132,13 +132,17 @@ Projects using this library
* `AMPL/MP <https://github.com/ampl/mp>`_:
An open-source library for mathematical programming
-* `HarpyWar/pvpgn <https://github.com/HarpyWar/pvpgn>`_:
+* `HarpyWar/pvpgn <https://github.com/pvpgn/pvpgn-server>`_:
Player vs Player Gaming Network with tweaks
-* `KBEngine <http://www.kbengine.org/>`_: An open-source MMOG server engine
+* `KBEngine <http://kbengine.org/>`_: An open-source MMOG server engine
+
+* `Keypirinha <http://keypirinha.com/>`_: A semantic launcher for Windows
* `Lifeline <https://github.com/peter-clark/lifeline>`_: A 2D game
+* `MongoDB Smasher <https://github.com/duckie/mongo_smasher>`_: A small tool to generate randomized datasets
+
* `PenUltima Online (POL) <http://www.polserver.com/>`_:
An MMO server, compatible with most Ultima Online clients
@@ -148,7 +152,7 @@ Projects using this library
* `redis-cerberus <https://github.com/HunanTV/redis-cerberus>`_: A Redis cluster proxy
-* `Saddy <https://code.google.com/p/saddy/>`_:
+* `Saddy <https://github.com/mamontov-cpp/saddy-graphics-engine-2d>`_:
Small crossplatform 2D graphic engine
* `Salesforce Analytics Cloud <http://www.salesforce.com/analytics-cloud/overview/>`_:
@@ -188,7 +192,7 @@ doesn't support user-defined types. Printf also has safety issues although
they are mostly solved with `__attribute__ ((format (printf, ...))
<http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html>`_ in GCC.
There is a POSIX extension that adds positional arguments required for
-`i18n <http://en.wikipedia.org/wiki/Internationalization_and_localization>`_
+`i18n <https://en.wikipedia.org/wiki/Internationalization_and_localization>`_
to printf but it is not a part of C99 and may not be available on some
platforms.
@@ -376,18 +380,13 @@ C++ Format is distributed under the BSD `license
The `Format String Syntax
<http://cppformat.github.io/latest/syntax.html>`_
section in the documentation is based on the one from Python `string module
-documentation <http://docs.python.org/3/library/string.html#module-string>`_
+documentation <https://docs.python.org/3/library/string.html#module-string>`_
adapted for the current library. For this reason the documentation is
distributed under the Python Software Foundation license available in
`doc/python-license.txt
<https://raw.github.com/cppformat/cppformat/master/doc/python-license.txt>`_.
It only applies if you distribute the documentation of C++ Format.
-Links
------
-
-`API changes/compatibility report <http://upstream-tracker.org/versions/cppformat.html>`_
-
Acknowledgments
---------------
diff --git a/dep/cppformat/format.cc b/dep/cppformat/cppformat/format.cc
index 1970d53c500..daccd68f1da 100644
--- a/dep/cppformat/format.cc
+++ b/dep/cppformat/cppformat/format.cc
@@ -207,10 +207,15 @@ void format_error_code(fmt::Writer &out, int error_code,
out.clear();
static const char SEP[] = ": ";
static const char ERROR_STR[] = "error ";
- fmt::internal::IntTraits<int>::MainType ec_value = error_code;
// Subtract 2 to account for terminating null characters in SEP and ERROR_STR.
std::size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 2;
- error_code_size += fmt::internal::count_digits(ec_value);
+ typedef fmt::internal::IntTraits<int>::MainType MainType;
+ MainType abs_value = static_cast<MainType>(error_code);
+ if (internal::is_negative(error_code)) {
+ abs_value = 0 - abs_value;
+ ++error_code_size;
+ }
+ error_code_size += fmt::internal::count_digits(abs_value);
if (message.size() <= fmt::internal::INLINE_BUFFER_SIZE - error_code_size)
out << message << SEP;
out << ERROR_STR << error_code;
@@ -252,7 +257,7 @@ class WidthHandler : public fmt::internal::ArgVisitor<WidthHandler, unsigned> {
template <typename T>
unsigned visit_any_int(T value) {
typedef typename fmt::internal::IntTraits<T>::MainType UnsignedType;
- UnsignedType width = value;
+ UnsignedType width = static_cast<UnsignedType>(value);
if (fmt::internal::is_negative(value)) {
spec_.align_ = fmt::ALIGN_LEFT;
width = 0 - width;
@@ -278,8 +283,21 @@ class PrecisionHandler :
}
};
-// Converts an integer argument to an integral type T for printf.
+template <typename T, typename U>
+struct is_same {
+ enum { value = 0 };
+};
+
template <typename T>
+struct is_same<T, T> {
+ enum { value = 1 };
+};
+
+// An argument visitor that converts an integer argument to T for printf,
+// if T is an integral type. If T is void, the argument is converted to
+// corresponding signed or unsigned type depending on the type specifier:
+// 'd' and 'i' - signed, other - unsigned)
+template <typename T = void>
class ArgConverter : public fmt::internal::ArgVisitor<ArgConverter<T>, void> {
private:
fmt::internal::Arg &arg_;
@@ -300,21 +318,25 @@ class ArgConverter : public fmt::internal::ArgVisitor<ArgConverter<T>, void> {
void visit_any_int(U value) {
bool is_signed = type_ == 'd' || type_ == 'i';
using fmt::internal::Arg;
- if (sizeof(T) <= sizeof(int)) {
+ typedef typename fmt::internal::Conditional<
+ is_same<T, void>::value, U, T>::type TargetType;
+ if (sizeof(TargetType) <= sizeof(int)) {
// Extra casts are used to silence warnings.
if (is_signed) {
arg_.type = Arg::INT;
- arg_.int_value = static_cast<int>(static_cast<T>(value));
+ arg_.int_value = static_cast<int>(static_cast<TargetType>(value));
} else {
arg_.type = Arg::UINT;
- arg_.uint_value = static_cast<unsigned>(
- static_cast<typename fmt::internal::MakeUnsigned<T>::Type>(value));
+ typedef typename fmt::internal::MakeUnsigned<TargetType>::Type Unsigned;
+ arg_.uint_value = static_cast<unsigned>(static_cast<Unsigned>(value));
}
} else {
if (is_signed) {
arg_.type = Arg::LONG_LONG;
- arg_.long_long_value =
- static_cast<typename fmt::internal::MakeUnsigned<U>::Type>(value);
+ // glibc's printf doesn't sign extend arguments of smaller types:
+ // std::printf("%lld", -42); // prints "4294967254"
+ // but we don't have to do the same because it's a UB.
+ arg_.long_long_value = static_cast<fmt::LongLong>(value);
} else {
arg_.type = Arg::ULONG_LONG;
arg_.ulong_long_value =
@@ -340,6 +362,21 @@ class CharConverter : public fmt::internal::ArgVisitor<CharConverter, void> {
arg_.int_value = static_cast<char>(value);
}
};
+
+// Write the content of w to os.
+void write(std::ostream &os, fmt::Writer &w) {
+ const char *data = w.data();
+ typedef internal::MakeUnsigned<std::streamsize>::Type UnsignedStreamSize;
+ UnsignedStreamSize size = w.size();
+ UnsignedStreamSize max_size =
+ internal::to_unsigned((std::numeric_limits<std::streamsize>::max)());
+ do {
+ UnsignedStreamSize n = size <= max_size ? size : max_size;
+ os.write(data, static_cast<std::streamsize>(n));
+ data += n;
+ size -= n;
+ } while (size != 0);
+}
} // namespace
namespace internal {
@@ -551,27 +588,25 @@ FMT_FUNC void fmt::WindowsError::init(
FMT_FUNC void fmt::internal::format_windows_error(
fmt::Writer &out, int error_code,
fmt::StringRef message) FMT_NOEXCEPT {
- class String {
- private:
- LPWSTR str_;
-
- public:
- String() : str_() {}
- ~String() { LocalFree(str_); }
- LPWSTR *ptr() { return &str_; }
- LPCWSTR c_str() const { return str_; }
- };
FMT_TRY {
- String system_message;
- if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0,
- error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- reinterpret_cast<LPWSTR>(system_message.ptr()), 0, 0)) {
- UTF16ToUTF8 utf8_message;
- if (utf8_message.convert(system_message.c_str()) == ERROR_SUCCESS) {
- out << message << ": " << utf8_message;
- return;
+ MemoryBuffer<wchar_t, INLINE_BUFFER_SIZE> buffer;
+ buffer.resize(INLINE_BUFFER_SIZE);
+ for (;;) {
+ wchar_t *system_message = &buffer[0];
+ int result = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ 0, error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ system_message, static_cast<uint32_t>(buffer.size()), 0);
+ if (result != 0) {
+ UTF16ToUTF8 utf8_message;
+ if (utf8_message.convert(system_message) == ERROR_SUCCESS) {
+ out << message << ": " << utf8_message;
+ return;
+ }
+ break;
}
+ if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+ break; // Can't get error message, report error code instead.
+ buffer.resize(buffer.size() * 2);
}
} FMT_CATCH(...) {}
fmt::format_error_code(out, error_code, message); // 'fmt::' is for bcc32.
@@ -616,7 +651,7 @@ void fmt::internal::ArgMap<Char>::init(const ArgList &args) {
return;
case internal::Arg::NAMED_ARG:
named_arg = static_cast<const NamedArg*>(args.values_[i].pointer);
- map_.insert(Pair(named_arg->name, *named_arg));
+ map_.push_back(Pair(named_arg->name, *named_arg));
break;
default:
/*nothing*/;
@@ -628,7 +663,7 @@ void fmt::internal::ArgMap<Char>::init(const ArgList &args) {
internal::Arg::Type arg_type = args.type(i);
if (arg_type == internal::Arg::NAMED_ARG) {
named_arg = static_cast<const NamedArg*>(args.args_[i].pointer);
- map_.insert(Pair(named_arg->name, *named_arg));
+ map_.push_back(Pair(named_arg->name, *named_arg));
}
}
for (unsigned i = ArgList::MAX_PACKED_ARGS;/*nothing*/; ++i) {
@@ -637,7 +672,7 @@ void fmt::internal::ArgMap<Char>::init(const ArgList &args) {
return;
case internal::Arg::NAMED_ARG:
named_arg = static_cast<const NamedArg*>(args.args_[i].pointer);
- map_.insert(Pair(named_arg->name, *named_arg));
+ map_.push_back(Pair(named_arg->name, *named_arg));
break;
default:
/*nothing*/;
@@ -659,6 +694,7 @@ FMT_FUNC Arg fmt::internal::FormatterBase::do_get_arg(
break;
case Arg::NAMED_ARG:
arg = *static_cast<const internal::Arg*>(arg.pointer);
+ break;
default:
/*nothing*/;
}
@@ -763,7 +799,7 @@ void fmt::internal::PrintfFormatter<Char>::format(
if (*s == '.') {
++s;
if ('0' <= *s && *s <= '9') {
- spec.precision_ = parse_nonnegative_int(s);
+ spec.precision_ = static_cast<int>(parse_nonnegative_int(s));
} else if (*s == '*') {
++s;
spec.precision_ = PrecisionHandler().visit(get_arg(s));
@@ -772,7 +808,7 @@ void fmt::internal::PrintfFormatter<Char>::format(
Arg arg = get_arg(s, arg_index);
if (spec.flag(HASH_FLAG) && IsZeroInt().visit(arg))
- spec.flags_ &= ~HASH_FLAG;
+ spec.flags_ &= ~to_unsigned<int>(HASH_FLAG);
if (spec.fill_ == '0') {
if (arg.type <= Arg::LAST_NUMERIC_TYPE)
spec.align_ = ALIGN_NUMERIC;
@@ -809,7 +845,7 @@ void fmt::internal::PrintfFormatter<Char>::format(
break;
default:
--s;
- ArgConverter<int>(arg, *s).visit(arg);
+ ArgConverter<void>(arg, *s).visit(arg);
}
// Parse type.
@@ -861,10 +897,11 @@ FMT_FUNC void fmt::print(CStringRef format_str, ArgList args) {
print(stdout, format_str, args);
}
-FMT_FUNC void fmt::print(std::ostream &os, CStringRef format_str, ArgList args) {
+FMT_FUNC void fmt::print(std::ostream &os, CStringRef format_str,
+ ArgList args) {
MemoryWriter w;
w.write(format_str, args);
- os.write(w.data(), w.size());
+ write(os, w);
}
FMT_FUNC void fmt::print_colored(Color c, CStringRef format, ArgList args) {
@@ -882,6 +919,13 @@ FMT_FUNC int fmt::fprintf(std::FILE *f, CStringRef format, ArgList args) {
return std::fwrite(w.data(), 1, size, f) < size ? -1 : static_cast<int>(size);
}
+FMT_FUNC int fmt::fprintf(std::ostream &os, CStringRef format, ArgList args) {
+ MemoryWriter w;
+ printf(w, format, args);
+ write(os, w);
+ return static_cast<int>(w.size());
+}
+
#ifndef FMT_HEADER_ONLY
template struct fmt::internal::BasicData<void>;
diff --git a/dep/cppformat/format.h b/dep/cppformat/cppformat/format.h
index a98a166091b..08bb9b5d9e8 100644
--- a/dep/cppformat/format.h
+++ b/dep/cppformat/cppformat/format.h
@@ -28,14 +28,6 @@
#ifndef FMT_FORMAT_H_
#define FMT_FORMAT_H_
-#if defined _MSC_VER && _MSC_VER <= 1500
-typedef unsigned int uint32_t;
-typedef unsigned long long uint64_t;
-typedef long long intmax_t;
-#else
-#include <stdint.h>
-#endif
-
#include <cassert>
#include <cmath>
#include <cstdio>
@@ -44,7 +36,8 @@ typedef long long intmax_t;
#include <memory>
#include <stdexcept>
#include <string>
-#include <map>
+#include <vector>
+#include <utility>
#ifndef FMT_USE_IOSTREAMS
# define FMT_USE_IOSTREAMS 1
@@ -64,40 +57,23 @@ typedef long long intmax_t;
# include <iterator>
#endif
-#ifdef _MSC_VER
-# include <intrin.h> // _BitScanReverse, _BitScanReverse64
-
-namespace fmt {
-namespace internal {
-# pragma intrinsic(_BitScanReverse)
-inline uint32_t clz(uint32_t x) {
- unsigned long r = 0;
- _BitScanReverse(&r, x);
- return 31 - r;
-}
-# define FMT_BUILTIN_CLZ(n) fmt::internal::clz(n)
-
-# ifdef _WIN64
-# pragma intrinsic(_BitScanReverse64)
-# endif
-
-inline uint32_t clzll(uint64_t x) {
- unsigned long r = 0;
-# ifdef _WIN64
- _BitScanReverse64(&r, x);
-# else
- // Scan the high 32 bits.
- if (_BitScanReverse(&r, static_cast<uint32_t>(x >> 32)))
- return 63 - (r + 32);
+#if defined(_MSC_VER) && _MSC_VER <= 1500
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+typedef __int64 intmax_t;
+#else
+#include <stdint.h>
+#endif
- // Scan the low 32 bits.
- _BitScanReverse(&r, static_cast<uint32_t>(x));
+#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
+# ifdef FMT_EXPORT
+# define FMT_API __declspec(dllexport)
+# elif defined(FMT_SHARED)
+# define FMT_API __declspec(dllimport)
# endif
- return 63 - r;
-}
-# define FMT_BUILTIN_CLZLL(n) fmt::internal::clzll(n)
-}
-}
+#endif
+#ifndef FMT_API
+# define FMT_API
#endif
#ifdef __GNUC__
@@ -174,21 +150,6 @@ inline uint32_t clzll(uint64_t x) {
# include <utility> // for std::move
#endif
-// Define FMT_USE_NOEXCEPT to make C++ Format use noexcept (C++11 feature).
-#ifndef FMT_USE_NOEXCEPT
-# define FMT_USE_NOEXCEPT 0
-#endif
-
-#ifndef FMT_NOEXCEPT
-# if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \
- (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || \
- _MSC_VER >= 1900
-# define FMT_NOEXCEPT noexcept
-# else
-# define FMT_NOEXCEPT throw()
-# endif
-#endif
-
// Check if exceptions are disabled.
#if defined(__GNUC__) && !defined(__EXCEPTIONS)
# define FMT_EXCEPTIONS 0
@@ -208,6 +169,25 @@ inline uint32_t clzll(uint64_t x) {
# endif
#endif
+// Define FMT_USE_NOEXCEPT to make C++ Format use noexcept (C++11 feature).
+#ifndef FMT_USE_NOEXCEPT
+# define FMT_USE_NOEXCEPT 0
+#endif
+
+#ifndef FMT_NOEXCEPT
+# if FMT_EXCEPTIONS
+# if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \
+ (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || \
+ _MSC_VER >= 1900
+# define FMT_NOEXCEPT noexcept
+# else
+# define FMT_NOEXCEPT throw()
+# endif
+# else
+# define FMT_NOEXCEPT
+# endif
+#endif
+
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#ifndef FMT_USE_DELETED_FUNCTIONS
@@ -241,6 +221,67 @@ inline uint32_t clzll(uint64_t x) {
# define FMT_ASSERT(condition, message) assert((condition) && message)
#endif
+
+#if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clz)
+# define FMT_BUILTIN_CLZ(n) __builtin_clz(n)
+#endif
+
+#if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clzll)
+# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
+#endif
+
+// Some compilers masquerade as both MSVC and GCC-likes or
+// otherwise support __builtin_clz and __builtin_clzll, so
+// only define FMT_BUILTIN_CLZ using the MSVC intrinsics
+// if the clz and clzll builtins are not available.
+#if defined(_MSC_VER) && !defined(FMT_BUILTIN_CLZLL)
+# include <intrin.h> // _BitScanReverse, _BitScanReverse64
+
+namespace fmt {
+namespace internal {
+# pragma intrinsic(_BitScanReverse)
+inline uint32_t clz(uint32_t x) {
+ unsigned long r = 0;
+ _BitScanReverse(&r, x);
+
+ assert(x != 0);
+ // Static analysis complains about using uninitialized data
+ // "r", but the only way that can happen is if "x" is 0,
+ // which the callers guarantee to not happen.
+# pragma warning(suppress: 6102)
+ return 31 - r;
+}
+# define FMT_BUILTIN_CLZ(n) fmt::internal::clz(n)
+
+# ifdef _WIN64
+# pragma intrinsic(_BitScanReverse64)
+# endif
+
+inline uint32_t clzll(uint64_t x) {
+ unsigned long r = 0;
+# ifdef _WIN64
+ _BitScanReverse64(&r, x);
+# else
+ // Scan the high 32 bits.
+ if (_BitScanReverse(&r, static_cast<uint32_t>(x >> 32)))
+ return 63 - (r + 32);
+
+ // Scan the low 32 bits.
+ _BitScanReverse(&r, static_cast<uint32_t>(x));
+# endif
+
+ assert(x != 0);
+ // Static analysis complains about using uninitialized data
+ // "r", but the only way that can happen is if "x" is 0,
+ // which the callers guarantee to not happen.
+# pragma warning(suppress: 6102)
+ return 63 - r;
+}
+# define FMT_BUILTIN_CLZLL(n) fmt::internal::clzll(n)
+}
+}
+#endif
+
namespace fmt {
namespace internal {
struct DummyInt {
@@ -396,7 +437,7 @@ class BasicStringRef {
return std::basic_string<Char>(data_, size_);
}
- /** Returns the pointer to a C string. */
+ /** Returns a pointer to the string data. */
const Char *data() const { return data_; }
/** Returns the string size. */
@@ -492,6 +533,29 @@ class FormatError : public std::runtime_error {
};
namespace internal {
+
+// MakeUnsigned<T>::Type gives an unsigned type corresponding to integer type T.
+template <typename T>
+struct MakeUnsigned { typedef T Type; };
+
+#define FMT_SPECIALIZE_MAKE_UNSIGNED(T, U) \
+ template <> \
+ struct MakeUnsigned<T> { typedef U Type; }
+
+FMT_SPECIALIZE_MAKE_UNSIGNED(char, unsigned char);
+FMT_SPECIALIZE_MAKE_UNSIGNED(signed char, unsigned char);
+FMT_SPECIALIZE_MAKE_UNSIGNED(short, unsigned short);
+FMT_SPECIALIZE_MAKE_UNSIGNED(int, unsigned);
+FMT_SPECIALIZE_MAKE_UNSIGNED(long, unsigned long);
+FMT_SPECIALIZE_MAKE_UNSIGNED(LongLong, ULongLong);
+
+// Casts nonnegative integer to unsigned.
+template <typename Int>
+inline typename MakeUnsigned<Int>::Type to_unsigned(Int value) {
+ FMT_ASSERT(value >= 0, "negative value");
+ return static_cast<typename MakeUnsigned<Int>::Type>(value);
+}
+
// The number of characters to store in the MemoryBuffer object itself
// to avoid dynamic memory allocation.
enum { INLINE_BUFFER_SIZE = 500 };
@@ -581,8 +645,7 @@ class Buffer {
template <typename T>
template <typename U>
void Buffer<T>::append(const U *begin, const U *end) {
- assert(begin <= end);
- std::size_t new_size = size_ + (end - begin);
+ std::size_t new_size = size_ + internal::to_unsigned(end - begin);
if (new_size > capacity_)
grow(new_size);
std::uninitialized_copy(begin, end,
@@ -592,8 +655,8 @@ void Buffer<T>::append(const U *begin, const U *end) {
namespace internal {
-// A memory buffer for POD types with the first SIZE elements stored in
-// the object itself.
+// A memory buffer for trivially copyable/constructible types with the first SIZE
+// elements stored in the object itself.
template <typename T, std::size_t SIZE, typename Allocator = std::allocator<T> >
class MemoryBuffer : private Allocator, public Buffer<T> {
private:
@@ -676,7 +739,7 @@ class FixedBuffer : public fmt::Buffer<Char> {
FixedBuffer(Char *array, std::size_t size) : fmt::Buffer<Char>(array, size) {}
protected:
- void grow(std::size_t size);
+ FMT_API void grow(std::size_t size);
};
template <typename Char>
@@ -704,7 +767,7 @@ class CharTraits<char> : public BasicCharTraits<char> {
// Formats a floating-point number.
template <typename T>
- static int format_float(char *buffer, std::size_t size,
+ FMT_API static int format_float(char *buffer, std::size_t size,
const char *format, unsigned width, int precision, T value);
};
@@ -715,7 +778,7 @@ class CharTraits<wchar_t> : public BasicCharTraits<wchar_t> {
static wchar_t convert(wchar_t value) { return value; }
template <typename T>
- static int format_float(wchar_t *buffer, std::size_t size,
+ FMT_API static int format_float(wchar_t *buffer, std::size_t size,
const wchar_t *format, unsigned width, int precision, T value);
};
@@ -754,27 +817,12 @@ struct IntTraits {
TypeSelector<std::numeric_limits<T>::digits <= 32>::Type MainType;
};
-// MakeUnsigned<T>::Type gives an unsigned type corresponding to integer type T.
-template <typename T>
-struct MakeUnsigned { typedef T Type; };
-
-#define FMT_SPECIALIZE_MAKE_UNSIGNED(T, U) \
- template <> \
- struct MakeUnsigned<T> { typedef U Type; }
-
-FMT_SPECIALIZE_MAKE_UNSIGNED(char, unsigned char);
-FMT_SPECIALIZE_MAKE_UNSIGNED(signed char, unsigned char);
-FMT_SPECIALIZE_MAKE_UNSIGNED(short, unsigned short);
-FMT_SPECIALIZE_MAKE_UNSIGNED(int, unsigned);
-FMT_SPECIALIZE_MAKE_UNSIGNED(long, unsigned long);
-FMT_SPECIALIZE_MAKE_UNSIGNED(LongLong, ULongLong);
-
-void report_unknown_type(char code, const char *type);
+FMT_API void report_unknown_type(char code, const char *type);
// Static data is placed in this class template to allow header-only
// configuration.
template <typename T = void>
-struct BasicData {
+struct FMT_API BasicData {
static const uint32_t POWERS_OF_10_32[];
static const uint64_t POWERS_OF_10_64[];
static const char DIGITS[];
@@ -782,22 +830,14 @@ struct BasicData {
typedef BasicData<> Data;
-#if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clz)
-# define FMT_BUILTIN_CLZ(n) __builtin_clz(n)
-#endif
-
-#if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clzll)
-# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
-#endif
-
#ifdef FMT_BUILTIN_CLZLL
// Returns the number of decimal digits in n. Leading zeros are not counted
// except for n == 0 in which case count_digits returns 1.
inline unsigned count_digits(uint64_t n) {
// Based on http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
// and the benchmark https://github.com/localvoid/cxx-benchmark-count-digits.
- unsigned t = (64 - FMT_BUILTIN_CLZLL(n | 1)) * 1233 >> 12;
- return t - (n < Data::POWERS_OF_10_64[t]) + 1;
+ int t = (64 - FMT_BUILTIN_CLZLL(n | 1)) * 1233 >> 12;
+ return to_unsigned(t) - (n < Data::POWERS_OF_10_64[t]) + 1;
}
#else
// Fallback version of count_digits used when __builtin_clz is not available.
@@ -820,8 +860,8 @@ inline unsigned count_digits(uint64_t n) {
#ifdef FMT_BUILTIN_CLZ
// Optional version of count_digits for better performance on 32-bit platforms.
inline unsigned count_digits(uint32_t n) {
- uint32_t t = (32 - FMT_BUILTIN_CLZ(n | 1)) * 1233 >> 12;
- return t - (n < Data::POWERS_OF_10_32[t]) + 1;
+ int t = (32 - FMT_BUILTIN_CLZ(n | 1)) * 1233 >> 12;
+ return to_unsigned(t) - (n < Data::POWERS_OF_10_32[t]) + 1;
}
#endif
@@ -863,7 +903,7 @@ class UTF8ToUTF16 {
MemoryBuffer<wchar_t, INLINE_BUFFER_SIZE> buffer_;
public:
- explicit UTF8ToUTF16(StringRef s);
+ FMT_API explicit UTF8ToUTF16(StringRef s);
operator WStringRef() const { return WStringRef(&buffer_[0], size()); }
size_t size() const { return buffer_.size() - 1; }
const wchar_t *c_str() const { return &buffer_[0]; }
@@ -878,7 +918,7 @@ class UTF16ToUTF8 {
public:
UTF16ToUTF8() {}
- explicit UTF16ToUTF8(WStringRef s);
+ FMT_API explicit UTF16ToUTF8(WStringRef s);
operator StringRef() const { return StringRef(&buffer_[0], size()); }
size_t size() const { return buffer_.size() - 1; }
const char *c_str() const { return &buffer_[0]; }
@@ -887,15 +927,15 @@ class UTF16ToUTF8 {
// Performs conversion returning a system error code instead of
// throwing exception on conversion error. This method may still throw
// in case of memory allocation error.
- int convert(WStringRef s);
+ FMT_API int convert(WStringRef s);
};
-void format_windows_error(fmt::Writer &out, int error_code,
- fmt::StringRef message) FMT_NOEXCEPT;
+FMT_API void format_windows_error(fmt::Writer &out, int error_code,
+ fmt::StringRef message) FMT_NOEXCEPT;
#endif
-void format_system_error(fmt::Writer &out, int error_code,
- fmt::StringRef message) FMT_NOEXCEPT;
+FMT_API void format_system_error(fmt::Writer &out, int error_code,
+ fmt::StringRef message) FMT_NOEXCEPT;
// A formatting argument value.
struct Value {
@@ -938,8 +978,8 @@ struct Value {
};
};
-// A formatting argument. It is a POD type to allow storage in
-// internal::MemoryBuffer.
+// A formatting argument. It is a trivially copyable/constructible type to
+// allow storage in internal::MemoryBuffer.
struct Arg : Value {
Type type;
};
@@ -976,6 +1016,7 @@ template <typename T>
T &get();
struct DummyStream : std::ostream {
+ DummyStream(); // Suppress a bogus warning in MSVC.
// Hide all operator<< overloads from std::ostream.
void operator<<(Null<>);
};
@@ -1199,17 +1240,27 @@ class MakeValue : public Arg {
static uint64_t type(const NamedArg<Char_> &) { return Arg::NAMED_ARG; }
};
+template <typename Formatter>
+class MakeArg : public Arg {
+public:
+ MakeArg() {
+ type = Arg::NONE;
+ }
+
+ template <typename T>
+ MakeArg(const T &value)
+ : Arg(MakeValue<Formatter>(value)) {
+ type = static_cast<Arg::Type>(MakeValue<Formatter>::type(value));
+ }
+};
+
template <typename Char>
struct NamedArg : Arg {
BasicStringRef<Char> name;
- typedef internal::MakeValue< BasicFormatter<Char> > MakeValue;
-
template <typename T>
NamedArg(BasicStringRef<Char> argname, const T &value)
- : Arg(MakeValue(value)), name(argname) {
- type = static_cast<Arg::Type>(MakeValue::type(value));
- }
+ : Arg(MakeArg< BasicFormatter<Char> >(value)), name(argname) {}
};
#define FMT_DISPATCH(call) static_cast<Impl*>(this)->call
@@ -1631,17 +1682,22 @@ namespace internal {
template <typename Char>
class ArgMap {
private:
- typedef std::map<fmt::BasicStringRef<Char>, internal::Arg> MapType;
+ typedef std::vector<std::pair<fmt::BasicStringRef<Char>, internal::Arg> > MapType;
typedef typename MapType::value_type Pair;
MapType map_;
public:
- void init(const ArgList &args);
+ FMT_API void init(const ArgList &args);
const internal::Arg* find(const fmt::BasicStringRef<Char> &name) const {
- typename MapType::const_iterator it = map_.find(name);
- return it != map_.end() ? &it->second : 0;
+ // The list is unsorted, so just return the first matching name.
+ for (typename MapType::const_iterator it = map_.begin(), end = map_.end();
+ it != end; ++it) {
+ if (it->first == name)
+ return &it->second;
+ }
+ return 0;
}
};
@@ -1767,7 +1823,7 @@ class FormatterBase {
int next_arg_index_;
// Returns the argument with specified index.
- Arg do_get_arg(unsigned arg_index, const char *&error);
+ FMT_API Arg do_get_arg(unsigned arg_index, const char *&error);
protected:
const ArgList &args() const { return args_; }
@@ -1780,7 +1836,7 @@ class FormatterBase {
// Returns the next argument.
Arg next_arg(const char *&error) {
if (next_arg_index_ >= 0)
- return do_get_arg(next_arg_index_++, error);
+ return do_get_arg(internal::to_unsigned(next_arg_index_++), error);
error = "cannot switch from manual to automatic argument indexing";
return Arg();
}
@@ -1803,7 +1859,7 @@ class FormatterBase {
template <typename Char>
void write(BasicWriter<Char> &w, const Char *start, const Char *end) {
if (start != end)
- w << BasicStringRef<Char>(start, end - start);
+ w << BasicStringRef<Char>(start, internal::to_unsigned(end - start));
}
};
@@ -1823,14 +1879,16 @@ class PrintfFormatter : private FormatterBase {
public:
explicit PrintfFormatter(const ArgList &args) : FormatterBase(args) {}
- void format(BasicWriter<Char> &writer, BasicCStringRef<Char> format_str);
+ FMT_API void format(BasicWriter<Char> &writer,
+ BasicCStringRef<Char> format_str);
};
} // namespace internal
-// A formatter.
+/** This template formats data and writes the output to a writer. */
template <typename CharType>
class BasicFormatter : private internal::FormatterBase {
public:
+ /** The character type for the output. */
typedef CharType Char;
private:
@@ -1852,13 +1910,23 @@ class BasicFormatter : private internal::FormatterBase {
internal::Arg parse_arg_name(const Char *&s);
public:
+ /**
+ \rst
+ Constructs a ``BasicFormatter`` object. References to the arguments and
+ the writer are stored in the formatter object so make sure they have
+ appropriate lifetimes.
+ \endrst
+ */
BasicFormatter(const ArgList &args, BasicWriter<Char> &w)
: internal::FormatterBase(args), writer_(w) {}
+ /** Returns a reference to the writer associated with this formatter. */
BasicWriter<Char> &writer() { return writer_; }
+ /** Formats stored arguments and writes the output to the writer. */
void format(BasicCStringRef<Char> format_str);
+ // Formats a single argument and advances format_str, a format string pointer.
const Char *format(const Char *&format_str, const internal::Arg &arg);
};
@@ -1889,16 +1957,29 @@ inline uint64_t make_type(const T &arg) {
return MakeValue< BasicFormatter<char> >::type(arg);
}
+template <unsigned N, bool/*IsPacked*/= (N < ArgList::MAX_PACKED_ARGS)>
+struct ArgArray;
+
+template <unsigned N>
+struct ArgArray<N, true/*IsPacked*/> {
+ typedef Value Type[N > 0 ? N : 1];
+
+ template <typename Formatter, typename T>
+ static Value make(const T &value) {
+ Value result = MakeValue<Formatter>(value);
+ // Workaround a bug in Apple LLVM version 4.2 (clang-425.0.28) of clang:
+ // https://github.com/cppformat/cppformat/issues/276
+ (void)result.custom.format;
+ return result;
+ }
+};
+
template <unsigned N>
-struct ArgArray {
- // Computes the argument array size by adding 1 to N, which is the number of
- // arguments, if N is zero, because array of zero size is invalid, or if N
- // is greater than ArgList::MAX_PACKED_ARGS to accommodate for an extra
- // argument that marks the end of the list.
- enum { SIZE = N + (N == 0 || N >= ArgList::MAX_PACKED_ARGS ? 1 : 0) };
-
- typedef typename Conditional<
- (N < ArgList::MAX_PACKED_ARGS), Value, Arg>::type Type[SIZE];
+struct ArgArray<N, false/*IsPacked*/> {
+ typedef Arg Type[N + 1]; // +1 for the list end Arg::NONE
+
+ template <typename Formatter, typename T>
+ static Arg make(const T &value) { return MakeArg<Formatter>(value); }
};
#if FMT_USE_VARIADIC_TEMPLATES
@@ -1907,47 +1988,6 @@ inline uint64_t make_type(const Arg &first, const Args & ... tail) {
return make_type(first) | (make_type(tail...) << 4);
}
-inline void do_set_types(Arg *) {}
-
-template <typename T, typename... Args>
-inline void do_set_types(Arg *args, const T &arg, const Args & ... tail) {
- args->type = static_cast<Arg::Type>(
- MakeValue< BasicFormatter<char> >::type(arg));
- do_set_types(args + 1, tail...);
-}
-
-template <typename... Args>
-inline void set_types(Arg *array, const Args & ... args) {
- if (check(sizeof...(Args) > ArgList::MAX_PACKED_ARGS))
- do_set_types(array, args...);
- array[sizeof...(Args)].type = Arg::NONE;
-}
-
-template <typename... Args>
-inline void set_types(Value *, const Args & ...) {
- // Do nothing as types are passed separately from values.
-}
-
-template <typename Formatter, typename Value>
-inline void store_args(Value *) {}
-
-template <typename Formatter, typename Arg, typename T, typename... Args>
-inline void store_args(Arg *args, const T &arg, const Args & ... tail) {
- // Assign only the Value subobject of Arg and don't overwrite type (if any)
- // that is assigned by set_types.
- Value &value = *args;
- value = MakeValue<Formatter>(arg);
- store_args<Formatter>(args + 1, tail...);
-}
-
-template <typename Formatter, typename... Args>
-ArgList make_arg_list(typename ArgArray<sizeof...(Args)>::Type array,
- const Args & ... args) {
- if (check(sizeof...(Args) >= ArgList::MAX_PACKED_ARGS))
- set_types(array, args...);
- store_args<Formatter>(array, args...);
- return ArgList(make_type(args...), array);
-}
#else
struct ArgType {
@@ -1985,7 +2025,7 @@ class FormatBuf : public std::basic_streambuf<Char> {
int_type overflow(int_type ch = traits_type::eof()) {
if (!traits_type::eq_int_type(ch, traits_type::eof())) {
- size_t size = this->pptr() - start_;
+ size_t size = this->size();
buffer_.resize(size);
buffer_.reserve(size * 2);
@@ -1997,7 +2037,7 @@ class FormatBuf : public std::basic_streambuf<Char> {
}
size_t size() const {
- return this->pptr() - start_;
+ return to_unsigned(this->pptr() - start_);
}
};
} // namespace internal
@@ -2015,18 +2055,20 @@ class FormatBuf : public std::basic_streambuf<Char> {
# define FMT_VARIADIC_VOID(func, arg_type) \
template <typename... Args> \
void func(arg_type arg0, const Args & ... args) { \
- typename fmt::internal::ArgArray<sizeof...(Args)>::Type array; \
- func(arg0, fmt::internal::make_arg_list< \
- fmt::BasicFormatter<Char> >(array, args...)); \
+ typedef fmt::internal::ArgArray<sizeof...(Args)> ArgArray; \
+ typename ArgArray::Type array{ \
+ ArgArray::template make<fmt::BasicFormatter<Char> >(args)...}; \
+ func(arg0, fmt::ArgList(fmt::internal::make_type(args...), array)); \
}
// Defines a variadic constructor.
# define FMT_VARIADIC_CTOR(ctor, func, arg0_type, arg1_type) \
template <typename... Args> \
ctor(arg0_type arg0, arg1_type arg1, const Args & ... args) { \
- typename fmt::internal::ArgArray<sizeof...(Args)>::Type array; \
- func(arg0, arg1, fmt::internal::make_arg_list< \
- fmt::BasicFormatter<Char> >(array, args...)); \
+ typedef fmt::internal::ArgArray<sizeof...(Args)> ArgArray; \
+ typename ArgArray::Type array{ \
+ ArgArray::template make<fmt::BasicFormatter<Char> >(args)...}; \
+ func(arg0, arg1, fmt::ArgList(fmt::internal::make_type(args...), array)); \
}
#else
@@ -2207,7 +2249,8 @@ class BasicWriter {
// Writes a decimal integer.
template <typename Int>
void write_decimal(Int value) {
- typename internal::IntTraits<Int>::MainType abs_value = value;
+ typedef typename internal::IntTraits<Int>::MainType MainType;
+ MainType abs_value = static_cast<MainType>(value);
if (internal::is_negative(value)) {
abs_value = 0 - abs_value;
*write_unsigned_decimal(abs_value, 1) = '-';
@@ -2474,9 +2517,9 @@ void BasicWriter<Char>::write_str(
return;
}
}
- std::size_t precision = spec.precision_;
+ std::size_t precision = static_cast<std::size_t>(spec.precision_);
if (spec.precision_ >= 0 && precision < str_size)
- str_size = spec.precision_;
+ str_size = precision;
write_str(str_value, str_size, spec);
}
@@ -2510,7 +2553,8 @@ typename BasicWriter<Char>::CharPtr
// is specified.
if (prefix_size > 0 && prefix[prefix_size - 1] == '0')
--prefix_size;
- unsigned number_size = prefix_size + spec.precision();
+ unsigned number_size =
+ prefix_size + internal::to_unsigned(spec.precision());
AlignSpec subspec(number_size, '0', ALIGN_NUMERIC);
if (number_size >= width)
return prepare_int_buffer(num_digits, subspec, prefix, prefix_size);
@@ -2564,7 +2608,7 @@ template <typename T, typename Spec>
void BasicWriter<Char>::write_int(T value, Spec spec) {
unsigned prefix_size = 0;
typedef typename internal::IntTraits<T>::MainType UnsignedType;
- UnsignedType abs_value = value;
+ UnsignedType abs_value = static_cast<UnsignedType>(value);
char prefix[4] = "";
if (internal::is_negative(value)) {
prefix[0] = '-';
@@ -2643,8 +2687,7 @@ void BasicWriter<Char>::write_int(T value, Spec spec) {
template <typename Char>
template <typename T>
-void BasicWriter<Char>::write_double(
- T value, const FormatSpec &spec) {
+void BasicWriter<Char>::write_double(T value, const FormatSpec &spec) {
// Check type.
char type = spec.type();
bool upper = false;
@@ -2744,6 +2787,8 @@ void BasicWriter<Char>::write_double(
// Format using snprintf.
Char fill = internal::CharTraits<Char>::cast(spec.fill());
+ unsigned n = 0;
+ Char *start = 0;
for (;;) {
std::size_t buffer_size = buffer_.capacity() - offset;
#ifdef _MSC_VER
@@ -2755,41 +2800,44 @@ void BasicWriter<Char>::write_double(
buffer_size = buffer_.capacity() - offset;
}
#endif
- Char *start = &buffer_[offset];
- int n = internal::CharTraits<Char>::format_float(
+ start = &buffer_[offset];
+ int result = internal::CharTraits<Char>::format_float(
start, buffer_size, format, width_for_sprintf, spec.precision(), value);
- if (n >= 0 && offset + n < buffer_.capacity()) {
- if (sign) {
- if ((spec.align() != ALIGN_RIGHT && spec.align() != ALIGN_DEFAULT) ||
- *start != ' ') {
- *(start - 1) = sign;
- sign = 0;
- } else {
- *(start - 1) = fill;
- }
- ++n;
- }
- if (spec.align() == ALIGN_CENTER &&
- spec.width() > static_cast<unsigned>(n)) {
- width = spec.width();
- CharPtr p = grow_buffer(width);
- std::memmove(get(p) + (width - n) / 2, get(p), n * sizeof(Char));
- fill_padding(p, spec.width(), n, fill);
- return;
- }
- if (spec.fill() != ' ' || sign) {
- while (*start == ' ')
- *start++ = fill;
- if (sign)
- *(start - 1) = sign;
- }
- grow_buffer(n);
- return;
+ if (result >= 0) {
+ n = internal::to_unsigned(result);
+ if (offset + n < buffer_.capacity())
+ break; // The buffer is large enough - continue with formatting.
+ buffer_.reserve(offset + n + 1);
+ } else {
+ // If result is negative we ask to increase the capacity by at least 1,
+ // but as std::vector, the buffer grows exponentially.
+ buffer_.reserve(buffer_.capacity() + 1);
}
- // If n is negative we ask to increase the capacity by at least 1,
- // but as std::vector, the buffer grows exponentially.
- buffer_.reserve(n >= 0 ? offset + n + 1 : buffer_.capacity() + 1);
}
+ if (sign) {
+ if ((spec.align() != ALIGN_RIGHT && spec.align() != ALIGN_DEFAULT) ||
+ *start != ' ') {
+ *(start - 1) = sign;
+ sign = 0;
+ } else {
+ *(start - 1) = fill;
+ }
+ ++n;
+ }
+ if (spec.align() == ALIGN_CENTER && spec.width() > n) {
+ width = spec.width();
+ CharPtr p = grow_buffer(width);
+ std::memmove(get(p) + (width - n) / 2, get(p), n * sizeof(Char));
+ fill_padding(p, spec.width(), n, fill);
+ return;
+ }
+ if (spec.fill() != ' ' || sign) {
+ while (*start == ' ')
+ *start++ = fill;
+ if (sign)
+ *(start - 1) = sign;
+ }
+ grow_buffer(n);
}
/**
@@ -2920,22 +2968,21 @@ void format(BasicFormatter<Char> &f, const Char *&format_str, const T &value) {
output << value;
BasicStringRef<Char> str(&buffer[0], format_buf.size());
- typedef internal::MakeValue< BasicFormatter<Char> > MakeValue;
- internal::Arg arg = MakeValue(str);
- arg.type = static_cast<internal::Arg::Type>(MakeValue::type(str));
- format_str = f.format(format_str, arg);
+ typedef internal::MakeArg< BasicFormatter<Char> > MakeArg;
+ format_str = f.format(format_str, MakeArg(str));
}
// Reports a system error without throwing an exception.
// Can be used to report errors from destructors.
-void report_system_error(int error_code, StringRef message) FMT_NOEXCEPT;
+FMT_API void report_system_error(int error_code,
+ StringRef message) FMT_NOEXCEPT;
#if FMT_USE_WINDOWS_H
/** A Windows error. */
class WindowsError : public SystemError {
private:
- void init(int error_code, CStringRef format_str, ArgList args);
+ FMT_API void init(int error_code, CStringRef format_str, ArgList args);
public:
/**
@@ -2974,7 +3021,8 @@ class WindowsError : public SystemError {
// Reports a Windows error without throwing an exception.
// Can be used to report errors from destructors.
-void report_windows_error(int error_code, StringRef message) FMT_NOEXCEPT;
+FMT_API void report_windows_error(int error_code,
+ StringRef message) FMT_NOEXCEPT;
#endif
@@ -2986,7 +3034,7 @@ enum Color { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE };
Example:
print_colored(fmt::RED, "Elapsed time: {0:.2f} seconds", 1.23);
*/
-void print_colored(Color c, CStringRef format, ArgList args);
+FMT_API void print_colored(Color c, CStringRef format, ArgList args);
/**
\rst
@@ -3018,7 +3066,7 @@ inline std::wstring format(WCStringRef format_str, ArgList args) {
print(stderr, "Don't {}!", "panic");
\endrst
*/
-void print(std::FILE *f, CStringRef format_str, ArgList args);
+FMT_API void print(std::FILE *f, CStringRef format_str, ArgList args);
/**
\rst
@@ -3029,7 +3077,7 @@ void print(std::FILE *f, CStringRef format_str, ArgList args);
print("Elapsed time: {0:.2f} seconds", 1.23);
\endrst
*/
-void print(CStringRef format_str, ArgList args);
+FMT_API void print(CStringRef format_str, ArgList args);
template <typename Char>
void printf(BasicWriter<Char> &w, BasicCStringRef<Char> format, ArgList args) {
@@ -3066,7 +3114,7 @@ inline std::wstring sprintf(WCStringRef format, ArgList args) {
fmt::fprintf(stderr, "Don't %s!", "panic");
\endrst
*/
-int fprintf(std::FILE *f, CStringRef format, ArgList args);
+FMT_API int fprintf(std::FILE *f, CStringRef format, ArgList args);
/**
\rst
@@ -3132,10 +3180,10 @@ class FormatInt {
explicit FormatInt(unsigned long value) : str_(format_decimal(value)) {}
explicit FormatInt(ULongLong value) : str_(format_decimal(value)) {}
- /**
- Returns the number of characters written to the output buffer.
- */
- std::size_t size() const { return buffer_ - str_ + BUFFER_SIZE - 1; }
+ /** Returns the number of characters written to the output buffer. */
+ std::size_t size() const {
+ return internal::to_unsigned(buffer_ - str_ + BUFFER_SIZE - 1);
+ }
/**
Returns a pointer to the output buffer content. No terminating null
@@ -3165,7 +3213,8 @@ class FormatInt {
// write a terminating null character.
template <typename T>
inline void format_decimal(char *&buffer, T value) {
- typename internal::IntTraits<T>::MainType abs_value = value;
+ typedef typename internal::IntTraits<T>::MainType MainType;
+ MainType abs_value = static_cast<MainType>(value);
if (internal::is_negative(value)) {
*buffer++ = '-';
abs_value = 0 - abs_value;
@@ -3245,10 +3294,11 @@ void arg(WStringRef, const internal::NamedArg<Char>&) FMT_DELETED_OR_UNDEFINED;
template <typename... Args> \
ReturnType func(FMT_FOR_EACH(FMT_ADD_ARG_NAME, __VA_ARGS__), \
const Args & ... args) { \
- typename fmt::internal::ArgArray<sizeof...(Args)>::Type array; \
+ typedef fmt::internal::ArgArray<sizeof...(Args)> ArgArray; \
+ typename ArgArray::Type array{ \
+ ArgArray::template make<fmt::BasicFormatter<Char> >(args)...}; \
call(FMT_FOR_EACH(FMT_GET_ARG_NAME, __VA_ARGS__), \
- fmt::internal::make_arg_list< \
- fmt::BasicFormatter<Char> >(array, args...)); \
+ fmt::ArgList(fmt::internal::make_type(args...), array)); \
}
#else
// Defines a wrapper for a function taking __VA_ARGS__ arguments
@@ -3361,8 +3411,20 @@ FMT_VARIADIC(int, fprintf, std::FILE *, CStringRef)
print(cerr, "Don't {}!", "panic");
\endrst
*/
-void print(std::ostream &os, CStringRef format_str, ArgList args);
+FMT_API void print(std::ostream &os, CStringRef format_str, ArgList args);
FMT_VARIADIC(void, print, std::ostream &, CStringRef)
+
+/**
+ \rst
+ Prints formatted data to the stream *os*.
+
+ **Example**::
+
+ fprintf(cerr, "Don't %s!", "panic");
+ \endrst
+ */
+FMT_API int fprintf(std::ostream &os, CStringRef format_str, ArgList args);
+FMT_VARIADIC(int, fprintf, std::ostream &, CStringRef)
#endif
namespace internal {
@@ -3374,7 +3436,7 @@ inline bool is_name_start(Char c) {
// Parses an unsigned integer advancing s to the end of the parsed input.
// This function assumes that the first character of s is a digit.
template <typename Char>
-int parse_nonnegative_int(const Char *&s) {
+unsigned parse_nonnegative_int(const Char *&s) {
assert('0' <= *s && *s <= '9');
unsigned value = 0;
do {
@@ -3453,7 +3515,6 @@ inline internal::Arg BasicFormatter<Char>::parse_arg_name(const Char *&s) {
return arg;
}
-// Should be after FormatSpec
template <typename Char>
const Char *BasicFormatter<Char>::format(
const Char *&format_str, const internal::Arg &arg) {
diff --git a/dep/cppformat/posix.cc b/dep/cppformat/cppformat/posix.cc
index 756281a0ebd..c6c2ae2c413 100644
--- a/dep/cppformat/posix.cc
+++ b/dep/cppformat/cppformat/posix.cc
@@ -173,7 +173,7 @@ std::size_t fmt::File::read(void *buffer, std::size_t count) {
FMT_RETRY(result, FMT_POSIX_CALL(read(fd_, buffer, convert_rwcount(count))));
if (result < 0)
throw SystemError(errno, "cannot read from file");
- return result;
+ return internal::to_unsigned(result);
}
std::size_t fmt::File::write(const void *buffer, std::size_t count) {
@@ -181,7 +181,7 @@ std::size_t fmt::File::write(const void *buffer, std::size_t count) {
FMT_RETRY(result, FMT_POSIX_CALL(write(fd_, buffer, convert_rwcount(count))));
if (result < 0)
throw SystemError(errno, "cannot write to file");
- return result;
+ return internal::to_unsigned(result);
}
fmt::File fmt::File::dup(int fd) {
diff --git a/dep/cppformat/posix.h b/dep/cppformat/cppformat/posix.h
index 88bcb4f557b..bfbd3851838 100644
--- a/dep/cppformat/posix.h
+++ b/dep/cppformat/cppformat/posix.h
@@ -34,11 +34,17 @@
#endif
#include <errno.h>
-#include <fcntl.h> // for O_RDONLY
+#include <fcntl.h> // for O_RDONLY
+#include <locale.h> // for locale_t
#include <stdio.h>
+#include <stdlib.h> // for strtod_l
#include <cstddef>
+#ifdef __APPLE__
+# include <xlocale.h> // for LC_NUMERIC_MASK on OS X
+#endif
+
#include "format.h"
#ifndef FMT_POSIX
@@ -299,7 +305,8 @@ class File {
// Closes the file.
void close();
- // Returns the file size.
+ // Returns the file size. The size has signed type for consistency with
+ // stat::st_size.
LongLong size() const;
// Attempts to read count bytes from the file into the specified buffer.
@@ -331,6 +338,58 @@ class File {
// Returns the memory page size.
long getpagesize();
+
+#if defined(LC_NUMERIC_MASK) || defined(_MSC_VER)
+# define FMT_LOCALE
+#endif
+
+#ifdef FMT_LOCALE
+// A "C" numeric locale.
+class Locale {
+ private:
+# ifdef _MSC_VER
+ typedef _locale_t locale_t;
+
+ enum { LC_NUMERIC_MASK = LC_NUMERIC };
+
+ static locale_t newlocale(int category_mask, const char *locale, locale_t) {
+ return _create_locale(category_mask, locale);
+ }
+
+ static void freelocale(locale_t locale) {
+ _free_locale(locale);
+ }
+
+ static double strtod_l(const char *nptr, char **endptr, _locale_t locale) {
+ return _strtod_l(nptr, endptr, locale);
+ }
+# endif
+
+ locale_t locale_;
+
+ FMT_DISALLOW_COPY_AND_ASSIGN(Locale);
+
+ public:
+ typedef locale_t Type;
+
+ Locale() : locale_(newlocale(LC_NUMERIC_MASK, "C", NULL)) {
+ if (!locale_)
+ throw fmt::SystemError(errno, "cannot create locale");
+ }
+ ~Locale() { freelocale(locale_); }
+
+ Type get() const { return locale_; }
+
+ // Converts string to floating-point number and advances str past the end
+ // of the parsed input.
+ double strtod(const char *&str) const {
+ char *end = 0;
+ double result = strtod_l(str, &end, locale_);
+ str = end;
+ return result;
+ }
+};
+#endif // FMT_LOCALE
} // namespace fmt
#if !FMT_USE_RVALUE_REFERENCES
diff --git a/dep/efsw/.hg_archival.txt b/dep/efsw/.hg_archival.txt
new file mode 100644
index 00000000000..19565afb668
--- /dev/null
+++ b/dep/efsw/.hg_archival.txt
@@ -0,0 +1,5 @@
+repo: 78c2ea8c48b213ee0078d6326a1dd719d0844764
+node: ff0b69daeca1edf7785a8a580518e462be5a6f3d
+branch: default
+latesttag: null
+latesttagdistance: 144
diff --git a/dep/efsw/CMakeLists.txt b/dep/efsw/CMakeLists.txt
new file mode 100644
index 00000000000..eecc5531944
--- /dev/null
+++ b/dep/efsw/CMakeLists.txt
@@ -0,0 +1,85 @@
+if (BUILD_SHARED_LIBS)
+ set(SRCS
+ src/efsw/DirectorySnapshot.cpp
+ src/efsw/DirectorySnapshotDiff.cpp
+ src/efsw/DirWatcherGeneric.cpp
+ src/efsw/FileInfo.cpp
+ src/efsw/FileSystem.cpp
+ src/efsw/FileWatcher.cpp
+ src/efsw/FileWatcherCWrapper.cpp
+ src/efsw/FileWatcherGeneric.cpp
+ src/efsw/FileWatcherImpl.cpp
+ src/efsw/Log.cpp
+ src/efsw/Mutex.cpp
+ src/efsw/String.cpp
+ src/efsw/System.cpp
+ src/efsw/Thread.cpp
+ src/efsw/Watcher.cpp
+ src/efsw/WatcherGeneric.cpp)
+
+ if(WIN32)
+ list(APPEND SRCS
+ src/efsw/platform/win/FileSystemImpl.cpp
+ src/efsw/platform/win/MutexImpl.cpp
+ src/efsw/platform/win/SystemImpl.cpp
+ src/efsw/platform/win/ThreadImpl.cpp)
+ else()
+ list(APPEND SRCS
+ src/efsw/platform/posix/FileSystemImpl.cpp
+ src/efsw/platform/posix/MutexImpl.cpp
+ src/efsw/platform/posix/SystemImpl.cpp
+ src/efsw/platform/posix/ThreadImpl.cpp)
+ endif()
+
+ if (WIN32)
+ list(APPEND SRCS
+ src/efsw/WatcherWin32.cpp
+ src/efsw/FileWatcherWin32.cpp)
+ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ list(APPEND SRCS
+ src/efsw/FileWatcherInotify.cpp
+ src/efsw/WatcherInotify.cpp)
+
+ if (NOT EXISTS "/usr/include/sys/inotify.h" AND NOT EXISTS "/usr/local/include/sys/inotify.h")
+ add_definitions(-DEFSW_INOTIFY_NOSYS)
+ endif()
+ elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR APPLE)
+ list(APPEND SRCS
+ src/efsw/FileWatcherKqueue.cpp
+ src/efsw/WatcherKqueue.cpp)
+
+ if (APPLE)
+ list(APPEND SRCS
+ src/efsw/FileWatcherFSEvents.cpp
+ src/efsw/WatcherFSEvents.cpp)
+
+ exec_program(uname ARGS -v OUTPUT_VARIABLE OSX_VERSION)
+ string(REGEX MATCH "[0-9]+" OSX_VERSION ${OSX_VERSION})
+ if (NOT OSX_VERSION GREATER 9)
+ add_definitions(-DEFSW_FSEVENTS_NOT_SUPPORTED)
+ endif()
+
+ set(OPTIONAL_MAC_LINK_LIBRARIES "-framework CoreFoundation" "-framework CoreServices")
+ endif()
+ endif()
+
+ add_library(efsw STATIC ${SRCS})
+
+ target_include_directories(efsw
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/src)
+
+ target_link_libraries(efsw
+ PUBLIC
+ threads
+ ${OPTIONAL_MAC_LINK_LIBRARIES})
+
+ set_target_properties(efsw
+ PROPERTIES
+ FOLDER
+ "dep")
+else()
+ add_library(efsw INTERFACE IMPORTED GLOBAL)
+endif()
diff --git a/dep/efsw/LICENSE b/dep/efsw/LICENSE
new file mode 100644
index 00000000000..ac8ac28988d
--- /dev/null
+++ b/dep/efsw/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Martín Lucas Golini
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+This software is a fork of the "simplefilewatcher" by James Wynn (james@jameswynn.com)
+http://code.google.com/p/simplefilewatcher/ also MIT licensed. \ No newline at end of file
diff --git a/dep/efsw/README.md b/dep/efsw/README.md
new file mode 100644
index 00000000000..fda0bb599aa
--- /dev/null
+++ b/dep/efsw/README.md
@@ -0,0 +1,138 @@
+Entropia File System Watcher
+============================
+**efsw** is a C++ cross-platform file system watcher and notifier.
+
+**efsw** monitors the file system asynchronously for changes to files and directories by watching a list of specified paths, and raises events when a directory or file change.
+
+**efsw** supports recursive directories watch, tracking the entire sub directory tree.
+
+**efsw** currently supports the following platforms:
+
+* Linux via [inotify](http://en.wikipedia.org/wiki/Inotify)
+
+* Windows via [I/O Completion Ports](http://en.wikipedia.org/wiki/IOCP)
+
+* Mac OS X via [FSEvents](http://en.wikipedia.org/wiki/FSEvents) or [kqueue](http://en.wikipedia.org/wiki/Kqueue)
+
+* FreeBSD/BSD via [kqueue](http://en.wikipedia.org/wiki/Kqueue)
+
+* OS-independent generic watcher
+(polling the disk for directory snapshots and comparing them periodically)
+
+If any of the backend fails to start by any reason, it will fallback to the OS-independent implementation.
+This should never happen, except for the Kqueue implementation, see `Platform limitations and clarifications`.
+
+**Code License**
+--------------
+[MIT License](http://www.opensource.org/licenses/mit-license.php)
+
+**Some example code:**
+--------------------
+
+ :::c++
+ // Inherits from the abstract listener class, and implements the the file action handler
+ class UpdateListener : public efsw::FileWatchListener
+ {
+ public:
+ UpdateListener() {}
+
+ void handleFileAction( efsw::WatchID watchid, const std::string& dir, const std::string& filename, efsw::Action action, std::string oldFilename = "" )
+ {
+ switch( action )
+ {
+ case efsw::Actions::Add:
+ std::cout << "DIR (" << dir << ") FILE (" << filename << ") has event Added" << std::endl;
+ break;
+ case efsw::Actions::Delete:
+ std::cout << "DIR (" << dir << ") FILE (" << filename << ") has event Delete" << std::endl;
+ break;
+ case efsw::Actions::Modified:
+ std::cout << "DIR (" << dir << ") FILE (" << filename << ") has event Modified" << std::endl;
+ break;
+ case efsw::Actions::Moved:
+ std::cout << "DIR (" << dir << ") FILE (" << filename << ") has event Moved from (" << oldFilename << ")" << std::endl;
+ break;
+ default:
+ std::cout << "Should never happen!" << std::endl;
+ }
+ }
+ };
+
+ // Create the file system watcher instance
+ // efsw::FileWatcher allow a first boolean parameter that indicates if it should start with the generic file watcher instead of the platform specific backend
+ efsw::FileWatcher * fileWatcher = new efsw::FileWatcher();
+
+ // Create the instance of your efsw::FileWatcherListener implementation
+ UpdateListener * listener = new UpdateListener();
+
+ // Add a folder to watch, and get the efsw::WatchID
+ // It will watch the /tmp folder recursively ( the third parameter indicates that is recursive )
+ // Reporting the files and directories changes to the instance of the listener
+ efsw::WatchID watchID = fileWatcher->addWatch( "/tmp", listener, true );
+
+ // Adds another directory to watch. This time as non-recursive.
+ efsw::WatchID watchID2 = fileWatcher->addWatch( "/usr", listener, false );
+
+ // Start watching asynchronously the directories
+ fileWatcher.watch();
+
+ // Remove the second watcher added
+ // You can also call removeWatch by passing the watch path ( it must end with an slash or backslash in windows, since that's how internally it's saved )
+ fileWatcher->removeWatch( watchID2 );
+
+**Dependencies**
+--------------
+None :)
+
+**Compiling**
+------------
+To generate project files you will need to [download and install](http://industriousone.com/premake/download) [Premake](http://industriousone.com/what-premake)
+
+Then you can generate the project for your platform just going to the project directory where the premake4.lua file is located and then execute:
+
+`premake4 gmake` to generate project Makefiles, then `cd make/*YOURPLATFORM*/`, and finally `make` or `make config=release` ( it will generate the static lib, the shared lib and the test application ).
+
+or
+
+`premake4 vs2010` to generate Visual Studio 2010 project.
+
+or
+
+`premake4 xcode4` to generate Xcode 4 project.
+
+There is also a cmake file that i don't oficially support but it works just fine, provided by [Mohammed Nafees](https://bitbucket.org/binaryking).
+
+**Platform limitations and clarifications**
+-------------------------------------------
+
+Directory paths are expected to be encoded as UTF-8 strings in all platforms.
+
+handleFileAction returns UTF-8 strings in all platforms.
+
+Windows and FSEvents Mac OS X implementation can't follow symlinks ( it will ignore followSymlinks() and allowOutOfScopeLinks() ).
+
+Kqueue implementation is limited by the maximun number of file descriptors allowed per process by the OS, in the case of reaching the file descriptors limit ( in BSD around 18000 and in OS X around 10240 ) it will fallback to the generic file watcher.
+
+OS X will only use Kqueue if OS X version is below to 10.5, and this implementation needs to be compiled separately from the OS X >= 10.5 implementation. Since there's no way to compile FSEvents backend in OS X below 10.5.
+
+FSEvents for OS X Lion and beyond in some cases will generate more actions that in reality ocurred, since fine-grained implementation of FSEvents doesn't give the order of the actions retrieved, in some cases i need to guess/aproximate the order of them.
+
+Generic watcher relies on the inode information to detect file and directories renames/move. Since Windows has no concept of inodes as Unix platforms do, there is no current reliable way of determining file/directory movement on Windows without help from the Windows API ( this is replaced with Add/Delete events ).
+
+Linux versions below 2.6.13 are not supported, since inotify wasn't implemented yet. I'm not interested in support older kernels, since i don't see the point. If someone needs this open an issue in the issue tracker and i may consider implenent a dnotify backend.
+
+OS-independent watcher, Kqueue and FSEvents for OS X below 10.5 keep cache of the directories structures, to be able to detect changes in the directories. This means that there's a memory overhead for this backends.
+
+**Useful information**
+--------------------
+The project also comes with a C API wrapper, contributed by [Sepul Sepehr Taghdisian](https://bitbucket.org/sepul).
+
+There's a string manipulation class not exposed in the efsw header ( efsw::String ) that can be used to make string encoding conversion.
+
+
+**Clarifications**
+----------------
+
+This software started as a fork of the [simplefilewatcher](http://code.google.com/p/simplefilewatcher/) by James Wynn (james[at]jameswynn.com), [MIT licensed](http://www.opensource.org/licenses/mit-license.html).
+
+The icon used for the project is part of the [Haiku®'s Icons](http://www.haiku-inc.org/haiku-icons.html), [MIT licensed](http://www.opensource.org/licenses/mit-license.html).
diff --git a/dep/efsw/include/efsw/efsw.h b/dep/efsw/include/efsw/efsw.h
new file mode 100644
index 00000000000..28e63e2139e
--- /dev/null
+++ b/dep/efsw/include/efsw/efsw.h
@@ -0,0 +1,151 @@
+/**
+ @author Sepul Sepehr Taghdisian
+
+ Copyright (c) 2013 Martin Lucas Golini
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+ This software is a fork of the "simplefilewatcher" by James Wynn (james@jameswynn.com)
+ http://code.google.com/p/simplefilewatcher/ also MIT licensed.
+*/
+/** This is the C API wrapper of EFSW */
+#ifndef ESFW_H
+#define ESFW_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WIN32)
+ #ifdef EFSW_DYNAMIC
+ // Windows platforms
+ #ifdef EFSW_EXPORTS
+ // From DLL side, we must export
+ #define EFSW_API __declspec(dllexport)
+ #else
+ // From client application side, we must import
+ #define EFSW_API __declspec(dllimport)
+ #endif
+ #else
+ // No specific directive needed for static build
+ #ifndef EFSW_API
+ #define EFSW_API
+ #endif
+ #endif
+#else
+ #if ( __GNUC__ >= 4 ) && defined( EFSW_EXPORTS )
+ #define EFSW_API __attribute__ ((visibility("default")))
+ #endif
+
+ // Other platforms don't need to define anything
+ #ifndef EFSW_API
+ #define EFSW_API
+ #endif
+#endif
+
+/// Type for a watch id
+typedef long efsw_watchid;
+
+/// Type for watcher
+typedef void* efsw_watcher;
+
+enum efsw_action
+{
+ EFSW_ADD = 1, /// Sent when a file is created or renamed
+ EFSW_DELETE = 2, /// Sent when a file is deleted or renamed
+ EFSW_MODIFIED = 3, /// Sent when a file is modified
+ EFSW_MOVED = 4 /// Sent when a file is moved
+};
+
+enum efsw_error
+{
+ EFSW_NOTFOUND = -1,
+ EFSW_REPEATED = -2,
+ EFSW_OUTOFSCOPE = -3,
+ EFSW_NOTREADABLE = -4,
+ EFSW_REMOTE = -5,
+ EFSW_UNSPECIFIED = -6
+};
+
+/// Basic interface for listening for file events.
+typedef void (*efsw_pfn_fileaction_callback) (
+ efsw_watcher watcher,
+ efsw_watchid watchid,
+ const char* dir,
+ const char* filename,
+ enum efsw_action action,
+ const char* old_filename,
+ void* param
+);
+
+/**
+ * Creates a new file-watcher
+ * @param generic_mode Force the use of the Generic file watcher
+ */
+efsw_watcher EFSW_API efsw_create(int generic_mode);
+
+/// Release the file-watcher and unwatch any directories
+void EFSW_API efsw_release(efsw_watcher watcher);
+
+/// Retreive last error occured by file-watcher
+EFSW_API const char* efsw_getlasterror();
+
+/// Add a directory watch. Same as the other addWatch, but doesn't have recursive option.
+/// For backwards compatibility.
+/// On error returns WatchID with Error type.
+efsw_watchid EFSW_API efsw_addwatch(efsw_watcher watcher, const char* directory,
+ efsw_pfn_fileaction_callback callback_fn, int recursive, void* param);
+
+/// Remove a directory watch. This is a brute force search O(nlogn).
+void EFSW_API efsw_removewatch(efsw_watcher watcher, const char* directory);
+
+/// Remove a directory watch. This is a map lookup O(logn).
+void EFSW_API efsw_removewatch_byid(efsw_watcher watcher, efsw_watchid watchid);
+
+/// Starts watching ( in other thread )
+void EFSW_API efsw_watch(efsw_watcher watcher);
+
+/**
+ * Allow recursive watchers to follow symbolic links to other directories
+ * followSymlinks is disabled by default
+ */
+void EFSW_API efsw_follow_symlinks(efsw_watcher watcher, int enable);
+
+/** @return If can follow symbolic links to directorioes */
+int EFSW_API efsw_follow_symlinks_isenabled(efsw_watcher watcher);
+
+/**
+ * When enable this it will allow symlinks to watch recursively out of the pointed directory.
+ * follorSymlinks must be enabled to this work.
+ * For example, added symlink to /home/folder, and the symlink points to /, this by default is not allowed,
+ * it's only allowed to symlink anything from /home/ and deeper. This is to avoid great levels of recursion.
+ * Enabling this could lead in infinite recursion, and crash the watcher ( it will try not to avoid this ).
+ * Buy enabling out of scope links, it will allow this behavior.
+ * allowOutOfScopeLinks are disabled by default.
+ */
+void EFSW_API efsw_allow_outofscopelinks(efsw_watcher watcher, int allow);
+
+/// @return Returns if out of scope links are allowed
+int EFSW_API efsw_outofscopelinks_isallowed(efsw_watcher watcher);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/dep/efsw/include/efsw/efsw.hpp b/dep/efsw/include/efsw/efsw.hpp
new file mode 100644
index 00000000000..0693bb296f0
--- /dev/null
+++ b/dep/efsw/include/efsw/efsw.hpp
@@ -0,0 +1,197 @@
+/**
+ @author Martín Lucas Golini
+
+ Copyright (c) 2013 Martín Lucas Golini
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+ This software is a fork of the "simplefilewatcher" by James Wynn (james@jameswynn.com)
+ http://code.google.com/p/simplefilewatcher/ also MIT licensed.
+*/
+
+#ifndef ESFW_HPP
+#define ESFW_HPP
+
+#include <string>
+#include <list>
+
+#if defined(_WIN32)
+ #ifdef EFSW_DYNAMIC
+ // Windows platforms
+ #ifdef EFSW_EXPORTS
+ // From DLL side, we must export
+ #define EFSW_API __declspec(dllexport)
+ #else
+ // From client application side, we must import
+ #define EFSW_API __declspec(dllimport)
+ #endif
+ #else
+ // No specific directive needed for static build
+ #ifndef EFSW_API
+ #define EFSW_API
+ #endif
+ #endif
+#else
+ #if ( __GNUC__ >= 4 ) && defined( EFSW_EXPORTS )
+ #define EFSW_API __attribute__ ((visibility("default")))
+ #endif
+
+ // Other platforms don't need to define anything
+ #ifndef EFSW_API
+ #define EFSW_API
+ #endif
+#endif
+
+namespace efsw {
+
+/// Type for a watch id
+typedef long WatchID;
+
+// forward declarations
+class FileWatcherImpl;
+class FileWatchListener;
+
+/// Actions to listen for. Rename will send two events, one for
+/// the deletion of the old file, and one for the creation of the
+/// new file.
+namespace Actions {
+ enum Action
+ {
+ /// Sent when a file is created or renamed
+ Add = 1,
+ /// Sent when a file is deleted or renamed
+ Delete = 2,
+ /// Sent when a file is modified
+ Modified = 3,
+ /// Sent when a file is moved
+ Moved = 4
+ };
+}
+typedef Actions::Action Action;
+
+/// Errors log namespace
+namespace Errors {
+
+enum Error
+{
+ FileNotFound = -1,
+ FileRepeated = -2,
+ FileOutOfScope = -3,
+ FileNotReadable = -4,
+ FileRemote = -5, /** Directory in remote file system ( create a generic FileWatcher instance to watch this directory ). */
+ Unspecified = -6
+};
+
+class EFSW_API Log
+{
+ public:
+ /// @return The last error logged
+ static std::string getLastErrorLog();
+
+ /// Creates an error of the type specified
+ static Error createLastError( Error err, std::string log );
+};
+
+}
+typedef Errors::Error Error;
+
+/// Listens to files and directories and dispatches events
+/// to notify the listener of files and directories changes.
+/// @class FileWatcher
+class EFSW_API FileWatcher
+{
+ public:
+ /// Default constructor, will use the default platform file watcher
+ FileWatcher();
+
+ /// Constructor that lets you force the use of the Generic File Watcher
+ FileWatcher( bool useGenericFileWatcher );
+
+ virtual ~FileWatcher();
+
+ /// Add a directory watch. Same as the other addWatch, but doesn't have recursive option.
+ /// For backwards compatibility.
+ /// On error returns WatchID with Error type.
+ WatchID addWatch(const std::string& directory, FileWatchListener* watcher);
+
+ /// Add a directory watch
+ /// On error returns WatchID with Error type.
+ WatchID addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive);
+
+ /// Remove a directory watch. This is a brute force search O(nlogn).
+ void removeWatch(const std::string& directory);
+
+ /// Remove a directory watch. This is a map lookup O(logn).
+ void removeWatch(WatchID watchid);
+
+ /// Starts watching ( in other thread )
+ void watch();
+
+ /// @return Returns a list of the directories that are being watched
+ std::list<std::string> directories();
+
+ /** Allow recursive watchers to follow symbolic links to other directories
+ * followSymlinks is disabled by default
+ */
+ void followSymlinks( bool follow );
+
+ /** @return If can follow symbolic links to directorioes */
+ const bool& followSymlinks() const;
+
+ /** When enable this it will allow symlinks to watch recursively out of the pointed directory.
+ * follorSymlinks must be enabled to this work.
+ * For example, added symlink to /home/folder, and the symlink points to /, this by default is not allowed,
+ * it's only allowed to symlink anything from /home/ and deeper. This is to avoid great levels of recursion.
+ * Enabling this could lead in infinite recursion, and crash the watcher ( it will try not to avoid this ).
+ * Buy enabling out of scope links, it will allow this behavior.
+ * allowOutOfScopeLinks are disabled by default.
+ */
+ void allowOutOfScopeLinks( bool allow );
+
+ /// @return Returns if out of scope links are allowed
+ const bool& allowOutOfScopeLinks() const;
+ private:
+ /// The implementation
+ FileWatcherImpl * mImpl;
+ bool mFollowSymlinks;
+ bool mOutOfScopeLinks;
+};
+
+/// Basic interface for listening for file events.
+/// @class FileWatchListener
+class FileWatchListener
+{
+ public:
+ FileWatchListener() {}
+
+ virtual ~FileWatchListener() {}
+
+ /// Handles the action file action
+ /// @param watchid The watch id for the directory
+ /// @param dir The directory
+ /// @param filename The filename that was accessed (not full path)
+ /// @param action Action that was performed
+ /// @param oldFilename The name of the file or directory moved
+ virtual void handleFileAction(WatchID watchid, const std::string& dir, const std::string& filename, Action action, std::string oldFilename = "" ) = 0;
+
+};
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/Debug.cpp b/dep/efsw/src/efsw/Debug.cpp
new file mode 100644
index 00000000000..9c4ee02e5b6
--- /dev/null
+++ b/dep/efsw/src/efsw/Debug.cpp
@@ -0,0 +1,85 @@
+#include <efsw/Debug.hpp>
+#include <iostream>
+
+#ifdef EFSW_COMPILER_MSVC
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <crtdbg.h>
+#endif
+
+#include <cassert>
+#include <cstdio>
+#include <cstdarg>
+
+namespace efsw {
+
+#ifdef DEBUG
+
+void efREPORT_ASSERT( const char * File, int Line, const char * Exp )
+{
+ #ifdef EFSW_COMPILER_MSVC
+ _CrtDbgReport( _CRT_ASSERT, File, Line, "", Exp);
+
+ DebugBreak();
+ #else
+ std::cout << "ASSERT: " << Exp << " file: " << File << " line: " << Line << std::endl;
+
+ #if defined(EFSW_COMPILER_GCC) && defined(EFSW_32BIT) && !defined(EFSW_ARM)
+ asm("int3");
+ #else
+ assert( false );
+ #endif
+ #endif
+}
+
+void efPRINT( const char * format, ... )
+{
+ char buf[2048];
+ va_list args;
+
+ va_start( args, format );
+
+ #ifdef EFSW_COMPILER_MSVC
+ _vsnprintf_s( buf, sizeof( buf ), sizeof( buf ) / sizeof( buf[0]), format, args );
+ #else
+ vsnprintf( buf, sizeof( buf ) / sizeof( buf[0]), format, args );
+ #endif
+
+ va_end( args );
+
+ #ifdef EFSW_COMPILER_MSVC
+ OutputDebugStringA( buf );
+ #else
+ std::cout << buf;
+ #endif
+}
+
+void efPRINTC( unsigned int cond, const char * format, ...)
+{
+ if ( 0 == cond )
+ return;
+
+ char buf[2048];
+ va_list args;
+
+ va_start( args, format );
+
+ #ifdef EFSW_COMPILER_MSVC
+ _vsnprintf_s( buf, efARRAY_SIZE( buf ), efARRAY_SIZE( buf ), format, args );
+ #else
+ vsnprintf( buf, sizeof( buf ) / sizeof( buf[0]), format, args );
+ #endif
+
+ va_end( args );
+
+ #ifdef EFSW_COMPILER_MSVC
+ OutputDebugStringA( buf );
+ #else
+ std::cout << buf;
+ #endif
+}
+
+#endif
+
+}
+
diff --git a/dep/efsw/src/efsw/Debug.hpp b/dep/efsw/src/efsw/Debug.hpp
new file mode 100644
index 00000000000..75d6dce0466
--- /dev/null
+++ b/dep/efsw/src/efsw/Debug.hpp
@@ -0,0 +1,50 @@
+#ifndef EFSW_DEBUG_HPP
+#define EFSW_DEBUG_HPP
+
+#include <efsw/base.hpp>
+
+namespace efsw {
+
+#ifdef DEBUG
+
+void efREPORT_ASSERT( const char * File, const int Line, const char * Exp );
+
+#define efASSERT( expr ) if ( !(expr) ) { efREPORT_ASSERT( __FILE__, __LINE__, #expr ); }
+#define efASSERTM( expr, msg ) if ( !(expr) ) { efREPORT_ASSERT( __FILE__, __LINE__, #msg ); }
+
+void efPRINT ( const char * format, ... );
+void efPRINTC ( unsigned int cond, const char * format, ... );
+
+#else
+
+#define efASSERT( expr )
+#define efASSERTM( expr, msg )
+
+#ifndef EFSW_COMPILER_MSVC
+ #define efPRINT( format, args... ) {}
+ #define efPRINTC( cond, format, args... ) {}
+#else
+ #define efPRINT
+ #define efPRINTC
+#endif
+
+#endif
+
+#ifdef EFSW_VERBOSE
+ #define efDEBUG efPRINT
+ #define efDEBUGC efPRINTC
+#else
+
+ #ifndef EFSW_COMPILER_MSVC
+ #define efDEBUG( format, args... ) {}
+ #define efDEBUGC( cond, format, args... ) {}
+ #else
+ #define efDEBUG
+ #define efDEBUGC
+ #endif
+
+#endif
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/DirWatcherGeneric.cpp b/dep/efsw/src/efsw/DirWatcherGeneric.cpp
new file mode 100644
index 00000000000..b80c14d24ce
--- /dev/null
+++ b/dep/efsw/src/efsw/DirWatcherGeneric.cpp
@@ -0,0 +1,451 @@
+#include <efsw/DirWatcherGeneric.hpp>
+#include <efsw/FileSystem.hpp>
+#include <efsw/Debug.hpp>
+#include <efsw/String.hpp>
+
+namespace efsw {
+
+DirWatcherGeneric::DirWatcherGeneric( DirWatcherGeneric * parent, WatcherGeneric * ws, const std::string& directory, bool recursive, bool reportNewFiles ) :
+ Parent( parent ),
+ Watch( ws ),
+ Recursive( recursive ),
+ Deleted( false )
+{
+ resetDirectory( directory );
+
+ if ( !reportNewFiles )
+ {
+ DirSnap.scan();
+ }
+ else
+ {
+ DirectorySnapshotDiff Diff = DirSnap.scan();
+
+ if ( Diff.changed() )
+ {
+ FileInfoList::iterator it;
+
+ DiffIterator( FilesCreated )
+ {
+ handleAction( ( *it ).Filepath, Actions::Add );
+ }
+ }
+ }
+}
+
+DirWatcherGeneric::~DirWatcherGeneric()
+{
+ /// If the directory was deleted mark the files as deleted
+ if ( Deleted )
+ {
+ DirectorySnapshotDiff Diff = DirSnap.scan();
+
+ if ( !DirSnap.exists() )
+ {
+ FileInfoList::iterator it;
+
+ DiffIterator( FilesDeleted )
+ {
+ handleAction( (*it).Filepath, Actions::Delete );
+ }
+
+ DiffIterator( DirsDeleted )
+ {
+ handleAction( (*it).Filepath, Actions::Delete );
+ }
+ }
+ }
+
+ DirWatchMap::iterator it = Directories.begin();
+
+ for ( ; it != Directories.end(); it++ )
+ {
+ if ( Deleted )
+ {
+ /// If the directory was deleted, mark the flag for file deletion
+ it->second->Deleted = true;
+ }
+
+ efSAFE_DELETE( it->second );
+ }
+}
+
+void DirWatcherGeneric::resetDirectory( std::string directory )
+{
+ std::string dir( directory );
+
+ /// Is this a recursive watch?
+ if ( Watch->Directory != directory )
+ {
+ if ( !( directory.size() && ( directory.at(0) == FileSystem::getOSSlash() || directory.at( directory.size() - 1 ) == FileSystem::getOSSlash() ) ) )
+ {
+ /// Get the real directory
+ if ( NULL != Parent )
+ {
+ FileSystem::dirAddSlashAtEnd(directory);
+
+ dir = Parent->DirSnap.DirectoryInfo.Filepath + directory;
+ }
+ else
+ {
+ efDEBUG( "resetDirectory(): Parent is NULL. Fatal error." );
+ }
+ }
+ }
+
+ DirSnap.setDirectoryInfo( dir );
+}
+
+void DirWatcherGeneric::handleAction( const std::string &filename, unsigned long action, std::string oldFilename)
+{
+ Watch->Listener->handleFileAction( Watch->ID, DirSnap.DirectoryInfo.Filepath, FileSystem::fileNameFromPath( filename ), (Action)action, oldFilename );
+}
+
+void DirWatcherGeneric::addChilds( bool reportNewFiles )
+{
+ if ( Recursive )
+ {
+ /// Create the subdirectories watchers
+ std::string dir;
+
+ for ( FileInfoMap::iterator it = DirSnap.Files.begin(); it != DirSnap.Files.end(); it++ )
+ {
+ if ( it->second.isDirectory() && it->second.isReadable() && !FileSystem::isRemoteFS( it->second.Filepath ) )
+ {
+ /// Check if the directory is a symbolic link
+ std::string curPath;
+ std::string link( FileSystem::getLinkRealPath( it->second.Filepath, curPath ) );
+
+ dir = it->first;
+
+ if ( "" != link )
+ {
+ /// Avoid adding symlinks directories if it's now enabled
+ if ( !Watch->WatcherImpl->mFileWatcher->followSymlinks() )
+ {
+ continue;
+ }
+
+ /// If it's a symlink check if the realpath exists as a watcher, or
+ /// if the path is outside the current dir
+ if ( Watch->WatcherImpl->pathInWatches( link ) || Watch->pathInWatches( link ) || !Watch->WatcherImpl->linkAllowed( curPath, link ) )
+ {
+ continue;
+ }
+ else
+ {
+ dir = link;
+ }
+ }
+ else
+ {
+ if ( Watch->pathInWatches( dir ) || Watch->WatcherImpl->pathInWatches( dir ) )
+ {
+ continue;
+ }
+ }
+
+ if ( reportNewFiles )
+ {
+ handleAction( dir, Actions::Add );
+ }
+
+ Directories[dir] = new DirWatcherGeneric( this, Watch, dir, Recursive, reportNewFiles );
+
+ Directories[dir]->addChilds( reportNewFiles );
+ }
+ }
+ }
+}
+
+void DirWatcherGeneric::watch( bool reportOwnChange )
+{
+ DirectorySnapshotDiff Diff = DirSnap.scan();
+
+ if ( reportOwnChange && Diff.DirChanged && NULL != Parent )
+ {
+ Watch->Listener->handleFileAction( Watch->ID, FileSystem::pathRemoveFileName( DirSnap.DirectoryInfo.Filepath ), FileSystem::fileNameFromPath( DirSnap.DirectoryInfo.Filepath ), Actions::Modified );
+ }
+
+ if ( Diff.changed() )
+ {
+ FileInfoList::iterator it;
+ MovedList::iterator mit;
+
+ /// Files
+ DiffIterator( FilesCreated )
+ {
+ handleAction( (*it).Filepath, Actions::Add );
+ }
+
+ DiffIterator( FilesModified )
+ {
+ handleAction( (*it).Filepath, Actions::Modified );
+ }
+
+ DiffIterator( FilesDeleted )
+ {
+ handleAction( (*it).Filepath, Actions::Delete );
+ }
+
+ DiffMovedIterator( FilesMoved )
+ {
+ handleAction( (*mit).second.Filepath, Actions::Moved, (*mit).first );
+ }
+
+ /// Directories
+ DiffIterator( DirsCreated )
+ {
+ createDirectory( (*it).Filepath );
+ }
+
+ DiffIterator( DirsModified )
+ {
+ handleAction( (*it).Filepath, Actions::Modified );
+ }
+
+ DiffIterator( DirsDeleted )
+ {
+ handleAction( (*it).Filepath, Actions::Delete );
+ removeDirectory( (*it).Filepath );
+ }
+
+ DiffMovedIterator( DirsMoved )
+ {
+ handleAction( (*mit).second.Filepath, Actions::Moved, (*mit).first );
+ moveDirectory( (*mit).first, (*mit).second.Filepath );
+ }
+ }
+
+ /// Process the subdirectories looking for changes
+ for ( DirWatchMap::iterator dit = Directories.begin(); dit != Directories.end(); dit++ )
+ {
+ /// Just watch
+ dit->second->watch();
+ }
+}
+
+void DirWatcherGeneric::watchDir( std::string &dir )
+{
+ DirWatcherGeneric * watcher = Watch->WatcherImpl->mFileWatcher->allowOutOfScopeLinks() ?
+ findDirWatcher( dir ) :
+ findDirWatcherFast( dir );
+
+ if ( NULL != watcher )
+ {
+ watcher->watch( true );
+ }
+}
+
+DirWatcherGeneric * DirWatcherGeneric::findDirWatcherFast( std::string dir )
+{
+ // remove the common base ( dir should always start with the same base as the watcher )
+ efASSERT( !dir.empty() );
+ efASSERT( dir.size() >= DirSnap.DirectoryInfo.Filepath.size() );
+ efASSERT( DirSnap.DirectoryInfo.Filepath == dir.substr( 0, DirSnap.DirectoryInfo.Filepath.size() ) );
+
+ if ( dir.size() >= DirSnap.DirectoryInfo.Filepath.size() )
+ {
+ dir = dir.substr( DirSnap.DirectoryInfo.Filepath.size() - 1 );
+ }
+
+ if ( dir.size() == 1 )
+ {
+ efASSERT( dir[0] == FileSystem::getOSSlash() );
+ return this;
+ }
+
+ size_t level = 0;
+ std::vector<std::string> dirv = String::split( dir, FileSystem::getOSSlash(), false );
+
+ DirWatcherGeneric * watcher = this;
+
+ while ( level < dirv.size() )
+ {
+ // search the dir level in the current watcher
+ DirWatchMap::iterator it = watcher->Directories.find( dirv[ level ] );
+
+ // found? continue with the next level
+ if ( it != watcher->Directories.end() )
+ {
+ watcher = it->second;
+
+ level++;
+ }
+ else
+ {
+ // couldn't found the folder level?
+ // directory not watched
+ return NULL;
+ }
+ }
+
+ return watcher;
+}
+
+DirWatcherGeneric * DirWatcherGeneric::findDirWatcher( std::string dir )
+{
+ if ( DirSnap.DirectoryInfo.Filepath == dir )
+ {
+ return this;
+ }
+ else
+ {
+ DirWatcherGeneric * watcher = NULL;
+
+ for ( DirWatchMap::iterator it = Directories.begin(); it != Directories.end(); it++ )
+ {
+ watcher = it->second->findDirWatcher( dir );
+
+ if ( NULL != watcher )
+ {
+ return watcher;
+ }
+ }
+ }
+
+ return NULL;
+}
+
+DirWatcherGeneric * DirWatcherGeneric::createDirectory( std::string newdir )
+{
+ FileSystem::dirRemoveSlashAtEnd( newdir );
+ newdir = FileSystem::fileNameFromPath( newdir );
+
+ DirWatcherGeneric * dw = NULL;
+
+ /// Check if the directory is a symbolic link
+ std::string dir( DirSnap.DirectoryInfo.Filepath + newdir );
+
+ FileSystem::dirAddSlashAtEnd( dir );
+
+ FileInfo fi( dir );
+
+ if ( !fi.isDirectory() || !fi.isReadable() || FileSystem::isRemoteFS( dir ) )
+ {
+ return NULL;
+ }
+
+ std::string curPath;
+ std::string link( FileSystem::getLinkRealPath( dir, curPath ) );
+ bool skip = false;
+
+ if ( "" != link )
+ {
+ /// Avoid adding symlinks directories if it's now enabled
+ if ( !Watch->WatcherImpl->mFileWatcher->followSymlinks() )
+ {
+ skip = true;
+ }
+
+ /// If it's a symlink check if the realpath exists as a watcher, or
+ /// if the path is outside the current dir
+ if ( Watch->WatcherImpl->pathInWatches( link ) || Watch->pathInWatches( link ) || !Watch->WatcherImpl->linkAllowed( curPath, link ) )
+ {
+ skip = true;
+ }
+ else
+ {
+ dir = link;
+ }
+ }
+ else
+ {
+ if ( Watch->pathInWatches( dir ) || Watch->WatcherImpl->pathInWatches( dir ) )
+ {
+ skip = true;
+ }
+ }
+
+ if ( !skip )
+ {
+ handleAction( newdir, Actions::Add );
+
+ /// Creates the new directory watcher of the subfolder and check for new files
+ dw = new DirWatcherGeneric( this, Watch, dir, Recursive );
+
+ dw->addChilds();
+
+ dw->watch();
+
+ /// Add it to the list of directories
+ Directories[ newdir ] = dw;
+ }
+
+ return dw;
+}
+
+void DirWatcherGeneric::removeDirectory( std::string dir )
+{
+ FileSystem::dirRemoveSlashAtEnd( dir );
+ dir = FileSystem::fileNameFromPath( dir );
+
+ DirWatcherGeneric * dw = NULL;
+ DirWatchMap::iterator dit;
+
+ /// Folder deleted
+
+ /// Search the folder, it should exists
+ dit = Directories.find( dir );
+
+ if ( dit != Directories.end() )
+ {
+ dw = dit->second;
+
+ /// Flag it as deleted so it fire the event for every file inside deleted
+ dw->Deleted = true;
+
+ /// Delete the DirWatcherGeneric
+ efSAFE_DELETE( dw );
+
+ /// Remove the directory from the map
+ Directories.erase( dit->first );
+ }
+}
+
+void DirWatcherGeneric::moveDirectory( std::string oldDir, std::string newDir )
+{
+ FileSystem::dirRemoveSlashAtEnd( oldDir );
+ oldDir = FileSystem::fileNameFromPath( oldDir );
+
+ FileSystem::dirRemoveSlashAtEnd( newDir );
+ newDir = FileSystem::fileNameFromPath( newDir );
+
+ DirWatcherGeneric * dw = NULL;
+ DirWatchMap::iterator dit;
+
+ /// Directory existed?
+ dit = Directories.find( oldDir );
+
+ if ( dit != Directories.end() )
+ {
+ dw = dit->second;
+
+ /// Remove the directory from the map
+ Directories.erase( dit->first );
+
+ Directories[ newDir ] = dw;
+
+ dw->resetDirectory( newDir );
+ }
+}
+
+bool DirWatcherGeneric::pathInWatches( std::string path )
+{
+ if ( DirSnap.DirectoryInfo.Filepath == path )
+ {
+ return true;
+ }
+
+ for ( DirWatchMap::iterator it = Directories.begin(); it != Directories.end(); it++ )
+ {
+ if ( it->second->pathInWatches( path ) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+}
diff --git a/dep/efsw/src/efsw/DirWatcherGeneric.hpp b/dep/efsw/src/efsw/DirWatcherGeneric.hpp
new file mode 100644
index 00000000000..a7581904422
--- /dev/null
+++ b/dep/efsw/src/efsw/DirWatcherGeneric.hpp
@@ -0,0 +1,55 @@
+#ifndef EFSW_DIRWATCHERGENERIC_HPP
+#define EFSW_DIRWATCHERGENERIC_HPP
+
+#include <efsw/WatcherGeneric.hpp>
+#include <efsw/FileInfo.hpp>
+#include <efsw/DirectorySnapshot.hpp>
+#include <map>
+
+namespace efsw {
+
+class DirWatcherGeneric
+{
+ public:
+ typedef std::map<std::string, DirWatcherGeneric*> DirWatchMap;
+
+ DirWatcherGeneric * Parent;
+ WatcherGeneric * Watch;
+ DirectorySnapshot DirSnap;
+ DirWatchMap Directories;
+ bool Recursive;
+
+ DirWatcherGeneric( DirWatcherGeneric * parent, WatcherGeneric * ws, const std::string& directory, bool recursive, bool reportNewFiles = false );
+
+ ~DirWatcherGeneric();
+
+ void watch( bool reportOwnChange = false );
+
+ void watchDir( std::string& dir );
+
+ static bool isDir( const std::string& directory );
+
+ bool pathInWatches( std::string path );
+
+ void addChilds( bool reportNewFiles = true );
+
+ DirWatcherGeneric * findDirWatcher( std::string dir );
+
+ DirWatcherGeneric * findDirWatcherFast( std::string dir );
+ protected:
+ bool Deleted;
+
+ DirWatcherGeneric * createDirectory( std::string newdir );
+
+ void removeDirectory( std::string dir );
+
+ void moveDirectory( std::string oldDir, std::string newDir );
+
+ void resetDirectory( std::string directory );
+
+ void handleAction( const std::string& filename, unsigned long action, std::string oldFilename = "");
+};
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/DirectorySnapshot.cpp b/dep/efsw/src/efsw/DirectorySnapshot.cpp
new file mode 100644
index 00000000000..c0ef747548a
--- /dev/null
+++ b/dep/efsw/src/efsw/DirectorySnapshot.cpp
@@ -0,0 +1,261 @@
+#include <efsw/DirectorySnapshot.hpp>
+#include <efsw/FileSystem.hpp>
+
+namespace efsw {
+
+DirectorySnapshot::DirectorySnapshot()
+{
+}
+
+DirectorySnapshot::DirectorySnapshot( std::string directory )
+{
+ init( directory );
+}
+
+DirectorySnapshot::~DirectorySnapshot()
+{
+}
+
+void DirectorySnapshot::init( std::string directory )
+{
+ setDirectoryInfo( directory );
+ initFiles();
+}
+
+bool DirectorySnapshot::exists()
+{
+ return DirectoryInfo.exists();
+}
+
+void DirectorySnapshot::deleteAll( DirectorySnapshotDiff& Diff )
+{
+ FileInfo fi;
+
+ for ( FileInfoMap::iterator it = Files.begin(); it != Files.end(); it++ )
+ {
+ fi = it->second;
+
+ if ( fi.isDirectory() )
+ {
+ Diff.DirsDeleted.push_back( fi );
+ }
+ else
+ {
+ Diff.FilesDeleted.push_back( fi );
+ }
+ }
+}
+
+void DirectorySnapshot::setDirectoryInfo( std::string directory )
+{
+ DirectoryInfo = FileInfo( directory );
+}
+
+void DirectorySnapshot::initFiles()
+{
+ Files = FileSystem::filesInfoFromPath( DirectoryInfo.Filepath );
+
+ FileInfoMap::iterator it = Files.begin();
+ std::list<std::string> eraseFiles;
+
+ /// Remove all non regular files and non directories
+ for ( ; it != Files.end(); it++ )
+ {
+ if ( !it->second.isRegularFile() && !it->second.isDirectory() )
+ {
+ eraseFiles.push_back( it->first );
+ }
+ }
+
+ for ( std::list<std::string>::iterator eit = eraseFiles.begin(); eit != eraseFiles.end(); eit++ )
+ {
+ Files.erase( *eit );
+ }
+}
+
+DirectorySnapshotDiff DirectorySnapshot::scan()
+{
+ DirectorySnapshotDiff Diff;
+
+ Diff.clear();
+
+ FileInfo curFI( DirectoryInfo.Filepath );
+
+ Diff.DirChanged = DirectoryInfo != curFI;
+
+ if ( Diff.DirChanged )
+ {
+ DirectoryInfo = curFI;
+ }
+
+ /// If the directory was erased, create the events for files and directories deletion
+ if ( !curFI.exists() )
+ {
+ deleteAll( Diff );
+
+ return Diff;
+ }
+
+ FileInfoMap files = FileSystem::filesInfoFromPath( DirectoryInfo.Filepath );
+
+ if ( files.empty() && Files.empty() )
+ {
+ return Diff;
+ }
+
+ FileInfo fi;
+ FileInfoMap FilesCpy;
+ FileInfoMap::iterator it;
+ FileInfoMap::iterator fiIt;
+
+ if ( Diff.DirChanged )
+ {
+ FilesCpy = Files;
+ }
+
+ for ( it = files.begin(); it != files.end(); it++ )
+ {
+ fi = it->second;
+
+ /// File existed before?
+ fiIt = Files.find( it->first );
+
+ if ( fiIt != Files.end() )
+ {
+ /// Erase from the file list copy
+ FilesCpy.erase( it->first );
+
+ /// File changed?
+ if ( (*fiIt).second != fi )
+ {
+ /// Update the new file info
+ Files[ it->first ] = fi;
+
+ /// handle modified event
+ if ( fi.isDirectory() )
+ {
+ Diff.DirsModified.push_back( fi );
+ }
+ else
+ {
+ Diff.FilesModified.push_back( fi );
+ }
+ }
+ }
+ /// Only add regular files or directories
+ else if ( fi.isRegularFile() || fi.isDirectory() )
+ {
+ /// New file found
+ Files[ it->first ] = fi;
+
+ FileInfoMap::iterator fit;
+ std::string oldFile = "";
+
+ /// Check if the same inode already existed
+ if ( ( fit = nodeInFiles( fi ) ) != Files.end() )
+ {
+ oldFile = fit->first;
+
+ /// Avoid firing a Delete event
+ FilesCpy.erase( fit->first );
+
+ /// Delete the old file name
+ Files.erase( fit->first );
+
+ if ( fi.isDirectory() )
+ {
+ Diff.DirsMoved.push_back( std::make_pair( oldFile, fi ) );
+ }
+ else
+ {
+ Diff.FilesMoved.push_back( std::make_pair( oldFile, fi ) );
+ }
+ }
+ else
+ {
+ if ( fi.isDirectory() )
+ {
+ Diff.DirsCreated.push_back( fi );
+ }
+ else
+ {
+ Diff.FilesCreated.push_back( fi );
+ }
+ }
+ }
+ }
+
+ if ( !Diff.DirChanged )
+ {
+ return Diff;
+ }
+
+ /// The files or directories that remains were deleted
+ for ( it = FilesCpy.begin(); it != FilesCpy.end(); it++ )
+ {
+ fi = it->second;
+
+ if ( fi.isDirectory() )
+ {
+ Diff.DirsDeleted.push_back( fi );
+ }
+ else
+ {
+ Diff.FilesDeleted.push_back( fi );
+ }
+
+ /// Remove the file or directory from the list of files
+ Files.erase( it->first );
+ }
+
+ return Diff;
+}
+
+FileInfoMap::iterator DirectorySnapshot::nodeInFiles( FileInfo& fi )
+{
+ FileInfoMap::iterator it;
+
+ if ( FileInfo::inodeSupported() )
+ {
+ for ( it = Files.begin(); it != Files.end(); it++ )
+ {
+ if ( it->second.sameInode( fi ) && it->second.Filepath != fi.Filepath )
+ {
+ return it;
+ }
+ }
+ }
+
+ return Files.end();
+}
+
+void DirectorySnapshot::addFile( std::string path )
+{
+ std::string name( FileSystem::fileNameFromPath( path ) );
+ Files[ name ] = FileInfo( path );
+}
+
+void DirectorySnapshot::removeFile( std::string path )
+{
+ std::string name( FileSystem::fileNameFromPath( path ) );
+
+ FileInfoMap::iterator it = Files.find( name );
+
+ if ( Files.end() != it )
+ {
+ Files.erase( it );
+ }
+}
+
+void DirectorySnapshot::moveFile( std::string oldPath, std::string newPath )
+{
+ removeFile( oldPath );
+ addFile( newPath );
+}
+
+void DirectorySnapshot::updateFile(std::string path)
+{
+ addFile( path );
+}
+
+}
diff --git a/dep/efsw/src/efsw/DirectorySnapshot.hpp b/dep/efsw/src/efsw/DirectorySnapshot.hpp
new file mode 100644
index 00000000000..1ada66fe980
--- /dev/null
+++ b/dep/efsw/src/efsw/DirectorySnapshot.hpp
@@ -0,0 +1,46 @@
+#ifndef EFSW_DIRECTORYSNAPSHOT_HPP
+#define EFSW_DIRECTORYSNAPSHOT_HPP
+
+#include <efsw/DirectorySnapshotDiff.hpp>
+
+namespace efsw {
+
+class DirectorySnapshot
+{
+ public:
+ FileInfo DirectoryInfo;
+ FileInfoMap Files;
+
+ void setDirectoryInfo( std::string directory );
+
+ DirectorySnapshot();
+
+ DirectorySnapshot( std::string directory );
+
+ ~DirectorySnapshot();
+
+ void init( std::string directory );
+
+ bool exists();
+
+ DirectorySnapshotDiff scan();
+
+ FileInfoMap::iterator nodeInFiles( FileInfo& fi );
+
+ void addFile( std::string path );
+
+ void removeFile( std::string path );
+
+ void moveFile( std::string oldPath, std::string newPath );
+
+ void updateFile( std::string path );
+ protected:
+ void initFiles();
+
+ void deleteAll( DirectorySnapshotDiff &Diff );
+};
+
+}
+
+#endif
+
diff --git a/dep/efsw/src/efsw/DirectorySnapshotDiff.cpp b/dep/efsw/src/efsw/DirectorySnapshotDiff.cpp
new file mode 100644
index 00000000000..eabc6fdbda1
--- /dev/null
+++ b/dep/efsw/src/efsw/DirectorySnapshotDiff.cpp
@@ -0,0 +1,29 @@
+#include <efsw/DirectorySnapshotDiff.hpp>
+
+namespace efsw {
+
+void DirectorySnapshotDiff::clear()
+{
+ FilesCreated.clear();
+ FilesModified.clear();
+ FilesMoved.clear();
+ FilesDeleted.clear();
+ DirsCreated.clear();
+ DirsModified.clear();
+ DirsMoved.clear();
+ DirsDeleted.clear();
+}
+
+bool DirectorySnapshotDiff::changed()
+{
+ return !FilesCreated.empty() ||
+ !FilesModified.empty() ||
+ !FilesMoved.empty() ||
+ !FilesDeleted.empty() ||
+ !DirsCreated.empty() ||
+ !DirsModified.empty() ||
+ !DirsMoved.empty() ||
+ !DirsDeleted.empty();
+}
+
+}
diff --git a/dep/efsw/src/efsw/DirectorySnapshotDiff.hpp b/dep/efsw/src/efsw/DirectorySnapshotDiff.hpp
new file mode 100644
index 00000000000..042de9ce02c
--- /dev/null
+++ b/dep/efsw/src/efsw/DirectorySnapshotDiff.hpp
@@ -0,0 +1,35 @@
+#ifndef EFSW_DIRECTORYSNAPSHOTDIFF_HPP
+#define EFSW_DIRECTORYSNAPSHOTDIFF_HPP
+
+#include <efsw/FileInfo.hpp>
+
+namespace efsw {
+
+class DirectorySnapshotDiff
+{
+ public:
+ FileInfoList FilesDeleted;
+ FileInfoList FilesCreated;
+ FileInfoList FilesModified;
+ MovedList FilesMoved;
+ FileInfoList DirsDeleted;
+ FileInfoList DirsCreated;
+ FileInfoList DirsModified;
+ MovedList DirsMoved;
+ bool DirChanged;
+
+ void clear();
+
+ bool changed();
+};
+
+#define DiffIterator( FileInfoListName ) it = Diff.FileInfoListName.begin(); \
+ for ( ; it != Diff.FileInfoListName.end(); it++ )
+
+#define DiffMovedIterator( MovedListName ) mit = Diff.MovedListName.begin(); \
+ for ( ; mit != Diff.MovedListName.end(); mit++ )
+
+}
+
+#endif
+
diff --git a/dep/efsw/src/efsw/FileInfo.cpp b/dep/efsw/src/efsw/FileInfo.cpp
new file mode 100644
index 00000000000..7003afc2a15
--- /dev/null
+++ b/dep/efsw/src/efsw/FileInfo.cpp
@@ -0,0 +1,274 @@
+#include <efsw/FileInfo.hpp>
+#include <efsw/FileSystem.hpp>
+#include <efsw/String.hpp>
+
+#ifndef _DARWIN_FEATURE_64_BIT_INODE
+#define _DARWIN_FEATURE_64_BIT_INODE
+#endif
+
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
+
+#include <sys/stat.h>
+
+#include <limits.h>
+#include <stdlib.h>
+
+#ifdef EFSW_COMPILER_MSVC
+ #ifndef S_ISDIR
+ #define S_ISDIR(f) ((f)&_S_IFDIR)
+ #endif
+
+ #ifndef S_ISREG
+ #define S_ISREG(f) ((f)&_S_IFREG)
+ #endif
+
+ #ifndef S_ISRDBL
+ #define S_ISRDBL(f) ((f)&_S_IREAD)
+ #endif
+#else
+ #include <unistd.h>
+
+ #ifndef S_ISRDBL
+ #define S_ISRDBL(f) ((f)&S_IRUSR)
+ #endif
+#endif
+
+namespace efsw {
+
+bool FileInfo::exists( const std::string& filePath )
+{
+ FileInfo fi( filePath );
+ return fi.exists();
+}
+
+bool FileInfo::isLink( const std::string& filePath )
+{
+ FileInfo fi( filePath, true );
+ return fi.isLink();
+}
+
+bool FileInfo::inodeSupported()
+{
+ #if EFSW_PLATFORM != EFSW_PLATFORM_WIN32
+ return true;
+ #else
+ return false;
+ #endif
+}
+
+FileInfo::FileInfo() :
+ ModificationTime(0),
+ OwnerId(0),
+ GroupId(0),
+ Permissions(0),
+ Inode(0)
+{}
+
+FileInfo::FileInfo( const std::string& filepath ) :
+ Filepath( filepath ),
+ ModificationTime(0),
+ OwnerId(0),
+ GroupId(0),
+ Permissions(0),
+ Inode(0)
+{
+ getInfo();
+}
+
+FileInfo::FileInfo( const std::string& filepath, bool linkInfo ) :
+ Filepath( filepath ),
+ ModificationTime(0),
+ OwnerId(0),
+ GroupId(0),
+ Permissions(0),
+ Inode(0)
+{
+ if ( linkInfo )
+ {
+ getRealInfo();
+ }
+ else
+ {
+ getInfo();
+ }
+}
+
+void FileInfo::getInfo()
+{
+ #if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+ if ( Filepath.size() == 3 && Filepath[1] == ':' && Filepath[2] == FileSystem::getOSSlash() )
+ {
+ Filepath += FileSystem::getOSSlash();
+ }
+ #endif
+
+ /// Why i'm doing this? stat in mingw32 doesn't work for directories if the dir path ends with a path slash
+ bool slashAtEnd = FileSystem::slashAtEnd( Filepath );
+
+ if ( slashAtEnd )
+ {
+ FileSystem::dirRemoveSlashAtEnd( Filepath );
+ }
+
+ #if EFSW_PLATFORM != EFSW_PLATFORM_WIN32
+ struct stat st;
+ int res = stat( Filepath.c_str(), &st );
+ #else
+ struct _stat st;
+ int res = _wstat( String::fromUtf8( Filepath ).toWideString().c_str(), &st );
+ #endif
+
+ if ( 0 == res )
+ {
+ ModificationTime = st.st_mtime;
+ Size = st.st_size;
+ OwnerId = st.st_uid;
+ GroupId = st.st_gid;
+ Permissions = st.st_mode;
+ Inode = st.st_ino;
+ }
+
+ if ( slashAtEnd )
+ {
+ FileSystem::dirAddSlashAtEnd( Filepath );
+ }
+}
+
+void FileInfo::getRealInfo()
+{
+ bool slashAtEnd = FileSystem::slashAtEnd( Filepath );
+
+ if ( slashAtEnd )
+ {
+ FileSystem::dirRemoveSlashAtEnd( Filepath );
+ }
+
+ #if EFSW_PLATFORM != EFSW_PLATFORM_WIN32
+ struct stat st;
+ int res = lstat( Filepath.c_str(), &st );
+ #else
+ struct _stat st;
+ int res = _wstat( String::fromUtf8( Filepath ).toWideString().c_str(), &st );
+ #endif
+
+ if ( 0 == res )
+ {
+ ModificationTime = st.st_mtime;
+ Size = st.st_size;
+ OwnerId = st.st_uid;
+ GroupId = st.st_gid;
+ Permissions = st.st_mode;
+ Inode = st.st_ino;
+ }
+
+ if ( slashAtEnd )
+ {
+ FileSystem::dirAddSlashAtEnd( Filepath );
+ }
+}
+
+bool FileInfo::operator==( const FileInfo& Other ) const
+{
+ return ( ModificationTime == Other.ModificationTime &&
+ Size == Other.Size &&
+ OwnerId == Other.OwnerId &&
+ GroupId == Other.GroupId &&
+ Permissions == Other.Permissions &&
+ Inode == Other.Inode
+ );
+}
+
+bool FileInfo::isDirectory()
+{
+ return 0 != S_ISDIR(Permissions);
+}
+
+bool FileInfo::isRegularFile()
+{
+ return 0 != S_ISREG(Permissions);
+}
+
+bool FileInfo::isReadable()
+{
+ return 0 != S_ISRDBL(Permissions);
+}
+
+bool FileInfo::isLink()
+{
+#if EFSW_PLATFORM != EFSW_PLATFORM_WIN32
+ return S_ISLNK(Permissions);
+#else
+ return false;
+#endif
+}
+
+std::string FileInfo::linksTo()
+{
+#if EFSW_PLATFORM != EFSW_PLATFORM_WIN32
+ if ( isLink() )
+ {
+ char * ch = realpath( Filepath.c_str(), NULL);
+
+ if ( NULL != ch )
+ {
+ std::string tstr( ch );
+
+ free( ch );
+
+ return tstr;
+ }
+ }
+#endif
+ return std::string("");
+}
+
+bool FileInfo::exists()
+{
+ bool slashAtEnd = FileSystem::slashAtEnd( Filepath );
+
+ if ( slashAtEnd )
+ {
+ FileSystem::dirRemoveSlashAtEnd(Filepath);
+ }
+
+#if EFSW_PLATFORM != EFSW_PLATFORM_WIN32
+ struct stat st;
+ int res = stat( Filepath.c_str(), &st );
+#else
+ struct _stat st;
+ int res = _wstat( String::fromUtf8( Filepath ).toWideString().c_str(), &st );
+#endif
+
+ if (slashAtEnd)
+ {
+ FileSystem::dirAddSlashAtEnd(Filepath);
+ }
+
+ return 0 == res;
+}
+
+FileInfo& FileInfo::operator=( const FileInfo& Other )
+{
+ this->Filepath = Other.Filepath;
+ this->Size = Other.Size;
+ this->ModificationTime = Other.ModificationTime;
+ this->GroupId = Other.GroupId;
+ this->OwnerId = Other.OwnerId;
+ this->Permissions = Other.Permissions;
+ this->Inode = Other.Inode;
+ return *this;
+}
+
+bool FileInfo::sameInode( const FileInfo& Other ) const
+{
+ return inodeSupported() && Inode == Other.Inode;
+}
+
+bool FileInfo::operator!=( const FileInfo& Other ) const
+{
+ return !(*this == Other);
+}
+
+}
diff --git a/dep/efsw/src/efsw/FileInfo.hpp b/dep/efsw/src/efsw/FileInfo.hpp
new file mode 100644
index 00000000000..45cca6a7953
--- /dev/null
+++ b/dep/efsw/src/efsw/FileInfo.hpp
@@ -0,0 +1,66 @@
+#ifndef EFSW_FILEINFO_HPP
+#define EFSW_FILEINFO_HPP
+
+#include <efsw/base.hpp>
+#include <string>
+#include <map>
+#include <list>
+
+namespace efsw {
+
+class FileInfo
+{
+ public:
+ static bool exists( const std::string& filePath );
+
+ static bool isLink( const std::string& filePath );
+
+ static bool inodeSupported();
+
+ FileInfo();
+
+ FileInfo( const std::string& filepath );
+
+ FileInfo( const std::string& filepath, bool linkInfo );
+
+ bool operator==( const FileInfo& Other ) const;
+
+ bool operator!=( const FileInfo& Other ) const;
+
+ FileInfo& operator=( const FileInfo& Other );
+
+ bool isDirectory();
+
+ bool isRegularFile();
+
+ bool isReadable();
+
+ bool sameInode( const FileInfo& Other ) const;
+
+ bool isLink();
+
+ std::string linksTo();
+
+ bool exists();
+
+ void getInfo();
+
+ void getRealInfo();
+
+ std::string Filepath;
+ Uint64 ModificationTime;
+ Uint64 Size;
+ Uint32 OwnerId;
+ Uint32 GroupId;
+ Uint32 Permissions;
+ Uint64 Inode;
+};
+
+typedef std::map<std::string, FileInfo> FileInfoMap;
+typedef std::list<FileInfo> FileInfoList;
+typedef std::list< std::pair< std::string, FileInfo> > MovedList;
+
+}
+
+#endif
+
diff --git a/dep/efsw/src/efsw/FileSystem.cpp b/dep/efsw/src/efsw/FileSystem.cpp
new file mode 100644
index 00000000000..e3afa0b4046
--- /dev/null
+++ b/dep/efsw/src/efsw/FileSystem.cpp
@@ -0,0 +1,124 @@
+#include <efsw/FileSystem.hpp>
+#include <efsw/platform/platformimpl.hpp>
+
+#if EFSW_OS == EFSW_OS_MACOSX
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
+namespace efsw {
+
+bool FileSystem::isDirectory( const std::string& path )
+{
+ return Platform::FileSystem::isDirectory( path );
+}
+
+FileInfoMap FileSystem::filesInfoFromPath( std::string path ) {
+ dirAddSlashAtEnd( path );
+
+ return Platform::FileSystem::filesInfoFromPath( path );
+}
+
+char FileSystem::getOSSlash()
+{
+ return Platform::FileSystem::getOSSlash();
+}
+
+bool FileSystem::slashAtEnd( std::string &dir )
+{
+ return ( dir.size() && dir[ dir.size() - 1 ] == getOSSlash() );
+}
+
+void FileSystem::dirAddSlashAtEnd( std::string& dir )
+{
+ if ( dir.size() > 1 && dir[ dir.size() - 1 ] != getOSSlash() )
+ {
+ dir.push_back( getOSSlash() );
+ }
+}
+
+void FileSystem::dirRemoveSlashAtEnd( std::string& dir )
+{
+ if ( dir.size() > 1 && dir[ dir.size() - 1 ] == getOSSlash() )
+ {
+ dir.erase( dir.size() - 1 );
+ }
+}
+
+std::string FileSystem::fileNameFromPath( std::string filepath )
+{
+ dirRemoveSlashAtEnd( filepath );
+
+ size_t pos = filepath.find_last_of( getOSSlash() );
+
+ if ( pos != std::string::npos )
+ {
+ return filepath.substr( pos + 1 );
+ }
+
+ return filepath;
+}
+
+std::string FileSystem::pathRemoveFileName( std::string filepath )
+{
+ dirRemoveSlashAtEnd( filepath );
+
+ size_t pos = filepath.find_last_of( getOSSlash() );
+
+ if ( pos != std::string::npos )
+ {
+ return filepath.substr( 0, pos + 1 );
+ }
+
+ return filepath;
+}
+
+std::string FileSystem::getLinkRealPath( std::string dir, std::string& curPath )
+{
+ FileSystem::dirRemoveSlashAtEnd( dir );
+ FileInfo fi( dir, true );
+
+ /// Check with lstat and see if it's a link
+ if ( fi.isLink() )
+ {
+ /// get the real path of the link
+ std::string link( fi.linksTo() );
+
+ /// get the current path of the directory without the link dir path
+ curPath = FileSystem::pathRemoveFileName( dir );
+
+ /// ensure that ends with the os directory slash
+ FileSystem::dirAddSlashAtEnd( link );
+
+ return link;
+ }
+
+ /// if it's not a link return nothing
+ return "";
+}
+
+std::string FileSystem::precomposeFileName( const std::string& name )
+{
+#if EFSW_OS == EFSW_OS_MACOSX
+ CFStringRef cfStringRef = CFStringCreateWithCString(kCFAllocatorDefault, name.c_str(), kCFStringEncodingUTF8);
+ CFMutableStringRef cfMutable = CFStringCreateMutableCopy(NULL, 0, cfStringRef);
+
+ CFStringNormalize(cfMutable,kCFStringNormalizationFormC);
+
+ char c_str[255 + 1];
+ CFStringGetCString(cfMutable, c_str, sizeof(c_str)-1, kCFStringEncodingUTF8);
+
+ CFRelease(cfStringRef);
+ CFRelease(cfMutable);
+
+ return std::string(c_str);
+#else
+ return name;
+#endif
+}
+
+bool FileSystem::isRemoteFS( const std::string& directory )
+{
+ return Platform::FileSystem::isRemoteFS( directory );
+}
+
+}
diff --git a/dep/efsw/src/efsw/FileSystem.hpp b/dep/efsw/src/efsw/FileSystem.hpp
new file mode 100644
index 00000000000..4e2e1aeb7cd
--- /dev/null
+++ b/dep/efsw/src/efsw/FileSystem.hpp
@@ -0,0 +1,40 @@
+#ifndef EFSW_FILESYSTEM_HPP
+#define EFSW_FILESYSTEM_HPP
+
+#include <efsw/base.hpp>
+#include <efsw/FileInfo.hpp>
+#include <map>
+
+namespace efsw {
+
+class FileSystem
+{
+ public:
+ static bool isDirectory( const std::string& path );
+
+ static FileInfoMap filesInfoFromPath( std::string path );
+
+ static char getOSSlash();
+
+ static bool slashAtEnd( std::string& dir );
+
+ static void dirAddSlashAtEnd( std::string& dir );
+
+ static void dirRemoveSlashAtEnd( std::string& dir );
+
+ static std::string fileNameFromPath( std::string filepath );
+
+ static std::string pathRemoveFileName( std::string filepath );
+
+ static void realPath( std::string curdir, std::string& path );
+
+ static std::string getLinkRealPath( std::string dir, std::string& curPath );
+
+ static std::string precomposeFileName(const std::string& name);
+
+ static bool isRemoteFS( const std::string& directory );
+};
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/FileWatcher.cpp b/dep/efsw/src/efsw/FileWatcher.cpp
new file mode 100644
index 00000000000..e33d5ec46fb
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcher.cpp
@@ -0,0 +1,145 @@
+#include <efsw/efsw.hpp>
+#include <efsw/FileWatcherImpl.hpp>
+#include <efsw/FileWatcherGeneric.hpp>
+#include <efsw/FileSystem.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+# include <efsw/FileWatcherWin32.hpp>
+# define FILEWATCHER_IMPL FileWatcherWin32
+# define BACKEND_NAME "Win32"
+#elif EFSW_PLATFORM == EFSW_PLATFORM_INOTIFY
+# include <efsw/FileWatcherInotify.hpp>
+# define FILEWATCHER_IMPL FileWatcherInotify
+# define BACKEND_NAME "Inotify"
+#elif EFSW_PLATFORM == EFSW_PLATFORM_KQUEUE
+# include <efsw/FileWatcherKqueue.hpp>
+# define FILEWATCHER_IMPL FileWatcherKqueue
+# define BACKEND_NAME "Kqueue"
+#elif EFSW_PLATFORM == EFSW_PLATFORM_FSEVENTS
+# include <efsw/FileWatcherFSEvents.hpp>
+# define FILEWATCHER_IMPL FileWatcherFSEvents
+# define BACKEND_NAME "FSEvents"
+#else
+# define FILEWATCHER_IMPL FileWatcherGeneric
+# define BACKEND_NAME "Generic"
+#endif
+
+#include <efsw/Debug.hpp>
+
+namespace efsw {
+
+FileWatcher::FileWatcher() :
+ mFollowSymlinks(false),
+ mOutOfScopeLinks(false)
+{
+ efDEBUG( "Using backend: %s\n", BACKEND_NAME );
+
+ mImpl = new FILEWATCHER_IMPL( this );
+
+ if ( !mImpl->initOK() )
+ {
+ efSAFE_DELETE( mImpl );
+
+ efDEBUG( "Falled back to backend: %s\n", BACKEND_NAME );
+
+ mImpl = new FileWatcherGeneric( this );
+ }
+}
+
+FileWatcher::FileWatcher( bool useGenericFileWatcher ) :
+ mFollowSymlinks(false),
+ mOutOfScopeLinks(false)
+{
+ if ( useGenericFileWatcher )
+ {
+ efDEBUG( "Using backend: Generic\n" );
+
+ mImpl = new FileWatcherGeneric( this );
+ }
+ else
+ {
+ efDEBUG( "Using backend: %s\n", BACKEND_NAME );
+
+ mImpl = new FILEWATCHER_IMPL( this );
+
+ if ( !mImpl->initOK() )
+ {
+ efSAFE_DELETE( mImpl );
+
+ efDEBUG( "Falled back to backend: %s\n", BACKEND_NAME );
+
+ mImpl = new FileWatcherGeneric( this );
+ }
+ }
+}
+
+FileWatcher::~FileWatcher()
+{
+ efSAFE_DELETE( mImpl );
+}
+
+WatchID FileWatcher::addWatch(const std::string& directory, FileWatchListener* watcher)
+{
+ if ( mImpl->mIsGeneric || !FileSystem::isRemoteFS( directory ) )
+ {
+ return mImpl->addWatch(directory, watcher, false);
+ }
+ else
+ {
+ return Errors::Log::createLastError( Errors::FileRemote, directory );
+ }
+}
+
+WatchID FileWatcher::addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive)
+{
+ if ( mImpl->mIsGeneric || !FileSystem::isRemoteFS( directory ) )
+ {
+ return mImpl->addWatch(directory, watcher, recursive);
+ }
+ else
+ {
+ return Errors::Log::createLastError( Errors::FileRemote, directory );
+ }
+}
+
+void FileWatcher::removeWatch(const std::string& directory)
+{
+ mImpl->removeWatch(directory);
+}
+
+void FileWatcher::removeWatch(WatchID watchid)
+{
+ mImpl->removeWatch(watchid);
+}
+
+void FileWatcher::watch()
+{
+ mImpl->watch();
+}
+
+std::list<std::string> FileWatcher::directories()
+{
+ return mImpl->directories();
+}
+
+void FileWatcher::followSymlinks( bool follow )
+{
+ mFollowSymlinks = follow;
+}
+
+const bool& FileWatcher::followSymlinks() const
+{
+ return mFollowSymlinks;
+}
+
+void FileWatcher::allowOutOfScopeLinks( bool allow )
+{
+ mOutOfScopeLinks = allow;
+}
+
+const bool& FileWatcher::allowOutOfScopeLinks() const
+{
+ return mOutOfScopeLinks;
+}
+
+}
diff --git a/dep/efsw/src/efsw/FileWatcherCWrapper.cpp b/dep/efsw/src/efsw/FileWatcherCWrapper.cpp
new file mode 100644
index 00000000000..2739e756bb2
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherCWrapper.cpp
@@ -0,0 +1,132 @@
+#include <efsw/efsw.h>
+#include <efsw/efsw.hpp>
+#include <vector>
+
+#define TOBOOL(i) ((i) == 0 ? false : true)
+
+/*************************************************************************************************/
+class Watcher_CAPI : public efsw::FileWatchListener
+{
+public:
+ efsw_watcher mWatcher;
+ efsw_pfn_fileaction_callback mFn;
+ void* mParam;
+public:
+ Watcher_CAPI(efsw_watcher watcher, efsw_pfn_fileaction_callback fn, void* param)
+ {
+ mWatcher = watcher;
+ mFn = fn;
+ mParam = param;
+ }
+
+ void handleFileAction(efsw::WatchID watchid, const std::string& dir, const std::string& filename,
+ efsw::Action action, std::string oldFilename = "")
+ {
+ mFn(mWatcher, watchid, dir.c_str(), filename.c_str(), (enum efsw_action)action,
+ oldFilename.c_str(), mParam );
+ }
+};
+
+/*************************************************************************************************
+ * globals
+ */
+static std::vector<Watcher_CAPI*> g_callbacks;
+
+Watcher_CAPI* find_callback(efsw_watcher watcher, efsw_pfn_fileaction_callback fn)
+{
+ for (std::vector<Watcher_CAPI*>::iterator i = g_callbacks.begin(); i != g_callbacks.end(); i++ )
+ {
+ Watcher_CAPI* callback = *i;
+
+ if (callback->mFn == fn && callback->mWatcher == watcher)
+ return *i;
+ }
+
+ return NULL;
+}
+
+Watcher_CAPI* remove_callback(efsw_watcher watcher)
+{
+ std::vector<Watcher_CAPI*>::iterator i = g_callbacks.begin();
+
+ while (i != g_callbacks.end()) {
+ Watcher_CAPI* callback = *i;
+
+ if (callback->mWatcher == watcher)
+ i = g_callbacks.erase(i);
+ else
+ i++;
+ }
+
+ return NULL;
+}
+
+
+/*************************************************************************************************/
+efsw_watcher efsw_create(int generic_mode)
+{
+ return (efsw_watcher)new efsw::FileWatcher(TOBOOL(generic_mode));
+}
+
+void efsw_release(efsw_watcher watcher)
+{
+ remove_callback(watcher);
+ delete (efsw::FileWatcher*)watcher;
+}
+
+const char* efsw_getlasterror()
+{
+ static std::string log_str;
+ log_str = efsw::Errors::Log::getLastErrorLog();
+ return log_str.c_str();
+}
+
+efsw_watchid efsw_addwatch(efsw_watcher watcher, const char* directory,
+ efsw_pfn_fileaction_callback callback_fn, int recursive, void * param)
+{
+ Watcher_CAPI* callback = find_callback(watcher, callback_fn);
+
+ if (callback == NULL) {
+ callback = new Watcher_CAPI(watcher, callback_fn, param);
+ g_callbacks.push_back(callback);
+ }
+
+ return ((efsw::FileWatcher*)watcher)->addWatch(std::string(directory), callback,
+ TOBOOL(recursive));
+}
+
+void efsw_removewatch(efsw_watcher watcher, const char* directory)
+{
+ ((efsw::FileWatcher*)watcher)->removeWatch(std::string(directory));
+}
+
+void efsw_removewatch_byid(efsw_watcher watcher, efsw_watchid watchid)
+{
+ ((efsw::FileWatcher*)watcher)->removeWatch(watchid);
+}
+
+void efsw_watch(efsw_watcher watcher)
+{
+ ((efsw::FileWatcher*)watcher)->watch();
+}
+
+void efsw_follow_symlinks(efsw_watcher watcher, int enable)
+{
+ ((efsw::FileWatcher*)watcher)->followSymlinks(TOBOOL(enable));
+}
+
+int efsw_follow_symlinks_isenabled(efsw_watcher watcher)
+{
+ return (int)((efsw::FileWatcher*)watcher)->followSymlinks();
+}
+
+void efsw_allow_outofscopelinks(efsw_watcher watcher, int allow)
+{
+ ((efsw::FileWatcher*)watcher)->allowOutOfScopeLinks(TOBOOL(allow));
+}
+
+int efsw_outofscopelinks_isallowed(efsw_watcher watcher)
+{
+ return (int)((efsw::FileWatcher*)watcher)->allowOutOfScopeLinks();
+}
+
diff --git a/dep/efsw/src/efsw/FileWatcherFSEvents.cpp b/dep/efsw/src/efsw/FileWatcherFSEvents.cpp
new file mode 100644
index 00000000000..40156674132
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherFSEvents.cpp
@@ -0,0 +1,278 @@
+#include <efsw/FileWatcherFSEvents.hpp>
+#include <efsw/FileSystem.hpp>
+#include <efsw/System.hpp>
+#include <efsw/Debug.hpp>
+#include <efsw/String.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_FSEVENTS
+
+#include <sys/utsname.h>
+
+namespace efsw
+{
+
+int getOSXReleaseNumber()
+{
+ static int osxR = -1;
+
+ if ( -1 == osxR )
+ {
+ struct utsname os;
+
+ if ( -1 != uname( &os ) ) {
+ std::string release( os.release );
+
+ size_t pos = release.find_first_of( '.' );
+
+ if ( pos != std::string::npos )
+ {
+ release = release.substr( 0, pos );
+ }
+
+ int rel = 0;
+
+ if ( String::fromString<int>( rel, release ) )
+ {
+ osxR = rel;
+ }
+ }
+ }
+
+ return osxR;
+}
+
+bool FileWatcherFSEvents::isGranular()
+{
+ return getOSXReleaseNumber() >= 11;
+}
+
+void FileWatcherFSEvents::FSEventCallback( ConstFSEventStreamRef streamRef,
+ void *userData,
+ size_t numEvents,
+ void *eventPaths,
+ const FSEventStreamEventFlags eventFlags[],
+ const FSEventStreamEventId eventIds[] )
+{
+ WatcherFSEvents * watcher = static_cast<WatcherFSEvents*>( userData );
+
+ std::vector<FSEvent> events;
+ events.reserve( numEvents );
+
+ for ( size_t i = 0; i < numEvents; i++ )
+ {
+ events.push_back( FSEvent( std::string( ((char**)eventPaths)[i] ), (long)eventFlags[i], (Uint64)eventIds[i] ) );
+ }
+
+ watcher->handleActions( events );
+
+ watcher->process();
+
+ efDEBUG( "\n" );
+}
+
+FileWatcherFSEvents::FileWatcherFSEvents( FileWatcher * parent ) :
+ FileWatcherImpl( parent ),
+ mRunLoopRef( NULL ),
+ mLastWatchID(0),
+ mThread( NULL )
+{
+ mInitOK = true;
+
+ watch();
+}
+
+FileWatcherFSEvents::~FileWatcherFSEvents()
+{
+ WatchMap::iterator iter = mWatches.begin();
+
+ for( ; iter != mWatches.end(); ++iter )
+ {
+ WatcherFSEvents * watch = iter->second;
+
+ efSAFE_DELETE( watch );
+ }
+
+ mWatches.clear();
+
+ mInitOK = false;
+
+ if ( NULL != mRunLoopRef )
+ {
+ CFRunLoopStop( mRunLoopRef );
+ }
+
+ efSAFE_DELETE( mThread );
+}
+
+WatchID FileWatcherFSEvents::addWatch( const std::string& directory, FileWatchListener* watcher, bool recursive )
+{
+ /// Wait to the RunLoopRef to be ready
+ while ( NULL == mRunLoopRef )
+ {
+ System::sleep( 1 );
+ }
+
+ std::string dir( directory );
+
+ FileInfo fi( dir );
+
+ if ( !fi.isDirectory() )
+ {
+ return Errors::Log::createLastError( Errors::FileNotFound, dir );
+ }
+ else if ( !fi.isReadable() )
+ {
+ return Errors::Log::createLastError( Errors::FileNotReadable, dir );
+ }
+
+ FileSystem::dirAddSlashAtEnd( dir );
+
+ if ( pathInWatches( dir ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, directory );
+ }
+
+ /// Check if the directory is a symbolic link
+ std::string curPath;
+ std::string link( FileSystem::getLinkRealPath( dir, curPath ) );
+
+ if ( "" != link )
+ {
+ /// If it's a symlink check if the realpath exists as a watcher, or
+ /// if the path is outside the current dir
+ if ( pathInWatches( link ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, directory );
+ }
+ else if ( !linkAllowed( curPath, link ) )
+ {
+ return Errors::Log::createLastError( Errors::FileOutOfScope, dir );
+ }
+ else
+ {
+ dir = link;
+ }
+ }
+
+ mLastWatchID++;
+
+ WatcherFSEvents * pWatch = new WatcherFSEvents();
+ pWatch->Listener = watcher;
+ pWatch->ID = mLastWatchID;
+ pWatch->Directory = dir;
+ pWatch->Recursive = recursive;
+ pWatch->FWatcher = this;
+
+ pWatch->init();
+
+ mWatchesLock.lock();
+ mWatches.insert(std::make_pair(mLastWatchID, pWatch));
+ mWatchesLock.unlock();
+
+ return pWatch->ID;
+}
+
+void FileWatcherFSEvents::removeWatch(const std::string& directory)
+{
+ mWatchesLock.lock();
+
+ WatchMap::iterator iter = mWatches.begin();
+
+ for(; iter != mWatches.end(); ++iter)
+ {
+ if( directory == iter->second->Directory )
+ {
+ removeWatch( iter->second->ID );
+ return;
+ }
+ }
+
+ mWatchesLock.unlock();
+}
+
+void FileWatcherFSEvents::removeWatch(WatchID watchid)
+{
+ mWatchesLock.lock();
+
+ WatchMap::iterator iter = mWatches.find( watchid );
+
+ if( iter == mWatches.end() )
+ return;
+
+ WatcherFSEvents * watch = iter->second;
+
+ mWatches.erase( iter );
+
+ efDEBUG( "Removed watch %s\n", watch->Directory.c_str() );
+
+ efSAFE_DELETE( watch );
+
+ mWatchesLock.unlock();
+}
+
+void FileWatcherFSEvents::watch()
+{
+ if ( NULL == mThread )
+ {
+ mThread = new Thread( &FileWatcherFSEvents::run, this );
+ mThread->launch();
+ }
+}
+
+void FileWatcherFSEvents::run()
+{
+ mRunLoopRef = CFRunLoopGetCurrent();
+
+ while ( mInitOK )
+ {
+ if ( !mNeedInit.empty() )
+ {
+ for ( std::list<WatcherFSEvents*>::iterator it = mNeedInit.begin(); it != mNeedInit.end(); it++ )
+ {
+ (*it)->initAsync();
+ }
+
+ mNeedInit.clear();
+ }
+
+ CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0.5, kCFRunLoopRunTimedOut );
+ }
+}
+
+void FileWatcherFSEvents::handleAction(Watcher* watch, const std::string& filename, unsigned long action, std::string oldFilename)
+{
+ /// Not used
+}
+
+std::list<std::string> FileWatcherFSEvents::directories()
+{
+ std::list<std::string> dirs;
+
+ mWatchesLock.lock();
+
+ for ( WatchMap::iterator it = mWatches.begin(); it != mWatches.end(); it++ )
+ {
+ dirs.push_back( std::string( it->second->Directory ) );
+ }
+
+ mWatchesLock.unlock();
+
+ return dirs;
+}
+
+bool FileWatcherFSEvents::pathInWatches( const std::string& path )
+{
+ for ( WatchMap::iterator it = mWatches.begin(); it != mWatches.end(); it++ )
+ {
+ if ( it->second->Directory == path )
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/FileWatcherFSEvents.hpp b/dep/efsw/src/efsw/FileWatcherFSEvents.hpp
new file mode 100644
index 00000000000..6aafbc0b5ea
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherFSEvents.hpp
@@ -0,0 +1,107 @@
+#ifndef EFSW_FILEWATCHERFSEVENTS_HPP
+#define EFSW_FILEWATCHERFSEVENTS_HPP
+
+#include <efsw/FileWatcherImpl.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_FSEVENTS
+
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreServices/CoreServices.h>
+#include <efsw/WatcherFSEvents.hpp>
+#include <map>
+#include <list>
+#include <vector>
+
+namespace efsw
+{
+
+/* OSX < 10.7 has no file events */
+/* So i declare the events constants */
+enum FSEventEvents
+{
+ efswFSEventStreamCreateFlagFileEvents = 0x00000010,
+ efswFSEventStreamEventFlagItemCreated = 0x00000100,
+ efswFSEventStreamEventFlagItemRemoved = 0x00000200,
+ efswFSEventStreamEventFlagItemInodeMetaMod = 0x00000400,
+ efswFSEventStreamEventFlagItemRenamed = 0x00000800,
+ efswFSEventStreamEventFlagItemModified = 0x00001000,
+ efswFSEventStreamEventFlagItemFinderInfoMod = 0x00002000,
+ efswFSEventStreamEventFlagItemChangeOwner = 0x00004000,
+ efswFSEventStreamEventFlagItemXattrMod = 0x00008000,
+ efswFSEventStreamEventFlagItemIsFile = 0x00010000,
+ efswFSEventStreamEventFlagItemIsDir = 0x00020000,
+ efswFSEventStreamEventFlagItemIsSymlink = 0x00040000,
+ efswFSEventsModified = efswFSEventStreamEventFlagItemFinderInfoMod |
+ efswFSEventStreamEventFlagItemModified |
+ efswFSEventStreamEventFlagItemInodeMetaMod |
+ efswFSEventStreamEventFlagItemChangeOwner |
+ efswFSEventStreamEventFlagItemXattrMod
+};
+
+/// Implementation for Win32 based on ReadDirectoryChangesW.
+/// @class FileWatcherFSEvents
+class FileWatcherFSEvents : public FileWatcherImpl
+{
+ friend class WatcherFSEvents;
+ public:
+ /// @return If FSEvents supports file-level notifications ( true if OS X >= 10.7 )
+ static bool isGranular();
+
+ /// type for a map from WatchID to WatcherWin32 pointer
+ typedef std::map<WatchID, WatcherFSEvents*> WatchMap;
+
+ FileWatcherFSEvents( FileWatcher * parent );
+
+ virtual ~FileWatcherFSEvents();
+
+ /// Add a directory watch
+ /// On error returns WatchID with Error type.
+ WatchID addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive);
+
+ /// Remove a directory watch. This is a brute force lazy search O(nlogn).
+ void removeWatch(const std::string& directory);
+
+ /// Remove a directory watch. This is a map lookup O(logn).
+ void removeWatch(WatchID watchid);
+
+ /// Updates the watcher. Must be called often.
+ void watch();
+
+ /// Handles the action
+ void handleAction(Watcher* watch, const std::string& filename, unsigned long action, std::string oldFilename = "");
+
+ /// @return Returns a list of the directories that are being watched
+ std::list<std::string> directories();
+ protected:
+ static void FSEventCallback( ConstFSEventStreamRef streamRef,
+ void *userData,
+ size_t numEvents,
+ void *eventPaths,
+ const FSEventStreamEventFlags eventFlags[],
+ const FSEventStreamEventId eventIds[]
+ );
+
+ CFRunLoopRef mRunLoopRef;
+
+ /// Vector of WatcherWin32 pointers
+ WatchMap mWatches;
+
+ /// The last watchid
+ WatchID mLastWatchID;
+
+ Thread * mThread;
+
+ Mutex mWatchesLock;
+
+ bool pathInWatches( const std::string& path );
+
+ std::list<WatcherFSEvents*> mNeedInit;
+ private:
+ void run();
+};
+
+}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/FileWatcherGeneric.cpp b/dep/efsw/src/efsw/FileWatcherGeneric.cpp
new file mode 100644
index 00000000000..1534b6a9279
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherGeneric.cpp
@@ -0,0 +1,197 @@
+#include <efsw/FileWatcherGeneric.hpp>
+#include <efsw/FileSystem.hpp>
+#include <efsw/System.hpp>
+
+namespace efsw
+{
+
+FileWatcherGeneric::FileWatcherGeneric( FileWatcher * parent ) :
+ FileWatcherImpl( parent ),
+ mThread( NULL ),
+ mLastWatchID( 0 )
+{
+ mInitOK = true;
+ mIsGeneric = true;
+}
+
+FileWatcherGeneric::~FileWatcherGeneric()
+{
+ mInitOK = false;
+
+ mThread->wait();
+
+ efSAFE_DELETE( mThread );
+
+ /// Delete the watches
+ WatchList::iterator it = mWatches.begin();
+
+ for ( ; it != mWatches.end(); it++ )
+ {
+ efSAFE_DELETE( (*it) );
+ }
+}
+
+WatchID FileWatcherGeneric::addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive)
+{
+ std::string dir( directory );
+
+ FileSystem::dirAddSlashAtEnd( dir );
+
+ FileInfo fi( dir );
+
+ if ( !fi.isDirectory() )
+ {
+ return Errors::Log::createLastError( Errors::FileNotFound, dir );
+ }
+ else if ( !fi.isReadable() )
+ {
+ return Errors::Log::createLastError( Errors::FileNotReadable, dir );
+ }
+ else if ( pathInWatches( dir ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, dir );
+ }
+
+ std::string curPath;
+ std::string link( FileSystem::getLinkRealPath( dir, curPath ) );
+
+ if ( "" != link )
+ {
+ if ( pathInWatches( link ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, dir );
+ }
+ else if ( !linkAllowed( curPath, link ) )
+ {
+ return Errors::Log::createLastError( Errors::FileOutOfScope, dir );
+ }
+ else
+ {
+ dir = link;
+ }
+ }
+
+ mLastWatchID++;
+
+ WatcherGeneric * pWatch = new WatcherGeneric( mLastWatchID, dir, watcher, this, recursive );
+
+ mWatchesLock.lock();
+ mWatches.push_back(pWatch);
+ mWatchesLock.unlock();
+
+ return pWatch->ID;
+}
+
+void FileWatcherGeneric::removeWatch( const std::string& directory )
+{
+ WatchList::iterator it = mWatches.begin();
+
+ for ( ; it != mWatches.end(); it++ )
+ {
+ if ( (*it)->Directory == directory )
+ {
+ WatcherGeneric * watch = (*it);
+
+ mWatchesLock.lock();
+
+ mWatches.erase( it );
+
+ efSAFE_DELETE( watch ) ;
+
+ mWatchesLock.unlock();
+
+ return;
+ }
+ }
+}
+
+void FileWatcherGeneric::removeWatch(WatchID watchid)
+{
+ WatchList::iterator it = mWatches.begin();
+
+ for ( ; it != mWatches.end(); it++ )
+ {
+ if ( (*it)->ID == watchid )
+ {
+ WatcherGeneric * watch = (*it);
+
+ mWatchesLock.lock();
+
+ mWatches.erase( it );
+
+ efSAFE_DELETE( watch ) ;
+
+ mWatchesLock.unlock();
+
+ return;
+ }
+ }
+}
+
+void FileWatcherGeneric::watch()
+{
+ if ( NULL == mThread )
+ {
+ mThread = new Thread( &FileWatcherGeneric::run, this );
+ mThread->launch();
+ }
+}
+
+void FileWatcherGeneric::run()
+{
+ do
+ {
+ mWatchesLock.lock();
+
+ WatchList::iterator it = mWatches.begin();
+
+ for ( ; it != mWatches.end(); it++ )
+ {
+ (*it)->watch();
+ }
+
+ mWatchesLock.unlock();
+
+ if ( mInitOK ) System::sleep( 1000 );
+ } while ( mInitOK );
+}
+
+void FileWatcherGeneric::handleAction(Watcher * watch, const std::string& filename, unsigned long action, std::string oldFilename)
+{
+ /// Not used
+}
+
+std::list<std::string> FileWatcherGeneric::directories()
+{
+ std::list<std::string> dirs;
+
+ mWatchesLock.lock();
+
+ WatchList::iterator it = mWatches.begin();
+
+ for ( ; it != mWatches.end(); it++ )
+ {
+ dirs.push_back( (*it)->Directory );
+ }
+
+ mWatchesLock.unlock();
+
+ return dirs;
+}
+
+bool FileWatcherGeneric::pathInWatches( const std::string& path )
+{
+ WatchList::iterator it = mWatches.begin();
+
+ for ( ; it != mWatches.end(); it++ )
+ {
+ if ( (*it)->Directory == path || (*it)->pathInWatches( path ) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+}
diff --git a/dep/efsw/src/efsw/FileWatcherGeneric.hpp b/dep/efsw/src/efsw/FileWatcherGeneric.hpp
new file mode 100644
index 00000000000..fc9826580ab
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherGeneric.hpp
@@ -0,0 +1,59 @@
+#ifndef EFSW_FILEWATCHERGENERIC_HPP
+#define EFSW_FILEWATCHERGENERIC_HPP
+
+#include <efsw/FileWatcherImpl.hpp>
+#include <efsw/WatcherGeneric.hpp>
+#include <efsw/DirWatcherGeneric.hpp>
+#include <list>
+
+namespace efsw
+{
+
+/// Implementation for Generic File Watcher.
+/// @class FileWatcherGeneric
+class FileWatcherGeneric : public FileWatcherImpl
+{
+ public:
+ typedef std::list<WatcherGeneric*> WatchList;
+
+ FileWatcherGeneric( FileWatcher * parent );
+
+ virtual ~FileWatcherGeneric();
+
+ /// Add a directory watch
+ /// On error returns WatchID with Error type.
+ WatchID addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive);
+
+ /// Remove a directory watch. This is a brute force lazy search O(nlogn).
+ void removeWatch(const std::string& directory);
+
+ /// Remove a directory watch. This is a map lookup O(logn).
+ void removeWatch(WatchID watchid);
+
+ /// Updates the watcher. Must be called often.
+ void watch();
+
+ /// Handles the action
+ void handleAction(Watcher * watch, const std::string& filename, unsigned long action, std::string oldFilename = "");
+
+ /// @return Returns a list of the directories that are being watched
+ std::list<std::string> directories();
+ protected:
+ Thread * mThread;
+
+ /// The last watchid
+ WatchID mLastWatchID;
+
+ /// Map of WatchID to WatchStruct pointers
+ WatchList mWatches;
+
+ Mutex mWatchesLock;
+
+ bool pathInWatches( const std::string& path );
+ private:
+ void run();
+};
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/FileWatcherImpl.cpp b/dep/efsw/src/efsw/FileWatcherImpl.cpp
new file mode 100644
index 00000000000..e6e0fc72a13
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherImpl.cpp
@@ -0,0 +1,29 @@
+#include <efsw/FileWatcherImpl.hpp>
+#include <efsw/String.hpp>
+#include <efsw/System.hpp>
+
+namespace efsw {
+
+FileWatcherImpl::FileWatcherImpl( FileWatcher * parent ) :
+ mFileWatcher( parent ),
+ mInitOK( false ),
+ mIsGeneric( false )
+{
+ System::maxFD();
+}
+
+FileWatcherImpl::~FileWatcherImpl()
+{
+}
+
+bool FileWatcherImpl::initOK()
+{
+ return mInitOK;
+}
+
+bool FileWatcherImpl::linkAllowed( const std::string& curPath, const std::string& link )
+{
+ return ( mFileWatcher->followSymlinks() && mFileWatcher->allowOutOfScopeLinks() ) || -1 != String::strStartsWith( curPath, link );
+}
+
+}
diff --git a/dep/efsw/src/efsw/FileWatcherImpl.hpp b/dep/efsw/src/efsw/FileWatcherImpl.hpp
new file mode 100644
index 00000000000..8f472bf56c5
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherImpl.hpp
@@ -0,0 +1,54 @@
+#ifndef EFSW_FILEWATCHERIMPL_HPP
+#define EFSW_FILEWATCHERIMPL_HPP
+
+#include <efsw/base.hpp>
+#include <efsw/efsw.hpp>
+#include <efsw/Watcher.hpp>
+#include <efsw/Thread.hpp>
+#include <efsw/Mutex.hpp>
+
+namespace efsw {
+
+class FileWatcherImpl
+{
+ public:
+ FileWatcherImpl( FileWatcher * parent );
+
+ virtual ~FileWatcherImpl();
+
+ /// Add a directory watch
+ /// On error returns WatchID with Error type.
+ virtual WatchID addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive) = 0;
+
+ /// Remove a directory watch. This is a brute force lazy search O(nlogn).
+ virtual void removeWatch(const std::string& directory) = 0;
+
+ /// Remove a directory watch. This is a map lookup O(logn).
+ virtual void removeWatch(WatchID watchid) = 0;
+
+ /// Updates the watcher. Must be called often.
+ virtual void watch() = 0;
+
+ /// Handles the action
+ virtual void handleAction(Watcher * watch, const std::string& filename, unsigned long action, std::string oldFilename = "") = 0;
+
+ /// @return Returns a list of the directories that are being watched
+ virtual std::list<std::string> directories() = 0;
+
+ /// @return true if the backend init successfully
+ virtual bool initOK();
+
+ /// @return If the link is allowed according to the current path and the state of out scope links
+ virtual bool linkAllowed( const std::string& curPath, const std::string& link );
+
+ /// Search if a directory already exists in the watches
+ virtual bool pathInWatches( const std::string& path ) = 0;
+
+ FileWatcher * mFileWatcher;
+ bool mInitOK;
+ bool mIsGeneric;
+};
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/FileWatcherInotify.cpp b/dep/efsw/src/efsw/FileWatcherInotify.cpp
new file mode 100644
index 00000000000..19c20761663
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherInotify.cpp
@@ -0,0 +1,531 @@
+#include <efsw/FileWatcherInotify.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_INOTIFY
+
+#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+
+#ifdef EFSW_INOTIFY_NOSYS
+#include <efsw/inotify-nosys.h>
+#else
+#include <sys/inotify.h>
+#endif
+
+#include <efsw/FileSystem.hpp>
+#include <efsw/System.hpp>
+#include <efsw/Debug.hpp>
+
+#define BUFF_SIZE ((sizeof(struct inotify_event)+FILENAME_MAX)*1024)
+
+namespace efsw
+{
+
+FileWatcherInotify::FileWatcherInotify( FileWatcher * parent ) :
+ FileWatcherImpl( parent ),
+ mFD(-1),
+ mThread(NULL)
+{
+ mFD = inotify_init();
+
+ if (mFD < 0)
+ {
+ efDEBUG( "Error: %s\n", strerror(errno) );
+ }
+ else
+ {
+ mInitOK = true;
+ }
+}
+
+FileWatcherInotify::~FileWatcherInotify()
+{
+ mInitOK = false;
+
+ efSAFE_DELETE( mThread );
+
+ WatchMap::iterator iter = mWatches.begin();
+ WatchMap::iterator end = mWatches.end();
+
+ for(; iter != end; ++iter)
+ {
+ efSAFE_DELETE( iter->second );
+ }
+
+ mWatches.clear();
+
+ if ( mFD != -1 )
+ {
+ close(mFD);
+ mFD = -1;
+ }
+}
+
+WatchID FileWatcherInotify::addWatch( const std::string& directory, FileWatchListener* watcher, bool recursive )
+{
+ return addWatch( directory, watcher, recursive, NULL );
+}
+
+WatchID FileWatcherInotify::addWatch( const std::string& directory, FileWatchListener* watcher, bool recursive, WatcherInotify * parent )
+{
+ std::string dir( directory );
+
+ FileSystem::dirAddSlashAtEnd( dir );
+
+ FileInfo fi( dir );
+
+ if ( !fi.isDirectory() )
+ {
+ return Errors::Log::createLastError( Errors::FileNotFound, dir );
+ }
+ else if ( !fi.isReadable() )
+ {
+ return Errors::Log::createLastError( Errors::FileNotReadable, dir );
+ }
+ else if ( pathInWatches( dir ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, directory );
+ }
+ else if ( NULL != parent && FileSystem::isRemoteFS( dir ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRemote, dir );
+ }
+
+ /// Check if the directory is a symbolic link
+ std::string curPath;
+ std::string link( FileSystem::getLinkRealPath( dir, curPath ) );
+
+ if ( "" != link )
+ {
+ /// Avoid adding symlinks directories if it's now enabled
+ if ( NULL != parent && !mFileWatcher->followSymlinks() )
+ {
+ return Errors::Log::createLastError( Errors::FileOutOfScope, dir );
+ }
+
+ /// If it's a symlink check if the realpath exists as a watcher, or
+ /// if the path is outside the current dir
+ if ( pathInWatches( link ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, directory );
+ }
+ else if ( !linkAllowed( curPath, link ) )
+ {
+ return Errors::Log::createLastError( Errors::FileOutOfScope, dir );
+ }
+ else
+ {
+ dir = link;
+ }
+ }
+
+ int wd = inotify_add_watch (mFD, dir.c_str(), IN_CLOSE_WRITE | IN_MOVED_TO | IN_CREATE | IN_MOVED_FROM | IN_DELETE | IN_MODIFY);
+
+ if ( wd < 0 )
+ {
+ if( errno == ENOENT )
+ {
+ return Errors::Log::createLastError( Errors::FileNotFound, dir );
+ }
+ else
+ {
+ return Errors::Log::createLastError( Errors::Unspecified, std::string(strerror(errno)) );
+ }
+ }
+
+ efDEBUG( "Added watch %s with id: %d\n", dir.c_str(), wd );
+
+ WatcherInotify * pWatch = new WatcherInotify();
+ pWatch->Listener = watcher;
+ pWatch->ID = wd;
+ pWatch->Directory = dir;
+ pWatch->Recursive = recursive;
+ pWatch->Parent = parent;
+
+ mWatchesLock.lock();
+ mWatches.insert(std::make_pair(wd, pWatch));
+ mWatchesLock.unlock();
+
+ if ( NULL == pWatch->Parent )
+ {
+ mRealWatches[ pWatch->ID ] = pWatch;
+ }
+
+ if ( pWatch->Recursive )
+ {
+ std::map<std::string, FileInfo> files = FileSystem::filesInfoFromPath( pWatch->Directory );
+ std::map<std::string, FileInfo>::iterator it = files.begin();
+
+ for ( ; it != files.end(); it++ )
+ {
+ FileInfo fi = it->second;
+
+ if ( fi.isDirectory() && fi.isReadable() )
+ {
+ addWatch( fi.Filepath, watcher, recursive, pWatch );
+ }
+ }
+ }
+
+ return wd;
+}
+
+void FileWatcherInotify::removeWatchLocked(WatchID watchid)
+{
+ WatchMap::iterator iter = mWatches.find( watchid );
+
+ WatcherInotify * watch = iter->second;
+
+ if ( watch->Recursive )
+ {
+ WatchMap::iterator it = mWatches.begin();
+ std::list<WatchID> eraseWatches;
+
+ for(; it != mWatches.end(); ++it)
+ {
+ if ( it->second != watch &&
+ it->second->inParentTree( watch )
+ )
+ {
+ eraseWatches.push_back( it->second->ID );
+ }
+ }
+
+ for ( std::list<WatchID>::iterator eit = eraseWatches.begin(); eit != eraseWatches.end(); eit++ )
+ {
+ removeWatch( *eit );
+ }
+ }
+
+ mWatches.erase( iter );
+
+ if ( NULL == watch->Parent )
+ {
+ WatchMap::iterator eraseit = mRealWatches.find( watch->ID );
+
+ if ( eraseit != mRealWatches.end() )
+ {
+ mRealWatches.erase( eraseit );
+ }
+ }
+
+ int err = inotify_rm_watch(mFD, watchid);
+
+ if ( err < 0 )
+ {
+ efDEBUG( "Error removing watch %d: %s\n", watchid, strerror(errno) );
+ }
+ else
+ {
+ efDEBUG( "Removed watch %s with id: %d\n", watch->Directory.c_str(), watchid );
+ }
+
+ efSAFE_DELETE( watch );
+}
+
+void FileWatcherInotify::removeWatch(const std::string& directory)
+{
+ mWatchesLock.lock();
+
+ WatchMap::iterator iter = mWatches.begin();
+
+ for(; iter != mWatches.end(); ++iter)
+ {
+ if( directory == iter->second->Directory )
+ {
+ WatcherInotify * watch = iter->second;
+
+ if ( watch->Recursive )
+ {
+ WatchMap::iterator it = mWatches.begin();
+ std::list<WatchID> eraseWatches;
+
+ for(; it != mWatches.end(); ++it)
+ {
+ if ( it->second->inParentTree( watch ) )
+ {
+ eraseWatches.push_back( it->second->ID );
+ }
+ }
+
+ for ( std::list<WatchID>::iterator eit = eraseWatches.begin(); eit != eraseWatches.end(); eit++ )
+ {
+ removeWatchLocked( *eit );
+ }
+ }
+
+ mWatches.erase( iter );
+
+ if ( NULL == watch->Parent )
+ {
+ WatchMap::iterator eraseit = mRealWatches.find( watch->ID );
+
+ if ( eraseit != mRealWatches.end() )
+ {
+ mRealWatches.erase( eraseit );
+ }
+ }
+
+ int err = inotify_rm_watch(mFD, watch->ID);
+
+ if ( err < 0 )
+ {
+ efDEBUG( "Error removing watch %d: %s\n", watch->ID, strerror(errno) );
+ }
+ else
+ {
+ efDEBUG( "Removed watch %s with id: %d\n", watch->Directory.c_str(), watch->ID );
+ }
+
+ efSAFE_DELETE( watch );
+
+ break;
+ }
+ }
+
+ mWatchesLock.unlock();
+}
+
+void FileWatcherInotify::removeWatch( WatchID watchid )
+{
+ mWatchesLock.lock();
+
+ WatchMap::iterator iter = mWatches.find( watchid );
+
+ if( iter == mWatches.end() )
+ {
+ mWatchesLock.unlock();
+
+ return;
+ }
+
+ removeWatchLocked( watchid );
+
+ mWatchesLock.unlock();
+}
+
+void FileWatcherInotify::watch()
+{
+ if ( NULL == mThread )
+ {
+ mThread = new Thread( &FileWatcherInotify::run, this );
+ mThread->launch();
+ }
+}
+
+void FileWatcherInotify::run()
+{
+ static char buff[BUFF_SIZE] = {0};
+ WatchMap::iterator wit;
+ std::list<WatcherInotify*> movedOutsideWatches;
+
+ do
+ {
+ fd_set rfds;
+ FD_ZERO (&rfds);
+ FD_SET (mFD, &rfds);
+ timeval timeout;
+ timeout.tv_sec=0;
+ timeout.tv_usec=100000;
+
+ if( select (FD_SETSIZE, &rfds, NULL, NULL, &timeout) > 0 )
+ {
+ ssize_t len, i = 0;
+
+ len = read (mFD, buff, BUFF_SIZE);
+
+ if (len != -1)
+ {
+ while (i < len)
+ {
+ struct inotify_event *pevent = (struct inotify_event *)&buff[i];
+
+ mWatchesLock.lock();
+
+ wit = mWatches.find( pevent->wd );
+
+ if ( wit != mWatches.end() )
+ {
+ handleAction(wit->second, pevent->name, pevent->mask);
+
+ /// Keep track of the IN_MOVED_FROM events to known if the IN_MOVED_TO event is also fired
+ if ( !wit->second->OldFileName.empty() )
+ {
+ movedOutsideWatches.push_back( wit->second );
+ }
+ }
+
+ mWatchesLock.unlock();
+
+ i += sizeof(struct inotify_event) + pevent->len;
+ }
+
+ if ( !movedOutsideWatches.empty() )
+ {
+ /// In case that the IN_MOVED_TO is never fired means that the file was moved to other folder
+ for ( std::list<WatcherInotify*>::iterator it = movedOutsideWatches.begin(); it != movedOutsideWatches.end(); it++ )
+ {
+ if ( !(*it)->OldFileName.empty() )
+ {
+ /// So we send a IN_DELETE event for files that where moved outside of our scope
+ handleAction( *it, (*it)->OldFileName, IN_DELETE );
+
+ /// Remove the OldFileName
+ (*it)->OldFileName = "";
+ }
+ }
+
+ movedOutsideWatches.clear();
+ }
+ }
+ }
+ } while( mInitOK );
+}
+
+void FileWatcherInotify::checkForNewWatcher( Watcher* watch, std::string fpath )
+{
+ FileSystem::dirAddSlashAtEnd( fpath );
+
+ /// If the watcher is recursive, checks if the new file is a folder, and creates a watcher
+ if ( watch->Recursive && FileSystem::isDirectory( fpath ) )
+ {
+ bool found = false;
+
+ /// First check if exists
+ for ( WatchMap::iterator it = mWatches.begin(); it != mWatches.end(); it++ )
+ {
+ if ( it->second->Directory == fpath )
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if ( !found )
+ {
+ addWatch( fpath, watch->Listener, watch->Recursive, static_cast<WatcherInotify*>( watch ) );
+ }
+ }
+}
+
+void FileWatcherInotify::handleAction( Watcher* watch, const std::string& filename, unsigned long action, std::string oldFilename )
+{
+ if ( !watch || !watch->Listener )
+ {
+ return;
+ }
+
+ std::string fpath( watch->Directory + filename );
+
+ if ( ( IN_CLOSE_WRITE & action ) || ( IN_MODIFY & action ) )
+ {
+ watch->Listener->handleFileAction( watch->ID, watch->Directory, filename, Actions::Modified );
+ }
+ else if( IN_MOVED_TO & action )
+ {
+ /// If OldFileName doesn't exist means that the file has been moved from other folder, so we just send the Add event
+ if ( watch->OldFileName.empty() )
+ {
+ watch->Listener->handleFileAction( watch->ID, watch->Directory, filename, Actions::Add );
+
+ watch->Listener->handleFileAction( watch->ID, watch->Directory, filename, Actions::Modified );
+
+ checkForNewWatcher( watch, fpath );
+ }
+ else
+ {
+ watch->Listener->handleFileAction( watch->ID, watch->Directory, filename, Actions::Moved, watch->OldFileName );
+ }
+
+ if ( watch->Recursive && FileSystem::isDirectory( fpath ) )
+ {
+ /// Update the new directory path
+ std::string opath( watch->Directory + watch->OldFileName );
+ FileSystem::dirAddSlashAtEnd( opath );
+ FileSystem::dirAddSlashAtEnd( fpath );
+
+ for ( WatchMap::iterator it = mWatches.begin(); it != mWatches.end(); it++ )
+ {
+ if ( it->second->Directory == opath && it->second->DirInfo.Inode == FileInfo( opath ).Inode )
+ {
+ it->second->Directory = fpath;
+ it->second->DirInfo = FileInfo( fpath );
+
+ break;
+ }
+ }
+ }
+
+ watch->OldFileName = "";
+ }
+ else if( IN_CREATE & action )
+ {
+ watch->Listener->handleFileAction( watch->ID, watch->Directory, filename, Actions::Add );
+
+ checkForNewWatcher( watch, fpath );
+ }
+ else if ( IN_MOVED_FROM & action )
+ {
+ watch->OldFileName = filename;
+ }
+ else if( IN_DELETE & action )
+ {
+ watch->Listener->handleFileAction( watch->ID, watch->Directory, filename, Actions::Delete );
+
+ FileSystem::dirAddSlashAtEnd( fpath );
+
+ /// If the file erased is a directory and recursive is enabled, removes the directory erased
+ if ( watch->Recursive )
+ {
+ for ( WatchMap::iterator it = mWatches.begin(); it != mWatches.end(); it++ )
+ {
+ if ( it->second->Directory == fpath )
+ {
+ removeWatch( it->second->ID );
+ break;
+ }
+ }
+ }
+ }
+}
+
+std::list<std::string> FileWatcherInotify::directories()
+{
+ std::list<std::string> dirs;
+
+ mWatchesLock.lock();
+
+ WatchMap::iterator it = mRealWatches.begin();
+
+ for ( ; it != mRealWatches.end(); it++ )
+ {
+ dirs.push_back( it->second->Directory );
+ }
+
+ mWatchesLock.unlock();
+
+ return dirs;
+}
+
+bool FileWatcherInotify::pathInWatches( const std::string& path )
+{
+ /// Search in the real watches, since it must allow adding a watch already watched as a subdir
+ WatchMap::iterator it = mRealWatches.begin();
+
+ for ( ; it != mRealWatches.end(); it++ )
+ {
+ if ( it->second->Directory == path )
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/FileWatcherInotify.hpp b/dep/efsw/src/efsw/FileWatcherInotify.hpp
new file mode 100644
index 00000000000..43ee9ca6afc
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherInotify.hpp
@@ -0,0 +1,73 @@
+#ifndef EFSW_FILEWATCHERLINUX_HPP
+#define EFSW_FILEWATCHERLINUX_HPP
+
+#include <efsw/FileWatcherImpl.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_INOTIFY
+
+#include <efsw/WatcherInotify.hpp>
+#include <map>
+
+namespace efsw
+{
+
+/// Implementation for Linux based on inotify.
+/// @class FileWatcherInotify
+class FileWatcherInotify : public FileWatcherImpl
+{
+ public:
+ /// type for a map from WatchID to WatchStruct pointer
+ typedef std::map<WatchID, WatcherInotify*> WatchMap;
+
+ FileWatcherInotify( FileWatcher * parent );
+
+ virtual ~FileWatcherInotify();
+
+ /// Add a directory watch
+ /// On error returns WatchID with Error type.
+ WatchID addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive);
+
+ /// Remove a directory watch. This is a brute force lazy search O(nlogn).
+ void removeWatch(const std::string& directory);
+
+ /// Remove a directory watch. This is a map lookup O(logn).
+ void removeWatch(WatchID watchid);
+
+ /// Updates the watcher. Must be called often.
+ void watch();
+
+ /// Handles the action
+ void handleAction(Watcher * watch, const std::string& filename, unsigned long action, std::string oldFilename = "");
+
+ /// @return Returns a list of the directories that are being watched
+ std::list<std::string> directories();
+ protected:
+ /// Map of WatchID to WatchStruct pointers
+ WatchMap mWatches;
+
+ /// User added watches
+ WatchMap mRealWatches;
+
+ /// inotify file descriptor
+ int mFD;
+
+ Thread * mThread;
+
+ Mutex mWatchesLock;
+
+ WatchID addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive, WatcherInotify * parent = NULL );
+
+ bool pathInWatches( const std::string& path );
+ private:
+ void run();
+
+ void removeWatchLocked(WatchID watchid);
+
+ void checkForNewWatcher( Watcher* watch, std::string fpath );
+};
+
+}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/FileWatcherKqueue.cpp b/dep/efsw/src/efsw/FileWatcherKqueue.cpp
new file mode 100644
index 00000000000..600fd085b35
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherKqueue.cpp
@@ -0,0 +1,274 @@
+#include <efsw/FileWatcherKqueue.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_KQUEUE || EFSW_PLATFORM == EFSW_PLATFORM_FSEVENTS
+
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dirent.h>
+#include <string.h>
+#include <efsw/FileSystem.hpp>
+#include <efsw/System.hpp>
+#include <efsw/Debug.hpp>
+#include <efsw/WatcherGeneric.hpp>
+
+namespace efsw
+{
+
+FileWatcherKqueue::FileWatcherKqueue( FileWatcher * parent ) :
+ FileWatcherImpl( parent ),
+ mLastWatchID(0),
+ mThread( NULL ),
+ mFileDescriptorCount( 1 ),
+ mAddingWatcher( false )
+{
+ mTimeOut.tv_sec = 0;
+ mTimeOut.tv_nsec = 0;
+ mInitOK = true;
+}
+
+FileWatcherKqueue::~FileWatcherKqueue()
+{
+ WatchMap::iterator iter = mWatches.begin();
+
+ for(; iter != mWatches.end(); ++iter)
+ {
+ efSAFE_DELETE( iter->second );
+ }
+
+ mWatches.clear();
+
+ mInitOK = false;
+
+ mThread->wait();
+
+ efSAFE_DELETE( mThread );
+}
+
+WatchID FileWatcherKqueue::addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive)
+{
+ static bool s_ug = false;
+
+ std::string dir( directory );
+
+ FileSystem::dirAddSlashAtEnd( dir );
+
+ FileInfo fi( dir );
+
+ if ( !fi.isDirectory() )
+ {
+ return Errors::Log::createLastError( Errors::FileNotFound, dir );
+ }
+ else if ( !fi.isReadable() )
+ {
+ return Errors::Log::createLastError( Errors::FileNotReadable, dir );
+ }
+ else if ( pathInWatches( dir ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, directory );
+ }
+
+ std::string curPath;
+ std::string link( FileSystem::getLinkRealPath( dir, curPath ) );
+
+ if ( "" != link )
+ {
+ if ( pathInWatches( link ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, directory );
+ }
+ else if ( !linkAllowed( curPath, link ) )
+ {
+ return Errors::Log::createLastError( Errors::FileOutOfScope, dir );
+ }
+ else
+ {
+ dir = link;
+ }
+ }
+
+ /// Check first if are enough file descriptors available to create another kqueue watcher, otherwise it creates a generic watcher
+ if ( availablesFD() )
+ {
+ mAddingWatcher = true;
+
+ WatcherKqueue * watch = new WatcherKqueue( ++mLastWatchID, dir, watcher, recursive, this );
+
+ mWatchesLock.lock();
+ mWatches.insert(std::make_pair(mLastWatchID, watch));
+ mWatchesLock.unlock();
+
+ watch->addAll();
+
+ // if failed to open the directory... erase the watcher
+ if ( !watch->initOK() )
+ {
+ int le = watch->lastErrno();
+
+ mWatches.erase( watch->ID );
+
+ efSAFE_DELETE( watch );
+
+ mLastWatchID--;
+
+ // Probably the folder has too many files, create a generic watcher
+ if ( EACCES != le )
+ {
+ WatcherGeneric * watch = new WatcherGeneric( ++mLastWatchID, dir, watcher, this, recursive );
+
+ mWatchesLock.lock();
+ mWatches.insert(std::make_pair(mLastWatchID, watch));
+ mWatchesLock.unlock();
+ }
+ else
+ {
+ return Errors::Log::createLastError( Errors::Unspecified, link );
+ }
+ }
+
+ mAddingWatcher = false;
+ }
+ else
+ {
+ if ( !s_ug )
+ {
+ efDEBUG( "Started using generic watcher, file descriptor limit reached: %ld\n", mFileDescriptorCount );
+ s_ug = true;
+ }
+
+ WatcherGeneric * watch = new WatcherGeneric( ++mLastWatchID, dir, watcher, this, recursive );
+
+ mWatchesLock.lock();
+ mWatches.insert(std::make_pair(mLastWatchID, watch));
+ mWatchesLock.unlock();
+ }
+
+ return mLastWatchID;
+}
+
+void FileWatcherKqueue::removeWatch(const std::string& directory)
+{
+ mWatchesLock.lock();
+
+ WatchMap::iterator iter = mWatches.begin();
+
+ for(; iter != mWatches.end(); ++iter)
+ {
+ if(directory == iter->second->Directory)
+ {
+ removeWatch(iter->first);
+ return;
+ }
+ }
+
+ mWatchesLock.unlock();
+}
+
+void FileWatcherKqueue::removeWatch(WatchID watchid)
+{
+ mWatchesLock.lock();
+
+ WatchMap::iterator iter = mWatches.find(watchid);
+
+ if(iter == mWatches.end())
+ return;
+
+ Watcher* watch = iter->second;
+
+ mWatches.erase(iter);
+
+ efSAFE_DELETE( watch );
+
+ mWatchesLock.unlock();
+}
+
+bool FileWatcherKqueue::isAddingWatcher() const
+{
+ return mAddingWatcher;
+}
+
+void FileWatcherKqueue::watch()
+{
+ if ( NULL == mThread )
+ {
+ mThread = new Thread( &FileWatcherKqueue::run, this );
+ mThread->launch();
+ }
+}
+
+void FileWatcherKqueue::run()
+{
+ do
+ {
+ mWatchesLock.lock();
+
+ for ( WatchMap::iterator it = mWatches.begin(); it != mWatches.end(); ++it )
+ {
+ it->second->watch();
+ }
+
+ mWatchesLock.unlock();
+
+ System::sleep( 500 );
+ } while( mInitOK );
+}
+
+void FileWatcherKqueue::handleAction(Watcher* watch, const std::string& filename, unsigned long action, std::string oldFilename)
+{
+}
+
+std::list<std::string> FileWatcherKqueue::directories()
+{
+ std::list<std::string> dirs;
+
+ mWatchesLock.lock();
+
+ WatchMap::iterator it = mWatches.begin();
+
+ for ( ; it != mWatches.end(); it++ )
+ {
+ dirs.push_back( it->second->Directory );
+ }
+
+ mWatchesLock.unlock();
+
+ return dirs;
+}
+
+bool FileWatcherKqueue::pathInWatches( const std::string& path )
+{
+ WatchMap::iterator it = mWatches.begin();
+
+ for ( ; it != mWatches.end(); it++ )
+ {
+ if ( it->second->Directory == path )
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void FileWatcherKqueue::addFD()
+{
+ mFileDescriptorCount++;
+}
+
+void FileWatcherKqueue::removeFD()
+{
+ mFileDescriptorCount--;
+}
+
+bool FileWatcherKqueue::availablesFD()
+{
+ return mFileDescriptorCount <= (Int64)System::getMaxFD() - 500;
+}
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/FileWatcherKqueue.hpp b/dep/efsw/src/efsw/FileWatcherKqueue.hpp
new file mode 100644
index 00000000000..0a2431e3777
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherKqueue.hpp
@@ -0,0 +1,78 @@
+#ifndef EFSW_FILEWATCHEROSX_HPP
+#define EFSW_FILEWATCHEROSX_HPP
+
+#include <efsw/FileWatcherImpl.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_KQUEUE || EFSW_PLATFORM == EFSW_PLATFORM_FSEVENTS
+
+#include <efsw/WatcherKqueue.hpp>
+
+namespace efsw
+{
+
+/// Implementation for OSX based on kqueue.
+/// @class FileWatcherKqueue
+class FileWatcherKqueue : public FileWatcherImpl
+{
+ friend class WatcherKqueue;
+ public:
+ FileWatcherKqueue( FileWatcher * parent );
+
+ virtual ~FileWatcherKqueue();
+
+ /// Add a directory watch
+ /// On error returns WatchID with Error type.
+ WatchID addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive);
+
+ /// Remove a directory watch. This is a brute force lazy search O(nlogn).
+ void removeWatch(const std::string& directory);
+
+ /// Remove a directory watch. This is a map lookup O(logn).
+ void removeWatch(WatchID watchid);
+
+ /// Updates the watcher. Must be called often.
+ void watch();
+
+ /// Handles the action
+ void handleAction(Watcher* watch, const std::string& filename, unsigned long action, std::string oldFilename = "");
+
+ /// @return Returns a list of the directories that are being watched
+ std::list<std::string> directories();
+ protected:
+ /// Map of WatchID to WatchStruct pointers
+ WatchMap mWatches;
+
+ /// time out data
+ struct timespec mTimeOut;
+
+ /// WatchID allocator
+ int mLastWatchID;
+
+ Thread * mThread;
+
+ Mutex mWatchesLock;
+
+ std::list<WatchID> mRemoveList;
+
+ long mFileDescriptorCount;
+
+ bool mAddingWatcher;
+
+ bool isAddingWatcher() const;
+
+ bool pathInWatches( const std::string& path );
+
+ void addFD();
+
+ void removeFD();
+
+ bool availablesFD();
+ private:
+ void run();
+};
+
+}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/FileWatcherWin32.cpp b/dep/efsw/src/efsw/FileWatcherWin32.cpp
new file mode 100644
index 00000000000..fe78dd122cf
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherWin32.cpp
@@ -0,0 +1,291 @@
+#include <efsw/FileWatcherWin32.hpp>
+#include <efsw/FileSystem.hpp>
+#include <efsw/System.hpp>
+#include <efsw/String.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+namespace efsw
+{
+
+FileWatcherWin32::FileWatcherWin32( FileWatcher * parent ) :
+ FileWatcherImpl( parent ),
+ mLastWatchID(0),
+ mThread( NULL )
+{
+ mInitOK = true;
+}
+
+FileWatcherWin32::~FileWatcherWin32()
+{
+ WatchVector::iterator iter = mWatches.begin();
+
+ mWatchesLock.lock();
+
+ for(; iter != mWatches.end(); ++iter)
+ {
+ DestroyWatch((*iter));
+ }
+
+ mHandles.clear();
+ mWatches.clear();
+
+ mInitOK = false;
+
+ mWatchesLock.unlock();
+
+ efSAFE_DELETE( mThread );
+}
+
+WatchID FileWatcherWin32::addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive)
+{
+ std::string dir( directory );
+
+ FileInfo fi( dir );
+
+ if ( !fi.isDirectory() )
+ {
+ return Errors::Log::createLastError( Errors::FileNotFound, dir );
+ }
+ else if ( !fi.isReadable() )
+ {
+ return Errors::Log::createLastError( Errors::FileNotReadable, dir );
+ }
+
+ FileSystem::dirAddSlashAtEnd( dir );
+
+ WatchID watchid = ++mLastWatchID;
+
+ mWatchesLock.lock();
+
+ WatcherStructWin32 * watch = CreateWatch( String::fromUtf8( dir ).toWideString().c_str(), recursive, FILE_NOTIFY_CHANGE_CREATION |
+ FILE_NOTIFY_CHANGE_LAST_WRITE |
+ FILE_NOTIFY_CHANGE_FILE_NAME |
+ FILE_NOTIFY_CHANGE_DIR_NAME |
+ FILE_NOTIFY_CHANGE_SIZE
+ );
+
+ if( NULL == watch )
+ {
+ return Errors::Log::createLastError( Errors::FileNotFound, dir );
+ }
+
+ if ( pathInWatches( dir ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, dir );
+ }
+
+ // Add the handle to the handles vector
+ watch->Watch->ID = watchid;
+ watch->Watch->Watch = this;
+ watch->Watch->Listener = watcher;
+ watch->Watch->DirName = new char[dir.length()+1];
+ strcpy(watch->Watch->DirName, dir.c_str());
+
+ mHandles.push_back( watch->Watch->DirHandle );
+ mWatches.push_back( watch );
+ mWatchesLock.unlock();
+
+ return watchid;
+}
+
+void FileWatcherWin32::removeWatch(const std::string& directory)
+{
+ mWatchesLock.lock();
+
+ WatchVector::iterator iter = mWatches.begin();
+
+ for(; iter != mWatches.end(); ++iter)
+ {
+ if(directory == (*iter)->Watch->DirName)
+ {
+ removeWatch((*iter)->Watch->ID);
+ return;
+ }
+ }
+
+ mWatchesLock.unlock();
+}
+
+void FileWatcherWin32::removeWatch(WatchID watchid)
+{
+ mWatchesLock.lock();
+
+ WatchVector::iterator iter = mWatches.begin();
+
+ WatcherStructWin32* watch = NULL;
+
+ for(; iter != mWatches.end(); ++iter)
+ {
+ // Find the watch ID
+ if ( (*iter)->Watch->ID == watchid )
+ {
+ watch = (*iter);
+
+ mWatches.erase( iter );
+
+ // Remove handle from the handle vector
+ HandleVector::iterator it = mHandles.begin();
+
+ for ( ; it != mHandles.end(); it++ )
+ {
+ if ( watch->Watch->DirHandle == (*it) )
+ {
+ mHandles.erase( it );
+ break;
+ }
+ }
+
+ DestroyWatch(watch);
+
+ break;
+ }
+ }
+
+ mWatchesLock.unlock();
+}
+
+void FileWatcherWin32::watch()
+{
+ if ( NULL == mThread )
+ {
+ mThread = new Thread( &FileWatcherWin32::run, this );
+ mThread->launch();
+ }
+}
+
+void FileWatcherWin32::run()
+{
+ if ( mHandles.empty() )
+ {
+ return;
+ }
+
+ do
+ {
+ if ( !mHandles.empty() )
+ {
+ mWatchesLock.lock();
+
+ for ( std::size_t i = 0; i < mWatches.size(); i++ )
+ {
+ WatcherStructWin32 * watch = mWatches[ i ];
+
+ // If the overlapped struct was cancelled ( because the creator thread doesn't exists anymore ),
+ // we recreate the overlapped in the current thread and refresh the watch
+ if ( /*STATUS_CANCELED*/0xC0000120 == watch->Overlapped.Internal )
+ {
+ watch->Overlapped = OVERLAPPED();
+ RefreshWatch(watch);
+ }
+
+ // First ensure that the handle is the same, this means that the watch was not removed.
+ if ( HasOverlappedIoCompleted( &watch->Overlapped ) && mHandles[ i ] == watch->Watch->DirHandle )
+ {
+ DWORD bytes;
+
+ if ( GetOverlappedResult( watch->Watch->DirHandle, &watch->Overlapped, &bytes, FALSE ) )
+ {
+ WatchCallback( ERROR_SUCCESS, bytes, &watch->Overlapped );
+ }
+ }
+ }
+
+ mWatchesLock.unlock();
+
+ if ( mInitOK )
+ {
+ System::sleep( 10 );
+ }
+ }
+ else
+ {
+ // Wait for a new handle to be added
+ System::sleep( 10 );
+ }
+ } while ( mInitOK );
+}
+
+void FileWatcherWin32::handleAction(Watcher* watch, const std::string& filename, unsigned long action, std::string oldFilename)
+{
+ Action fwAction;
+
+ switch(action)
+ {
+ case FILE_ACTION_RENAMED_OLD_NAME:
+ watch->OldFileName = filename;
+ return;
+ case FILE_ACTION_ADDED:
+ fwAction = Actions::Add;
+ break;
+ case FILE_ACTION_RENAMED_NEW_NAME:
+ {
+ fwAction = Actions::Moved;
+
+ std::string fpath( watch->Directory + filename );
+
+ // Update the directory path
+ if ( watch->Recursive && FileSystem::isDirectory( fpath ) )
+ {
+ // Update the new directory path
+ std::string opath( watch->Directory + watch->OldFileName );
+ FileSystem::dirAddSlashAtEnd( opath );
+ FileSystem::dirAddSlashAtEnd( fpath );
+
+ for ( WatchVector::iterator it = mWatches.begin(); it != mWatches.end(); it++ )
+ {
+ if ( (*it)->Watch->Directory == opath )
+ {
+ (*it)->Watch->Directory = fpath;
+
+ break;
+ }
+ }
+ }
+
+ watch->Listener->handleFileAction(watch->ID, static_cast<WatcherWin32*>( watch )->DirName, filename, fwAction, watch->OldFileName);
+ return;
+ }
+ case FILE_ACTION_REMOVED:
+ fwAction = Actions::Delete;
+ break;
+ case FILE_ACTION_MODIFIED:
+ fwAction = Actions::Modified;
+ break;
+ };
+
+ watch->Listener->handleFileAction(watch->ID, static_cast<WatcherWin32*>( watch )->DirName, filename, fwAction);
+}
+
+std::list<std::string> FileWatcherWin32::directories()
+{
+ std::list<std::string> dirs;
+
+ mWatchesLock.lock();
+
+ for ( WatchVector::iterator it = mWatches.begin(); it != mWatches.end(); it++ )
+ {
+ dirs.push_back( std::string( (*it)->Watch->DirName ) );
+ }
+
+ mWatchesLock.unlock();
+
+ return dirs;
+}
+
+bool FileWatcherWin32::pathInWatches( const std::string& path )
+{
+ for ( WatchVector::iterator it = mWatches.begin(); it != mWatches.end(); it++ )
+ {
+ if ( (*it)->Watch->DirName == path )
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/FileWatcherWin32.hpp b/dep/efsw/src/efsw/FileWatcherWin32.hpp
new file mode 100644
index 00000000000..505cd772b82
--- /dev/null
+++ b/dep/efsw/src/efsw/FileWatcherWin32.hpp
@@ -0,0 +1,69 @@
+#ifndef EFSW_FILEWATCHERWIN32_HPP
+#define EFSW_FILEWATCHERWIN32_HPP
+
+#include <efsw/base.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+#include <efsw/WatcherWin32.hpp>
+#include <vector>
+#include <map>
+
+namespace efsw
+{
+
+/// Implementation for Win32 based on ReadDirectoryChangesW.
+/// @class FileWatcherWin32
+class FileWatcherWin32 : public FileWatcherImpl
+{
+ public:
+ /// type for a map from WatchID to WatcherWin32 pointer
+ typedef std::vector<WatcherStructWin32*> WatchVector;
+ typedef std::vector<HANDLE> HandleVector;
+
+ FileWatcherWin32( FileWatcher * parent );
+
+ virtual ~FileWatcherWin32();
+
+ /// Add a directory watch
+ /// On error returns WatchID with Error type.
+ WatchID addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive);
+
+ /// Remove a directory watch. This is a brute force lazy search O(nlogn).
+ void removeWatch(const std::string& directory);
+
+ /// Remove a directory watch. This is a map lookup O(logn).
+ void removeWatch(WatchID watchid);
+
+ /// Updates the watcher. Must be called often.
+ void watch();
+
+ /// Handles the action
+ void handleAction(Watcher* watch, const std::string& filename, unsigned long action, std::string oldFilename = "");
+
+ /// @return Returns a list of the directories that are being watched
+ std::list<std::string> directories();
+ protected:
+ /// Vector of WatcherWin32 pointers
+ WatchVector mWatches;
+
+ /// Keeps an updated handles vector
+ HandleVector mHandles;
+
+ /// The last watchid
+ WatchID mLastWatchID;
+
+ Thread * mThread;
+
+ Mutex mWatchesLock;
+
+ bool pathInWatches( const std::string& path );
+ private:
+ void run();
+};
+
+}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/Log.cpp b/dep/efsw/src/efsw/Log.cpp
new file mode 100644
index 00000000000..8e2860ac099
--- /dev/null
+++ b/dep/efsw/src/efsw/Log.cpp
@@ -0,0 +1,27 @@
+#include <efsw/efsw.hpp>
+
+namespace efsw { namespace Errors {
+
+static std::string LastError;
+
+std::string Log::getLastErrorLog()
+{
+ return LastError;
+}
+
+Error Log::createLastError( Error err, std::string log )
+{
+ switch ( err )
+ {
+ case FileNotFound: LastError = "File not found ( " + log + " )"; break;
+ case FileRepeated: LastError = "File reapeated in watches ( " + log + " )"; break;
+ case FileOutOfScope: LastError = "Symlink file out of scope ( " + log + " )"; break;
+ case FileRemote: LastError = "File is located in a remote file system, use a generic watcher. ( " + log + " )"; break;
+ case Unspecified:
+ default: LastError = log;
+ }
+
+ return err;
+}
+
+}}
diff --git a/dep/efsw/src/efsw/Mutex.cpp b/dep/efsw/src/efsw/Mutex.cpp
new file mode 100644
index 00000000000..b34ba066ee9
--- /dev/null
+++ b/dep/efsw/src/efsw/Mutex.cpp
@@ -0,0 +1,26 @@
+#include <efsw/Mutex.hpp>
+#include <efsw/platform/platformimpl.hpp>
+
+namespace efsw {
+
+Mutex::Mutex() :
+ mMutexImpl( new Platform::MutexImpl() )
+{
+}
+
+Mutex::~Mutex()
+{
+ efSAFE_DELETE( mMutexImpl );
+}
+
+void Mutex::lock()
+{
+ mMutexImpl->lock();
+}
+
+void Mutex::unlock()
+{
+ mMutexImpl->unlock();
+}
+
+}
diff --git a/dep/efsw/src/efsw/Mutex.hpp b/dep/efsw/src/efsw/Mutex.hpp
new file mode 100644
index 00000000000..e6e89def175
--- /dev/null
+++ b/dep/efsw/src/efsw/Mutex.hpp
@@ -0,0 +1,28 @@
+#ifndef EFSW_MUTEX_HPP
+#define EFSW_MUTEX_HPP
+
+#include <efsw/base.hpp>
+
+namespace efsw {
+
+namespace Platform { class MutexImpl; }
+
+/** Simple mutex class */
+class Mutex {
+ public:
+ Mutex();
+
+ ~Mutex();
+
+ /** Lock the mutex */
+ void lock();
+
+ /** Unlock the mutex */
+ void unlock();
+ private:
+ Platform::MutexImpl * mMutexImpl;
+};
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/String.cpp b/dep/efsw/src/efsw/String.cpp
new file mode 100644
index 00000000000..f703d25cb35
--- /dev/null
+++ b/dep/efsw/src/efsw/String.cpp
@@ -0,0 +1,813 @@
+#include <iterator>
+#include <efsw/String.hpp>
+#include <efsw/Utf.hpp>
+
+namespace efsw {
+
+const std::size_t String::InvalidPos = StringType::npos;
+
+std::vector < std::string > String::split ( const std::string& str, const char& splitchar, const bool& pushEmptyString )
+{
+ std::vector < std::string > tmp;
+ std::string tmpstr;
+
+ for ( size_t i = 0; i < str.size(); i++ )
+ {
+ if ( str[i] == splitchar )
+ {
+ if ( pushEmptyString || tmpstr.size() )
+ {
+ tmp.push_back(tmpstr);
+ tmpstr = "";
+ }
+ }
+ else
+ {
+ tmpstr += str[i];
+ }
+ }
+
+ if ( tmpstr.size() )
+ {
+ tmp.push_back( tmpstr );
+ }
+
+ return tmp;
+}
+
+std::vector < String > String::split ( const String& str, const Uint32& splitchar, const bool& pushEmptyString )
+{
+ std::vector < String > tmp;
+ String tmpstr;
+
+ for ( size_t i = 0; i < str.size(); i++ )
+ {
+ if ( str[i] == splitchar )
+ {
+ if ( pushEmptyString || tmpstr.size() )
+ {
+ tmp.push_back(tmpstr);
+ tmpstr = "";
+ }
+ }
+ else
+ {
+ tmpstr += str[i];
+ }
+ }
+
+ if ( tmpstr.size() )
+ {
+ tmp.push_back( tmpstr );
+ }
+
+ return tmp;
+}
+
+int String::strStartsWith( const std::string& start, const std::string& str )
+{
+ int pos = -1;
+ size_t size = start.size();
+
+ if ( str.size() >= size )
+ {
+ for ( std::size_t i = 0; i < size; i++ )
+ {
+ if ( start[i] == str[i] )
+ {
+ pos = (int)i;
+ }
+ else
+ {
+ pos = -1;
+ break;
+ }
+ }
+ }
+
+ return pos;
+}
+
+int String::strStartsWith( const String& start, const String& str )
+{
+ int pos = -1;
+ size_t size = start.size();
+
+ if ( str.size() >= size )
+ {
+ for ( std::size_t i = 0; i < size; i++ )
+ {
+ if ( start[i] == str[i] )
+ {
+ pos = (int)i;
+ }
+ else
+ {
+ pos = -1;
+ break;
+ }
+ }
+ }
+
+ return pos;
+}
+
+String::String()
+{
+}
+
+String::String(char ansiChar, const std::locale& locale)
+{
+ mString += Utf32::DecodeAnsi(ansiChar, locale);
+}
+
+#ifndef EFSW_NO_WIDECHAR
+String::String(wchar_t wideChar)
+{
+ mString += Utf32::DecodeWide(wideChar);
+}
+#endif
+
+String::String(StringBaseType utf32Char)
+{
+ mString += utf32Char;
+}
+
+String::String( const char* uf8String ) {
+ if (uf8String)
+ {
+ std::size_t length = strlen(uf8String);
+
+ if (length > 0)
+ {
+ mString.reserve(length + 1);
+
+ Utf8::ToUtf32(uf8String, uf8String + length, std::back_inserter(mString));
+ }
+ }
+}
+
+String::String( const std::string& utf8String ) {
+ mString.reserve( utf8String.length() + 1 );
+
+ Utf8::ToUtf32( utf8String.begin(), utf8String.end(), std::back_inserter( mString ) );
+}
+
+String::String(const char* ansiString, const std::locale& locale)
+{
+ if (ansiString)
+ {
+ std::size_t length = strlen(ansiString);
+ if (length > 0)
+ {
+ mString.reserve(length + 1);
+ Utf32::FromAnsi(ansiString, ansiString + length, std::back_inserter(mString), locale);
+ }
+ }
+}
+
+String::String(const std::string& ansiString, const std::locale& locale)
+{
+ mString.reserve(ansiString.length() + 1);
+ Utf32::FromAnsi(ansiString.begin(), ansiString.end(), std::back_inserter(mString), locale);
+}
+
+#ifndef EFSW_NO_WIDECHAR
+String::String(const wchar_t* wideString)
+{
+ if (wideString)
+ {
+ std::size_t length = std::wcslen(wideString);
+ if (length > 0)
+ {
+ mString.reserve(length + 1);
+ Utf32::FromWide(wideString, wideString + length, std::back_inserter(mString));
+ }
+ }
+}
+
+String::String(const std::wstring& wideString)
+{
+ mString.reserve(wideString.length() + 1);
+ Utf32::FromWide(wideString.begin(), wideString.end(), std::back_inserter(mString));
+}
+#endif
+
+String::String(const StringBaseType* utf32String)
+{
+ if (utf32String)
+ mString = utf32String;
+}
+
+String::String(const StringType& utf32String) :
+mString(utf32String)
+{
+}
+
+String::String(const String& str) :
+mString(str.mString)
+{
+}
+
+String String::fromUtf8( const std::string& utf8String )
+{
+ String::StringType utf32;
+
+ utf32.reserve( utf8String.length() + 1 );
+
+ Utf8::ToUtf32( utf8String.begin(), utf8String.end(), std::back_inserter( utf32 ) );
+
+ return String( utf32 );
+}
+
+String::operator std::string() const
+{
+ return toAnsiString();
+}
+
+std::string String::toAnsiString(const std::locale& locale) const
+{
+ // Prepare the output string
+ std::string output;
+ output.reserve(mString.length() + 1);
+
+ // Convert
+ Utf32::ToAnsi(mString.begin(), mString.end(), std::back_inserter(output), 0, locale);
+
+ return output;
+}
+
+#ifndef EFSW_NO_WIDECHAR
+std::wstring String::toWideString() const
+{
+ // Prepare the output string
+ std::wstring output;
+ output.reserve(mString.length() + 1);
+
+ // Convert
+ Utf32::ToWide(mString.begin(), mString.end(), std::back_inserter(output), 0);
+
+ return output;
+}
+#endif
+
+std::string String::toUtf8() const {
+ // Prepare the output string
+ std::string output;
+ output.reserve(mString.length() + 1);
+
+ // Convert
+ Utf32::toUtf8(mString.begin(), mString.end(), std::back_inserter(output) );
+
+ return output;
+}
+
+String& String::operator =(const String& right)
+{
+ mString = right.mString;
+ return *this;
+}
+
+String& String::operator =( const StringBaseType& right )
+{
+ mString = right;
+ return *this;
+}
+
+String& String::operator +=(const String& right)
+{
+ mString += right.mString;
+ return *this;
+}
+
+String& String::operator +=( const StringBaseType& right )
+{
+ mString += right;
+ return *this;
+}
+
+
+String::StringBaseType String::operator [](std::size_t index) const
+{
+ return mString[index];
+}
+
+String::StringBaseType& String::operator [](std::size_t index)
+{
+ return mString[index];
+}
+
+String::StringBaseType String::at( std::size_t index ) const
+{
+ return mString.at( index );
+}
+
+void String::push_back( StringBaseType c )
+{
+ mString.push_back( c );
+}
+
+void String::swap ( String& str )
+{
+ mString.swap( str.mString );
+}
+
+void String::clear()
+{
+ mString.clear();
+}
+
+std::size_t String::size() const
+{
+ return mString.size();
+}
+
+std::size_t String::length() const
+{
+ return mString.length();
+}
+
+bool String::empty() const
+{
+ return mString.empty();
+}
+
+void String::erase(std::size_t position, std::size_t count)
+{
+ mString.erase(position, count);
+}
+
+String& String::insert(std::size_t position, const String& str)
+{
+ mString.insert(position, str.mString);
+ return *this;
+}
+
+String& String::insert( std::size_t pos1, const String& str, std::size_t pos2, std::size_t n )
+{
+ mString.insert( pos1, str.mString, pos2, n );
+ return *this;
+}
+
+String& String::insert ( size_t pos1, const char* s, size_t n )
+{
+ String tmp( s );
+
+ mString.insert( pos1, tmp.data(), n );
+
+ return *this;
+}
+
+String& String::insert ( size_t pos1, size_t n, char c )
+{
+ mString.insert( pos1, n, c );
+ return *this;
+}
+
+String& String::insert ( size_t pos1, const char* s )
+{
+ String tmp( s );
+
+ mString.insert( pos1, tmp.data() );
+
+ return *this;
+}
+
+String::Iterator String::insert ( Iterator p, char c )
+{
+ return mString.insert( p, c );
+}
+
+void String::insert ( Iterator p, size_t n, char c )
+{
+ mString.insert( p, n, c );
+}
+
+const String::StringBaseType* String::c_str() const
+{
+ return mString.c_str();
+}
+
+const String::StringBaseType* String::data() const
+{
+ return mString.data();
+}
+
+String::Iterator String::begin()
+{
+ return mString.begin();
+}
+
+String::ConstIterator String::begin() const
+{
+ return mString.begin();
+}
+
+String::Iterator String::end()
+{
+ return mString.end();
+}
+
+String::ConstIterator String::end() const
+{
+ return mString.end();
+}
+
+String::ReverseIterator String::rbegin()
+{
+ return mString.rbegin();
+}
+
+String::ConstReverseIterator String::rbegin() const
+{
+ return mString.rbegin();
+}
+
+String::ReverseIterator String::rend()
+{
+ return mString.rend();
+}
+
+String::ConstReverseIterator String::rend() const
+{
+ return mString.rend();
+}
+
+void String::resize( std::size_t n, StringBaseType c )
+{
+ mString.resize( n, c );
+}
+
+void String::resize( std::size_t n )
+{
+ mString.resize( n );
+}
+
+std::size_t String::max_size() const
+{
+ return mString.max_size();
+}
+
+void String::reserve( size_t res_arg )
+{
+ mString.reserve( res_arg );
+}
+
+std::size_t String::capacity() const
+{
+ return mString.capacity();
+}
+
+String& String::assign ( const String& str )
+{
+ mString.assign( str.mString );
+ return *this;
+}
+
+String& String::assign ( const String& str, size_t pos, size_t n )
+{
+ mString.assign( str.mString, pos, n );
+ return *this;
+}
+
+String& String::assign ( const char* s, size_t n )
+{
+ String tmp( s );
+
+ mString.assign( tmp.mString );
+
+ return *this;
+}
+
+String& String::assign ( const char* s )
+{
+ String tmp( s );
+
+ mString.assign( tmp.mString );
+
+ return *this;
+}
+
+String& String::assign ( size_t n, char c )
+{
+ mString.assign( n, c );
+
+ return *this;
+}
+
+String& String::append ( const String& str )
+{
+ mString.append( str.mString );
+
+ return *this;
+}
+
+String& String::append ( const String& str, size_t pos, size_t n )
+{
+ mString.append( str.mString, pos, n );
+
+ return *this;
+}
+
+String& String::append ( const char* s, size_t n )
+{
+ String tmp( s );
+
+ mString.append( tmp.mString );
+
+ return *this;
+}
+
+String& String::append ( const char* s )
+{
+ String tmp( s );
+
+ mString.append( tmp.mString );
+
+ return *this;
+}
+
+String& String::append ( size_t n, char c )
+{
+ mString.append( n, c );
+
+ return *this;
+}
+
+String& String::append ( std::size_t n, StringBaseType c )
+{
+ mString.append( n, c );
+
+ return *this;
+}
+
+String& String::replace ( size_t pos1, size_t n1, const String& str )
+{
+ mString.replace( pos1, n1, str.mString );
+
+ return *this;
+}
+
+String& String::replace ( Iterator i1, Iterator i2, const String& str )
+{
+ mString.replace( i1, i2, str.mString );
+
+ return *this;
+}
+
+String& String::replace ( size_t pos1, size_t n1, const String& str, size_t pos2, size_t n2 )
+{
+ mString.replace( pos1, n1, str.mString, pos2, n2 );
+
+ return *this;
+}
+
+String& String::replace ( size_t pos1, size_t n1, const char* s, size_t n2 )
+{
+ String tmp( s );
+
+ mString.replace( pos1, n1, tmp.data(), n2 );
+
+ return *this;
+}
+
+String& String::replace ( Iterator i1, Iterator i2, const char* s, size_t n2 )
+{
+ String tmp( s );
+
+ mString.replace( i1, i2, tmp.data(), n2 );
+
+ return *this;
+}
+
+String& String::replace ( size_t pos1, size_t n1, const char* s )
+{
+ String tmp( s );
+
+ mString.replace( pos1, n1, tmp.mString );
+
+ return *this;
+}
+
+String& String::replace ( Iterator i1, Iterator i2, const char* s )
+{
+ String tmp( s );
+
+ mString.replace( i1, i2, tmp.mString );
+
+ return *this;
+}
+
+String& String::replace ( size_t pos1, size_t n1, size_t n2, char c )
+{
+ mString.replace( pos1, n1, n2, (StringBaseType)c );
+
+ return *this;
+}
+
+String& String::replace ( Iterator i1, Iterator i2, size_t n2, char c )
+{
+ mString.replace( i1, i2, n2, (StringBaseType)c );
+
+ return *this;
+}
+
+std::size_t String::find( const String& str, std::size_t start ) const
+{
+ return mString.find( str.mString, start );
+}
+
+std::size_t String::find ( const char* s, std::size_t pos, std::size_t n ) const
+{
+ return find( String( s ), pos );
+}
+
+std::size_t String::find ( const char* s, std::size_t pos ) const
+{
+ return find( String( s ), pos );
+}
+
+size_t String::find ( char c, std::size_t pos ) const
+{
+ return mString.find( (StringBaseType)c, pos );
+}
+
+std::size_t String::rfind ( const String& str, std::size_t pos ) const
+{
+ return mString.rfind( str.mString, pos );
+}
+
+std::size_t String::rfind ( const char* s, std::size_t pos, std::size_t n ) const
+{
+ return rfind( String( s ), pos );
+}
+
+std::size_t String::rfind ( const char* s, std::size_t pos ) const
+{
+ return rfind( String( s ), pos );
+}
+
+std::size_t String::rfind ( char c, std::size_t pos ) const
+{
+ return mString.rfind( c, pos );
+}
+
+std::size_t String::copy ( StringBaseType* s, std::size_t n, std::size_t pos ) const
+{
+ return mString.copy( s, n, pos );
+}
+
+String String::substr ( std::size_t pos, std::size_t n ) const
+{
+ return String( mString.substr( pos, n ) );
+}
+
+int String::compare ( const String& str ) const
+{
+ return mString.compare( str.mString );
+}
+
+int String::compare ( const char* s ) const
+{
+ return compare( String( s ) );
+}
+
+int String::compare ( std::size_t pos1, std::size_t n1, const String& str ) const
+{
+ return mString.compare( pos1, n1, str.mString );
+}
+
+int String::compare ( std::size_t pos1, std::size_t n1, const char* s) const
+{
+ return compare( pos1, n1, String( s ) );
+}
+
+int String::compare ( std::size_t pos1, std::size_t n1, const String& str, std::size_t pos2, std::size_t n2 ) const
+{
+ return mString.compare( pos1, n1, str.mString, pos2, n2 );
+}
+
+int String::compare ( std::size_t pos1, std::size_t n1, const char* s, std::size_t n2) const
+{
+ return compare( pos1, n1, String( s ), 0, n2 );
+}
+
+std::size_t String::find_first_of ( const String& str, std::size_t pos ) const
+{
+ return mString.find_first_of( str.mString, pos );
+}
+
+std::size_t String::find_first_of ( const char* s, std::size_t pos, std::size_t n ) const
+{
+ return find_first_of( String( s ), pos );
+}
+
+std::size_t String::find_first_of ( const char* s, std::size_t pos ) const
+{
+ return find_first_of( String( s ), pos );
+}
+
+std::size_t String::find_first_of ( StringBaseType c, std::size_t pos ) const
+{
+ return mString.find_first_of( c, pos );
+}
+
+std::size_t String::find_last_of ( const String& str, std::size_t pos ) const
+{
+ return mString.find_last_of( str.mString, pos );
+}
+
+std::size_t String::find_last_of ( const char* s, std::size_t pos, std::size_t n ) const
+{
+ return find_last_of( String( s ), pos );
+}
+
+std::size_t String::find_last_of ( const char* s, std::size_t pos ) const
+{
+ return find_last_of( String( s ), pos );
+}
+
+std::size_t String::find_last_of ( StringBaseType c, std::size_t pos) const
+{
+ return mString.find_last_of( c, pos );
+}
+
+std::size_t String::find_first_not_of ( const String& str, std::size_t pos ) const
+{
+ return mString.find_first_not_of( str.mString, pos );
+}
+
+std::size_t String::find_first_not_of ( const char* s, std::size_t pos, std::size_t n ) const
+{
+ return find_first_not_of( String( s ), pos );
+}
+
+std::size_t String::find_first_not_of ( const char* s, std::size_t pos ) const
+{
+ return find_first_not_of( String( s ), pos );
+}
+
+std::size_t String::find_first_not_of ( StringBaseType c, std::size_t pos ) const
+{
+ return mString.find_first_not_of( c, pos );
+}
+
+std::size_t String::find_last_not_of ( const String& str, std::size_t pos ) const
+{
+ return mString.find_last_not_of( str.mString, pos );
+}
+
+std::size_t String::find_last_not_of ( const char* s, std::size_t pos, std::size_t n ) const
+{
+ return find_last_not_of( String( s ), pos );
+}
+
+std::size_t String::find_last_not_of ( const char* s, std::size_t pos ) const
+{
+ return find_last_not_of( String( s ), pos );
+}
+
+std::size_t String::find_last_not_of ( StringBaseType c, std::size_t pos ) const
+{
+ return mString.find_last_not_of( c, pos );
+}
+
+bool operator ==(const String& left, const String& right)
+{
+ return left.mString == right.mString;
+}
+
+bool operator !=(const String& left, const String& right)
+{
+ return !(left == right);
+}
+
+bool operator <(const String& left, const String& right)
+{
+ return left.mString < right.mString;
+}
+
+bool operator >(const String& left, const String& right)
+{
+ return right < left;
+}
+
+bool operator <=(const String& left, const String& right)
+{
+ return !(right < left);
+}
+
+bool operator >=(const String& left, const String& right)
+{
+ return !(left < right);
+}
+
+String operator +(const String& left, const String& right)
+{
+ String string = left;
+ string += right;
+
+ return string;
+}
+
+}
diff --git a/dep/efsw/src/efsw/String.hpp b/dep/efsw/src/efsw/String.hpp
new file mode 100644
index 00000000000..ce7e3b75f89
--- /dev/null
+++ b/dep/efsw/src/efsw/String.hpp
@@ -0,0 +1,629 @@
+/** NOTE:
+* This code is based on the Utf implementation from SFML2. License zlib/png ( http://www.sfml-dev.org/license.php )
+* The class was modified to fit efsw own needs. This is not the original implementation from SFML2.
+* Functions and methods are the same that in std::string to facilitate portability.
+**/
+
+#ifndef EFSW_STRING_HPP
+#define EFSW_STRING_HPP
+
+#include <efsw/base.hpp>
+#include <locale>
+#include <string>
+#include <cstring>
+#include <cstdlib>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <vector>
+
+namespace efsw {
+
+/** @brief Utility string class that automatically handles conversions between types and encodings **/
+class String
+{
+ public :
+ typedef Uint32 StringBaseType;
+ typedef std::basic_string<StringBaseType> StringType;
+ typedef StringType::iterator Iterator; //! Iterator type
+ typedef StringType::const_iterator ConstIterator; //! Constant iterator type
+ typedef StringType::reverse_iterator ReverseIterator; //! Reverse Iterator type
+ typedef StringType::const_reverse_iterator ConstReverseIterator; //! Constant iterator type
+
+ static const std::size_t InvalidPos; ///< Represents an invalid position in the string
+
+ template <class T>
+ static std::string toStr(const T& i) {
+ std::ostringstream ss;
+ ss << i;
+ return ss.str();
+ }
+
+ /** Converts from a string to type */
+ template <class T>
+ static bool fromString(T& t, const std::string& s, std::ios_base& (*f)(std::ios_base&) = std::dec ) {
+ std::istringstream iss(s);
+ return !(iss >> f >> t).fail();
+ }
+
+ /** Converts from a String to type */
+ template <class T>
+ static bool fromString(T& t, const String& s, std::ios_base& (*f)(std::ios_base&) = std::dec ) {
+ std::istringstream iss( s.toUtf8() );
+ return !(iss >> f >> t).fail();
+ }
+
+ /** Split a string and hold it on a vector */
+ static std::vector < std::string > split( const std::string& str, const char& splitchar, const bool& pushEmptyString = false );
+
+ /** Split a string and hold it on a vector */
+ static std::vector < String > split( const String& str, const Uint32& splitchar, const bool& pushEmptyString = false );
+
+ /** Determine if a string starts with the string passed
+ ** @param start The substring expected to start
+ ** @param str The string to compare
+ ** @return -1 if the substring is no in str, otherwise the size of the substring
+ */
+ static int strStartsWith( const std::string& start, const std::string& str );
+
+ static int strStartsWith( const String& start, const String& str );
+
+ /** @brief Construct from an UTF-8 string to UTF-32 according
+ ** @param uf8String UTF-8 string to convert
+ **/
+ static String fromUtf8( const std::string& utf8String );
+
+ /** @brief Default constructor
+ ** This constructor creates an empty string.
+ **/
+ String();
+
+ /** @brief Construct from a single ANSI character and a locale
+ ** The source character is converted to UTF-32 according
+ ** to the given locale. If you want to use the current global
+ ** locale, rather use the other constructor.
+ ** @param ansiChar ANSI character to convert
+ ** @param locale Locale to use for conversion
+ **/
+ String( char ansiChar, const std::locale& locale = std::locale() );
+
+#ifndef EFSW_NO_WIDECHAR
+ /** @brief Construct from single wide character
+ ** @param wideChar Wide character to convert
+ **/
+ String( wchar_t wideChar );
+#endif
+
+ /** @brief Construct from single UTF-32 character
+ ** @param utf32Char UTF-32 character to convert
+ **/
+ String( StringBaseType utf32Char );
+
+ /** @brief Construct from an from a null-terminated C-style UTF-8 string to UTF-32
+ ** @param uf8String UTF-8 string to convert
+ **/
+ String( const char* uf8String );
+
+ /** @brief Construct from an UTF-8 string to UTF-32 according
+ ** @param uf8String UTF-8 string to convert
+ **/
+ String( const std::string& utf8String );
+
+ /** @brief Construct from a null-terminated C-style ANSI string and a locale
+ ** The source string is converted to UTF-32 according
+ ** to the given locale. If you want to use the current global
+ ** locale, rather use the other constructor.
+ ** @param ansiString ANSI string to convert
+ ** @param locale Locale to use for conversion
+ **/
+ String( const char* ansiString, const std::locale& locale );
+
+ /** @brief Construct from an ANSI string and a locale
+ ** The source string is converted to UTF-32 according
+ ** to the given locale. If you want to use the current global
+ ** locale, rather use the other constructor.
+ ** @param ansiString ANSI string to convert
+ ** @param locale Locale to use for conversion
+ **/
+ String( const std::string& ansiString, const std::locale& locale );
+
+#ifndef EFSW_NO_WIDECHAR
+ /** @brief Construct from null-terminated C-style wide string
+ ** @param wideString Wide string to convert
+ **/
+ String( const wchar_t* wideString );
+
+ /** @brief Construct from a wide string
+ ** @param wideString Wide string to convert
+ **/
+ String( const std::wstring& wideString );
+#endif
+
+ /** @brief Construct from a null-terminated C-style UTF-32 string
+ ** @param utf32String UTF-32 string to assign
+ **/
+ String( const StringBaseType* utf32String );
+
+ /** @brief Construct from an UTF-32 string
+ ** @param utf32String UTF-32 string to assign
+ **/
+ String( const StringType& utf32String );
+
+
+ /** @brief Copy constructor
+ ** @param str Instance to copy
+ **/
+ String( const String& str );
+
+ /** @brief Implicit cast operator to std::string (ANSI string)
+ ** The current global locale is used for conversion. If you
+ ** want to explicitely specify a locale, see toAnsiString.
+ ** Characters that do not fit in the target encoding are
+ ** discarded from the returned string.
+ ** This operator is defined for convenience, and is equivalent
+ ** to calling toAnsiString().
+ ** @return Converted ANSI string
+ ** @see toAnsiString, operator String
+ **/
+ operator std::string() const;
+
+ /** @brief Convert the unicode string to an ANSI string
+ ** The UTF-32 string is converted to an ANSI string in
+ ** the encoding defined by \a locale. If you want to use
+ ** the current global locale, see the other overload
+ ** of toAnsiString.
+ ** Characters that do not fit in the target encoding are
+ ** discarded from the returned string.
+ ** @param locale Locale to use for conversion
+ ** @return Converted ANSI string
+ ** @see toWideString, operator std::string
+ **/
+ std::string toAnsiString( const std::locale& locale = std::locale() ) const;
+
+#ifndef EFSW_NO_WIDECHAR
+ /** @brief Convert the unicode string to a wide string
+ ** Characters that do not fit in the target encoding are
+ ** discarded from the returned string.
+ ** @return Converted wide string
+ ** @see toAnsiString, operator String
+ **/
+ std::wstring toWideString() const;
+#endif
+
+ std::string toUtf8() const;
+
+ /** @brief Overload of assignment operator
+ ** @param right Instance to assign
+ ** @return Reference to self
+ **/
+ String& operator =(const String& right);
+
+ String& operator =( const StringBaseType& right );
+
+ /** @brief Overload of += operator to append an UTF-32 string
+ ** @param right String to append
+ ** @return Reference to self
+ **/
+ String& operator +=(const String& right);
+
+ String& operator +=( const StringBaseType& right );
+
+ /** @brief Overload of [] operator to access a character by its position
+ ** This function provides read-only access to characters.
+ ** Note: this function doesn't throw if \a index is out of range.
+ ** @param index Index of the character to get
+ ** @return Character at position \a index
+ **/
+ StringBaseType operator [](std::size_t index) const;
+
+ /** @brief Overload of [] operator to access a character by its position
+ ** This function provides read and write access to characters.
+ ** Note: this function doesn't throw if \a index is out of range.
+ ** @param index Index of the character to get
+ ** @return Reference to the character at position \a index
+ **/
+
+ StringBaseType& operator [](std::size_t index);
+
+ /** @brief Get character in string
+ ** Performs a range check, throwing an exception of type out_of_range in case that pos is not an actual position in the string.
+ ** @return The character at position pos in the string.
+ */
+ StringBaseType at( std::size_t index ) const;
+
+ /** @brief clear the string
+ ** This function removes all the characters from the string.
+ ** @see empty, erase
+ **/
+ void clear();
+
+ /** @brief Get the size of the string
+ ** @return Number of characters in the string
+ ** @see empty
+ **/
+ std::size_t size() const;
+
+ /** @see size() */
+ std::size_t length() const;
+
+ /** @brief Check whether the string is empty or not
+ ** @return True if the string is empty (i.e. contains no character)
+ ** @see clear, size
+ **/
+ bool empty() const;
+
+ /** @brief Erase one or more characters from the string
+ ** This function removes a sequence of \a count characters
+ ** starting from \a position.
+ ** @param position Position of the first character to erase
+ ** @param count Number of characters to erase
+ **/
+ void erase(std::size_t position, std::size_t count = 1);
+
+
+ /** @brief Insert one or more characters into the string
+ ** This function inserts the characters of \a str
+ ** into the string, starting from \a position.
+ ** @param position Position of insertion
+ ** @param str Characters to insert
+ **/
+ String& insert(std::size_t position, const String& str);
+
+ String& insert( std::size_t pos1, const String& str, std::size_t pos2, std::size_t n );
+
+ String& insert ( std::size_t pos1, const char* s, std::size_t n );
+
+ String& insert ( std::size_t pos1, const char* s );
+
+ String& insert ( std::size_t pos1, size_t n, char c );
+
+ Iterator insert ( Iterator p, char c );
+
+ void insert ( Iterator p, std::size_t n, char c );
+
+ template<class InputIterator>
+ void insert ( Iterator p, InputIterator first, InputIterator last )
+ {
+ mString.insert( p, first, last );
+ }
+
+ /** @brief Find a sequence of one or more characters in the string
+ ** This function searches for the characters of \a str
+ ** into the string, starting from \a start.
+ ** @param str Characters to find
+ ** @param start Where to begin searching
+ ** @return Position of \a str in the string, or String::InvalidPos if not found
+ **/
+ std::size_t find( const String& str, std::size_t start = 0 ) const;
+
+ std::size_t find ( const char* s, std::size_t pos, std::size_t n ) const;
+
+ std::size_t find ( const char* s, std::size_t pos = 0 ) const;
+
+ std::size_t find ( char c, std::size_t pos = 0 ) const;
+
+ /** @brief Get a pointer to the C-style array of characters
+ ** This functions provides a read-only access to a
+ ** null-terminated C-style representation of the string.
+ ** The returned pointer is temporary and is meant only for
+ ** immediate use, thus it is not recommended to store it.
+ ** @return Read-only pointer to the array of characters
+ **/
+ const StringBaseType* c_str() const;
+
+ /** @brief Get string data
+ ** Notice that no terminating null character is appended (see member c_str for such a functionality).
+ ** The returned array points to an internal location which should not be modified directly in the program.
+ ** Its contents are guaranteed to remain unchanged only until the next call to a non-constant member function of the string object.
+ ** @return Pointer to an internal array containing the same content as the string.
+ **/
+ const StringBaseType* data() const;
+
+ /** @brief Return an iterator to the beginning of the string
+ ** @return Read-write iterator to the beginning of the string characters
+ ** @see end
+ **/
+ Iterator begin();
+
+ /** @brief Return an iterator to the beginning of the string
+ ** @return Read-only iterator to the beginning of the string characters
+ ** @see end
+ **/
+ ConstIterator begin() const;
+
+ /** @brief Return an iterator to the beginning of the string
+ ** The end iterator refers to 1 position past the last character;
+ ** thus it represents an invalid character and should never be
+ ** accessed.
+ ** @return Read-write iterator to the end of the string characters
+ ** @see begin
+ **/
+ Iterator end();
+
+ /** @brief Return an iterator to the beginning of the string
+ ** The end iterator refers to 1 position past the last character;
+ ** thus it represents an invalid character and should never be
+ ** accessed.
+ ** @return Read-only iterator to the end of the string characters
+ ** @see begin
+ **/
+ ConstIterator end() const;
+
+ /** @brief Return an reverse iterator to the beginning of the string
+ ** @return Read-write reverse iterator to the beginning of the string characters
+ ** @see end
+ **/
+ ReverseIterator rbegin();
+
+ /** @brief Return an reverse iterator to the beginning of the string
+ ** @return Read-only reverse iterator to the beginning of the string characters
+ ** @see end
+ **/
+ ConstReverseIterator rbegin() const;
+
+ /** @brief Return an reverse iterator to the beginning of the string
+ ** The end reverse iterator refers to 1 position past the last character;
+ ** thus it represents an invalid character and should never be
+ ** accessed.
+ ** @return Read-write reverse iterator to the end of the string characters
+ ** @see begin
+ **/
+ ReverseIterator rend();
+
+
+ /** @brief Return an reverse iterator to the beginning of the string
+ ** The end reverse iterator refers to 1 position past the last character;
+ ** thus it represents an invalid character and should never be
+ ** accessed.
+ ** @return Read-only reverse iterator to the end of the string characters
+ ** @see begin
+ **/
+ ConstReverseIterator rend() const;
+
+ /** @brief Resize String */
+ void resize ( std::size_t n, StringBaseType c );
+
+ /** @brief Resize String */
+ void resize ( std::size_t n );
+
+ /** @return Maximum size of string */
+ std::size_t max_size() const;
+
+ /** @brief Request a change in capacity */
+ void reserve ( size_t res_arg=0 );
+
+ /** @return Size of allocated storage */
+ std::size_t capacity() const;
+
+ /** @brief Append character to string */
+ void push_back( StringBaseType c );
+
+ /** @brief Swap contents with another string */
+ void swap ( String& str );
+
+ String& assign ( const String& str );
+
+ String& assign ( const String& str, std::size_t pos, std::size_t n );
+
+ String& assign ( const char* s, std::size_t n );
+
+ String& assign ( const char* s );
+
+ String& assign ( std::size_t n, char c );
+
+ template <class InputIterator>
+ String& assign ( InputIterator first, InputIterator last )
+ {
+ mString.assign( first, last );
+ return *this;
+ }
+
+ String& append ( const String& str );
+
+ String& append ( const String& str, std::size_t pos, std::size_t n );
+
+ String& append ( const char* s, std::size_t n );
+
+ String& append ( const char* s );
+
+ String& append ( std::size_t n, char c );
+
+ String& append ( std::size_t n, StringBaseType c );
+
+ template <class InputIterator>
+ String& append ( InputIterator first, InputIterator last )
+ {
+ mString.append( first, last );
+ return *this;
+ }
+
+ String& replace ( std::size_t pos1, std::size_t n1, const String& str );
+
+ String& replace ( Iterator i1, Iterator i2, const String& str );
+
+ String& replace ( std::size_t pos1, std::size_t n1, const String& str, std::size_t pos2, std::size_t n2 );
+
+ String& replace ( std::size_t pos1, std::size_t n1, const char* s, std::size_t n2 );
+
+ String& replace ( Iterator i1, Iterator i2, const char* s, std::size_t n2 );
+
+ String& replace ( std::size_t pos1, std::size_t n1, const char* s );
+
+ String& replace ( Iterator i1, Iterator i2, const char* s );
+
+ String& replace ( std::size_t pos1, std::size_t n1, std::size_t n2, char c );
+
+ String& replace ( Iterator i1, Iterator i2, std::size_t n2, char c );
+
+ template<class InputIterator>
+ String& replace ( Iterator i1, Iterator i2, InputIterator j1, InputIterator j2 )
+ {
+ mString.replace( i1, i2, j1, j2 );
+ return *this;
+ }
+
+ std::size_t rfind ( const String& str, std::size_t pos = StringType::npos ) const;
+
+ std::size_t rfind ( const char* s, std::size_t pos, std::size_t n ) const;
+
+ std::size_t rfind ( const char* s, std::size_t pos = StringType::npos ) const;
+
+ std::size_t rfind ( char c, std::size_t pos = StringType::npos ) const;
+
+ String substr ( std::size_t pos = 0, std::size_t n = StringType::npos ) const;
+
+ std::size_t copy ( StringBaseType* s, std::size_t n, std::size_t pos = 0 ) const;
+
+ int compare ( const String& str ) const;
+
+ int compare ( const char* s ) const;
+
+ int compare ( std::size_t pos1, std::size_t n1, const String& str ) const;
+
+ int compare ( std::size_t pos1, std::size_t n1, const char* s) const;
+
+ int compare ( std::size_t pos1, std::size_t n1, const String& str, std::size_t pos2, std::size_t n2 ) const;
+
+ int compare ( std::size_t pos1, std::size_t n1, const char* s, std::size_t n2) const;
+
+ std::size_t find_first_of ( const String& str, std::size_t pos = 0 ) const;
+
+ std::size_t find_first_of ( const char* s, std::size_t pos, std::size_t n ) const;
+
+ std::size_t find_first_of ( const char* s, std::size_t pos = 0 ) const;
+
+ std::size_t find_first_of ( StringBaseType c, std::size_t pos = 0 ) const;
+
+ std::size_t find_last_of ( const String& str, std::size_t pos = StringType::npos ) const;
+
+ std::size_t find_last_of ( const char* s, std::size_t pos, std::size_t n ) const;
+
+ std::size_t find_last_of ( const char* s, std::size_t pos = StringType::npos ) const;
+
+ std::size_t find_last_of ( StringBaseType c, std::size_t pos = StringType::npos ) const;
+
+ std::size_t find_first_not_of ( const String& str, std::size_t pos = 0 ) const;
+
+ std::size_t find_first_not_of ( const char* s, std::size_t pos, std::size_t n ) const;
+
+ std::size_t find_first_not_of ( const char* s, std::size_t pos = 0 ) const;
+
+ std::size_t find_first_not_of ( StringBaseType c, std::size_t pos = 0 ) const;
+
+ std::size_t find_last_not_of ( const String& str, std::size_t pos = StringType::npos ) const;
+
+ std::size_t find_last_not_of ( const char* s, std::size_t pos, std::size_t n ) const;
+
+ std::size_t find_last_not_of ( const char* s, std::size_t pos = StringType::npos ) const;
+
+ std::size_t find_last_not_of ( StringBaseType c, std::size_t pos = StringType::npos ) const;
+private :
+ friend bool operator ==(const String& left, const String& right);
+ friend bool operator <(const String& left, const String& right);
+
+ StringType mString; ///< Internal string of UTF-32 characters
+};
+
+/** @relates String
+** @brief Overload of == operator to compare two UTF-32 strings
+** @param left Left operand (a string)
+** @param right Right operand (a string)
+** @return True if both strings are equal
+**/
+ bool operator ==(const String& left, const String& right);
+
+/** @relates String
+** @brief Overload of != operator to compare two UTF-32 strings
+** @param left Left operand (a string)
+** @param right Right operand (a string)
+** @return True if both strings are different
+**/
+ bool operator !=(const String& left, const String& right);
+
+/** @relates String
+** @brief Overload of < operator to compare two UTF-32 strings
+** @param left Left operand (a string)
+** @param right Right operand (a string)
+** @return True if \a left is alphabetically lesser than \a right
+**/
+ bool operator <(const String& left, const String& right);
+
+/** @relates String
+** @brief Overload of > operator to compare two UTF-32 strings
+** @param left Left operand (a string)
+** @param right Right operand (a string)
+** @return True if \a left is alphabetically greater than \a right
+**/
+ bool operator >(const String& left, const String& right);
+
+/** @relates String
+** @brief Overload of <= operator to compare two UTF-32 strings
+** @param left Left operand (a string)
+** @param right Right operand (a string)
+** @return True if \a left is alphabetically lesser or equal than \a right
+**/
+ bool operator <=(const String& left, const String& right);
+
+/** @relates String
+** @brief Overload of >= operator to compare two UTF-32 strings
+** @param left Left operand (a string)
+** @param right Right operand (a string)
+** @return True if \a left is alphabetically greater or equal than \a right
+**/
+ bool operator >=(const String& left, const String& right);
+
+/** @relates String
+** @brief Overload of binary + operator to concatenate two strings
+** @param left Left operand (a string)
+** @param right Right operand (a string)
+** @return Concatenated string
+**/
+ String operator +( const String& left, const String& right );
+
+}
+
+#endif
+
+/** @class efsw::String
+** @ingroup system
+** efsw::String is a utility string class defined mainly for
+** convenience. It is a Unicode string (implemented using
+** UTF-32), thus it can store any character in the world
+** (european, chinese, arabic, hebrew, etc.).
+** It automatically handles conversions from/to ANSI and
+** wide strings, so that you can work with standard string
+** classes and still be compatible with functions taking a
+** efsw::String.
+** @code
+** efsw::String s;
+** std::string s1 = s; // automatically converted to ANSI string
+** String s2 = s; // automatically converted to wide string
+** s = "hello"; // automatically converted from ANSI string
+** s = L"hello"; // automatically converted from wide string
+** s += 'a'; // automatically converted from ANSI string
+** s += L'a'; // automatically converted from wide string
+** @endcode
+** Conversions involving ANSI strings use the default user locale. However
+** it is possible to use a custom locale if necessary:
+** @code
+** std::locale locale;
+** efsw::String s;
+** ...
+** std::string s1 = s.toAnsiString(locale);
+** s = efsw::String("hello", locale);
+** @endcode
+**
+** efsw::String defines the most important functions of the
+** standard std::string class: removing, random access, iterating,
+** appending, comparing, etc. However it is a simple class
+** provided for convenience, and you may have to consider using
+** a more optimized class if your program requires complex string
+** handling. The automatic conversion functions will then take
+** care of converting your string to efsw::String whenever EE
+** requires it.
+**
+** Please note that EE also defines a low-level, generic
+** interface for Unicode handling, see the efsw::Utf classes.
+**
+** All credits to Laurent Gomila, i just modified and expanded a little bit the implementation.
+**/
diff --git a/dep/efsw/src/efsw/System.cpp b/dep/efsw/src/efsw/System.cpp
new file mode 100644
index 00000000000..f8767cbc58f
--- /dev/null
+++ b/dep/efsw/src/efsw/System.cpp
@@ -0,0 +1,26 @@
+#include <efsw/System.hpp>
+#include <efsw/platform/platformimpl.hpp>
+
+namespace efsw {
+
+void System::sleep( const unsigned long& ms )
+{
+ Platform::System::sleep( ms );
+}
+
+std::string System::getProcessPath()
+{
+ return Platform::System::getProcessPath();
+}
+
+void System::maxFD()
+{
+ Platform::System::maxFD();
+}
+
+Uint64 System::getMaxFD()
+{
+ return Platform::System::getMaxFD();
+}
+
+}
diff --git a/dep/efsw/src/efsw/System.hpp b/dep/efsw/src/efsw/System.hpp
new file mode 100644
index 00000000000..1d6f4a70f91
--- /dev/null
+++ b/dep/efsw/src/efsw/System.hpp
@@ -0,0 +1,26 @@
+#ifndef EFSW_SYSTEM_HPP
+#define EFSW_SYSTEM_HPP
+
+#include <efsw/base.hpp>
+
+namespace efsw {
+
+class System
+{
+ public:
+ /// Sleep for x milliseconds
+ static void sleep( const unsigned long& ms );
+
+ /// @return The process binary path
+ static std::string getProcessPath();
+
+ /// Maximize the number of file descriptors allowed per process in the current OS
+ static void maxFD();
+
+ /// @return The number of supported file descriptors for the process
+ static Uint64 getMaxFD();
+};
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/Thread.cpp b/dep/efsw/src/efsw/Thread.cpp
new file mode 100644
index 00000000000..fff41517dc1
--- /dev/null
+++ b/dep/efsw/src/efsw/Thread.cpp
@@ -0,0 +1,51 @@
+#include <efsw/Thread.hpp>
+#include <efsw/platform/platformimpl.hpp>
+
+namespace efsw {
+
+Thread::Thread() :
+ mThreadImpl(NULL),
+ mEntryPoint(NULL)
+{
+}
+
+Thread::~Thread()
+{
+ wait();
+
+ efSAFE_DELETE( mEntryPoint );
+}
+
+void Thread::launch()
+{
+ wait();
+
+ mThreadImpl = new Platform::ThreadImpl( this );
+}
+
+void Thread::wait()
+{
+ if ( mThreadImpl )
+ {
+ mThreadImpl->wait();
+
+ efSAFE_DELETE( mThreadImpl );
+ }
+}
+
+void Thread::terminate()
+{
+ if ( mThreadImpl )
+ {
+ mThreadImpl->terminate();
+
+ efSAFE_DELETE( mThreadImpl );
+ }
+}
+
+void Thread::run()
+{
+ mEntryPoint->run();
+}
+
+}
diff --git a/dep/efsw/src/efsw/Thread.hpp b/dep/efsw/src/efsw/Thread.hpp
new file mode 100644
index 00000000000..c7da9e8b33c
--- /dev/null
+++ b/dep/efsw/src/efsw/Thread.hpp
@@ -0,0 +1,111 @@
+#ifndef EFSW_THREAD_HPP
+#define EFSW_THREAD_HPP
+
+#include <efsw/base.hpp>
+
+namespace efsw {
+
+namespace Platform { class ThreadImpl; }
+namespace Private { struct ThreadFunc; }
+
+/** @brief Thread manager class */
+class Thread {
+ public:
+ typedef void (*FuncType)(void*);
+
+ template <typename F>
+ Thread( F function );
+
+ template <typename F, typename A>
+ Thread( F function, A argument );
+
+ template <typename C>
+ Thread( void(C::*function)(), C* object );
+
+ virtual ~Thread();
+
+ /** Launch the thread */
+ virtual void launch();
+
+ /** Wait the thread until end */
+ void wait();
+
+ /** Terminate the thread */
+ void terminate();
+ protected:
+ Thread();
+ private:
+ friend class Platform::ThreadImpl;
+
+ /** The virtual function to run in the thread */
+ virtual void run();
+
+ Platform::ThreadImpl * mThreadImpl; ///< OS-specific implementation of the thread
+ Private::ThreadFunc * mEntryPoint; ///< Abstraction of the function to run
+};
+
+//! NOTE: Taken from SFML2 threads
+namespace Private {
+
+// Base class for abstract thread functions
+struct ThreadFunc
+{
+ virtual ~ThreadFunc() {}
+ virtual void run() = 0;
+};
+
+// Specialization using a functor (including free functions) with no argument
+template <typename T>
+struct ThreadFunctor : ThreadFunc
+{
+ ThreadFunctor(T functor) : m_functor(functor) {}
+ virtual void run() {m_functor();}
+ T m_functor;
+};
+
+// Specialization using a functor (including free functions) with one argument
+template <typename F, typename A>
+struct ThreadFunctorWithArg : ThreadFunc
+{
+ ThreadFunctorWithArg(F function, A arg) : m_function(function), m_arg(arg) {}
+ virtual void run() {m_function(m_arg);}
+ F m_function;
+ A m_arg;
+};
+
+// Specialization using a member function
+template <typename C>
+struct ThreadMemberFunc : ThreadFunc
+{
+ ThreadMemberFunc(void(C::*function)(), C* object) : m_function(function), m_object(object) {}
+ virtual void run() {(m_object->*m_function)();}
+ void(C::*m_function)();
+ C* m_object;
+};
+
+}
+
+template <typename F>
+Thread::Thread(F functor) :
+ mThreadImpl (NULL),
+ mEntryPoint( new Private::ThreadFunctor<F>(functor) )
+{
+}
+
+template <typename F, typename A>
+Thread::Thread(F function, A argument) :
+ mThreadImpl(NULL),
+ mEntryPoint( new Private::ThreadFunctorWithArg<F efCOMMA A>(function, argument) )
+{
+}
+
+template <typename C>
+Thread::Thread(void(C::*function)(), C* object) :
+ mThreadImpl(NULL),
+ mEntryPoint( new Private::ThreadMemberFunc<C>(function, object) )
+{
+}
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/Utf.hpp b/dep/efsw/src/efsw/Utf.hpp
new file mode 100644
index 00000000000..925a7cc149b
--- /dev/null
+++ b/dep/efsw/src/efsw/Utf.hpp
@@ -0,0 +1,748 @@
+/** NOTE:
+* This code is based on the Utf implementation from SFML2. License zlib/png ( http://www.sfml-dev.org/license.php )
+* The class was modified to fit efsw own needs. This is not the original implementation from SFML2.
+* */
+
+#ifndef EFSW_UTF_HPP
+#define EFSW_UTF_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <locale>
+#include <string>
+#include <cstdlib>
+#include <efsw/base.hpp>
+
+namespace efsw {
+
+template <unsigned int N>
+class Utf;
+
+////////////////////////////////////////////////////////////
+/// \brief Specialization of the Utf template for UTF-8
+///
+////////////////////////////////////////////////////////////
+template <>
+class Utf<8> {
+public :
+ ////////////////////////////////////////////////////////////
+ /// \brief Decode a single UTF-8 character
+ ///
+ /// Decoding a character means finding its unique 32-bits
+ /// code (called the codepoint) in the Unicode standard.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Codepoint of the decoded UTF-8 character
+ /// \param replacement Replacement character to use in case the UTF-8 sequence is invalid
+ ///
+ /// \return Iterator pointing to one past the last read element of the input sequence
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static In Decode(In begin, In end, Uint32& output, Uint32 replacement = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Encode a single UTF-8 character
+ ///
+ /// Encoding a character means converting a unique 32-bits
+ /// code (called the codepoint) in the target encoding, UTF-8.
+ ///
+ /// \param input Codepoint to encode as UTF-8
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to UTF-8 (use 0 to skip them)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename Out>
+ static Out Encode(Uint32 input, Out output, Uint8 replacement = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Advance to the next UTF-8 character
+ ///
+ /// This function is necessary for multi-elements encodings, as
+ /// a single character may use more than 1 storage element.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ ///
+ /// \return Iterator pointing to one past the last read element of the input sequence
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static In Next(In begin, In end);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Count the number of characters of a UTF-8 sequence
+ ///
+ /// This function is necessary for multi-elements encodings, as
+ /// a single character may use more than 1 storage element, thus the
+ /// total size can be different from (begin - end).
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ ///
+ /// \return Iterator pointing to one past the last read element of the input sequence
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static std::size_t Count(In begin, In end);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an ANSI characters range to UTF-8
+ ///
+ /// The current global locale will be used by default, unless you
+ /// pass a custom one in the \a locale parameter.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out FromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale());
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a wide characters range to UTF-8
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out FromWide(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a latin-1 (ISO-5589-1) characters range to UTF-8
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out FromLatin1(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an UTF-8 characters range to ANSI characters
+ ///
+ /// The current global locale will be used by default, unless you
+ /// pass a custom one in the \a locale parameter.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to ANSI (use 0 to skip them)
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale());
+
+#ifndef EFSW_NO_WIDECHAR
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an UTF-8 characters range to wide characters
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToWide(In begin, In end, Out output, wchar_t replacement = 0);
+#endif
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an UTF-8 characters range to latin-1 (ISO-5589-1) characters
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToLatin1(In begin, In end, Out output, char replacement = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a UTF-8 characters range to UTF-8
+ ///
+ /// This functions does nothing more than a direct copy;
+ /// it is defined only to provide the same interface as other
+ /// specializations of the efsw::Utf<> template, and allow
+ /// generic code to be written on top of it.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out toUtf8(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a UTF-8 characters range to UTF-16
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToUtf16(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a UTF-8 characters range to UTF-32
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToUtf32(In begin, In end, Out output);
+};
+
+////////////////////////////////////////////////////////////
+/// \brief Specialization of the Utf template for UTF-16
+///
+////////////////////////////////////////////////////////////
+template <>
+class Utf<16>
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Decode a single UTF-16 character
+ ///
+ /// Decoding a character means finding its unique 32-bits
+ /// code (called the codepoint) in the Unicode standard.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Codepoint of the decoded UTF-16 character
+ /// \param replacement Replacement character to use in case the UTF-8 sequence is invalid
+ ///
+ /// \return Iterator pointing to one past the last read element of the input sequence
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static In Decode(In begin, In end, Uint32& output, Uint32 replacement = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Encode a single UTF-16 character
+ ///
+ /// Encoding a character means converting a unique 32-bits
+ /// code (called the codepoint) in the target encoding, UTF-16.
+ ///
+ /// \param input Codepoint to encode as UTF-16
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to UTF-16 (use 0 to skip them)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename Out>
+ static Out Encode(Uint32 input, Out output, Uint16 replacement = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Advance to the next UTF-16 character
+ ///
+ /// This function is necessary for multi-elements encodings, as
+ /// a single character may use more than 1 storage element.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ ///
+ /// \return Iterator pointing to one past the last read element of the input sequence
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static In Next(In begin, In end);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Count the number of characters of a UTF-16 sequence
+ ///
+ /// This function is necessary for multi-elements encodings, as
+ /// a single character may use more than 1 storage element, thus the
+ /// total size can be different from (begin - end).
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ ///
+ /// \return Iterator pointing to one past the last read element of the input sequence
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static std::size_t Count(In begin, In end);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an ANSI characters range to UTF-16
+ ///
+ /// The current global locale will be used by default, unless you
+ /// pass a custom one in the \a locale parameter.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out FromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale());
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a wide characters range to UTF-16
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out FromWide(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a latin-1 (ISO-5589-1) characters range to UTF-16
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out FromLatin1(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an UTF-16 characters range to ANSI characters
+ ///
+ /// The current global locale will be used by default, unless you
+ /// pass a custom one in the \a locale parameter.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to ANSI (use 0 to skip them)
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale());
+
+#ifndef EFSW_NO_WIDECHAR
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an UTF-16 characters range to wide characters
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToWide(In begin, In end, Out output, wchar_t replacement = 0);
+#endif
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an UTF-16 characters range to latin-1 (ISO-5589-1) characters
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToLatin1(In begin, In end, Out output, char replacement = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a UTF-16 characters range to UTF-8
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out toUtf8(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a UTF-16 characters range to UTF-16
+ ///
+ /// This functions does nothing more than a direct copy;
+ /// it is defined only to provide the same interface as other
+ /// specializations of the efsw::Utf<> template, and allow
+ /// generic code to be written on top of it.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToUtf16(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a UTF-16 characters range to UTF-32
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToUtf32(In begin, In end, Out output);
+};
+
+////////////////////////////////////////////////////////////
+/// \brief Specialization of the Utf template for UTF-32
+///
+////////////////////////////////////////////////////////////
+template <>
+class Utf<32>
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Decode a single UTF-32 character
+ ///
+ /// Decoding a character means finding its unique 32-bits
+ /// code (called the codepoint) in the Unicode standard.
+ /// For UTF-32, the character value is the same as the codepoint.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Codepoint of the decoded UTF-32 character
+ /// \param replacement Replacement character to use in case the UTF-8 sequence is invalid
+ ///
+ /// \return Iterator pointing to one past the last read element of the input sequence
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static In Decode(In begin, In end, Uint32& output, Uint32 replacement = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Encode a single UTF-32 character
+ ///
+ /// Encoding a character means converting a unique 32-bits
+ /// code (called the codepoint) in the target encoding, UTF-32.
+ /// For UTF-32, the codepoint is the same as the character value.
+ ///
+ /// \param input Codepoint to encode as UTF-32
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to UTF-32 (use 0 to skip them)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename Out>
+ static Out Encode(Uint32 input, Out output, Uint32 replacement = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Advance to the next UTF-32 character
+ ///
+ /// This function is trivial for UTF-32, which can store
+ /// every character in a single storage element.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ ///
+ /// \return Iterator pointing to one past the last read element of the input sequence
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static In Next(In begin, In end);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Count the number of characters of a UTF-32 sequence
+ ///
+ /// This function is trivial for UTF-32, which can store
+ /// every character in a single storage element.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ ///
+ /// \return Iterator pointing to one past the last read element of the input sequence
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static std::size_t Count(In begin, In end);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an ANSI characters range to UTF-32
+ ///
+ /// The current global locale will be used by default, unless you
+ /// pass a custom one in the \a locale parameter.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out FromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale());
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a wide characters range to UTF-32
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out FromWide(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a latin-1 (ISO-5589-1) characters range to UTF-32
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out FromLatin1(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an UTF-32 characters range to ANSI characters
+ ///
+ /// The current global locale will be used by default, unless you
+ /// pass a custom one in the \a locale parameter.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to ANSI (use 0 to skip them)
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale());
+
+#ifndef EFSW_NO_WIDECHAR
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an UTF-32 characters range to wide characters
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToWide(In begin, In end, Out output, wchar_t replacement = 0);
+#endif
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert an UTF-16 characters range to latin-1 (ISO-5589-1) characters
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToLatin1(In begin, In end, Out output, char replacement = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a UTF-32 characters range to UTF-8
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out toUtf8(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a UTF-32 characters range to UTF-16
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToUtf16(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Convert a UTF-32 characters range to UTF-32
+ ///
+ /// This functions does nothing more than a direct copy;
+ /// it is defined only to provide the same interface as other
+ /// specializations of the efsw::Utf<> template, and allow
+ /// generic code to be written on top of it.
+ ///
+ /// \param begin Iterator pointing to the beginning of the input sequence
+ /// \param end Iterator pointing to the end of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ToUtf32(In begin, In end, Out output);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Decode a single ANSI character to UTF-32
+ ///
+ /// This function does not exist in other specializations
+ /// of efsw::Utf<>, it is defined for convenience (it is used by
+ /// several other conversion functions).
+ ///
+ /// \param input Input ANSI character
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Converted character
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static Uint32 DecodeAnsi(In input, const std::locale& locale = std::locale());
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Decode a single wide character to UTF-32
+ ///
+ /// This function does not exist in other specializations
+ /// of efsw::Utf<>, it is defined for convenience (it is used by
+ /// several other conversion functions).
+ ///
+ /// \param input Input wide character
+ ///
+ /// \return Converted character
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static Uint32 DecodeWide(In input);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Encode a single UTF-32 character to ANSI
+ ///
+ /// This function does not exist in other specializations
+ /// of efsw::Utf<>, it is defined for convenience (it is used by
+ /// several other conversion functions).
+ ///
+ /// \param codepoint Iterator pointing to the beginning of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement if the input character is not convertible to ANSI (use 0 to skip it)
+ /// \param locale Locale to use for conversion
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename Out>
+ static Out EncodeAnsi(Uint32 codepoint, Out output, char replacement = 0, const std::locale& locale = std::locale());
+
+#ifndef EFSW_NO_WIDECHAR
+ ////////////////////////////////////////////////////////////
+ /// \brief Encode a single UTF-32 character to wide
+ ///
+ /// This function does not exist in other specializations
+ /// of efsw::Utf<>, it is defined for convenience (it is used by
+ /// several other conversion functions).
+ ///
+ /// \param codepoint Iterator pointing to the beginning of the input sequence
+ /// \param output Iterator pointing to the beginning of the output sequence
+ /// \param replacement Replacement if the input character is not convertible to wide (use 0 to skip it)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename Out>
+ static Out EncodeWide(Uint32 codepoint, Out output, wchar_t replacement = 0);
+#endif
+};
+
+#include "Utf.inl"
+
+// Make typedefs to get rid of the template syntax
+typedef Utf<8> Utf8;
+typedef Utf<16> Utf16;
+typedef Utf<32> Utf32;
+
+}
+#endif
+
+////////////////////////////////////////////////////////////
+/// \class efsw::Utf
+/// \ingroup system
+///
+/// Utility class providing generic functions for UTF conversions.
+///
+/// efsw::Utf is a low-level, generic interface for counting, iterating,
+/// encoding and decoding Unicode characters and strings. It is able
+/// to handle ANSI, wide, UTF-8, UTF-16 and UTF-32 encodings.
+///
+/// efsw::Utf<X> functions are all static, these classes are not meant to
+/// be instanciated. All the functions are template, so that you
+/// can use any character / string type for a given encoding.
+///
+/// It has 3 specializations:
+/// \li efsw::Utf<8> (typedef'd to efsw::Utf8)
+/// \li efsw::Utf<16> (typedef'd to efsw::Utf16)
+/// \li efsw::Utf<32> (typedef'd to efsw::Utf32)
+///
+////////////////////////////////////////////////////////////
diff --git a/dep/efsw/src/efsw/Utf.inl b/dep/efsw/src/efsw/Utf.inl
new file mode 100644
index 00000000000..db8fd5d61ee
--- /dev/null
+++ b/dep/efsw/src/efsw/Utf.inl
@@ -0,0 +1,671 @@
+// References :
+// http://www.unicode.org/
+// http://www.unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.c
+// http://www.unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.h
+// http://people.w3.org/rishida/scripts/uniview/conversion
+////////////////////////////////////////////////////////////
+
+template <typename In>
+In Utf<8>::Decode(In begin, In end, Uint32& output, Uint32 replacement)
+{
+ // Some useful precomputed data
+ static const int trailing[256] =
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5
+ };
+ static const Uint32 offsets[6] =
+ {
+ 0x00000000, 0x00003080, 0x000E2080, 0x03C82080, 0xFA082080, 0x82082080
+ };
+
+ // Decode the character
+ int trailingBytes = trailing[static_cast<Uint8>(*begin)];
+ if (begin + trailingBytes < end)
+ {
+ output = 0;
+ switch (trailingBytes)
+ {
+ case 5 : output += static_cast<Uint8>(*begin++); output <<= 6;
+ case 4 : output += static_cast<Uint8>(*begin++); output <<= 6;
+ case 3 : output += static_cast<Uint8>(*begin++); output <<= 6;
+ case 2 : output += static_cast<Uint8>(*begin++); output <<= 6;
+ case 1 : output += static_cast<Uint8>(*begin++); output <<= 6;
+ case 0 : output += static_cast<Uint8>(*begin++);
+ }
+ output -= offsets[trailingBytes];
+ }
+ else
+ {
+ // Incomplete character
+ begin = end;
+ output = replacement;
+ }
+
+ return begin;
+}
+
+template <typename Out>
+Out Utf<8>::Encode(Uint32 input, Out output, Uint8 replacement)
+{
+ // Some useful precomputed data
+ static const Uint8 firstBytes[7] =
+ {
+ 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC
+ };
+
+ // Encode the character
+ if ((input > 0x0010FFFF) || ((input >= 0xD800) && (input <= 0xDBFF)))
+ {
+ // Invalid character
+ if (replacement)
+ *output++ = replacement;
+ }
+ else
+ {
+ // Valid character
+
+ // Get the number of bytes to write
+ int bytesToWrite = 1;
+ if (input < 0x80) bytesToWrite = 1;
+ else if (input < 0x800) bytesToWrite = 2;
+ else if (input < 0x10000) bytesToWrite = 3;
+ else if (input <= 0x0010FFFF) bytesToWrite = 4;
+
+ // Extract the bytes to write
+ Uint8 bytes[4];
+ switch (bytesToWrite)
+ {
+ case 4 : bytes[3] = static_cast<Uint8>((input | 0x80) & 0xBF); input >>= 6;
+ case 3 : bytes[2] = static_cast<Uint8>((input | 0x80) & 0xBF); input >>= 6;
+ case 2 : bytes[1] = static_cast<Uint8>((input | 0x80) & 0xBF); input >>= 6;
+ case 1 : bytes[0] = static_cast<Uint8> (input | firstBytes[bytesToWrite]);
+ }
+
+ // Add them to the output
+ const Uint8* currentByte = bytes;
+ switch (bytesToWrite)
+ {
+ case 4 : *output++ = *currentByte++;
+ case 3 : *output++ = *currentByte++;
+ case 2 : *output++ = *currentByte++;
+ case 1 : *output++ = *currentByte++;
+ }
+ }
+
+ return output;
+}
+
+template <typename In>
+In Utf<8>::Next(In begin, In end)
+{
+ Uint32 codepoint;
+ return Decode(begin, end, codepoint);
+}
+
+template <typename In>
+std::size_t Utf<8>::Count(In begin, In end)
+{
+ std::size_t length = 0;
+ while (begin < end)
+ {
+ begin = Next(begin, end);
+ ++length;
+ }
+
+ return length;
+}
+
+template <typename In, typename Out>
+Out Utf<8>::FromAnsi(In begin, In end, Out output, const std::locale& locale)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint = Utf<32>::DecodeAnsi(*begin++, locale);
+ output = Encode(codepoint, output);
+ }
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<8>::FromWide(In begin, In end, Out output)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint = Utf<32>::DecodeWide(*begin++);
+ output = Encode(codepoint, output);
+ }
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<8>::FromLatin1(In begin, In end, Out output)
+{
+ // Latin-1 is directly compatible with Unicode encodings,
+ // and can thus be treated as (a sub-range of) UTF-32
+ while (begin < end)
+ output = Encode(*begin++, output);
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<8>::ToAnsi(In begin, In end, Out output, char replacement, const std::locale& locale)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint;
+ begin = Decode(begin, end, codepoint);
+ output = Utf<32>::EncodeAnsi(codepoint, output, replacement, locale);
+ }
+
+ return output;
+}
+
+#ifndef EFSW_NO_WIDECHAR
+template <typename In, typename Out>
+Out Utf<8>::ToWide(In begin, In end, Out output, wchar_t replacement)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint;
+ begin = Decode(begin, end, codepoint);
+ output = Utf<32>::EncodeWide(codepoint, output, replacement);
+ }
+
+ return output;
+}
+#endif
+
+template <typename In, typename Out>
+Out Utf<8>::ToLatin1(In begin, In end, Out output, char replacement)
+{
+ // Latin-1 is directly compatible with Unicode encodings,
+ // and can thus be treated as (a sub-range of) UTF-32
+ while (begin < end)
+ {
+ Uint32 codepoint;
+ begin = Decode(begin, end, codepoint);
+ *output++ = codepoint < 256 ? static_cast<char>(codepoint) : replacement;
+ }
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<8>::toUtf8(In begin, In end, Out output)
+{
+ while (begin < end)
+ *output++ = *begin++;
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<8>::ToUtf16(In begin, In end, Out output)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint;
+ begin = Decode(begin, end, codepoint);
+ output = Utf<16>::Encode(codepoint, output);
+ }
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<8>::ToUtf32(In begin, In end, Out output)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint;
+ begin = Decode(begin, end, codepoint);
+ *output++ = codepoint;
+ }
+
+ return output;
+}
+
+template <typename In>
+In Utf<16>::Decode(In begin, In end, Uint32& output, Uint32 replacement)
+{
+ Uint16 first = *begin++;
+
+ // If it's a surrogate pair, first convert to a single UTF-32 character
+ if ((first >= 0xD800) && (first <= 0xDBFF))
+ {
+ if (begin < end)
+ {
+ Uint32 second = *begin++;
+ if ((second >= 0xDC00) && (second <= 0xDFFF))
+ {
+ // The second element is valid: convert the two elements to a UTF-32 character
+ output = static_cast<Uint32>(((first - 0xD800) << 10) + (second - 0xDC00) + 0x0010000);
+ }
+ else
+ {
+ // Invalid character
+ output = replacement;
+ }
+ }
+ else
+ {
+ // Invalid character
+ begin = end;
+ output = replacement;
+ }
+ }
+ else
+ {
+ // We can make a direct copy
+ output = first;
+ }
+
+ return begin;
+}
+
+template <typename Out>
+Out Utf<16>::Encode(Uint32 input, Out output, Uint16 replacement)
+{
+ if (input < 0xFFFF)
+ {
+ // The character can be copied directly, we just need to check if it's in the valid range
+ if ((input >= 0xD800) && (input <= 0xDFFF))
+ {
+ // Invalid character (this range is reserved)
+ if (replacement)
+ *output++ = replacement;
+ }
+ else
+ {
+ // Valid character directly convertible to a single UTF-16 character
+ *output++ = static_cast<Uint16>(input);
+ }
+ }
+ else if (input > 0x0010FFFF)
+ {
+ // Invalid character (greater than the maximum unicode value)
+ if (replacement)
+ *output++ = replacement;
+ }
+ else
+ {
+ // The input character will be converted to two UTF-16 elements
+ input -= 0x0010000;
+ *output++ = static_cast<Uint16>((input >> 10) + 0xD800);
+ *output++ = static_cast<Uint16>((input & 0x3FFUL) + 0xDC00);
+ }
+
+ return output;
+}
+
+template <typename In>
+In Utf<16>::Next(In begin, In end)
+{
+ Uint32 codepoint;
+ return Decode(begin, end, codepoint);
+}
+
+template <typename In>
+std::size_t Utf<16>::Count(In begin, In end)
+{
+ std::size_t length = 0;
+ while (begin < end)
+ {
+ begin = Next(begin, end);
+ ++length;
+ }
+
+ return length;
+}
+
+template <typename In, typename Out>
+Out Utf<16>::FromAnsi(In begin, In end, Out output, const std::locale& locale)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint = Utf<32>::DecodeAnsi(*begin++, locale);
+ output = Encode(codepoint, output);
+ }
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<16>::FromWide(In begin, In end, Out output)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint = Utf<32>::DecodeWide(*begin++);
+ output = Encode(codepoint, output);
+ }
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<16>::FromLatin1(In begin, In end, Out output)
+{
+ // Latin-1 is directly compatible with Unicode encodings,
+ // and can thus be treated as (a sub-range of) UTF-32
+ while (begin < end)
+ *output++ = *begin++;
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<16>::ToAnsi(In begin, In end, Out output, char replacement, const std::locale& locale)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint;
+ begin = Decode(begin, end, codepoint);
+ output = Utf<32>::EncodeAnsi(codepoint, output, replacement, locale);
+ }
+
+ return output;
+}
+
+#ifndef EFSW_NO_WIDECHAR
+template <typename In, typename Out>
+Out Utf<16>::ToWide(In begin, In end, Out output, wchar_t replacement)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint;
+ begin = Decode(begin, end, codepoint);
+ output = Utf<32>::EncodeWide(codepoint, output, replacement);
+ }
+
+ return output;
+}
+#endif
+
+template <typename In, typename Out>
+Out Utf<16>::ToLatin1(In begin, In end, Out output, char replacement)
+{
+ // Latin-1 is directly compatible with Unicode encodings,
+ // and can thus be treated as (a sub-range of) UTF-32
+ while (begin < end)
+ {
+ *output++ = *begin < 256 ? static_cast<char>(*begin) : replacement;
+ begin++;
+ }
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<16>::toUtf8(In begin, In end, Out output)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint;
+ begin = Decode(begin, end, codepoint);
+ output = Utf<8>::Encode(codepoint, output);
+ }
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<16>::ToUtf16(In begin, In end, Out output)
+{
+ while (begin < end)
+ *output++ = *begin++;
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<16>::ToUtf32(In begin, In end, Out output)
+{
+ while (begin < end)
+ {
+ Uint32 codepoint;
+ begin = Decode(begin, end, codepoint);
+ *output++ = codepoint;
+ }
+
+ return output;
+}
+
+template <typename In>
+In Utf<32>::Decode(In begin, In end, Uint32& output, Uint32)
+{
+ output = *begin++;
+ return begin;
+}
+
+template <typename Out>
+Out Utf<32>::Encode(Uint32 input, Out output, Uint32 replacement)
+{
+ *output++ = input;
+ return output;
+}
+
+template <typename In>
+In Utf<32>::Next(In begin, In end)
+{
+ return ++begin;
+}
+
+template <typename In>
+std::size_t Utf<32>::Count(In begin, In end)
+{
+ return begin - end;
+}
+
+template <typename In, typename Out>
+Out Utf<32>::FromAnsi(In begin, In end, Out output, const std::locale& locale)
+{
+ while (begin < end)
+ *output++ = DecodeAnsi(*begin++, locale);
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<32>::FromWide(In begin, In end, Out output)
+{
+ while (begin < end)
+ *output++ = DecodeWide(*begin++);
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<32>::FromLatin1(In begin, In end, Out output)
+{
+ // Latin-1 is directly compatible with Unicode encodings,
+ // and can thus be treated as (a sub-range of) UTF-32
+ while (begin < end)
+ *output++ = *begin++;
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<32>::ToAnsi(In begin, In end, Out output, char replacement, const std::locale& locale)
+{
+ while (begin < end)
+ output = EncodeAnsi(*begin++, output, replacement, locale);
+
+ return output;
+}
+
+#ifndef EFSW_NO_WIDECHAR
+template <typename In, typename Out>
+Out Utf<32>::ToWide(In begin, In end, Out output, wchar_t replacement)
+{
+ while (begin < end)
+ output = EncodeWide(*begin++, output, replacement);
+
+ return output;
+}
+#endif
+
+template <typename In, typename Out>
+Out Utf<32>::ToLatin1(In begin, In end, Out output, char replacement)
+{
+ // Latin-1 is directly compatible with Unicode encodings,
+ // and can thus be treated as (a sub-range of) UTF-32
+ while (begin < end)
+ {
+ *output++ = *begin < 256 ? static_cast<char>(*begin) : replacement;
+ begin++;
+ }
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<32>::toUtf8(In begin, In end, Out output)
+{
+ while (begin < end)
+ output = Utf<8>::Encode(*begin++, output);
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<32>::ToUtf16(In begin, In end, Out output)
+{
+ while (begin < end)
+ output = Utf<16>::Encode(*begin++, output);
+
+ return output;
+}
+
+template <typename In, typename Out>
+Out Utf<32>::ToUtf32(In begin, In end, Out output)
+{
+ while (begin < end)
+ *output++ = *begin++;
+
+ return output;
+}
+
+template <typename In>
+Uint32 Utf<32>::DecodeAnsi(In input, const std::locale& locale)
+{
+ // On Windows, gcc's standard library (glibc++) has almost
+ // no support for Unicode stuff. As a consequence, in this
+ // context we can only use the default locale and ignore
+ // the one passed as parameter.
+
+ #if EFSW_PLATFORM == EFSW_PLATFORM_WIN && /* if Windows ... */ \
+ (defined(__GLIBCPP__) || defined (__GLIBCXX__)) && /* ... and standard library is glibc++ ... */ \
+ !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) /* ... and STLPort is not used on top of it */
+
+ wchar_t character = 0;
+ mbtowc(&character, &input, 1);
+ return static_cast<Uint32>(character);
+
+ #else
+ // Get the facet of the locale which deals with character conversion
+ #ifndef EFSW_NO_WIDECHAR
+ const std::ctype<wchar_t>& facet = std::use_facet< std::ctype<wchar_t> >(locale);
+ #else
+ const std::ctype<char>& facet = std::use_facet< std::ctype<char> >(locale);
+ #endif
+
+ // Use the facet to convert each character of the input string
+ return static_cast<Uint32>(facet.widen(input));
+
+ #endif
+}
+
+template <typename In>
+Uint32 Utf<32>::DecodeWide(In input)
+{
+ // The encoding of wide characters is not well defined and is left to the system;
+ // however we can safely assume that it is UCS-2 on Windows and
+ // UCS-4 on Unix systems.
+ // In both cases, a simple copy is enough (UCS-2 is a subset of UCS-4,
+ // and UCS-4 *is* UTF-32).
+
+ return input;
+}
+
+template <typename Out>
+Out Utf<32>::EncodeAnsi(Uint32 codepoint, Out output, char replacement, const std::locale& locale)
+{
+ // On Windows, gcc's standard library (glibc++) has almost
+ // no support for Unicode stuff. As a consequence, in this
+ // context we can only use the default locale and ignore
+ // the one passed as parameter.
+
+ #if EFSW_PLATFORM == EFSW_PLATFORM_WIN && /* if Windows ... */ \
+ (defined(__GLIBCPP__) || defined (__GLIBCXX__)) && /* ... and standard library is glibc++ ... */ \
+ !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) /* ... and STLPort is not used on top of it */
+
+ char character = 0;
+ if (wctomb(&character, static_cast<wchar_t>(codepoint)) >= 0)
+ *output++ = character;
+ else if (replacement)
+ *output++ = replacement;
+
+ return output;
+
+ #else
+ // Get the facet of the locale which deals with character conversion
+ #ifndef EFSW_NO_WIDECHAR
+ const std::ctype<wchar_t>& facet = std::use_facet< std::ctype<wchar_t> >(locale);
+ #else
+ const std::ctype<char>& facet = std::use_facet< std::ctype<char> >(locale);
+ #endif
+
+ // Use the facet to convert each character of the input string
+ *output++ = facet.narrow(static_cast<wchar_t>(codepoint), replacement);
+
+ return output;
+
+ #endif
+}
+
+#ifndef EFSW_NO_WIDECHAR
+template <typename Out>
+Out Utf<32>::EncodeWide(Uint32 codepoint, Out output, wchar_t replacement)
+{
+ // The encoding of wide characters is not well defined and is left to the system;
+ // however we can safely assume that it is UCS-2 on Windows and
+ // UCS-4 on Unix systems.
+ // For UCS-2 we need to check if the source characters fits in (UCS-2 is a subset of UCS-4).
+ // For UCS-4 we can do a direct copy (UCS-4 *is* UTF-32).
+
+ switch (sizeof(wchar_t))
+ {
+ case 4:
+ {
+ *output++ = static_cast<wchar_t>(codepoint);
+ break;
+ }
+
+ default:
+ {
+ if ((codepoint <= 0xFFFF) && ((codepoint < 0xD800) || (codepoint > 0xDFFF)))
+ {
+ *output++ = static_cast<wchar_t>(codepoint);
+ }
+ else if (replacement)
+ {
+ *output++ = replacement;
+ }
+ break;
+ }
+ }
+
+ return output;
+}
+#endif
diff --git a/dep/efsw/src/efsw/Watcher.cpp b/dep/efsw/src/efsw/Watcher.cpp
new file mode 100644
index 00000000000..d81c84228ad
--- /dev/null
+++ b/dep/efsw/src/efsw/Watcher.cpp
@@ -0,0 +1,21 @@
+#include <efsw/Watcher.hpp>
+
+namespace efsw {
+
+Watcher::Watcher() :
+ ID(0),
+ Directory(""),
+ Listener(NULL),
+ Recursive(false)
+{
+}
+
+Watcher::Watcher( WatchID id, std::string directory, FileWatchListener * listener, bool recursive ) :
+ ID( id ),
+ Directory( directory ),
+ Listener( listener ),
+ Recursive( recursive )
+{
+}
+
+}
diff --git a/dep/efsw/src/efsw/Watcher.hpp b/dep/efsw/src/efsw/Watcher.hpp
new file mode 100644
index 00000000000..5a35cb9a2ac
--- /dev/null
+++ b/dep/efsw/src/efsw/Watcher.hpp
@@ -0,0 +1,30 @@
+#ifndef EFSW_WATCHERIMPL_HPP
+#define EFSW_WATCHERIMPL_HPP
+
+#include <efsw/base.hpp>
+#include <efsw/efsw.hpp>
+
+namespace efsw {
+
+/** @brief Base Watcher class */
+class Watcher
+{
+ public:
+ Watcher();
+
+ Watcher( WatchID id, std::string directory, FileWatchListener * listener, bool recursive );
+
+ virtual ~Watcher() {}
+
+ virtual void watch() {}
+
+ WatchID ID;
+ std::string Directory;
+ FileWatchListener * Listener;
+ bool Recursive;
+ std::string OldFileName;
+};
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/WatcherFSEvents.cpp b/dep/efsw/src/efsw/WatcherFSEvents.cpp
new file mode 100644
index 00000000000..3a9700c77ec
--- /dev/null
+++ b/dep/efsw/src/efsw/WatcherFSEvents.cpp
@@ -0,0 +1,264 @@
+#include <efsw/WatcherFSEvents.hpp>
+#include <efsw/FileWatcherFSEvents.hpp>
+#include <efsw/FileSystem.hpp>
+#include <efsw/Debug.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_FSEVENTS
+
+namespace efsw {
+
+WatcherFSEvents::WatcherFSEvents() :
+ Watcher(),
+ FWatcher( NULL ),
+ FSStream( NULL ),
+ WatcherGen( NULL ),
+ initializedAsync( false )
+{
+}
+
+WatcherFSEvents::WatcherFSEvents( WatchID id, std::string directory, FileWatchListener * listener, bool recursive, WatcherFSEvents * parent ) :
+ Watcher( id, directory, listener, recursive ),
+ FWatcher( NULL ),
+ FSStream( NULL ),
+ WatcherGen( NULL ),
+ initializedAsync( false )
+{
+}
+
+WatcherFSEvents::~WatcherFSEvents()
+{
+ if ( initializedAsync )
+ {
+ FSEventStreamStop( FSStream );
+ FSEventStreamInvalidate( FSStream );
+ }
+
+ if ( NULL != FSStream )
+ {
+ FSEventStreamRelease( FSStream );
+ }
+
+ efSAFE_DELETE( WatcherGen );
+}
+
+void WatcherFSEvents::init()
+{
+ CFStringRef CFDirectory = CFStringCreateWithCString( NULL, Directory.c_str(), kCFStringEncodingUTF8 );
+ CFArrayRef CFDirectoryArray = CFArrayCreate( NULL, (const void **)&CFDirectory, 1, NULL );
+
+ Uint32 streamFlags = kFSEventStreamCreateFlagNone;
+
+ if ( FileWatcherFSEvents::isGranular() )
+ {
+ streamFlags = efswFSEventStreamCreateFlagFileEvents;
+ }
+ else
+ {
+ WatcherGen = new WatcherGeneric( ID, Directory, Listener, FWatcher, Recursive );
+ }
+
+ FSEventStreamContext ctx;
+ /* Initialize context */
+ ctx.version = 0;
+ ctx.info = this;
+ ctx.retain = NULL;
+ ctx.release = NULL;
+ ctx.copyDescription = NULL;
+
+ FSStream = FSEventStreamCreate( kCFAllocatorDefault, &FileWatcherFSEvents::FSEventCallback, &ctx, CFDirectoryArray, kFSEventStreamEventIdSinceNow, 0.25, streamFlags );
+
+ FWatcher->mNeedInit.push_back( this );
+
+ CFRelease( CFDirectoryArray );
+ CFRelease( CFDirectory );
+}
+
+void WatcherFSEvents::initAsync()
+{
+ FSEventStreamScheduleWithRunLoop( FSStream, FWatcher->mRunLoopRef, kCFRunLoopDefaultMode );
+ FSEventStreamStart( FSStream );
+ initializedAsync = true;
+}
+
+void WatcherFSEvents::sendFileAction( WatchID watchid, const std::string& dir, const std::string& filename, Action action, std::string oldFilename )
+{
+ Listener->handleFileAction( watchid, FileSystem::precomposeFileName( dir ), FileSystem::precomposeFileName( filename ), action, oldFilename );
+}
+
+void WatcherFSEvents::handleAddModDel( const Uint32& flags, const std::string& path, std::string& dirPath, std::string& filePath )
+{
+ if ( flags & efswFSEventStreamEventFlagItemCreated )
+ {
+ if ( FileInfo::exists( path ) )
+ {
+ sendFileAction( ID, dirPath, filePath, Actions::Add );
+ }
+ }
+
+ if ( flags & efswFSEventsModified )
+ {
+ sendFileAction( ID, dirPath, filePath, Actions::Modified );
+ }
+
+ if ( flags & efswFSEventStreamEventFlagItemRemoved )
+ {
+ // Since i don't know the order, at least i try to keep the data consistent with the real state
+ if ( !FileInfo::exists( path ) )
+ {
+ sendFileAction( ID, dirPath, filePath, Actions::Delete );
+ }
+ }
+}
+
+void WatcherFSEvents::handleActions( std::vector<FSEvent>& events )
+{
+ size_t esize = events.size();
+
+ for ( size_t i = 0; i < esize; i++ )
+ {
+ FSEvent& event = events[i];
+
+ if ( event.Flags & ( kFSEventStreamEventFlagUserDropped |
+ kFSEventStreamEventFlagKernelDropped |
+ kFSEventStreamEventFlagEventIdsWrapped |
+ kFSEventStreamEventFlagHistoryDone |
+ kFSEventStreamEventFlagMount |
+ kFSEventStreamEventFlagUnmount |
+ kFSEventStreamEventFlagRootChanged ) )
+ {
+ continue;
+ }
+
+ if ( !Recursive )
+ {
+ /** In case that is not recursive the watcher, ignore the events from subfolders */
+ if ( event.Path.find_last_of( FileSystem::getOSSlash() ) != Directory.size() - 1 )
+ {
+ continue;
+ }
+ }
+
+ if ( FileWatcherFSEvents::isGranular() )
+ {
+ std::string dirPath( FileSystem::pathRemoveFileName( event.Path ) );
+ std::string filePath( FileSystem::fileNameFromPath( event.Path ) );
+
+ if ( event.Flags & ( efswFSEventStreamEventFlagItemCreated |
+ efswFSEventStreamEventFlagItemRemoved |
+ efswFSEventStreamEventFlagItemRenamed )
+ )
+ {
+ if ( dirPath != Directory )
+ {
+ DirsChanged.insert( dirPath );
+ }
+ }
+
+ // This is a mess. But it's FSEvents faults, because shrinks events from the same file in one single event ( so there's no order for them )
+ // For example a file could have been added modified and erased, but i can't know if first was erased and then added and modified, or added, then modified and then erased.
+ // I don't know what they were thinking by doing this...
+ efDEBUG( "Event in: %s - flags: %ld\n", path.c_str(), event.Flags );
+
+ if ( event.Flags & efswFSEventStreamEventFlagItemRenamed )
+ {
+ if ( ( i + 1 < esize ) &&
+ ( events[ i + 1 ].Flags & efswFSEventStreamEventFlagItemRenamed ) &&
+ ( events[ i + 1 ].Id == event.Id + 1 )
+ )
+ {
+ FSEvent& nEvent = events[ i + 1 ];
+ std::string newDir( FileSystem::pathRemoveFileName( nEvent.Path ) );
+ std::string newFilepath( FileSystem::fileNameFromPath( nEvent.Path ) );
+
+ if ( event.Path != nEvent.Path )
+ {
+ if ( dirPath == newDir )
+ {
+ if ( !FileInfo::exists( event.Path ) )
+ {
+ sendFileAction( ID, dirPath, newFilepath, Actions::Moved, filePath );
+ }
+ else
+ {
+ sendFileAction( ID, dirPath, filePath, Actions::Moved, newFilepath );
+ }
+ }
+ else
+ {
+ sendFileAction( ID, dirPath, filePath, Actions::Delete );
+ sendFileAction( ID, newDir, newFilepath, Actions::Add );
+
+ if ( nEvent.Flags & efswFSEventsModified )
+ {
+ sendFileAction( ID, newDir, newFilepath, Actions::Modified );
+ }
+ }
+ }
+ else
+ {
+ handleAddModDel( nEvent.Flags, nEvent.Path, dirPath, filePath );
+ }
+
+ if ( nEvent.Flags & ( efswFSEventStreamEventFlagItemCreated |
+ efswFSEventStreamEventFlagItemRemoved |
+ efswFSEventStreamEventFlagItemRenamed )
+ )
+ {
+ if ( newDir != Directory )
+ {
+ DirsChanged.insert( newDir );
+ }
+ }
+
+ // Skip the renamed file
+ i++;
+ }
+ else if ( FileInfo::exists( event.Path ) )
+ {
+ sendFileAction( ID, dirPath, filePath, Actions::Add );
+
+ if ( event.Flags & efswFSEventsModified )
+ {
+ sendFileAction( ID, dirPath, filePath, Actions::Modified );
+ }
+ }
+ else
+ {
+ sendFileAction( ID, dirPath, filePath, Actions::Delete );
+ }
+ }
+ else
+ {
+ handleAddModDel( event.Flags, event.Path, dirPath, filePath );
+ }
+ }
+ else
+ {
+ efDEBUG( "Directory: %s changed\n", event.Path.c_str() );
+ DirsChanged.insert( event.Path );
+ }
+ }
+}
+
+void WatcherFSEvents::process()
+{
+ std::set<std::string>::iterator it = DirsChanged.begin();
+
+ for ( ; it != DirsChanged.end(); it++ )
+ {
+ if ( !FileWatcherFSEvents::isGranular() )
+ {
+ WatcherGen->watchDir( (*it) );
+ }
+ else
+ {
+ sendFileAction( ID, FileSystem::pathRemoveFileName( (*it) ), FileSystem::fileNameFromPath( (*it) ), Actions::Modified );
+ }
+ }
+
+ DirsChanged.clear();
+}
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/WatcherFSEvents.hpp b/dep/efsw/src/efsw/WatcherFSEvents.hpp
new file mode 100644
index 00000000000..d4fc5c9a8d3
--- /dev/null
+++ b/dep/efsw/src/efsw/WatcherFSEvents.hpp
@@ -0,0 +1,70 @@
+#ifndef EFSW_WATCHERINOTIFY_HPP
+#define EFSW_WATCHERINOTIFY_HPP
+
+#include <efsw/FileWatcherImpl.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_FSEVENTS
+
+#include <efsw/WatcherGeneric.hpp>
+#include <efsw/FileInfo.hpp>
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreServices/CoreServices.h>
+#include <set>
+#include <vector>
+
+namespace efsw {
+
+class FileWatcherFSEvents;
+
+class FSEvent
+{
+ public:
+ FSEvent( std::string path, long flags, Uint64 id ) :
+ Path( path ),
+ Flags( flags ),
+ Id ( id )
+ {
+ }
+
+ std::string Path;
+ long Flags;
+ Uint64 Id;
+};
+
+class WatcherFSEvents : public Watcher
+{
+ public:
+ WatcherFSEvents();
+
+ WatcherFSEvents( WatchID id, std::string directory, FileWatchListener * listener, bool recursive, WatcherFSEvents * parent = NULL );
+
+ ~WatcherFSEvents();
+
+ void init();
+
+ void initAsync();
+
+ void handleActions( std::vector<FSEvent> & events );
+
+ void process();
+
+ FileWatcherFSEvents * FWatcher;
+
+ FSEventStreamRef FSStream;
+ protected:
+ void handleAddModDel( const Uint32 &flags, const std::string &path, std::string &dirPath, std::string &filePath );
+
+ WatcherGeneric * WatcherGen;
+
+ bool initializedAsync;
+
+ std::set<std::string> DirsChanged;
+
+ void sendFileAction( WatchID watchid, const std::string& dir, const std::string& filename, Action action, std::string oldFilename = "" );
+};
+
+}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/WatcherGeneric.cpp b/dep/efsw/src/efsw/WatcherGeneric.cpp
new file mode 100644
index 00000000000..94170d3ce87
--- /dev/null
+++ b/dep/efsw/src/efsw/WatcherGeneric.cpp
@@ -0,0 +1,40 @@
+#include <efsw/WatcherGeneric.hpp>
+#include <efsw/FileSystem.hpp>
+#include <efsw/DirWatcherGeneric.hpp>
+
+namespace efsw
+{
+
+WatcherGeneric::WatcherGeneric( WatchID id, const std::string& directory, FileWatchListener * fwl, FileWatcherImpl * fw, bool recursive ) :
+ Watcher( id, directory, fwl, recursive ),
+ WatcherImpl( fw ),
+ DirWatch( NULL )
+{
+ FileSystem::dirAddSlashAtEnd( Directory );
+
+ DirWatch = new DirWatcherGeneric( NULL, this, directory, recursive, false );
+
+ DirWatch->addChilds( false );
+}
+
+WatcherGeneric::~WatcherGeneric()
+{
+ efSAFE_DELETE( DirWatch );
+}
+
+void WatcherGeneric::watch()
+{
+ DirWatch->watch();
+}
+
+void WatcherGeneric::watchDir( std::string dir )
+{
+ DirWatch->watchDir( dir );
+}
+
+bool WatcherGeneric::pathInWatches( std::string path )
+{
+ return DirWatch->pathInWatches( path );
+}
+
+}
diff --git a/dep/efsw/src/efsw/WatcherGeneric.hpp b/dep/efsw/src/efsw/WatcherGeneric.hpp
new file mode 100644
index 00000000000..8794e921b40
--- /dev/null
+++ b/dep/efsw/src/efsw/WatcherGeneric.hpp
@@ -0,0 +1,30 @@
+#ifndef EFSW_WATCHERGENERIC_HPP
+#define EFSW_WATCHERGENERIC_HPP
+
+#include <efsw/FileWatcherImpl.hpp>
+
+namespace efsw
+{
+
+class DirWatcherGeneric;
+
+class WatcherGeneric : public Watcher
+{
+ public:
+ FileWatcherImpl * WatcherImpl;
+ DirWatcherGeneric * DirWatch;
+
+ WatcherGeneric( WatchID id, const std::string& directory, FileWatchListener * fwl, FileWatcherImpl * fw, bool recursive );
+
+ ~WatcherGeneric();
+
+ void watch();
+
+ void watchDir( std::string dir );
+
+ bool pathInWatches( std::string path );
+};
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/WatcherInotify.cpp b/dep/efsw/src/efsw/WatcherInotify.cpp
new file mode 100644
index 00000000000..741641bf43c
--- /dev/null
+++ b/dep/efsw/src/efsw/WatcherInotify.cpp
@@ -0,0 +1,35 @@
+#include <efsw/WatcherInotify.hpp>
+
+namespace efsw {
+
+WatcherInotify::WatcherInotify() :
+ Watcher(),
+ Parent( NULL )
+{
+}
+
+WatcherInotify::WatcherInotify( WatchID id, std::string directory, FileWatchListener * listener, bool recursive, WatcherInotify * parent ) :
+ Watcher( id, directory, listener, recursive ),
+ Parent( parent ),
+ DirInfo( directory )
+{
+}
+
+bool WatcherInotify::inParentTree( WatcherInotify * parent )
+{
+ WatcherInotify * tNext = Parent;
+
+ while ( NULL != tNext )
+ {
+ if ( tNext == parent )
+ {
+ return true;
+ }
+
+ tNext = tNext->Parent;
+ }
+
+ return false;
+}
+
+}
diff --git a/dep/efsw/src/efsw/WatcherInotify.hpp b/dep/efsw/src/efsw/WatcherInotify.hpp
new file mode 100644
index 00000000000..1caf399679b
--- /dev/null
+++ b/dep/efsw/src/efsw/WatcherInotify.hpp
@@ -0,0 +1,25 @@
+#ifndef EFSW_WATCHERINOTIFY_HPP
+#define EFSW_WATCHERINOTIFY_HPP
+
+#include <efsw/FileWatcherImpl.hpp>
+#include <efsw/FileInfo.hpp>
+
+namespace efsw {
+
+class WatcherInotify : public Watcher
+{
+ public:
+ WatcherInotify();
+
+ WatcherInotify( WatchID id, std::string directory, FileWatchListener * listener, bool recursive, WatcherInotify * parent = NULL );
+
+ bool inParentTree( WatcherInotify * parent );
+
+ WatcherInotify * Parent;
+
+ FileInfo DirInfo;
+};
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/WatcherKqueue.cpp b/dep/efsw/src/efsw/WatcherKqueue.cpp
new file mode 100644
index 00000000000..8347fb53439
--- /dev/null
+++ b/dep/efsw/src/efsw/WatcherKqueue.cpp
@@ -0,0 +1,667 @@
+#include <efsw/WatcherKqueue.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_KQUEUE || EFSW_PLATFORM == EFSW_PLATFORM_FSEVENTS
+
+#include <sys/stat.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <efsw/Debug.hpp>
+#include <efsw/String.hpp>
+#include <efsw/System.hpp>
+#include <efsw/FileSystem.hpp>
+#include <efsw/WatcherGeneric.hpp>
+#include <efsw/FileWatcherKqueue.hpp>
+
+#define KEVENT_RESERVE_VALUE (10)
+
+#ifndef O_EVTONLY
+#define O_EVTONLY (O_RDONLY | O_NONBLOCK)
+#endif
+
+namespace efsw {
+
+int comparator(const void* ke1, const void* ke2)
+{
+ const KEvent * kev1 = reinterpret_cast<const KEvent*>( ke1 );
+ const KEvent * kev2 = reinterpret_cast<const KEvent*>( ke2 );
+
+ if ( NULL != kev2->udata )
+ {
+ FileInfo * fi1 = reinterpret_cast<FileInfo*>( kev1->udata );
+ FileInfo * fi2 = reinterpret_cast<FileInfo*>( kev2->udata );
+
+ return strcmp( fi1->Filepath.c_str(), fi2->Filepath.c_str() );
+ }
+
+ return 1;
+}
+
+WatcherKqueue::WatcherKqueue(WatchID watchid, const std::string& dirname, FileWatchListener* listener, bool recursive, FileWatcherKqueue * watcher, WatcherKqueue * parent ) :
+ Watcher( watchid, dirname, listener, recursive ),
+ mLastWatchID(0),
+ mChangeListCount( 0 ),
+ mKqueue( kqueue() ),
+ mWatcher( watcher ),
+ mParent( parent ),
+ mInitOK( true ),
+ mErrno(0)
+{
+ if ( -1 == mKqueue )
+ {
+ efDEBUG( "kqueue() returned invalid descriptor for directory %s. File descriptors count: %ld\n", Directory.c_str(), mWatcher->mFileDescriptorCount );
+
+ mInitOK = false;
+ mErrno = errno;
+ }
+ else
+ {
+ mWatcher->addFD();
+ }
+}
+
+WatcherKqueue::~WatcherKqueue()
+{
+ // Remove the childs watchers ( sub-folders watches )
+ removeAll();
+
+ for ( size_t i = 0; i < mChangeListCount; i++ )
+ {
+ if ( NULL != mChangeList[i].udata )
+ {
+ FileInfo * fi = reinterpret_cast<FileInfo*>( mChangeList[i].udata );
+
+ efSAFE_DELETE( fi );
+ }
+ }
+
+ close( mKqueue );
+
+ mWatcher->removeFD();
+}
+
+void WatcherKqueue::addAll()
+{
+ if ( -1 == mKqueue )
+ {
+ return;
+ }
+
+ // scan directory and call addFile(name, false) on each file
+ FileSystem::dirAddSlashAtEnd( Directory );
+
+ efDEBUG( "addAll(): Added folder: %s\n", Directory.c_str());
+
+ // add base dir
+ int fd = open( Directory.c_str(), O_EVTONLY );
+
+ if ( -1 == fd )
+ {
+ efDEBUG( "addAll(): Couldn't open folder: %s\n", Directory.c_str() );
+
+ if ( EACCES != errno )
+ {
+ mInitOK = false;
+ }
+
+ mErrno = errno;
+
+ return;
+ }
+
+ mDirSnap.setDirectoryInfo( Directory );
+ mDirSnap.scan();
+
+ mChangeList.resize( KEVENT_RESERVE_VALUE );
+
+ // Creates the kevent for the folder
+ EV_SET(
+ &mChangeList[0],
+ fd,
+ EVFILT_VNODE,
+ EV_ADD | EV_ENABLE | EV_ONESHOT,
+ NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_ATTRIB | NOTE_RENAME,
+ 0,
+ 0
+ );
+
+ mWatcher->addFD();
+
+ // Get the files and directories from the directory
+ FileInfoMap files = FileSystem::filesInfoFromPath( Directory );
+
+ for ( FileInfoMap::iterator it = files.begin(); it != files.end(); it++ )
+ {
+ FileInfo& fi = it->second;
+
+ if ( fi.isRegularFile() )
+ {
+ // Add the regular files kevent
+ addFile( fi.Filepath , false );
+ }
+ else if ( Recursive && fi.isDirectory() && fi.isReadable() )
+ {
+ // Create another watcher for the subfolders ( if recursive )
+ WatchID id = addWatch( fi.Filepath, Listener, Recursive, this );
+
+ // If the watcher is not adding the watcher means that the directory was created
+ if ( id > 0 && !mWatcher->isAddingWatcher() )
+ {
+ handleFolderAction( fi.Filepath, Actions::Add );
+ }
+ }
+ }
+}
+
+void WatcherKqueue::removeAll()
+{
+ efDEBUG( "removeAll(): Removing all child watchers\n" );
+
+ std::list<WatchID> erase;
+
+ for ( WatchMap::iterator it = mWatches.begin(); it != mWatches.end(); it++ )
+ {
+ efDEBUG( "removeAll(): Removed child watcher %s\n", it->second->Directory.c_str() );
+
+ erase.push_back( it->second->ID );
+ }
+
+ for ( std::list<WatchID>::iterator eit = erase.begin(); eit != erase.end(); eit++ )
+ {
+ removeWatch( *eit );
+ }
+}
+
+void WatcherKqueue::addFile(const std::string& name, bool emitEvents)
+{
+ efDEBUG( "addFile(): Added: %s\n", name.c_str() );
+
+ // Open the file to get the file descriptor
+ int fd = open( name.c_str(), O_EVTONLY );
+
+ if( fd == -1 )
+ {
+ efDEBUG( "addFile(): Could open file descriptor for %s. File descriptor count: %ld\n", name.c_str(), mWatcher->mFileDescriptorCount );
+
+ Errors::Log::createLastError( Errors::FileNotReadable, name );
+
+ if ( EACCES != errno )
+ {
+ mInitOK = false;
+ }
+
+ mErrno = errno;
+
+ return;
+ }
+
+ mWatcher->addFD();
+
+ // increase the file kevent file count
+ mChangeListCount++;
+
+ if ( mChangeListCount + KEVENT_RESERVE_VALUE > mChangeList.size() &&
+ mChangeListCount % KEVENT_RESERVE_VALUE == 0 )
+ {
+ size_t reserve_size = mChangeList.size() + KEVENT_RESERVE_VALUE;
+ mChangeList.resize( reserve_size );
+ efDEBUG( "addFile(): Reserverd more KEvents space for %s, space reserved %ld, list actual size %ld.\n", Directory.c_str(), reserve_size, mChangeListCount );
+ }
+
+ // create entry
+ FileInfo * entry = new FileInfo( name );
+
+ // set the event data at the end of the list
+ EV_SET(
+ &mChangeList[mChangeListCount],
+ fd,
+ EVFILT_VNODE,
+ EV_ADD | EV_ENABLE | EV_ONESHOT,
+ NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_ATTRIB | NOTE_RENAME,
+ 0,
+ (void*)entry
+ );
+
+ // qsort sort the list by name
+ qsort(&mChangeList[1], mChangeListCount, sizeof(KEvent), comparator);
+
+ // handle action
+ if( emitEvents )
+ {
+ handleAction(name, Actions::Add);
+ }
+}
+
+void WatcherKqueue::removeFile( const std::string& name, bool emitEvents )
+{
+ efDEBUG( "removeFile(): Trying to remove file: %s\n", name.c_str() );
+
+ // bsearch
+ KEvent target;
+
+ // Create a temporary file info to search the kevent ( searching the directory )
+ FileInfo tempEntry( name );
+
+ target.udata = &tempEntry;
+
+ // Search the kevent
+ KEvent * ke = (KEvent*)bsearch(&target, &mChangeList[0], mChangeListCount + 1, sizeof(KEvent), comparator);
+
+ // Trying to remove a non-existing file?
+ if( !ke )
+ {
+ Errors::Log::createLastError( Errors::FileNotFound, name );
+ efDEBUG( "File not removed\n" );
+ return;
+ }
+
+ efDEBUG( "File removed\n" );
+
+ // handle action
+ if ( emitEvents )
+ {
+ handleAction( name, Actions::Delete );
+ }
+
+ // Delete the user data ( FileInfo ) from the kevent closed
+ FileInfo * del = reinterpret_cast<FileInfo*>( ke->udata );
+
+ efSAFE_DELETE( del );
+
+ // close the file descriptor from the kevent
+ close( ke->ident );
+
+ mWatcher->removeFD();
+
+ memset(ke, 0, sizeof(KEvent));
+
+ // move end to current
+ memcpy(ke, &mChangeList[mChangeListCount], sizeof(KEvent));
+ memset(&mChangeList[mChangeListCount], 0, sizeof(KEvent));
+ --mChangeListCount;
+}
+
+void WatcherKqueue::rescan()
+{
+ efDEBUG( "rescan(): Rescanning: %s\n", Directory.c_str() );
+
+ DirectorySnapshotDiff Diff = mDirSnap.scan();
+
+ if ( Diff.DirChanged )
+ {
+ sendDirChanged();
+ }
+
+ if ( Diff.changed() )
+ {
+ FileInfoList::iterator it;
+ MovedList::iterator mit;
+
+ /// Files
+ DiffIterator( FilesCreated )
+ {
+ addFile( (*it).Filepath );
+ }
+
+ DiffIterator( FilesModified )
+ {
+ handleAction( (*it).Filepath, Actions::Modified );
+ }
+
+ DiffIterator( FilesDeleted )
+ {
+ removeFile( (*it).Filepath );
+ }
+
+ DiffMovedIterator( FilesMoved )
+ {
+ handleAction( (*mit).second.Filepath, Actions::Moved, (*mit).first );
+ removeFile( Directory + (*mit).first, false );
+ addFile( (*mit).second.Filepath, false );
+ }
+
+ /// Directories
+ DiffIterator( DirsCreated )
+ {
+ handleFolderAction( (*it).Filepath, Actions::Add );
+ addWatch( (*it).Filepath, Listener, Recursive, this );
+ }
+
+ DiffIterator( DirsModified )
+ {
+ handleFolderAction( (*it).Filepath, Actions::Modified );
+ }
+
+ DiffIterator( DirsDeleted )
+ {
+ handleFolderAction( (*it).Filepath, Actions::Delete );
+
+ Watcher * watch = findWatcher( (*it).Filepath );
+
+ if ( NULL != watch )
+ {
+ removeWatch( watch->ID );
+
+ }
+ }
+
+ DiffMovedIterator( DirsMoved )
+ {
+ moveDirectory( Directory + (*mit).first, (*mit).second.Filepath );
+ }
+ }
+}
+
+WatchID WatcherKqueue::watchingDirectory( std::string dir )
+{
+ Watcher * watch = findWatcher( dir );
+
+ if ( NULL != watch )
+ {
+ return watch->ID;
+ }
+
+ return Errors::FileNotFound;
+}
+
+void WatcherKqueue::handleAction( const std::string& filename, efsw::Action action, const std::string& oldFilename )
+{
+ Listener->handleFileAction( ID, Directory, FileSystem::fileNameFromPath( filename ), action, FileSystem::fileNameFromPath( oldFilename ) );
+}
+
+void WatcherKqueue::handleFolderAction( std::string filename, efsw::Action action , const std::string &oldFilename )
+{
+ FileSystem::dirRemoveSlashAtEnd( filename );
+
+ handleAction( filename, action, oldFilename );
+}
+
+void WatcherKqueue::sendDirChanged()
+{
+ if ( NULL != mParent )
+ {
+ Listener->handleFileAction( mParent->ID, mParent->Directory, FileSystem::fileNameFromPath( Directory ), Actions::Modified );
+ }
+}
+
+void WatcherKqueue::watch()
+{
+ if ( -1 == mKqueue )
+ {
+ return;
+ }
+
+ int nev = 0;
+ KEvent event;
+
+ // First iterate the childs, to get the events from the deepest folder, to the watcher childs
+ for ( WatchMap::iterator it = mWatches.begin(); it != mWatches.end(); ++it )
+ {
+ it->second->watch();
+ }
+
+ bool needScan = false;
+
+ // Then we get the the events of the current folder
+ while( ( nev = kevent( mKqueue, &mChangeList[0], mChangeListCount + 1, &event, 1, &mWatcher->mTimeOut ) ) != 0 )
+ {
+ // An error ocurred?
+ if( nev == -1 )
+ {
+ efDEBUG( "watch(): Error on directory %s\n", Directory.c_str() );
+ perror("kevent");
+ break;
+ }
+ else
+ {
+ FileInfo * entry = NULL;
+
+ // If udate == NULL means that it is the fisrt element of the change list, the folder.
+ // otherwise it is an event of some file inside the folder
+ if( ( entry = reinterpret_cast<FileInfo*> ( event.udata ) ) != NULL )
+ {
+ efDEBUG( "watch(): File: %s ", entry->Filepath.c_str() );
+
+ // If the event flag is delete... the file was deleted
+ if ( event.fflags & NOTE_DELETE )
+ {
+ efDEBUG( "deleted\n" );
+
+ mDirSnap.removeFile( entry->Filepath );
+
+ removeFile( entry->Filepath );
+ }
+ else if ( event.fflags & NOTE_EXTEND ||
+ event.fflags & NOTE_WRITE ||
+ event.fflags & NOTE_ATTRIB
+ )
+ {
+ // The file was modified
+ efDEBUG( "modified\n" );
+
+ FileInfo fi( entry->Filepath );
+
+ if ( fi != *entry )
+ {
+ *entry = fi;
+
+ mDirSnap.updateFile( entry->Filepath );
+
+ handleAction( entry->Filepath, efsw::Actions::Modified );
+ }
+ }
+ else if ( event.fflags & NOTE_RENAME )
+ {
+ efDEBUG( "moved\n" );
+
+ needScan = true;
+ }
+ }
+ else
+ {
+ needScan = true;
+ }
+ }
+ }
+
+ if ( needScan )
+ {
+ rescan();
+ }
+}
+
+Watcher * WatcherKqueue::findWatcher( const std::string path )
+{
+ WatchMap::iterator it = mWatches.begin();
+
+ for ( ; it != mWatches.end(); it++ )
+ {
+ if ( it->second->Directory == path )
+ {
+ return it->second;
+ }
+ }
+
+ return NULL;
+}
+
+void WatcherKqueue::moveDirectory( std::string oldPath, std::string newPath, bool emitEvents )
+{
+ // Update the directory path if it's a watcher
+ std::string opath2( oldPath );
+ FileSystem::dirAddSlashAtEnd( opath2 );
+
+ Watcher * watch = findWatcher( opath2 );
+
+ if ( NULL != watch )
+ {
+ watch->Directory = opath2;
+ }
+
+ if ( emitEvents )
+ {
+ handleFolderAction( newPath, efsw::Actions::Moved, oldPath );
+ }
+}
+
+WatchID WatcherKqueue::addWatch( const std::string& directory, FileWatchListener* watcher, bool recursive , WatcherKqueue *parent)
+{
+ static long s_fc = 0;
+ static bool s_ug = false;
+
+ std::string dir( directory );
+
+ FileSystem::dirAddSlashAtEnd( dir );
+
+ // This should never happen here
+ if( !FileSystem::isDirectory( dir ) )
+ {
+ return Errors::Log::createLastError( Errors::FileNotFound, dir );
+ }
+ else if ( pathInWatches( dir ) || pathInParent( dir ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, directory );
+ }
+ else if ( NULL != parent && FileSystem::isRemoteFS( dir ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRemote, dir );
+ }
+
+ std::string curPath;
+ std::string link( FileSystem::getLinkRealPath( dir, curPath ) );
+
+ if ( "" != link )
+ {
+ /// Avoid adding symlinks directories if it's now enabled
+ if ( NULL != parent && !mWatcher->mFileWatcher->followSymlinks() )
+ {
+ return Errors::Log::createLastError( Errors::FileOutOfScope, dir );
+ }
+
+ if ( pathInWatches( link ) || pathInParent( link ) )
+ {
+ return Errors::Log::createLastError( Errors::FileRepeated, link );
+ }
+ else if ( !mWatcher->linkAllowed( curPath, link ) )
+ {
+ return Errors::Log::createLastError( Errors::FileOutOfScope, link );
+ }
+ else
+ {
+ dir = link;
+ }
+ }
+
+ if ( mWatcher->availablesFD() )
+ {
+ WatcherKqueue* watch = new WatcherKqueue( ++mLastWatchID, dir, watcher, recursive, mWatcher, parent );
+
+ mWatches.insert(std::make_pair(mLastWatchID, watch));
+
+ watch->addAll();
+
+ s_fc++;
+
+ // if failed to open the directory... erase the watcher
+ if ( !watch->initOK() )
+ {
+ int le = watch->lastErrno();
+
+ mWatches.erase( watch->ID );
+
+ efSAFE_DELETE( watch );
+
+ mLastWatchID--;
+
+ // Probably the folder has too many files, create a generic watcher
+ if ( EACCES != le )
+ {
+ WatcherGeneric * watch = new WatcherGeneric( ++mLastWatchID, dir, watcher, mWatcher, recursive );
+
+ mWatches.insert(std::make_pair(mLastWatchID, watch));
+ }
+ else
+ {
+ return Errors::Log::createLastError( Errors::Unspecified, link );
+ }
+ }
+ }
+ else
+ {
+ if ( !s_ug )
+ {
+ efDEBUG( "Started using WatcherGeneric, reached file descriptors limit: %ld. Folders added: %ld\n", mWatcher->mFileDescriptorCount, s_fc );
+ s_ug = true;
+ }
+
+ WatcherGeneric * watch = new WatcherGeneric( ++mLastWatchID, dir, watcher, mWatcher, recursive );
+
+ mWatches.insert(std::make_pair(mLastWatchID, watch));
+ }
+
+ return mLastWatchID;
+}
+
+bool WatcherKqueue::initOK()
+{
+ return mInitOK;
+}
+
+void WatcherKqueue::removeWatch( WatchID watchid )
+{
+ WatchMap::iterator iter = mWatches.find(watchid);
+
+ if(iter == mWatches.end())
+ return;
+
+ Watcher * watch = iter->second;
+
+ mWatches.erase(iter);
+
+ efSAFE_DELETE( watch );
+}
+
+bool WatcherKqueue::pathInWatches( const std::string& path )
+{
+ return NULL != findWatcher( path );
+}
+
+bool WatcherKqueue::pathInParent( const std::string &path )
+{
+ WatcherKqueue * pNext = mParent;
+
+ while ( NULL != pNext )
+ {
+ if ( pNext->pathInWatches( path ) )
+ {
+ return true;
+ }
+
+ pNext = pNext->mParent;
+ }
+
+ if ( mWatcher->pathInWatches( path ) )
+ {
+ return true;
+ }
+
+ if ( path == Directory )
+ {
+ return true;
+ }
+
+ return false;
+}
+
+int WatcherKqueue::lastErrno()
+{
+ return mErrno;
+}
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/WatcherKqueue.hpp b/dep/efsw/src/efsw/WatcherKqueue.hpp
new file mode 100644
index 00000000000..4babbe73354
--- /dev/null
+++ b/dep/efsw/src/efsw/WatcherKqueue.hpp
@@ -0,0 +1,94 @@
+#ifndef EFSW_WATCHEROSX_HPP
+#define EFSW_WATCHEROSX_HPP
+
+#include <efsw/FileWatcherImpl.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_KQUEUE || EFSW_PLATFORM == EFSW_PLATFORM_FSEVENTS
+
+#include <map>
+#include <vector>
+#include <sys/types.h>
+#include <sys/event.h>
+#include <efsw/DirectorySnapshot.hpp>
+
+namespace efsw
+{
+
+class FileWatcherKqueue;
+class WatcherKqueue;
+
+typedef struct kevent KEvent;
+
+/// type for a map from WatchID to WatcherKqueue pointer
+typedef std::map<WatchID, Watcher*> WatchMap;
+
+class WatcherKqueue : public Watcher
+{
+ public:
+ WatcherKqueue( WatchID watchid, const std::string& dirname, FileWatchListener* listener, bool recursive, FileWatcherKqueue * watcher, WatcherKqueue * parent = NULL );
+
+ virtual ~WatcherKqueue();
+
+ void addFile( const std::string& name, bool emitEvents = true );
+
+ void removeFile( const std::string& name, bool emitEvents = true );
+
+ // called when the directory is actually changed
+ // means a file has been added or removed
+ // rescans the watched directory adding/removing files and sending notices
+ void rescan();
+
+ void handleAction( const std::string& filename, efsw::Action action, const std::string& oldFilename = "" );
+
+ void handleFolderAction( std::string filename, efsw::Action action, const std::string& oldFilename = "" );
+
+ void addAll();
+
+ void removeAll();
+
+ WatchID watchingDirectory( std::string dir );
+
+ void watch();
+
+ WatchID addWatch(const std::string& directory, FileWatchListener* watcher, bool recursive, WatcherKqueue * parent);
+
+ void removeWatch (WatchID watchid );
+
+ bool initOK();
+
+ int lastErrno();
+ protected:
+ WatchMap mWatches;
+ int mLastWatchID;
+
+ // index 0 is always the directory
+ std::vector<KEvent> mChangeList;
+ size_t mChangeListCount;
+ DirectorySnapshot mDirSnap;
+
+ /// The descriptor for the kqueue
+ int mKqueue;
+
+ FileWatcherKqueue * mWatcher;
+
+ WatcherKqueue * mParent;
+
+ bool mInitOK;
+ int mErrno;
+
+ bool pathInWatches( const std::string& path );
+
+ bool pathInParent( const std::string& path );
+
+ Watcher * findWatcher( const std::string path );
+
+ void moveDirectory( std::string oldPath, std::string newPath, bool emitEvents = true );
+
+ void sendDirChanged();
+};
+
+}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/WatcherWin32.cpp b/dep/efsw/src/efsw/WatcherWin32.cpp
new file mode 100644
index 00000000000..01d7b0fcd99
--- /dev/null
+++ b/dep/efsw/src/efsw/WatcherWin32.cpp
@@ -0,0 +1,150 @@
+#include <efsw/WatcherWin32.hpp>
+#include <efsw/String.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+namespace efsw
+{
+
+/// Unpacks events and passes them to a user defined callback.
+void CALLBACK WatchCallback(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered, LPOVERLAPPED lpOverlapped)
+{
+ char szFile[MAX_PATH];
+ PFILE_NOTIFY_INFORMATION pNotify;
+ WatcherStructWin32 * tWatch = (WatcherStructWin32*) lpOverlapped;
+ WatcherWin32 * pWatch = tWatch->Watch;
+ size_t offset = 0;
+
+ if (dwNumberOfBytesTransfered == 0)
+ {
+ RefreshWatch(tWatch); // If dwNumberOfBytesTransfered == 0, it means the buffer overflowed (too many changes between GetOverlappedResults calls). Those events are lost, but at least we can refresh so subsequent changes are seen again.
+ return;
+ }
+
+ if (dwErrorCode == ERROR_SUCCESS)
+ {
+ do
+ {
+ bool skip = false;
+
+ pNotify = (PFILE_NOTIFY_INFORMATION) &pWatch->mBuffer[offset];
+ offset += pNotify->NextEntryOffset;
+
+ int count = WideCharToMultiByte(CP_UTF8, 0, pNotify->FileName,
+ pNotify->FileNameLength / sizeof(WCHAR),
+ szFile, MAX_PATH - 1, NULL, NULL);
+ szFile[count] = TEXT('\0');
+
+ std::string nfile( szFile );
+
+ if ( FILE_ACTION_MODIFIED == pNotify->Action )
+ {
+ FileInfo fifile( std::string( pWatch->DirName ) + nfile );
+
+ if ( pWatch->LastModifiedEvent.file.ModificationTime == fifile.ModificationTime && pWatch->LastModifiedEvent.file.Size == fifile.Size && pWatch->LastModifiedEvent.fileName == nfile )
+ {
+ skip = true;
+ }
+
+ pWatch->LastModifiedEvent.fileName = nfile;
+ pWatch->LastModifiedEvent.file = fifile;
+ }
+
+ if ( !skip )
+ {
+ pWatch->Watch->handleAction(pWatch, nfile, pNotify->Action);
+ }
+ } while (pNotify->NextEntryOffset != 0);
+ }
+
+ if (!pWatch->StopNow)
+ {
+ RefreshWatch(tWatch);
+ }
+}
+
+/// Refreshes the directory monitoring.
+bool RefreshWatch(WatcherStructWin32* pWatch)
+{
+ return ReadDirectoryChangesW(
+ pWatch->Watch->DirHandle,
+ pWatch->Watch->mBuffer,
+ sizeof(pWatch->Watch->mBuffer),
+ pWatch->Watch->Recursive,
+ pWatch->Watch->NotifyFilter,
+ NULL,
+ &pWatch->Overlapped,
+ NULL
+ ) != 0;
+}
+
+/// Stops monitoring a directory.
+void DestroyWatch(WatcherStructWin32* pWatch)
+{
+ if (pWatch)
+ {
+ WatcherWin32 * tWatch = pWatch->Watch;
+
+ tWatch->StopNow = true;
+
+ CancelIo(tWatch->DirHandle);
+
+ RefreshWatch(pWatch);
+
+ if (!HasOverlappedIoCompleted(&pWatch->Overlapped))
+ {
+ SleepEx(5, TRUE);
+ }
+
+ CloseHandle(pWatch->Overlapped.hEvent);
+ CloseHandle(pWatch->Watch->DirHandle);
+ efSAFE_DELETE_ARRAY( pWatch->Watch->DirName );
+ efSAFE_DELETE( pWatch->Watch );
+ HeapFree(GetProcessHeap(), 0, pWatch);
+ }
+}
+
+/// Starts monitoring a directory.
+WatcherStructWin32* CreateWatch(LPCWSTR szDirectory, bool recursive, DWORD NotifyFilter)
+{
+ WatcherStructWin32 * tWatch;
+ size_t ptrsize = sizeof(*tWatch);
+ tWatch = static_cast<WatcherStructWin32*>(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ptrsize));
+
+ WatcherWin32 * pWatch = new WatcherWin32();
+ tWatch->Watch = pWatch;
+
+ pWatch->DirHandle = CreateFileW(
+ szDirectory,
+ GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED,
+ NULL
+ );
+
+ if (pWatch->DirHandle != INVALID_HANDLE_VALUE)
+ {
+ tWatch->Overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ pWatch->NotifyFilter = NotifyFilter;
+ pWatch->Recursive = recursive;
+
+ if (RefreshWatch(tWatch))
+ {
+ return tWatch;
+ }
+ else
+ {
+ CloseHandle(tWatch->Overlapped.hEvent);
+ CloseHandle(pWatch->DirHandle);
+ }
+ }
+
+ HeapFree(GetProcessHeap(), 0, tWatch);
+ return NULL;
+}
+
+}
+
+ #endif
diff --git a/dep/efsw/src/efsw/WatcherWin32.hpp b/dep/efsw/src/efsw/WatcherWin32.hpp
new file mode 100644
index 00000000000..3c6d988fbf4
--- /dev/null
+++ b/dep/efsw/src/efsw/WatcherWin32.hpp
@@ -0,0 +1,77 @@
+#ifndef EFSW_WATCHERWIN32_HPP
+#define EFSW_WATCHERWIN32_HPP
+
+#include <efsw/FileWatcherImpl.hpp>
+#include <efsw/FileInfo.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+#include <windows.h>
+
+#ifdef EFSW_COMPILER_MSVC
+ #pragma comment(lib, "comctl32.lib")
+ #pragma comment(lib, "user32.lib")
+ #pragma comment(lib, "ole32.lib")
+
+ // disable secure warnings
+ #pragma warning (disable: 4996)
+#endif
+
+namespace efsw
+{
+
+class WatcherWin32;
+
+/// Internal watch data
+struct WatcherStructWin32
+{
+ OVERLAPPED Overlapped;
+ WatcherWin32 * Watch;
+};
+
+class cLastModifiedEvent
+{
+ public:
+ cLastModifiedEvent() {}
+ FileInfo file;
+ std::string fileName;
+};
+
+bool RefreshWatch(WatcherStructWin32* pWatch);
+
+void CALLBACK WatchCallback(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered, LPOVERLAPPED lpOverlapped);
+
+void DestroyWatch(WatcherStructWin32* pWatch);
+
+WatcherStructWin32* CreateWatch(LPCWSTR szDirectory, bool recursive, DWORD NotifyFilter);
+
+class WatcherWin32 : public Watcher
+{
+ public:
+ WatcherWin32() :
+ Struct( NULL ),
+ DirHandle( NULL ),
+ lParam( 0 ),
+ NotifyFilter( 0 ),
+ StopNow( false ),
+ Watch( NULL ),
+ DirName( NULL )
+ {
+ }
+
+ WatcherStructWin32 * Struct;
+ HANDLE DirHandle;
+ BYTE mBuffer[63 * 1024]; // do NOT make this bigger than 64K because it will fail if the folder being watched is on the network! (see http://msdn.microsoft.com/en-us/library/windows/desktop/aa365465(v=vs.85).aspx)
+ LPARAM lParam;
+ DWORD NotifyFilter;
+ bool StopNow;
+ FileWatcherImpl* Watch;
+ char* DirName;
+ cLastModifiedEvent LastModifiedEvent;
+};
+
+}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/base.hpp b/dep/efsw/src/efsw/base.hpp
new file mode 100644
index 00000000000..26108c76985
--- /dev/null
+++ b/dep/efsw/src/efsw/base.hpp
@@ -0,0 +1,110 @@
+#ifndef EFSW_BASE
+#define EFSW_BASE
+
+#include <efsw/sophist.h>
+#include <efsw/efsw.hpp>
+
+namespace efsw {
+
+typedef SOPHIST_int8 Int8;
+typedef SOPHIST_uint8 Uint8;
+typedef SOPHIST_int16 Int16;
+typedef SOPHIST_uint16 Uint16;
+typedef SOPHIST_int32 Int32;
+typedef SOPHIST_uint32 Uint32;
+typedef SOPHIST_int64 Int64;
+typedef SOPHIST_uint64 Uint64;
+
+#define EFSW_OS_WIN 1
+#define EFSW_OS_LINUX 2
+#define EFSW_OS_MACOSX 3
+#define EFSW_OS_BSD 4
+#define EFSW_OS_SOLARIS 5
+#define EFSW_OS_HAIKU 6
+#define EFSW_OS_ANDROID 7
+#define EFSW_OS_IOS 8
+
+#define EFSW_PLATFORM_WIN32 1
+#define EFSW_PLATFORM_INOTIFY 2
+#define EFSW_PLATFORM_KQUEUE 3
+#define EFSW_PLATFORM_FSEVENTS 4
+#define EFSW_PLATFORM_GENERIC 5
+
+#if defined(_WIN32)
+ /// Any Windows platform
+ #define EFSW_OS EFSW_OS_WIN
+ #define EFSW_PLATFORM EFSW_PLATFORM_WIN32
+
+ #if ( defined( _MSCVER ) || defined( _MSC_VER ) )
+ #define EFSW_COMPILER_MSVC
+ #endif
+
+#elif defined( __FreeBSD__ ) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined( __DragonFly__ )
+ #define EFSW_OS EFSW_OS_BSD
+ #define EFSW_PLATFORM EFSW_PLATFORM_KQUEUE
+
+#elif defined( __APPLE_CC__ ) || defined ( __APPLE__ )
+ #include <TargetConditionals.h>
+
+ #if defined( __IPHONE__ ) || ( defined( TARGET_OS_IPHONE ) && TARGET_OS_IPHONE ) || ( defined( TARGET_IPHONE_SIMULATOR ) && TARGET_IPHONE_SIMULATOR )
+ #define EFSW_OS EFSW_OS_IOS
+ #define EFSW_PLATFORM EFSW_PLATFORM_KQUEUE
+ #else
+ #define EFSW_OS EFSW_OS_MACOSX
+
+ #if defined(EFSW_FSEVENTS_NOT_SUPPORTED)
+ #define EFSW_PLATFORM EFSW_PLATFORM_KQUEUE
+ #else
+ #define EFSW_PLATFORM EFSW_PLATFORM_FSEVENTS
+ #endif
+ #endif
+
+#elif defined(__linux__)
+ /// This includes Linux and Android
+ #ifndef EFSW_KQUEUE
+ #define EFSW_PLATFORM EFSW_PLATFORM_INOTIFY
+ #else
+ /// This is for testing libkqueue, sadly it doesnt work
+ #define EFSW_PLATFORM EFSW_PLATFORM_KQUEUE
+ #endif
+
+ #if defined( __ANDROID__ ) || defined( ANDROID )
+ #define EFSW_OS EFSW_OS_ANDROID
+ #else
+ #define EFSW_OS EFSW_OS_LINUX
+ #endif
+
+#else
+ #if defined( __SVR4 )
+ #define EFSW_OS EFSW_OS_SOLARIS
+ #elif defined( __HAIKU__ ) || defined( __BEOS__ )
+ #define EFSW_OS EFSW_OS_HAIKU
+ #endif
+
+ /// Everything else
+ #define EFSW_PLATFORM EFSW_PLATFORM_GENERIC
+#endif
+
+#if EFSW_PLATFORM != EFSW_PLATFORM_WIN32
+ #define EFSW_PLATFORM_POSIX
+#endif
+
+#if 1 == SOPHIST_pointer64
+ #define EFSW_64BIT
+#else
+ #define EFSW_32BIT
+#endif
+
+#if defined(arm) || defined(__arm__)
+ #define EFSW_ARM
+#endif
+
+#define efCOMMA ,
+
+#define efSAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
+#define efSAFE_DELETE_ARRAY(p) { if(p) { delete [] (p); (p)=NULL; } }
+#define efARRAY_SIZE(__array) ( sizeof(__array) / sizeof(__array[0]) )
+
+}
+
+#endif
diff --git a/dep/efsw/src/efsw/inotify-nosys.h b/dep/efsw/src/efsw/inotify-nosys.h
new file mode 100644
index 00000000000..75df5d3ced3
--- /dev/null
+++ b/dep/efsw/src/efsw/inotify-nosys.h
@@ -0,0 +1,159 @@
+#ifndef _LINUX_INOTIFY_H
+#define _LINUX_INOTIFY_H
+
+#include <stdint.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+/*
+ * struct inotify_event - structure read from the inotify device for each event
+ *
+ * When you are watching a directory, you will receive the filename for events
+ * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
+ */
+struct inotify_event {
+ int wd; /* watch descriptor */
+ uint32_t mask; /* watch mask */
+ uint32_t cookie; /* cookie to synchronize two events */
+ uint32_t len; /* length (including nulls) of name */
+ char name __flexarr; /* stub for possible name */
+};
+
+/* the following are legal, implemented events that user-space can watch for */
+#define IN_ACCESS 0x00000001 /* File was accessed */
+#define IN_MODIFY 0x00000002 /* File was modified */
+#define IN_ATTRIB 0x00000004 /* Metadata changed */
+#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
+#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
+#define IN_OPEN 0x00000020 /* File was opened */
+#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
+#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
+#define IN_CREATE 0x00000100 /* Subfile was created */
+#define IN_DELETE 0x00000200 /* Subfile was deleted */
+#define IN_DELETE_SELF 0x00000400 /* Self was deleted */
+#define IN_MOVE_SELF 0x00000800 /* Self was moved */
+
+/* the following are legal events. they are sent as needed to any watch */
+#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
+#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
+#define IN_IGNORED 0x00008000 /* File was ignored */
+
+/* helper events */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
+
+/* special flags */
+#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */
+#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */
+#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
+#define IN_ISDIR 0x40000000 /* event occurred against dir */
+#define IN_ONESHOT 0x80000000 /* only send event once */
+
+/*
+ * All of the events - we build the list by hand so that we can add flags in
+ * the future and not break backward compatibility. Apps will get only the
+ * events that they originally wanted. Be sure to add new events here!
+ */
+#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
+ IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
+ IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
+ IN_MOVE_SELF)
+
+#if defined (__alpha__)
+# define __NR_inotify_init 444
+# define __NR_inotify_add_watch 445
+# define __NR_inotify_rm_watch 446
+
+#elif defined (__arm__)
+# define __NR_inotify_init (__NR_SYSCALL_BASE+316)
+# define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
+# define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
+
+#elif defined (__frv__)
+# define __NR_inotify_init 291
+# define __NR_inotify_add_watch 292
+# define __NR_inotify_rm_watch 293
+
+#elif defined(__i386__)
+# define __NR_inotify_init 291
+# define __NR_inotify_add_watch 292
+# define __NR_inotify_rm_watch 293
+
+#elif defined (__ia64__)
+# define __NR_inotify_init 1277
+# define __NR_inotify_add_watch 1278
+# define __NR_inotify_rm_watch 1279
+
+#elif defined (__mips__)
+# if _MIPS_SIM == _MIPS_SIM_ABI32
+# define __NR_inotify_init (__NR_Linux + 284)
+# define __NR_inotify_add_watch (__NR_Linux + 285)
+# define __NR_inotify_rm_watch (__NR_Linux + 286)
+# endif
+# if _MIPS_SIM == _MIPS_SIM_ABI64
+# define __NR_inotify_init (__NR_Linux + 243)
+# define __NR_inotify_add_watch (__NR_Linux + 243)
+# define __NR_inotify_rm_watch (__NR_Linux + 243)
+# endif
+# if _MIPS_SIM == _MIPS_SIM_NABI32
+# define __NR_inotify_init (__NR_Linux + 247)
+# define __NR_inotify_add_watch (__NR_Linux + 248)
+# define __NR_inotify_rm_watch (__NR_Linux + 249)
+# endif
+
+#elif defined(__parisc__)
+# define __NR_inotify_init (__NR_Linux + 269)
+# define __NR_inotify_add_watch (__NR_Linux + 270)
+# define __NR_inotify_rm_watch (__NR_Linux + 271)
+
+#elif defined(__powerpc__) || defined(__powerpc64__)
+# define __NR_inotify_init 275
+# define __NR_inotify_add_watch 276
+# define __NR_inotify_rm_watch 277
+
+#elif defined (__s390__)
+# define __NR_inotify_init 284
+# define __NR_inotify_add_watch 285
+# define __NR_inotify_rm_watch 286
+
+#elif defined (__sh__)
+# define __NR_inotify_init 290
+# define __NR_inotify_add_watch 291
+# define __NR_inotify_rm_watch 292
+
+#elif defined (__sh64__)
+# define __NR_inotify_init 318
+# define __NR_inotify_add_watch 319
+# define __NR_inotify_rm_watch 320
+
+#elif defined (__sparc__) || defined (__sparc64__)
+# define __NR_inotify_init 151
+# define __NR_inotify_add_watch 152
+# define __NR_inotify_rm_watch 156
+
+#elif defined(__x86_64__)
+# define __NR_inotify_init 253
+# define __NR_inotify_add_watch 254
+# define __NR_inotify_rm_watch 255
+
+#else
+# error "Unsupported architecture!"
+#endif
+
+static inline int inotify_init (void)
+{
+ return syscall (__NR_inotify_init);
+}
+
+static inline int inotify_add_watch (int fd, const char *name, uint32_t mask)
+{
+ return syscall (__NR_inotify_add_watch, fd, name, mask);
+}
+
+static inline int inotify_rm_watch (int fd, uint32_t wd)
+{
+ return syscall (__NR_inotify_rm_watch, fd, wd);
+}
+
+
+#endif /* _LINUX_INOTIFY_H */
diff --git a/dep/efsw/src/efsw/platform/platformimpl.hpp b/dep/efsw/src/efsw/platform/platformimpl.hpp
new file mode 100644
index 00000000000..86a74eee0c8
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/platformimpl.hpp
@@ -0,0 +1,20 @@
+#ifndef EFSW_PLATFORMIMPL_HPP
+#define EFSW_PLATFORMIMPL_HPP
+
+#include <efsw/base.hpp>
+
+#if defined( EFSW_PLATFORM_POSIX )
+ #include <efsw/platform/posix/ThreadImpl.hpp>
+ #include <efsw/platform/posix/MutexImpl.hpp>
+ #include <efsw/platform/posix/SystemImpl.hpp>
+ #include <efsw/platform/posix/FileSystemImpl.hpp>
+#elif EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+ #include <efsw/platform/win/ThreadImpl.hpp>
+ #include <efsw/platform/win/MutexImpl.hpp>
+ #include <efsw/platform/win/SystemImpl.hpp>
+ #include <efsw/platform/win/FileSystemImpl.hpp>
+#else
+ #error Thread, Mutex, and System not implemented for this platform.
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/posix/FileSystemImpl.cpp b/dep/efsw/src/efsw/platform/posix/FileSystemImpl.cpp
new file mode 100644
index 00000000000..e061b25d56b
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/posix/FileSystemImpl.cpp
@@ -0,0 +1,144 @@
+#include <efsw/platform/posix/FileSystemImpl.hpp>
+
+#if defined( EFSW_PLATFORM_POSIX )
+
+#include <efsw/FileInfo.hpp>
+#include <efsw/FileSystem.hpp>
+#include <dirent.h>
+#include <cstring>
+
+#ifndef _DARWIN_FEATURE_64_BIT_INODE
+#define _DARWIN_FEATURE_64_BIT_INODE
+#endif
+
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
+
+#include <sys/stat.h>
+#include <cstdlib>
+
+#if EFSW_OS == EFSW_OS_LINUX || EFSW_OS == EFSW_OS_SOLARIS || EFSW_OS == EFSW_OS_ANDROID
+#include <sys/vfs.h>
+#elif EFSW_OS == EFSW_OS_MACOSX || EFSW_OS == EFSW_OS_BSD || EFSW_OS == EFSW_OS_IOS
+#include <sys/param.h>
+#include <sys/mount.h>
+#endif
+
+/** Remote file systems codes */
+#define S_MAGIC_AFS 0x5346414F
+#define S_MAGIC_AUFS 0x61756673
+#define S_MAGIC_CEPH 0x00C36400
+#define S_MAGIC_CIFS 0xFF534D42
+#define S_MAGIC_CODA 0x73757245
+#define S_MAGIC_FHGFS 0x19830326
+#define S_MAGIC_FUSEBLK 0x65735546
+#define S_MAGIC_FUSECTL 0x65735543
+#define S_MAGIC_GFS 0x01161970
+#define S_MAGIC_GPFS 0x47504653
+#define S_MAGIC_KAFS 0x6B414653
+#define S_MAGIC_LUSTRE 0x0BD00BD0
+#define S_MAGIC_NCP 0x564C
+#define S_MAGIC_NFS 0x6969
+#define S_MAGIC_NFSD 0x6E667364
+#define S_MAGIC_OCFS2 0x7461636F
+#define S_MAGIC_PANFS 0xAAD7AAEA
+#define S_MAGIC_PIPEFS 0x50495045
+#define S_MAGIC_SMB 0x517B
+#define S_MAGIC_SNFS 0xBEEFDEAD
+#define S_MAGIC_VMHGFS 0xBACBACBC
+#define S_MAGIC_VXFS 0xA501FCF5
+
+namespace efsw { namespace Platform {
+
+FileInfoMap FileSystem::filesInfoFromPath( const std::string& path )
+{
+ FileInfoMap files;
+
+ DIR *dp;
+ struct dirent *dirp;
+
+ if( ( dp = opendir( path.c_str() ) ) == NULL)
+ return files;
+
+ while ( ( dirp = readdir(dp) ) != NULL)
+ {
+ if ( strcmp( dirp->d_name, ".." ) != 0 && strcmp( dirp->d_name, "." ) != 0 )
+ {
+ std::string name( dirp->d_name );
+ std::string fpath( path + name );
+
+ files[ name ] = FileInfo( fpath );
+ }
+ }
+
+ closedir(dp);
+
+ return files;
+}
+
+char FileSystem::getOSSlash()
+{
+ return '/';
+}
+
+bool FileSystem::isDirectory( const std::string& path )
+{
+ struct stat st;
+ int res = stat( path.c_str(), &st );
+
+ if ( 0 == res )
+ {
+ return static_cast<bool>( S_ISDIR(st.st_mode) );
+ }
+
+ return false;
+}
+
+bool FileSystem::isRemoteFS( const std::string& directory )
+{
+#if EFSW_OS == EFSW_OS_LINUX || EFSW_OS == EFSW_OS_MACOSX || EFSW_OS == EFSW_OS_BSD || EFSW_OS == EFSW_OS_SOLARIS || EFSW_OS == EFSW_OS_ANDROID || EFSW_OS == EFSW_OS_IOS
+ struct statfs statfsbuf;
+
+ statfs( directory.c_str(), &statfsbuf );
+
+ switch ( statfsbuf.f_type | 0UL )
+ {
+ case S_MAGIC_AFS: /* 0x5346414F remote */
+ case S_MAGIC_AUFS: /* 0x61756673 remote */
+ case S_MAGIC_CEPH: /* 0x00C36400 remote */
+ case S_MAGIC_CIFS: /* 0xFF534D42 remote */
+ case S_MAGIC_CODA: /* 0x73757245 remote */
+ case S_MAGIC_FHGFS: /* 0x19830326 remote */
+ case S_MAGIC_FUSEBLK: /* 0x65735546 remote */
+ case S_MAGIC_FUSECTL: /* 0x65735543 remote */
+ case S_MAGIC_GFS: /* 0x01161970 remote */
+ case S_MAGIC_GPFS: /* 0x47504653 remote */
+ case S_MAGIC_KAFS: /* 0x6B414653 remote */
+ case S_MAGIC_LUSTRE: /* 0x0BD00BD0 remote */
+ case S_MAGIC_NCP: /* 0x564C remote */
+ case S_MAGIC_NFS: /* 0x6969 remote */
+ case S_MAGIC_NFSD: /* 0x6E667364 remote */
+ case S_MAGIC_OCFS2: /* 0x7461636F remote */
+ case S_MAGIC_PANFS: /* 0xAAD7AAEA remote */
+ case S_MAGIC_PIPEFS: /* 0x50495045 remote */
+ case S_MAGIC_SMB: /* 0x517B remote */
+ case S_MAGIC_SNFS: /* 0xBEEFDEAD remote */
+ case S_MAGIC_VMHGFS: /* 0xBACBACBC remote */
+ case S_MAGIC_VXFS: /* 0xA501FCF5 remote */
+ {
+ return true;
+ }
+ default:
+ {
+ return false;
+ }
+ }
+#endif
+
+ return false;
+}
+
+}}
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/posix/FileSystemImpl.hpp b/dep/efsw/src/efsw/platform/posix/FileSystemImpl.hpp
new file mode 100644
index 00000000000..865b3f8dfdf
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/posix/FileSystemImpl.hpp
@@ -0,0 +1,27 @@
+#ifndef EFSW_FILESYSTEMIMPLPOSIX_HPP
+#define EFSW_FILESYSTEMIMPLPOSIX_HPP
+
+#include <efsw/base.hpp>
+#include <efsw/FileInfo.hpp>
+
+#if defined( EFSW_PLATFORM_POSIX )
+
+namespace efsw { namespace Platform {
+
+class FileSystem
+{
+ public:
+ static FileInfoMap filesInfoFromPath( const std::string& path );
+
+ static char getOSSlash();
+
+ static bool isDirectory( const std::string& path );
+
+ static bool isRemoteFS( const std::string& directory );
+};
+
+}}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/posix/MutexImpl.cpp b/dep/efsw/src/efsw/platform/posix/MutexImpl.cpp
new file mode 100644
index 00000000000..6f2af5abc61
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/posix/MutexImpl.cpp
@@ -0,0 +1,32 @@
+#include <efsw/platform/posix/MutexImpl.hpp>
+
+#if defined( EFSW_PLATFORM_POSIX )
+
+namespace efsw { namespace Platform {
+
+MutexImpl::MutexImpl()
+{
+ pthread_mutexattr_t attributes;
+ pthread_mutexattr_init(&attributes);
+ pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutex_init(&mMutex, &attributes);
+}
+
+MutexImpl::~MutexImpl()
+{
+ pthread_mutex_destroy(&mMutex);
+}
+
+void MutexImpl::lock()
+{
+ pthread_mutex_lock(&mMutex);
+}
+
+void MutexImpl::unlock()
+{
+ pthread_mutex_unlock(&mMutex);
+}
+
+}}
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/posix/MutexImpl.hpp b/dep/efsw/src/efsw/platform/posix/MutexImpl.hpp
new file mode 100644
index 00000000000..d51eecb16aa
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/posix/MutexImpl.hpp
@@ -0,0 +1,31 @@
+#ifndef EFSW_MUTEXIMPLPOSIX_HPP
+#define EFSW_MUTEXIMPLPOSIX_HPP
+
+#include <efsw/base.hpp>
+
+#if defined( EFSW_PLATFORM_POSIX )
+
+#include <pthread.h>
+
+namespace efsw { namespace Platform {
+
+class MutexImpl
+{
+ public:
+ MutexImpl();
+
+ ~MutexImpl();
+
+ void lock();
+
+ void unlock();
+ private:
+ pthread_mutex_t mMutex;
+};
+
+}}
+
+#endif
+
+#endif
+
diff --git a/dep/efsw/src/efsw/platform/posix/SystemImpl.cpp b/dep/efsw/src/efsw/platform/posix/SystemImpl.cpp
new file mode 100644
index 00000000000..22e37095afd
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/posix/SystemImpl.cpp
@@ -0,0 +1,180 @@
+#include <efsw/platform/posix/SystemImpl.hpp>
+
+#if defined( EFSW_PLATFORM_POSIX )
+
+#include <cstdio>
+#include <pthread.h>
+#include <sys/time.h>
+#include <limits.h>
+#include <sys/resource.h>
+
+#include <efsw/FileSystem.hpp>
+#include <efsw/Debug.hpp>
+
+#if EFSW_OS == EFSW_OS_MACOSX
+ #include <CoreFoundation/CoreFoundation.h>
+#elif EFSW_OS == EFSW_OS_LINUX || EFSW_OS == EFSW_OS_ANDROID
+ #include <libgen.h>
+ #include <unistd.h>
+#elif EFSW_OS == EFSW_OS_HAIKU
+ #include <kernel/OS.h>
+ #include <kernel/image.h>
+#elif EFSW_OS == EFSW_OS_SOLARIS
+ #include <stdlib.h>
+#elif EFSW_OS == EFSW_OS_BSD
+ #include <sys/sysctl.h>
+#endif
+
+namespace efsw { namespace Platform {
+
+void System::sleep( const unsigned long& ms )
+{
+ // usleep( static_cast<unsigned long>( ms * 1000 ) );
+
+ // usleep is not reliable enough (it might block the
+ // whole process instead of just the current thread)
+ // so we must use pthread_cond_timedwait instead
+
+ // this implementation is inspired from Qt
+ // and taken from SFML
+
+ unsigned long long usecs = ms * 1000;
+
+ // get the current time
+ timeval tv;
+ gettimeofday(&tv, NULL);
+
+ // construct the time limit (current time + time to wait)
+ timespec ti;
+ ti.tv_nsec = (tv.tv_usec + (usecs % 1000000)) * 1000;
+ ti.tv_sec = tv.tv_sec + (usecs / 1000000) + (ti.tv_nsec / 1000000000);
+ ti.tv_nsec %= 1000000000;
+
+ // create a mutex and thread condition
+ pthread_mutex_t mutex;
+ pthread_mutex_init(&mutex, 0);
+ pthread_cond_t condition;
+ pthread_cond_init(&condition, 0);
+
+ // wait...
+ pthread_mutex_lock(&mutex);
+ pthread_cond_timedwait(&condition, &mutex, &ti);
+ pthread_mutex_unlock(&mutex);
+
+ // destroy the mutex and condition
+ pthread_cond_destroy(&condition);
+}
+
+std::string System::getProcessPath()
+{
+#if EFSW_OS == EFSW_OS_MACOSX
+ char exe_file[FILENAME_MAX + 1];
+
+ CFBundleRef mainBundle = CFBundleGetMainBundle();
+
+ if (mainBundle)
+ {
+ CFURLRef mainURL = CFBundleCopyBundleURL(mainBundle);
+
+ if (mainURL)
+ {
+ int ok = CFURLGetFileSystemRepresentation ( mainURL, (Boolean) true, (UInt8*)exe_file, FILENAME_MAX );
+
+ if (ok)
+ {
+ return std::string(exe_file) + "/";
+ }
+ }
+ }
+
+ return "./";
+#elif EFSW_OS == EFSW_OS_LINUX
+ char exe_file[FILENAME_MAX + 1];
+
+ int size;
+
+ size = readlink("/proc/self/exe", exe_file, FILENAME_MAX);
+
+ if (size < 0)
+ {
+ return std::string( "./" );
+ }
+ else
+ {
+ exe_file[size] = '\0';
+ return std::string( dirname( exe_file ) ) + "/";
+ }
+
+#elif EFSW_OS == EFSW_OS_BSD
+ int mib[4];
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PATHNAME;
+ mib[3] = -1;
+ char buf[1024];
+ size_t cb = sizeof(buf);
+ sysctl(mib, 4, buf, &cb, NULL, 0);
+
+ return FileSystem::pathRemoveFileName( std::string( buf ) );
+
+#elif EFSW_OS == EFSW_OS_SOLARIS
+ return FileSystem::pathRemoveFileName( std::string( getexecname() ) );
+
+#elif EFSW_OS == EFSW_OS_HAIKU
+ image_info info;
+ int32 cookie = 0;
+
+ while ( B_OK == get_next_image_info( 0, &cookie, &info ) )
+ {
+ if ( info.type == B_APP_IMAGE )
+ break;
+ }
+
+ return FileSystem::pathRemoveFileName( std::string( info.name ) );
+
+#elif EFSW_OS == EFSW_OS_ANDROID
+ return "/sdcard/";
+
+#else
+ #warning getProcessPath() not implemented on this platform. ( will return "./" )
+ return "./";
+
+#endif
+}
+
+void System::maxFD()
+{
+ static bool maxed = false;
+
+ if ( !maxed )
+ {
+ struct rlimit limit;
+ getrlimit( RLIMIT_NOFILE, &limit );
+ limit.rlim_cur = limit.rlim_max;
+ setrlimit( RLIMIT_NOFILE, &limit );
+
+ getrlimit( RLIMIT_NOFILE, &limit );
+
+ efDEBUG( "File descriptor limit %ld\n", limit.rlim_cur );
+
+ maxed = true;
+ }
+}
+
+Uint64 System::getMaxFD()
+{
+ static rlim_t max_fd = 0;
+
+ if ( max_fd == 0 )
+ {
+ struct rlimit limit;
+ getrlimit( RLIMIT_NOFILE, &limit );
+ max_fd = limit.rlim_cur;
+ }
+
+ return max_fd;
+}
+
+}}
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/posix/SystemImpl.hpp b/dep/efsw/src/efsw/platform/posix/SystemImpl.hpp
new file mode 100644
index 00000000000..34734104467
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/posix/SystemImpl.hpp
@@ -0,0 +1,26 @@
+#ifndef EFSW_SYSTEMIMPLPOSIX_HPP
+#define EFSW_SYSTEMIMPLPOSIX_HPP
+
+#include <efsw/base.hpp>
+
+#if defined( EFSW_PLATFORM_POSIX )
+
+namespace efsw { namespace Platform {
+
+class System
+{
+ public:
+ static void sleep( const unsigned long& ms );
+
+ static std::string getProcessPath();
+
+ static void maxFD();
+
+ static Uint64 getMaxFD();
+};
+
+}}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/posix/ThreadImpl.cpp b/dep/efsw/src/efsw/platform/posix/ThreadImpl.cpp
new file mode 100644
index 00000000000..2d3671db9b8
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/posix/ThreadImpl.cpp
@@ -0,0 +1,68 @@
+#include <efsw/platform/posix/ThreadImpl.hpp>
+#include <efsw/Thread.hpp>
+
+#if defined( EFSW_PLATFORM_POSIX )
+
+#include <cassert>
+#include <iostream>
+#include <efsw/Debug.hpp>
+
+namespace efsw { namespace Platform {
+
+ThreadImpl::ThreadImpl( Thread * owner ) :
+ mIsActive(false)
+{
+ mIsActive = pthread_create( &mThread, NULL, &ThreadImpl::entryPoint, owner ) == 0;
+
+ if ( !mIsActive )
+ {
+ efDEBUG( "Failed to create thread\n" );
+ }
+}
+
+void ThreadImpl::wait()
+{
+ // Wait for the thread to finish, no timeout
+ if ( mIsActive )
+ {
+ assert( pthread_equal( pthread_self(), mThread ) == 0 );
+
+ pthread_join( mThread, NULL );
+
+ mIsActive = false; // Reset the thread state
+ }
+}
+
+void ThreadImpl::terminate()
+{
+ if ( mIsActive )
+ {
+ #if !defined( __ANDROID__ ) && !defined( ANDROID )
+ pthread_cancel( mThread );
+ #else
+ pthread_kill( mThread , SIGUSR1 );
+ #endif
+
+ mIsActive = false;
+ }
+}
+
+void * ThreadImpl::entryPoint( void * userData )
+{
+ // The Thread instance is stored in the user data
+ Thread * owner = static_cast<Thread*>( userData );
+
+ // Tell the thread to handle cancel requests immediatly
+ #ifdef PTHREAD_CANCEL_ASYNCHRONOUS
+ pthread_setcanceltype( PTHREAD_CANCEL_ASYNCHRONOUS, NULL );
+ #endif
+
+ // Forward to the owner
+ owner->run();
+
+ return NULL;
+}
+
+}}
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/posix/ThreadImpl.hpp b/dep/efsw/src/efsw/platform/posix/ThreadImpl.hpp
new file mode 100644
index 00000000000..be6dc1b3e58
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/posix/ThreadImpl.hpp
@@ -0,0 +1,35 @@
+#ifndef EFSW_THREADIMPLPOSIX_HPP
+#define EFSW_THREADIMPLPOSIX_HPP
+
+#include <efsw/base.hpp>
+
+#if defined( EFSW_PLATFORM_POSIX )
+
+#include <pthread.h>
+
+namespace efsw {
+
+class Thread;
+
+namespace Platform {
+
+class ThreadImpl
+{
+ public:
+ ThreadImpl( Thread * owner );
+
+ void wait();
+
+ void terminate();
+ protected:
+ static void * entryPoint( void* userData );
+
+ pthread_t mThread;
+ bool mIsActive;
+};
+
+}}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/win/FileSystemImpl.cpp b/dep/efsw/src/efsw/platform/win/FileSystemImpl.cpp
new file mode 100644
index 00000000000..376a474e662
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/win/FileSystemImpl.cpp
@@ -0,0 +1,89 @@
+#include <efsw/platform/win/FileSystemImpl.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+#ifndef WIN32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+
+#ifndef EFSW_COMPILER_MSVC
+#include <dirent.h>
+#endif
+
+namespace efsw { namespace Platform {
+
+FileInfoMap FileSystem::filesInfoFromPath( const std::string& path )
+{
+ FileInfoMap files;
+
+ String tpath( path );
+
+ if ( tpath[ tpath.size() - 1 ] == '/' || tpath[ tpath.size() - 1 ] == '\\' )
+ {
+ tpath += "*";
+ }
+ else
+ {
+ tpath += "\\*";
+ }
+
+ WIN32_FIND_DATAW findFileData;
+ HANDLE hFind = FindFirstFileW( (LPCWSTR)tpath.toWideString().c_str(), &findFileData );
+
+ if( hFind != INVALID_HANDLE_VALUE )
+ {
+ std::string name( String( findFileData.cFileName ).toUtf8() );
+ std::string fpath( path + name );
+
+ if ( name != "." && name != ".." )
+ {
+ files[ name ] = FileInfo( fpath );
+ }
+
+ while( FindNextFileW( hFind, &findFileData ) )
+ {
+ name = String( findFileData.cFileName ).toUtf8();
+ fpath = path + name;
+
+ if ( name != "." && name != ".." )
+ {
+ files[ name ] = FileInfo( fpath );
+ }
+ }
+
+ FindClose( hFind );
+ }
+
+ return files;
+}
+
+char FileSystem::getOSSlash()
+{
+ return '\\';
+}
+
+bool FileSystem::isDirectory( const std::string& path )
+{
+ return 0 != ( GetFileAttributesW( String( path ).toWideString().c_str() ) & FILE_ATTRIBUTE_DIRECTORY );
+}
+
+bool FileSystem::isRemoteFS( const std::string& directory )
+{
+ if ((directory[0] == '\\' || directory[0] == '/') &&
+ (directory[1] == '\\' || directory[1] == '/'))
+ {
+ return true;
+ }
+
+ if ( directory.size() >= 3 )
+ {
+ return 4 == GetDriveTypeA( directory.substr( 0, 3 ).c_str() );
+ }
+
+ return false;
+}
+
+}}
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/win/FileSystemImpl.hpp b/dep/efsw/src/efsw/platform/win/FileSystemImpl.hpp
new file mode 100644
index 00000000000..597edc4a647
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/win/FileSystemImpl.hpp
@@ -0,0 +1,28 @@
+#ifndef EFSW_FILESYSTEMIMPLWIN_HPP
+#define EFSW_FILESYSTEMIMPLWIN_HPP
+
+#include <efsw/base.hpp>
+#include <efsw/String.hpp>
+#include <efsw/FileInfo.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+namespace efsw { namespace Platform {
+
+class FileSystem
+{
+ public:
+ static FileInfoMap filesInfoFromPath( const std::string& path );
+
+ static char getOSSlash();
+
+ static bool isDirectory( const std::string& path );
+
+ static bool isRemoteFS( const std::string& directory );
+};
+
+}}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/win/MutexImpl.cpp b/dep/efsw/src/efsw/platform/win/MutexImpl.cpp
new file mode 100644
index 00000000000..0c8c36d8b39
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/win/MutexImpl.cpp
@@ -0,0 +1,29 @@
+#include <efsw/platform/win/MutexImpl.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+namespace efsw { namespace Platform {
+
+MutexImpl::MutexImpl()
+{
+ InitializeCriticalSection(&mMutex);
+}
+
+MutexImpl::~MutexImpl()
+{
+ DeleteCriticalSection(&mMutex);
+}
+
+void MutexImpl::lock()
+{
+ EnterCriticalSection(&mMutex);
+}
+
+void MutexImpl::unlock()
+{
+ LeaveCriticalSection(&mMutex);
+}
+
+}}
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/win/MutexImpl.hpp b/dep/efsw/src/efsw/platform/win/MutexImpl.hpp
new file mode 100644
index 00000000000..da1e20c5fa9
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/win/MutexImpl.hpp
@@ -0,0 +1,34 @@
+#ifndef EFSW_MUTEXIMPLWIN_HPP
+#define EFSW_MUTEXIMPLWIN_HPP
+
+#include <efsw/base.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+#ifndef WIN32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+
+namespace efsw { namespace Platform {
+
+class MutexImpl
+{
+ public:
+ MutexImpl();
+
+ ~MutexImpl();
+
+ void lock();
+
+ void unlock();
+ private:
+ CRITICAL_SECTION mMutex;
+};
+
+}}
+
+#endif
+
+#endif
+
diff --git a/dep/efsw/src/efsw/platform/win/SystemImpl.cpp b/dep/efsw/src/efsw/platform/win/SystemImpl.cpp
new file mode 100644
index 00000000000..ddbe1e5c45c
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/win/SystemImpl.cpp
@@ -0,0 +1,50 @@
+#include <efsw/platform/win/SystemImpl.hpp>
+#include <efsw/String.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+#ifndef WIN32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+#include <cstdlib>
+
+namespace efsw { namespace Platform {
+
+void System::sleep( const unsigned long& ms )
+{
+ ::Sleep( ms );
+}
+
+std::string System::getProcessPath()
+{
+ // Get path to executable:
+ WCHAR szDrive[_MAX_DRIVE];
+ WCHAR szDir[_MAX_DIR];
+ WCHAR szFilename[_MAX_DIR];
+ WCHAR szExt[_MAX_DIR];
+ std::wstring dllName( _MAX_DIR, 0 );
+
+ GetModuleFileNameW(0, &dllName[0], _MAX_PATH);
+
+ #ifdef EFSW_COMPILER_MSVC
+ _wsplitpath_s( dllName.c_str(), szDrive, _MAX_DRIVE, szDir, _MAX_DIR, szFilename, _MAX_DIR, szExt, _MAX_DIR );
+ #else
+ _wsplitpath( dllName.c_str(), szDrive, szDir, szFilename, szExt);
+ #endif
+
+ return String( szDrive ).toUtf8() + String( szDir ).toUtf8();
+}
+
+void System::maxFD()
+{
+}
+
+Uint64 System::getMaxFD()
+{ // Number of ReadDirectory per thread
+ return 60;
+}
+
+}}
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/win/SystemImpl.hpp b/dep/efsw/src/efsw/platform/win/SystemImpl.hpp
new file mode 100644
index 00000000000..2f785e3565c
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/win/SystemImpl.hpp
@@ -0,0 +1,26 @@
+#ifndef EFSW_SYSTEMIMPLWIN_HPP
+#define EFSW_SYSTEMIMPLWIN_HPP
+
+#include <efsw/base.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+namespace efsw { namespace Platform {
+
+class System
+{
+ public:
+ static void sleep( const unsigned long& ms );
+
+ static std::string getProcessPath();
+
+ static void maxFD();
+
+ static Uint64 getMaxFD();
+};
+
+}}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/win/ThreadImpl.cpp b/dep/efsw/src/efsw/platform/win/ThreadImpl.cpp
new file mode 100644
index 00000000000..2fa30f30060
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/win/ThreadImpl.cpp
@@ -0,0 +1,56 @@
+#include <efsw/platform/win/ThreadImpl.hpp>
+#include <efsw/Thread.hpp>
+#include <assert.h>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+#include <efsw/Debug.hpp>
+
+namespace efsw { namespace Platform {
+
+ThreadImpl::ThreadImpl( Thread *owner )
+{
+ mThread = reinterpret_cast<HANDLE>( _beginthreadex( NULL, 0, &ThreadImpl::entryPoint, owner, 0, &mThreadId ) );
+
+ if ( !mThread )
+ {
+ efDEBUG( "Failed to create thread\n" );
+ }
+}
+
+void ThreadImpl::wait()
+{
+ // Wait for the thread to finish, no timeout
+ if ( mThread )
+ {
+ assert( mThreadId != GetCurrentThreadId() ); // A thread cannot wait for itself!
+
+ WaitForSingleObject( mThread, INFINITE );
+ }
+}
+
+void ThreadImpl::terminate()
+{
+ if ( mThread )
+ {
+ TerminateThread( mThread, 0 );
+ }
+}
+
+unsigned int __stdcall ThreadImpl::entryPoint( void * userData )
+{
+ // The Thread instance is stored in the user data
+ Thread * owner = static_cast<Thread*>( userData );
+
+ // Forward to the owner
+ owner->run();
+
+ // Optional, but it is cleaner
+ _endthreadex(0);
+
+ return 0;
+}
+
+}}
+
+#endif
diff --git a/dep/efsw/src/efsw/platform/win/ThreadImpl.hpp b/dep/efsw/src/efsw/platform/win/ThreadImpl.hpp
new file mode 100644
index 00000000000..506c659c675
--- /dev/null
+++ b/dep/efsw/src/efsw/platform/win/ThreadImpl.hpp
@@ -0,0 +1,39 @@
+#ifndef EFSW_THREADIMPLWIN_HPP
+#define EFSW_THREADIMPLWIN_HPP
+
+#include <efsw/base.hpp>
+
+#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
+
+#ifndef WIN32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+#include <process.h>
+
+namespace efsw {
+
+class Thread;
+
+namespace Platform {
+
+class ThreadImpl
+{
+ public:
+ ThreadImpl( Thread * owner );
+
+ void wait();
+
+ void terminate();
+ protected:
+ static unsigned int __stdcall entryPoint(void* userData);
+
+ HANDLE mThread;
+ unsigned int mThreadId;
+};
+
+}}
+
+#endif
+
+#endif
diff --git a/dep/efsw/src/efsw/sophist.h b/dep/efsw/src/efsw/sophist.h
new file mode 100644
index 00000000000..3a645040e2f
--- /dev/null
+++ b/dep/efsw/src/efsw/sophist.h
@@ -0,0 +1,147 @@
+/* sophist.h - 0.3 - public domain - Sean Barrett 2010
+** Knowledge drawn from Brian Hook's posh.h and http://predef.sourceforge.net
+** Sophist provides portable types; you typedef/#define them to your own names
+**
+** defines:
+** - SOPHIST_endian - either SOPHIST_little_endian or SOPHIST_big_endian
+** - SOPHIST_has_64 - either 0 or 1; if 0, int64 types aren't defined
+** - SOPHIST_pointer64 - either 0 or 1; if 1, pointer is 64-bit
+**
+** - SOPHIST_intptr, SOPHIST_uintptr - integer same size as pointer
+** - SOPHIST_int8, SOPHIST_uint8, SOPHIST_int16, SOPHIST_uint16
+** - SOPHIST_int32, SOPHIST_uint32, SOPHIST_int64, SOPHIST_uint64
+** - SOPHIST_int64_constant(number) - macros for creating 64-bit
+** - SOPHIST_uint64_constant(number) integer constants
+** - SOPHIST_printf_format64 - string for printf format for int64
+*/
+
+#ifndef __INCLUDE_SOPHIST_H__
+#define __INCLUDE_SOPHIST_H__
+
+#define SOPHIST_compiletime_assert(name,val) \
+ typedef int SOPHIST__assert##name[(val) ? 1 : -1]
+
+/* define a couple synthetic rules to make code more readable */
+#if (defined(__sparc__) || defined(__sparc)) && \
+ (defined(__arch64__) || defined(__sparcv9) || defined(__sparc_v9__))
+ #define SOPHIST_sparc64
+#endif
+
+#if (defined(linux) || defined(__linux__)) && \
+ (defined(__alpha)||defined(__alpha__)||defined(__x86_64__)||defined(_M_X64))
+ #define SOPHIST_linux64
+#endif
+
+/* basic types */
+typedef signed char SOPHIST_int8;
+typedef unsigned char SOPHIST_uint8;
+
+typedef signed short SOPHIST_int16;
+typedef unsigned short SOPHIST_uint16;
+
+#ifdef __palmos__
+ typedef signed long SOPHIST_int32;
+ typedef unsigned long SOPHIST_uint32;
+#else
+ typedef signed int SOPHIST_int32;
+ typedef unsigned int SOPHIST_uint32;
+#endif
+
+#ifndef SOPHIST_NO_64
+ #if defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) \
+ || (defined(__alpha) && defined(__DECC))
+
+ typedef signed __int64 SOPHIST_int64;
+ typedef unsigned __int64 SOPHIST_uint64;
+ #define SOPHIST_has_64 1
+ #define SOPHIST_int64_constant(x) (x##i64)
+ #define SOPHIST_uint64_constant(x) (x##ui64)
+ #define SOPHIST_printf_format64 "I64"
+
+ #elif defined(__LP64__) || defined(__powerpc64__) || defined(SOPHIST_sparc64)
+
+ typedef signed long SOPHIST_int64;
+ typedef unsigned long SOPHIST_uint64;
+
+ #define SOPHIST_has_64 1
+ #define SOPHIST_int64_constant(x) ((SOPHIST_int64) x)
+ #define SOPHIST_uint64_constant(x) ((SOPHIST_uint64) x)
+ #define SOPHIST_printf_format64 "l"
+
+ #elif defined(_LONG_LONG) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) \
+ || defined(__GNUC__) || defined(__MWERKS__) || defined(__APPLE_CC__) \
+ || defined(sgi) || defined (__sgi) || defined(__sgi__) \
+ || defined(_CRAYC)
+
+ typedef signed long long SOPHIST_int64;
+ typedef unsigned long long SOPHIST_uint64;
+
+ #define SOPHIST_has_64 1
+ #define SOPHIST_int64_constant(x) (x##LL)
+ #define SOPHIST_uint64_constant(x) (x##ULL)
+ #define SOPHIST_printf_format64 "ll"
+ #endif
+#endif
+
+#ifndef SOPHIST_has_64
+#define SOPHIST_has_64 0
+#endif
+
+SOPHIST_compiletime_assert( int8 , sizeof(SOPHIST_int8 ) == 1);
+SOPHIST_compiletime_assert(uint16, sizeof(SOPHIST_int16) == 2);
+SOPHIST_compiletime_assert( int32, sizeof(SOPHIST_int32 ) == 4);
+SOPHIST_compiletime_assert(uint32, sizeof(SOPHIST_uint32) == 4);
+
+#if SOPHIST_has_64
+ SOPHIST_compiletime_assert( int64, sizeof(SOPHIST_int64 ) == 8);
+ SOPHIST_compiletime_assert(uint64, sizeof(SOPHIST_uint64) == 8);
+#endif
+
+/* determine whether pointers are 64-bit */
+
+#if defined(SOPHIST_linux64) || defined(SOPHIST_sparc64) \
+ || defined(__osf__) || (defined(_WIN64) && !defined(_XBOX)) \
+ || defined(__64BIT__) \
+ || defined(__LP64) || defined(__LP64__) || defined(_LP64) \
+ || defined(_ADDR64) || defined(_CRAYC) \
+
+ #define SOPHIST_pointer64 1
+
+ SOPHIST_compiletime_assert(pointer64, sizeof(void*) == 8);
+
+ typedef SOPHIST_int64 SOPHIST_intptr;
+ typedef SOPHIST_uint64 SOPHIST_uintptr;
+#else
+
+ #define SOPHIST_pointer64 0
+
+ SOPHIST_compiletime_assert(pointer64, sizeof(void*) <= 4);
+
+ /* do we care about pointers that are only 16-bit? */
+ typedef SOPHIST_int32 SOPHIST_intptr;
+ typedef SOPHIST_uint32 SOPHIST_uintptr;
+
+#endif
+
+SOPHIST_compiletime_assert(intptr, sizeof(SOPHIST_intptr) == sizeof(char *));
+
+/* enumerate known little endian cases; fallback to big-endian */
+
+#define SOPHIST_little_endian 1
+#define SOPHIST_big_endian 2
+
+#if defined(__386__) || defined(i386) || defined(__i386__) \
+ || defined(__X86) || defined(_M_IX86) \
+ || defined(_M_X64) || defined(__x86_64__) \
+ || defined(alpha) || defined(__alpha) || defined(__alpha__) \
+ || defined(_M_ALPHA) \
+ || defined(ARM) || defined(_ARM) || defined(__arm__) \
+ || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
+ || defined(_WIN32_WCE) || defined(__NT__) \
+ || defined(__MIPSEL__)
+ #define SOPHIST_endian SOPHIST_little_endian
+#else
+ #define SOPHIST_endian SOPHIST_big_endian
+#endif
+
+#endif /* __INCLUDE_SOPHIST_H__ */
diff --git a/dep/efsw/src/test/efsw-test.cpp b/dep/efsw/src/test/efsw-test.cpp
new file mode 100644
index 00000000000..a49e3414fcc
--- /dev/null
+++ b/dep/efsw/src/test/efsw-test.cpp
@@ -0,0 +1,151 @@
+#include <efsw/efsw.hpp>
+#include <efsw/System.hpp>
+#include <efsw/FileSystem.hpp>
+#include <signal.h>
+#include <iostream>
+
+bool STOP = false;
+
+void sigend(int signal)
+{
+ std::cout << std::endl << "Bye bye" << std::endl;
+ STOP = true;
+}
+
+/// Processes a file action
+class UpdateListener : public efsw::FileWatchListener
+{
+ public:
+ UpdateListener() {}
+
+ std::string getActionName( efsw::Action action )
+ {
+ switch ( action )
+ {
+ case efsw::Actions::Add: return "Add";
+ case efsw::Actions::Modified: return "Modified";
+ case efsw::Actions::Delete: return "Delete";
+ case efsw::Actions::Moved: return "Moved";
+ default: return "Bad Action";
+ }
+ }
+
+ void handleFileAction( efsw::WatchID watchid, const std::string& dir, const std::string& filename, efsw::Action action, std::string oldFilename = "" )
+ {
+ std::cout << "DIR (" << dir + ") FILE (" + ( oldFilename.empty() ? "" : "from file " + oldFilename + " to " ) + filename + ") has event " << getActionName( action ) << std::endl;
+ }
+};
+
+efsw::WatchID handleWatchID( efsw::WatchID watchid )
+{
+ switch ( watchid )
+ {
+ case efsw::Errors::FileNotFound:
+ case efsw::Errors::FileRepeated:
+ case efsw::Errors::FileOutOfScope:
+ case efsw::Errors::FileRemote:
+ case efsw::Errors::Unspecified:
+ {
+ std::cout << efsw::Errors::Log::getLastErrorLog().c_str() << std::endl;
+ break;
+ }
+ default:
+ {
+ std::cout << "Added WatchID: " << watchid << std::endl;
+ }
+ }
+
+ return watchid;
+}
+
+int main(int argc, char **argv)
+{
+ signal( SIGABRT , sigend );
+ signal( SIGINT , sigend );
+ signal( SIGTERM , sigend );
+
+ std::cout << "Press ^C to exit demo" << std::endl;
+
+ bool commonTest = true;
+ bool useGeneric = false;
+ std::string path;
+
+ if ( argc >= 2 )
+ {
+ path = std::string( argv[1] );
+
+ if ( efsw::FileSystem::isDirectory( path ) )
+ {
+ commonTest = false;
+ }
+
+ if ( argc >= 3 )
+ {
+ if ( std::string( argv[2] ) == "true" )
+ {
+ useGeneric = true;
+ }
+ }
+ }
+
+ UpdateListener * ul = new UpdateListener();
+
+ /// create the file watcher object
+ efsw::FileWatcher fileWatcher( useGeneric );
+
+ fileWatcher.followSymlinks( false );
+ fileWatcher.allowOutOfScopeLinks( false );
+
+ if ( commonTest )
+ {
+ std::string CurPath( efsw::System::getProcessPath() );
+
+ std::cout << "CurPath: " << CurPath.c_str() << std::endl;
+
+ /// add a watch to the system
+ handleWatchID( fileWatcher.addWatch( CurPath + "test", ul, true ) );
+
+ /// starts watching
+ fileWatcher.watch();
+
+ /// adds another watch after started watching...
+ efsw::System::sleep( 100 );
+
+ efsw::WatchID watchID = handleWatchID( fileWatcher.addWatch( CurPath + "test2", ul, true ) );
+
+ /// delete the watch
+ if ( watchID > 0 )
+ {
+ efsw::System::sleep( 1000 );
+ fileWatcher.removeWatch( watchID );
+ }
+ }
+ else
+ {
+ efsw::WatchID err;
+
+ if ( ( err = fileWatcher.addWatch( path, ul, true ) ) > 0 )
+ {
+ fileWatcher.watch();
+
+ std::cout << "Watching directory: " << path.c_str() << std::endl;
+
+ if ( useGeneric )
+ {
+ std::cout << "Using generic backend watcher" << std::endl;
+ }
+ }
+ else
+ {
+ std::cout << "Error trying to watch directory: " << path.c_str() << std::endl;
+ std::cout << efsw::Errors::Log::getLastErrorLog().c_str() << std::endl;
+ }
+ }
+
+ while( !STOP )
+ {
+ efsw::System::sleep( 100 );
+ }
+
+ return 0;
+}
diff --git a/dep/g3dlite/CMakeLists.txt b/dep/g3dlite/CMakeLists.txt
index f1166c72e6d..4e579951d63 100644
--- a/dep/g3dlite/CMakeLists.txt
+++ b/dep/g3dlite/CMakeLists.txt
@@ -8,7 +8,6 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
set(g3dlib_STAT_SRCS
source/AABox.cpp
source/Any.cpp
@@ -55,20 +54,18 @@ set(g3dlib_STAT_SRCS
source/Vector4.cpp
)
-if(WIN32)
- include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${CMAKE_SOURCE_DIR}/dep/zlib
- )
-else()
- include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- )
-endif()
-
add_library(g3dlib STATIC ${g3dlib_STAT_SRCS})
+target_include_directories(g3dlib
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/include)
+
target_link_libraries(g3dlib
- ${ZLIB_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
-)
+ PUBLIC
+ zlib
+ threads)
+
+set_target_properties(g3dlib
+ PROPERTIES
+ FOLDER
+ "dep")
diff --git a/dep/gsoap/CMakeLists.txt b/dep/gsoap/CMakeLists.txt
index b5fed7809af..bdcadf6e4dc 100644
--- a/dep/gsoap/CMakeLists.txt
+++ b/dep/gsoap/CMakeLists.txt
@@ -10,17 +10,22 @@
file(GLOB sources *.cpp *.h)
-set(gsoap_STAT_SRCS
- ${sources}
-)
+add_library(gsoap STATIC ${sources})
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
-)
+set_target_properties(gsoap PROPERTIES LINKER_LANGUAGE CXX)
-# Little fix for MSVC / Windows platforms
-add_definitions(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=0)
+target_include_directories(gsoap
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR})
-add_library(gsoap STATIC ${gsoap_STAT_SRCS})
+set_target_properties(gsoap
+ PROPERTIES
+ FOLDER
+ "dep")
-set_target_properties(gsoap PROPERTIES LINKER_LANGUAGE CXX)
+if (MSVC)
+ # Little fix for MSVC / Windows platforms
+ target_compile_definitions(gsoap
+ PRIVATE
+ -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=0)
+endif()
diff --git a/dep/gsoap/soapC.cpp b/dep/gsoap/soapC.cpp
index 321cae0299b..cc332c4854b 100644
--- a/dep/gsoap/soapC.cpp
+++ b/dep/gsoap/soapC.cpp
@@ -1,11 +1,14 @@
/* soapC.cpp
- Generated by gSOAP 2.8.17r from gsoap.stub
+ Generated by gSOAP 2.8.33 for gsoap.stub
-Copyright(C) 2000-2013, Robert van Engelen, Genivia Inc. All Rights Reserved.
-The generated code is released under one of the following licenses:
-GPL or Genivia's license for commercial use.
+gSOAP XML Web services tools
+Copyright (C) 2000-2016, Robert van Engelen, Genivia Inc. All Rights Reserved.
+The soapcpp2 tool and its generated software are released under the GPL.
This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed.
+--------------------------------------------------------------------------------
+A commercial use license is available from Genivia Inc., contact@genivia.com
+--------------------------------------------------------------------------------
*/
#if defined(__BORLANDC__)
@@ -15,7 +18,7 @@ compiling, linking, and/or using OpenSSL is allowed.
#include "soapH.h"
-SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.8.17r 2014-06-21 21:43:17 GMT")
+SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.8.33 2016-07-29 05:51:35 GMT")
#ifndef WITH_NOGLOBAL
@@ -32,7 +35,7 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_putheader(struct soap *soap)
{
if (soap->version && soap->header)
{ soap->part = SOAP_IN_HEADER;
- if (soap_out_SOAP_ENV__Header(soap, "SOAP-ENV:Header", 0, soap->header, NULL))
+ if (soap_out_SOAP_ENV__Header(soap, "SOAP-ENV:Header", 0, soap->header, ""))
return soap->error;
soap->part = SOAP_END_HEADER;
}
@@ -48,7 +51,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serializeheader(struct soap *soap)
SOAP_FMAC3 void SOAP_FMAC4 soap_header(struct soap *soap)
{
if (soap->header == NULL)
- { if ((soap->header = soap_new_SOAP_ENV__Header(soap, -1)))
+ { if ((soap->header = soap_new_SOAP_ENV__Header(soap)))
soap_default_SOAP_ENV__Header(soap, soap->header);
}
}
@@ -56,17 +59,17 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_header(struct soap *soap)
SOAP_FMAC3 void SOAP_FMAC4 soap_fault(struct soap *soap)
{
if (soap->fault == NULL)
- { soap->fault = soap_new_SOAP_ENV__Fault(soap, -1);
+ { soap->fault = soap_new_SOAP_ENV__Fault(soap);
if (soap->fault == NULL)
return;
soap_default_SOAP_ENV__Fault(soap, soap->fault);
}
if (soap->version == 2 && !soap->fault->SOAP_ENV__Code)
- { soap->fault->SOAP_ENV__Code = soap_new_SOAP_ENV__Code(soap, -1);
+ { soap->fault->SOAP_ENV__Code = soap_new_SOAP_ENV__Code(soap);
soap_default_SOAP_ENV__Code(soap, soap->fault->SOAP_ENV__Code);
}
if (soap->version == 2 && !soap->fault->SOAP_ENV__Reason)
- { soap->fault->SOAP_ENV__Reason = soap_new_SOAP_ENV__Reason(soap, -1);
+ { soap->fault->SOAP_ENV__Reason = soap_new_SOAP_ENV__Reason(soap);
soap_default_SOAP_ENV__Reason(soap, soap->fault->SOAP_ENV__Reason);
}
}
@@ -81,7 +84,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serializefault(struct soap *soap)
SOAP_FMAC3 int SOAP_FMAC4 soap_putfault(struct soap *soap)
{
if (soap->fault)
- return soap_put_SOAP_ENV__Fault(soap, soap->fault, "SOAP-ENV:Fault", NULL);
+ return soap_put_SOAP_ENV__Fault(soap, soap->fault, "SOAP-ENV:Fault", "");
return SOAP_OK;
}
@@ -94,8 +97,8 @@ SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultcode(struct soap *soap)
{
soap_fault(soap);
if (soap->version == 2 && soap->fault->SOAP_ENV__Code)
- return (const char**)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Value;
- return (const char**)&soap->fault->faultcode;
+ return (const char**)(void*)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Value;
+ return (const char**)(void*)&soap->fault->faultcode;
}
SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultsubcode(struct soap *soap)
@@ -103,19 +106,19 @@ SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultsubcode(struct soap *soap)
soap_fault(soap);
if (soap->version == 2)
{ if (soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode == NULL)
- { soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode = soap_new_SOAP_ENV__Code(soap, -1);
+ { soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode = soap_new_SOAP_ENV__Code(soap);
soap_default_SOAP_ENV__Code(soap, soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode);
}
- return (const char**)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value;
+ return (const char**)(void*)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value;
}
- return (const char**)&soap->fault->faultcode;
+ return (const char**)(void*)&soap->fault->faultcode;
}
SOAP_FMAC3 const char * SOAP_FMAC4 soap_check_faultsubcode(struct soap *soap)
{
soap_fault(soap);
if (soap->version == 2)
- { if (soap->fault->SOAP_ENV__Code && soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode && soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode)
+ { if (soap->fault->SOAP_ENV__Code && soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode)
return soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value;
return NULL;
}
@@ -126,8 +129,8 @@ SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultstring(struct soap *soap)
{
soap_fault(soap);
if (soap->version == 2)
- return (const char**)&soap->fault->SOAP_ENV__Reason->SOAP_ENV__Text;
- return (const char**)&soap->fault->faultstring;
+ return (const char**)(void*)&soap->fault->SOAP_ENV__Reason->SOAP_ENV__Text;
+ return (const char**)(void*)&soap->fault->faultstring;
}
SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultdetail(struct soap *soap)
@@ -135,16 +138,16 @@ SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultdetail(struct soap *soap)
soap_fault(soap);
if (soap->version == 2)
{ if (soap->fault->SOAP_ENV__Detail == NULL)
- { soap->fault->SOAP_ENV__Detail = soap_new_SOAP_ENV__Detail(soap, -1);
+ { soap->fault->SOAP_ENV__Detail = soap_new_SOAP_ENV__Detail(soap);
soap_default_SOAP_ENV__Detail(soap, soap->fault->SOAP_ENV__Detail);
}
- return (const char**)&soap->fault->SOAP_ENV__Detail->__any;
+ return (const char**)(void*)&soap->fault->SOAP_ENV__Detail->__any;
}
if (soap->fault->detail == NULL)
- { soap->fault->detail = soap_new_SOAP_ENV__Detail(soap, -1);
+ { soap->fault->detail = soap_new_SOAP_ENV__Detail(soap);
soap_default_SOAP_ENV__Detail(soap, soap->fault->detail);
}
- return (const char**)&soap->fault->detail->__any;
+ return (const char**)(void*)&soap->fault->detail->__any;
}
SOAP_FMAC3 const char * SOAP_FMAC4 soap_check_faultdetail(struct soap *soap)
@@ -166,7 +169,7 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_getindependent(struct soap *soap)
if (soap->version == 1)
{ for (;;)
{ if (!soap_getelement(soap, &t))
- if (soap->error || soap_ignore_element(soap))
+ if ((soap->error && soap->error != SOAP_TAG_MISMATCH) || soap_ignore_element(soap))
break;
}
}
@@ -260,8 +263,8 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_ignore_element(struct soap *soap)
{
if (!soap_peek_element(soap))
{ int t;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unexpected element '%s' in input (level=%u, %d)\n", soap->tag, soap->level, soap->body));
- if (soap->mustUnderstand && !soap->other)
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unexpected element '%s' in input (level = %u, %d)\n", soap->tag, soap->level, soap->body));
+ if (soap->mustUnderstand && !soap->other && !soap->fignore)
return soap->error = SOAP_MUSTUNDERSTAND;
if (((soap->mode & SOAP_XML_STRICT) && soap->part != SOAP_IN_HEADER) || !soap_match_tag(soap, soap->tag, "SOAP-ENV:"))
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "REJECTING element '%s'\n", soap->tag));
@@ -276,10 +279,8 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_ignore_element(struct soap *soap)
DBGLOG(TEST, if (!soap->error) SOAP_MESSAGE(fdebug, "IGNORING element '%s'\n", soap->tag));
if (!soap->error && soap->body)
{ soap->level++;
- while (!soap_ignore_element(soap))
- ;
- if (soap->error == SOAP_NO_TAG)
- soap->error = soap_element_end_in(soap, NULL);
+ if (soap_ignore(soap) || soap_element_end_in(soap, NULL))
+ return soap->error;
}
}
}
@@ -295,7 +296,7 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_putindependent(struct soap *soap)
for (i = 0; i < SOAP_PTRHASH; i++)
for (pp = soap->pht[i]; pp; pp = pp->next)
if (pp->mark1 == 2 || pp->mark2 == 2)
- if (soap_putelement(soap, pp->ptr, "id", pp->id, pp->type))
+ if (soap_putelement(soap, pp->ptr, SOAP_MULTIREFTAG, pp->id, pp->type))
return soap->error;
return SOAP_OK;
}
@@ -319,13 +320,12 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_putelement(struct soap *soap, const void *ptr, co
case SOAP_TYPE_PointerTostring:
return soap_out_PointerTostring(soap, tag, id, (char **const*)ptr, "xsd:string");
case SOAP_TYPE__QName:
- return soap_out_string(soap, tag, id, (char*const*)&ptr, "xsd:QName");
+ return soap_out_string(soap, tag, id, (char*const*)(void*)&ptr, "xsd:QName");
case SOAP_TYPE_string:
- return soap_out_string(soap, tag, id, (char*const*)&ptr, "xsd:string");
+ return soap_out_string(soap, tag, id, (char*const*)(void*)&ptr, "xsd:string");
}
return SOAP_OK;
}
-
#ifdef __cplusplus
}
#endif
@@ -350,14 +350,13 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_markelement(struct soap *soap, const void *ptr,
soap_serialize_PointerTostring(soap, (char **const*)ptr);
break;
case SOAP_TYPE__QName:
- soap_serialize_string(soap, (char*const*)&ptr);
+ soap_serialize_string(soap, (char*const*)(void*)&ptr);
break;
case SOAP_TYPE_string:
- soap_serialize_string(soap, (char*const*)&ptr);
+ soap_serialize_string(soap, (char*const*)(void*)&ptr);
break;
}
}
-
#ifdef __cplusplus
}
#endif
@@ -400,64 +399,139 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_fdelete(struct soap_clist *p)
{
case SOAP_TYPE_ns1__executeCommandResponse:
if (p->size < 0)
- SOAP_DELETE((struct ns1__executeCommandResponse*)p->ptr);
+ SOAP_DELETE(static_cast<struct ns1__executeCommandResponse*>(p->ptr));
else
- SOAP_DELETE_ARRAY((struct ns1__executeCommandResponse*)p->ptr);
+ SOAP_DELETE_ARRAY(static_cast<struct ns1__executeCommandResponse*>(p->ptr));
break;
case SOAP_TYPE_ns1__executeCommand:
if (p->size < 0)
- SOAP_DELETE((struct ns1__executeCommand*)p->ptr);
+ SOAP_DELETE(static_cast<struct ns1__executeCommand*>(p->ptr));
else
- SOAP_DELETE_ARRAY((struct ns1__executeCommand*)p->ptr);
+ SOAP_DELETE_ARRAY(static_cast<struct ns1__executeCommand*>(p->ptr));
break;
#ifndef WITH_NOGLOBAL
case SOAP_TYPE_SOAP_ENV__Header:
if (p->size < 0)
- SOAP_DELETE((struct SOAP_ENV__Header*)p->ptr);
+ SOAP_DELETE(static_cast<struct SOAP_ENV__Header*>(p->ptr));
else
- SOAP_DELETE_ARRAY((struct SOAP_ENV__Header*)p->ptr);
+ SOAP_DELETE_ARRAY(static_cast<struct SOAP_ENV__Header*>(p->ptr));
break;
#endif
#ifndef WITH_NOGLOBAL
case SOAP_TYPE_SOAP_ENV__Code:
if (p->size < 0)
- SOAP_DELETE((struct SOAP_ENV__Code*)p->ptr);
+ SOAP_DELETE(static_cast<struct SOAP_ENV__Code*>(p->ptr));
else
- SOAP_DELETE_ARRAY((struct SOAP_ENV__Code*)p->ptr);
+ SOAP_DELETE_ARRAY(static_cast<struct SOAP_ENV__Code*>(p->ptr));
break;
#endif
#ifndef WITH_NOGLOBAL
case SOAP_TYPE_SOAP_ENV__Detail:
if (p->size < 0)
- SOAP_DELETE((struct SOAP_ENV__Detail*)p->ptr);
+ SOAP_DELETE(static_cast<struct SOAP_ENV__Detail*>(p->ptr));
else
- SOAP_DELETE_ARRAY((struct SOAP_ENV__Detail*)p->ptr);
+ SOAP_DELETE_ARRAY(static_cast<struct SOAP_ENV__Detail*>(p->ptr));
break;
#endif
#ifndef WITH_NOGLOBAL
case SOAP_TYPE_SOAP_ENV__Reason:
if (p->size < 0)
- SOAP_DELETE((struct SOAP_ENV__Reason*)p->ptr);
+ SOAP_DELETE(static_cast<struct SOAP_ENV__Reason*>(p->ptr));
else
- SOAP_DELETE_ARRAY((struct SOAP_ENV__Reason*)p->ptr);
+ SOAP_DELETE_ARRAY(static_cast<struct SOAP_ENV__Reason*>(p->ptr));
break;
#endif
#ifndef WITH_NOGLOBAL
case SOAP_TYPE_SOAP_ENV__Fault:
if (p->size < 0)
- SOAP_DELETE((struct SOAP_ENV__Fault*)p->ptr);
+ SOAP_DELETE(static_cast<struct SOAP_ENV__Fault*>(p->ptr));
else
- SOAP_DELETE_ARRAY((struct SOAP_ENV__Fault*)p->ptr);
+ SOAP_DELETE_ARRAY(static_cast<struct SOAP_ENV__Fault*>(p->ptr));
break;
#endif
- default: return SOAP_ERR;
+ default:
+ return SOAP_ERR;
}
return SOAP_OK;
}
-SOAP_FMAC3 void* SOAP_FMAC4 soap_class_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, const char *type, const char *arrayType)
-{ return soap_id_enter(soap, id, p, t, n, 0, type, arrayType, soap_instantiate);
+#ifdef WIN32
+#pragma warning(push)
+// do not warn on switch w/o cases
+#pragma warning(disable:4065)
+#endif
+SOAP_FMAC3 int SOAP_FMAC4 soap_fbase(int t, int b)
+{
+ do
+ { switch (t)
+ {
+ default: return 0;
+ }
+ }
+ while (t != b);
+ return 1;
+}
+#ifdef WIN32
+#pragma warning(pop)
+#endif
+
+#ifndef WITH_NOIDREF
+#ifdef WIN32
+#pragma warning(push)
+// do not warn on switch w/o cases
+#pragma warning(disable:4065)
+#endif
+SOAP_FMAC3 void SOAP_FMAC4 soap_finsert(struct soap *soap, int t, int tt, void *p, size_t index, const void *q, void **x)
+{
+ (void)soap; (void)t; (void)p; (void)index; (void)q; (void)x; /* appease -Wall -Werror */
+ switch (tt)
+ {
+ case SOAP_TYPE_ns1__executeCommandResponse:
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct ns1__executeCommandResponse type=%d location=%p object=%p\n", t, p, q));
+ *(struct ns1__executeCommandResponse*)p = *(struct ns1__executeCommandResponse*)q;
+ break;
+ case SOAP_TYPE_ns1__executeCommand:
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct ns1__executeCommand type=%d location=%p object=%p\n", t, p, q));
+ *(struct ns1__executeCommand*)p = *(struct ns1__executeCommand*)q;
+ break;
+#ifndef WITH_NOGLOBAL
+ case SOAP_TYPE_SOAP_ENV__Header:
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Header type=%d location=%p object=%p\n", t, p, q));
+ *(struct SOAP_ENV__Header*)p = *(struct SOAP_ENV__Header*)q;
+ break;
+#endif
+#ifndef WITH_NOGLOBAL
+ case SOAP_TYPE_SOAP_ENV__Code:
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Code type=%d location=%p object=%p\n", t, p, q));
+ *(struct SOAP_ENV__Code*)p = *(struct SOAP_ENV__Code*)q;
+ break;
+#endif
+#ifndef WITH_NOGLOBAL
+ case SOAP_TYPE_SOAP_ENV__Detail:
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Detail type=%d location=%p object=%p\n", t, p, q));
+ *(struct SOAP_ENV__Detail*)p = *(struct SOAP_ENV__Detail*)q;
+ break;
+#endif
+#ifndef WITH_NOGLOBAL
+ case SOAP_TYPE_SOAP_ENV__Reason:
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Reason type=%d location=%p object=%p\n", t, p, q));
+ *(struct SOAP_ENV__Reason*)p = *(struct SOAP_ENV__Reason*)q;
+ break;
+#endif
+#ifndef WITH_NOGLOBAL
+ case SOAP_TYPE_SOAP_ENV__Fault:
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Fault type=%d location=%p object=%p\n", t, p, q));
+ *(struct SOAP_ENV__Fault*)p = *(struct SOAP_ENV__Fault*)q;
+ break;
+#endif
+ default:
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not insert type = %d in %d\n", t, tt));
+ }
}
+#ifdef WIN32
+#pragma warning(pop)
+#endif
+#endif
SOAP_FMAC3 void SOAP_FMAC4 soap_default_byte(struct soap *soap, char *a)
{
@@ -470,20 +544,19 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_byte(struct soap *soap, char *a)
}
SOAP_FMAC3 int SOAP_FMAC4 soap_out_byte(struct soap *soap, const char *tag, int id, const char *a, const char *type)
-{ (void)soap; (void)type; (void)tag; (void)id;
+{
return soap_outbyte(soap, tag, id, a, type, SOAP_TYPE_byte);
}
SOAP_FMAC3 char * SOAP_FMAC4 soap_in_byte(struct soap *soap, const char *tag, char *a, const char *type)
-{ char *p;
- p = soap_inbyte(soap, tag, a, type, SOAP_TYPE_byte);
- return p;
+{
+ a = soap_inbyte(soap, tag, a, type, SOAP_TYPE_byte);
+ return a;
}
SOAP_FMAC3 int SOAP_FMAC4 soap_put_byte(struct soap *soap, const char *a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_byte);
- if (soap_out_byte(soap, tag?tag:"byte", id, a, type))
+ if (soap_out_byte(soap, tag?tag:"byte", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -507,20 +580,19 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_int(struct soap *soap, int *a)
}
SOAP_FMAC3 int SOAP_FMAC4 soap_out_int(struct soap *soap, const char *tag, int id, const int *a, const char *type)
-{ (void)soap; (void)type; (void)tag; (void)id;
+{
return soap_outint(soap, tag, id, a, type, SOAP_TYPE_int);
}
SOAP_FMAC3 int * SOAP_FMAC4 soap_in_int(struct soap *soap, const char *tag, int *a, const char *type)
-{ int *p;
- p = soap_inint(soap, tag, a, type, SOAP_TYPE_int);
- return p;
+{
+ a = soap_inint(soap, tag, a, type, SOAP_TYPE_int);
+ return a;
}
SOAP_FMAC3 int SOAP_FMAC4 soap_put_int(struct soap *soap, const int *a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_int);
- if (soap_out_int(soap, tag?tag:"int", id, a, type))
+ if (soap_out_int(soap, tag?tag:"int", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -551,16 +623,16 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap *soap, struc
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Fault(struct soap *soap, const struct SOAP_ENV__Fault *a)
{
-#ifndef WITH_NOIDREF
(void)soap; (void)a; /* appease -Wall -Werror */
- soap_serialize__QName(soap, &a->faultcode);
- soap_serialize_string(soap, &a->faultstring);
- soap_serialize_string(soap, &a->faultactor);
+#ifndef WITH_NOIDREF
+ soap_serialize__QName(soap, (char*const*)&a->faultcode);
+ soap_serialize_string(soap, (char*const*)&a->faultstring);
+ soap_serialize_string(soap, (char*const*)&a->faultactor);
soap_serialize_PointerToSOAP_ENV__Detail(soap, &a->detail);
soap_serialize_PointerToSOAP_ENV__Code(soap, &a->SOAP_ENV__Code);
soap_serialize_PointerToSOAP_ENV__Reason(soap, &a->SOAP_ENV__Reason);
- soap_serialize_string(soap, &a->SOAP_ENV__Node);
- soap_serialize_string(soap, &a->SOAP_ENV__Role);
+ soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Node);
+ soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Role);
soap_serialize_PointerToSOAP_ENV__Detail(soap, &a->SOAP_ENV__Detail);
#endif
}
@@ -568,14 +640,14 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Fault(struct soap *soap, con
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Fault(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Fault *a, const char *type)
{
const char *soap_tmp_faultcode = soap_QName2s(soap, a->faultcode);
- (void)soap; (void)tag; (void)id; (void)type;
+ (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Fault), type))
return soap->error;
- if (soap_out__QName(soap, "faultcode", -1, (char*const*)&soap_tmp_faultcode, ""))
+ if (soap_out__QName(soap, "faultcode", -1, (char*const*)(void*)&soap_tmp_faultcode, ""))
return soap->error;
- if (soap_out_string(soap, "faultstring", -1, &a->faultstring, ""))
+ if (soap_out_string(soap, "faultstring", -1, (char*const*)&a->faultstring, ""))
return soap->error;
- if (soap_out_string(soap, "faultactor", -1, &a->faultactor, ""))
+ if (soap_out_string(soap, "faultactor", -1, (char*const*)&a->faultactor, ""))
return soap->error;
if (soap_out_PointerToSOAP_ENV__Detail(soap, "detail", -1, &a->detail, ""))
return soap->error;
@@ -583,9 +655,9 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Fault(struct soap *soap, const char
return soap->error;
if (soap_out_PointerToSOAP_ENV__Reason(soap, "SOAP-ENV:Reason", -1, &a->SOAP_ENV__Reason, ""))
return soap->error;
- if (soap_out_string(soap, "SOAP-ENV:Node", -1, &a->SOAP_ENV__Node, ""))
+ if (soap_out_string(soap, "SOAP-ENV:Node", -1, (char*const*)&a->SOAP_ENV__Node, ""))
return soap->error;
- if (soap_out_string(soap, "SOAP-ENV:Role", -1, &a->SOAP_ENV__Role, ""))
+ if (soap_out_string(soap, "SOAP-ENV:Role", -1, (char*const*)&a->SOAP_ENV__Role, ""))
return soap->error;
if (soap_out_PointerToSOAP_ENV__Detail(soap, "SOAP-ENV:Detail", -1, &a->SOAP_ENV__Detail, ""))
return soap->error;
@@ -605,7 +677,7 @@ SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct so
size_t soap_flag_SOAP_ENV__Detail = 1;
if (soap_element_begin_in(soap, tag, 0, type))
return NULL;
- a = (struct SOAP_ENV__Fault *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Fault, sizeof(struct SOAP_ENV__Fault), 0, NULL, NULL, NULL);
+ a = (struct SOAP_ENV__Fault *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Fault, sizeof(struct SOAP_ENV__Fault), NULL, NULL, NULL, NULL);
if (!a)
return NULL;
soap_default_SOAP_ENV__Fault(soap, a);
@@ -614,17 +686,17 @@ SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct so
for (;;)
{ soap->error = SOAP_TAG_MISMATCH;
if (soap_flag_faultcode && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
- if (soap_in__QName(soap, "faultcode", &a->faultcode, ""))
+ if (soap_in__QName(soap, "faultcode", (char**)&a->faultcode, "xsd:QName"))
{ soap_flag_faultcode--;
continue;
}
if (soap_flag_faultstring && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
- if (soap_in_string(soap, "faultstring", &a->faultstring, "xsd:string"))
+ if (soap_in_string(soap, "faultstring", (char**)&a->faultstring, "xsd:string"))
{ soap_flag_faultstring--;
continue;
}
if (soap_flag_faultactor && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
- if (soap_in_string(soap, "faultactor", &a->faultactor, "xsd:string"))
+ if (soap_in_string(soap, "faultactor", (char**)&a->faultactor, "xsd:string"))
{ soap_flag_faultactor--;
continue;
}
@@ -644,12 +716,12 @@ SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct so
continue;
}
if (soap_flag_SOAP_ENV__Node && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
- if (soap_in_string(soap, "SOAP-ENV:Node", &a->SOAP_ENV__Node, "xsd:string"))
+ if (soap_in_string(soap, "SOAP-ENV:Node", (char**)&a->SOAP_ENV__Node, "xsd:string"))
{ soap_flag_SOAP_ENV__Node--;
continue;
}
if (soap_flag_SOAP_ENV__Role && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
- if (soap_in_string(soap, "SOAP-ENV:Role", &a->SOAP_ENV__Role, "xsd:string"))
+ if (soap_in_string(soap, "SOAP-ENV:Role", (char**)&a->SOAP_ENV__Role, "xsd:string"))
{ soap_flag_SOAP_ENV__Role--;
continue;
}
@@ -669,17 +741,36 @@ SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct so
return NULL;
}
else
- { a = (struct SOAP_ENV__Fault *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Fault, 0, sizeof(struct SOAP_ENV__Fault), 0, NULL);
+ { a = (struct SOAP_ENV__Fault *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Fault, SOAP_TYPE_SOAP_ENV__Fault, sizeof(struct SOAP_ENV__Fault), 0, soap_finsert, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
return a;
}
+SOAP_FMAC1 struct SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
+{
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Fault(%p, %d, %s, %s)\n", soap, n, type?type:"", arrayType?arrayType:""));
+ (void)type; (void)arrayType; /* appease -Wall -Werror */
+ struct SOAP_ENV__Fault *p;
+ size_t k = sizeof(struct SOAP_ENV__Fault);
+ if (n < 0)
+ { p = SOAP_NEW(struct SOAP_ENV__Fault);
+ }
+ else
+ { p = SOAP_NEW_ARRAY(struct SOAP_ENV__Fault, n);
+ k *= n;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Fault location=%p n=%d\n", p, n));
+ soap_link(soap, p, SOAP_TYPE_SOAP_ENV__Fault, n, soap_fdelete);
+ if (size)
+ *size = k;
+ return p;
+}
+
SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Fault(struct soap *soap, const struct SOAP_ENV__Fault *a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_SOAP_ENV__Fault);
- if (soap_out_SOAP_ENV__Fault(soap, tag?tag:"SOAP-ENV:Fault", id, a, type))
+ if (soap_out_SOAP_ENV__Fault(soap, tag?tag:"SOAP-ENV:Fault", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -692,36 +783,6 @@ SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_get_SOAP_ENV__Fault(struct s
return p;
}
-SOAP_FMAC1 struct SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
-{
- (void)type; (void)arrayType; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Fault(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:""));
- struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_SOAP_ENV__Fault, n, soap_fdelete);
- if (!cp)
- return NULL;
- if (n < 0)
- { cp->ptr = (void*)SOAP_NEW(struct SOAP_ENV__Fault);
- if (size)
- *size = sizeof(struct SOAP_ENV__Fault);
- }
- else
- { cp->ptr = (void*)SOAP_NEW_ARRAY(struct SOAP_ENV__Fault, n);
- if (size)
- *size = n * sizeof(struct SOAP_ENV__Fault);
- }
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr));
- if (!cp->ptr)
- soap->error = SOAP_EOM;
- return (struct SOAP_ENV__Fault*)cp->ptr;
-}
-
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Fault(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
-{
- (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct SOAP_ENV__Fault %p -> %p\n", q, p));
- *(struct SOAP_ENV__Fault*)p = *(struct SOAP_ENV__Fault*)q;
-}
-
#endif
#ifndef WITH_NOGLOBAL
@@ -734,20 +795,20 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap *soap, stru
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Reason(struct soap *soap, const struct SOAP_ENV__Reason *a)
{
-#ifndef WITH_NOIDREF
(void)soap; (void)a; /* appease -Wall -Werror */
- soap_serialize_string(soap, &a->SOAP_ENV__Text);
+#ifndef WITH_NOIDREF
+ soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Text);
#endif
}
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Reason(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Reason *a, const char *type)
{
- (void)soap; (void)tag; (void)id; (void)type;
+ (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Reason), type))
return soap->error;
if (soap->lang)
soap_set_attr(soap, "xml:lang", soap->lang, 1);
- if (soap_out_string(soap, "SOAP-ENV:Text", -1, &a->SOAP_ENV__Text, ""))
+ if (soap_out_string(soap, "SOAP-ENV:Text", -1, (char*const*)&a->SOAP_ENV__Text, ""))
return soap->error;
return soap_element_end_out(soap, tag);
}
@@ -757,7 +818,7 @@ SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_in_SOAP_ENV__Reason(struct
size_t soap_flag_SOAP_ENV__Text = 1;
if (soap_element_begin_in(soap, tag, 0, type))
return NULL;
- a = (struct SOAP_ENV__Reason *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), 0, NULL, NULL, NULL);
+ a = (struct SOAP_ENV__Reason *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), NULL, NULL, NULL, NULL);
if (!a)
return NULL;
soap_default_SOAP_ENV__Reason(soap, a);
@@ -766,7 +827,7 @@ SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_in_SOAP_ENV__Reason(struct
for (;;)
{ soap->error = SOAP_TAG_MISMATCH;
if (soap_flag_SOAP_ENV__Text && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
- if (soap_in_string(soap, "SOAP-ENV:Text", &a->SOAP_ENV__Text, "xsd:string"))
+ if (soap_in_string(soap, "SOAP-ENV:Text", (char**)&a->SOAP_ENV__Text, "xsd:string"))
{ soap_flag_SOAP_ENV__Text--;
continue;
}
@@ -781,17 +842,36 @@ SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_in_SOAP_ENV__Reason(struct
return NULL;
}
else
- { a = (struct SOAP_ENV__Reason *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Reason, 0, sizeof(struct SOAP_ENV__Reason), 0, NULL);
+ { a = (struct SOAP_ENV__Reason *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Reason, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), 0, soap_finsert, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
return a;
}
+SOAP_FMAC1 struct SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reason(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
+{
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Reason(%p, %d, %s, %s)\n", soap, n, type?type:"", arrayType?arrayType:""));
+ (void)type; (void)arrayType; /* appease -Wall -Werror */
+ struct SOAP_ENV__Reason *p;
+ size_t k = sizeof(struct SOAP_ENV__Reason);
+ if (n < 0)
+ { p = SOAP_NEW(struct SOAP_ENV__Reason);
+ }
+ else
+ { p = SOAP_NEW_ARRAY(struct SOAP_ENV__Reason, n);
+ k *= n;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Reason location=%p n=%d\n", p, n));
+ soap_link(soap, p, SOAP_TYPE_SOAP_ENV__Reason, n, soap_fdelete);
+ if (size)
+ *size = k;
+ return p;
+}
+
SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Reason(struct soap *soap, const struct SOAP_ENV__Reason *a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_SOAP_ENV__Reason);
- if (soap_out_SOAP_ENV__Reason(soap, tag?tag:"SOAP-ENV:Reason", id, a, type))
+ if (soap_out_SOAP_ENV__Reason(soap, tag?tag:"SOAP-ENV:Reason", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -804,36 +884,6 @@ SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_get_SOAP_ENV__Reason(struct
return p;
}
-SOAP_FMAC1 struct SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reason(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
-{
- (void)type; (void)arrayType; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Reason(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:""));
- struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_SOAP_ENV__Reason, n, soap_fdelete);
- if (!cp)
- return NULL;
- if (n < 0)
- { cp->ptr = (void*)SOAP_NEW(struct SOAP_ENV__Reason);
- if (size)
- *size = sizeof(struct SOAP_ENV__Reason);
- }
- else
- { cp->ptr = (void*)SOAP_NEW_ARRAY(struct SOAP_ENV__Reason, n);
- if (size)
- *size = n * sizeof(struct SOAP_ENV__Reason);
- }
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr));
- if (!cp->ptr)
- soap->error = SOAP_EOM;
- return (struct SOAP_ENV__Reason*)cp->ptr;
-}
-
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Reason(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
-{
- (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct SOAP_ENV__Reason %p -> %p\n", q, p));
- *(struct SOAP_ENV__Reason*)p = *(struct SOAP_ENV__Reason*)q;
-}
-
#endif
#ifndef WITH_NOGLOBAL
@@ -848,18 +898,18 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap *soap, stru
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Detail(struct soap *soap, const struct SOAP_ENV__Detail *a)
{
-#ifndef WITH_NOIDREF
(void)soap; (void)a; /* appease -Wall -Werror */
+#ifndef WITH_NOIDREF
soap_markelement(soap, a->fault, a->__type);
#endif
}
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Detail(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Detail *a, const char *type)
{
- (void)soap; (void)tag; (void)id; (void)type;
+ (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Detail), type))
return soap->error;
- soap_outliteral(soap, "-any", &a->__any, NULL);
+ soap_outliteral(soap, "-any", (char*const*)&a->__any, NULL);
if (soap_putelement(soap, a->fault, "fault", -1, a->__type))
return soap->error;
return soap_element_end_out(soap, tag);
@@ -871,7 +921,7 @@ SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_in_SOAP_ENV__Detail(struct
size_t soap_flag_fault = 1;
if (soap_element_begin_in(soap, tag, 0, type))
return NULL;
- a = (struct SOAP_ENV__Detail *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), 0, NULL, NULL, NULL);
+ a = (struct SOAP_ENV__Detail *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), NULL, NULL, NULL, NULL);
if (!a)
return NULL;
soap_default_SOAP_ENV__Detail(soap, a);
@@ -885,7 +935,7 @@ SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_in_SOAP_ENV__Detail(struct
continue;
}
if (soap_flag___any && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
- if (soap_inliteral(soap, "-any", &a->__any))
+ if (soap_inliteral(soap, "-any", (char**)&a->__any))
{ soap_flag___any--;
continue;
}
@@ -900,17 +950,36 @@ SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_in_SOAP_ENV__Detail(struct
return NULL;
}
else
- { a = (struct SOAP_ENV__Detail *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Detail, 0, sizeof(struct SOAP_ENV__Detail), 0, NULL);
+ { a = (struct SOAP_ENV__Detail *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Detail, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), 0, soap_finsert, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
return a;
}
+SOAP_FMAC1 struct SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detail(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
+{
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Detail(%p, %d, %s, %s)\n", soap, n, type?type:"", arrayType?arrayType:""));
+ (void)type; (void)arrayType; /* appease -Wall -Werror */
+ struct SOAP_ENV__Detail *p;
+ size_t k = sizeof(struct SOAP_ENV__Detail);
+ if (n < 0)
+ { p = SOAP_NEW(struct SOAP_ENV__Detail);
+ }
+ else
+ { p = SOAP_NEW_ARRAY(struct SOAP_ENV__Detail, n);
+ k *= n;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Detail location=%p n=%d\n", p, n));
+ soap_link(soap, p, SOAP_TYPE_SOAP_ENV__Detail, n, soap_fdelete);
+ if (size)
+ *size = k;
+ return p;
+}
+
SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Detail(struct soap *soap, const struct SOAP_ENV__Detail *a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_SOAP_ENV__Detail);
- if (soap_out_SOAP_ENV__Detail(soap, tag?tag:"SOAP-ENV:Detail", id, a, type))
+ if (soap_out_SOAP_ENV__Detail(soap, tag?tag:"SOAP-ENV:Detail", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -923,36 +992,6 @@ SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_get_SOAP_ENV__Detail(struct
return p;
}
-SOAP_FMAC1 struct SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detail(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
-{
- (void)type; (void)arrayType; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Detail(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:""));
- struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_SOAP_ENV__Detail, n, soap_fdelete);
- if (!cp)
- return NULL;
- if (n < 0)
- { cp->ptr = (void*)SOAP_NEW(struct SOAP_ENV__Detail);
- if (size)
- *size = sizeof(struct SOAP_ENV__Detail);
- }
- else
- { cp->ptr = (void*)SOAP_NEW_ARRAY(struct SOAP_ENV__Detail, n);
- if (size)
- *size = n * sizeof(struct SOAP_ENV__Detail);
- }
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr));
- if (!cp->ptr)
- soap->error = SOAP_EOM;
- return (struct SOAP_ENV__Detail*)cp->ptr;
-}
-
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Detail(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
-{
- (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct SOAP_ENV__Detail %p -> %p\n", q, p));
- *(struct SOAP_ENV__Detail*)p = *(struct SOAP_ENV__Detail*)q;
-}
-
#endif
#ifndef WITH_NOGLOBAL
@@ -966,9 +1005,9 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap *soap, struct
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Code(struct soap *soap, const struct SOAP_ENV__Code *a)
{
-#ifndef WITH_NOIDREF
(void)soap; (void)a; /* appease -Wall -Werror */
- soap_serialize__QName(soap, &a->SOAP_ENV__Value);
+#ifndef WITH_NOIDREF
+ soap_serialize__QName(soap, (char*const*)&a->SOAP_ENV__Value);
soap_serialize_PointerToSOAP_ENV__Code(soap, &a->SOAP_ENV__Subcode);
#endif
}
@@ -976,10 +1015,10 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Code(struct soap *soap, cons
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Code(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Code *a, const char *type)
{
const char *soap_tmp_SOAP_ENV__Value = soap_QName2s(soap, a->SOAP_ENV__Value);
- (void)soap; (void)tag; (void)id; (void)type;
+ (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Code), type))
return soap->error;
- if (soap_out__QName(soap, "SOAP-ENV:Value", -1, (char*const*)&soap_tmp_SOAP_ENV__Value, ""))
+ if (soap_out__QName(soap, "SOAP-ENV:Value", -1, (char*const*)(void*)&soap_tmp_SOAP_ENV__Value, ""))
return soap->error;
if (soap_out_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Subcode", -1, &a->SOAP_ENV__Subcode, ""))
return soap->error;
@@ -992,7 +1031,7 @@ SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_in_SOAP_ENV__Code(struct soap
size_t soap_flag_SOAP_ENV__Subcode = 1;
if (soap_element_begin_in(soap, tag, 0, type))
return NULL;
- a = (struct SOAP_ENV__Code *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), 0, NULL, NULL, NULL);
+ a = (struct SOAP_ENV__Code *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), NULL, NULL, NULL, NULL);
if (!a)
return NULL;
soap_default_SOAP_ENV__Code(soap, a);
@@ -1001,7 +1040,7 @@ SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_in_SOAP_ENV__Code(struct soap
for (;;)
{ soap->error = SOAP_TAG_MISMATCH;
if (soap_flag_SOAP_ENV__Value && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
- if (soap_in__QName(soap, "SOAP-ENV:Value", &a->SOAP_ENV__Value, ""))
+ if (soap_in__QName(soap, "SOAP-ENV:Value", (char**)&a->SOAP_ENV__Value, "xsd:QName"))
{ soap_flag_SOAP_ENV__Value--;
continue;
}
@@ -1021,17 +1060,36 @@ SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_in_SOAP_ENV__Code(struct soap
return NULL;
}
else
- { a = (struct SOAP_ENV__Code *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Code, 0, sizeof(struct SOAP_ENV__Code), 0, NULL);
+ { a = (struct SOAP_ENV__Code *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Code, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), 0, soap_finsert, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
return a;
}
+SOAP_FMAC1 struct SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
+{
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Code(%p, %d, %s, %s)\n", soap, n, type?type:"", arrayType?arrayType:""));
+ (void)type; (void)arrayType; /* appease -Wall -Werror */
+ struct SOAP_ENV__Code *p;
+ size_t k = sizeof(struct SOAP_ENV__Code);
+ if (n < 0)
+ { p = SOAP_NEW(struct SOAP_ENV__Code);
+ }
+ else
+ { p = SOAP_NEW_ARRAY(struct SOAP_ENV__Code, n);
+ k *= n;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Code location=%p n=%d\n", p, n));
+ soap_link(soap, p, SOAP_TYPE_SOAP_ENV__Code, n, soap_fdelete);
+ if (size)
+ *size = k;
+ return p;
+}
+
SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Code(struct soap *soap, const struct SOAP_ENV__Code *a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_SOAP_ENV__Code);
- if (soap_out_SOAP_ENV__Code(soap, tag?tag:"SOAP-ENV:Code", id, a, type))
+ if (soap_out_SOAP_ENV__Code(soap, tag?tag:"SOAP-ENV:Code", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -1044,36 +1102,6 @@ SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_get_SOAP_ENV__Code(struct soa
return p;
}
-SOAP_FMAC1 struct SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
-{
- (void)type; (void)arrayType; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Code(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:""));
- struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_SOAP_ENV__Code, n, soap_fdelete);
- if (!cp)
- return NULL;
- if (n < 0)
- { cp->ptr = (void*)SOAP_NEW(struct SOAP_ENV__Code);
- if (size)
- *size = sizeof(struct SOAP_ENV__Code);
- }
- else
- { cp->ptr = (void*)SOAP_NEW_ARRAY(struct SOAP_ENV__Code, n);
- if (size)
- *size = n * sizeof(struct SOAP_ENV__Code);
- }
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr));
- if (!cp->ptr)
- soap->error = SOAP_EOM;
- return (struct SOAP_ENV__Code*)cp->ptr;
-}
-
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Code(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
-{
- (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct SOAP_ENV__Code %p -> %p\n", q, p));
- *(struct SOAP_ENV__Code*)p = *(struct SOAP_ENV__Code*)q;
-}
-
#endif
#ifndef WITH_NOGLOBAL
@@ -1085,14 +1113,14 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap *soap, stru
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Header(struct soap *soap, const struct SOAP_ENV__Header *a)
{
-#ifndef WITH_NOIDREF
(void)soap; (void)a; /* appease -Wall -Werror */
+#ifndef WITH_NOIDREF
#endif
}
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Header *a, const char *type)
{
- (void)soap; (void)tag; (void)id; (void)type;
+ (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Header), type))
return soap->error;
return soap_element_end_out(soap, tag);
@@ -1102,7 +1130,7 @@ SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_in_SOAP_ENV__Header(struct
{
if (soap_element_begin_in(soap, tag, 0, type))
return NULL;
- a = (struct SOAP_ENV__Header *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Header, sizeof(struct SOAP_ENV__Header), 0, NULL, NULL, NULL);
+ a = (struct SOAP_ENV__Header *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Header, sizeof(struct SOAP_ENV__Header), NULL, NULL, NULL, NULL);
if (!a)
return NULL;
soap_default_SOAP_ENV__Header(soap, a);
@@ -1121,17 +1149,36 @@ SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_in_SOAP_ENV__Header(struct
return NULL;
}
else
- { a = (struct SOAP_ENV__Header *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Header, 0, sizeof(struct SOAP_ENV__Header), 0, NULL);
+ { a = (struct SOAP_ENV__Header *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Header, SOAP_TYPE_SOAP_ENV__Header, sizeof(struct SOAP_ENV__Header), 0, soap_finsert, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
return a;
}
+SOAP_FMAC1 struct SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Header(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
+{
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Header(%p, %d, %s, %s)\n", soap, n, type?type:"", arrayType?arrayType:""));
+ (void)type; (void)arrayType; /* appease -Wall -Werror */
+ struct SOAP_ENV__Header *p;
+ size_t k = sizeof(struct SOAP_ENV__Header);
+ if (n < 0)
+ { p = SOAP_NEW(struct SOAP_ENV__Header);
+ }
+ else
+ { p = SOAP_NEW_ARRAY(struct SOAP_ENV__Header, n);
+ k *= n;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Header location=%p n=%d\n", p, n));
+ soap_link(soap, p, SOAP_TYPE_SOAP_ENV__Header, n, soap_fdelete);
+ if (size)
+ *size = k;
+ return p;
+}
+
SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Header(struct soap *soap, const struct SOAP_ENV__Header *a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_SOAP_ENV__Header);
- if (soap_out_SOAP_ENV__Header(soap, tag?tag:"SOAP-ENV:Header", id, a, type))
+ if (soap_out_SOAP_ENV__Header(soap, tag?tag:"SOAP-ENV:Header", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -1144,36 +1191,6 @@ SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_get_SOAP_ENV__Header(struct
return p;
}
-SOAP_FMAC1 struct SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Header(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
-{
- (void)type; (void)arrayType; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Header(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:""));
- struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_SOAP_ENV__Header, n, soap_fdelete);
- if (!cp)
- return NULL;
- if (n < 0)
- { cp->ptr = (void*)SOAP_NEW(struct SOAP_ENV__Header);
- if (size)
- *size = sizeof(struct SOAP_ENV__Header);
- }
- else
- { cp->ptr = (void*)SOAP_NEW_ARRAY(struct SOAP_ENV__Header, n);
- if (size)
- *size = n * sizeof(struct SOAP_ENV__Header);
- }
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr));
- if (!cp->ptr)
- soap->error = SOAP_EOM;
- return (struct SOAP_ENV__Header*)cp->ptr;
-}
-
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Header(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
-{
- (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct SOAP_ENV__Header %p -> %p\n", q, p));
- *(struct SOAP_ENV__Header*)p = *(struct SOAP_ENV__Header*)q;
-}
-
#endif
SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__executeCommand(struct soap *soap, struct ns1__executeCommand *a)
@@ -1184,18 +1201,18 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__executeCommand(struct soap *soap, s
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__executeCommand(struct soap *soap, const struct ns1__executeCommand *a)
{
-#ifndef WITH_NOIDREF
(void)soap; (void)a; /* appease -Wall -Werror */
- soap_serialize_string(soap, &a->command);
+#ifndef WITH_NOIDREF
+ soap_serialize_string(soap, (char*const*)&a->command);
#endif
}
SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__executeCommand(struct soap *soap, const char *tag, int id, const struct ns1__executeCommand *a, const char *type)
{
- (void)soap; (void)tag; (void)id; (void)type;
+ (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__executeCommand), type))
return soap->error;
- if (soap_out_string(soap, "command", -1, &a->command, ""))
+ if (soap_out_string(soap, "command", -1, (char*const*)&a->command, ""))
return soap->error;
return soap_element_end_out(soap, tag);
}
@@ -1205,7 +1222,7 @@ SOAP_FMAC3 struct ns1__executeCommand * SOAP_FMAC4 soap_in_ns1__executeCommand(s
size_t soap_flag_command = 1;
if (soap_element_begin_in(soap, tag, 0, type))
return NULL;
- a = (struct ns1__executeCommand *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__executeCommand, sizeof(struct ns1__executeCommand), 0, NULL, NULL, NULL);
+ a = (struct ns1__executeCommand *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__executeCommand, sizeof(struct ns1__executeCommand), NULL, NULL, NULL, NULL);
if (!a)
return NULL;
soap_default_ns1__executeCommand(soap, a);
@@ -1214,7 +1231,7 @@ SOAP_FMAC3 struct ns1__executeCommand * SOAP_FMAC4 soap_in_ns1__executeCommand(s
for (;;)
{ soap->error = SOAP_TAG_MISMATCH;
if (soap_flag_command && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG))
- if (soap_in_string(soap, "command", &a->command, "xsd:string"))
+ if (soap_in_string(soap, "command", (char**)&a->command, "xsd:string"))
{ soap_flag_command--;
continue;
}
@@ -1229,17 +1246,36 @@ SOAP_FMAC3 struct ns1__executeCommand * SOAP_FMAC4 soap_in_ns1__executeCommand(s
return NULL;
}
else
- { a = (struct ns1__executeCommand *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__executeCommand, 0, sizeof(struct ns1__executeCommand), 0, NULL);
+ { a = (struct ns1__executeCommand *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__executeCommand, SOAP_TYPE_ns1__executeCommand, sizeof(struct ns1__executeCommand), 0, soap_finsert, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
return a;
}
+SOAP_FMAC1 struct ns1__executeCommand * SOAP_FMAC2 soap_instantiate_ns1__executeCommand(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
+{
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__executeCommand(%p, %d, %s, %s)\n", soap, n, type?type:"", arrayType?arrayType:""));
+ (void)type; (void)arrayType; /* appease -Wall -Werror */
+ struct ns1__executeCommand *p;
+ size_t k = sizeof(struct ns1__executeCommand);
+ if (n < 0)
+ { p = SOAP_NEW(struct ns1__executeCommand);
+ }
+ else
+ { p = SOAP_NEW_ARRAY(struct ns1__executeCommand, n);
+ k *= n;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct ns1__executeCommand location=%p n=%d\n", p, n));
+ soap_link(soap, p, SOAP_TYPE_ns1__executeCommand, n, soap_fdelete);
+ if (size)
+ *size = k;
+ return p;
+}
+
SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__executeCommand(struct soap *soap, const struct ns1__executeCommand *a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns1__executeCommand);
- if (soap_out_ns1__executeCommand(soap, tag?tag:"ns1:executeCommand", id, a, type))
+ if (soap_out_ns1__executeCommand(soap, tag?tag:"ns1:executeCommand", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -1252,36 +1288,6 @@ SOAP_FMAC3 struct ns1__executeCommand * SOAP_FMAC4 soap_get_ns1__executeCommand(
return p;
}
-SOAP_FMAC1 struct ns1__executeCommand * SOAP_FMAC2 soap_instantiate_ns1__executeCommand(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
-{
- (void)type; (void)arrayType; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__executeCommand(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:""));
- struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_ns1__executeCommand, n, soap_fdelete);
- if (!cp)
- return NULL;
- if (n < 0)
- { cp->ptr = (void*)SOAP_NEW(struct ns1__executeCommand);
- if (size)
- *size = sizeof(struct ns1__executeCommand);
- }
- else
- { cp->ptr = (void*)SOAP_NEW_ARRAY(struct ns1__executeCommand, n);
- if (size)
- *size = n * sizeof(struct ns1__executeCommand);
- }
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr));
- if (!cp->ptr)
- soap->error = SOAP_EOM;
- return (struct ns1__executeCommand*)cp->ptr;
-}
-
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns1__executeCommand(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
-{
- (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct ns1__executeCommand %p -> %p\n", q, p));
- *(struct ns1__executeCommand*)p = *(struct ns1__executeCommand*)q;
-}
-
SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__executeCommandResponse(struct soap *soap, struct ns1__executeCommandResponse *a)
{
(void)soap; (void)a; /* appease -Wall -Werror */
@@ -1290,15 +1296,15 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__executeCommandResponse(struct soap
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__executeCommandResponse(struct soap *soap, const struct ns1__executeCommandResponse *a)
{
-#ifndef WITH_NOIDREF
(void)soap; (void)a; /* appease -Wall -Werror */
+#ifndef WITH_NOIDREF
soap_serialize_PointerTostring(soap, &a->result);
#endif
}
SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__executeCommandResponse(struct soap *soap, const char *tag, int id, const struct ns1__executeCommandResponse *a, const char *type)
{
- (void)soap; (void)tag; (void)id; (void)type;
+ (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__executeCommandResponse), type))
return soap->error;
if (soap_out_PointerTostring(soap, "result", -1, &a->result, ""))
@@ -1311,7 +1317,7 @@ SOAP_FMAC3 struct ns1__executeCommandResponse * SOAP_FMAC4 soap_in_ns1__executeC
size_t soap_flag_result = 1;
if (soap_element_begin_in(soap, tag, 0, type))
return NULL;
- a = (struct ns1__executeCommandResponse *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__executeCommandResponse, sizeof(struct ns1__executeCommandResponse), 0, NULL, NULL, NULL);
+ a = (struct ns1__executeCommandResponse *)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__executeCommandResponse, sizeof(struct ns1__executeCommandResponse), NULL, NULL, NULL, NULL);
if (!a)
return NULL;
soap_default_ns1__executeCommandResponse(soap, a);
@@ -1335,17 +1341,36 @@ SOAP_FMAC3 struct ns1__executeCommandResponse * SOAP_FMAC4 soap_in_ns1__executeC
return NULL;
}
else
- { a = (struct ns1__executeCommandResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__executeCommandResponse, 0, sizeof(struct ns1__executeCommandResponse), 0, NULL);
+ { a = (struct ns1__executeCommandResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__executeCommandResponse, SOAP_TYPE_ns1__executeCommandResponse, sizeof(struct ns1__executeCommandResponse), 0, soap_finsert, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
return a;
}
+SOAP_FMAC1 struct ns1__executeCommandResponse * SOAP_FMAC2 soap_instantiate_ns1__executeCommandResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
+{
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__executeCommandResponse(%p, %d, %s, %s)\n", soap, n, type?type:"", arrayType?arrayType:""));
+ (void)type; (void)arrayType; /* appease -Wall -Werror */
+ struct ns1__executeCommandResponse *p;
+ size_t k = sizeof(struct ns1__executeCommandResponse);
+ if (n < 0)
+ { p = SOAP_NEW(struct ns1__executeCommandResponse);
+ }
+ else
+ { p = SOAP_NEW_ARRAY(struct ns1__executeCommandResponse, n);
+ k *= n;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct ns1__executeCommandResponse location=%p n=%d\n", p, n));
+ soap_link(soap, p, SOAP_TYPE_ns1__executeCommandResponse, n, soap_fdelete);
+ if (size)
+ *size = k;
+ return p;
+}
+
SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__executeCommandResponse(struct soap *soap, const struct ns1__executeCommandResponse *a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_ns1__executeCommandResponse);
- if (soap_out_ns1__executeCommandResponse(soap, tag?tag:"ns1:executeCommandResponse", id, a, type))
+ if (soap_out_ns1__executeCommandResponse(soap, tag?tag:"ns1:executeCommandResponse", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -1358,40 +1383,11 @@ SOAP_FMAC3 struct ns1__executeCommandResponse * SOAP_FMAC4 soap_get_ns1__execute
return p;
}
-SOAP_FMAC1 struct ns1__executeCommandResponse * SOAP_FMAC2 soap_instantiate_ns1__executeCommandResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size)
-{
- (void)type; (void)arrayType; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__executeCommandResponse(%d, %s, %s)\n", n, type?type:"", arrayType?arrayType:""));
- struct soap_clist *cp = soap_link(soap, NULL, SOAP_TYPE_ns1__executeCommandResponse, n, soap_fdelete);
- if (!cp)
- return NULL;
- if (n < 0)
- { cp->ptr = (void*)SOAP_NEW(struct ns1__executeCommandResponse);
- if (size)
- *size = sizeof(struct ns1__executeCommandResponse);
- }
- else
- { cp->ptr = (void*)SOAP_NEW_ARRAY(struct ns1__executeCommandResponse, n);
- if (size)
- *size = n * sizeof(struct ns1__executeCommandResponse);
- }
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated location=%p\n", cp->ptr));
- if (!cp->ptr)
- soap->error = SOAP_EOM;
- return (struct ns1__executeCommandResponse*)cp->ptr;
-}
-
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns1__executeCommandResponse(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
-{
- (void)soap; (void)tt; (void)st; (void)len; (void)n; /* appease -Wall -Werror */
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying struct ns1__executeCommandResponse %p -> %p\n", q, p));
- *(struct ns1__executeCommandResponse*)p = *(struct ns1__executeCommandResponse*)q;
-}
-
#ifndef WITH_NOGLOBAL
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *const*a)
{
+ (void)soap; (void)a; /* appease -Wall -Werror */
#ifndef WITH_NOIDREF
if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Reason))
soap_serialize_SOAP_ENV__Reason(soap, *a);
@@ -1400,7 +1396,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap
SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Reason(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Reason *const*a, const char *type)
{
- id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Reason);
+ id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Reason, NULL);
if (id < 0)
return soap->error;
return soap_out_SOAP_ENV__Reason(soap, tag, id, *a, type);
@@ -1408,6 +1404,7 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Reason(struct soap *soap,
SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reason(struct soap *soap, const char *tag, struct SOAP_ENV__Reason **a, const char *type)
{
+ (void)type; /* appease -Wall -Werror */
if (soap_element_begin_in(soap, tag, 1, NULL))
return NULL;
if (!a)
@@ -1420,7 +1417,7 @@ SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reas
return NULL;
}
else
- { a = (struct SOAP_ENV__Reason **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), 0);
+ { a = (struct SOAP_ENV__Reason **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), 0, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
@@ -1429,8 +1426,7 @@ SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reas
SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *const*a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_PointerToSOAP_ENV__Reason);
- if (soap_out_PointerToSOAP_ENV__Reason(soap, tag?tag:"SOAP-ENV:Reason", id, a, type))
+ if (soap_out_PointerToSOAP_ENV__Reason(soap, tag?tag:"SOAP-ENV:Reason", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -1449,6 +1445,7 @@ SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Rea
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *const*a)
{
+ (void)soap; (void)a; /* appease -Wall -Werror */
#ifndef WITH_NOIDREF
if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Detail))
soap_serialize_SOAP_ENV__Detail(soap, *a);
@@ -1457,7 +1454,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap
SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Detail(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Detail *const*a, const char *type)
{
- id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Detail);
+ id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Detail, NULL);
if (id < 0)
return soap->error;
return soap_out_SOAP_ENV__Detail(soap, tag, id, *a, type);
@@ -1465,6 +1462,7 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Detail(struct soap *soap,
SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Detail(struct soap *soap, const char *tag, struct SOAP_ENV__Detail **a, const char *type)
{
+ (void)type; /* appease -Wall -Werror */
if (soap_element_begin_in(soap, tag, 1, NULL))
return NULL;
if (!a)
@@ -1477,7 +1475,7 @@ SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Deta
return NULL;
}
else
- { a = (struct SOAP_ENV__Detail **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), 0);
+ { a = (struct SOAP_ENV__Detail **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), 0, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
@@ -1486,8 +1484,7 @@ SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Deta
SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *const*a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_PointerToSOAP_ENV__Detail);
- if (soap_out_PointerToSOAP_ENV__Detail(soap, tag?tag:"SOAP-ENV:Detail", id, a, type))
+ if (soap_out_PointerToSOAP_ENV__Detail(soap, tag?tag:"SOAP-ENV:Detail", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -1506,6 +1503,7 @@ SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Det
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *const*a)
{
+ (void)soap; (void)a; /* appease -Wall -Werror */
#ifndef WITH_NOIDREF
if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Code))
soap_serialize_SOAP_ENV__Code(soap, *a);
@@ -1514,14 +1512,18 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap *s
SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Code(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Code *const*a, const char *type)
{
- id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Code);
+ char *mark;
+ id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Code, &mark);
if (id < 0)
return soap->error;
- return soap_out_SOAP_ENV__Code(soap, tag, id, *a, type);
+ soap_out_SOAP_ENV__Code(soap, tag, id, *a, type);
+ soap_unmark(soap, mark);
+ return soap->error;
}
SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(struct soap *soap, const char *tag, struct SOAP_ENV__Code **a, const char *type)
{
+ (void)type; /* appease -Wall -Werror */
if (soap_element_begin_in(soap, tag, 1, NULL))
return NULL;
if (!a)
@@ -1534,7 +1536,7 @@ SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(s
return NULL;
}
else
- { a = (struct SOAP_ENV__Code **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), 0);
+ { a = (struct SOAP_ENV__Code **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), 0, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
@@ -1543,8 +1545,7 @@ SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(s
SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *const*a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_PointerToSOAP_ENV__Code);
- if (soap_out_PointerToSOAP_ENV__Code(soap, tag?tag:"SOAP-ENV:Code", id, a, type))
+ if (soap_out_PointerToSOAP_ENV__Code(soap, tag?tag:"SOAP-ENV:Code", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -1561,6 +1562,7 @@ SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Code(
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTostring(struct soap *soap, char **const*a)
{
+ (void)soap; (void)a; /* appease -Wall -Werror */
#ifndef WITH_NOIDREF
if (!soap_reference(soap, *a, SOAP_TYPE_string))
soap_serialize_string(soap, *a);
@@ -1569,7 +1571,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTostring(struct soap *soap, cha
SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTostring(struct soap *soap, const char *tag, int id, char **const*a, const char *type)
{
- id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_string);
+ id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_string, NULL);
if (id < 0)
return soap->error;
return soap_out_string(soap, tag, id, *a, type);
@@ -1577,6 +1579,7 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTostring(struct soap *soap, const char
SOAP_FMAC3 char *** SOAP_FMAC4 soap_in_PointerTostring(struct soap *soap, const char *tag, char ***a, const char *type)
{
+ (void)type; /* appease -Wall -Werror */
if (soap_element_begin_in(soap, tag, 1, NULL))
return NULL;
if (!a)
@@ -1589,7 +1592,7 @@ SOAP_FMAC3 char *** SOAP_FMAC4 soap_in_PointerTostring(struct soap *soap, const
return NULL;
}
else
- { a = (char ***)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_string, sizeof(char *), 1);
+ { a = (char ***)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_string, sizeof(char *), 1, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
}
@@ -1598,8 +1601,7 @@ SOAP_FMAC3 char *** SOAP_FMAC4 soap_in_PointerTostring(struct soap *soap, const
SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTostring(struct soap *soap, char **const*a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_PointerTostring);
- if (soap_out_PointerTostring(soap, tag?tag:"byte", id, a, type))
+ if (soap_out_PointerTostring(soap, tag?tag:"string", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -1612,8 +1614,19 @@ SOAP_FMAC3 char *** SOAP_FMAC4 soap_get_PointerTostring(struct soap *soap, char
return p;
}
+SOAP_FMAC3 void SOAP_FMAC4 soap_default__QName(struct soap *soap, char **a)
+{
+ (void)soap; /* appease -Wall -Werror */
+#ifdef SOAP_DEFAULT__QName
+ *a = SOAP_DEFAULT__QName;
+#else
+ *a = (char *)0;
+#endif
+}
+
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize__QName(struct soap *soap, char *const*a)
{
+ (void)soap; (void)a; /* appease -Wall -Werror */
#ifndef WITH_NOIDREF
soap_reference(soap, *a, SOAP_TYPE__QName);
#endif
@@ -1625,15 +1638,14 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_out__QName(struct soap *soap, const char *tag, in
}
SOAP_FMAC3 char * * SOAP_FMAC4 soap_in__QName(struct soap *soap, const char *tag, char **a, const char *type)
-{ char **p;
- p = soap_instring(soap, tag, a, type, SOAP_TYPE__QName, 2, 0, -1);
- return p;
+{
+ a = soap_instring(soap, tag, a, type, SOAP_TYPE__QName, 2, 0, -1, NULL);
+ return a;
}
SOAP_FMAC3 int SOAP_FMAC4 soap_put__QName(struct soap *soap, char *const*a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE__QName);
- if (soap_out__QName(soap, tag?tag:"byte", id, a, type))
+ if (soap_out__QName(soap, tag?tag:"QName", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
@@ -1658,6 +1670,7 @@ SOAP_FMAC3 void SOAP_FMAC4 soap_default_string(struct soap *soap, char **a)
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_string(struct soap *soap, char *const*a)
{
+ (void)soap; (void)a; /* appease -Wall -Werror */
#ifndef WITH_NOIDREF
soap_reference(soap, *a, SOAP_TYPE_string);
#endif
@@ -1669,15 +1682,14 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_out_string(struct soap *soap, const char *tag, in
}
SOAP_FMAC3 char * * SOAP_FMAC4 soap_in_string(struct soap *soap, const char *tag, char **a, const char *type)
-{ char **p;
- p = soap_instring(soap, tag, a, type, SOAP_TYPE_string, 1, 0, -1);
- return p;
+{
+ a = soap_instring(soap, tag, a, type, SOAP_TYPE_string, 1, 0, -1, NULL);
+ return a;
}
SOAP_FMAC3 int SOAP_FMAC4 soap_put_string(struct soap *soap, char *const*a, const char *tag, const char *type)
{
- register int id = soap_embed(soap, (void*)a, NULL, 0, tag, SOAP_TYPE_string);
- if (soap_out_string(soap, tag?tag:"byte", id, a, type))
+ if (soap_out_string(soap, tag?tag:"string", -2, a, type))
return soap->error;
return soap_putindependent(soap);
}
diff --git a/dep/gsoap/soapH.h b/dep/gsoap/soapH.h
index a73b369fe90..f3def95426a 100644
--- a/dep/gsoap/soapH.h
+++ b/dep/gsoap/soapH.h
@@ -1,11 +1,14 @@
/* soapH.h
- Generated by gSOAP 2.8.17r from gsoap.stub
+ Generated by gSOAP 2.8.33 for gsoap.stub
-Copyright(C) 2000-2013, Robert van Engelen, Genivia Inc. All Rights Reserved.
-The generated code is released under one of the following licenses:
-GPL or Genivia's license for commercial use.
+gSOAP XML Web services tools
+Copyright (C) 2000-2016, Robert van Engelen, Genivia Inc. All Rights Reserved.
+The soapcpp2 tool and its generated software are released under the GPL.
This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed.
+--------------------------------------------------------------------------------
+A commercial use license is available from Genivia Inc., contact@genivia.com
+--------------------------------------------------------------------------------
*/
#ifndef soapH_H
@@ -37,425 +40,635 @@ SOAP_FMAC3 int SOAP_FMAC4 soap_putelement(struct soap*, const void*, const char*
SOAP_FMAC3 int SOAP_FMAC4 soap_ignore_element(struct soap*);
SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultcode(struct soap *soap);
-
SOAP_FMAC3 void * SOAP_FMAC4 soap_instantiate(struct soap*, int, const char*, const char*, size_t*);
SOAP_FMAC3 int SOAP_FMAC4 soap_fdelete(struct soap_clist*);
-SOAP_FMAC3 void* SOAP_FMAC4 soap_class_id_enter(struct soap*, const char*, void*, int, size_t, const char*, const char*);
+SOAP_FMAC3 int SOAP_FMAC4 soap_fbase(int, int);
+SOAP_FMAC3 void SOAP_FMAC4 soap_finsert(struct soap*, int, int, void*, size_t, const void*, void**);
-#ifndef SOAP_TYPE_byte
-#define SOAP_TYPE_byte (3)
-#endif
+#ifndef SOAP_TYPE_byte_DEFINED
+#define SOAP_TYPE_byte_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_default_byte(struct soap*, char *);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_byte(struct soap*, const char*, int, const char *, const char*);
SOAP_FMAC3 char * SOAP_FMAC4 soap_in_byte(struct soap*, const char*, char *, const char*);
-
SOAP_FMAC3 int SOAP_FMAC4 soap_put_byte(struct soap*, const char *, const char*, const char*);
-#ifndef soap_write_byte
-#define soap_write_byte(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_byte(soap, data),0) || soap_put_byte(soap, data, "byte", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
+inline int soap_write_byte(struct soap *soap, char const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || soap_put_byte(soap, p, "byte", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
SOAP_FMAC3 char * SOAP_FMAC4 soap_get_byte(struct soap*, char *, const char*, const char*);
-#ifndef soap_read_byte
-#define soap_read_byte(soap, data) ( soap_begin_recv(soap) || !soap_get_byte(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
+inline int soap_read_byte(struct soap *soap, char *p)
+{
+ if (p)
+ { if (soap_begin_recv(soap) || soap_get_byte(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
#endif
-
-#ifndef SOAP_TYPE_int
-#define SOAP_TYPE_int (1)
-#endif
+#ifndef SOAP_TYPE_int_DEFINED
+#define SOAP_TYPE_int_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_default_int(struct soap*, int *);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_int(struct soap*, const char*, int, const int *, const char*);
SOAP_FMAC3 int * SOAP_FMAC4 soap_in_int(struct soap*, const char*, int *, const char*);
-
SOAP_FMAC3 int SOAP_FMAC4 soap_put_int(struct soap*, const int *, const char*, const char*);
-#ifndef soap_write_int
-#define soap_write_int(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_int(soap, data),0) || soap_put_int(soap, data, "int", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
+inline int soap_write_int(struct soap *soap, int const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || soap_put_int(soap, p, "int", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
SOAP_FMAC3 int * SOAP_FMAC4 soap_get_int(struct soap*, int *, const char*, const char*);
-#ifndef soap_read_int
-#define soap_read_int(soap, data) ( soap_begin_recv(soap) || !soap_get_int(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
+inline int soap_read_int(struct soap *soap, int *p)
+{
+ if (p)
+ { if (soap_begin_recv(soap) || soap_get_int(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
#endif
-
#ifndef WITH_NOGLOBAL
-#ifndef SOAP_TYPE_SOAP_ENV__Fault
-#define SOAP_TYPE_SOAP_ENV__Fault (18)
-#endif
+#ifndef SOAP_TYPE_SOAP_ENV__Fault_DEFINED
+#define SOAP_TYPE_SOAP_ENV__Fault_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *);
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Fault(struct soap*, const struct SOAP_ENV__Fault *);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Fault(struct soap*, const char*, int, const struct SOAP_ENV__Fault *, const char*);
SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct soap*, const char*, struct SOAP_ENV__Fault *, const char*);
-
-SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Fault(struct soap*, const struct SOAP_ENV__Fault *, const char*, const char*);
-
-#ifndef soap_write_SOAP_ENV__Fault
-#define soap_write_SOAP_ENV__Fault(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_SOAP_ENV__Fault(soap, data),0) || soap_put_SOAP_ENV__Fault(soap, data, "SOAP-ENV:Fault", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
-SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_get_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *, const char*, const char*);
-
-#ifndef soap_read_SOAP_ENV__Fault
-#define soap_read_SOAP_ENV__Fault(soap, data) ( soap_begin_recv(soap) || !soap_get_SOAP_ENV__Fault(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
-#endif
-
SOAP_FMAC1 struct SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(struct soap*, int, const char*, const char*, size_t*);
-inline struct SOAP_ENV__Fault * soap_new_SOAP_ENV__Fault(struct soap *soap, int n = -1) { return soap_instantiate_SOAP_ENV__Fault(soap, n, NULL, NULL, NULL); }
+inline struct SOAP_ENV__Fault * soap_new_SOAP_ENV__Fault(struct soap *soap, int n = -1)
+{
+ return soap_instantiate_SOAP_ENV__Fault(soap, n, NULL, NULL, NULL);
+}
-inline struct SOAP_ENV__Fault * soap_new_req_SOAP_ENV__Fault(struct soap *soap) { struct SOAP_ENV__Fault *_p = soap_instantiate_SOAP_ENV__Fault(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_SOAP_ENV__Fault(soap, _p); } return _p; }
+inline struct SOAP_ENV__Fault * soap_new_req_SOAP_ENV__Fault(
+ struct soap *soap)
+{
+ struct SOAP_ENV__Fault *_p = soap_new_SOAP_ENV__Fault(soap);
+ if (_p)
+ { soap_default_SOAP_ENV__Fault(soap, _p);
+ }
+ return _p;
+}
-inline struct SOAP_ENV__Fault * soap_new_set_SOAP_ENV__Fault(struct soap *soap, char *faultcode, char *faultstring, char *faultactor, struct SOAP_ENV__Detail *detail, struct SOAP_ENV__Code *SOAP_ENV__Code, struct SOAP_ENV__Reason *SOAP_ENV__Reason, char *SOAP_ENV__Node, char *SOAP_ENV__Role, struct SOAP_ENV__Detail *SOAP_ENV__Detail) { struct SOAP_ENV__Fault *_p = soap_instantiate_SOAP_ENV__Fault(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_SOAP_ENV__Fault(soap, _p); _p->faultcode = faultcode; _p->faultstring = faultstring; _p->faultactor = faultactor; _p->detail = detail; _p->SOAP_ENV__Code = SOAP_ENV__Code; _p->SOAP_ENV__Reason = SOAP_ENV__Reason; _p->SOAP_ENV__Node = SOAP_ENV__Node; _p->SOAP_ENV__Role = SOAP_ENV__Role; _p->SOAP_ENV__Detail = SOAP_ENV__Detail; } return _p; }
+inline struct SOAP_ENV__Fault * soap_new_set_SOAP_ENV__Fault(
+ struct soap *soap,
+ char *faultcode,
+ char *faultstring,
+ char *faultactor,
+ struct SOAP_ENV__Detail *detail,
+ struct SOAP_ENV__Code *SOAP_ENV__Code,
+ struct SOAP_ENV__Reason *SOAP_ENV__Reason,
+ char *SOAP_ENV__Node,
+ char *SOAP_ENV__Role,
+ struct SOAP_ENV__Detail *SOAP_ENV__Detail)
+{
+ struct SOAP_ENV__Fault *_p = soap_new_SOAP_ENV__Fault(soap);
+ if (_p)
+ { soap_default_SOAP_ENV__Fault(soap, _p);
+ _p->faultcode = faultcode;
+ _p->faultstring = faultstring;
+ _p->faultactor = faultactor;
+ _p->detail = detail;
+ _p->SOAP_ENV__Code = SOAP_ENV__Code;
+ _p->SOAP_ENV__Reason = SOAP_ENV__Reason;
+ _p->SOAP_ENV__Node = SOAP_ENV__Node;
+ _p->SOAP_ENV__Role = SOAP_ENV__Role;
+ _p->SOAP_ENV__Detail = SOAP_ENV__Detail;
+ }
+ return _p;
+}
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Fault(struct soap*, const struct SOAP_ENV__Fault *, const char*, const char*);
-inline void soap_delete_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p) { soap_delete(soap, p); }
+inline int soap_write_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || (soap_serialize_SOAP_ENV__Fault(soap, p), 0) || soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_get_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *, const char*, const char*);
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Fault(struct soap*, int, int, void*, size_t, const void*, size_t);
+inline int soap_read_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p)
+{
+ if (p)
+ { soap_default_SOAP_ENV__Fault(soap, p);
+ if (soap_begin_recv(soap) || soap_get_SOAP_ENV__Fault(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+#endif
#endif
#ifndef WITH_NOGLOBAL
-#ifndef SOAP_TYPE_SOAP_ENV__Reason
-#define SOAP_TYPE_SOAP_ENV__Reason (17)
-#endif
+#ifndef SOAP_TYPE_SOAP_ENV__Reason_DEFINED
+#define SOAP_TYPE_SOAP_ENV__Reason_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *);
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Reason(struct soap*, const struct SOAP_ENV__Reason *);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Reason(struct soap*, const char*, int, const struct SOAP_ENV__Reason *, const char*);
SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_in_SOAP_ENV__Reason(struct soap*, const char*, struct SOAP_ENV__Reason *, const char*);
-
-SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Reason(struct soap*, const struct SOAP_ENV__Reason *, const char*, const char*);
-
-#ifndef soap_write_SOAP_ENV__Reason
-#define soap_write_SOAP_ENV__Reason(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_SOAP_ENV__Reason(soap, data),0) || soap_put_SOAP_ENV__Reason(soap, data, "SOAP-ENV:Reason", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
-SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_get_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *, const char*, const char*);
-
-#ifndef soap_read_SOAP_ENV__Reason
-#define soap_read_SOAP_ENV__Reason(soap, data) ( soap_begin_recv(soap) || !soap_get_SOAP_ENV__Reason(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
-#endif
-
SOAP_FMAC1 struct SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reason(struct soap*, int, const char*, const char*, size_t*);
-inline struct SOAP_ENV__Reason * soap_new_SOAP_ENV__Reason(struct soap *soap, int n = -1) { return soap_instantiate_SOAP_ENV__Reason(soap, n, NULL, NULL, NULL); }
+inline struct SOAP_ENV__Reason * soap_new_SOAP_ENV__Reason(struct soap *soap, int n = -1)
+{
+ return soap_instantiate_SOAP_ENV__Reason(soap, n, NULL, NULL, NULL);
+}
-inline struct SOAP_ENV__Reason * soap_new_req_SOAP_ENV__Reason(struct soap *soap) { struct SOAP_ENV__Reason *_p = soap_instantiate_SOAP_ENV__Reason(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_SOAP_ENV__Reason(soap, _p); } return _p; }
+inline struct SOAP_ENV__Reason * soap_new_req_SOAP_ENV__Reason(
+ struct soap *soap)
+{
+ struct SOAP_ENV__Reason *_p = soap_new_SOAP_ENV__Reason(soap);
+ if (_p)
+ { soap_default_SOAP_ENV__Reason(soap, _p);
+ }
+ return _p;
+}
-inline struct SOAP_ENV__Reason * soap_new_set_SOAP_ENV__Reason(struct soap *soap, char *SOAP_ENV__Text) { struct SOAP_ENV__Reason *_p = soap_instantiate_SOAP_ENV__Reason(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_SOAP_ENV__Reason(soap, _p); _p->SOAP_ENV__Text = SOAP_ENV__Text; } return _p; }
+inline struct SOAP_ENV__Reason * soap_new_set_SOAP_ENV__Reason(
+ struct soap *soap,
+ char *SOAP_ENV__Text)
+{
+ struct SOAP_ENV__Reason *_p = soap_new_SOAP_ENV__Reason(soap);
+ if (_p)
+ { soap_default_SOAP_ENV__Reason(soap, _p);
+ _p->SOAP_ENV__Text = SOAP_ENV__Text;
+ }
+ return _p;
+}
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Reason(struct soap*, const struct SOAP_ENV__Reason *, const char*, const char*);
-inline void soap_delete_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p) { soap_delete(soap, p); }
+inline int soap_write_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || (soap_serialize_SOAP_ENV__Reason(soap, p), 0) || soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_get_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *, const char*, const char*);
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Reason(struct soap*, int, int, void*, size_t, const void*, size_t);
+inline int soap_read_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p)
+{
+ if (p)
+ { soap_default_SOAP_ENV__Reason(soap, p);
+ if (soap_begin_recv(soap) || soap_get_SOAP_ENV__Reason(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+#endif
#endif
#ifndef WITH_NOGLOBAL
-#ifndef SOAP_TYPE_SOAP_ENV__Detail
-#define SOAP_TYPE_SOAP_ENV__Detail (14)
-#endif
+#ifndef SOAP_TYPE_SOAP_ENV__Detail_DEFINED
+#define SOAP_TYPE_SOAP_ENV__Detail_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *);
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Detail(struct soap*, const struct SOAP_ENV__Detail *);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Detail(struct soap*, const char*, int, const struct SOAP_ENV__Detail *, const char*);
SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_in_SOAP_ENV__Detail(struct soap*, const char*, struct SOAP_ENV__Detail *, const char*);
-
-SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Detail(struct soap*, const struct SOAP_ENV__Detail *, const char*, const char*);
-
-#ifndef soap_write_SOAP_ENV__Detail
-#define soap_write_SOAP_ENV__Detail(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_SOAP_ENV__Detail(soap, data),0) || soap_put_SOAP_ENV__Detail(soap, data, "SOAP-ENV:Detail", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
-SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_get_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *, const char*, const char*);
-
-#ifndef soap_read_SOAP_ENV__Detail
-#define soap_read_SOAP_ENV__Detail(soap, data) ( soap_begin_recv(soap) || !soap_get_SOAP_ENV__Detail(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
-#endif
-
SOAP_FMAC1 struct SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detail(struct soap*, int, const char*, const char*, size_t*);
-inline struct SOAP_ENV__Detail * soap_new_SOAP_ENV__Detail(struct soap *soap, int n = -1) { return soap_instantiate_SOAP_ENV__Detail(soap, n, NULL, NULL, NULL); }
+inline struct SOAP_ENV__Detail * soap_new_SOAP_ENV__Detail(struct soap *soap, int n = -1)
+{
+ return soap_instantiate_SOAP_ENV__Detail(soap, n, NULL, NULL, NULL);
+}
-inline struct SOAP_ENV__Detail * soap_new_req_SOAP_ENV__Detail(struct soap *soap, int __type, void *fault) { struct SOAP_ENV__Detail *_p = soap_instantiate_SOAP_ENV__Detail(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_SOAP_ENV__Detail(soap, _p); _p->__type = __type; _p->fault = fault; } return _p; }
+inline struct SOAP_ENV__Detail * soap_new_req_SOAP_ENV__Detail(
+ struct soap *soap,
+ int __type,
+ void *fault)
+{
+ struct SOAP_ENV__Detail *_p = soap_new_SOAP_ENV__Detail(soap);
+ if (_p)
+ { soap_default_SOAP_ENV__Detail(soap, _p);
+ _p->__type = __type;
+ _p->fault = fault;
+ }
+ return _p;
+}
-inline struct SOAP_ENV__Detail * soap_new_set_SOAP_ENV__Detail(struct soap *soap, char *__any, int __type, void *fault) { struct SOAP_ENV__Detail *_p = soap_instantiate_SOAP_ENV__Detail(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_SOAP_ENV__Detail(soap, _p); _p->__any = __any; _p->__type = __type; _p->fault = fault; } return _p; }
+inline struct SOAP_ENV__Detail * soap_new_set_SOAP_ENV__Detail(
+ struct soap *soap,
+ char *__any,
+ int __type,
+ void *fault)
+{
+ struct SOAP_ENV__Detail *_p = soap_new_SOAP_ENV__Detail(soap);
+ if (_p)
+ { soap_default_SOAP_ENV__Detail(soap, _p);
+ _p->__any = __any;
+ _p->__type = __type;
+ _p->fault = fault;
+ }
+ return _p;
+}
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Detail(struct soap*, const struct SOAP_ENV__Detail *, const char*, const char*);
-inline void soap_delete_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p) { soap_delete(soap, p); }
+inline int soap_write_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || (soap_serialize_SOAP_ENV__Detail(soap, p), 0) || soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_get_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *, const char*, const char*);
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Detail(struct soap*, int, int, void*, size_t, const void*, size_t);
+inline int soap_read_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p)
+{
+ if (p)
+ { soap_default_SOAP_ENV__Detail(soap, p);
+ if (soap_begin_recv(soap) || soap_get_SOAP_ENV__Detail(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+#endif
#endif
#ifndef WITH_NOGLOBAL
-#ifndef SOAP_TYPE_SOAP_ENV__Code
-#define SOAP_TYPE_SOAP_ENV__Code (12)
-#endif
+#ifndef SOAP_TYPE_SOAP_ENV__Code_DEFINED
+#define SOAP_TYPE_SOAP_ENV__Code_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *);
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Code(struct soap*, const struct SOAP_ENV__Code *);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Code(struct soap*, const char*, int, const struct SOAP_ENV__Code *, const char*);
SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_in_SOAP_ENV__Code(struct soap*, const char*, struct SOAP_ENV__Code *, const char*);
-
-SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Code(struct soap*, const struct SOAP_ENV__Code *, const char*, const char*);
-
-#ifndef soap_write_SOAP_ENV__Code
-#define soap_write_SOAP_ENV__Code(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_SOAP_ENV__Code(soap, data),0) || soap_put_SOAP_ENV__Code(soap, data, "SOAP-ENV:Code", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
-SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_get_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *, const char*, const char*);
-
-#ifndef soap_read_SOAP_ENV__Code
-#define soap_read_SOAP_ENV__Code(soap, data) ( soap_begin_recv(soap) || !soap_get_SOAP_ENV__Code(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
-#endif
-
SOAP_FMAC1 struct SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(struct soap*, int, const char*, const char*, size_t*);
-inline struct SOAP_ENV__Code * soap_new_SOAP_ENV__Code(struct soap *soap, int n = -1) { return soap_instantiate_SOAP_ENV__Code(soap, n, NULL, NULL, NULL); }
+inline struct SOAP_ENV__Code * soap_new_SOAP_ENV__Code(struct soap *soap, int n = -1)
+{
+ return soap_instantiate_SOAP_ENV__Code(soap, n, NULL, NULL, NULL);
+}
-inline struct SOAP_ENV__Code * soap_new_req_SOAP_ENV__Code(struct soap *soap) { struct SOAP_ENV__Code *_p = soap_instantiate_SOAP_ENV__Code(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_SOAP_ENV__Code(soap, _p); } return _p; }
+inline struct SOAP_ENV__Code * soap_new_req_SOAP_ENV__Code(
+ struct soap *soap)
+{
+ struct SOAP_ENV__Code *_p = soap_new_SOAP_ENV__Code(soap);
+ if (_p)
+ { soap_default_SOAP_ENV__Code(soap, _p);
+ }
+ return _p;
+}
-inline struct SOAP_ENV__Code * soap_new_set_SOAP_ENV__Code(struct soap *soap, char *SOAP_ENV__Value, struct SOAP_ENV__Code *SOAP_ENV__Subcode) { struct SOAP_ENV__Code *_p = soap_instantiate_SOAP_ENV__Code(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_SOAP_ENV__Code(soap, _p); _p->SOAP_ENV__Value = SOAP_ENV__Value; _p->SOAP_ENV__Subcode = SOAP_ENV__Subcode; } return _p; }
+inline struct SOAP_ENV__Code * soap_new_set_SOAP_ENV__Code(
+ struct soap *soap,
+ char *SOAP_ENV__Value,
+ struct SOAP_ENV__Code *SOAP_ENV__Subcode)
+{
+ struct SOAP_ENV__Code *_p = soap_new_SOAP_ENV__Code(soap);
+ if (_p)
+ { soap_default_SOAP_ENV__Code(soap, _p);
+ _p->SOAP_ENV__Value = SOAP_ENV__Value;
+ _p->SOAP_ENV__Subcode = SOAP_ENV__Subcode;
+ }
+ return _p;
+}
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Code(struct soap*, const struct SOAP_ENV__Code *, const char*, const char*);
-inline void soap_delete_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p) { soap_delete(soap, p); }
+inline int soap_write_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || (soap_serialize_SOAP_ENV__Code(soap, p), 0) || soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_get_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *, const char*, const char*);
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Code(struct soap*, int, int, void*, size_t, const void*, size_t);
+inline int soap_read_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p)
+{
+ if (p)
+ { soap_default_SOAP_ENV__Code(soap, p);
+ if (soap_begin_recv(soap) || soap_get_SOAP_ENV__Code(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+#endif
#endif
#ifndef WITH_NOGLOBAL
-#ifndef SOAP_TYPE_SOAP_ENV__Header
-#define SOAP_TYPE_SOAP_ENV__Header (11)
-#endif
+#ifndef SOAP_TYPE_SOAP_ENV__Header_DEFINED
+#define SOAP_TYPE_SOAP_ENV__Header_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *);
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Header(struct soap*, const struct SOAP_ENV__Header *);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap*, const char*, int, const struct SOAP_ENV__Header *, const char*);
SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_in_SOAP_ENV__Header(struct soap*, const char*, struct SOAP_ENV__Header *, const char*);
-
-SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Header(struct soap*, const struct SOAP_ENV__Header *, const char*, const char*);
-
-#ifndef soap_write_SOAP_ENV__Header
-#define soap_write_SOAP_ENV__Header(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_SOAP_ENV__Header(soap, data),0) || soap_put_SOAP_ENV__Header(soap, data, "SOAP-ENV:Header", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
-SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_get_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *, const char*, const char*);
-
-#ifndef soap_read_SOAP_ENV__Header
-#define soap_read_SOAP_ENV__Header(soap, data) ( soap_begin_recv(soap) || !soap_get_SOAP_ENV__Header(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
-#endif
-
SOAP_FMAC1 struct SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Header(struct soap*, int, const char*, const char*, size_t*);
-inline struct SOAP_ENV__Header * soap_new_SOAP_ENV__Header(struct soap *soap, int n = -1) { return soap_instantiate_SOAP_ENV__Header(soap, n, NULL, NULL, NULL); }
-
-inline struct SOAP_ENV__Header * soap_new_req_SOAP_ENV__Header(struct soap *soap) { struct SOAP_ENV__Header *_p = soap_instantiate_SOAP_ENV__Header(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_SOAP_ENV__Header(soap, _p); } return _p; }
+inline struct SOAP_ENV__Header * soap_new_SOAP_ENV__Header(struct soap *soap, int n = -1)
+{
+ return soap_instantiate_SOAP_ENV__Header(soap, n, NULL, NULL, NULL);
+}
-inline struct SOAP_ENV__Header * soap_new_set_SOAP_ENV__Header(struct soap *soap) { struct SOAP_ENV__Header *_p = soap_instantiate_SOAP_ENV__Header(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_SOAP_ENV__Header(soap, _p); } return _p; }
+inline struct SOAP_ENV__Header * soap_new_req_SOAP_ENV__Header(
+ struct soap *soap)
+{
+ struct SOAP_ENV__Header *_p = soap_new_SOAP_ENV__Header(soap);
+ if (_p)
+ { soap_default_SOAP_ENV__Header(soap, _p);
+ }
+ return _p;
+}
-inline void soap_delete_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p) { soap_delete(soap, p); }
+inline struct SOAP_ENV__Header * soap_new_set_SOAP_ENV__Header(
+ struct soap *soap)
+{
+ struct SOAP_ENV__Header *_p = soap_new_SOAP_ENV__Header(soap);
+ if (_p)
+ { soap_default_SOAP_ENV__Header(soap, _p);
+ }
+ return _p;
+}
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Header(struct soap*, const struct SOAP_ENV__Header *, const char*, const char*);
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_SOAP_ENV__Header(struct soap*, int, int, void*, size_t, const void*, size_t);
+inline int soap_write_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || (soap_serialize_SOAP_ENV__Header(soap, p), 0) || soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_get_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *, const char*, const char*);
+inline int soap_read_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p)
+{
+ if (p)
+ { soap_default_SOAP_ENV__Header(soap, p);
+ if (soap_begin_recv(soap) || soap_get_SOAP_ENV__Header(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
#endif
-#ifndef SOAP_TYPE_ns1__executeCommand
-#define SOAP_TYPE_ns1__executeCommand (10)
#endif
+
+#ifndef SOAP_TYPE_ns1__executeCommand_DEFINED
+#define SOAP_TYPE_ns1__executeCommand_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__executeCommand(struct soap*, struct ns1__executeCommand *);
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__executeCommand(struct soap*, const struct ns1__executeCommand *);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__executeCommand(struct soap*, const char*, int, const struct ns1__executeCommand *, const char*);
SOAP_FMAC3 struct ns1__executeCommand * SOAP_FMAC4 soap_in_ns1__executeCommand(struct soap*, const char*, struct ns1__executeCommand *, const char*);
-
-SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__executeCommand(struct soap*, const struct ns1__executeCommand *, const char*, const char*);
-
-#ifndef soap_write_ns1__executeCommand
-#define soap_write_ns1__executeCommand(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_ns1__executeCommand(soap, data),0) || soap_put_ns1__executeCommand(soap, data, "ns1:executeCommand", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
-SOAP_FMAC3 struct ns1__executeCommand * SOAP_FMAC4 soap_get_ns1__executeCommand(struct soap*, struct ns1__executeCommand *, const char*, const char*);
-
-#ifndef soap_read_ns1__executeCommand
-#define soap_read_ns1__executeCommand(soap, data) ( soap_begin_recv(soap) || !soap_get_ns1__executeCommand(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
-#endif
-
SOAP_FMAC1 struct ns1__executeCommand * SOAP_FMAC2 soap_instantiate_ns1__executeCommand(struct soap*, int, const char*, const char*, size_t*);
-inline struct ns1__executeCommand * soap_new_ns1__executeCommand(struct soap *soap, int n = -1) { return soap_instantiate_ns1__executeCommand(soap, n, NULL, NULL, NULL); }
-
-inline struct ns1__executeCommand * soap_new_req_ns1__executeCommand(struct soap *soap) { struct ns1__executeCommand *_p = soap_instantiate_ns1__executeCommand(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_ns1__executeCommand(soap, _p); } return _p; }
+inline struct ns1__executeCommand * soap_new_ns1__executeCommand(struct soap *soap, int n = -1)
+{
+ return soap_instantiate_ns1__executeCommand(soap, n, NULL, NULL, NULL);
+}
-inline struct ns1__executeCommand * soap_new_set_ns1__executeCommand(struct soap *soap, char *command) { struct ns1__executeCommand *_p = soap_instantiate_ns1__executeCommand(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_ns1__executeCommand(soap, _p); _p->command = command; } return _p; }
+inline struct ns1__executeCommand * soap_new_req_ns1__executeCommand(
+ struct soap *soap)
+{
+ struct ns1__executeCommand *_p = soap_new_ns1__executeCommand(soap);
+ if (_p)
+ { soap_default_ns1__executeCommand(soap, _p);
+ }
+ return _p;
+}
-inline void soap_delete_ns1__executeCommand(struct soap *soap, struct ns1__executeCommand *p) { soap_delete(soap, p); }
+inline struct ns1__executeCommand * soap_new_set_ns1__executeCommand(
+ struct soap *soap,
+ char *command)
+{
+ struct ns1__executeCommand *_p = soap_new_ns1__executeCommand(soap);
+ if (_p)
+ { soap_default_ns1__executeCommand(soap, _p);
+ _p->command = command;
+ }
+ return _p;
+}
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__executeCommand(struct soap*, const struct ns1__executeCommand *, const char*, const char*);
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns1__executeCommand(struct soap*, int, int, void*, size_t, const void*, size_t);
+inline int soap_write_ns1__executeCommand(struct soap *soap, struct ns1__executeCommand const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || (soap_serialize_ns1__executeCommand(soap, p), 0) || soap_put_ns1__executeCommand(soap, p, "ns1:executeCommand", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+SOAP_FMAC3 struct ns1__executeCommand * SOAP_FMAC4 soap_get_ns1__executeCommand(struct soap*, struct ns1__executeCommand *, const char*, const char*);
-#ifndef SOAP_TYPE_ns1__executeCommandResponse
-#define SOAP_TYPE_ns1__executeCommandResponse (9)
+inline int soap_read_ns1__executeCommand(struct soap *soap, struct ns1__executeCommand *p)
+{
+ if (p)
+ { soap_default_ns1__executeCommand(soap, p);
+ if (soap_begin_recv(soap) || soap_get_ns1__executeCommand(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
#endif
+
+#ifndef SOAP_TYPE_ns1__executeCommandResponse_DEFINED
+#define SOAP_TYPE_ns1__executeCommandResponse_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_default_ns1__executeCommandResponse(struct soap*, struct ns1__executeCommandResponse *);
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_ns1__executeCommandResponse(struct soap*, const struct ns1__executeCommandResponse *);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__executeCommandResponse(struct soap*, const char*, int, const struct ns1__executeCommandResponse *, const char*);
SOAP_FMAC3 struct ns1__executeCommandResponse * SOAP_FMAC4 soap_in_ns1__executeCommandResponse(struct soap*, const char*, struct ns1__executeCommandResponse *, const char*);
-
-SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__executeCommandResponse(struct soap*, const struct ns1__executeCommandResponse *, const char*, const char*);
-
-#ifndef soap_write_ns1__executeCommandResponse
-#define soap_write_ns1__executeCommandResponse(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_ns1__executeCommandResponse(soap, data),0) || soap_put_ns1__executeCommandResponse(soap, data, "ns1:executeCommandResponse", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
-SOAP_FMAC3 struct ns1__executeCommandResponse * SOAP_FMAC4 soap_get_ns1__executeCommandResponse(struct soap*, struct ns1__executeCommandResponse *, const char*, const char*);
-
-#ifndef soap_read_ns1__executeCommandResponse
-#define soap_read_ns1__executeCommandResponse(soap, data) ( soap_begin_recv(soap) || !soap_get_ns1__executeCommandResponse(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
-#endif
-
SOAP_FMAC1 struct ns1__executeCommandResponse * SOAP_FMAC2 soap_instantiate_ns1__executeCommandResponse(struct soap*, int, const char*, const char*, size_t*);
-inline struct ns1__executeCommandResponse * soap_new_ns1__executeCommandResponse(struct soap *soap, int n = -1) { return soap_instantiate_ns1__executeCommandResponse(soap, n, NULL, NULL, NULL); }
+inline struct ns1__executeCommandResponse * soap_new_ns1__executeCommandResponse(struct soap *soap, int n = -1)
+{
+ return soap_instantiate_ns1__executeCommandResponse(soap, n, NULL, NULL, NULL);
+}
-inline struct ns1__executeCommandResponse * soap_new_req_ns1__executeCommandResponse(struct soap *soap) { struct ns1__executeCommandResponse *_p = soap_instantiate_ns1__executeCommandResponse(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_ns1__executeCommandResponse(soap, _p); } return _p; }
+inline struct ns1__executeCommandResponse * soap_new_req_ns1__executeCommandResponse(
+ struct soap *soap)
+{
+ struct ns1__executeCommandResponse *_p = soap_new_ns1__executeCommandResponse(soap);
+ if (_p)
+ { soap_default_ns1__executeCommandResponse(soap, _p);
+ }
+ return _p;
+}
-inline struct ns1__executeCommandResponse * soap_new_set_ns1__executeCommandResponse(struct soap *soap, char **result) { struct ns1__executeCommandResponse *_p = soap_instantiate_ns1__executeCommandResponse(soap, -1, NULL, NULL, NULL); if (_p) { soap_default_ns1__executeCommandResponse(soap, _p); _p->result = result; } return _p; }
+inline struct ns1__executeCommandResponse * soap_new_set_ns1__executeCommandResponse(
+ struct soap *soap,
+ char **result)
+{
+ struct ns1__executeCommandResponse *_p = soap_new_ns1__executeCommandResponse(soap);
+ if (_p)
+ { soap_default_ns1__executeCommandResponse(soap, _p);
+ _p->result = result;
+ }
+ return _p;
+}
+SOAP_FMAC3 int SOAP_FMAC4 soap_put_ns1__executeCommandResponse(struct soap*, const struct ns1__executeCommandResponse *, const char*, const char*);
-inline void soap_delete_ns1__executeCommandResponse(struct soap *soap, struct ns1__executeCommandResponse *p) { soap_delete(soap, p); }
+inline int soap_write_ns1__executeCommandResponse(struct soap *soap, struct ns1__executeCommandResponse const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || (soap_serialize_ns1__executeCommandResponse(soap, p), 0) || soap_put_ns1__executeCommandResponse(soap, p, "ns1:executeCommandResponse", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+SOAP_FMAC3 struct ns1__executeCommandResponse * SOAP_FMAC4 soap_get_ns1__executeCommandResponse(struct soap*, struct ns1__executeCommandResponse *, const char*, const char*);
-SOAP_FMAC3 void SOAP_FMAC4 soap_copy_ns1__executeCommandResponse(struct soap*, int, int, void*, size_t, const void*, size_t);
+inline int soap_read_ns1__executeCommandResponse(struct soap *soap, struct ns1__executeCommandResponse *p)
+{
+ if (p)
+ { soap_default_ns1__executeCommandResponse(soap, p);
+ if (soap_begin_recv(soap) || soap_get_ns1__executeCommandResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+#endif
#ifndef WITH_NOGLOBAL
-#ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason
-#define SOAP_TYPE_PointerToSOAP_ENV__Reason (20)
-#endif
+#ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason_DEFINED
+#define SOAP_TYPE_PointerToSOAP_ENV__Reason_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Reason(struct soap*, const char *, int, struct SOAP_ENV__Reason *const*, const char *);
SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reason(struct soap*, const char*, struct SOAP_ENV__Reason **, const char*);
SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*, const char*, const char*);
-
-#ifndef soap_write_PointerToSOAP_ENV__Reason
-#define soap_write_PointerToSOAP_ENV__Reason(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_PointerToSOAP_ENV__Reason(soap, data),0) || soap_put_PointerToSOAP_ENV__Reason(soap, data, "SOAP-ENV:Reason", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason **, const char*, const char*);
-
-#ifndef soap_read_PointerToSOAP_ENV__Reason
-#define soap_read_PointerToSOAP_ENV__Reason(soap, data) ( soap_begin_recv(soap) || !soap_get_PointerToSOAP_ENV__Reason(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
#endif
-
#endif
#ifndef WITH_NOGLOBAL
-#ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail
-#define SOAP_TYPE_PointerToSOAP_ENV__Detail (19)
-#endif
+#ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail_DEFINED
+#define SOAP_TYPE_PointerToSOAP_ENV__Detail_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Detail(struct soap*, const char *, int, struct SOAP_ENV__Detail *const*, const char *);
SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Detail(struct soap*, const char*, struct SOAP_ENV__Detail **, const char*);
SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*, const char*, const char*);
-
-#ifndef soap_write_PointerToSOAP_ENV__Detail
-#define soap_write_PointerToSOAP_ENV__Detail(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_PointerToSOAP_ENV__Detail(soap, data),0) || soap_put_PointerToSOAP_ENV__Detail(soap, data, "SOAP-ENV:Detail", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail **, const char*, const char*);
-
-#ifndef soap_read_PointerToSOAP_ENV__Detail
-#define soap_read_PointerToSOAP_ENV__Detail(soap, data) ( soap_begin_recv(soap) || !soap_get_PointerToSOAP_ENV__Detail(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
#endif
-
#endif
#ifndef WITH_NOGLOBAL
-#ifndef SOAP_TYPE_PointerToSOAP_ENV__Code
-#define SOAP_TYPE_PointerToSOAP_ENV__Code (13)
-#endif
+#ifndef SOAP_TYPE_PointerToSOAP_ENV__Code_DEFINED
+#define SOAP_TYPE_PointerToSOAP_ENV__Code_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Code(struct soap*, const char *, int, struct SOAP_ENV__Code *const*, const char *);
SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(struct soap*, const char*, struct SOAP_ENV__Code **, const char*);
SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*, const char*, const char*);
-
-#ifndef soap_write_PointerToSOAP_ENV__Code
-#define soap_write_PointerToSOAP_ENV__Code(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_PointerToSOAP_ENV__Code(soap, data),0) || soap_put_PointerToSOAP_ENV__Code(soap, data, "SOAP-ENV:Code", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code **, const char*, const char*);
-
-#ifndef soap_read_PointerToSOAP_ENV__Code
-#define soap_read_PointerToSOAP_ENV__Code(soap, data) ( soap_begin_recv(soap) || !soap_get_PointerToSOAP_ENV__Code(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
#endif
-
#endif
-#ifndef SOAP_TYPE_PointerTostring
-#define SOAP_TYPE_PointerTostring (7)
-#endif
+#ifndef SOAP_TYPE_PointerTostring_DEFINED
+#define SOAP_TYPE_PointerTostring_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTostring(struct soap*, char **const*);
SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTostring(struct soap*, const char *, int, char **const*, const char *);
SOAP_FMAC3 char *** SOAP_FMAC4 soap_in_PointerTostring(struct soap*, const char*, char ***, const char*);
SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTostring(struct soap*, char **const*, const char*, const char*);
-
-#ifndef soap_write_PointerTostring
-#define soap_write_PointerTostring(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_PointerTostring(soap, data),0) || soap_put_PointerTostring(soap, data, "byte", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
SOAP_FMAC3 char *** SOAP_FMAC4 soap_get_PointerTostring(struct soap*, char ***, const char*, const char*);
-
-#ifndef soap_read_PointerTostring
-#define soap_read_PointerTostring(soap, data) ( soap_begin_recv(soap) || !soap_get_PointerTostring(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
#endif
-
-#ifndef SOAP_TYPE__QName
-#define SOAP_TYPE__QName (5)
+#ifndef SOAP_TYPE__XML_DEFINED
+#define SOAP_TYPE__XML_DEFINED
#endif
-#define soap_default__QName(soap, a) soap_default_string(soap, a)
-
+#ifndef SOAP_TYPE__QName_DEFINED
+#define SOAP_TYPE__QName_DEFINED
+SOAP_FMAC3 void SOAP_FMAC4 soap_default__QName(struct soap*, char **);
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize__QName(struct soap*, char *const*);
+
+#define soap__QName2s(soap, a) soap_QName2s(soap, (a))
SOAP_FMAC3 int SOAP_FMAC4 soap_out__QName(struct soap*, const char*, int, char*const*, const char*);
+
+#define soap_s2_QName(soap, s, a) soap_s2QName((soap), (s), (char**)(a), 0, -1, NULL)
SOAP_FMAC3 char * * SOAP_FMAC4 soap_in__QName(struct soap*, const char*, char **, const char*);
SOAP_FMAC3 int SOAP_FMAC4 soap_put__QName(struct soap*, char *const*, const char*, const char*);
-#ifndef soap_write__QName
-#define soap_write__QName(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize__QName(soap, data),0) || soap_put__QName(soap, data, "byte", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
+inline int soap_write__QName(struct soap *soap, char *const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || soap_put__QName(soap, p, "QName", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
SOAP_FMAC3 char ** SOAP_FMAC4 soap_get__QName(struct soap*, char **, const char*, const char*);
-#ifndef soap_read__QName
-#define soap_read__QName(soap, data) ( soap_begin_recv(soap) || !soap_get__QName(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
+inline int soap_read__QName(struct soap *soap, char **p)
+{
+ if (p)
+ { if (soap_begin_recv(soap) || soap_get__QName(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
#endif
-
-#ifndef SOAP_TYPE_string
-#define SOAP_TYPE_string (4)
-#endif
+#ifndef SOAP_TYPE_string_DEFINED
+#define SOAP_TYPE_string_DEFINED
SOAP_FMAC3 void SOAP_FMAC4 soap_default_string(struct soap*, char **);
SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_string(struct soap*, char *const*);
+
+#define soap_string2s(soap, a) (a)
SOAP_FMAC3 int SOAP_FMAC4 soap_out_string(struct soap*, const char*, int, char*const*, const char*);
+
+#define soap_s2string(soap, s, a) soap_s2char((soap), (s), (char**)(a), 0, -1, NULL)
SOAP_FMAC3 char * * SOAP_FMAC4 soap_in_string(struct soap*, const char*, char **, const char*);
SOAP_FMAC3 int SOAP_FMAC4 soap_put_string(struct soap*, char *const*, const char*, const char*);
-#ifndef soap_write_string
-#define soap_write_string(soap, data) ( soap_free_temp(soap), soap_begin_send(soap) || (soap_serialize_string(soap, data),0) || soap_put_string(soap, data, "byte", NULL) || soap_end_send(soap), (soap)->error )
-#endif
-
+inline int soap_write_string(struct soap *soap, char *const*p)
+{
+ soap_free_temp(soap);
+ if (p)
+ { if (soap_begin_send(soap) || soap_put_string(soap, p, "string", "") || soap_end_send(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
SOAP_FMAC3 char ** SOAP_FMAC4 soap_get_string(struct soap*, char **, const char*, const char*);
-#ifndef soap_read_string
-#define soap_read_string(soap, data) ( soap_begin_recv(soap) || !soap_get_string(soap, data, NULL, NULL) || soap_end_recv(soap), (soap)->error )
+inline int soap_read_string(struct soap *soap, char **p)
+{
+ if (p)
+ { if (soap_begin_recv(soap) || soap_get_string(soap, p, NULL, NULL) == NULL || soap_end_recv(soap))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
#endif
-
#endif
/* End of soapH.h */
diff --git a/dep/gsoap/soapServer.cpp b/dep/gsoap/soapServer.cpp
index 6e5c8040165..f8fa4797180 100644
--- a/dep/gsoap/soapServer.cpp
+++ b/dep/gsoap/soapServer.cpp
@@ -1,11 +1,14 @@
/* soapServer.cpp
- Generated by gSOAP 2.8.17r from gsoap.stub
+ Generated by gSOAP 2.8.33 for gsoap.stub
-Copyright(C) 2000-2013, Robert van Engelen, Genivia Inc. All Rights Reserved.
-The generated code is released under one of the following licenses:
-GPL or Genivia's license for commercial use.
+gSOAP XML Web services tools
+Copyright (C) 2000-2016, Robert van Engelen, Genivia Inc. All Rights Reserved.
+The soapcpp2 tool and its generated software are released under the GPL.
This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed.
+--------------------------------------------------------------------------------
+A commercial use license is available from Genivia Inc., contact@genivia.com
+--------------------------------------------------------------------------------
*/
#if defined(__BORLANDC__)
@@ -14,9 +17,7 @@ compiling, linking, and/or using OpenSSL is allowed.
#endif
#include "soapH.h"
-SOAP_SOURCE_STAMP("@(#) soapServer.cpp ver 2.8.17r 2014-06-21 21:43:17 GMT")
-
-
+SOAP_SOURCE_STAMP("@(#) soapServer.cpp ver 2.8.33 2016-07-29 05:51:35 GMT")
extern "C" SOAP_FMAC5 int SOAP_FMAC6 soap_serve(struct soap *soap)
{
#ifndef WITH_FASTCGI
@@ -88,7 +89,7 @@ SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__executeCommand(struct soap *soap)
{ if (soap_envelope_begin_out(soap)
|| soap_putheader(soap)
|| soap_body_begin_out(soap)
- || soap_put_ns1__executeCommandResponse(soap, &soap_tmp_ns1__executeCommandResponse, "ns1:executeCommandResponse", NULL)
+ || soap_put_ns1__executeCommandResponse(soap, &soap_tmp_ns1__executeCommandResponse, "ns1:executeCommandResponse", "")
|| soap_body_end_out(soap)
|| soap_envelope_end_out(soap))
return soap->error;
@@ -98,7 +99,7 @@ SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns1__executeCommand(struct soap *soap)
|| soap_envelope_begin_out(soap)
|| soap_putheader(soap)
|| soap_body_begin_out(soap)
- || soap_put_ns1__executeCommandResponse(soap, &soap_tmp_ns1__executeCommandResponse, "ns1:executeCommandResponse", NULL)
+ || soap_put_ns1__executeCommandResponse(soap, &soap_tmp_ns1__executeCommandResponse, "ns1:executeCommandResponse", "")
|| soap_body_end_out(soap)
|| soap_envelope_end_out(soap)
|| soap_end_send(soap))
diff --git a/dep/gsoap/soapStub.h b/dep/gsoap/soapStub.h
index 38374561cde..ce1a2546ef6 100644
--- a/dep/gsoap/soapStub.h
+++ b/dep/gsoap/soapStub.h
@@ -1,30 +1,27 @@
/* soapStub.h
- Generated by gSOAP 2.8.17r from gsoap.stub
+ Generated by gSOAP 2.8.33 for gsoap.stub
-Copyright(C) 2000-2013, Robert van Engelen, Genivia Inc. All Rights Reserved.
-The generated code is released under one of the following licenses:
-GPL or Genivia's license for commercial use.
+gSOAP XML Web services tools
+Copyright (C) 2000-2016, Robert van Engelen, Genivia Inc. All Rights Reserved.
+The soapcpp2 tool and its generated software are released under the GPL.
This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed.
+--------------------------------------------------------------------------------
+A commercial use license is available from Genivia Inc., contact@genivia.com
+--------------------------------------------------------------------------------
*/
+
#ifndef soapStub_H
#define soapStub_H
#include "stdsoap2.h"
-#if GSOAP_VERSION != 20817
-# error "GSOAP VERSION MISMATCH IN GENERATED CODE: PLEASE REINSTALL PACKAGE"
+#if GSOAP_VERSION != 20833
+# error "GSOAP VERSION 20833 MISMATCH IN GENERATED CODE VERSUS LIBRARY CODE: PLEASE REINSTALL PACKAGE"
#endif
/******************************************************************************\
* *
- * Enumerations *
- * *
-\******************************************************************************/
-
-
-/******************************************************************************\
- * *
* Types with Custom Serializers *
* *
\******************************************************************************/
@@ -32,130 +29,197 @@ compiling, linking, and/or using OpenSSL is allowed.
/******************************************************************************\
* *
- * Classes and Structs *
+ * Classes, Structs and Unions *
* *
\******************************************************************************/
+struct ns1__executeCommandResponse; /* gsoap.stub:1 */
+struct ns1__executeCommand; /* gsoap.stub:1 */
-#if 0 /* volatile type: do not declare here, declared elsewhere */
-
-#endif
-
+/* gsoap.stub:1 */
#ifndef SOAP_TYPE_ns1__executeCommandResponse
#define SOAP_TYPE_ns1__executeCommandResponse (9)
-/* ns1:executeCommandResponse */
-struct ns1__executeCommandResponse
-{
-public:
- char **result; /* SOAP 1.2 RPC return element (when namespace qualified) */ /* optional element of type xsd:string */
-public:
- int soap_type() const { return 9; } /* = unique type id SOAP_TYPE_ns1__executeCommandResponse */
+/* complex XSD type 'ns1:executeCommandResponse': */
+struct ns1__executeCommandResponse {
+ public:
+ /** Optional element 'result' of XSD type 'xsd:string' */
+ char **result;
+ public:
+ /** Return unique type id SOAP_TYPE_ns1__executeCommandResponse */
+ int soap_type() const { return SOAP_TYPE_ns1__executeCommandResponse; }
+ /** Constructor with member initializations */
+ ns1__executeCommandResponse()
+ {
+ result = (char **)0;
+ }
+ /** Friend allocator used by soap_new_ns1__executeCommandResponse(struct soap*, int) */
+ friend SOAP_FMAC1 ns1__executeCommandResponse * SOAP_FMAC2 soap_instantiate_ns1__executeCommandResponse(struct soap*, int, const char*, const char*, size_t*);
};
#endif
+/* gsoap.stub:1 */
#ifndef SOAP_TYPE_ns1__executeCommand
#define SOAP_TYPE_ns1__executeCommand (10)
-/* ns1:executeCommand */
-struct ns1__executeCommand
-{
-public:
- char *command; /* optional element of type xsd:string */
-public:
- int soap_type() const { return 10; } /* = unique type id SOAP_TYPE_ns1__executeCommand */
+/* complex XSD type 'ns1:executeCommand': */
+struct ns1__executeCommand {
+ public:
+ /** Optional element 'command' of XSD type 'xsd:string' */
+ char *command;
+ public:
+ /** Return unique type id SOAP_TYPE_ns1__executeCommand */
+ int soap_type() const { return SOAP_TYPE_ns1__executeCommand; }
+ /** Constructor with member initializations */
+ ns1__executeCommand()
+ {
+ command = (char *)0;
+ }
+ /** Friend allocator used by soap_new_ns1__executeCommand(struct soap*, int) */
+ friend SOAP_FMAC1 ns1__executeCommand * SOAP_FMAC2 soap_instantiate_ns1__executeCommand(struct soap*, int, const char*, const char*, size_t*);
};
#endif
+/* gsoap.stub:2 */
#ifndef WITH_NOGLOBAL
-
#ifndef SOAP_TYPE_SOAP_ENV__Header
#define SOAP_TYPE_SOAP_ENV__Header (11)
-/* SOAP Header: */
-struct SOAP_ENV__Header
-{
-public:
- int soap_type() const { return 11; } /* = unique type id SOAP_TYPE_SOAP_ENV__Header */
-#ifdef WITH_NOEMPTYSTRUCT
-private:
- char dummy; /* dummy member to enable compilation */
-#endif
+/* SOAP_ENV__Header: */
+struct SOAP_ENV__Header {
+ public:
+ /** Return unique type id SOAP_TYPE_SOAP_ENV__Header */
+ int soap_type() const { return SOAP_TYPE_SOAP_ENV__Header; }
+ /** Constructor with member initializations */
+ SOAP_ENV__Header()
+ {
+ }
+ /** Friend allocator used by soap_new_SOAP_ENV__Header(struct soap*, int) */
+ friend SOAP_FMAC1 SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Header(struct soap*, int, const char*, const char*, size_t*);
};
#endif
-
#endif
+/* gsoap.stub:2 */
#ifndef WITH_NOGLOBAL
-
#ifndef SOAP_TYPE_SOAP_ENV__Code
#define SOAP_TYPE_SOAP_ENV__Code (12)
-/* SOAP Fault Code: */
-struct SOAP_ENV__Code
-{
-public:
- char *SOAP_ENV__Value; /* optional element of type xsd:QName */
- struct SOAP_ENV__Code *SOAP_ENV__Subcode; /* optional element of type SOAP-ENV:Code */
-public:
- int soap_type() const { return 12; } /* = unique type id SOAP_TYPE_SOAP_ENV__Code */
+/* Type SOAP_ENV__Code is a recursive data type, (in)directly referencing itself through its (base or derived class) members */
+/* SOAP_ENV__Code: */
+struct SOAP_ENV__Code {
+ public:
+ /** Optional element 'SOAP-ENV:Value' of XSD type 'xsd:QName' */
+ char *SOAP_ENV__Value;
+ /** Optional element 'SOAP-ENV:Subcode' of XSD type 'SOAP-ENV:Code' */
+ struct SOAP_ENV__Code *SOAP_ENV__Subcode;
+ public:
+ /** Return unique type id SOAP_TYPE_SOAP_ENV__Code */
+ int soap_type() const { return SOAP_TYPE_SOAP_ENV__Code; }
+ /** Constructor with member initializations */
+ SOAP_ENV__Code()
+ {
+ SOAP_ENV__Value = (char *)0;
+ SOAP_ENV__Subcode = (struct SOAP_ENV__Code *)0;
+ }
+ /** Friend allocator used by soap_new_SOAP_ENV__Code(struct soap*, int) */
+ friend SOAP_FMAC1 SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(struct soap*, int, const char*, const char*, size_t*);
};
#endif
-
#endif
+/* gsoap.stub:2 */
#ifndef WITH_NOGLOBAL
-
#ifndef SOAP_TYPE_SOAP_ENV__Detail
#define SOAP_TYPE_SOAP_ENV__Detail (14)
-/* SOAP-ENV:Detail */
-struct SOAP_ENV__Detail
-{
-public:
- char *__any;
- int __type; /* any type of element <fault> (defined below) */
- void *fault; /* transient */
-public:
- int soap_type() const { return 14; } /* = unique type id SOAP_TYPE_SOAP_ENV__Detail */
+/* SOAP_ENV__Detail: */
+struct SOAP_ENV__Detail {
+ public:
+ char *__any;
+ /** Any type of element 'fault' assigned to fault with its SOAP_TYPE_T assigned to __type */
+ /** Do not create a cyclic data structure throught this member unless SOAP encoding or SOAP_XML_GRAPH are used for id-ref serialization */
+ int __type;
+ void *fault;
+ public:
+ /** Return unique type id SOAP_TYPE_SOAP_ENV__Detail */
+ int soap_type() const { return SOAP_TYPE_SOAP_ENV__Detail; }
+ /** Constructor with member initializations */
+ SOAP_ENV__Detail()
+ {
+ __any = (char *)0;
+ __type = 0;
+ fault = NULL;
+ }
+ /** Friend allocator used by soap_new_SOAP_ENV__Detail(struct soap*, int) */
+ friend SOAP_FMAC1 SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detail(struct soap*, int, const char*, const char*, size_t*);
};
#endif
-
#endif
+/* gsoap.stub:2 */
#ifndef WITH_NOGLOBAL
-
#ifndef SOAP_TYPE_SOAP_ENV__Reason
#define SOAP_TYPE_SOAP_ENV__Reason (17)
-/* SOAP-ENV:Reason */
-struct SOAP_ENV__Reason
-{
-public:
- char *SOAP_ENV__Text; /* optional element of type xsd:string */
-public:
- int soap_type() const { return 17; } /* = unique type id SOAP_TYPE_SOAP_ENV__Reason */
+/* SOAP_ENV__Reason: */
+struct SOAP_ENV__Reason {
+ public:
+ /** Optional element 'SOAP-ENV:Text' of XSD type 'xsd:string' */
+ char *SOAP_ENV__Text;
+ public:
+ /** Return unique type id SOAP_TYPE_SOAP_ENV__Reason */
+ int soap_type() const { return SOAP_TYPE_SOAP_ENV__Reason; }
+ /** Constructor with member initializations */
+ SOAP_ENV__Reason()
+ {
+ SOAP_ENV__Text = (char *)0;
+ }
+ /** Friend allocator used by soap_new_SOAP_ENV__Reason(struct soap*, int) */
+ friend SOAP_FMAC1 SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reason(struct soap*, int, const char*, const char*, size_t*);
};
#endif
-
#endif
+/* gsoap.stub:2 */
#ifndef WITH_NOGLOBAL
-
#ifndef SOAP_TYPE_SOAP_ENV__Fault
#define SOAP_TYPE_SOAP_ENV__Fault (18)
-/* SOAP Fault: */
-struct SOAP_ENV__Fault
-{
-public:
- char *faultcode; /* optional element of type xsd:QName */
- char *faultstring; /* optional element of type xsd:string */
- char *faultactor; /* optional element of type xsd:string */
- struct SOAP_ENV__Detail *detail; /* optional element of type SOAP-ENV:Detail */
- struct SOAP_ENV__Code *SOAP_ENV__Code; /* optional element of type SOAP-ENV:Code */
- struct SOAP_ENV__Reason *SOAP_ENV__Reason; /* optional element of type SOAP-ENV:Reason */
- char *SOAP_ENV__Node; /* optional element of type xsd:string */
- char *SOAP_ENV__Role; /* optional element of type xsd:string */
- struct SOAP_ENV__Detail *SOAP_ENV__Detail; /* optional element of type SOAP-ENV:Detail */
-public:
- int soap_type() const { return 18; } /* = unique type id SOAP_TYPE_SOAP_ENV__Fault */
+/* SOAP_ENV__Fault: */
+struct SOAP_ENV__Fault {
+ public:
+ /** Optional element 'faultcode' of XSD type 'xsd:QName' */
+ char *faultcode;
+ /** Optional element 'faultstring' of XSD type 'xsd:string' */
+ char *faultstring;
+ /** Optional element 'faultactor' of XSD type 'xsd:string' */
+ char *faultactor;
+ /** Optional element 'detail' of XSD type 'SOAP-ENV:Detail' */
+ struct SOAP_ENV__Detail *detail;
+ /** Optional element 'SOAP-ENV:Code' of XSD type 'SOAP-ENV:Code' */
+ struct SOAP_ENV__Code *SOAP_ENV__Code;
+ /** Optional element 'SOAP-ENV:Reason' of XSD type 'SOAP-ENV:Reason' */
+ struct SOAP_ENV__Reason *SOAP_ENV__Reason;
+ /** Optional element 'SOAP-ENV:Node' of XSD type 'xsd:string' */
+ char *SOAP_ENV__Node;
+ /** Optional element 'SOAP-ENV:Role' of XSD type 'xsd:string' */
+ char *SOAP_ENV__Role;
+ /** Optional element 'SOAP-ENV:Detail' of XSD type 'SOAP-ENV:Detail' */
+ struct SOAP_ENV__Detail *SOAP_ENV__Detail;
+ public:
+ /** Return unique type id SOAP_TYPE_SOAP_ENV__Fault */
+ int soap_type() const { return SOAP_TYPE_SOAP_ENV__Fault; }
+ /** Constructor with member initializations */
+ SOAP_ENV__Fault()
+ {
+ faultcode = (char *)0;
+ faultstring = (char *)0;
+ faultactor = (char *)0;
+ detail = (struct SOAP_ENV__Detail *)0;
+ SOAP_ENV__Code = (struct SOAP_ENV__Code *)0;
+ SOAP_ENV__Reason = (struct SOAP_ENV__Reason *)0;
+ SOAP_ENV__Node = (char *)0;
+ SOAP_ENV__Role = (char *)0;
+ SOAP_ENV__Detail = (struct SOAP_ENV__Detail *)0;
+ }
+ /** Friend allocator used by soap_new_SOAP_ENV__Fault(struct soap*, int) */
+ friend SOAP_FMAC1 SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(struct soap*, int, const char*, const char*, size_t*);
};
#endif
-
#endif
/******************************************************************************\
@@ -164,16 +228,105 @@ public:
* *
\******************************************************************************/
+
+/* gsoap.stub:1 */
#ifndef SOAP_TYPE__QName
#define SOAP_TYPE__QName (5)
typedef char *_QName;
#endif
+/* gsoap.stub:1 */
#ifndef SOAP_TYPE__XML
#define SOAP_TYPE__XML (6)
typedef char *_XML;
#endif
+/******************************************************************************\
+ * *
+ * Serializable Types *
+ * *
+\******************************************************************************/
+
+
+/* char has binding name 'byte' for type 'xsd:byte' */
+#ifndef SOAP_TYPE_byte
+#define SOAP_TYPE_byte (3)
+#endif
+
+/* int has binding name 'int' for type 'xsd:int' */
+#ifndef SOAP_TYPE_int
+#define SOAP_TYPE_int (1)
+#endif
+
+/* struct SOAP_ENV__Fault has binding name 'SOAP_ENV__Fault' for type '' */
+#ifndef SOAP_TYPE_SOAP_ENV__Fault
+#define SOAP_TYPE_SOAP_ENV__Fault (18)
+#endif
+
+/* struct SOAP_ENV__Reason has binding name 'SOAP_ENV__Reason' for type '' */
+#ifndef SOAP_TYPE_SOAP_ENV__Reason
+#define SOAP_TYPE_SOAP_ENV__Reason (17)
+#endif
+
+/* struct SOAP_ENV__Detail has binding name 'SOAP_ENV__Detail' for type '' */
+#ifndef SOAP_TYPE_SOAP_ENV__Detail
+#define SOAP_TYPE_SOAP_ENV__Detail (14)
+#endif
+
+/* struct SOAP_ENV__Code has binding name 'SOAP_ENV__Code' for type '' */
+#ifndef SOAP_TYPE_SOAP_ENV__Code
+#define SOAP_TYPE_SOAP_ENV__Code (12)
+#endif
+
+/* struct SOAP_ENV__Header has binding name 'SOAP_ENV__Header' for type '' */
+#ifndef SOAP_TYPE_SOAP_ENV__Header
+#define SOAP_TYPE_SOAP_ENV__Header (11)
+#endif
+
+/* struct ns1__executeCommand has binding name 'ns1__executeCommand' for type 'ns1:executeCommand' */
+#ifndef SOAP_TYPE_ns1__executeCommand
+#define SOAP_TYPE_ns1__executeCommand (10)
+#endif
+
+/* struct ns1__executeCommandResponse has binding name 'ns1__executeCommandResponse' for type 'ns1:executeCommandResponse' */
+#ifndef SOAP_TYPE_ns1__executeCommandResponse
+#define SOAP_TYPE_ns1__executeCommandResponse (9)
+#endif
+
+/* struct SOAP_ENV__Reason * has binding name 'PointerToSOAP_ENV__Reason' for type '' */
+#ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason
+#define SOAP_TYPE_PointerToSOAP_ENV__Reason (20)
+#endif
+
+/* struct SOAP_ENV__Detail * has binding name 'PointerToSOAP_ENV__Detail' for type '' */
+#ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail
+#define SOAP_TYPE_PointerToSOAP_ENV__Detail (19)
+#endif
+
+/* struct SOAP_ENV__Code * has binding name 'PointerToSOAP_ENV__Code' for type '' */
+#ifndef SOAP_TYPE_PointerToSOAP_ENV__Code
+#define SOAP_TYPE_PointerToSOAP_ENV__Code (13)
+#endif
+
+/* char ** has binding name 'PointerTostring' for type 'xsd:string' */
+#ifndef SOAP_TYPE_PointerTostring
+#define SOAP_TYPE_PointerTostring (7)
+#endif
+
+/* _XML has binding name '_XML' for type '' */
+#ifndef SOAP_TYPE__XML
+#define SOAP_TYPE__XML (6)
+#endif
+
+/* _QName has binding name '_QName' for type 'xsd:QName' */
+#ifndef SOAP_TYPE__QName
+#define SOAP_TYPE__QName (5)
+#endif
+
+/* char * has binding name 'string' for type 'xsd:string' */
+#ifndef SOAP_TYPE_string
+#define SOAP_TYPE_string (4)
+#endif
/******************************************************************************\
* *
@@ -188,8 +341,8 @@ typedef char *_XML;
* *
\******************************************************************************/
-
-SOAP_FMAC5 int SOAP_FMAC6 ns1__executeCommand(struct soap*, char *command, char **result);
+ /** Web service operation 'ns1__executeCommand' (returns SOAP_OK or error code) */
+ SOAP_FMAC5 int SOAP_FMAC6 ns1__executeCommand(struct soap*, char *command, char **result);
/******************************************************************************\
* *
diff --git a/dep/gsoap/stdsoap2.cpp b/dep/gsoap/stdsoap2.cpp
index 6186f8904e3..bec1d4b02a5 100644
--- a/dep/gsoap/stdsoap2.cpp
+++ b/dep/gsoap/stdsoap2.cpp
@@ -1,10 +1,10 @@
/*
- stdsoap2.c[pp] 2.8.17r
+ stdsoap2.c[pp] 2.8.33
- gSOAP runtime engine
+ gSOAP runtime engine
gSOAP XML Web services tools
-Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc., All Rights Reserved.
+Copyright (C) 2000-2016, Robert van Engelen, Genivia Inc., All Rights Reserved.
This part of the software is released under ONE of the following licenses:
GPL, or the gSOAP public license, or Genivia's license for commercial use.
--------------------------------------------------------------------------------
@@ -24,7 +24,7 @@ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the License.
The Initial Developer of the Original Code is Robert A. van Engelen.
-Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc., All Rights Reserved.
+Copyright (C) 2000-2016, Robert van Engelen, Genivia Inc., All Rights Reserved.
--------------------------------------------------------------------------------
GPL license.
@@ -51,43 +51,52 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
--------------------------------------------------------------------------------
*/
-#define GSOAP_LIB_VERSION 20817
+#define GSOAP_LIB_VERSION 20833
#ifdef AS400
-# pragma convert(819) /* EBCDIC to ASCII */
+# pragma convert(819) /* EBCDIC to ASCII */
#endif
#include "stdsoap2.h"
-#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE)
-#include <ipcom_key_db.h>
-#endif
+
#if GSOAP_VERSION != GSOAP_LIB_VERSION
# error "GSOAP VERSION MISMATCH IN LIBRARY: PLEASE REINSTALL PACKAGE"
#endif
+#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE)
+# include <ipcom_key_db.h>
+#endif
+
#ifdef __BORLANDC__
# pragma warn -8060
#else
# ifdef WIN32
# ifdef UNDER_CE
-# pragma comment(lib, "ws2.lib") /* WinCE */
+# pragma comment(lib, "ws2.lib") /* WinCE */
# else
-# pragma comment(lib, "ws2_32.lib")
+# pragma comment(lib, "Ws2_32.lib")
# endif
# pragma warning(disable : 4996) /* disable deprecation warnings */
# endif
#endif
#ifdef __cplusplus
-SOAP_SOURCE_STAMP("@(#) stdsoap2.cpp ver 2.8.17r 2013-12-18 00:00:00 GMT")
+SOAP_SOURCE_STAMP("@(#) stdsoap2.cpp ver 2.8.33 2016-06-14 00:00:00 GMT")
extern "C" {
#else
-SOAP_SOURCE_STAMP("@(#) stdsoap2.c ver 2.8.17r 2013-12-18 00:00:00 GMT")
+SOAP_SOURCE_STAMP("@(#) stdsoap2.c ver 2.8.32 2016-06-14 00:00:00 GMT")
#endif
-/* 8bit character representing unknown/nonrepresentable character data (e.g. not supported by current locale with multibyte support enabled) */
+/* 8bit character representing unknown character entity or multibyte data */
#ifndef SOAP_UNKNOWN_CHAR
-#define SOAP_UNKNOWN_CHAR (127)
+# define SOAP_UNKNOWN_CHAR (0x7F)
+#endif
+
+/* unicode character representing unknown characters outside the XML 1.0 UTF8 unicode space */
+#ifdef WITH_REPLACE_ILLEGAL_UTF8
+# ifndef SOAP_UNKNOWN_UNICODE_CHAR
+# define SOAP_UNKNOWN_UNICODE_CHAR (0xFFFD)
+# endif
#endif
/* EOF=-1 */
@@ -97,13 +106,13 @@ SOAP_SOURCE_STAMP("@(#) stdsoap2.c ver 2.8.17r 2013-12-18 00:00:00 GMT")
#define SOAP_QT (soap_wchar)(-5) /* XML-specific '"' */
#define SOAP_AP (soap_wchar)(-6) /* XML-specific ''' */
-#define soap_blank(c) ((c)+1 > 0 && (c) <= 32)
-#define soap_notblank(c) ((c) > 32)
+#define soap_blank(c) ((c)+1 > 0 && (c) <= 32)
+#define soap_notblank(c) ((c) > 32)
#if defined(WIN32) && !defined(UNDER_CE)
-#define soap_hash_ptr(p) ((PtrToUlong(p) >> 3) & (SOAP_PTRHASH - 1))
+#define soap_hash_ptr(p) ((PtrToUlong(p) >> 3) & (SOAP_PTRHASH - 1))
#else
-#define soap_hash_ptr(p) ((size_t)(((unsigned long)(p) >> 3) & (SOAP_PTRHASH-1)))
+#define soap_hash_ptr(p) ((size_t)(((unsigned long)(p) >> 3) & (SOAP_PTRHASH-1)))
#endif
#if !defined(WITH_LEAN) || defined(SOAP_DEBUG)
@@ -123,7 +132,7 @@ static void soap_track_unlink(struct soap*, const void*);
#ifndef PALM_2
static int soap_set_error(struct soap*, const char*, const char*, const char*, const char*, int);
static int soap_copy_fault(struct soap*, const char*, const char*, const char*, const char*);
-static int soap_getattrval(struct soap*, char*, size_t, soap_wchar);
+static int soap_getattrval(struct soap*, char*, size_t*, soap_wchar);
#endif
#ifndef PALM_1
@@ -139,18 +148,26 @@ static int soap_ntlm_handshake(struct soap *soap, int command, const char *endpo
#endif
#ifndef WITH_NOIDREF
static int soap_has_copies(struct soap*, const char*, const char*);
+static int soap_type_punned(struct soap*, const struct soap_ilist*);
+static int soap_is_shaky(struct soap*, void*);
static void soap_init_iht(struct soap*);
static void soap_free_iht(struct soap*);
+#endif
static void soap_init_pht(struct soap*);
static void soap_free_pht(struct soap*);
#endif
-#endif
#ifndef WITH_LEAN
static const char *soap_set_validation_fault(struct soap*, const char*, const char*);
static int soap_isnumeric(struct soap*, const char*);
static struct soap_nlist *soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized);
static void soap_utilize_ns(struct soap *soap, const char *tag);
+static const wchar_t* soap_wstring(struct soap *soap, const char *s, long minlen, long maxlen, const char *pattern);
+#endif
+
+#ifndef PALM_2
+static const char* soap_string(struct soap *soap, const char *s, long minlen, long maxlen, const char *pattern);
+static const char* soap_QName(struct soap *soap, const char *s, long minlen, long maxlen, const char *pattern);
#endif
#ifndef WITH_LEANER
@@ -184,6 +201,7 @@ static int ssl_password(char*, int, int, void *);
# define SOAP_SSL_RSA_BITS 2048
# endif
static int soap_ssl_init_done = 0;
+static int ssl_auth_init(struct soap*);
static const char *ssl_verify(struct soap *soap, const char *host);
# if defined(HAVE_PTHREAD_H)
# include <pthread.h>
@@ -196,6 +214,12 @@ static const char *ssl_verify(struct soap *soap, const char *host);
# endif
#endif
+#ifdef WITH_SYSTEMSSL
+static int ssl_auth_init(struct soap*);
+static int ssl_recv(int sk, void *s, int n, char *user);
+static int ssl_send(int sk, void *s, int n, char *user);
+#endif
+
#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER)
#ifndef PALM_1
static const char *soap_decode(char*, size_t, const char*, const char*);
@@ -307,9 +331,9 @@ const char soap_base64i[81] = "\76XXX\77\64\65\66\67\70\71\72\73\74\75XXXXXXX\00
#endif
#ifndef WITH_LEAN
-static const char soap_indent[11] = "\n\t\t\t\t\t\t\t\t\t";
+static const char soap_indent[21] = "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
/* Alternative indentation form for SOAP_XML_INDENT:
-static const char soap_indent[21] = "\n ";
+static const char soap_indent[41] = "\n ";
*/
#endif
@@ -511,14 +535,14 @@ static const struct soap_code_map h_ssl_error_codes[] =
#ifndef WITH_LEANER
static const struct soap_code_map mime_codes[] =
-{ { SOAP_MIME_7BIT, "7bit" },
- { SOAP_MIME_8BIT, "8bit" },
- { SOAP_MIME_BINARY, "binary" },
+{ { SOAP_MIME_7BIT, "7bit" },
+ { SOAP_MIME_8BIT, "8bit" },
+ { SOAP_MIME_BINARY, "binary" },
{ SOAP_MIME_QUOTED_PRINTABLE, "quoted-printable" },
- { SOAP_MIME_BASE64, "base64" },
- { SOAP_MIME_IETF_TOKEN, "ietf-token" },
- { SOAP_MIME_X_TOKEN, "x-token" },
- { 0, NULL }
+ { SOAP_MIME_BASE64, "base64" },
+ { SOAP_MIME_IETF_TOKEN, "ietf-token" },
+ { SOAP_MIME_X_TOKEN, "x-token" },
+ { 0, NULL }
};
#endif
@@ -531,13 +555,14 @@ extern int h_errno;
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
static int
fsend(struct soap *soap, const char *s, size_t n)
-{ register int nwritten, err;
+{ int nwritten, err;
SOAP_SOCKET sk;
-#if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
+#if defined(__cplusplus) && !defined(WITH_COMPAT)
if (soap->os)
{ soap->os->write(s, (std::streamsize)n);
if (soap->os->good())
@@ -554,7 +579,7 @@ fsend(struct soap *soap, const char *s, size_t n)
{
if (soap->send_timeout)
{ for (;;)
- { register int r;
+ { int r;
#ifdef WITH_OPENSSL
if (soap->ssl)
r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout);
@@ -565,6 +590,11 @@ fsend(struct soap *soap, const char *s, size_t n)
r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout);
else
#endif
+#ifdef WITH_SYSTEMSSL
+ if (soap->ssl)
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout);
+ else
+#endif
r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->send_timeout);
if (r > 0)
break;
@@ -589,10 +619,18 @@ fsend(struct soap *soap, const char *s, size_t n)
nwritten = gnutls_record_send(soap->session, s, n);
else
#endif
+#ifdef WITH_SYSTEMSSL
+ if (soap->ssl)
+ { err = gsk_secure_socket_write(soap->ssl, (char*)s, n, &nwritten);
+ if (err != GSK_OK)
+ nwritten = 0;
+ }
+ else
+#endif
#ifndef WITH_LEAN
if ((soap->omode & SOAP_IO_UDP))
{ if (soap->peerlen)
- nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, (SOAP_WINSOCKINT)soap->peerlen);
+ nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, &soap->peer.addr, (SOAP_WINSOCKINT)soap->peerlen);
else
nwritten = send(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags);
/* retry and back-off algorithm */
@@ -608,14 +646,13 @@ fsend(struct soap *soap, const char *s, size_t n)
do
{ tcp_select(soap, sk, SOAP_TCP_SELECT_ERR, -1000 * udp_delay);
if (soap->peerlen)
- nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, (SOAP_WINSOCKINT)soap->peerlen);
+ nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, &soap->peer.addr, (SOAP_WINSOCKINT)soap->peerlen);
else
nwritten = send(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags);
udp_delay <<= 1;
if (udp_delay > 500) /* UDP_UPPER_DELAY */
udp_delay = 500;
- }
- while (nwritten < 0 && --udp_repeat > 0);
+ } while (nwritten < 0 && --udp_repeat > 0);
}
if (nwritten < 0)
{ err = soap_socket_errno(sk);
@@ -635,7 +672,7 @@ fsend(struct soap *soap, const char *s, size_t n)
#endif
if (nwritten <= 0)
{
- register int r = 0;
+ int r = 0;
err = soap_socket_errno(sk);
#ifdef WITH_OPENSSL
if (soap->ssl && (r = SSL_get_error(soap->ssl, nwritten)) != SSL_ERROR_NONE && r != SSL_ERROR_WANT_READ && r != SSL_ERROR_WANT_WRITE)
@@ -723,6 +760,7 @@ fsend(struct soap *soap, const char *s, size_t n)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -731,25 +769,25 @@ soap_send_raw(struct soap *soap, const char *s, size_t n)
{ if (!n)
return SOAP_OK;
#ifndef WITH_LEANER
- if (soap->fpreparesend && (soap->mode & SOAP_IO) != SOAP_IO_STORE && (soap->mode & SOAP_IO_LENGTH) && (soap->error = soap->fpreparesend(soap, s, n)))
+ if (soap->fpreparesend && (soap->mode & SOAP_IO) != SOAP_IO_STORE && (soap->mode & SOAP_IO_LENGTH) && (soap->error = soap->fpreparesend(soap, s, n)) != SOAP_OK)
return soap->error;
- if (soap->ffiltersend && (soap->error = soap->ffiltersend(soap, &s, &n)))
+ if (soap->ffiltersend && (soap->error = soap->ffiltersend(soap, &s, &n)) != SOAP_OK)
return soap->error;
#endif
- if (soap->mode & SOAP_IO_LENGTH)
+ if ((soap->mode & SOAP_IO_LENGTH))
soap->count += n;
else if (soap->mode & SOAP_IO)
- { register size_t i = SOAP_BUFLEN - soap->bufidx;
+ { size_t i = sizeof(soap->buf) - soap->bufidx;
while (n >= i)
- { memcpy(soap->buf + soap->bufidx, s, i);
- soap->bufidx = SOAP_BUFLEN;
+ { soap_memcpy((void*)(soap->buf + soap->bufidx), i, (const void*)s, i);
+ soap->bufidx = sizeof(soap->buf);
if (soap_flush(soap))
return soap->error;
s += i;
n -= i;
- i = SOAP_BUFLEN;
+ i = sizeof(soap->buf);
}
- memcpy(soap->buf + soap->bufidx, s, n);
+ soap_memcpy((void*)(soap->buf + soap->bufidx), sizeof(soap->buf) - soap->bufidx, (const void*)s, n);
soap->bufidx += n;
}
else
@@ -759,18 +797,19 @@ soap_send_raw(struct soap *soap, const char *s, size_t n)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_flush(struct soap *soap)
-{ register size_t n = soap->bufidx;
+{ size_t n = soap->bufidx;
if (n)
{
#ifndef WITH_LEANER
if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
- { register int r;
- if (soap->fpreparesend && (r = soap->fpreparesend(soap, soap->buf, n)))
+ { int r;
+ if (soap->fpreparesend && (r = soap->fpreparesend(soap, soap->buf, n)) != SOAP_OK)
return soap->error = r;
}
#endif
@@ -789,10 +828,10 @@ soap_flush(struct soap *soap)
return soap->error = SOAP_ZLIB_ERROR;
}
if (!soap->d_stream->avail_out)
- { if (soap_flush_raw(soap, soap->z_buf, SOAP_BUFLEN))
+ { if (soap_flush_raw(soap, soap->z_buf, sizeof(soap->buf)))
return soap->error;
soap->d_stream->next_out = (Byte*)soap->z_buf;
- soap->d_stream->avail_out = SOAP_BUFLEN;
+ soap->d_stream->avail_out = sizeof(soap->buf);
}
} while (soap->d_stream->avail_in);
}
@@ -805,28 +844,27 @@ soap_flush(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_flush_raw(struct soap *soap, const char *s, size_t n)
{ if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
- { register char *t;
- if (!(t = (char*)soap_push_block(soap, NULL, n)))
+ { void *t;
+ t = soap_push_block(soap, NULL, n);
+ if (!t)
return soap->error = SOAP_EOM;
- memcpy(t, s, n);
+ soap_memcpy(t, n, (const void*)s, n);
return SOAP_OK;
}
#ifndef WITH_LEANER
if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
- { char t[16];
-#ifdef HAVE_SNPRINTF
- soap_snprintf(t, sizeof(t), &"\r\n%lX\r\n"[soap->chunksize ? 0 : 2], (unsigned long)n);
-#else
- sprintf(t, &"\r\n%lX\r\n"[soap->chunksize ? 0 : 2], (unsigned long)n);
-#endif
+ { char t[24];
+ (SOAP_SNPRINTF(t, sizeof(t), 20), &"\r\n%lX\r\n"[soap->chunksize ? 0 : 2], (unsigned long)n);
DBGMSG(SENT, t, strlen(t));
- if ((soap->error = soap->fsend(soap, t, strlen(t))))
+ soap->error = soap->fsend(soap, t, strlen(t));
+ if (soap->error)
return soap->error;
soap->chunksize += n;
}
@@ -838,6 +876,7 @@ soap_flush_raw(struct soap *soap, const char *s, size_t n)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -850,6 +889,7 @@ soap_send(struct soap *soap, const char *s)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -864,6 +904,7 @@ soap_send2(struct soap *soap, const char *s1, const char *s2)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -879,20 +920,30 @@ soap_send3(struct soap *soap, const char *s1, const char *s2, const char *s3)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
static size_t
frecv(struct soap *soap, char *s, size_t n)
-{ register int r;
- register int retries = 100; /* max 100 retries with non-blocking sockets */
+{ int r;
+ int retries = 100; /* max 100 retries with non-blocking sockets */
SOAP_SOCKET sk;
soap->errnum = 0;
-#if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
- if (soap->is)
+#if defined(__cplusplus) && !defined(WITH_COMPAT)
+ if (soap->is) /* recv from C++ stream */
{ if (soap->is->good())
- return soap->is->read(s, (std::streamsize)n).gcount();
+ return (size_t)soap->is->read(s, (std::streamsize)n).gcount();
return 0;
}
+#else
+ if (soap->is) /* recv from C buffer until NUL */
+ { size_t l = strlen(soap->is);
+ if (l > n)
+ l = n;
+ soap_memcpy(s, n, soap->is, l);
+ soap->is += l;
+ return l;
+ }
#endif
sk = soap->recvsk;
if (!soap_valid_socket(sk))
@@ -900,11 +951,11 @@ frecv(struct soap *soap, char *s, size_t n)
if (soap_valid_socket(sk))
{ for (;;)
{
-#ifdef WITH_OPENSSL
- register int err = 0;
+#if defined(WITH_OPENSSL) || defined(WITH_SYSTEMSSL)
+ int err = 0;
#endif
#ifdef WITH_OPENSSL
- if (soap->recv_timeout && !soap->ssl) /* SSL: sockets are nonblocking */
+ if (soap->recv_timeout && !soap->ssl) /* OpenSSL: sockets are nonblocking so go ahead to read */
#else
if (soap->recv_timeout)
#endif
@@ -944,20 +995,30 @@ frecv(struct soap *soap, char *s, size_t n)
}
else
#endif
+#ifdef WITH_SYSTEMSSL
+ if (soap->ssl)
+ { err = gsk_secure_socket_read(soap->ssl, s, n, &r);
+ if (err == GSK_OK && r > 0)
+ return (size_t)r;
+ if (err != GSK_OK && err != GSK_WOULD_BLOCK && err != GSK_WOULD_BLOCK_WRITE)
+ return 0;
+ }
+ else
+#endif
{
#ifndef WITH_LEAN
if ((soap->omode & SOAP_IO_UDP))
{ SOAP_SOCKLEN_T k = (SOAP_SOCKLEN_T)sizeof(soap->peer);
memset((void*)&soap->peer, 0, sizeof(soap->peer));
- r = recvfrom(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags, (struct sockaddr*)&soap->peer, &k); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
+ r = recvfrom(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags, &soap->peer.addr, &k); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
soap->peerlen = (size_t)k;
#ifndef WITH_IPV6
- soap->ip = ntohl(soap->peer.sin_addr.s_addr);
+ soap->ip = ntohl(soap->peer.in.sin_addr.s_addr);
#endif
}
else
#endif
- r = recv(sk, s, (int)n, soap->socket_flags);
+ r = recv(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags);
#ifdef PALM
/* CycleSyncDisplay(curStatusMsg); */
#endif
@@ -977,6 +1038,10 @@ frecv(struct soap *soap, char *s, size_t n)
if (soap->session && gnutls_record_get_direction(soap->session))
r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
else
+#elif defined(WITH_SYSTEMSSL)
+ if (soap->ssl && err == GSK_WOULD_BLOCK_WRITE)
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
+ else
#endif
r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5);
if (!r && soap->recv_timeout)
@@ -1011,7 +1076,7 @@ frecv(struct soap *soap, char *s, size_t n)
#ifdef WIN32
r = _read(soap->recvfd, s, (unsigned int)n);
#else
- r = read(soap->recvfd, s, (unsigned int)n);
+ r = read(soap->recvfd, s, n);
#endif
if (r >= 0)
return (size_t)r;
@@ -1024,6 +1089,7 @@ frecv(struct soap *soap, char *s, size_t n)
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
static soap_wchar
@@ -1031,7 +1097,7 @@ soap_getchunkchar(struct soap *soap)
{ if (soap->bufidx < soap->buflen)
return soap->buf[soap->bufidx++];
soap->bufidx = 0;
- soap->buflen = soap->chunkbuflen = soap->frecv(soap, soap->buf, SOAP_BUFLEN);
+ soap->buflen = soap->chunkbuflen = soap->frecv(soap, soap->buf, sizeof(soap->buf));
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes from socket=%d/fd=%d\n", (unsigned int)soap->buflen, soap->socket, soap->recvfd));
DBGMSG(RECV, soap->buf, soap->buflen);
if (soap->buflen)
@@ -1042,6 +1108,7 @@ soap_getchunkchar(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
static int
soap_isxdigit(int c)
@@ -1050,17 +1117,18 @@ soap_isxdigit(int c)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_recv_raw(struct soap *soap)
-{ register size_t ret;
+{ size_t ret;
#if !defined(WITH_LEANER) || defined(WITH_ZLIB)
- register int r;
+ int r;
#endif
#ifdef WITH_ZLIB
- if (soap->mode & SOAP_ENC_ZLIB)
+ if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream)
{ if (soap->d_stream->next_out == Z_NULL)
{ soap->bufidx = soap->buflen = 0;
return EOF;
@@ -1068,13 +1136,13 @@ soap_recv_raw(struct soap *soap)
if (soap->d_stream->avail_in || !soap->d_stream->avail_out)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflating\n"));
soap->d_stream->next_out = (Byte*)soap->buf;
- soap->d_stream->avail_out = SOAP_BUFLEN;
+ soap->d_stream->avail_out = sizeof(soap->buf);
r = inflate(soap->d_stream, Z_NO_FLUSH);
if (r == Z_NEED_DICT && soap->z_dict)
r = inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len);
if (r == Z_OK || r == Z_STREAM_END)
{ soap->bufidx = 0;
- ret = soap->buflen = SOAP_BUFLEN - soap->d_stream->avail_out;
+ ret = soap->buflen = sizeof(soap->buf) - soap->d_stream->avail_out;
if (soap->zlib_in == SOAP_ZLIB_GZIP)
soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)ret);
if (r == Z_STREAM_END)
@@ -1084,11 +1152,15 @@ soap_recv_raw(struct soap *soap)
}
if (ret)
{ soap->count += ret;
+ if (soap->count > SOAP_MAXINFLATESIZE && soap->z_ratio_in < SOAP_MINDEFLATERATIO)
+ { soap->d_stream->msg = (char*)"caught SOAP_MINDEFLATERATIO explosive decompression guard (remedy: increase SOAP_MAXINFLATESIZE and/or decrease SOAP_MINDEFLATERATIO)";
+ return soap->error = SOAP_ZLIB_ERROR;
+ }
DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- decompressed ----\n"));
DBGMSG(RECV, soap->buf, ret);
DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n----\n"));
#ifndef WITH_LEANER
- if (soap->fpreparerecv && (r = soap->fpreparerecv(soap, soap->buf, ret)))
+ if (soap->fpreparerecv && (r = soap->fpreparerecv(soap, soap->buf, ret)) != SOAP_OK)
return soap->error = r;
#endif
return SOAP_OK;
@@ -1102,7 +1174,7 @@ soap_recv_raw(struct soap *soap)
}
zlib_again:
if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK && !soap->chunksize)
- { memcpy(soap->buf, soap->z_buf, SOAP_BUFLEN);
+ { soap_memcpy((void*)soap->buf, sizeof(soap->buf), (const void*)soap->z_buf, sizeof(soap->buf));
soap->buflen = soap->z_buflen;
}
DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- compressed ----\n"));
@@ -1111,10 +1183,10 @@ zlib_again:
#ifndef WITH_NOHTTP
if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) /* read HTTP chunked transfer */
{ for (;;)
- { register soap_wchar c;
+ { soap_wchar c;
char *t, tmp[17];
if (soap->chunksize)
- { soap->buflen = ret = soap->frecv(soap, soap->buf, soap->chunksize > SOAP_BUFLEN ? SOAP_BUFLEN : soap->chunksize);
+ { soap->buflen = ret = soap->frecv(soap, soap->buf, soap->chunksize > sizeof(soap->buf) ? sizeof(soap->buf) : soap->chunksize);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Getting chunk: read %u bytes\n", (unsigned int)ret));
DBGMSG(RECV, soap->buf, ret);
soap->bufidx = 0;
@@ -1123,7 +1195,7 @@ zlib_again:
}
t = tmp;
if (!soap->chunkbuflen)
- { soap->chunkbuflen = ret = soap->frecv(soap, soap->buf, SOAP_BUFLEN);
+ { soap->chunkbuflen = ret = soap->frecv(soap, soap->buf, sizeof(soap->buf));
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes (chunked) from socket=%d\n", (unsigned int)ret, soap->socket));
DBGMSG(RECV, soap->buf, ret);
soap->bufidx = 0;
@@ -1157,8 +1229,6 @@ zlib_again:
if (!soap->chunksize)
{ soap->bufidx = soap->buflen = soap->chunkbuflen = 0;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of chunked message\n"));
- while ((int)c != EOF && c != '\n')
- c = soap_getchunkchar(soap);
ret = 0;
soap->ahead = EOF;
break;
@@ -1181,24 +1251,24 @@ zlib_again:
else
#endif
{ soap->bufidx = 0;
- soap->buflen = ret = soap->frecv(soap, soap->buf, SOAP_BUFLEN);
+ soap->buflen = ret = soap->frecv(soap, soap->buf, sizeof(soap->buf));
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes from socket=%d/fd=%d\n", (unsigned int)ret, soap->socket, soap->recvfd));
DBGMSG(RECV, soap->buf, ret);
}
#ifdef WITH_ZLIB
if (soap->mode & SOAP_ENC_ZLIB)
- { memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
+ { soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)soap->buf, sizeof(soap->buf));
soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx);
soap->d_stream->avail_in = (unsigned int)ret;
soap->d_stream->next_out = (Byte*)soap->buf;
- soap->d_stream->avail_out = SOAP_BUFLEN;
+ soap->d_stream->avail_out = sizeof(soap->buf);
r = inflate(soap->d_stream, Z_NO_FLUSH);
if (r == Z_NEED_DICT && soap->z_dict)
r = inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len);
if (r == Z_OK || r == Z_STREAM_END)
{ soap->bufidx = 0;
soap->z_buflen = soap->buflen;
- soap->buflen = SOAP_BUFLEN - soap->d_stream->avail_out;
+ soap->buflen = sizeof(soap->buf) - soap->d_stream->avail_out;
if (soap->zlib_in == SOAP_ZLIB_GZIP)
soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)soap->buflen);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated %u bytes\n", (unsigned int)soap->buflen));
@@ -1210,10 +1280,14 @@ zlib_again:
soap->z_ratio_in = (float)soap->d_stream->total_in / (float)soap->d_stream->total_out;
soap->d_stream->next_out = Z_NULL;
}
+ if (soap->count + ret > SOAP_MAXINFLATESIZE && soap->z_ratio_in < SOAP_MINDEFLATERATIO)
+ { soap->d_stream->msg = (char*)"caught SOAP_MINDEFLATERATIO explosive decompression guard (remedy: increase SOAP_MAXINFLATESIZE and/or decrease SOAP_MINDEFLATERATIO)";
+ return soap->error = SOAP_ZLIB_ERROR;
+ }
DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- decompressed ----\n"));
DBGMSG(RECV, soap->buf, ret);
#ifndef WITH_LEANER
- if (soap->fpreparerecv && (r = soap->fpreparerecv(soap, soap->buf, ret)))
+ if (soap->fpreparerecv && (r = soap->fpreparerecv(soap, soap->buf, ret)) != SOAP_OK)
return soap->error = r;
#endif
}
@@ -1232,13 +1306,17 @@ zlib_again:
&& (r = soap->fpreparerecv(soap, soap->buf + soap->bufidx, ret)))
return soap->error = r;
#endif
- soap->count += ret;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read count=%lu (+%lu)\n", (unsigned long)soap->count, (unsigned long)ret));
- return !ret;
+ if (ret)
+ { soap->count += ret;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read count=%lu (+%lu)\n", (unsigned long)soap->count, (unsigned long)ret));
+ return SOAP_OK;
+ }
+ return EOF;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -1307,35 +1385,42 @@ soap_recv(struct soap *soap)
}
}
while (soap->ffilterrecv)
- { int err, last = soap->filterstop;
- if (last)
+ { int err;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Filter recverror = %d\n", soap->recverror));
+ if (soap->recverror)
soap->bufidx = soap->buflen = 0;
- if ((err = soap->ffilterrecv(soap, soap->buf, &soap->buflen, sizeof(soap->buf))))
+ else
+ { soap->recverror = soap_recv_raw(soap); /* do not call again after EOF */
+ soap->buflen -= soap->bufidx; /* chunked may set bufidx > 0 to skip hex chunk length */
+ }
+ err = soap->ffilterrecv(soap, soap->buf + soap->bufidx, &soap->buflen, sizeof(soap->buf) - soap->bufidx);
+ if (err)
return soap->error = err;
if (soap->buflen)
- { soap->bufidx = 0;
- soap->filterstop = last;
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Filtered %lu\n", (unsigned long)soap->buflen));
+ soap->buflen += soap->bufidx;
return SOAP_OK;
}
- if (last)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Returning postponed error %d\n", last));
- soap->filterstop = SOAP_OK;
- return last;
+ if (soap->recverror)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Returning postponed EOF%d\n", soap->recverror));
+ return soap->recverror;
}
- soap->filterstop = soap_recv_raw(soap); /* do not call again after EOF */
}
-#endif
+ return soap->recverror = soap_recv_raw(soap);
+#else
return soap_recv_raw(soap);
+#endif
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
soap_wchar
SOAP_FMAC2
soap_getchar(struct soap *soap)
-{ register soap_wchar c;
+{ soap_wchar c;
c = soap->ahead;
if (c)
{ if (c != EOF)
@@ -1347,6 +1432,7 @@ soap_getchar(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
const struct soap_code_map*
@@ -1364,11 +1450,12 @@ soap_code(const struct soap_code_map *code_map, const char *str)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
-long
+LONG64
SOAP_FMAC2
-soap_code_int(const struct soap_code_map *code_map, const char *str, long other)
+soap_code_int(const struct soap_code_map *code_map, const char *str, LONG64 other)
{ if (code_map)
{ while (code_map->string)
{ if (!soap_tag_cmp(str, code_map->string)) /* case insensitive */
@@ -1381,6 +1468,7 @@ soap_code_int(const struct soap_code_map *code_map, const char *str, long other)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
const char*
@@ -1395,17 +1483,18 @@ soap_code_str(const struct soap_code_map *code_map, long code)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
-long
+LONG64
SOAP_FMAC2
soap_code_bits(const struct soap_code_map *code_map, const char *str)
-{ register long bits = 0;
+{ LONG64 bits = 0;
if (code_map)
{ while (str && *str)
{ const struct soap_code_map *p;
for (p = code_map; p->string; p++)
- { register size_t n = strlen(p->string);
+ { size_t n = strlen(p->string);
if (!strncmp(p->string, str, n) && soap_blank((soap_wchar)str[n]))
{ bits |= p->code;
str += n;
@@ -1423,16 +1512,17 @@ soap_code_bits(const struct soap_code_map *code_map, const char *str)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_code_list(struct soap *soap, const struct soap_code_map *code_map, long code)
-{ register char *t = soap->tmpbuf;
+{ char *t = soap->tmpbuf;
if (code_map)
{ while (code_map->string)
{ if (code_map->code & code)
- { register const char *s = code_map->string;
+ { const char *s = code_map->string;
if (t != soap->tmpbuf)
*t++ = ' ';
while (*s && t < soap->tmpbuf + sizeof(soap->tmpbuf) - 1)
@@ -1449,13 +1539,14 @@ soap_code_list(struct soap *soap, const struct soap_code_map *code_map, long cod
#endif
/******************************************************************************/
+
#ifndef PALM_1
static soap_wchar
soap_char(struct soap *soap)
{ char tmp[8];
- register int i;
- register soap_wchar c;
- register char *s = tmp;
+ int i;
+ soap_wchar c;
+ char *s = tmp;
for (i = 0; i < 7; i++)
{ c = soap_get1(soap);
if (c == ';' || (int)c == EOF)
@@ -1479,7 +1570,7 @@ soap_char(struct soap *soap)
if (!strcmp(tmp, "apos"))
return '\'';
#ifndef WITH_LEAN
- return (soap_wchar)soap_code_int(html_entity_codes, tmp, SOAP_UNKNOWN_CHAR);
+ return (soap_wchar)soap_code_int(html_entity_codes, tmp, (LONG64)SOAP_UNKNOWN_CHAR);
#else
return SOAP_UNKNOWN_CHAR; /* use this to represent unknown code */
#endif
@@ -1487,6 +1578,7 @@ soap_char(struct soap *soap)
#endif
/******************************************************************************/
+
#ifdef WITH_LEAN
#ifndef PALM_1
soap_wchar
@@ -1499,6 +1591,7 @@ soap_get0(struct soap *soap)
#endif
/******************************************************************************/
+
#ifdef WITH_LEAN
#ifndef PALM_1
soap_wchar
@@ -1511,12 +1604,13 @@ soap_get1(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
soap_wchar
SOAP_FMAC2
soap_get(struct soap *soap)
-{ register soap_wchar c;
+{ soap_wchar c;
c = soap->ahead;
if (c)
{ if ((int)c != EOF)
@@ -1553,7 +1647,7 @@ soap_get(struct soap *soap)
do c = soap_get1(soap);
while (soap_blank(c));
if (c == '!' || c == '?' || c == '%')
- { register int k = 1;
+ { int k = 1;
if (c == '!')
{ c = soap_get1(soap);
if (c == '[')
@@ -1609,13 +1703,14 @@ soap_get(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
static soap_wchar
soap_get_pi(struct soap *soap)
{ char buf[64];
- register char *s = buf;
- register int i = sizeof(buf);
- register soap_wchar c = soap_getchar(soap);
+ char *s = buf;
+ int i = sizeof(buf);
+ soap_wchar c = soap_getchar(soap);
/* This is a quick way to parse XML PI and we could use a callback instead to
* enable applications to intercept processing instructions */
while ((int)c != EOF && c != '?')
@@ -1649,6 +1744,7 @@ soap_get_pi(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -1665,6 +1761,7 @@ soap_move(struct soap *soap, size_t n)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -1677,19 +1774,24 @@ soap_tell(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
-soap_pututf8(struct soap *soap, register unsigned long c)
-{ char tmp[16];
- if (c < 0x80 && c > 0)
+soap_pututf8(struct soap *soap, unsigned long c)
+{ char tmp[24];
+ if ((c < 0x7F && c > 0x1F))
{ *tmp = (char)c;
return soap_send_raw(soap, tmp, 1);
}
+#ifdef WITH_REPLACE_ILLEGAL_UTF8
+ if (!(c == 0x09 || c == 0x0A || c == 0x0D || (c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF)))
+ c = SOAP_UNKNOWN_UNICODE_CHAR;
+#endif
#ifndef WITH_LEAN
- if (c >= 0x80)
- { register char *t = tmp;
+ if (c > 0x9F)
+ { char *t = tmp;
if (c < 0x0800)
*t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
else
@@ -1716,22 +1818,19 @@ soap_pututf8(struct soap *soap, register unsigned long c)
}
else
#endif
-#ifdef HAVE_SNPRINTF
- soap_snprintf(tmp, sizeof(tmp), "&#%lu;", c);
-#else
- sprintf(tmp, "&#%lu;", c);
-#endif
+ (SOAP_SNPRINTF(tmp, sizeof(tmp), 20), "&#x%lX;", c);
return soap_send(soap, tmp);
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
soap_wchar
SOAP_FMAC2
soap_getutf8(struct soap *soap)
-{ register soap_wchar c, c1, c2, c3, c4;
+{ soap_wchar c, c1, c2, c3, c4;
c = soap->ahead;
if (c >= 0x80)
soap->ahead = 0;
@@ -1761,22 +1860,39 @@ soap_getutf8(struct soap *soap)
#endif
/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+size_t
+SOAP_FMAC2
+soap_utf8len(const char *s)
+{ size_t l = 0;
+ while (*s)
+ if ((*s++ & 0xC0) != 0x80)
+ l++;
+ return l;
+}
+#endif
+
+/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_puthex(struct soap *soap, const unsigned char *s, int n)
{ char d[2];
- register int i;
+ int i;
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- { if (!(soap->dom->data = soap_s2hex(soap, s, NULL, n)))
+ { soap->dom->text = soap_s2hex(soap, s, NULL, n);
+ if (!soap->dom->text)
return soap->error;
return SOAP_OK;
}
#endif
for (i = 0; i < n; i++)
- { register int m = *s++;
+ { int m = *s++;
d[0] = (char)((m >> 4) + (m > 159 ? '7' : '0'));
m &= 0x0F;
d[1] = (char)(m + (m > 9 ? '7' : '0'));
@@ -1788,31 +1904,32 @@ soap_puthex(struct soap *soap, const unsigned char *s, int n)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
unsigned char*
SOAP_FMAC2
soap_gethex(struct soap *soap, int *n)
-{
+{ long l = 0;
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- { soap->dom->data = soap_string_in(soap, 0, -1, -1);
- return (unsigned char*)soap_hex2s(soap, soap->dom->data, NULL, 0, n);
+ { soap->dom->text = soap_string_in(soap, 0, -1, -1, NULL);
+ return (unsigned char*)soap_hex2s(soap, soap->dom->text, NULL, 0, n);
}
#endif
#ifdef WITH_FAST
soap->labidx = 0;
for (;;)
- { register char *s;
- register size_t i, k;
+ { char *s;
+ size_t i, k;
if (soap_append_lab(soap, NULL, 0))
return NULL;
s = soap->labbuf + soap->labidx;
k = soap->lablen - soap->labidx;
soap->labidx = soap->lablen;
for (i = 0; i < k; i++)
- { register char d1, d2;
- register soap_wchar c;
+ { char d1, d2;
+ soap_wchar c;
c = soap_get(soap);
if (soap_isxdigit(c))
{ d1 = (char)c;
@@ -1825,31 +1942,41 @@ soap_gethex(struct soap *soap, int *n)
}
}
else
- { unsigned char *p;
+ { unsigned char *p = NULL;
+ l = (long)(soap->lablen + i - k);
soap_unget(soap, c);
if (n)
- *n = (int)(soap->lablen + i - k);
- p = (unsigned char*)soap_malloc(soap, soap->lablen + i - k);
- if (p)
- memcpy(p, soap->labbuf, soap->lablen + i - k);
+ *n = (int)l;
+ if (soap->maxlength > 0 && l > soap->maxlength)
+ soap->error = SOAP_LENGTH;
+ else
+ { p = (unsigned char*)soap_malloc(soap, (size_t)l);
+ if (p)
+ soap_memcpy((void*)p, (size_t)l, (const void*)soap->labbuf, (size_t)l);
+ }
return p;
}
*s++ = (char)(((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0'));
}
+ l = (long)soap->lablen;
+ if (soap->maxlength > 0 && l > soap->maxlength)
+ { soap->error = SOAP_LENGTH;
+ return NULL;
+ }
}
#else
if (soap_new_block(soap) == NULL)
return NULL;
for (;;)
- { register int i;
- register char *s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN);
+ { int i;
+ char *s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN);
if (!s)
{ soap_end_block(soap, NULL);
return NULL;
}
for (i = 0; i < SOAP_BLKLEN; i++)
- { register char d1, d2;
- register soap_wchar c = soap_get(soap);
+ { char d1, d2;
+ soap_wchar c = soap_get(soap);
if (soap_isxdigit(c))
{ d1 = (char)c;
c = soap_get(soap);
@@ -1864,12 +1991,23 @@ soap_gethex(struct soap *soap, int *n)
else
{ unsigned char *p;
soap_unget(soap, c);
+ if (soap->maxlength > 0 && l > soap->maxlength)
+ { soap->error = SOAP_LENGTH;
+ soap_end_block(soap, NULL);
+ return NULL;
+ }
if (n)
*n = (int)soap_size_block(soap, NULL, i);
- p = (unsigned char*)soap_save_block(soap, NULL, 0);
+ p = (unsigned char*)soap_save_block(soap, NULL, NULL, 0);
return p;
}
*s++ = ((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0');
+ l++;
+ }
+ if (soap->maxlength > 0 && l > soap->maxlength)
+ { soap->error = SOAP_LENGTH;
+ soap_end_block(soap, NULL);
+ return NULL;
}
}
#endif
@@ -1877,19 +2015,21 @@ soap_gethex(struct soap *soap, int *n)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_putbase64(struct soap *soap, const unsigned char *s, int n)
-{ register int i;
- register unsigned long m;
+{ int i;
+ unsigned long m;
char d[4];
if (!s)
return SOAP_OK;
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- { if (!(soap->dom->data = soap_s2base64(soap, s, NULL, n)))
+ { soap->dom->text = soap_s2base64(soap, s, NULL, n);
+ if (!soap->dom->text)
return soap->error;
return SOAP_OK;
}
@@ -1921,40 +2061,40 @@ soap_putbase64(struct soap *soap, const unsigned char *s, int n)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
unsigned char*
SOAP_FMAC2
soap_getbase64(struct soap *soap, int *n, int malloc_flag)
-{ (void)malloc_flag;
+{ long l = 0;
+ (void)malloc_flag;
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- { soap->dom->data = soap_string_in(soap, 0, -1, -1);
- return (unsigned char*)soap_base642s(soap, soap->dom->data, NULL, 0, n);
+ { soap->dom->text = soap_string_in(soap, 0, -1, -1, NULL);
+ return (unsigned char*)soap_base642s(soap, soap->dom->text, NULL, 0, n);
}
#endif
#ifdef WITH_FAST
soap->labidx = 0;
for (;;)
- { register size_t i, k;
- register char *s;
+ { size_t i, k;
+ char *s;
if (soap_append_lab(soap, NULL, 2))
return NULL;
s = soap->labbuf + soap->labidx;
k = soap->lablen - soap->labidx;
soap->labidx = 3 * (soap->lablen / 3);
- if (!s)
- return NULL;
if (k > 2)
{ for (i = 0; i < k - 2; i += 3)
- { register unsigned long m = 0;
- register int j = 0;
+ { unsigned long m = 0;
+ int j = 0;
do
- { register soap_wchar c = soap_get(soap);
+ { soap_wchar c = soap_get(soap);
if (c < SOAP_AP)
c &= 0x7FFFFFFF;
if (c == '=' || c < 0)
- { unsigned char *p;
+ { unsigned char *p = NULL;
switch (j)
{ case 2:
*s++ = (char)((m >> 4) & 0xFF);
@@ -1965,21 +2105,26 @@ soap_getbase64(struct soap *soap, int *n, int malloc_flag)
*s++ = (char)((m >> 2) & 0xFF);
i += 2;
}
+ l = (long)(soap->lablen + i - k);
if (n)
- *n = (int)(soap->lablen + i - k);
- p = (unsigned char*)soap_malloc(soap, soap->lablen + i - k);
- if (p)
- memcpy(p, soap->labbuf, soap->lablen + i - k);
+ *n = (int)l;
+ if (soap->maxlength > 0 && l > soap->maxlength)
+ soap->error = SOAP_LENGTH;
+ else
+ { p = (unsigned char*)soap_malloc(soap, (size_t)l);
+ if (p)
+ soap_memcpy((void*)p, (size_t)l, (const void*)soap->labbuf, (size_t)l);
+ }
if (c >= 0)
{ while ((int)((c = soap_get(soap)) != EOF) && c != SOAP_LT && c != SOAP_TT)
- ;
+ continue;
}
soap_unget(soap, c);
return p;
}
c -= '+';
if (c >= 0 && c <= 79)
- { register int b = soap_base64i[c];
+ { int b = soap_base64i[c];
if (b >= 64)
{ soap->error = SOAP_TYPE;
return NULL;
@@ -1996,23 +2141,30 @@ soap_getbase64(struct soap *soap, int *n, int malloc_flag)
*s++ = (char)((m >> 8) & 0xFF);
*s++ = (char)(m & 0xFF);
}
+ l = (long)soap->lablen;
+ if (soap->maxlength > 0 && l > soap->maxlength)
+ { soap->error = SOAP_LENGTH;
+ return NULL;
+ }
}
}
#else
if (soap_new_block(soap) == NULL)
return NULL;
for (;;)
- { register int i;
- register char *s = (char*)soap_push_block(soap, NULL, 3 * SOAP_BLKLEN); /* must be multiple of 3 */
+ { int i;
+ char *s = (char*)soap_push_block(soap, NULL, 3 * SOAP_BLKLEN); /* must be multiple of 3 */
if (!s)
{ soap_end_block(soap, NULL);
return NULL;
}
for (i = 0; i < SOAP_BLKLEN; i++)
- { register unsigned long m = 0;
- register int j = 0;
+ { unsigned long m = 0;
+ int j = 0;
do
- { register soap_wchar c = soap_get(soap);
+ { soap_wchar c = soap_get(soap);
+ if (c < SOAP_AP)
+ c &= 0x7FFFFFFF;
if (c == '=' || c < 0)
{ unsigned char *p;
i *= 3;
@@ -2020,18 +2172,25 @@ soap_getbase64(struct soap *soap, int *n, int malloc_flag)
{ case 2:
*s++ = (char)((m >> 4) & 0xFF);
i++;
+ l++;
break;
case 3:
*s++ = (char)((m >> 10) & 0xFF);
*s++ = (char)((m >> 2) & 0xFF);
+ l += 2;
i += 2;
}
if (n)
*n = (int)soap_size_block(soap, NULL, i);
- p = (unsigned char*)soap_save_block(soap, NULL, 0);
+ if (soap->maxlength > 0 && l > soap->maxlength)
+ { soap->error = SOAP_LENGTH;
+ soap_end_block(soap, NULL);
+ return NULL;
+ }
+ p = (unsigned char*)soap_save_block(soap, NULL, NULL, 0);
if (c >= 0)
{ while ((int)((c = soap_get(soap)) != EOF) && c != SOAP_LT && c != SOAP_TT)
- ;
+ continue;
}
soap_unget(soap, c);
return p;
@@ -2046,7 +2205,7 @@ soap_getbase64(struct soap *soap, int *n, int malloc_flag)
m = (m << 6) + b;
j++;
}
- else if (!soap_blank(c))
+ else if (!soap_blank(c + '+'))
{ soap->error = SOAP_TYPE;
return NULL;
}
@@ -2054,6 +2213,12 @@ soap_getbase64(struct soap *soap, int *n, int malloc_flag)
*s++ = (char)((m >> 16) & 0xFF);
*s++ = (char)((m >> 8) & 0xFF);
*s++ = (char)(m & 0xFF);
+ l += 3;
+ }
+ if (soap->maxlength > 0 && l > soap->maxlength)
+ { soap->error = SOAP_LENGTH;
+ soap_end_block(soap, NULL);
+ return NULL;
}
}
#endif
@@ -2061,6 +2226,7 @@ soap_getbase64(struct soap *soap, int *n, int malloc_flag)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -2072,7 +2238,7 @@ soap_xop_forward(struct soap *soap, unsigned char **ptr, int *size, char **id, c
short body = soap->body; /* should save type too? */
if (!soap_peek_element(soap))
{ if (!soap_element_begin_in(soap, "xop:Include", 0, NULL))
- { if (soap_dime_forward(soap, ptr, size, id, type, options)
+ { if (soap_attachment_forward(soap, ptr, size, id, type, options)
|| (soap->body && soap_element_end_in(soap, "xop:Include")))
return soap->error;
}
@@ -2084,12 +2250,13 @@ soap_xop_forward(struct soap *soap, unsigned char **ptr, int *size, char **id, c
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
-soap_dime_forward(struct soap *soap, unsigned char **ptr, int *size, char **id, char **type, char **options)
+soap_attachment_forward(struct soap *soap, unsigned char **ptr, int *size, char **id, char **type, char **options)
{ struct soap_xlist *xp;
*ptr = NULL;
*size = 0;
@@ -2115,19 +2282,42 @@ soap_dime_forward(struct soap *soap, unsigned char **ptr, int *size, char **id,
#endif
/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+void *
+SOAP_FMAC2
+soap_memdup(struct soap *soap, const void *s, size_t n)
+{ void *t = NULL;
+ if (s)
+ { t = soap_malloc(soap, n);
+ if (t)
+ soap_memcpy(t, n, s, n);
+ }
+ return t;
+}
+#endif
+
+/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
char *
SOAP_FMAC2
soap_strdup(struct soap *soap, const char *s)
{ char *t = NULL;
- if (s && (t = (char*)soap_malloc(soap, strlen(s) + 1)))
- strcpy(t, s);
+ if (s)
+ { size_t l = strlen(s) + 1;
+ t = (char*)soap_malloc(soap, l);
+ if (t)
+ soap_memcpy((void*)t, l, (const void*)s, l);
+ }
return t;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
wchar_t *
@@ -2138,14 +2328,63 @@ soap_wstrdup(struct soap *soap, const wchar_t *s)
{ size_t n = 0;
while (s[n])
n++;
- if ((t = (wchar_t*)soap_malloc(soap, sizeof(wchar_t)*(n+1))))
- memcpy(t, s, sizeof(wchar_t)*(n+1));
+ n = sizeof(wchar_t)*(n+1);
+ t = (wchar_t*)soap_malloc(soap, n);
+ if (t)
+ soap_memcpy((void*)t, n, (const void*)s, n);
}
return t;
}
#endif
/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_strtrim(struct soap *soap, char *s)
+{ (void)soap;
+ if (s)
+ { char *t;
+ while ((*s >= 9 && *s <= 13) || *s == 32)
+ s++;
+ t = s;
+ while (*t)
+ t++;
+ while (--t > s && ((*t >= 9 && *t <= 13) || *t == 32))
+ continue;
+ t[1] = '\0';
+ }
+ return s;
+}
+#endif
+
+/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+wchar_t *
+SOAP_FMAC2
+soap_wstrtrim(struct soap *soap, wchar_t *s)
+{ (void)soap;
+ if (s)
+ { wchar_t *t;
+ while ((*s >= 9 && *s <= 13) || *s == 32)
+ s++;
+ t = s;
+ while (*t)
+ t++;
+ while (--t > s && ((*t >= 9 && *t <= 13) || *t == 32))
+ continue;
+ t[1] = L'\0';
+ }
+ return s;
+}
+#endif
+
+/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
struct soap_blist*
@@ -2153,135 +2392,169 @@ SOAP_FMAC2
soap_new_block(struct soap *soap)
{ struct soap_blist *p;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New block sequence (prev=%p)\n", soap->blist));
- if (!(p = (struct soap_blist*)SOAP_MALLOC(soap, sizeof(struct soap_blist))))
+ p = (struct soap_blist*)SOAP_MALLOC(soap, sizeof(struct soap_blist));
+ if (!p)
{ soap->error = SOAP_EOM;
return NULL;
}
p->next = soap->blist;
- p->ptr = NULL;
+ p->head = NULL;
p->size = 0;
+ p->item = 0;
soap->blist = p;
return p;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void*
SOAP_FMAC2
soap_push_block(struct soap *soap, struct soap_blist *b, size_t n)
-{ char *p;
+{ struct soap_bhead *p;
if (!b)
b = soap->blist;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push block of %u bytes (%u bytes total)\n", (unsigned int)n, (unsigned int)b->size + (unsigned int)n));
- if (!(p = (char*)SOAP_MALLOC(soap, n + sizeof(char*) + sizeof(size_t))))
+ p = (struct soap_bhead*)SOAP_MALLOC(soap, sizeof(struct soap_bhead) + n);
+ if (!p)
{ soap->error = SOAP_EOM;
return NULL;
}
- *(char**)p = b->ptr;
- *(size_t*)(p + sizeof(char*)) = n;
- b->ptr = p;
+ p->next = b->head;
+ b->head = p;
+ p->size = n;
b->size += n;
- return p + sizeof(char*) + sizeof(size_t);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push block %p of %u bytes on %lu previous blocks (%lu bytes total)\n", p, (unsigned int)n, (unsigned long)b->item, (unsigned long)b->size));
+ b->item++;
+ return (void*)(p + 1); /* skip block header and point to n allocated bytes */
+}
+#endif
+
+/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+void*
+SOAP_FMAC2
+soap_push_block_max(struct soap *soap, struct soap_blist *b, size_t n)
+{ if (b && b->item >= soap->maxoccurs) /* restrict block array length */
+ { soap->error = SOAP_OCCURS;
+ return NULL;
+ }
+ return soap_push_block(soap, b, n);
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
SOAP_FMAC2
soap_pop_block(struct soap *soap, struct soap_blist *b)
-{ char *p;
+{ struct soap_bhead *p;
if (!b)
b = soap->blist;
- if (!b->ptr)
+ if (!b->head)
return;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop block\n"));
- p = b->ptr;
- b->size -= *(size_t*)(p + sizeof(char*));
- b->ptr = *(char**)p;
+ p = b->head;
+ b->size -= p->size;
+ b->head = p->next;
+ b->item--;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop block %p (%lu items of %lu bytes total)\n", p, (unsigned long)b->item, (unsigned long)b->size));
SOAP_FREE(soap, p);
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
SOAP_FMAC2
-soap_update_pointers(struct soap *soap, char *start, char *end, char *p1, char *p2)
-{
-#ifndef WITH_NOIDREF
- int i;
- register struct soap_ilist *ip = NULL;
- register struct soap_flist *fp = NULL;
+soap_update_pointers(struct soap *soap, const char *dst, const char *src, size_t len)
+{ const void *start = src, *end = src + len;
#ifndef WITH_LEANER
- register struct soap_xlist *xp = NULL;
+ struct soap_xlist *xp;
#endif
- register void *p, **q;
- for (i = 0; i < SOAP_IDHASH; i++)
- { for (ip = soap->iht[i]; ip; ip = ip->next)
- { if (ip->ptr && (char*)ip->ptr >= start && (char*)ip->ptr < end)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update id='%s' %p -> %p\n", ip->id, ip->ptr, (char*)ip->ptr + (p1-p2)));
- ip->ptr = (char*)ip->ptr + (p1-p2);
- }
- for (q = &ip->link; q; q = (void**)p)
- { p = *q;
- if (p && (char*)p >= start && (char*)p < end)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Link update id='%s' %p\n", ip->id, p));
- *q = (char*)p + (p1-p2);
- }
- }
- for (q = &ip->copy; q; q = (void**)p)
- { p = *q;
- if (p && (char*)p >= start && (char*)p < end)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy chain update id='%s' %p\n", ip->id, p));
- *q = (char*)p + (p1-p2);
- }
- }
- for (fp = ip->flist; fp; fp = fp->next)
- { if ((char*)fp->ptr >= start && (char*)fp->ptr < end)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy list update id='%s' %p\n", ip->id, fp));
- fp->ptr = (char*)fp->ptr + (p1-p2);
+#ifndef WITH_NOIDREF
+ if ((soap->version && !(soap->imode & SOAP_XML_TREE)) || (soap->mode & SOAP_XML_GRAPH))
+ { int i;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update pointers %p (%lu bytes) -> %p\n", src, (unsigned long)len, dst));
+ for (i = 0; i < SOAP_IDHASH; i++)
+ { struct soap_ilist *ip;
+ for (ip = soap->iht[i]; ip; ip = ip->next)
+ { struct soap_flist *fp;
+ void *p, **q;
+ if (ip->shaky)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update shaky id='%s'\n", ip->id));
+ if (ip->ptr && ip->ptr >= start && ip->ptr < end)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update ptr %p -> %p\n", ip->ptr, (const char*)ip->ptr + (dst-src)));
+ ip->ptr = (void*)((const char*)ip->ptr + (dst-src));
+ }
+ for (q = &ip->link; q; q = (void**)p)
+ { p = *q;
+ if (p && p >= start && p < end)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Link update id='%s' %p -> %p\n", ip->id, p, (const char*)p + (dst-src)));
+ *q = (void*)((const char*)p + (dst-src));
+ }
+ }
+ for (q = &ip->copy; q; q = (void**)p)
+ { p = *q;
+ if (p && p >= start && p < end)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy chain update id='%s' %p -> %p\n", ip->id, p, (const char*)p + (dst-src)));
+ *q = (void*)((const char*)p + (dst-src));
+ }
+ }
+ for (fp = ip->flist; fp; fp = fp->next)
+ { if (fp->ptr >= start && fp->ptr < end)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy list update id='%s' target type=%d %p -> %p\n", ip->id, fp->type, fp->ptr, (char*)fp->ptr + (dst-src)));
+ fp->ptr = (void*)((const char*)fp->ptr + (dst-src));
+ }
+ }
+ if (ip->smart && ip->smart >= start && ip->smart < end)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Smart shared pointer update %p -> %p\n", ip->smart, (const char*)ip->smart + (dst-src)));
+ ip->smart = (void*)((const char*)ip->smart + (dst-src));
+ }
}
}
}
}
+#else
+ (void)soap; (void)start; (void)end; (void)dst; (void)src;
+#endif
#ifndef WITH_LEANER
for (xp = soap->xlist; xp; xp = xp->next)
- { if (xp->ptr && (char*)xp->ptr >= start && (char*)xp->ptr < end)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update id='%s' %p -> %p\n", xp->id ? xp->id : SOAP_STR_EOS, xp->ptr, (char*)xp->ptr + (p1-p2)));
- xp->ptr = (unsigned char**)((char*)xp->ptr + (p1-p2));
- xp->size = (int*)((char*)xp->size + (p1-p2));
- xp->type = (char**)((char*)xp->type + (p1-p2));
- xp->options = (char**)((char*)xp->options + (p1-p2));
+ { if (xp->ptr && (void*)xp->ptr >= start && (void*)xp->ptr < end)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update attachment id='%s' %p -> %p\n", xp->id ? xp->id : SOAP_STR_EOS, xp->ptr, (char*)xp->ptr + (dst-src)));
+ xp->ptr = (unsigned char**)((char*)xp->ptr + (dst-src));
+ xp->size = (int*)((char*)xp->size + (dst-src));
+ xp->type = (char**)((char*)xp->type + (dst-src));
+ xp->options = (char**)((char*)xp->options + (dst-src));
}
}
#endif
-#else
- (void)soap; (void)start; (void)end; (void)p1; (void)p2;
-#endif
}
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_1
static int
-soap_has_copies(struct soap *soap, register const char *start, register const char *end)
-{ register int i;
- register struct soap_ilist *ip = NULL;
- register struct soap_flist *fp = NULL;
- register const char *p;
+soap_has_copies(struct soap *soap, const char *start, const char *end)
+{ int i;
+ struct soap_ilist *ip = NULL;
+ struct soap_flist *fp = NULL;
+ const char *p;
for (i = 0; i < SOAP_IDHASH; i++)
{ for (ip = soap->iht[i]; ip; ip = ip->next)
{ for (p = (const char*)ip->copy; p; p = *(const char**)p)
if (p >= start && p < end)
return SOAP_ERR;
for (fp = ip->flist; fp; fp = fp->next)
- if ((const char*)fp->ptr >= start && (const char*)fp->ptr < end)
+ if (fp->type == ip->type && (const char*)fp->ptr >= start && (const char*)fp->ptr < end)
return SOAP_ERR;
}
}
@@ -2291,91 +2564,112 @@ soap_has_copies(struct soap *soap, register const char *start, register const ch
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_resolve(struct soap *soap)
-{ register int i;
- register struct soap_ilist *ip = NULL;
- register struct soap_flist *fp = NULL;
+{ int i;
short flag;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded data\n"));
+ const char *id;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded refs\n"));
for (i = 0; i < SOAP_IDHASH; i++)
- { for (ip = soap->iht[i]; ip; ip = ip->next)
+ { struct soap_ilist *ip;
+ for (ip = soap->iht[i]; ip; ip = ip->next)
{ if (ip->ptr)
- { register void *p, **q, *r;
+ { void **q;
+ struct soap_flist *fp, **fpp = &ip->flist;
+ if (ip->spine)
+ ip->spine[0] = ip->ptr;
q = (void**)ip->link;
ip->link = NULL;
- r = ip->ptr;
- DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing link chain to resolve id='%s'\n", ip->id));
+ DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing link chain to resolve id='%s' type=%d\n", ip->id, ip->type));
while (q)
- { p = *q;
- *q = r;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "... link %p -> %p\n", q, r));
+ { void *p = *q;
+ *q = ip->ptr;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... link %p -> %p\n", q, ip->ptr));
q = (void**)p;
}
+ while ((fp = *fpp))
+ { if (fp->level > 0 && fp->finsert)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... insert type=%d link %p -> %p\n", fp->type, fp->ptr, ip->ptr));
+ if (ip->spine && fp->level <= SOAP_MAXPTRS)
+ fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, &ip->spine[fp->level - 1], &ip->smart);
+ else if (fp->level == 1)
+ fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, &ip->ptr, &ip->smart);
+ else if (fp->level <= SOAP_MAXPTRS)
+ { int i;
+ ip->spine = (void**)soap_malloc(soap, SOAP_MAXPTRS * sizeof(void*));
+ if (!ip->spine)
+ return soap->error = SOAP_EOM;
+ ip->spine[0] = ip->ptr;
+ for (i = 1; i < SOAP_MAXPTRS; i++)
+ ip->spine[i] = &ip->spine[i - 1];
+ fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, &ip->spine[fp->level - 1], &ip->smart);
+ }
+ *fpp = fp->next;
+ SOAP_FREE(soap, fp);
+ }
+ else
+ fpp = &fp->next;
+ }
}
else if (*ip->id == '#')
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Missing data for id='%s'\n", ip->id));
- strcpy(soap->id, ip->id + 1);
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Missing id='%s'\n", ip->id));
+ soap_strcpy(soap->id, sizeof(soap->id), ip->id + 1);
return soap->error = SOAP_MISSING_ID;
}
}
}
do
{ flag = 0;
+ id = NULL;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution phase\n"));
for (i = 0; i < SOAP_IDHASH; i++)
- { for (ip = soap->iht[i]; ip; ip = ip->next)
- { if (ip->ptr && !soap_has_copies(soap, (const char*)ip->ptr, (const char*)ip->ptr + ip->size))
- { if (ip->copy)
- { register void *p, **q = (void**)ip->copy;
- DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing copy chain to resolve id='%s'\n", ip->id));
- ip->copy = NULL;
- do
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... copy %p -> %p (%u bytes)\n", ip->ptr, q, (unsigned int)ip->size));
- p = *q;
- memcpy(q, ip->ptr, ip->size);
- q = (void**)p;
- } while (q);
- flag = 1;
- }
- for (fp = ip->flist; fp; fp = ip->flist)
- { register unsigned int k = fp->level;
- register void *p = ip->ptr;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded data type=%d location=%p level=%u,%u id='%s'\n", ip->type, p, ip->level, fp->level, ip->id));
- while (ip->level < k)
- { register void **q = (void**)soap_malloc(soap, sizeof(void*));
- if (!q)
- return soap->error;
- *q = p;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level, new location=%p holds=%p...\n", q, *q));
- p = (void*)q;
- k--;
+ { struct soap_ilist *ip;
+ for (ip = soap->iht[i]; ip; ip = ip->next)
+ { if (ip->copy || ip->flist)
+ { if (ip->ptr && !soap_has_copies(soap, (const char*)ip->ptr, (const char*)ip->ptr + ip->size))
+ { struct soap_flist *fp;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving id='%s' type=%d ptr=%p size=%lu ...\n", ip->id, ip->type, ip->ptr, (unsigned long)ip->size));
+ if (ip->copy)
+ { void *p, **q = (void**)ip->copy;
+ DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing copy chain to resolve id='%s'\n", ip->id));
+ ip->copy = NULL;
+ do
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... copy %p -> %p (%u bytes)\n", ip->ptr, q, (unsigned int)ip->size));
+ p = *q;
+ soap_memcpy((void*)q, ip->size, (const void*)ip->ptr, ip->size);
+ q = (void**)p;
+ } while (q);
+ flag = 1;
+ }
+ while ((fp = ip->flist))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded data type=%d target type=%d location=%p level=%u id='%s'\n", ip->type, fp->type, ip->ptr, fp->level, ip->id));
+ if (fp->level == 0)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... copy %p -> %p (%lu bytes)\n", ip->ptr, fp->ptr, (unsigned long)ip->size));
+ if (fp->finsert)
+ fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, ip->ptr, &ip->smart);
+ else
+ soap_memcpy((void*)fp->ptr, ip->size, (const void*)ip->ptr, ip->size);
+ }
+ ip->flist = fp->next;
+ SOAP_FREE(soap, fp);
+ flag = 1;
}
- if (fp->fcopy)
- fp->fcopy(soap, ip->type, fp->type, fp->ptr, fp->len, p, ip->size);
- else
- soap_fcopy(soap, ip->type, fp->type, fp->ptr, fp->len, p, ip->size);
- ip->flist = fp->next;
- SOAP_FREE(soap, fp);
- flag = 1;
}
+ else
+ id = ip->id;
}
}
}
} while (flag);
-#ifdef SOAP_DEBUG
- for (i = 0; i < SOAP_IDHASH; i++)
- { for (ip = soap->iht[i]; ip; ip = ip->next)
- { if (ip->copy || ip->flist)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution error: forwarded data for id='%s' could not be propagated, please report this problem to the developers\n", ip->id));
- }
- }
+ if (id)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution error: forwarded data for id='%s' could not be propagated, please report this problem to the gSOAP developers\n", id));
+ return soap_id_nullify(soap, id);
}
-#endif
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution done\n"));
return SOAP_OK;
}
@@ -2383,6 +2677,7 @@ soap_resolve(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
size_t
@@ -2390,61 +2685,64 @@ SOAP_FMAC2
soap_size_block(struct soap *soap, struct soap_blist *b, size_t n)
{ if (!b)
b = soap->blist;
- if (b->ptr)
- { b->size -= *(size_t*)(b->ptr + sizeof(char*)) - n;
- *(size_t*)(b->ptr + sizeof(char*)) = n;
+ if (b->head)
+ { b->size -= b->head->size - n;
+ b->head->size = n;
}
return b->size;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
char*
SOAP_FMAC2
soap_first_block(struct soap *soap, struct soap_blist *b)
-{ char *p, *q, *r;
+{ struct soap_bhead *p, *q, *r;
if (!b)
b = soap->blist;
- p = b->ptr;
+ p = b->head;
if (!p)
return NULL;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "First block\n"));
r = NULL;
do
- { q = *(char**)p;
- *(char**)p = r;
+ { q = p->next;
+ p->next = r;
r = p;
p = q;
} while (p);
- b->ptr = r;
- return r + sizeof(char*) + sizeof(size_t);
+ b->head = r;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "First block %p\n", r + 1));
+ return (char*)(r + 1);
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
char*
SOAP_FMAC2
soap_next_block(struct soap *soap, struct soap_blist *b)
-{ char *p;
+{ struct soap_bhead *p;
if (!b)
b = soap->blist;
- p = b->ptr;
+ p = b->head;
if (p)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Next block\n"));
- b->ptr = *(char**)p;
+ { b->head = p->next;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Next block %p, deleting current block\n", b->head ? b->head + 1 : NULL));
SOAP_FREE(soap, p);
- if (b->ptr)
- return b->ptr + sizeof(char*) + sizeof(size_t);
+ if (b->head)
+ return (char*)(b->head + 1);
}
return NULL;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
size_t
@@ -2452,23 +2750,24 @@ SOAP_FMAC2
soap_block_size(struct soap *soap, struct soap_blist *b)
{ if (!b)
b = soap->blist;
- return *(size_t*)(b->ptr + sizeof(char*));
+ return b->head->size;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
SOAP_FMAC2
soap_end_block(struct soap *soap, struct soap_blist *b)
-{ char *p, *q;
+{ struct soap_bhead *p, *q;
if (!b)
b = soap->blist;
if (b)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of block sequence, free all remaining blocks\n"));
- for (p = b->ptr; p; p = q)
- { q = *(char**)p;
+ for (p = b->head; p; p = q)
+ { q = p->next;
SOAP_FREE(soap, p);
}
if (soap->blist == b)
@@ -2484,33 +2783,42 @@ soap_end_block(struct soap *soap, struct soap_blist *b)
}
SOAP_FREE(soap, b);
}
- DBGLOG(TEST, if (soap->blist) SOAP_MESSAGE(fdebug, "Restore previous block sequence\n"));
+ DBGLOG(TEST, if (soap->blist) SOAP_MESSAGE(fdebug, "Restored previous block sequence\n"));
+#ifndef WITH_NOIDREF
+ if (!soap->blist && ((soap->version && !(soap->imode & SOAP_XML_TREE)) || (soap->mode & SOAP_XML_GRAPH)))
+ { int i;
+ struct soap_ilist *ip = NULL;
+ for (i = 0; i < SOAP_IDHASH; i++)
+ for (ip = soap->iht[i]; ip; ip = ip->next)
+ ip->shaky = 0;
+ }
+#endif
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
char*
SOAP_FMAC2
soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
-{ register size_t n;
- register char *q, *s;
+{ size_t n;
+ char *q, *s;
if (!b)
b = soap->blist;
if (b->size)
{ if (!p)
p = (char*)soap_malloc(soap, b->size);
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Save all blocks in contiguous memory space of %u bytes (%p->%p)\n", (unsigned int)b->size, b->ptr, p));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Save all %lu blocks in contiguous memory space of %u bytes (%p->%p)\n", (unsigned long)b->item, (unsigned int)b->size, b->head, p));
if (p)
- { for (s = p, q = soap_first_block(soap, b); q; q = soap_next_block(soap, b))
+ { s = p;
+ for (q = soap_first_block(soap, b); q; q = soap_next_block(soap, b))
{ n = soap_block_size(soap, b);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy %u bytes from %p to %p\n", (unsigned int)n, q, s));
-#ifndef WITH_NOIDREF
if (flag)
- soap_update_pointers(soap, q, q + n, s, q);
-#endif
- memcpy(s, q, n);
+ soap_update_pointers(soap, s, q, n);
+ soap_memcpy((void*)s, n, (const void*)q, n);
s += n;
}
}
@@ -2523,248 +2831,140 @@ soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
#endif
/******************************************************************************/
-#ifndef PALM_2
-SOAP_FMAC1
-char *
-SOAP_FMAC2
-soap_putsize(struct soap *soap, const char *type, int size)
-{ return soap_putsizes(soap, type, &size, 1);
-}
-#endif
-
-/******************************************************************************/
-#ifndef PALM_2
-SOAP_FMAC1
-char *
-SOAP_FMAC2
-soap_putsizes(struct soap *soap, const char *type, const int *size, int dim)
-{ return soap_putsizesoffsets(soap, type, size, NULL, dim);
-}
-#endif
-/******************************************************************************/
#ifndef PALM_2
SOAP_FMAC1
char *
SOAP_FMAC2
soap_putsizesoffsets(struct soap *soap, const char *type, const int *size, const int *offset, int dim)
-{ register int i;
- register size_t l;
- if (!type || strlen(type) + 13 > sizeof(soap->type)) /* prevent overruns */
+{ int i;
+ const char *t = ",%d";
+ if (!type)
return NULL;
if (soap->version == 2)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->type, sizeof(soap->type) - 1, "%s[%d", type, size[0]);
-#else
- sprintf(soap->type, "%s[%d", type, size[0]);
-#endif
+ t = " %d";
+ if (soap->version != 2 && offset)
+ { (SOAP_SNPRINTF(soap->type, sizeof(soap->type) - 1, strlen(type) + 20), "%s[%d", type, size[0] + offset[0]);
for (i = 1; i < dim; i++)
- {
-#ifdef HAVE_SNPRINTF
- l = strlen(soap->type);
- soap_snprintf(soap->type + l, sizeof(soap->type) - l - 1, " %d", size[i]);
-#else
- if ((l = strlen(soap->type)) + 13 > sizeof(soap->type))
- return NULL;
- sprintf(soap->type + l, " %d", size[i]);
-#endif
+ { size_t l = strlen(soap->type);
+ (SOAP_SNPRINTF(soap->type + l, sizeof(soap->type) - l - 1, 20), t, size[i] + offset[i]);
}
}
else
- { if (offset)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->type, sizeof(soap->type) - 1, "%s[%d", type, size[0] + offset[0]);
-#else
- sprintf(soap->type, "%s[%d", type, size[0] + offset[0]);
-#endif
- for (i = 1; i < dim; i++)
- {
-#ifdef HAVE_SNPRINTF
- l = strlen(soap->type);
- soap_snprintf(soap->type + l, sizeof(soap->type) - l - 1, ",%d", size[i] + offset[i]);
-#else
- if ((l = strlen(soap->type)) + 13 > sizeof(soap->type))
- return NULL;
- sprintf(soap->type + l, ",%d", size[i] + offset[i]);
-#endif
- }
- }
- else
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->type, sizeof(soap->type) - 1, "%s[%d", type, size[0]);
-#else
- sprintf(soap->type, "%s[%d", type, size[0]);
-#endif
- for (i = 1; i < dim; i++)
- {
-#ifdef HAVE_SNPRINTF
- l = strlen(soap->type);
- soap_snprintf(soap->type + l, sizeof(soap->type) - l - 1, ",%d", size[i]);
-#else
- if ((l = strlen(soap->type)) + 13 > sizeof(soap->type))
- return NULL;
- sprintf(soap->type + l, ",%d", size[i]);
-#endif
- }
+ { (SOAP_SNPRINTF(soap->type, sizeof(soap->type) - 1, strlen(type) + 20), "%s[%d", type, size[0]);
+ for (i = 1; i < dim; i++)
+ { size_t l = strlen(soap->type);
+ (SOAP_SNPRINTF(soap->type + l, sizeof(soap->type) - l - 1, 20), t, size[i]);
}
}
- strcat(soap->type, "]");
+ soap_strncat(soap->type, sizeof(soap->type), "]", 1);
return soap->type;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
char *
SOAP_FMAC2
-soap_putoffset(struct soap *soap, int offset)
-{ return soap_putoffsets(soap, &offset, 1);
+soap_putoffsets(struct soap *soap, const int *offset, int dim)
+{ int i;
+ soap->arrayOffset[0] = '\0';
+ if (soap->version == 1)
+ { (SOAP_SNPRINTF(soap->arrayOffset, sizeof(soap->arrayOffset) - 1, 20), "[%d", offset[0]);
+ for (i = 1; i < dim; i++)
+ { size_t l = strlen(soap->arrayOffset);
+ (SOAP_SNPRINTF(soap->arrayOffset + l, sizeof(soap->arrayOffset) - l - 1, 20), ",%d", offset[i]);
+ }
+ soap_strncat(soap->arrayOffset, sizeof(soap->arrayOffset), "]", 1);
+ }
+ return soap->arrayOffset;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
-char *
+size_t
SOAP_FMAC2
-soap_putoffsets(struct soap *soap, const int *offset, int dim)
-{ register int i;
- register size_t l;
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->arrayOffset, sizeof(soap->arrayOffset) - 1, "[%d", offset[0]);
-#else
- if (sizeof(soap->arrayOffset) < 13) /* prevent overruns */
- return NULL;
- sprintf(soap->arrayOffset, "[%d", offset[0]);
-#endif
+soap_size(const int *size, int dim)
+{ int i;
+ size_t n = 0;
+ if (size[0] <= 0)
+ return 0;
+ n = (size_t)size[0];
for (i = 1; i < dim; i++)
- {
-#ifdef HAVE_SNPRINTF
- l = strlen(soap->arrayOffset);
- soap_snprintf(soap->arrayOffset + l, sizeof(soap->arrayOffset) - l - 1, ",%d", offset[i]);
-#else
- if ((l = strlen(soap->arrayOffset)) + 13 > sizeof(soap->arrayOffset))
- return NULL;
- sprintf(soap->arrayOffset + l, ",%d", offset[i]);
-#endif
+ { if (size[i] <= 0)
+ return 0;
+ n *= (size_t)size[i];
}
- strcat(soap->arrayOffset, "]");
- return soap->arrayOffset;
+ return (size_t)n;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
-int
+size_t
SOAP_FMAC2
-soap_size(const int *size, int dim)
-{ register int i, n = size[0];
- for (i = 1; i < dim; i++)
- n *= size[i];
+soap_getsizes(const char *attr, int *size, int dim)
+{ size_t i, k, n;
+ if (!*attr)
+ return 0;
+ i = strlen(attr);
+ n = 1;
+ do
+ { for (; i > 0; i--)
+ if (attr[i - 1] == '[' || attr[i - 1] == ',' || attr[i - 1] == ' ')
+ break;
+ n *= k = (size_t)soap_strtoul(attr + i, NULL, 10);
+ size[--dim] = (int)k;
+ if (n > SOAP_MAXARRAYSIZE)
+ return 0;
+ } while (dim > 0 && --i > 0 && attr[i] != '[');
return n;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_getoffsets(const char *attr, const int *size, int *offset, int dim)
-{ register int i, j = 0;
+{ int i, j = 0;
if (offset)
- for (i = 0; i < dim && attr && *attr; i++)
+ { for (i = 0; i < dim && attr && *attr; i++)
{ attr++;
j *= size[i];
j += offset[i] = (int)soap_strtol(attr, NULL, 10);
attr = strchr(attr, ',');
}
+ }
else
- for (i = 0; i < dim && attr && *attr; i++)
+ { for (i = 0; i < dim && attr && *attr; i++)
{ attr++;
j *= size[i];
j += (int)soap_strtol(attr, NULL, 10);
attr = strchr(attr, ',');
}
+ }
return j;
}
#endif
/******************************************************************************/
-#ifndef PALM_2
-SOAP_FMAC1
-int
-SOAP_FMAC2
-soap_getsize(const char *attr1, const char *attr2, int *j)
-{ register int n, k;
- char *s;
- *j = 0;
- if (!*attr1)
- return -1;
- if (*attr1 == '[')
- attr1++;
- n = 1;
- for (;;)
- { k = (int)soap_strtol(attr1, &s, 10);
- n *= k;
- if (k < 0 || n > SOAP_MAXARRAYSIZE || s == attr1)
- return -1;
- attr1 = strchr(s, ',');
- if (!attr1)
- attr1 = strchr(s, ' ');
- if (attr2 && *attr2)
- { attr2++;
- *j *= k;
- k = (int)soap_strtol(attr2, &s, 10);
- *j += k;
- if (k < 0)
- return -1;
- attr2 = s;
- }
- if (!attr1)
- break;
- attr1++;
- }
- return n - *j;
-}
-#endif
-/******************************************************************************/
-#ifndef PALM_2
-SOAP_FMAC1
-int
-SOAP_FMAC2
-soap_getsizes(const char *attr, int *size, int dim)
-{ register int i, k, n;
- if (!*attr)
- return -1;
- i = (int)strlen(attr);
- n = 1;
- do
- { for (i = i-1; i >= 0; i--)
- if (attr[i] == '[' || attr[i] == ',' || attr[i] == ' ')
- break;
- k = (int)soap_strtol(attr + i + 1, NULL, 10);
- n *= size[--dim] = k;
- if (k < 0 || n > SOAP_MAXARRAYSIZE)
- return -1;
- } while (i >= 0 && attr[i] != '[');
- return n;
-}
-#endif
-
-/******************************************************************************/
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_getposition(const char *attr, int *pos)
-{ register int i, n;
+{ int i, n;
if (!*attr)
return -1;
n = 0;
@@ -2781,15 +2981,16 @@ soap_getposition(const char *attr, int *pos)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
struct soap_nlist *
SOAP_FMAC2
soap_push_namespace(struct soap *soap, const char *id, const char *ns)
-{ register struct soap_nlist *np;
- register struct Namespace *p;
- register short i = -1;
- register size_t n, k;
+{ struct soap_nlist *np;
+ struct Namespace *p;
+ short i = -1;
+ size_t n, k;
n = strlen(id);
k = strlen(ns) + 1;
p = soap->local_namespaces;
@@ -2803,13 +3004,14 @@ soap_push_namespace(struct soap *soap, const char *id, const char *ns)
}
else if (p->in)
{ if (!soap_tag_cmp(ns, p->in))
- { if ((p->out = (char*)SOAP_MALLOC(soap, k)))
- strcpy(p->out, ns);
+ { p->out = (char*)SOAP_MALLOC(soap, k);
+ if (p->out)
+ soap_strcpy(p->out, k, ns);
break;
}
}
}
- if (!p || !p->id)
+ if (!p->id)
i = -1;
}
if (i >= 0)
@@ -2823,10 +3025,11 @@ soap_push_namespace(struct soap *soap, const char *id, const char *ns)
soap->nlist = np;
np->level = soap->level;
np->index = i;
- strcpy((char*)np->id, id);
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push namespace binding (level=%u) '%s' '%s'\n", soap->level, id, ns));
+ soap_strcpy((char*)np->id, n + 1, id);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push namespace binding (level=%u) '%s'='%s'\n", soap->level, id, ns));
if (i < 0)
- { np->ns = strcpy((char*)np->id + n + 1, ns);
+ { np->ns = np->id + n + 1;
+ soap_strcpy((char*)np->ns, k, ns);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push NOT OK: no match found for '%s' in namespace mapping table (added to stack anyway)\n", ns));
}
else
@@ -2838,15 +3041,16 @@ soap_push_namespace(struct soap *soap, const char *id, const char *ns)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void
SOAP_FMAC2
soap_pop_namespace(struct soap *soap)
-{ register struct soap_nlist *np, *nq;
+{ struct soap_nlist *np, *nq;
for (np = soap->nlist; np && np->level >= soap->level; np = nq)
{ nq = np->next;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop namespace binding (level=%u) '%s'\n", soap->level, np->id));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop namespace binding (level=%u) '%s' level=%u\n", soap->level, np->id, np->level));
SOAP_FREE(soap, np);
}
soap->nlist = np;
@@ -2854,24 +3058,26 @@ soap_pop_namespace(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_match_namespace(struct soap *soap, const char *id1, const char *id2, size_t n1, size_t n2)
-{ register struct soap_nlist *np = soap->nlist;
+{ struct soap_nlist *np = soap->nlist;
const char *s;
while (np && (strncmp(np->id, id1, n1) || np->id[n1]))
np = np->next;
if (np)
- { if (!(soap->mode & SOAP_XML_IGNORENS))
- if (np->index < 0
+ { if (!(soap->mode & SOAP_XML_IGNORENS) && (n2 > 0 || !np->ns || *np->ns))
+ { if (np->index < 0
|| ((s = soap->local_namespaces[np->index].id) && (strncmp(s, id2, n2) || (s[n2] && s[n2] != '_'))))
return SOAP_NAMESPACE;
+ }
return SOAP_OK;
}
if (n1 == 0)
- return (soap->mode & SOAP_XML_IGNORENS) ? SOAP_OK : SOAP_NAMESPACE;
+ return n2 == 0 || (soap->mode & SOAP_XML_IGNORENS) ? SOAP_OK : SOAP_NAMESPACE;
if ((n1 == 3 && n1 == n2 && !strncmp(id1, "xml", 3) && !strncmp(id1, id2, 3))
|| (soap->mode & SOAP_XML_IGNORENS))
return SOAP_OK;
@@ -2880,17 +3086,19 @@ soap_match_namespace(struct soap *soap, const char *id1, const char *id2, size_t
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
SOAP_FMAC2
-soap_current_namespace(struct soap *soap, const char *tag)
-{ register struct soap_nlist *np;
- register const char *s;
+soap_current_namespace_tag(struct soap *soap, const char *tag)
+{ struct soap_nlist *np;
+ const char *s;
if (!tag || !strncmp(tag, "xml", 3))
return NULL;
np = soap->nlist;
- if (!(s = strchr(tag, ':')))
+ s = strchr(tag, ':');
+ if (!s)
{ while (np && *np->id) /* find default namespace, if present */
np = np->next;
}
@@ -2903,7 +3111,7 @@ soap_current_namespace(struct soap *soap, const char *tag)
if (np)
{ if (np->index >= 0)
return soap->namespaces[np->index].ns;
- if (np->ns)
+ if (np->ns && *np->ns)
return soap_strdup(soap, np->ns);
}
return NULL;
@@ -2911,14 +3119,44 @@ soap_current_namespace(struct soap *soap, const char *tag)
#endif
/******************************************************************************/
+
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_current_namespace_att(struct soap *soap, const char *tag)
+{ struct soap_nlist *np;
+ const char *s;
+ if (!tag || !strncmp(tag, "xml", 3))
+ return NULL;
+ s = strchr(tag, ':');
+ if (!s)
+ return NULL;
+ np = soap->nlist;
+ while (np && (strncmp(np->id, tag, s - tag) || np->id[s - tag]))
+ np = np->next;
+ if (!np)
+ soap->error = SOAP_NAMESPACE;
+ if (np)
+ { if (np->index >= 0)
+ return soap->namespaces[np->index].ns;
+ if (np->ns && *np->ns)
+ return soap_strdup(soap, np->ns);
+ }
+ return NULL;
+}
+#endif
+
+/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_tag_cmp(const char *s, const char *t)
{ for (;;)
- { register int c1 = *s;
- register int c2 = *t;
+ { int c1 = *s;
+ int c2 = *t;
if (!c1 || c1 == '"')
break;
if (c2 != '-')
@@ -2959,13 +3197,14 @@ soap_tag_cmp(const char *s, const char *t)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
-{ register const char *s, *t;
- register int err;
+{ const char *s, *t;
+ int err;
if (!tag1 || !tag2 || !*tag2)
return SOAP_OK;
s = strchr(tag1, ':');
@@ -2974,35 +3213,40 @@ soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
{ if (s)
{ if (t[1] && SOAP_STRCMP(s + 1, t + 1))
return SOAP_TAG_MISMATCH;
- if (t != tag2 && (err = soap_match_namespace(soap, tag1, tag2, s - tag1, t - tag2)))
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2));
- if (err == SOAP_NAMESPACE)
- return SOAP_TAG_MISMATCH;
- return err;
+ if (t != tag2 && !(soap->mode & SOAP_XML_IGNORENS))
+ { err = soap_match_namespace(soap, tag1, tag2, s - tag1, t - tag2);
+ if (err)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2));
+ if (err == SOAP_NAMESPACE)
+ return SOAP_TAG_MISMATCH;
+ return err;
+ }
}
}
else if (!t[1])
- { err = soap_match_namespace(soap, tag1, tag2, 0, t - tag2);
- if (err == SOAP_NAMESPACE)
+ { if ((soap->mode & SOAP_XML_IGNORENS) || soap_match_namespace(soap, tag1, tag2, 0, t - tag2))
return SOAP_TAG_MISMATCH;
}
else if (SOAP_STRCMP(tag1, t + 1))
{ return SOAP_TAG_MISMATCH;
}
- else if (t != tag2 && (err = soap_match_namespace(soap, tag1, tag2, 0, t - tag2)))
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2));
- if (err == SOAP_NAMESPACE)
- return SOAP_TAG_MISMATCH;
- return err;
+ else if (t != tag2)
+ { err = soap_match_namespace(soap, tag1, tag2, 0, t - tag2);
+ if (err)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2));
+ if (err == SOAP_NAMESPACE)
+ return SOAP_TAG_MISMATCH;
+ return err;
+ }
}
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags and (default) namespaces match: '%s' '%s'\n", tag1, tag2));
return SOAP_OK;
}
if (s)
- { if (SOAP_STRCMP(s + 1, tag2))
+ { if (!(soap->mode & SOAP_XML_IGNORENS) || SOAP_STRCMP(s + 1, tag2)) /* always fails (except when ignoring ns) */
return SOAP_TAG_MISMATCH;
}
- else if (SOAP_STRCMP(tag1, tag2))
+ else if (SOAP_STRCMP(tag1, tag2) || ((soap->mode & SOAP_XML_STRICT) && !(soap->mode & SOAP_XML_IGNORENS) && soap_match_namespace(soap, tag1, tag2, 0, 0))) /* strict checking: default namespace must be null namespace */
return SOAP_TAG_MISMATCH;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags match: '%s' '%s'\n", tag1, tag2));
return SOAP_OK;
@@ -3010,6 +3254,50 @@ soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
#endif
/******************************************************************************/
+
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_match_att(struct soap *soap, const char *tag1, const char *tag2)
+{ const char *s, *t;
+ int err;
+ if (!tag1 || !tag2 || !*tag2)
+ return SOAP_OK;
+ s = strchr(tag1, ':');
+ t = strchr(tag2, ':');
+ if (t)
+ { if (s)
+ { if (t[1] && SOAP_STRCMP(s + 1, t + 1))
+ return SOAP_TAG_MISMATCH;
+ if (t != tag2 && !(soap->mode & SOAP_XML_IGNORENS))
+ { err = soap_match_namespace(soap, tag1, tag2, s - tag1, t - tag2);
+ if (err)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Atts '%s' and '%s' match but namespaces differ\n", tag1, tag2));
+ if (err == SOAP_NAMESPACE)
+ return SOAP_TAG_MISMATCH;
+ return err;
+ }
+ }
+ }
+ else if (!t[1] || t != tag2 || SOAP_STRCMP(tag1, t + 1))
+ return SOAP_TAG_MISMATCH;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Atts and (default) namespaces match: '%s' '%s'\n", tag1, tag2));
+ return SOAP_OK;
+ }
+ if (s)
+ { if (!(soap->mode & SOAP_XML_IGNORENS) || SOAP_STRCMP(s + 1, tag2)) /* always fails (except when ignoring ns) */
+ return SOAP_TAG_MISMATCH;
+ }
+ else if (SOAP_STRCMP(tag1, tag2))
+ return SOAP_TAG_MISMATCH;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Atts match: '%s' '%s'\n", tag1, tag2));
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -3029,28 +3317,28 @@ soap_match_array(struct soap *soap, const char *type)
/******************************************************************************\
*
- * SSL/TLS
+ * SSL/TLS
*
\******************************************************************************/
-/******************************************************************************/
#ifdef WITH_OPENSSL
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_rand()
-{ unsigned char buf[4];
+{ int r;
if (!soap_ssl_init_done)
soap_ssl_init();
- RAND_pseudo_bytes(buf, 4);
- return *(int*)buf;
+ RAND_pseudo_bytes((unsigned char*)&r, sizeof(int));
+ return r;
}
#endif
#endif
/******************************************************************************/
-#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
+
+#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_SYSTEMSSL)
#ifndef PALM_2
SOAP_FMAC1
int
@@ -3068,13 +3356,15 @@ soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *key
soap->password = password;
soap->cafile = cafile;
soap->capath = capath;
- soap->crlfile = NULL;
#ifdef WITH_OPENSSL
soap->dhfile = dhfile;
soap->randfile = randfile;
+ if (!soap->fsslverify)
+ soap->fsslverify = ssl_verify_callback;
#endif
soap->ssl_flags = flags | (dhfile == NULL ? SOAP_SSL_RSA : 0);
#ifdef WITH_GNUTLS
+ (void)randfile; (void)sid;
if (dhfile)
{ char *s;
int n = (int)soap_strtoul(dhfile, &s, 10);
@@ -3110,6 +3400,11 @@ soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *key
soap->xcred = NULL;
}
#endif
+#ifdef WITH_SYSTEMSSL
+ (void)randfile; (void)sid;
+ if (soap->ctx)
+ gsk_environment_close(&soap->ctx);
+#endif
err = soap->fsslauth(soap);
#ifdef WITH_OPENSSL
if (!err)
@@ -3125,7 +3420,8 @@ soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *key
#endif
/******************************************************************************/
-#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
+
+#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_SYSTEMSSL)
#ifndef PALM_2
SOAP_FMAC1
int
@@ -3146,9 +3442,11 @@ soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *key
#ifdef WITH_OPENSSL
soap->dhfile = NULL;
soap->randfile = randfile;
- soap->fsslverify = (flags & SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE) == 0 ? ssl_verify_callback : ssl_verify_callback_allow_expired_certificate;
+ if (!soap->fsslverify)
+ soap->fsslverify = (flags & SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE) == 0 ? ssl_verify_callback : ssl_verify_callback_allow_expired_certificate;
#endif
#ifdef WITH_GNUTLS
+ (void)randfile;
if (soap->session)
{ gnutls_deinit(soap->session);
soap->session = NULL;
@@ -3158,12 +3456,62 @@ soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *key
soap->xcred = NULL;
}
#endif
+#ifdef WITH_SYSTEMSSL
+ (void)randfile;
+ if (soap->ctx)
+ gsk_environment_close(&soap->ctx);
+#endif
return soap->fsslauth(soap);
}
#endif
#endif
/******************************************************************************/
+
+#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_ssl_crl(struct soap *soap, const char *crlfile)
+{
+#ifdef WITH_OPENSSL
+ if (crlfile && soap->ctx)
+ {
+#if (OPENSSL_VERSION_NUMBER >= 0x0090800fL)
+ X509_STORE *store = SSL_CTX_get_cert_store(soap->ctx);
+ if (*crlfile)
+ { int ret;
+ X509_LOOKUP *lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
+ ret = X509_load_crl_file(lookup, crlfile, X509_FILETYPE_PEM);
+ if (ret <= 0)
+ return soap_set_receiver_error(soap, soap_ssl_error(soap, ret), "Can't read CRL file", SOAP_SSL_ERROR);
+ }
+ X509_VERIFY_PARAM *param = X509_VERIFY_PARAM_new();
+ X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK);
+ X509_STORE_set1_param(store, param);
+ X509_VERIFY_PARAM_free(param);
+#endif
+ }
+ else
+ soap->crlfile = crlfile; /* activate later when store is available */
+#endif
+#ifdef WITH_GNUTLS
+ if (crlfile && soap->xcred)
+ { if (*crlfile)
+ if (gnutls_certificate_set_x509_crl_file(soap->xcred, crlfile, GNUTLS_X509_FMT_PEM) < 0)
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CRL file", SOAP_SSL_ERROR);
+ }
+ else
+ soap->crlfile = crlfile; /* activate later when xcred is available */
+#endif
+ return SOAP_OK;
+}
+#endif
+#endif
+
+/******************************************************************************/
+
#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
#ifndef PALM_2
SOAP_FMAC1
@@ -3175,8 +3523,7 @@ soap_ssl_init()
{ soap_ssl_init_done = 1;
#ifdef WITH_OPENSSL
SSL_library_init();
- OpenSSL_add_all_algorithms(); /* 2.8.1 change (wsseapi.c) */
- OpenSSL_add_all_digests();
+ OpenSSL_add_all_algorithms(); /* we keep ciphers and digests for the program's lifetime */
#ifndef WITH_LEAN
SSL_load_error_strings();
#endif
@@ -3206,6 +3553,21 @@ soap_ssl_init()
#endif
/******************************************************************************/
+
+#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_ssl_noinit()
+{ /* Call this first to bypass SSL init is SSL is already initialized elsewhere */
+ soap_ssl_init_done = 1;
+}
+#endif
+#endif
+
+/******************************************************************************/
+
#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
#ifndef PALM_1
SOAP_FMAC1
@@ -3217,35 +3579,33 @@ soap_ssl_error(struct soap *soap, int ret)
int err = SSL_get_error(soap->ssl, ret);
const char *msg = soap_code_str(h_ssl_error_codes, err);
if (msg)
- strcpy(soap->msgbuf, msg);
+ (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(msg) + 1), "%s\n", msg);
else
return ERR_error_string(err, soap->msgbuf);
if (ERR_peek_error())
{ unsigned long r;
- strcat(soap->msgbuf, "\n");
while ((r = ERR_get_error()))
- ERR_error_string_n(r, soap->msgbuf + strlen(soap->msgbuf), sizeof(soap->msgbuf) - strlen(soap->msgbuf));
+ { size_t l = strlen(soap->msgbuf);
+ ERR_error_string_n(r, soap->msgbuf + l, sizeof(soap->msgbuf) - l);
+ }
}
else
- { switch (ret)
+ { size_t l = strlen(soap->msgbuf);
+ switch (ret)
{ case 0:
- strcpy(soap->msgbuf, "EOF was observed that violates the SSL/TLS protocol. The client probably provided invalid authentication information.");
+ soap_strcpy(soap->msgbuf + l, sizeof(soap->msgbuf) - l, "EOF was observed that violates the SSL/TLS protocol. The client probably provided invalid authentication information.");
break;
case -1:
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Error observed by underlying SSL/TLS BIO: %s", strerror(errno));
-#else
- { const char *s = strerror(errno);
- size_t l = strlen(s);
- sprintf(soap->msgbuf, "Error observed by underlying SSL/TLS BIO: %s", l + 44 < sizeof(soap->msgbuf) ? s : SOAP_STR_EOS);
+ { const char *s = strerror(soap_errno);
+ (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, strlen(s) + 42), "Error observed by underlying SSL/TLS BIO: %s", s);
}
-#endif
break;
}
}
return soap->msgbuf;
#endif
#ifdef WITH_GNUTLS
+ (void)soap;
return gnutls_strerror(ret);
#endif
}
@@ -3253,7 +3613,30 @@ soap_ssl_error(struct soap *soap, int ret)
#endif
/******************************************************************************/
-#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
+
+#ifdef WITH_SYSTEMSSL
+static int
+ssl_recv(int sk, void *s, int n, char *user)
+{
+ (void)user;
+ return recv(sk, s, n, 0);
+}
+#endif
+
+/******************************************************************************/
+
+#ifdef WITH_SYSTEMSSL
+static int
+ssl_send(int sk, void *s, int n, char *user)
+{
+ (void)user;
+ return send(sk, s, n, 0);
+}
+#endif
+
+/******************************************************************************/
+
+#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_SYSTEMSSL)
#ifndef PALM_1
static int
ssl_auth_init(struct soap *soap)
@@ -3268,7 +3651,15 @@ ssl_auth_init(struct soap *soap)
soap_ssl_init();
ERR_clear_error();
if (!soap->ctx)
- { if (!(soap->ctx = SSL_CTX_new(SSLv23_method())))
+ {
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+ /* TLS_method: a TLS/SSL connection established may understand the SSLv3, TLSv1, TLSv1.1 and TLSv1.2 protocols. */
+ soap->ctx = SSL_CTX_new(TLS_method());
+#else
+ /* SSLv23_method: a TLS/SSL connection established may understand the SSLv3, TLSv1, TLSv1.1 and TLSv1.2 protocols. */
+ soap->ctx = SSL_CTX_new(SSLv23_method());
+#endif
+ if (!soap->ctx)
return soap_set_receiver_error(soap, "SSL/TLS error", "Can't setup context", SOAP_SSL_ERROR);
/* The following alters the behavior of SSL read/write: */
#if 0
@@ -3289,41 +3680,52 @@ ssl_auth_init(struct soap *soap)
{ if (!SSL_CTX_set_default_verify_paths(soap->ctx))
return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read default CA file and/or directory", SOAP_SSL_ERROR);
}
-/* This code assumes a typical scenario, see alternative code below */
+ if (soap->crlfile)
+ { if (soap_ssl_crl(soap, soap->crlfile))
+ return soap->error;
+ }
+/* This code assumes a typical scenario with key and cert in one PEM file, see alternative code below */
+#if 1
if (soap->keyfile)
{ if (!SSL_CTX_use_certificate_chain_file(soap->ctx, soap->keyfile))
- return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read certificate key file", SOAP_SSL_ERROR);
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't find or read certificate in key file", SOAP_SSL_ERROR);
if (soap->password)
{ SSL_CTX_set_default_passwd_cb_userdata(soap->ctx, (void*)soap->password);
SSL_CTX_set_default_passwd_cb(soap->ctx, ssl_password);
}
- if (!SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM))
- return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read key file", SOAP_SSL_ERROR);
#ifndef WM_SECURE_KEY_STORAGE
if (!SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM))
return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read key file", SOAP_SSL_ERROR);
#endif
}
-#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE)
- if (NULL == (pkey = ipcom_key_db_pkey_get(soap->keyid)))
- return soap_set_receiver_error(soap, "SSL error", "Can't find key", SOAP_SSL_ERROR);
- if (0 == SSL_CTX_use_PrivateKey(soap->ctx, pkey))
- return soap_set_receiver_error(soap, "SSL error", "Can't read key", SOAP_SSL_ERROR);
-#endif
-/* Suggested alternative approach to check the key file for certs (cafile=NULL):*/
-#if 0
+#else
+/* Suggested alternative approach to check the key file for cert only when cafile==NULL */
if (soap->password)
{ SSL_CTX_set_default_passwd_cb_userdata(soap->ctx, (void*)soap->password);
SSL_CTX_set_default_passwd_cb(soap->ctx, ssl_password);
}
- if (!soap->cafile || !SSL_CTX_use_certificate_chain_file(soap->ctx, soap->cafile))
+ if (!soap->cafile)
{ if (soap->keyfile)
{ if (!SSL_CTX_use_certificate_chain_file(soap->ctx, soap->keyfile))
- return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read certificate or key file", SOAP_SSL_ERROR);
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't find or read certificate in key file", SOAP_SSL_ERROR);
if (!SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM))
return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read key file", SOAP_SSL_ERROR);
}
}
+ else /* use cafile for (server) cert and keyfile for (server) key */
+ { if (!SSL_CTX_use_certificate_chain_file(soap->ctx, soap->cafile))
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CA file", SOAP_SSL_ERROR);
+ if (soap->keyfile)
+ if (!SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM))
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read key file", SOAP_SSL_ERROR);
+ }
+#endif
+#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE)
+ pkey = ipcom_key_db_pkey_get(soap->keyid);
+ if (!pkey)
+ return soap_set_receiver_error(soap, "SSL error", "Can't find key", SOAP_SSL_ERROR);
+ if (!SSL_CTX_use_PrivateKey(soap->ctx, pkey))
+ return soap_set_receiver_error(soap, "SSL error", "Can't read key", SOAP_SSL_ERROR);
#endif
if ((soap->ssl_flags & SOAP_SSL_RSA))
{ RSA *rsa = RSA_generate_key(SOAP_SSL_RSA_BITS, RSA_F4, NULL, NULL);
@@ -3360,11 +3762,27 @@ ssl_auth_init(struct soap *soap)
}
DH_free(dh);
}
- flags = (SSL_OP_ALL | SSL_OP_NO_SSLv2); /* disable SSL v2 */
+ flags = (SSL_OP_ALL | SSL_OP_NO_SSLv2); /* disable SSL v2 by default */
if ((soap->ssl_flags & SOAP_SSLv3))
+ {
+#if (OPENSSL_VERSION_NUMBER >= 0x10001000L)
+ flags |= SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2;
+#else
flags |= SSL_OP_NO_TLSv1;
- if ((soap->ssl_flags & SOAP_TLSv1))
- flags |= SSL_OP_NO_SSLv3;
+#endif
+ }
+ else
+ { if (!(soap->ssl_flags & SOAP_SSLv3_TLSv1))
+ flags |= SSL_OP_NO_SSLv3; /* disable SSL v3 by default, unless SOAP_SSLv3 or SOAP_SSLv3_TLSv1 is set */
+#if (OPENSSL_VERSION_NUMBER >= 0x10001000L)
+ if ((soap->ssl_flags & SOAP_TLSv1_0))
+ flags |= SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2;
+ else if ((soap->ssl_flags & SOAP_TLSv1_1))
+ flags |= SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_2;
+ else if ((soap->ssl_flags & SOAP_TLSv1_2))
+ flags |= SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1;
+#endif
+ }
#ifdef SSL_OP_NO_TICKET
/* TLS extension is enabled by default in OPENSSL v0.9.8k
Disable it by adding SSL_OP_NO_TICKET */
@@ -3395,11 +3813,11 @@ ssl_auth_init(struct soap *soap)
return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CA file", SOAP_SSL_ERROR);
}
if (soap->crlfile)
- { if (gnutls_certificate_set_x509_crl_file(soap->xcred, soap->crlfile, GNUTLS_X509_FMT_PEM) < 0)
- return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CRL file", SOAP_SSL_ERROR);
+ { if (soap_ssl_crl(soap, soap->crlfile))
+ return soap->error;
}
if (soap->keyfile)
- { if (gnutls_certificate_set_x509_key_file(soap->xcred, soap->keyfile, soap->keyfile, GNUTLS_X509_FMT_PEM) < 0) /* TODO: GNUTLS need to concat cert and key in single key file */
+ { if (gnutls_certificate_set_x509_key_file(soap->xcred, soap->keyfile, soap->keyfile, GNUTLS_X509_FMT_PEM) < 0) /* Assumes that key and cert(s) are concatenated in the keyfile */
return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read key file", SOAP_SSL_ERROR);
}
}
@@ -3434,11 +3852,74 @@ ssl_auth_init(struct soap *soap)
if ((soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION))
gnutls_certificate_server_set_request(soap->session, GNUTLS_CERT_REQUEST);
gnutls_session_enable_compatibility_mode(soap->session);
- if ((soap->ssl_flags & SOAP_TLSv1))
+ if ((soap->ssl_flags & SOAP_SSLv3))
+ { int protocol_priority[] = { GNUTLS_SSL3, 0 };
+ if (gnutls_protocol_set_priority(soap->session, protocol_priority) != GNUTLS_E_SUCCESS)
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set SSLv3 protocol", SOAP_SSL_ERROR);
+ }
+ else if ((soap->ssl_flags & SOAP_TLSv1_0))
{ int protocol_priority[] = { GNUTLS_TLS1_0, 0 };
if (gnutls_protocol_set_priority(soap->session, protocol_priority) != GNUTLS_E_SUCCESS)
- return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set TLS v1.0 protocol", SOAP_SSL_ERROR);
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set TLSv1.0 protocol", SOAP_SSL_ERROR);
+ }
+ else if ((soap->ssl_flags & SOAP_TLSv1_1))
+ { int protocol_priority[] = { GNUTLS_TLS1_1, 0 };
+ if (gnutls_protocol_set_priority(soap->session, protocol_priority) != GNUTLS_E_SUCCESS)
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set TLSv1.1 protocol", SOAP_SSL_ERROR);
+ }
+ else if ((soap->ssl_flags & SOAP_TLSv1_2))
+ { int protocol_priority[] = { GNUTLS_TLS1_2, 0 };
+ if (gnutls_protocol_set_priority(soap->session, protocol_priority) != GNUTLS_E_SUCCESS)
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set TLSv1.2 protocol", SOAP_SSL_ERROR);
+ }
+ else if ((soap->ssl_flags & SOAP_SSLv3_TLSv1))
+ { int protocol_priority[] = { GNUTLS_SSL3, GNUTLS_TLS1_0, GNUTLS_TLS1_1, GNUTLS_TLS1_2, 0 };
+ if (gnutls_protocol_set_priority(soap->session, protocol_priority) != GNUTLS_E_SUCCESS)
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set SSLv3 & TLSv1 protocols", SOAP_SSL_ERROR);
+ }
+ else
+ { int protocol_priority[] = { GNUTLS_TLS1_0, GNUTLS_TLS1_1, GNUTLS_TLS1_2, 0 };
+ if (gnutls_protocol_set_priority(soap->session, protocol_priority) != GNUTLS_E_SUCCESS)
+ return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set TLSv1 protocols", SOAP_SSL_ERROR);
+ }
+ }
+#endif
+#ifdef WITH_SYSTEMSSL
+ if (!soap->ctx)
+ { int err;
+ err = gsk_environment_open(&soap->ctx);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_SSLV2, GSK_PROTOCOL_SSLV2_OFF);
+ if (err == GSK_OK)
+ { if ((soap->ssl_flags & SOAP_SSLv3) || (soap->ssl_flags & SOAP_SSLv3_TLSv1))
+ err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_SSLV3, GSK_PROTOCOL_SSLV3_ON);
+ else
+ err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_SSLV3, GSK_PROTOCOL_SSLV3_OFF);
}
+ if (!(soap->ssl_flags & SOAP_SSLv3))
+ { if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_ON);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1_1, GSK_PROTOCOL_TLSV1_1_ON);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1_2, GSK_PROTOCOL_TLSV1_2_ON);
+ }
+ else
+ { if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_OFF);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1_1, GSK_PROTOCOL_TLSV1_1_OFF);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1_2, GSK_PROTOCOL_TLSV1_2_OFF);
+ }
+ if (err == GSK_OK)
+ err = gsk_attribute_set_buffer(soap->ctx, GSK_KEYRING_FILE, soap->keyfile, 0); /* keyfile is a keyring .kdb file */
+ if (err == GSK_OK)
+ err = gsk_attribute_set_buffer(soap->ctx, GSK_KEYRING_PW, soap->password, 0); /* locked by password */
+ if (err == GSK_OK)
+ err = gsk_environment_init(soap->ctx);
+ if (err != GSK_OK)
+ return soap_set_receiver_error(soap, gsk_strerror(err), "SYSTEM SSL error in ssl_auth_init()", SOAP_SSL_ERROR);
}
#endif
return SOAP_OK;
@@ -3447,63 +3928,75 @@ ssl_auth_init(struct soap *soap)
#endif
/******************************************************************************/
+
#ifdef WITH_OPENSSL
#ifndef PALM_1
static int
ssl_password(char *buf, int num, int rwflag, void *userdata)
-{ if (num < (int)strlen((char*)userdata) + 1)
+{ (void)rwflag;
+ if (!buf || !userdata)
return 0;
- return (int)strlen(strcpy(buf, (char*)userdata));
+ soap_strcpy(buf, (size_t)num, (char*)userdata);
+ return (int)strlen(buf);
}
#endif
#endif
/******************************************************************************/
+
#ifdef WITH_OPENSSL
#ifndef PALM_1
static int
ssl_verify_callback(int ok, X509_STORE_CTX *store)
-{
+{ (void)store;
#ifdef SOAP_DEBUG
if (!ok)
{ char buf[1024];
int err = X509_STORE_CTX_get_error(store);
X509 *cert = X509_STORE_CTX_get_current_cert(store);
- fprintf(stderr, "SSL verify error or warning with certificate at depth %d: %s\n", X509_STORE_CTX_get_error_depth(store), X509_verify_cert_error_string(err));
+ fprintf(stderr, "\nDEBUG mode TLS/SSL warnings:\nSSL verify error %d or warning with certificate at depth %d: %s\n", err, X509_STORE_CTX_get_error_depth(store), X509_verify_cert_error_string(err));
X509_NAME_oneline(X509_get_issuer_name(cert), buf, sizeof(buf));
- fprintf(stderr, "certificate issuer %s\n", buf);
+ fprintf(stderr, " certificate issuer: %s\n", buf);
X509_NAME_oneline(X509_get_subject_name(cert), buf, sizeof(buf));
- fprintf(stderr, "certificate subject %s\n", buf);
- /* accept self signed certificates and certificates out of date */
+ fprintf(stderr, " certificate subject: %s\n", buf);
+ /* accept self-signed certificates and certificates out of date */
switch (err)
{ case X509_V_ERR_CERT_NOT_YET_VALID:
case X509_V_ERR_CERT_HAS_EXPIRED:
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
+ case X509_V_ERR_UNABLE_TO_GET_CRL:
+ case X509_V_ERR_CRL_NOT_YET_VALID:
+ case X509_V_ERR_CRL_HAS_EXPIRED:
X509_STORE_CTX_set_error(store, X509_V_OK);
ok = 1;
+ fprintf(stderr, "Initialize soap_ssl_client_context with SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE to allow this verification error to pass without DEBUG mode enabled\n");
}
}
#endif
- /* Note: return 1 to continue, but unsafe progress will be terminated by OpenSSL */
+ /* Note: return 1 to try to continue, but unsafe progress will be terminated by OpenSSL */
return ok;
}
#endif
#endif
/******************************************************************************/
+
#ifdef WITH_OPENSSL
#ifndef PALM_1
static int
ssl_verify_callback_allow_expired_certificate(int ok, X509_STORE_CTX *store)
{ ok = ssl_verify_callback(ok, store);
if (!ok)
- { /* accept self signed certificates and certificates out of date */
+ { /* accept self signed certificates, expired certificates, and certficiates w/o CRL */
switch (X509_STORE_CTX_get_error(store))
{ case X509_V_ERR_CERT_NOT_YET_VALID:
case X509_V_ERR_CERT_HAS_EXPIRED:
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN:
+ case X509_V_ERR_UNABLE_TO_GET_CRL:
+ case X509_V_ERR_CRL_NOT_YET_VALID:
+ case X509_V_ERR_CRL_HAS_EXPIRED:
X509_STORE_CTX_set_error(store, X509_V_OK);
ok = 1;
}
@@ -3515,6 +4008,7 @@ ssl_verify_callback_allow_expired_certificate(int ok, X509_STORE_CTX *store)
#endif
/******************************************************************************/
+
#ifdef WITH_GNUTLS
static const char *
ssl_verify(struct soap *soap, const char *host)
@@ -3554,6 +4048,7 @@ ssl_verify(struct soap *soap, const char *host)
#endif
/******************************************************************************/
+
#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
#ifndef WITH_NOIO
#ifndef PALM_1
@@ -3568,7 +4063,7 @@ soap_ssl_accept(struct soap *soap)
if (!soap_valid_socket(sk))
return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR);
soap->ssl_flags &= ~SOAP_SSL_CLIENT;
- if (!soap->ctx && (soap->error = soap->fsslauth(soap)))
+ if (!soap->ctx && (soap->error = soap->fsslauth(soap)) != SOAP_OK)
return soap->error;
if (!soap->ssl)
{ soap->ssl = SSL_new(soap->ctx);
@@ -3630,7 +4125,7 @@ soap_ssl_accept(struct soap *soap)
if (!soap_valid_socket(sk))
return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR);
soap->ssl_flags &= ~SOAP_SSL_CLIENT;
- if (!soap->session && (soap->error = soap->fsslauth(soap)))
+ if (!soap->session && (soap->error = soap->fsslauth(soap)) != SOAP_OK)
{ soap_closesock(soap);
return soap->error;
}
@@ -3672,6 +4167,50 @@ soap_ssl_accept(struct soap *soap)
}
}
#endif
+#ifdef WITH_SYSTEMSSL
+ gsk_iocallback local_io = { ssl_recv, ssl_send, NULL, NULL, NULL, NULL };
+ int err, s;
+ int retries = 0;
+ if (soap->accept_timeout)
+ { SOAP_SOCKNONBLOCK(sk)
+ retries = 10*soap->accept_timeout;
+ }
+ if (retries <= 0)
+ retries = 100; /* timeout: 10 sec retries, 100 times 0.1 sec */
+ err = gsk_secure_socket_open(soap->ctx, &soap->ssl);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_numeric_value(soap->ssl, GSK_FD, sk);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_buffer(soap->ssl, GSK_KEYRING_LABEL, soap->cafile, 0);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ssl, GSK_SESSION_TYPE, GSK_SERVER_SESSION);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_buffer(soap->ssl, GSK_V3_CIPHER_SPECS_EXPANDED, "0035002F000A", 0);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ssl, GSK_V3_CIPHERS, GSK_V3_CIPHERS_CHAR4);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_callback(soap->ssl, GSK_IO_CALLBACK, &local_io);
+ if (err != GSK_OK)
+ return soap_set_receiver_error(soap, gsk_strerror(err), "SYSTEM SSL error in soap_ssl_accept()", SOAP_SSL_ERROR);
+ while ((err = gsk_secure_socket_init(soap->ssl)) != GSK_OK)
+ { if (retries-- <= 0)
+ break;
+ if (err == GSK_WOULD_BLOCK_READ || err == GSK_WOULD_BLOCK_WRITE)
+ { if (err == GSK_WOULD_BLOCK_READ)
+ s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
+ else
+ s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
+ if (s < 0)
+ break;
+ }
+ else
+ { soap->errnum = soap_socket_errno(sk);
+ break;
+ }
+ }
+ if (err != GSK_OK)
+ return soap_set_receiver_error(soap, gsk_strerror(err), "gsk_secure_socket_init() failed in soap_ssl_accept()", SOAP_SSL_ERROR);
+#endif
if (soap->recv_timeout || soap->send_timeout)
SOAP_SOCKNONBLOCK(sk)
else
@@ -3686,11 +4225,10 @@ soap_ssl_accept(struct soap *soap)
/******************************************************************************\
*
- * TCP/UDP [SSL/TLS] IPv4 and IPv6
+ * TCP/UDP [SSL/TLS] IPv4 and IPv6
*
\******************************************************************************/
-/******************************************************************************/
#ifndef WITH_NOIO
#ifndef PALM_1
static int
@@ -3712,11 +4250,12 @@ tcp_init(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
static const char*
tcp_error(struct soap *soap)
-{ register const char *msg = NULL;
+{ const char *msg = NULL;
switch (soap->errmode)
{ case 0:
msg = soap_strerror(soap);
@@ -3730,12 +4269,7 @@ tcp_error(struct soap *soap)
msg = soap_code_str(h_error_codes, soap->errnum);
if (!msg)
#endif
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "TCP/UDP IP error %d", soap->errnum);
-#else
- sprintf(soap->msgbuf, "TCP/UDP IP error %d", soap->errnum);
-#endif
+ { (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), 37), "TCP/UDP IP error %d", soap->errnum);
msg = soap->msgbuf;
}
}
@@ -3746,6 +4280,7 @@ tcp_error(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_IPV6
#ifndef WITH_NOIO
#ifndef PALM_1
@@ -3764,15 +4299,16 @@ tcp_gethost(struct soap *soap, const char *addr, struct in_addr *inaddr)
#ifdef AS400
iadd = inet_addr((void*)addr);
#else
- iadd = inet_addr(addr);
+ iadd = inet_addr((char*)addr);
#endif
#endif
if (iadd != -1)
- { memcpy(inaddr, &iadd, sizeof(iadd));
+ { if (soap_memcpy((void*)inaddr, sizeof(struct in_addr), (const void*)&iadd, sizeof(iadd)))
+ return soap->error = SOAP_EOM;
return SOAP_OK;
}
#if defined(__GLIBC__) || (defined(HAVE_GETHOSTBYNAME_R) && (defined(FREEBSD) || defined(__FreeBSD__))) || defined(__ANDROID__)
- if (gethostbyname_r(addr, &hostent, soap->buf, SOAP_BUFLEN, &host, &soap->errnum) < 0)
+ if (gethostbyname_r(addr, &hostent, soap->buf, sizeof(soap->buf), &host, &soap->errnum) < 0)
host = NULL;
#elif defined(_AIX43) || ((defined(TRU64) || defined(HP_UX)) && defined(HAVE_GETHOSTBYNAME_R))
memset((void*)&ht_data, 0, sizeof(ht_data));
@@ -3781,7 +4317,7 @@ tcp_gethost(struct soap *soap, const char *addr, struct in_addr *inaddr)
soap->errnum = h_errno;
}
#elif defined(HAVE_GETHOSTBYNAME_R)
- host = gethostbyname_r(addr, &hostent, soap->buf, SOAP_BUFLEN, &soap->errnum);
+ host = gethostbyname_r(addr, &hostent, soap->buf, sizeof(soap->buf), &soap->errnum);
#elif defined(VXWORKS)
/* If the DNS resolver library resolvLib has been configured in the vxWorks
* image, a query for the host IP address is sent to the DNS server, if the
@@ -3793,12 +4329,12 @@ tcp_gethost(struct soap *soap, const char *addr, struct in_addr *inaddr)
}
#else
#ifdef AS400
- if (!(host = gethostbyname((void*)addr)))
- soap->errnum = h_errno;
+ host = gethostbyname((void*)addr);
#else
- if (!(host = gethostbyname(addr)))
- soap->errnum = h_errno;
+ host = gethostbyname((char*)addr);
#endif
+ if (!host)
+ soap->errnum = h_errno;
#endif
if (!host)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Host name not found\n"));
@@ -3807,7 +4343,8 @@ tcp_gethost(struct soap *soap, const char *addr, struct in_addr *inaddr)
#ifdef VXWORKS
inaddr->s_addr = hostint;
#else
- memcpy(inaddr, host->h_addr, host->h_length);
+ if (soap_memcpy((void*)inaddr, sizeof(struct in_addr), (const void*)host->h_addr, (size_t)host->h_length))
+ return soap->error = SOAP_EOM;
#endif
return SOAP_OK;
}
@@ -3816,6 +4353,7 @@ tcp_gethost(struct soap *soap, const char *addr, struct in_addr *inaddr)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
static SOAP_SOCKET
@@ -3827,14 +4365,9 @@ tcp_connect(struct soap *soap, const char *endpoint, const char *host, int port)
SOAP_SOCKET sk;
int err = 0;
#ifndef WITH_LEAN
-#ifndef WIN32
- int len = SOAP_BUFLEN;
-#else
- int len = SOAP_BUFLEN + 1; /* speeds up windows xfer */
-#endif
int set = 1;
#endif
-#if !defined(WITH_LEAN) || defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
+#if !defined(WITH_LEAN) || defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_SYSTEMSSL)
int retries;
#endif
if (soap_valid_socket(soap->socket))
@@ -3842,13 +4375,17 @@ tcp_connect(struct soap *soap, const char *endpoint, const char *host, int port)
soap->socket = SOAP_INVALID_SOCKET;
if (tcp_init(soap))
{ soap->errnum = 0;
- soap_set_sender_error(soap, tcp_error(soap), "TCP init failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP init failed in tcp_connect()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
soap->errmode = 0;
#ifdef WITH_IPV6
memset((void*)&hints, 0, sizeof(hints));
+#ifdef WITH_IPV6_V6ONLY
+ hints.ai_family = PF_INET6;
+#else
hints.ai_family = PF_UNSPEC;
+#endif
#ifndef WITH_LEAN
if ((soap->omode & SOAP_IO_UDP))
hints.ai_socktype = SOCK_DGRAM;
@@ -3860,13 +4397,14 @@ tcp_connect(struct soap *soap, const char *endpoint, const char *host, int port)
err = getaddrinfo(soap->proxy_host, soap_int2s(soap, soap->proxy_port), &hints, &res);
else
err = getaddrinfo(host, soap_int2s(soap, port), &hints, &res);
- if (err)
- { soap_set_sender_error(soap, SOAP_GAI_STRERROR(err), "getaddrinfo failed in tcp_connect()", SOAP_TCP_ERROR);
+ if (err || !res)
+ { soap_set_receiver_error(soap, SOAP_GAI_STRERROR(err), "getaddrinfo failed in tcp_connect()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
ressave = res;
again:
sk = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+ soap->error = SOAP_OK;
soap->errmode = 0;
#else
#ifndef WITH_LEAN
@@ -3888,13 +4426,13 @@ again:
}
#endif
soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "socket failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "socket failed in tcp_connect()", SOAP_TCP_ERROR);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
-#ifdef SOCKET_CLOSE_ON_EXEC
+#ifdef SOCKET_CLOSE_ON_EXIT
#ifdef WIN32
#ifndef UNDER_CE
SetHandleInformation((HANDLE)sk, HANDLE_FLAG_INHERIT, 0);
@@ -3904,14 +4442,14 @@ again:
#endif
#endif
#ifndef WITH_LEAN
- if (soap->connect_flags == SO_LINGER)
+ if ((soap->connect_flags & SO_LINGER))
{ struct linger linger;
memset((void*)&linger, 0, sizeof(linger));
linger.l_onoff = 1;
linger.l_linger = soap->linger_time;
if (setsockopt(sk, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
@@ -3919,36 +4457,37 @@ again:
return SOAP_INVALID_SOCKET;
}
}
- else if (soap->connect_flags && setsockopt(sk, SOL_SOCKET, soap->connect_flags, (char*)&set, sizeof(int)))
+ if ((soap->connect_flags & ~SO_LINGER) && setsockopt(sk, SOL_SOCKET, soap->connect_flags & ~SO_LINGER, (char*)&set, sizeof(int)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
+#ifndef UNDER_CE
if ((soap->keep_alive || soap->tcp_keep_alive) && setsockopt(sk, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
- if (setsockopt(sk, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
+ if (soap->sndbuf > 0 && setsockopt(sk, SOL_SOCKET, SO_SNDBUF, (char*)&soap->sndbuf, sizeof(int)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
- if (setsockopt(sk, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
+ if (soap->rcvbuf > 0 && setsockopt(sk, SOL_SOCKET, SO_RCVBUF, (char*)&soap->rcvbuf, sizeof(int)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
@@ -3958,7 +4497,7 @@ again:
#ifdef TCP_KEEPIDLE
if (soap->tcp_keep_idle && setsockopt((SOAP_SOCKET)sk, IPPROTO_TCP, TCP_KEEPIDLE, (char*)&(soap->tcp_keep_idle), sizeof(int)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt TCP_KEEPIDLE failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_KEEPIDLE failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, (SOAP_SOCKET)sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
@@ -3969,7 +4508,7 @@ again:
#ifdef TCP_KEEPINTVL
if (soap->tcp_keep_intvl && setsockopt((SOAP_SOCKET)sk, IPPROTO_TCP, TCP_KEEPINTVL, (char*)&(soap->tcp_keep_intvl), sizeof(int)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt TCP_KEEPINTVL failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_KEEPINTVL failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, (SOAP_SOCKET)sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
@@ -3980,7 +4519,7 @@ again:
#ifdef TCP_KEEPCNT
if (soap->tcp_keep_cnt && setsockopt((SOAP_SOCKET)sk, IPPROTO_TCP, TCP_KEEPCNT, (char*)&(soap->tcp_keep_cnt), sizeof(int)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt TCP_KEEPCNT failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_KEEPCNT failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, (SOAP_SOCKET)sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
@@ -3991,7 +4530,7 @@ again:
#ifdef TCP_NODELAY
if (!(soap->omode & SOAP_IO_UDP) && setsockopt(sk, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
@@ -4011,8 +4550,11 @@ again:
{ unsigned char ttl = soap->ipv4_multicast_ttl;
if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl, sizeof(ttl)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_TTL failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_TTL failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
+#ifdef WITH_IPV6
+ freeaddrinfo(ressave);
+#endif
return SOAP_INVALID_SOCKET;
}
}
@@ -4020,8 +4562,11 @@ again:
{ if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr)))
#ifndef WINDOWS
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
+#ifdef WITH_IPV6
+ freeaddrinfo(ressave);
+#endif
return SOAP_INVALID_SOCKET;
}
#else
@@ -4030,8 +4575,11 @@ again:
#endif
if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr)))
{ soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
+#ifdef WITH_IPV6
+ freeaddrinfo(ressave);
+#endif
return SOAP_INVALID_SOCKET;
}
#endif
@@ -4039,27 +4587,28 @@ again:
}
#endif
#endif
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Opening socket=%d to host='%s' port=%d\n", sk, host, port));
+#endif
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Opening socket=%d to host='%s' port=%d\n", sk, host, port));
#ifndef WITH_IPV6
- soap->peerlen = sizeof(soap->peer);
- memset((void*)&soap->peer, 0, sizeof(soap->peer));
- soap->peer.sin_family = AF_INET;
+ soap->peerlen = sizeof(soap->peer.in);
+ memset((void*)&soap->peer.in, 0, sizeof(soap->peer.in));
+ soap->peer.in.sin_family = AF_INET;
soap->errmode = 2;
if (soap->proxy_host)
- { if (soap->fresolve(soap, soap->proxy_host, &soap->peer.sin_addr))
- { soap_set_sender_error(soap, tcp_error(soap), "get proxy host by name failed in tcp_connect()", SOAP_TCP_ERROR);
+ { if (soap->fresolve(soap, soap->proxy_host, &soap->peer.in.sin_addr))
+ { soap_set_receiver_error(soap, tcp_error(soap), "get proxy host by name failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
- soap->peer.sin_port = htons((short)soap->proxy_port);
+ soap->peer.in.sin_port = htons((short)soap->proxy_port);
}
else
- { if (soap->fresolve(soap, host, &soap->peer.sin_addr))
- { soap_set_sender_error(soap, tcp_error(soap), "get host by name failed in tcp_connect()", SOAP_TCP_ERROR);
+ { if (soap->fresolve(soap, host, &soap->peer.in.sin_addr))
+ { soap_set_receiver_error(soap, tcp_error(soap), "get host by name failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
- soap->peer.sin_port = htons((short)port);
+ soap->peer.in.sin_port = htons((short)port);
}
soap->errmode = 0;
#ifndef WITH_LEAN
@@ -4068,7 +4617,11 @@ again:
#endif
#else
if ((soap->omode & SOAP_IO_UDP))
- { memcpy(&soap->peer, res->ai_addr, res->ai_addrlen);
+ { if (soap_memcpy((void*)&soap->peer.storage, sizeof(soap->peer.storage), (const void*)res->ai_addr, res->ai_addrlen))
+ { soap->error = SOAP_EOM;
+ soap->fclosesocket(soap, sk);
+ sk = SOAP_INVALID_SOCKET;
+ }
soap->peerlen = res->ai_addrlen;
freeaddrinfo(ressave);
return sk;
@@ -4086,9 +4639,16 @@ again:
#ifdef WITH_IPV6
if (connect(sk, res->ai_addr, (int)res->ai_addrlen))
#else
- if (connect(sk, (struct sockaddr*)&soap->peer, sizeof(soap->peer)))
+ if (connect(sk, &soap->peer.addr, sizeof(soap->peer.in)))
#endif
{ err = soap_socket_errno(sk);
+#ifdef WITH_IPV6
+ if (err == SOAP_ECONNREFUSED && res->ai_next)
+ { soap->fclosesocket(soap, sk);
+ res = res->ai_next;
+ goto again;
+ }
+#endif
#ifndef WITH_LEAN
if (err == SOAP_EADDRINUSE)
{ soap->fclosesocket(soap, sk);
@@ -4099,15 +4659,19 @@ again:
{
SOAP_SOCKLEN_T k;
for (;;)
- { register int r;
+ { int r;
r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND, soap->connect_timeout);
if (r > 0)
break;
if (!r)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connect timeout\n"));
- soap_set_sender_error(soap, "Timeout", "connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, "Timeout", "connect failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
+ if (res->ai_next)
+ { res = res->ai_next;
+ goto again;
+ }
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
@@ -4115,23 +4679,31 @@ again:
r = soap->errnum = soap_socket_errno(sk);
if (r != SOAP_EINTR)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n"));
- soap_set_sender_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
+ if (res->ai_next)
+ { res = res->ai_next;
+ goto again;
+ }
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
}
}
k = (SOAP_SOCKLEN_T)sizeof(soap->errnum);
- if (!getsockopt(sk, SOL_SOCKET, SO_ERROR, (char*)&soap->errnum, &k) && !soap->errnum) /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
+ if (!getsockopt(sk, SOL_SOCKET, SO_ERROR, (char*)&soap->errnum, &k) && !soap->errnum) /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
break;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n"));
if (!soap->errnum)
soap->errnum = soap_socket_errno(sk);
- soap_set_sender_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
+ if (res->ai_next)
+ { res = res->ai_next;
+ goto again;
+ }
freeaddrinfo(ressave);
#endif
return SOAP_INVALID_SOCKET;
@@ -4147,7 +4719,7 @@ again:
if (err && err != SOAP_EINTR)
{ soap->errnum = err;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n"));
- soap_set_sender_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
#ifdef WITH_IPV6
freeaddrinfo(ressave);
@@ -4165,12 +4737,15 @@ again:
soap->socket = sk;
soap->imode &= ~SOAP_ENC_SSL;
soap->omode &= ~SOAP_ENC_SSL;
- if (!soap_tag_cmp(endpoint, "https:*"))
+ if (endpoint && !soap_tag_cmp(endpoint, "https:*"))
{
-#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
+#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_SYSTEMSSL)
#ifdef WITH_OPENSSL
BIO *bio;
#endif
+#ifdef WITH_SYSTEMSSL
+ gsk_iocallback local_io = { ssl_recv, ssl_send, NULL, NULL, NULL, NULL };
+#endif
int r;
if (soap->proxy_host)
{ soap_mode m = soap->mode; /* preserve settings */
@@ -4194,7 +4769,8 @@ again:
}
soap->status = SOAP_CONNECT;
soap->keep_alive = 1;
- if ((soap->error = soap->fpost(soap, endpoint, host, port, NULL, NULL, 0))
+ soap->error = soap->fpost(soap, endpoint, host, port, NULL, NULL, 0);
+ if (soap->error
|| soap_end_send_flush(soap))
{ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
@@ -4205,7 +4781,8 @@ again:
soap->imode &= ~SOAP_ENC; /* mask IO and ENC */
userid = soap->userid; /* preserve */
passwd = soap->passwd; /* preserve */
- if ((soap->error = soap->fparse(soap)))
+ soap->error = soap->fparse(soap);
+ if (soap->error)
{ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
@@ -4219,14 +4796,12 @@ again:
return SOAP_INVALID_SOCKET;
}
if (endpoint)
- { strncpy(soap->endpoint, endpoint, sizeof(soap->endpoint)); /* restore */
- soap->endpoint[sizeof(soap->endpoint) - 1] = '\0';
- }
+ soap_strcpy(soap->endpoint, sizeof(soap->endpoint), endpoint); /* restore */
soap->mode = m;
}
#ifdef WITH_OPENSSL
soap->ssl_flags |= SOAP_SSL_CLIENT;
- if (!soap->ctx && (soap->error = soap->fsslauth(soap)))
+ if (!soap->ctx && (soap->error = soap->fsslauth(soap)) != SOAP_OK)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL required, but no ctx set\n"));
soap->fclosesocket(soap, sk);
soap->error = SOAP_SSL_ERROR;
@@ -4248,8 +4823,19 @@ again:
SSL_SESSION_free(soap->session);
soap->session = NULL;
}
- soap->imode |= SOAP_ENC_SSL;
- soap->omode |= SOAP_ENC_SSL;
+#if (OPENSSL_VERSION_NUMBER >= 0x1000000aL)
+ if (!(soap->ssl_flags & SOAP_SSLv3) && !SSL_set_tlsext_host_name(soap->ssl, host))
+ { soap_set_receiver_error(soap, "SSL/TLS error", "SNI failed", SOAP_SSL_ERROR);
+ soap->fclosesocket(soap, sk);
+ return SOAP_INVALID_SOCKET;
+ }
+#elif (OPENSSL_VERSION_NUMBER >= 0x0090800fL) && defined(SSL_CTRL_SET_TLSEXT_HOSTNAME)
+ if (!SSL_ctrl(soap->ssl, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, (void*)host))
+ { soap_set_receiver_error(soap, "SSL/TLS error", "SNI failed", SOAP_SSL_ERROR);
+ soap->fclosesocket(soap, sk);
+ return SOAP_INVALID_SOCKET;
+ }
+#endif
bio = BIO_new_socket((int)sk, BIO_NOCLOSE);
SSL_set_bio(soap->ssl, bio, bio);
/* Connect timeout: set SSL sockets to non-blocking */
@@ -4267,26 +4853,26 @@ again:
{ if ((r = SSL_connect(soap->ssl)) <= 0)
{ int err = SSL_get_error(soap->ssl, r);
if (err == SSL_ERROR_WANT_CONNECT || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE)
- { register int s;
+ { int s;
if (err == SSL_ERROR_WANT_READ)
s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
else
s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
if (s < 0)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL_connect/select error in tcp_connect\n"));
- soap_set_sender_error(soap, soap_ssl_error(soap, r), "SSL_connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, soap_ssl_error(soap, r), "SSL_connect failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
if (s == 0 && retries-- <= 0)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL/TLS connect timeout\n"));
- soap_set_sender_error(soap, "Timeout", "SSL_connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, "Timeout", "SSL_connect failed in tcp_connect()", SOAP_TCP_ERROR);
soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
}
else
- { soap_set_sender_error(soap, soap_ssl_error(soap, r), "SSL_connect error in tcp_connect()", SOAP_SSL_ERROR);
+ { soap_set_receiver_error(soap, soap_ssl_error(soap, r), "SSL_connect error in tcp_connect()", SOAP_SSL_ERROR);
soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
@@ -4337,18 +4923,17 @@ again:
if (meth->it)
ext_data = ASN1_item_d2i(NULL, &data, ext->value->length, ASN1_ITEM_ptr(meth->it));
else
- { /* OpenSSL is not portable at this point (?):
- Some compilers appear to prefer
- meth->d2i(NULL, (const unsigned char**)&data, ...
- and others prefer
- meth->d2i(NULL, &data, ext->value->length);
- */
+ {
+#if (OPENSSL_VERSION_NUMBER > 0x0090800fL)
+ ext_data = meth->d2i(NULL, (const unsigned char **)&data, ext->value->length);
+#else
ext_data = meth->d2i(NULL, &data, ext->value->length);
+#endif
}
if (ext_data)
val = meth->i2v(meth, ext_data, NULL);
- else
- val = NULL;
+ else
+ val = NULL;
if (meth->it)
ASN1_item_free((ASN1_VALUE*)ext_data, ASN1_ITEM_ptr(meth->it));
else
@@ -4359,11 +4944,11 @@ again:
val = meth->i2v(meth, ext_data, NULL);
meth->ext_free(ext_data);
#endif
- if (val)
+ if (val)
{ int j;
for (j = 0; j < sk_CONF_VALUE_num(val); j++)
{ CONF_VALUE *nval = sk_CONF_VALUE_value(val, j);
- if (nval && !strcmp(nval->name, "DNS") && !strcmp(nval->value, host))
+ if (nval && (!strcmp(nval->name, "DNS") || !strcmp(nval->name,"IP Address")) && !soap_tag_cmp(nval->value, host))
{ ok = 1;
break;
}
@@ -4386,7 +4971,7 @@ again:
{ int j;
for (j = 0; j < sk_CONF_VALUE_num(val); j++)
{ CONF_VALUE *nval = sk_CONF_VALUE_value(val, j);
- if (nval && !strcmp(nval->name, "DNS") && !strcmp(nval->value, host))
+ if (nval && (!strcmp(nval->name, "DNS") || !strcmp(nval->name,"IP Address")) && !soap_tag_cmp(nval->value, host))
{ ok = 1;
break;
}
@@ -4394,7 +4979,7 @@ again:
sk_CONF_VALUE_pop_free(val, X509V3_conf_free);
}
#endif
- if (!ok && (subj = X509_get_subject_name(peer)))
+ if (!ok && (subj = X509_get_subject_name(peer)) != 0)
{ int i = -1;
do
{ ASN1_STRING *name;
@@ -4433,7 +5018,7 @@ again:
#endif
#ifdef WITH_GNUTLS
soap->ssl_flags |= SOAP_SSL_CLIENT;
- if (!soap->session && (soap->error = soap->fsslauth(soap)))
+ if (!soap->session && (soap->error = soap->fsslauth(soap)) != SOAP_OK)
{ soap->fclosesocket(soap, sk);
return SOAP_INVALID_SOCKET;
}
@@ -4474,11 +5059,75 @@ again:
{ const char *err = ssl_verify(soap, host);
if (err)
{ soap->fclosesocket(soap, sk);
- soap->error = soap_set_sender_error(soap, "SSL/TLS error", err, SOAP_SSL_ERROR);
+ soap->error = soap_set_sender_error(soap, "SSL/TLS verify error", err, SOAP_SSL_ERROR);
return SOAP_INVALID_SOCKET;
}
}
#endif
+#ifdef WITH_SYSTEMSSL
+ soap->ssl_flags |= SOAP_SSL_CLIENT;
+ if (!soap->ctx && (soap->error = soap->fsslauth(soap)) != SOAP_OK)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL required, but no ctx set\n"));
+ soap->fclosesocket(soap, sk);
+ soap->error = SOAP_SSL_ERROR;
+ return SOAP_INVALID_SOCKET;
+ }
+ /* Connect timeout: set SSL sockets to non-blocking */
+ retries = 0;
+ if (soap->connect_timeout)
+ { SOAP_SOCKNONBLOCK(sk)
+ retries = 10*soap->connect_timeout;
+ }
+ else
+ SOAP_SOCKBLOCK(sk)
+ if (retries <= 0)
+ retries = 100; /* timeout: 10 sec retries, 100 times 0.1 sec */
+ err = gsk_secure_socket_open(soap->ctx, &soap->ssl);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_numeric_value(soap->ssl, GSK_FD, sk);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_buffer(soap->ssl, GSK_KEYRING_LABEL, soap->cafile, 0); /* Certificate label */
+ if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ssl, GSK_SESSION_TYPE, GSK_CLIENT_SESSION);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_buffer(soap->ssl, GSK_V3_CIPHER_SPECS_EXPANDED, "0035002F000A", 0);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_enum(soap->ssl, GSK_V3_CIPHERS, GSK_V3_CIPHERS_CHAR4);
+ if (err == GSK_OK)
+ err = gsk_attribute_set_callback(soap->ssl, GSK_IO_CALLBACK, &local_io);
+ if (err != GSK_OK)
+ { soap_set_receiver_error(soap, gsk_strerror(err), "SYSTEM SSL error in tcp_connect()", SOAP_SSL_ERROR);
+ return SOAP_INVALID_SOCKET;
+ }
+ /* Try connecting until success or timeout (when nonblocking) */
+ while ((err = gsk_secure_socket_init(soap->ssl)) != GSK_OK)
+ { if (err == GSK_WOULD_BLOCK_READ || err == GSK_WOULD_BLOCK_WRITE)
+ { if (err == GSK_WOULD_BLOCK_READ)
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000);
+ else
+ r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000);
+ if (r < 0)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL_connect/select error in tcp_connect\n"));
+ soap_set_receiver_error(soap, gsk_strerror(err), "gsk_secure_socket_init failed in tcp_connect()", SOAP_TCP_ERROR);
+ soap->fclosesocket(soap, sk);
+ return SOAP_INVALID_SOCKET;
+ }
+ if (r == 0 && retries-- <= 0)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL/TLS connect timeout\n"));
+ soap_set_receiver_error(soap, "Timeout", "in tcp_connect()", SOAP_TCP_ERROR);
+ soap->fclosesocket(soap, sk);
+ return SOAP_INVALID_SOCKET;
+ }
+ }
+ else
+ { soap_set_receiver_error(soap, gsk_strerror(err), "gsk_secure_socket_init() failed in tcp_connect()", SOAP_SSL_ERROR);
+ soap->fclosesocket(soap, sk);
+ return SOAP_INVALID_SOCKET;
+ }
+ }
+#endif
+ soap->imode |= SOAP_ENC_SSL;
+ soap->omode |= SOAP_ENC_SSL;
#else
soap->fclosesocket(soap, sk);
soap->error = SOAP_SSL_ERROR;
@@ -4495,6 +5144,7 @@ again:
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
static int
@@ -4531,9 +5181,11 @@ tcp_select(struct soap *soap, SOAP_SOCKET sk, int flags, int timeout)
}
do
{ r = poll(&pollfd, 1, timeout);
- if (r < 0 && (soap->errnum = soap_socket_errno(sk)) == SOAP_EINTR && eintr--)
- continue;
- } while (r == 0 && retries--);
+ if (r < 0 && (soap->errnum = soap_socket_errno(sk)) == SOAP_EINTR && eintr-- > 0)
+ r = 0;
+ else if (retries-- <= 0)
+ break;
+ } while (r == 0);
if (r > 0)
{ r = 0;
if ((flags & SOAP_TCP_SELECT_RCV) && (pollfd.revents & POLLIN))
@@ -4543,6 +5195,8 @@ tcp_select(struct soap *soap, SOAP_SOCKET sk, int flags, int timeout)
if ((flags & SOAP_TCP_SELECT_ERR) && (pollfd.revents & POLLERR))
r |= SOAP_TCP_SELECT_ERR;
}
+ else if (r == 0)
+ soap->errnum = 0;
return r;
}
#else
@@ -4579,9 +5233,11 @@ tcp_select(struct soap *soap, SOAP_SOCKET sk, int flags, int timeout)
tv.tv_usec = 0;
}
r = select((int)sk + 1, rfd, sfd, efd, &tv);
- if (r < 0 && (soap->errnum = soap_socket_errno(sk)) == SOAP_EINTR && eintr--)
- continue;
- } while (r == 0 && retries--);
+ if (r < 0 && (soap->errnum = soap_socket_errno(sk)) == SOAP_EINTR && eintr-- > 0)
+ r = 0;
+ else if (retries-- <= 0)
+ break;
+ } while (r == 0);
if (r > 0)
{ r = 0;
if ((flags & SOAP_TCP_SELECT_RCV) && FD_ISSET(sk, rfd))
@@ -4591,12 +5247,15 @@ tcp_select(struct soap *soap, SOAP_SOCKET sk, int flags, int timeout)
if ((flags & SOAP_TCP_SELECT_ERR) && FD_ISSET(sk, efd))
r |= SOAP_TCP_SELECT_ERR;
}
+ else if (r == 0)
+ soap->errnum = 0;
return r;
}
#endif
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
static SOAP_SOCKET
@@ -4604,7 +5263,7 @@ tcp_accept(struct soap *soap, SOAP_SOCKET s, struct sockaddr *a, int *n)
{ SOAP_SOCKET sk;
(void)soap;
sk = accept(s, a, (SOAP_SOCKLEN_T*)n); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */
-#ifdef SOCKET_CLOSE_ON_EXEC
+#ifdef SOCKET_CLOSE_ON_EXIT
#ifdef WIN32
#ifndef UNDER_CE
SetHandleInformation((HANDLE)sk, HANDLE_FLAG_INHERIT, 0);
@@ -4619,6 +5278,7 @@ tcp_accept(struct soap *soap, SOAP_SOCKET s, struct sockaddr *a, int *n)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
static int
@@ -4634,7 +5294,7 @@ tcp_disconnect(struct soap *soap)
if (*soap->host)
{ soap->session = SSL_get1_session(soap->ssl);
if (soap->session)
- { strcpy(soap->session_host, soap->host);
+ { soap_strcpy(soap->session_host, sizeof(soap->session_host), soap->host);
soap->session_port = soap->port;
}
}
@@ -4700,6 +5360,12 @@ tcp_disconnect(struct soap *soap)
soap->session = NULL;
}
#endif
+#ifdef WITH_SYSTEMSSL
+ if (soap->ssl)
+ { gsk_secure_socket_shutdown(soap->ssl);
+ gsk_secure_socket_close(&soap->ssl);
+ }
+#endif
if (soap_valid_socket(soap->socket) && !(soap->omode & SOAP_IO_UDP))
{ soap->fshutdownsocket(soap, soap->socket, SOAP_SHUT_RDWR);
soap->fclosesocket(soap, soap->socket);
@@ -4711,6 +5377,7 @@ tcp_disconnect(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
static int
@@ -4723,6 +5390,7 @@ tcp_closesocket(struct soap *soap, SOAP_SOCKET sk)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
static int
@@ -4735,6 +5403,7 @@ tcp_shutdownsocket(struct soap *soap, SOAP_SOCKET sk, int how)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
SOAP_FMAC1
@@ -4752,11 +5421,6 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
#endif
#endif
#ifndef WITH_LEAN
-#ifndef WIN32
- int len = SOAP_BUFLEN;
-#else
- int len = SOAP_BUFLEN + 1; /* speeds up windows xfer */
-#endif
int set = 1;
#endif
if (soap_valid_socket(soap->master))
@@ -4771,7 +5435,11 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
}
#ifdef WITH_IPV6
memset((void*)&hints, 0, sizeof(hints));
+#ifdef WITH_IPV6_V6ONLY
+ hints.ai_family = PF_INET6;
+#else
hints.ai_family = PF_UNSPEC;
+#endif
#ifndef WITH_LEAN
if ((soap->omode & SOAP_IO_UDP))
hints.ai_socktype = SOCK_DGRAM;
@@ -4783,12 +5451,18 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
err = getaddrinfo(host, soap_int2s(soap, port), &hints, &addrinfo);
if (err || !addrinfo)
{ soap_set_receiver_error(soap, SOAP_GAI_STRERROR(err), "getaddrinfo failed in soap_bind()", SOAP_TCP_ERROR);
+ if (addrinfo)
+ freeaddrinfo(addrinfo);
return SOAP_INVALID_SOCKET;
}
res = *addrinfo;
- memcpy(&soap->peer, addrinfo->ai_addr, addrinfo->ai_addrlen);
+ if (soap_memcpy((void*)&soap->peer.storage, sizeof(soap->peer.storage), (const void*)addrinfo->ai_addr, addrinfo->ai_addrlen))
+ { freeaddrinfo(addrinfo);
+ soap->error = SOAP_EOM;
+ return SOAP_INVALID_SOCKET;
+ }
soap->peerlen = addrinfo->ai_addrlen;
- res.ai_addr = (struct sockaddr*)&soap->peer;
+ res.ai_addr = &soap->peer.addr;
res.ai_addrlen = soap->peerlen;
freeaddrinfo(addrinfo);
soap->master = (int)socket(res.ai_family, res.ai_socktype, res.ai_protocol);
@@ -4811,7 +5485,7 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
if ((soap->omode & SOAP_IO_UDP))
soap->socket = soap->master;
#endif
-#ifdef SOCKET_CLOSE_ON_EXEC
+#ifdef SOCKET_CLOSE_ON_EXIT
#ifdef WIN32
#ifndef UNDER_CE
SetHandleInformation((HANDLE)soap->master, HANDLE_FLAG_INHERIT, 0);
@@ -4826,17 +5500,18 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
+#ifndef UNDER_CE
if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && (!((soap->imode | soap->omode) & SOAP_IO_UDP)) && setsockopt(soap->master, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->master);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
- if (setsockopt(soap->master, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
+ if (soap->sndbuf > 0 && setsockopt(soap->master, SOL_SOCKET, SO_SNDBUF, (char*)&soap->sndbuf, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->master);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
- if (setsockopt(soap->master, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
+ if (soap->rcvbuf > 0 && setsockopt(soap->master, SOL_SOCKET, SO_RCVBUF, (char*)&soap->rcvbuf, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->master);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
@@ -4848,17 +5523,24 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
return SOAP_INVALID_SOCKET;
}
#endif
+#ifdef TCP_FASTOPEN
+ if (!(soap->omode & SOAP_IO_UDP) && setsockopt(soap->master, IPPROTO_TCP, TCP_FASTOPEN, (char*)&set, sizeof(int)))
+ { /* silently ignore */
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "setsockopt TCP_FASTOPEN failed in soap_bind()\n"));
+ }
+#endif
+#endif
#endif
#ifdef WITH_IPV6
#ifdef WITH_IPV6_V6ONLY
- if (setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&set, sizeof(int)))
+ if (res.ai_family == AF_INET6 && setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&set, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->master);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt set IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
#endif
#ifdef WITH_NO_IPV6_V6ONLY
- if (setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&unset, sizeof(int)))
+ if (res.ai_family == AF_INET6 && setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&unset, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->master);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt unset IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
@@ -4873,21 +5555,21 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
return SOAP_INVALID_SOCKET;
}
#else
- soap->peerlen = sizeof(soap->peer);
- memset((void*)&soap->peer, 0, sizeof(soap->peer));
- soap->peer.sin_family = AF_INET;
+ soap->peerlen = sizeof(soap->peer.in);
+ memset((void*)&soap->peer.in, 0, sizeof(soap->peer.in));
+ soap->peer.in.sin_family = AF_INET;
soap->errmode = 2;
if (host)
- { if (soap->fresolve(soap, host, &soap->peer.sin_addr))
+ { if (soap->fresolve(soap, host, &soap->peer.in.sin_addr))
{ soap_set_receiver_error(soap, tcp_error(soap), "get host by name failed in soap_bind()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
}
else
- soap->peer.sin_addr.s_addr = htonl(INADDR_ANY);
- soap->peer.sin_port = htons((short)port);
+ soap->peer.in.sin_addr.s_addr = htonl(INADDR_ANY);
+ soap->peer.in.sin_port = htons((short)port);
soap->errmode = 0;
- if (bind(soap->master, (struct sockaddr*)&soap->peer, (int)soap->peerlen))
+ if (bind(soap->master, &soap->peer.addr, (int)soap->peerlen))
{ soap->errnum = soap_socket_errno(soap->master);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host\n"));
soap_closesock(soap);
@@ -4908,6 +5590,7 @@ soap_bind(struct soap *soap, const char *host, int port, int backlog)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
SOAP_FMAC1
@@ -4916,7 +5599,7 @@ SOAP_FMAC2
soap_poll(struct soap *soap)
{
#ifndef WITH_LEAN
- register int r;
+ int r;
if (soap_valid_socket(soap->socket))
{ r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_ALL, 0);
if (r > 0 && (r & SOAP_TCP_SELECT_ERR))
@@ -4953,9 +5636,10 @@ soap_poll(struct soap *soap)
return soap->error = SOAP_TCP_ERROR;
}
}
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Polling: other end down on socket=%d select=%d\n", soap->socket, r));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Polling: other end down on socket=%d select=%d\n", soap->socket, r));
return SOAP_EOF;
#else
+ (void)soap;
return SOAP_OK;
#endif
}
@@ -4963,6 +5647,7 @@ soap_poll(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
SOAP_FMAC1
@@ -4970,13 +5655,8 @@ SOAP_SOCKET
SOAP_FMAC2
soap_accept(struct soap *soap)
{ int n = (int)sizeof(soap->peer);
- register int err;
+ int err;
#ifndef WITH_LEAN
-#ifndef WIN32
- int len = SOAP_BUFLEN;
-#else
- int len = SOAP_BUFLEN + 1; /* speeds up windows xfer */
-#endif
int set = 1;
#endif
soap->error = SOAP_OK;
@@ -4996,7 +5676,7 @@ soap_accept(struct soap *soap)
for (;;)
{ if (soap->accept_timeout || soap->send_timeout || soap->recv_timeout)
{ for (;;)
- { register int r;
+ { int r;
r = tcp_select(soap, soap->master, SOAP_TCP_SELECT_ALL, soap->accept_timeout ? soap->accept_timeout : 60);
if (r > 0)
break;
@@ -5008,7 +5688,7 @@ soap_accept(struct soap *soap)
{ r = soap->errnum;
if (r != SOAP_EINTR)
{ soap_closesock(soap);
- soap_set_sender_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
+ soap_set_receiver_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
return SOAP_INVALID_SOCKET;
}
}
@@ -5018,29 +5698,31 @@ soap_accept(struct soap *soap)
SOAP_SOCKNONBLOCK(soap->master)
else
SOAP_SOCKBLOCK(soap->master)
- soap->socket = soap->faccept(soap, soap->master, (struct sockaddr*)&soap->peer, &n);
+ n = (int)sizeof(soap->peer);
+ soap->socket = soap->faccept(soap, soap->master, &soap->peer.addr, &n);
soap->peerlen = (size_t)n;
if (soap_valid_socket(soap->socket))
{
#ifdef WITH_IPV6
- unsigned int ip1, ip2, ip3, ip4;
+ char *s = soap->host;
char port[16];
- getnameinfo((struct sockaddr*)&soap->peer, n, soap->host, sizeof(soap->host), port, 16, NI_NUMERICHOST | NI_NUMERICSERV);
- sscanf(soap->host, "%u.%u.%u.%u", &ip1, &ip2, &ip3, &ip4);
- soap->ip = (unsigned long)ip1 << 24 | (unsigned long)ip2 << 16 | (unsigned long)ip3 << 8 | (unsigned long)ip4;
+ int i;
+ getnameinfo(&soap->peer.addr, n, soap->host, sizeof(soap->host), port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV);
+ soap->ip = 0;
+ for (i = 0; i < 4 && *s; i++)
+ { soap->ip = (soap->ip << 8) + (unsigned int)soap_strtoul(s, &s, 10);
+ if (*s)
+ s++;
+ }
soap->port = soap_strtol(port, NULL, 10);
#else
- soap->ip = ntohl(soap->peer.sin_addr.s_addr);
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->host, sizeof(soap->host), "%u.%u.%u.%u", (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF);
-#else
- sprintf(soap->host, "%u.%u.%u.%u", (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF);
+ soap->ip = ntohl(soap->peer.in.sin_addr.s_addr);
+ (SOAP_SNPRINTF(soap->host, sizeof(soap->host), 80), "%u.%u.%u.%u", (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF);
+ soap->port = (int)ntohs(soap->peer.in.sin_port); /* does not return port number on some systems */
#endif
- soap->port = (int)ntohs(soap->peer.sin_port); /* does not return port number on some systems */
-#endif
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept socket=%d at port=%d from IP='%s'\n", soap->socket, soap->port, soap->host));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Accept socket=%d at port=%d from IP='%s'\n", soap->socket, soap->port, soap->host));
#ifndef WITH_LEAN
- if (soap->accept_flags == SO_LINGER)
+ if ((soap->accept_flags & SO_LINGER))
{ struct linger linger;
memset((void*)&linger, 0, sizeof(linger));
linger.l_onoff = 1;
@@ -5052,25 +5734,26 @@ soap_accept(struct soap *soap)
return SOAP_INVALID_SOCKET;
}
}
- else if (soap->accept_flags && setsockopt(soap->socket, SOL_SOCKET, soap->accept_flags, (char*)&set, sizeof(int)))
+ if ((soap->accept_flags & ~SO_LINGER) && setsockopt(soap->socket, SOL_SOCKET, soap->accept_flags & ~SO_LINGER, (char*)&set, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->socket);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_accept()", SOAP_TCP_ERROR);
soap_closesock(soap);
return SOAP_INVALID_SOCKET;
}
+#ifndef UNDER_CE
if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && setsockopt(soap->socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->socket);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR);
soap_closesock(soap);
return SOAP_INVALID_SOCKET;
}
- if (setsockopt(soap->socket, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
+ if (soap->sndbuf > 0 && setsockopt(soap->socket, SOL_SOCKET, SO_SNDBUF, (char*)&soap->sndbuf, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->socket);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_accept()", SOAP_TCP_ERROR);
soap_closesock(soap);
return SOAP_INVALID_SOCKET;
}
- if (setsockopt(soap->socket, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
+ if (soap->rcvbuf > 0 && setsockopt(soap->socket, SOL_SOCKET, SO_RCVBUF, (char*)&soap->rcvbuf, sizeof(int)))
{ soap->errnum = soap_socket_errno(soap->socket);
soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_accept()", SOAP_TCP_ERROR);
soap_closesock(soap);
@@ -5085,6 +5768,7 @@ soap_accept(struct soap *soap)
}
#endif
#endif
+#endif
soap->keep_alive = (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) != 0);
if (soap->send_timeout || soap->recv_timeout)
SOAP_SOCKNONBLOCK(soap->socket)
@@ -5094,7 +5778,7 @@ soap_accept(struct soap *soap)
}
err = soap_socket_errno(soap->socket);
if (err != 0 && err != SOAP_EINTR && err != SOAP_EAGAIN && err != SOAP_EWOULDBLOCK)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Accept failed from %s\n", soap->host));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Accept failed from %s\n", soap->host));
soap->errnum = err;
soap_set_receiver_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
soap_closesock(soap);
@@ -5106,12 +5790,13 @@ soap_accept(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_closesock(struct soap *soap)
-{ register int status = soap->error;
+{ int status = soap->error;
#ifndef WITH_LEANER
if (status) /* close on error: attachment state is not to be trusted */
{ soap->mime.first = NULL;
@@ -5120,10 +5805,10 @@ soap_closesock(struct soap *soap)
soap->dime.last = NULL;
}
#endif
- if (soap->fdisconnect && (soap->error = soap->fdisconnect(soap)))
+ if (soap->fdisconnect && (soap->error = soap->fdisconnect(soap)) != SOAP_OK)
return soap->error;
if (status == SOAP_EOF || status == SOAP_TCP_ERROR || status == SOAP_SSL_ERROR || !soap->keep_alive)
- { if (soap->fclose && (soap->error = soap->fclose(soap)))
+ { if (soap->fclose && (soap->error = soap->fclose(soap)) != SOAP_OK)
return soap->error;
soap->keep_alive = 0;
}
@@ -5141,6 +5826,7 @@ soap_closesock(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
SOAP_FMAC1
@@ -5156,6 +5842,7 @@ soap_force_closesock(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_2
SOAP_FMAC1
@@ -5174,6 +5861,7 @@ soap_cleanup(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
@@ -5202,7 +5890,7 @@ soap_done(struct soap *soap)
soap_free_cookies(soap);
#endif
while (soap->plugins)
- { register struct soap_plugin *p = soap->plugins->next;
+ { struct soap_plugin *p = soap->plugins->next;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Removing plugin '%s'\n", soap->plugins->id));
if (soap->plugins->fcopy || soap->state == SOAP_INIT)
soap->plugins->fdelete(soap, soap->plugins);
@@ -5245,6 +5933,8 @@ soap_done(struct soap *soap)
soap->fpoll = NULL;
#endif
#ifndef WITH_LEANER
+ soap->fsvalidate = NULL;
+ soap->fwvalidate = NULL;
soap->feltbegin = NULL;
soap->feltendin = NULL;
soap->feltbegout = NULL;
@@ -5314,20 +6004,31 @@ soap_done(struct soap *soap)
soap->session = NULL;
}
#endif
+#ifdef WITH_SYSTEMSSL
+ if (soap->ssl)
+ gsk_secure_socket_close(&soap->ssl);
+ if (soap->state == SOAP_INIT)
+ if (soap->ctx)
+ gsk_environment_close(&soap->ctx);
+#endif
#ifdef WITH_C_LOCALE
+ if (soap->c_locale)
+ {
# ifdef WIN32
- _free_locale(soap->c_locale);
+ _free_locale(soap->c_locale);
# else
- freelocale(soap->c_locale);
+ freelocale(soap->c_locale);
# endif
+ soap->c_locale = NULL;
+ }
#endif
#ifdef WITH_ZLIB
if (soap->d_stream)
- { SOAP_FREE(soap, (void*)soap->d_stream);
+ { SOAP_FREE(soap, soap->d_stream);
soap->d_stream = NULL;
}
if (soap->z_buf)
- { SOAP_FREE(soap, (void*)soap->z_buf);
+ { SOAP_FREE(soap, soap->z_buf);
soap->z_buf = NULL;
}
#endif
@@ -5335,7 +6036,7 @@ soap_done(struct soap *soap)
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free logfiles\n"));
for (i = 0; i < SOAP_MAXLOGS; i++)
{ if (soap->logfile[i])
- { SOAP_FREE(soap, (void*)soap->logfile[i]);
+ { SOAP_FREE(soap, soap->logfile[i]);
soap->logfile[i] = NULL;
}
soap_close_logfile(soap, i);
@@ -5350,11 +6051,10 @@ soap_done(struct soap *soap)
/******************************************************************************\
*
- * HTTP
+ * HTTP
*
\******************************************************************************/
-/******************************************************************************/
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
@@ -5386,26 +6086,27 @@ http_parse(struct soap *soap)
return SOAP_EOF;
return soap->error = 414;
}
- if ((s = strchr(soap->msgbuf, ' ')))
+ s = strchr(soap->msgbuf, ' ');
+ if (s)
{ soap->status = (unsigned short)soap_strtoul(s, &s, 10);
if (!soap_blank((soap_wchar)*s))
soap->status = 0;
}
else
soap->status = 0;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP status: %s\n", soap->msgbuf));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP status: %s\n", soap->msgbuf));
for (;;)
{ if (soap_getline(soap, header, SOAP_HDRLEN))
{ if (soap->error == SOAP_EOF)
{ soap->error = SOAP_OK;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "EOF in HTTP header, continue anyway\n"));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "EOF in HTTP header, continue anyway\n"));
break;
}
return soap->error;
}
if (!*header)
break;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP header: %s\n", header));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP header: %s\n", header));
s = strchr(header, ':');
if (s)
{ char *t;
@@ -5420,7 +6121,8 @@ http_parse(struct soap *soap)
if (t >= s && *t == '"')
t--;
t[1] = '\0';
- if ((soap->error = soap->fparsehdr(soap, header, s)))
+ soap->error = soap->fparsehdr(soap, header, s);
+ if (soap->error)
{ if (soap->error < SOAP_STOP)
return soap->error;
status = soap->error;
@@ -5429,7 +6131,7 @@ http_parse(struct soap *soap)
}
}
} while (soap->status == 100);
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Finished HTTP header parsing, status = %d\n", soap->status));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Finished HTTP header parsing, status = %d\n", soap->status));
s = strstr(soap->msgbuf, "HTTP/");
if (s && s[7] != '1')
{ if (soap->keep_alive == 1)
@@ -5439,7 +6141,7 @@ http_parse(struct soap *soap)
}
if (soap->keep_alive < 0)
soap->keep_alive = 1;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Keep alive connection = %d\n", soap->keep_alive));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Keep alive connection = %d\n", soap->keep_alive));
if (soap->status == 0)
{ size_t l = 0;
if (s)
@@ -5457,24 +6159,28 @@ http_parse(struct soap *soap)
httpcmd = 6;
}
if (s && httpcmd)
- { size_t m = strlen(soap->endpoint);
- size_t n = m + (s - soap->msgbuf) - l - 1;
- size_t k;
+ { size_t m, n, k;
+ while (soap_blank(soap->msgbuf[l]))
+ l++;
+ m = strlen(soap->endpoint);
+ n = m + (s - soap->msgbuf) - l - 1;
if (n >= sizeof(soap->endpoint))
n = sizeof(soap->endpoint) - 1;
if (m > n)
m = n;
k = n - m + 1;
- if (k > sizeof(soap->path))
- k = sizeof(soap->path);
- strncpy(soap->path, soap->msgbuf + l, k);
- soap->path[k - 1] = '\0';
+ if (k >= sizeof(soap->path))
+ k = sizeof(soap->path) - 1;
+ while (k > 0 && soap_blank(soap->msgbuf[l + k - 1]))
+ k--;
+ soap_strncpy(soap->path, sizeof(soap->path), soap->msgbuf + l, k);
if (*soap->path && *soap->path != '/')
- *soap->endpoint = '\0';
- strcat(soap->endpoint, soap->path);
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Target endpoint='%s'\n", soap->endpoint));
+ soap_strncpy(soap->endpoint, sizeof(soap->endpoint), soap->path, k);
+ else
+ soap_strncat(soap->endpoint, sizeof(soap->endpoint), soap->path, k);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Target endpoint='%s' path='%s'\n", soap->endpoint, soap->path));
if (httpcmd > 1)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP %s handler\n", soap->msgbuf));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP %s handler\n", soap->msgbuf));
switch (httpcmd)
{ case 2: soap->error = soap->fput(soap); break;
case 3: soap->error = soap->fget(soap); break;
@@ -5483,7 +6189,7 @@ http_parse(struct soap *soap)
case 6: soap->error = soap->fhead(soap); break;
default: soap->error = 405; break;
}
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP handler return = %d\n", soap->error));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP handler return = %d\n", soap->error));
if (soap->error == SOAP_OK)
soap->error = SOAP_STOP; /* prevents further processing */
return soap->error;
@@ -5504,7 +6210,7 @@ http_parse(struct soap *soap)
{ if ((soap->status >= 200 && soap->status <= 299) /* OK, Accepted, etc */
|| soap->status == 400 /* Bad Request */
|| soap->status == 500) /* Internal Server Error */
- return SOAP_OK;
+ return soap->error = SOAP_OK;
/* force close afterwards in soap_closesock() */
soap->keep_alive = 0;
#ifndef WITH_LEAN
@@ -5516,13 +6222,14 @@ http_parse(struct soap *soap)
}
else if (soap->status >= 200 && soap->status <= 299)
return soap->error = soap->status;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP error %d\n", soap->status));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP error %d: %s\n", soap->status, soap->msgbuf));
return soap_set_receiver_error(soap, "HTTP Error", soap->msgbuf, soap->status);
}
#endif
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
@@ -5531,11 +6238,11 @@ http_parse_header(struct soap *soap, const char *key, const char *val)
{
#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
if (soap->imode & SOAP_ENC_SSL)
- strcpy(soap->endpoint, "https://");
+ soap_strcpy(soap->endpoint, sizeof(soap->endpoint), "https://");
else
#endif
- strcpy(soap->endpoint, "http://");
- strncat(soap->endpoint, val, sizeof(soap->endpoint) - 8);
+ soap_strcpy(soap->endpoint, sizeof(soap->endpoint), "http://");
+ soap_strncat(soap->endpoint, sizeof(soap->endpoint), val, sizeof(soap->endpoint) - 9);
}
#ifndef WITH_LEANER
else if (!soap_tag_cmp(key, "Content-Type"))
@@ -5605,7 +6312,7 @@ http_parse_header(struct soap *soap, const char *key, const char *val)
else if (!soap_tag_cmp(val, "close"))
soap->keep_alive = 0;
}
-#ifndef WITH_LEAN
+#if !defined(WITH_LEAN) || defined(WITH_NTLM)
else if (!soap_tag_cmp(key, "Authorization") || !soap_tag_cmp(key, "Proxy-Authorization"))
{
#ifdef WITH_NTLM
@@ -5618,7 +6325,8 @@ http_parse_header(struct soap *soap, const char *key, const char *val)
char *s;
soap_base642s(soap, val + 6, soap->tmpbuf, sizeof(soap->tmpbuf) - 1, &n);
soap->tmpbuf[n] = '\0';
- if ((s = strchr(soap->tmpbuf, ':')))
+ s = strchr(soap->tmpbuf, ':');
+ if (s)
{ *s = '\0';
soap->userid = soap_strdup(soap, soap->tmpbuf);
soap->passwd = soap_strdup(soap, s + 1);
@@ -5636,8 +6344,8 @@ http_parse_header(struct soap *soap, const char *key, const char *val)
}
else if (!soap_tag_cmp(key, "Expect"))
{ if (!soap_tag_cmp(val, "100-continue"))
- { if ((soap->error = soap->fposthdr(soap, "HTTP/1.1 100 Continue", NULL))
- || (soap->error = soap->fposthdr(soap, NULL, NULL)))
+ { if ((soap->error = soap->fposthdr(soap, "HTTP/1.1 100 Continue", NULL)) != SOAP_OK
+ || (soap->error = soap->fposthdr(soap, NULL, NULL)) != SOAP_OK)
return soap->error;
}
}
@@ -5652,8 +6360,7 @@ http_parse_header(struct soap *soap, const char *key, const char *val)
soap->action = soap_strdup(soap, val);
}
else if (!soap_tag_cmp(key, "Location"))
- { strncpy(soap->endpoint, val, sizeof(soap->endpoint));
- soap->endpoint[sizeof(soap->endpoint) - 1] = '\0';
+ { soap_strcpy(soap->endpoint, sizeof(soap->endpoint), val);
}
else if (!soap_tag_cmp(key, "X-Forwarded-For"))
{ soap->proxy_from = soap_strdup(soap, val);
@@ -5672,16 +6379,17 @@ http_parse_header(struct soap *soap, const char *key, const char *val)
#endif
/******************************************************************************/
+
#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER)
#ifndef PALM_1
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_get_header_attribute(struct soap *soap, const char *line, const char *key)
-{ register const char *s = line;
+{ const char *s = line;
if (s)
{ while (*s)
- { register short flag;
+ { short flag;
s = soap_decode_key(soap->tmpbuf, sizeof(soap->tmpbuf), s);
flag = soap_tag_cmp(soap->tmpbuf, key);
s = soap_decode_val(soap->tmpbuf, sizeof(soap->tmpbuf), s);
@@ -5695,6 +6403,7 @@ soap_get_header_attribute(struct soap *soap, const char *line, const char *key)
#endif
/******************************************************************************/
+
#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER)
#ifndef PALM_1
SOAP_FMAC1
@@ -5707,6 +6416,7 @@ soap_decode_key(char *buf, size_t len, const char *val)
#endif
/******************************************************************************/
+
#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER)
#ifndef PALM_1
SOAP_FMAC1
@@ -5723,6 +6433,7 @@ soap_decode_val(char *buf, size_t len, const char *val)
#endif
/******************************************************************************/
+
#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER)
#ifndef PALM_1
static const char*
@@ -5761,12 +6472,14 @@ soap_decode(char *buf, size_t len, const char *val, const char *sep)
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
static const char*
http_error(struct soap *soap, int status)
-{ register const char *msg = SOAP_STR_EOS;
+{ const char *msg = SOAP_STR_EOS;
(void)soap;
+ (void)status;
#ifndef WITH_LEAN
msg = soap_code_str(h_http_error_codes, status);
if (!msg)
@@ -5791,6 +6504,7 @@ http_get(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
@@ -5802,6 +6516,7 @@ http_405(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
@@ -5812,12 +6527,14 @@ http_200(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
http_post(struct soap *soap, const char *endpoint, const char *host, int port, const char *path, const char *action, size_t count)
-{ register const char *s;
- register int err;
+{ const char *s;
+ int err;
+ size_t l;
switch (soap->status)
{ case SOAP_GET:
s = "GET";
@@ -5836,39 +6553,23 @@ http_post(struct soap *soap, const char *endpoint, const char *host, int port, c
}
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP %s to %s\n", s, endpoint ? endpoint : "(null)"));
#ifdef PALM
- if (!endpoint || (soap_tag_cmp(endpoint, "http:*") && soap_tag_cmp(endpoint, "https:*") && strncmp(endpoint, "httpg:", 6)) && strncmp(endpoint, "_beam:", 6) && strncmp(endpoint, "_local:", 7) && strncmp(endpoint, "_btobex:", 8))
+ if (!endpoint || (soap_tag_cmp(endpoint, "http:*") && soap_tag_cmp(endpoint, "https:*") && strncmp(endpoint, "_beam:", 6) && strncmp(endpoint, "_local:", 7) && strncmp(endpoint, "_btobex:", 8))
#else
- if (!endpoint || (soap_tag_cmp(endpoint, "http:*") && soap_tag_cmp(endpoint, "https:*") && strncmp(endpoint, "httpg:", 6)))
+ if (!endpoint || (soap_tag_cmp(endpoint, "http:*") && soap_tag_cmp(endpoint, "https:*") && soap_tag_cmp(endpoint, "httpg:*")))
#endif
return SOAP_OK;
- if (strlen(endpoint) + strlen(soap->http_version) > sizeof(soap->tmpbuf) - 80
- || strlen(host) + strlen(soap->http_version) > sizeof(soap->tmpbuf) - 80)
- return soap->error = SOAP_EOM; /* prevent overrun (note that 'host' and 'soap->host' are substrings of 'endpoint') */
+ /* set l to prevent overruns ('host' and 'soap->host' are substrings of 'endpoint') */
+ l = strlen(endpoint) + strlen(soap->http_version) + 80;
+ if (l > sizeof(soap->tmpbuf))
+ return soap->error = SOAP_EOM;
if (soap->status == SOAP_CONNECT)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%s %s:%d HTTP/%s", s, soap->host, soap->port, soap->http_version);
-#else
- sprintf(soap->tmpbuf, "%s %s:%d HTTP/%s", s, soap->host, soap->port, soap->http_version);
-#endif
- }
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s %s:%d HTTP/%s", s, soap->host, soap->port, soap->http_version);
else if (soap->proxy_host && endpoint)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%s %s HTTP/%s", s, endpoint, soap->http_version);
-#else
- sprintf(soap->tmpbuf, "%s %s HTTP/%s", s, endpoint, soap->http_version);
-#endif
- }
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s %s HTTP/%s", s, endpoint, soap->http_version);
else
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%s /%s HTTP/%s", s, (*path == '/' ? path + 1 : path), soap->http_version);
-#else
- sprintf(soap->tmpbuf, "%s /%s HTTP/%s", s, (*path == '/' ? path + 1 : path), soap->http_version);
-#endif
- }
- if ((err = soap->fposthdr(soap, soap->tmpbuf, NULL)))
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s /%s HTTP/%s", s, (*path == '/' ? path + 1 : path), soap->http_version);
+ err = soap->fposthdr(soap, soap->tmpbuf, NULL);
+ if (err)
return err;
#ifdef WITH_OPENSSL
if ((soap->ssl && port != 443) || (!soap->ssl && port != 80))
@@ -5878,93 +6579,73 @@ http_post(struct soap *soap, const char *endpoint, const char *host, int port, c
{
#ifdef WITH_IPV6
if (*host != '[' && strchr(host, ':'))
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "[%s]:%d", host, port); /* RFC 2732 */
-#else
- sprintf(soap->tmpbuf, "[%s]:%d", host, port); /* RFC 2732 */
-#endif
- }
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "[%s]:%d", host, port); /* RFC 2732 */
else
#endif
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%s:%d", host, port);
-#else
- sprintf(soap->tmpbuf, "%s:%d", host, port);
-#endif
- }
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s:%d", host, port);
}
else
{
#ifdef WITH_IPV6
if (*host != '[' && strchr(host, ':'))
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "[%s]", host); /* RFC 2732 */
-#else
- sprintf(soap->tmpbuf, "[%s]", host); /* RFC 2732 */
-#endif
- }
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "[%s]", host); /* RFC 2732 */
else
#endif
- strcpy(soap->tmpbuf, host);
+ soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), host);
}
- if ((err = soap->fposthdr(soap, "Host", soap->tmpbuf)))
+ err = soap->fposthdr(soap, "Host", soap->tmpbuf);
+ if (err)
return err;
- if ((err = soap->fposthdr(soap, "User-Agent", "gSOAP/2.8")))
+ err = soap->fposthdr(soap, "User-Agent", "gSOAP/2.8");
+ if (err)
return err;
- if ((err = soap_puthttphdr(soap, SOAP_OK, count)))
+ err = soap_puthttphdr(soap, SOAP_OK, count);
+ if (err)
return err;
#ifdef WITH_ZLIB
#ifdef WITH_GZIP
- if ((err = soap->fposthdr(soap, "Accept-Encoding", "gzip, deflate")))
+ err = soap->fposthdr(soap, "Accept-Encoding", "gzip, deflate");
#else
- if ((err = soap->fposthdr(soap, "Accept-Encoding", "deflate")))
+ err = soap->fposthdr(soap, "Accept-Encoding", "deflate");
#endif
+ if (err)
return err;
#endif
-#ifndef WITH_LEAN
+#if !defined(WITH_LEAN) || defined(WITH_NTLM)
#ifdef WITH_NTLM
- if (soap->ntlm_challenge && strlen(soap->ntlm_challenge) + 6 < sizeof(soap->tmpbuf))
- { if (*soap->ntlm_challenge)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "NTLM %s", soap->ntlm_challenge);
-#else
- sprintf(soap->tmpbuf, "NTLM %s", soap->ntlm_challenge);
-#endif
+ if (soap->ntlm_challenge)
+ { l = strlen(soap->ntlm_challenge);
+ if (l)
+ { (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l + 5), "NTLM %s", soap->ntlm_challenge);
if (soap->proxy_host)
- { if ((err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf)))
+ { err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf);
+ if (err)
+ return err;
+ }
+ else
+ { err = soap->fposthdr(soap, "Authorization", soap->tmpbuf);
+ if (err)
return err;
}
- else if ((err = soap->fposthdr(soap, "Authorization", soap->tmpbuf)))
- return err;
}
}
else
{
#endif
- if (soap->userid && soap->passwd && strlen(soap->userid) + strlen(soap->passwd) < 761)
- { strcpy(soap->tmpbuf, "Basic ");
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf + 262, sizeof(soap->tmpbuf) - 262, "%s:%s", soap->userid, soap->passwd);
-#else
- sprintf(soap->tmpbuf + 262, "%s:%s", soap->userid, soap->passwd);
-#endif
+ if (soap->userid && soap->passwd)
+ { soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "Basic ");
+ (SOAP_SNPRINTF(soap->tmpbuf + 262, sizeof(soap->tmpbuf) - 262, strlen(soap->userid) + strlen(soap->passwd) + 1), "%s:%s", soap->userid, soap->passwd);
soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262));
- if ((err = soap->fposthdr(soap, "Authorization", soap->tmpbuf)))
+ err = soap->fposthdr(soap, "Authorization", soap->tmpbuf);
+ if (err)
return err;
}
- if (soap->proxy_userid && soap->proxy_passwd && strlen(soap->proxy_userid) + strlen(soap->proxy_passwd) < 761)
- { strcpy(soap->tmpbuf, "Basic ");
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf + 262, sizeof(soap->tmpbuf) - 262, "%s:%s", soap->proxy_userid, soap->proxy_passwd);
-#else
- sprintf(soap->tmpbuf + 262, "%s:%s", soap->proxy_userid, soap->proxy_passwd);
-#endif
+ if (soap->proxy_userid && soap->proxy_passwd)
+ { soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "Basic ");
+ (SOAP_SNPRINTF(soap->tmpbuf + 262, sizeof(soap->tmpbuf) - 262, strlen(soap->proxy_userid) + strlen(soap->proxy_passwd) + 1), "%s:%s", soap->proxy_userid, soap->proxy_passwd);
soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262));
- if ((err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf)))
+ err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf);
+ if (err)
return err;
}
#ifdef WITH_NTLM
@@ -5981,13 +6662,9 @@ http_post(struct soap *soap, const char *endpoint, const char *host, int port, c
#endif
#endif
if (action && soap->status != SOAP_GET && soap->status != SOAP_DEL)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "\"%s\"", action);
-#else
- sprintf(soap->tmpbuf, "\"%s\"", strlen(action) < sizeof(soap->tmpbuf) - 3 ? action : SOAP_STR_EOS);
-#endif
- if ((err = soap->fposthdr(soap, "SOAPAction", soap->tmpbuf)))
+ { (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(action) + 2), "\"%s\"", action);
+ err = soap->fposthdr(soap, "SOAPAction", soap->tmpbuf);
+ if (err)
return err;
}
return soap->fposthdr(soap, NULL, NULL);
@@ -5996,11 +6673,12 @@ http_post(struct soap *soap, const char *endpoint, const char *host, int port, c
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
http_send_header(struct soap *soap, const char *s)
-{ register const char *t;
+{ const char *t;
do
{ t = strchr(s, '\n'); /* disallow \n in HTTP headers */
if (!t)
@@ -6015,6 +6693,7 @@ http_send_header(struct soap *soap, const char *s)
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
@@ -6031,34 +6710,27 @@ http_post_header(struct soap *soap, const char *key, const char *val)
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
static int
http_response(struct soap *soap, int status, size_t count)
-{ register int err;
- char http[10];
+{ int err;
+ char http[16];
int code = status;
const char *line;
#ifdef WMW_RPM_IO
if (soap->rpmreqid)
httpOutputEnable(soap->rpmreqid);
#endif
- if (!soap->http_version || strlen(soap->http_version) > 4)
- return soap->error = SOAP_EOM;
#ifdef WMW_RPM_IO
if (soap->rpmreqid || soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) /* RPM behaves as if standalone */
#else
if (soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) /* standalone application (socket) or CGI (stdin/out)? */
#endif
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(http, sizeof(http), "HTTP/%s", soap->http_version);
-#else
- sprintf(http, "HTTP/%s", soap->http_version);
-#endif
- }
+ (SOAP_SNPRINTF(http, sizeof(http), strlen(soap->http_version) + 5), "HTTP/%s", soap->http_version);
else
- strcpy(http, "Status:");
+ soap_strcpy(http, sizeof(http), "Status:");
if (!status || status == SOAP_HTML || status == SOAP_FILE)
{ if (count || ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK))
code = 200;
@@ -6076,31 +6748,28 @@ http_response(struct soap *soap, int status, size_t count)
}
line = http_error(soap, code);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP Status = %d %s\n", code, line));
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%s %d %s", http, code, line);
-#else
- sprintf(soap->tmpbuf, "%s %d %s", http, code, line);
-#endif
- if ((err = soap->fposthdr(soap, soap->tmpbuf, NULL)))
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), sizeof(http) + 22 + strlen(line)), "%s %d %s", http, code, line);
+ err = soap->fposthdr(soap, soap->tmpbuf, NULL);
+ if (err)
return err;
#ifndef WITH_LEAN
if (status == 401)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "Basic realm=\"%s\"", (soap->authrealm && strlen(soap->authrealm) < sizeof(soap->tmpbuf) - 14) ? soap->authrealm : "gSOAP Web Service");
-#else
- sprintf(soap->tmpbuf, "Basic realm=\"%s\"", (soap->authrealm && strlen(soap->authrealm) < sizeof(soap->tmpbuf) - 14) ? soap->authrealm : "gSOAP Web Service");
-#endif
- if ((err = soap->fposthdr(soap, "WWW-Authenticate", soap->tmpbuf)))
+ { (SOAP_SNPRINTF_SAFE(soap->tmpbuf, sizeof(soap->tmpbuf)), "Basic realm=\"%s\"", (soap->authrealm && strlen(soap->authrealm) + 14 < sizeof(soap->tmpbuf)) ? soap->authrealm : "gSOAP Web Service");
+ err = soap->fposthdr(soap, "WWW-Authenticate", soap->tmpbuf);
+ if (err)
return err;
}
else if ((status >= 301 && status <= 303) || status == 307)
- { if ((err = soap->fposthdr(soap, "Location", soap->endpoint)))
+ { err = soap->fposthdr(soap, "Location", soap->endpoint);
+ if (err)
return err;
}
#endif
- if ((err = soap->fposthdr(soap, "Server", "gSOAP/2.8"))
- || (err = soap_puthttphdr(soap, status, count)))
+ err = soap->fposthdr(soap, "Server", "gSOAP/2.8");
+ if (err)
+ return err;
+ err = soap_puthttphdr(soap, status, count);
+ if (err)
return err;
#ifdef WITH_COOKIES
if (soap_putsetcookies(soap))
@@ -6112,12 +6781,13 @@ http_response(struct soap *soap, int status, size_t count)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_response(struct soap *soap, int status)
-{ register size_t count;
+{ size_t count;
if (!(soap->omode & (SOAP_ENC_XML | SOAP_IO_STORE /* this tests for chunking too */))
&& (status == SOAP_HTML || status == SOAP_FILE))
soap->omode = (soap->omode & ~SOAP_IO) | SOAP_IO_STORE;
@@ -6127,11 +6797,12 @@ soap_response(struct soap *soap, int status)
return soap->error;
#ifndef WITH_NOHTTP
if ((soap->mode & SOAP_IO) != SOAP_IO_STORE && !(soap->mode & SOAP_ENC_XML))
- { register int n = soap->mode;
+ { int n = soap->mode;
soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB);
if ((n & SOAP_IO) != SOAP_IO_FLUSH)
soap->mode |= SOAP_IO_BUFFER;
- if ((soap->error = soap->fresponse(soap, status, count)))
+ soap->error = soap->fresponse(soap, status, count);
+ if (soap->error)
return soap->error;
#ifndef WITH_LEANER
if ((n & SOAP_IO) == SOAP_IO_CHUNK)
@@ -6147,27 +6818,63 @@ soap_response(struct soap *soap, int status)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
const char*
SOAP_FMAC2
-soap_url(struct soap *soap, const char *s, const char *t)
-{ if (!t || (*t != '/' && *t != '?') || strlen(s) + strlen(t) >= sizeof(soap->msgbuf))
- return s;
- strcpy(soap->msgbuf, s);
- strcat(soap->msgbuf, t);
+soap_extend_url(struct soap *soap, const char *s, const char *t)
+{ if (s)
+ soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), s);
+ else
+ *soap->msgbuf = '\0';
+ if (t && (*t == '/' || *t == '?'))
+ { char *r = strchr(soap->msgbuf, '?');
+ if (r)
+ { if (*t == '?')
+ { soap_strncat(soap->msgbuf, sizeof(soap->msgbuf), "&", 1);
+ soap_strncat(soap->msgbuf, sizeof(soap->msgbuf), t + 1, strlen(t) - 1);
+ }
+ else /* *t == '/' */
+ { size_t l = r - soap->msgbuf;
+ *r = '\0';
+ soap_strncat(soap->msgbuf, sizeof(soap->msgbuf), t, strlen(t));
+ if (s)
+ soap_strncat(soap->msgbuf, sizeof(soap->msgbuf), s + l, strlen(s + l));
+ }
+ }
+ else
+ soap_strncat(soap->msgbuf, sizeof(soap->msgbuf), t, strlen(t));
+ }
return soap->msgbuf;
}
#endif
/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_extend_url_query(struct soap *soap, const char *s, const char *t)
+{ soap_extend_url(soap, s, t);
+ if (strchr(soap->msgbuf, '?'))
+ soap_strncat(soap->msgbuf, sizeof(soap->msgbuf), "&", 1);
+ else
+ soap_strncat(soap->msgbuf, sizeof(soap->msgbuf), "?", 1);
+ return soap->msgbuf;
+}
+#endif
+
+/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
size_t
SOAP_FMAC2
soap_encode_url(const char *s, char *t, size_t len)
-{ register int c;
- register size_t n = len;
+{ int c;
+ size_t n = len;
while ((c = *s++) && --n > 0)
{ if (c > ' ' && c < 128 && !strchr("()<>@,;:\\\"/[]?={}#!$&'*+", c))
*t++ = c;
@@ -6187,6 +6894,7 @@ soap_encode_url(const char *s, char *t, size_t len)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
const char*
@@ -6206,12 +6914,12 @@ soap_encode_url_string(struct soap *soap, const char *s)
/******************************************************************************\
*
- * HTTP Cookies
+ * HTTP Cookies
*
\******************************************************************************/
#ifdef WITH_COOKIES
-/******************************************************************************/
+
SOAP_FMAC1
struct soap_cookie*
SOAP_FMAC2
@@ -6229,16 +6937,15 @@ soap_cookie(struct soap *soap, const char *name, const char *domain, const char
for (p = soap->cookies; p; p = p->next)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie in database: %s='%s' domain='%s' path='%s' env=%hd\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->env));
if (!strcmp(p->name, name)
- && p->domain
- && p->path
- && !strcmp(p->domain, domain)
- && (!*p->path || !strncmp(p->path, path, strlen(p->path))))
+ && ((!domain && !p->domain) || (domain && p->domain && !strcmp(p->domain, domain)))
+ && ((!path && !p->path) || (path && p->path && !strncmp(p->path, path, strlen(p->path)))))
break;
}
return p;
}
/******************************************************************************/
+
SOAP_FMAC1
struct soap_cookie*
SOAP_FMAC2
@@ -6256,9 +6963,12 @@ soap_set_cookie(struct soap *soap, const char *name, const char *value, const ch
q = soap_cookie(soap, name, domain, path);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set %scookie: %s='%s' domain='%s' path='%s'\n", q ? SOAP_STR_EOS : "new ", name, value ? value : "(null)", domain ? domain : "(null)", path ? path : "(null)"));
if (!q)
- { if ((q = (struct soap_cookie*)SOAP_MALLOC(soap, sizeof(struct soap_cookie))))
- { if ((q->name = (char*)SOAP_MALLOC(soap, strlen(name)+1)))
- strcpy(q->name, name);
+ { q = (struct soap_cookie*)SOAP_MALLOC(soap, sizeof(struct soap_cookie));
+ if (q)
+ { size_t l = strlen(name);
+ q->name = (char*)SOAP_MALLOC(soap, l + 1);
+ if (q->name)
+ soap_strcpy(q->name, l + 1, name);
q->value = NULL;
q->domain = NULL;
q->path = NULL;
@@ -6290,24 +7000,36 @@ soap_set_cookie(struct soap *soap, const char *name, const char *value, const ch
q->value = NULL;
}
}
- if (value && *value && !q->value && (q->value = (char*)SOAP_MALLOC(soap, strlen(value)+1)))
- strcpy(q->value, value);
+ if (value && *value && !q->value)
+ { size_t l = strlen(value);
+ q->value = (char*)SOAP_MALLOC(soap, l + 1);
+ if (q->value)
+ soap_strcpy(q->value, l + 1, value);
+ }
if (q->domain)
{ if (!domain || strcmp(domain, q->domain))
{ SOAP_FREE(soap, q->domain);
q->domain = NULL;
}
}
- if (domain && !q->domain && (q->domain = (char*)SOAP_MALLOC(soap, strlen(domain)+1)))
- strcpy(q->domain, domain);
+ if (domain && !q->domain)
+ { size_t l = strlen(domain);
+ q->domain = (char*)SOAP_MALLOC(soap, l + 1);
+ if (q->domain)
+ soap_strcpy(q->domain, l + 1, domain);
+ }
if (q->path)
{ if (!path || strncmp(path, q->path, strlen(q->path)))
{ SOAP_FREE(soap, q->path);
q->path = NULL;
}
}
- if (path && !q->path && (q->path = (char*)SOAP_MALLOC(soap, strlen(path)+1)))
- strcpy(q->path, path);
+ if (path && !q->path)
+ { size_t l = strlen(path);
+ q->path = (char*)SOAP_MALLOC(soap, l + 1);
+ if (q->path)
+ soap_strcpy(q->path, l + 1, path);
+ }
q->session = 1;
q->env = 0;
}
@@ -6315,6 +7037,7 @@ soap_set_cookie(struct soap *soap, const char *name, const char *value, const ch
}
/******************************************************************************/
+
SOAP_FMAC1
void
SOAP_FMAC2
@@ -6335,7 +7058,7 @@ soap_clr_cookie(struct soap *soap, const char *name, const char *domain, const c
if (*path == '/')
path++;
for (p = &soap->cookies, q = *p; q; q = *p)
- { if (!strcmp(q->name, name) && !strcmp(q->domain, domain) && !strncmp(q->path, path, strlen(q->path)))
+ { if (!strcmp(q->name, name) && (!q->domain || !strcmp(q->domain, domain)) && (!q->path || !strncmp(q->path, path, strlen(q->path))))
{ if (q->value)
SOAP_FREE(soap, q->value);
if (q->domain)
@@ -6351,46 +7074,54 @@ soap_clr_cookie(struct soap *soap, const char *name, const char *domain, const c
}
/******************************************************************************/
+
SOAP_FMAC1
char *
SOAP_FMAC2
soap_cookie_value(struct soap *soap, const char *name, const char *domain, const char *path)
{ struct soap_cookie *p;
- if ((p = soap_cookie(soap, name, domain, path)))
+ p = soap_cookie(soap, name, domain, path);
+ if (p)
return p->value;
return NULL;
}
/******************************************************************************/
+
SOAP_FMAC1
char *
SOAP_FMAC2
soap_env_cookie_value(struct soap *soap, const char *name, const char *domain, const char *path)
{ struct soap_cookie *p;
- if ((p = soap_cookie(soap, name, domain, path)) && p->env)
+ p = soap_cookie(soap, name, domain, path);
+ if (p && p->env)
return p->value;
return NULL;
}
/******************************************************************************/
+
SOAP_FMAC1
time_t
SOAP_FMAC2
soap_cookie_expire(struct soap *soap, const char *name, const char *domain, const char *path)
{ struct soap_cookie *p;
- if ((p = soap_cookie(soap, name, domain, path)))
+ p = soap_cookie(soap, name, domain, path);
+ if (p)
return p->expire;
return -1;
}
/******************************************************************************/
+
SOAP_FMAC1
int
SOAP_FMAC2
soap_set_cookie_expire(struct soap *soap, const char *name, long expire, const char *domain, const char *path)
{ struct soap_cookie *p;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set cookie expiration max-age=%ld: cookie='%s' domain='%s' path='%s'\n", expire, name, domain ? domain : "(null)", path ? path : "(null)"));
- if ((p = soap_cookie(soap, name, domain, path)))
+ p = soap_cookie(soap, name, domain, path);
+ if (p)
{ p->maxage = expire;
p->modified = 1;
return SOAP_OK;
@@ -6399,12 +7130,14 @@ soap_set_cookie_expire(struct soap *soap, const char *name, long expire, const c
}
/******************************************************************************/
+
SOAP_FMAC1
int
SOAP_FMAC2
soap_set_cookie_session(struct soap *soap, const char *name, const char *domain, const char *path)
{ struct soap_cookie *p;
- if ((p = soap_cookie(soap, name, domain, path)))
+ p = soap_cookie(soap, name, domain, path);
+ if (p)
{ p->session = 1;
p->modified = 1;
return SOAP_OK;
@@ -6413,12 +7146,14 @@ soap_set_cookie_session(struct soap *soap, const char *name, const char *domain,
}
/******************************************************************************/
+
SOAP_FMAC1
int
SOAP_FMAC2
soap_clr_cookie_session(struct soap *soap, const char *name, const char *domain, const char *path)
{ struct soap_cookie *p;
- if ((p = soap_cookie(soap, name, domain, path)))
+ p = soap_cookie(soap, name, domain, path);
+ if (p)
{ p->session = 0;
p->modified = 1;
return SOAP_OK;
@@ -6427,6 +7162,7 @@ soap_clr_cookie_session(struct soap *soap, const char *name, const char *domain,
}
/******************************************************************************/
+
SOAP_FMAC1
int
SOAP_FMAC2
@@ -6435,28 +7171,28 @@ soap_putsetcookies(struct soap *soap)
char *s, tmp[4096];
const char *t;
for (p = soap->cookies; p; p = p->next)
- {
- if (p->modified
+ { if (p->modified
#ifdef WITH_OPENSSL
|| (!p->env && !soap->ssl == !p->secure)
#endif
)
{ s = tmp;
if (p->name)
- s += soap_encode_url(p->name, s, tmp-s+4064);
+ s += soap_encode_url(p->name, s, 4064 - (s-tmp));
if (p->value && *p->value)
{ *s++ = '=';
- s += soap_encode_url(p->value, s, tmp-s+4064);
+ s += soap_encode_url(p->value, s, 4064 - (s-tmp));
}
- if (p->domain && (int)strlen(p->domain) < tmp-s+4064)
- { strcpy(s, ";Domain=");
- strcat(s, p->domain);
+ if (p->domain && (int)strlen(p->domain) < 4064 - (s-tmp))
+ { soap_strcpy(s, 4096 - (s-tmp), ";Domain=");
+ soap_strcpy(s + 8, 4088 - (s-tmp), p->domain);
}
- else if (soap->cookie_domain && (int)strlen(soap->cookie_domain) < tmp-s+4064)
- { strcpy(s, ";Domain=");
- strcat(s, soap->cookie_domain);
+ else if (soap->cookie_domain && (int)strlen(soap->cookie_domain) < 4064 - (s-tmp))
+ { soap_strcpy(s, 4096 - (s-tmp), ";Domain=");
+ soap_strcpy(s + 8, 4088 - (s-tmp), soap->cookie_domain);
}
- strcat(s, ";Path=/");
+ s += strlen(s);
+ soap_strcpy(s, 4096 - (s-tmp), ";Path=/");
s += strlen(s);
if (p->path)
t = p->path;
@@ -6465,31 +7201,21 @@ soap_putsetcookies(struct soap *soap)
if (t)
{ if (*t == '/')
t++;
- if ((int)strlen(t) < tmp-s+4064)
- { if (strchr(t, '%')) /* already URL encoded? */
- { strcpy(s, t);
+ if ((int)strlen(t) < 4064 - (s-tmp))
+ { if (strchr(t, '%')) /* already URL encoded? */
+ { soap_strcpy(s, 4096 - (s-tmp), t);
s += strlen(s);
}
else
- s += soap_encode_url(t, s, tmp-s+4064);
+ s += soap_encode_url(t, s, 4064 - (s-tmp));
}
}
- if (p->version > 0 && s-tmp < 4060)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(s, 4096 - (s-tmp), ";Version=%u", p->version);
-#else
- sprintf(s, ";Version=%u", p->version);
-#endif
+ if (p->version > 0 && s-tmp < 4064)
+ { (SOAP_SNPRINTF(s, 4096 - (s-tmp), 29), ";Version=%u", p->version);
s += strlen(s);
}
- if (p->maxage >= 0 && s-tmp < 4060)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(s, 4096 - (s-tmp), ";Max-Age=%ld", p->maxage);
-#else
- sprintf(s, ";Max-Age=%ld", p->maxage);
-#endif
+ if (p->maxage >= 0 && s-tmp < 4064)
+ { (SOAP_SNPRINTF(s, 4096 - (s-tmp), 29), ";Max-Age=%ld", p->maxage);
s += strlen(s);
}
if (s-tmp < 4073
@@ -6498,9 +7224,10 @@ soap_putsetcookies(struct soap *soap)
|| soap->ssl
#endif
))
- strcpy(s, ";Secure");
+ soap_strcpy(s, 4096 - (s-tmp), ";Secure");
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set-Cookie: %s\n", tmp));
- if ((soap->error = soap->fposthdr(soap, "Set-Cookie", tmp)))
+ soap->error = soap->fposthdr(soap, "Set-Cookie", tmp);
+ if (soap->error)
return soap->error;
}
}
@@ -6508,6 +7235,7 @@ soap_putsetcookies(struct soap *soap)
}
/******************************************************************************/
+
SOAP_FMAC1
int
SOAP_FMAC2
@@ -6555,10 +7283,14 @@ soap_putcookies(struct soap *soap, const char *domain, const char *path, int sec
if (!flag)
{ struct hostent *hostent = gethostbyname((char*)domain);
if (hostent)
- { const char *r = strchr(hostent->h_name, '.');
- if (!r)
- r = hostent->h_name;
+ { const char *r = hostent->h_name;
+ if (*t == '.')
+ { size_t k = strlen(hostent->h_name);
+ if (k >= n)
+ r = hostent->h_name + k - n;
+ }
flag = !strncmp(t, r, n);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Domain cookie %s host %s (match=%d)\n", t, r, flag));
}
}
#endif
@@ -6578,21 +7310,16 @@ soap_putcookies(struct soap *soap, const char *domain, const char *path, int sec
{ if (s == tmp)
return SOAP_OK; /* HTTP header size overflow */
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie: %s\n", tmp));
- if ((soap->error = soap->fposthdr(soap, "Cookie", tmp)))
+ soap->error = soap->fposthdr(soap, "Cookie", tmp);
+ if (soap->error)
return soap->error;
s = tmp;
}
else if (s != tmp)
- { strcat(s, " ");
- s++;
+ { *s++ = ' ';
}
if (q->version != version && s-tmp < 4060)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(s, 4096 - (s-tmp), "$Version=%u;", q->version);
-#else
- sprintf(s, "$Version=%u;", q->version);
-#endif
+ { (SOAP_SNPRINTF(s, 4096 - (s-tmp), 29), "$Version=%u;", q->version);
version = q->version;
s += strlen(s);
}
@@ -6603,21 +7330,11 @@ soap_putcookies(struct soap *soap, const char *domain, const char *path, int sec
s += soap_encode_url(q->value, s, tmp+sizeof(tmp)-s-16);
}
if (q->path && (s-tmp) + strlen(q->path) < 4060)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(s, 4096 - (s-tmp), ";$Path=\"/%s\"", (*q->path == '/' ? q->path + 1 : q->path));
-#else
- sprintf(s, ";$Path=\"/%s\"", (*q->path == '/' ? q->path + 1 : q->path));
-#endif
+ { (SOAP_SNPRINTF_SAFE(s, 4096 - (s-tmp)), ";$Path=\"/%s\"", (*q->path == '/' ? q->path + 1 : q->path));
s += strlen(s);
}
if (q->domain && (s-tmp) + strlen(q->domain) < 4060)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(s, 4096 - (s-tmp), ";$Domain=\"%s\"", q->domain);
-#else
- sprintf(s, ";$Domain=\"%s\"", q->domain);
-#endif
+ { (SOAP_SNPRINTF_SAFE(s, 4096 - (s-tmp)), ";$Domain=\"%s\"", q->domain);
s += strlen(s);
}
}
@@ -6625,12 +7342,15 @@ soap_putcookies(struct soap *soap, const char *domain, const char *path, int sec
}
}
if (s != tmp)
- if ((soap->error = soap->fposthdr(soap, "Cookie", tmp)))
+ { soap->error = soap->fposthdr(soap, "Cookie", tmp);
+ if (soap->error)
return soap->error;
+ }
return SOAP_OK;
}
/******************************************************************************/
+
SOAP_FMAC1
void
SOAP_FMAC2
@@ -6648,7 +7368,8 @@ soap_getcookies(struct soap *soap, const char *val)
while (*s)
{ s = soap_decode_key(tmp, sizeof(tmp), s);
if (!soap_tag_cmp(tmp, "$Version"))
- { if ((s = soap_decode_val(tmp, sizeof(tmp), s)))
+ { s = soap_decode_val(tmp, sizeof(tmp), s);
+ if (s)
{ if (p)
p->version = (int)soap_strtol(tmp, NULL, 10);
else
@@ -6658,8 +7379,10 @@ soap_getcookies(struct soap *soap, const char *val)
else if (!soap_tag_cmp(tmp, "$Path"))
{ s = soap_decode_val(tmp, sizeof(tmp), s);
if (*tmp)
- { if ((t = (char*)SOAP_MALLOC(soap, strlen(tmp)+1)))
- strcpy(t, tmp);
+ { size_t l = strlen(tmp) + 1;
+ t = (char*)SOAP_MALLOC(soap, l);
+ if (t)
+ soap_memcpy((void*)t, l, (const void*)tmp, l);
}
else
t = NULL;
@@ -6677,8 +7400,10 @@ soap_getcookies(struct soap *soap, const char *val)
else if (!soap_tag_cmp(tmp, "$Domain"))
{ s = soap_decode_val(tmp, sizeof(tmp), s);
if (*tmp)
- { if ((t = (char*)SOAP_MALLOC(soap, strlen(tmp)+1)))
- strcpy(t, tmp);
+ { size_t l = strlen(tmp) + 1;
+ t = (char*)SOAP_MALLOC(soap, l);
+ if (t)
+ soap_memcpy((void*)t, l, (const void*)tmp, l);
}
else
t = NULL;
@@ -6698,8 +7423,10 @@ soap_getcookies(struct soap *soap, const char *val)
SOAP_FREE(soap, p->path);
s = soap_decode_val(tmp, sizeof(tmp), s);
if (*tmp)
- { if ((p->path = (char*)SOAP_MALLOC(soap, strlen(tmp)+1)))
- strcpy(p->path, tmp);
+ { size_t l = strlen(tmp) + 1;
+ p->path = (char*)SOAP_MALLOC(soap, l);
+ if (p->path)
+ soap_memcpy((void*)p->path, l, (const void*)tmp, l);
}
else
p->path = NULL;
@@ -6709,8 +7436,10 @@ soap_getcookies(struct soap *soap, const char *val)
SOAP_FREE(soap, p->domain);
s = soap_decode_val(tmp, sizeof(tmp), s);
if (*tmp)
- { if ((p->domain = (char*)SOAP_MALLOC(soap, strlen(tmp)+1)))
- strcpy(p->domain, tmp);
+ { size_t l = strlen(tmp) + 1;
+ p->domain = (char*)SOAP_MALLOC(soap, l);
+ if (p->domain)
+ soap_memcpy((void*)p->domain, l, (const void*)tmp, l);
}
else
p->domain = NULL;
@@ -6757,7 +7486,8 @@ soap_getcookies(struct soap *soap, const char *val)
else
{ if (p)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie='%s' value='%s' domain='%s' path='%s' expire=%ld secure=%d\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->expire, p->secure));
- if ((q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path)))
+ q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path);
+ if (q)
{ q->version = p->version;
q->expire = p->expire;
q->secure = p->secure;
@@ -6773,33 +7503,43 @@ soap_getcookies(struct soap *soap, const char *val)
SOAP_FREE(soap, p->path);
SOAP_FREE(soap, p);
}
- if ((p = (struct soap_cookie*)SOAP_MALLOC(soap, sizeof(struct soap_cookie))))
- { p->name = (char*)SOAP_MALLOC(soap, strlen(tmp)+1);
- strcpy(p->name, tmp);
+ p = (struct soap_cookie*)SOAP_MALLOC(soap, sizeof(struct soap_cookie));
+ if (p)
+ { size_t l = strlen(tmp) + 1;
+ p->name = (char*)SOAP_MALLOC(soap, l);
+ if (p->name)
+ soap_memcpy((void*)p->name, l, (const void*)tmp, l);
s = soap_decode_val(tmp, sizeof(tmp), s);
if (*tmp)
- { p->value = (char*)SOAP_MALLOC(soap, strlen(tmp)+1);
- strcpy(p->value, tmp);
+ { l = strlen(tmp) + 1;
+ p->value = (char*)SOAP_MALLOC(soap, l);
+ if (p->value)
+ soap_memcpy((void*)p->value, l, (const void*)tmp, l);
}
else
p->value = NULL;
if (domain)
p->domain = domain;
else if (*soap->host)
- { p->domain = (char*)SOAP_MALLOC(soap, strlen(soap->host)+1);
- strcpy(p->domain, soap->host);
+ { l = strlen(soap->host) + 1;
+ p->domain = (char*)SOAP_MALLOC(soap, l);
+ if (p->domain)
+ soap_memcpy((void*)p->domain, l, (const void*)soap->host, l);
}
else
p->domain = NULL;
if (path)
p->path = path;
- else if (soap->path && *soap->path)
- { p->path = (char*)SOAP_MALLOC(soap, strlen(soap->path)+1);
- strcpy(p->path, soap->path);
+ else if (*soap->path)
+ { l = strlen(soap->path) + 1;
+ p->path = (char*)SOAP_MALLOC(soap, l);
+ if (p->path)
+ soap_memcpy((void*)p->path, l, (const void*)soap->path, l);
}
else
{ p->path = (char*)SOAP_MALLOC(soap, 2);
- strcpy(p->path, "/");
+ if (p->path)
+ soap_memcpy((void*)p->path, 2, (const void*)"/", 2);
}
p->expire = 0;
p->secure = 0;
@@ -6809,7 +7549,8 @@ soap_getcookies(struct soap *soap, const char *val)
}
if (p)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie='%s' value='%s' domain='%s' path='%s' expire=%ld secure=%d\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->expire, p->secure));
- if ((q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path)))
+ q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path);
+ if (q)
{ q->version = p->version;
q->expire = p->expire;
q->secure = p->secure;
@@ -6832,6 +7573,7 @@ soap_getcookies(struct soap *soap, const char *val)
}
/******************************************************************************/
+
SOAP_FMAC1
int
SOAP_FMAC2
@@ -6839,7 +7581,8 @@ soap_getenv_cookies(struct soap *soap)
{ struct soap_cookie *p;
const char *s;
char key[4096], val[4096]; /* cookie size is up to 4096 bytes [RFC2109] */
- if (!(s = getenv("HTTP_COOKIE")))
+ s = getenv("HTTP_COOKIE");
+ if (!s)
return SOAP_ERR;
do
{ s = soap_decode_key(key, sizeof(key), s);
@@ -6852,6 +7595,7 @@ soap_getenv_cookies(struct soap *soap)
}
/******************************************************************************/
+
SOAP_FMAC1
struct soap_cookie*
SOAP_FMAC2
@@ -6859,24 +7603,33 @@ soap_copy_cookies(struct soap *copy, const struct soap *soap)
{ struct soap_cookie *p, **q, *r;
q = &r;
for (p = soap->cookies; p; p = p->next)
- { if (!(*q = (struct soap_cookie*)SOAP_MALLOC(copy, sizeof(struct soap_cookie))))
+ { *q = (struct soap_cookie*)SOAP_MALLOC(copy, sizeof(struct soap_cookie));
+ if (!*q)
return r;
**q = *p;
if (p->name)
- { if (((*q)->name = (char*)SOAP_MALLOC(copy, strlen(p->name)+1)))
- strcpy((*q)->name, p->name);
+ { size_t l = strlen(p->name) + 1;
+ (*q)->name = (char*)SOAP_MALLOC(copy, l);
+ if ((*q)->name)
+ soap_memcpy((*q)->name, l, p->name, l);
}
if (p->value)
- { if (((*q)->value = (char*)SOAP_MALLOC(copy, strlen(p->value)+1)))
- strcpy((*q)->value, p->value);
+ { size_t l = strlen(p->value) + 1;
+ (*q)->value = (char*)SOAP_MALLOC(copy, l);
+ if ((*q)->value)
+ soap_memcpy((*q)->value, l, p->value, l);
}
if (p->domain)
- { if (((*q)->domain = (char*)SOAP_MALLOC(copy, strlen(p->domain)+1)))
- strcpy((*q)->domain, p->domain);
+ { size_t l = strlen(p->domain) + 1;
+ (*q)->domain = (char*)SOAP_MALLOC(copy, l);
+ if ((*q)->domain)
+ soap_memcpy((*q)->domain, l, p->domain, l);
}
if (p->path)
- { if (((*q)->path = (char*)SOAP_MALLOC(copy, strlen(p->path)+1)))
- strcpy((*q)->path, p->path);
+ { size_t l = strlen(p->path) + 1;
+ (*q)->path = (char*)SOAP_MALLOC(copy, l);
+ if ((*q)->path)
+ soap_memcpy((*q)->path, l, p->path, l);
}
q = &(*q)->next;
}
@@ -6885,6 +7638,7 @@ soap_copy_cookies(struct soap *copy, const struct soap *soap)
}
/******************************************************************************/
+
SOAP_FMAC1
void
SOAP_FMAC2
@@ -6904,44 +7658,49 @@ soap_free_cookies(struct soap *soap)
}
/******************************************************************************/
+
#endif /* WITH_COOKIES */
/******************************************************************************/
-#ifndef WITH_NOIDREF
+
#ifndef PALM_2
SOAP_FMAC1
size_t
SOAP_FMAC2
-soap_hash(register const char *s)
-{ register size_t h = 0;
+soap_hash(const char *s)
+{ size_t h = 0;
while (*s)
h = 65599*h + *s++;
return h % SOAP_IDHASH;
}
#endif
-#endif
/******************************************************************************/
-#ifndef WITH_NOIDREF
+
#ifndef PALM_1
static void
soap_init_pht(struct soap *soap)
-{ register int i;
+{ int i;
soap->pblk = NULL;
soap->pidx = 0;
for (i = 0; i < (int)SOAP_PTRHASH; i++)
soap->pht[i] = NULL;
}
#endif
-#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
struct soap*
SOAP_FMAC2
soap_versioning(soap_new)(soap_mode imode, soap_mode omode)
-{ struct soap *soap = (struct soap*)malloc(sizeof(struct soap));
+{ struct soap *soap;
+#ifdef __cplusplus
+ soap = SOAP_NEW(struct soap);
+#else
+ soap = (struct soap*)malloc(sizeof(struct soap));
+#endif
if (soap)
soap_versioning(soap_init)(soap, imode, omode);
return soap;
@@ -6949,17 +7708,23 @@ soap_versioning(soap_new)(soap_mode imode, soap_mode omode)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
SOAP_FMAC2
soap_free(struct soap *soap)
{ soap_done(soap);
+#ifdef __cplusplus
+ SOAP_DELETE(soap);
+#else
free(soap);
+#endif
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
@@ -6970,12 +7735,12 @@ soap_del(struct soap *soap)
#endif
/******************************************************************************/
-#ifndef WITH_NOIDREF
+
#ifndef PALM_1
static void
soap_free_pht(struct soap *soap)
-{ register struct soap_pblk *pb, *next;
- register int i;
+{ struct soap_pblk *pb, *next;
+ int i;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free pointer hashtable\n"));
for (pb = soap->pblk; pb; pb = next)
{ next = pb->next;
@@ -6987,43 +7752,44 @@ soap_free_pht(struct soap *soap)
soap->pht[i] = NULL;
}
#endif
-#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
-soap_embed(struct soap *soap, const void *p, const struct soap_array *a, int n, const char *tag, int type)
-{ register int i;
+soap_embed(struct soap *soap, const void *p, const void *a, int n, int t)
+{ int id;
struct soap_plist *pp;
- (void)soap;
if (soap->version == 2)
soap->encoding = 1;
+ if (!p || (!soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH)) || (soap->omode & SOAP_XML_TREE))
+ return 0;
if (a)
- i = soap_array_pointer_lookup(soap, p, a, n, type, &pp);
+ id = soap_array_pointer_lookup(soap, p, a, n, t, &pp);
else
- i = soap_pointer_lookup(soap, p, type, &pp);
- if (i)
+ id = soap_pointer_lookup(soap, p, t, &pp);
+ if (id)
{ if (soap_is_embedded(soap, pp)
|| soap_is_single(soap, pp))
return 0;
soap_set_embedded(soap, pp);
}
- return i;
+ return id;
}
#endif
#endif
/******************************************************************************/
-#ifndef WITH_NOIDREF
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_pointer_lookup(struct soap *soap, const void *p, int type, struct soap_plist **ppp)
-{ register struct soap_plist *pp;
+{ struct soap_plist *pp;
*ppp = NULL;
if (p)
{ for (pp = soap->pht[soap_hash_ptr(p)]; pp; pp = pp->next)
@@ -7038,20 +7804,19 @@ soap_pointer_lookup(struct soap *soap, const void *p, int type, struct soap_plis
return 0;
}
#endif
-#endif
/******************************************************************************/
-#ifndef WITH_NOIDREF
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
-soap_pointer_enter(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
-{ register size_t h;
- register struct soap_plist *pp;
+soap_pointer_enter(struct soap *soap, const void *p, const void *a, int n, int type, struct soap_plist **ppp)
+{ size_t h;
+ struct soap_plist *pp;
(void)n;
if (!soap->pblk || soap->pidx >= SOAP_PTRBLK)
- { register struct soap_pblk *pb = (struct soap_pblk*)SOAP_MALLOC(soap, sizeof(struct soap_pblk));
+ { struct soap_pblk *pb = (struct soap_pblk*)SOAP_MALLOC(soap, sizeof(struct soap_pblk));
if (!pb)
{ soap->error = SOAP_EOM;
return 0;
@@ -7062,54 +7827,49 @@ soap_pointer_enter(struct soap *soap, const void *p, const struct soap_array *a,
}
*ppp = pp = &soap->pblk->plist[soap->pidx++];
if (a)
- h = soap_hash_ptr(a->__ptr);
+ h = soap_hash_ptr(a);
else
h = soap_hash_ptr(p);
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pointer enter location=%p array=%p size=%d dim=%d type=%d id=%d\n", p, a ? a->__ptr : NULL, a ? a->__size : 0, n, type, soap->idnum+1));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pointer enter location=%p array=%p size=%lu type=%d id=%d\n", p, a, (unsigned long)n, type, soap->idnum+1));
pp->next = soap->pht[h];
pp->type = type;
pp->mark1 = 0;
pp->mark2 = 0;
pp->ptr = p;
+ pp->dup = NULL;
pp->array = a;
+ pp->size = n;
soap->pht[h] = pp;
pp->id = ++soap->idnum;
return pp->id;
}
#endif
-#endif
/******************************************************************************/
-#ifndef WITH_NOIDREF
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
-soap_array_pointer_lookup(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
-{ register struct soap_plist *pp;
+soap_array_pointer_lookup(struct soap *soap, const void *p, const void *a, int n, int type, struct soap_plist **ppp)
+{ struct soap_plist *pp;
*ppp = NULL;
- if (!p || !a->__ptr)
+ if (!p || !a)
return 0;
- for (pp = soap->pht[soap_hash_ptr(a->__ptr)]; pp; pp = pp->next)
- { if (pp->type == type && pp->array && pp->array->__ptr == a->__ptr)
- { register int i;
- for (i = 0; i < n; i++)
- if (((const int*)&pp->array->__size)[i] != ((const int*)&a->__size)[i])
- break;
- if (i == n)
- { *ppp = pp;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d id=%d\n", a->__ptr, type, pp->id));
- return pp->id;
- }
+ for (pp = soap->pht[soap_hash_ptr(a)]; pp; pp = pp->next)
+ { if (pp->type == type && pp->array == a && pp->size == n)
+ { *ppp = pp;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d id=%d\n", a, type, pp->id));
+ return pp->id;
}
}
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d: not found\n", a->__ptr, type));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d: not found\n", a, type));
return 0;
}
#endif
-#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -7123,7 +7883,9 @@ soap_begin_count(struct soap *soap)
#endif
{ soap->mode = soap->omode;
if ((soap->mode & SOAP_IO_UDP))
- soap->mode |= SOAP_ENC_XML;
+ { soap->mode |= SOAP_ENC_XML;
+ soap->mode &= ~SOAP_IO_CHUNK;
+ }
if ((soap->mode & SOAP_IO) == SOAP_IO_STORE
|| (((soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_ENC_XML))
#ifndef WITH_LEANER
@@ -7151,7 +7913,7 @@ soap_begin_count(struct soap *soap)
soap->mode &= ~SOAP_ENC_MTOM;
if (soap->mode & SOAP_ENC_MIME)
soap_select_mime_boundary(soap);
- soap->dime.list = soap->dime.last; /* keep track of last DIME attachment */
+ soap->dime.list = soap->dime.last; /* keep track of last DIME attachment */
#endif
soap->count = 0;
soap->ns = 0;
@@ -7163,12 +7925,14 @@ soap_begin_count(struct soap *soap)
soap->event = 0;
soap->evlev = 0;
soap->idnum = 0;
+ soap->body = 1;
+ soap->level = 0;
soap_clr_attr(soap);
soap_set_local_namespaces(soap);
#ifndef WITH_LEANER
soap->dime.count = 0; /* count # of attachments */
soap->dime.size = 0; /* accumulate total size of attachments */
- if (soap->fprepareinitsend && (soap->mode & SOAP_IO) != SOAP_IO_STORE && (soap->error = soap->fprepareinitsend(soap)))
+ if (soap->fprepareinitsend && (soap->mode & SOAP_IO) != SOAP_IO_STORE && (soap->error = soap->fprepareinitsend(soap)) != SOAP_OK)
return soap->error;
#endif
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin count phase (socket=%d mode=0x%x count=%lu)\n", soap->socket, (unsigned int)soap->mode, (unsigned long)soap->count));
@@ -7177,6 +7941,7 @@ soap_begin_count(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -7185,15 +7950,18 @@ soap_end_count(struct soap *soap)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of count phase\n"));
#ifndef WITH_LEANER
if ((soap->mode & SOAP_IO_LENGTH))
- { if (soap->fpreparefinalsend && (soap->error = soap->fpreparefinalsend(soap)))
+ { if (soap->fpreparefinalsend && (soap->error = soap->fpreparefinalsend(soap)) != SOAP_OK)
return soap->error;
}
+#else
+ (void)soap;
#endif
return SOAP_OK;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -7203,27 +7971,36 @@ soap_begin_send(struct soap *soap)
soap_free_ns(soap);
soap->error = SOAP_OK;
soap->mode = soap->omode | (soap->mode & (SOAP_IO_LENGTH | SOAP_ENC_DIME));
-#ifdef WITH_ZLIB
- if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH)
- { if (soap->mode & SOAP_ENC_XML)
- soap->mode |= SOAP_IO_BUFFER;
- else
- soap->mode |= SOAP_IO_STORE;
- }
-#endif
#ifndef WITH_LEAN
if ((soap->mode & SOAP_IO_UDP))
{ soap->mode |= SOAP_ENC_XML;
- if (soap->count > SOAP_BUFLEN)
+ soap->mode &= ~SOAP_IO_CHUNK;
+ if (soap->count > sizeof(soap->buf))
return soap->error = SOAP_UDP_ERROR;
}
#endif
- if ((soap->mode & SOAP_IO) == SOAP_IO_FLUSH && soap_valid_socket(soap->socket))
- { if (soap->count || (soap->mode & SOAP_IO_LENGTH) || (soap->mode & SOAP_ENC_XML))
+#ifdef WITH_ZLIB
+ if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH)
+ { if (soap->mode & SOAP_ENC_XML)
soap->mode |= SOAP_IO_BUFFER;
else
soap->mode |= SOAP_IO_STORE;
}
+#endif
+ if ((soap->mode & SOAP_IO) == SOAP_IO_FLUSH)
+ { if (soap_valid_socket(soap->socket))
+ { if (soap->count || (soap->mode & SOAP_IO_LENGTH) || (soap->mode & SOAP_ENC_XML))
+ soap->mode |= SOAP_IO_BUFFER;
+ else
+ soap->mode |= SOAP_IO_STORE;
+ }
+#if !defined(__cplusplus) || defined(WITH_COMPAT)
+ else if (soap->os != NULL)
+ { *soap->os = NULL;
+ soap->mode |= SOAP_IO_STORE;
+ }
+#endif
+ }
soap->mode &= ~SOAP_IO_LENGTH;
if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
if (soap_new_block(soap) == NULL)
@@ -7242,7 +8019,7 @@ soap_begin_send(struct soap *soap)
#ifdef WIN32
#ifndef UNDER_CE
#ifndef WITH_FASTCGI
- if (!soap_valid_socket(soap->socket) && !soap->os) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */
+ if (!soap_valid_socket(soap->socket) && !soap->os && soap->sendfd >= 0) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */
#ifdef __BORLANDC__
setmode(soap->sendfd, _O_BINARY);
#else
@@ -7263,21 +8040,30 @@ soap_begin_send(struct soap *soap)
soap->mustUnderstand = 0;
soap->encoding = 0;
soap->idnum = 0;
+ soap->body = 1;
soap->level = 0;
soap_clr_attr(soap);
soap_set_local_namespaces(soap);
#ifdef WITH_ZLIB
soap->z_ratio_out = 1.0;
if ((soap->mode & SOAP_ENC_ZLIB) && soap->zlib_state != SOAP_ZLIB_DEFLATE)
- { if (!soap->z_buf)
- soap->z_buf = (char*)SOAP_MALLOC(soap, SOAP_BUFLEN);
+ { if (!soap->d_stream)
+ { soap->d_stream = (z_stream*)SOAP_MALLOC(soap, sizeof(z_stream));
+ soap->d_stream->zalloc = Z_NULL;
+ soap->d_stream->zfree = Z_NULL;
+ soap->d_stream->opaque = Z_NULL;
+ soap->d_stream->next_in = Z_NULL;
+ }
+ if (!soap->z_buf)
+ soap->z_buf = (char*)SOAP_MALLOC(soap, sizeof(soap->buf));
soap->d_stream->next_out = (Byte*)soap->z_buf;
- soap->d_stream->avail_out = SOAP_BUFLEN;
+ soap->d_stream->avail_out = sizeof(soap->buf);
#ifdef WITH_GZIP
if (soap->zlib_out != SOAP_ZLIB_DEFLATE)
- { memcpy(soap->z_buf, "\37\213\10\0\0\0\0\0\0\377", 10);
+ { if (soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)"\37\213\10\0\0\0\0\0\0\377", 10))
+ return soap->error = SOAP_EOM;
soap->d_stream->next_out = (Byte*)soap->z_buf + 10;
- soap->d_stream->avail_out = SOAP_BUFLEN - 10;
+ soap->d_stream->avail_out = sizeof(soap->buf) - 10;
soap->z_crc = crc32(0L, NULL, 0);
soap->zlib_out = SOAP_ZLIB_GZIP;
if (soap->z_dict)
@@ -7304,7 +8090,7 @@ soap_begin_send(struct soap *soap)
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin send phase (socket=%d mode=0x%x count=%lu)\n", soap->socket, soap->mode, (unsigned long)soap->count));
soap->part = SOAP_BEGIN;
#ifndef WITH_LEANER
- if (soap->fprepareinitsend && (soap->mode & SOAP_IO) == SOAP_IO_STORE && (soap->error = soap->fprepareinitsend(soap)))
+ if (soap->fprepareinitsend && (soap->mode & SOAP_IO) == SOAP_IO_STORE && (soap->error = soap->fprepareinitsend(soap)) != SOAP_OK)
return soap->error;
#endif
return SOAP_OK;
@@ -7312,6 +8098,7 @@ soap_begin_send(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
@@ -7329,6 +8116,7 @@ soap_embedded(struct soap *soap, const void *p, int t)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
@@ -7353,14 +8141,15 @@ soap_reference(struct soap *soap, const void *p, int t)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
-soap_array_reference(struct soap *soap, const void *p, const struct soap_array *a, int n, int t)
+soap_array_reference(struct soap *soap, const void *p, const void *a, int n, int t)
{ struct soap_plist *pp;
- if (!p || !a->__ptr || (!soap->encodingStyle && !(soap->omode & (SOAP_ENC_DIME|SOAP_ENC_MIME|SOAP_ENC_MTOM|SOAP_XML_GRAPH))) || (soap->omode & SOAP_XML_TREE))
+ if (!p || !a || (!soap->encodingStyle && !(soap->omode & (SOAP_ENC_DIME|SOAP_ENC_MIME|SOAP_ENC_MTOM|SOAP_XML_GRAPH))) || (soap->omode & SOAP_XML_TREE))
return 1;
if (soap_array_pointer_lookup(soap, p, a, n, t, &pp))
{ if (pp->mark1 == 0)
@@ -7370,13 +8159,14 @@ soap_array_reference(struct soap *soap, const void *p, const struct soap_array *
}
else if (!soap_pointer_enter(soap, p, a, n, t, &pp))
return 1;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array reference %p ptr=%p dim=%d type=%d (%d %d)\n", p, a->__ptr, n, t, (int)pp->mark1, (int)pp->mark2));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array reference %p ptr=%p n=%lu type=%d (%d %d)\n", p, a, (unsigned long)n, t, (int)pp->mark1, (int)pp->mark2));
return pp->mark1;
}
#endif
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
@@ -7384,13 +8174,15 @@ int
SOAP_FMAC2
soap_embedded_id(struct soap *soap, int id, const void *p, int t)
{ struct soap_plist *pp = NULL;
- if (!id || (!soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH)) || (soap->omode & SOAP_XML_TREE))
+ if (id >= 0 || (!soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH)) || (soap->omode & SOAP_XML_TREE))
return id;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id %p type=%d id=%d\n", p, t, id));
- if (soap->version == 1 && soap->part != SOAP_IN_HEADER)
- { if (id < 0)
- { id = soap_pointer_lookup(soap, p, t, &pp);
- if (id)
+ if (id < -1)
+ return soap_embed(soap, p, NULL, 0, t);
+ if (id < 0)
+ { id = soap_pointer_lookup(soap, p, t, &pp);
+ if (soap->version == 1 && soap->part != SOAP_IN_HEADER)
+ { if (id)
{ if (soap->mode & SOAP_IO_LENGTH)
pp->mark1 = 2;
else
@@ -7399,18 +8191,13 @@ soap_embedded_id(struct soap *soap, int id, const void *p, int t)
}
return -1;
}
- return id;
- }
- if (id < 0)
- id = soap_pointer_lookup(soap, p, t, &pp);
- else if (id && !soap_pointer_lookup(soap, p, t, &pp))
- return 0;
- if (id && pp)
- { if (soap->mode & SOAP_IO_LENGTH)
- pp->mark1 = 1;
- else
- pp->mark2 = 1;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id embedded ref id=%d %p type=%d = (%d %d)\n", id, p, t, (int)pp->mark1, (int)pp->mark2));
+ else if (id)
+ { if (soap->mode & SOAP_IO_LENGTH)
+ pp->mark1 = 1;
+ else
+ pp->mark2 = 1;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id embedded ref id=%d %p type=%d = (%d %d)\n", id, p, t, (int)pp->mark1, (int)pp->mark2));
+ }
}
return id;
}
@@ -7418,6 +8205,7 @@ soap_embedded_id(struct soap *soap, int id, const void *p, int t)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
@@ -7440,6 +8228,7 @@ soap_is_embedded(struct soap *soap, struct soap_plist *pp)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
@@ -7458,6 +8247,7 @@ soap_is_single(struct soap *soap, struct soap_plist *pp)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
@@ -7475,18 +8265,17 @@ soap_set_embedded(struct soap *soap, struct soap_plist *pp)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
-soap_attachment(struct soap *soap, const char *tag, int id, const void *p, const struct soap_array *a, const char *aid, const char *atype, const char *aoptions, int n, const char *type, int t)
-{
-#ifndef WITH_NOIDREF
- struct soap_plist *pp;
+soap_attachment(struct soap *soap, const char *tag, int id, const void *p, const void *a, int n, const char *aid, const char *atype, const char *aoptions, const char *type, int t)
+{ struct soap_plist *pp;
int i;
- if (!p || !a->__ptr || (!aid && !atype))
- return soap_element_id(soap, tag, id, p, a, n, type, t);
+ if (!p || !a || (!aid && !atype))
+ return soap_element_id(soap, tag, id, p, a, n, type, t, NULL);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attachment tag='%s' id='%s' (%d) type='%s'\n", tag, aid ? aid : SOAP_STR_EOS, id, atype ? atype : SOAP_STR_EOS));
i = soap_array_pointer_lookup(soap, p, a, n, t, &pp);
if (!i)
@@ -7499,12 +8288,7 @@ soap_attachment(struct soap *soap, const char *tag, int id, const void *p, const
if (id <= 0)
id = i;
if (!aid)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), soap->dime_id_format, id);
-#else
- sprintf(soap->tmpbuf, soap->dime_id_format, id);
-#endif
+ { (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(soap->dime_id_format) + 20), soap->dime_id_format, id);
aid = soap_strdup(soap, soap->tmpbuf);
}
/* Add MTOM xop:Include element when necessary */
@@ -7521,20 +8305,22 @@ soap_attachment(struct soap *soap, const char *tag, int id, const void *p, const
{ if (pp->mark1 != 3)
{ struct soap_multipart *content;
if (soap->mode & SOAP_ENC_MTOM)
- content = soap_new_multipart(soap, &soap->mime.first, &soap->mime.last, (char*)a->__ptr, a->__size);
+ content = soap_new_multipart(soap, &soap->mime.first, &soap->mime.last, (char*)a, n);
else
- content = soap_new_multipart(soap, &soap->dime.first, &soap->dime.last, (char*)a->__ptr, a->__size);
+ content = soap_new_multipart(soap, &soap->dime.first, &soap->dime.last, (char*)a, n);
if (!content)
{ soap->error = SOAP_EOM;
return -1;
}
if (!strncmp(aid, "cid:", 4)) /* RFC 2111 */
{ if (soap->mode & SOAP_ENC_MTOM)
- { char *s = (char*)soap_malloc(soap, strlen(aid) - 1);
+ { size_t l = strlen(aid) - 1;
+ char *s = (char*)soap_malloc(soap, l);
if (s)
- { *s = '<';
- strcpy(s + 1, aid + 4);
- strcat(s, ">");
+ { s[0] = '<';
+ soap_strncpy(s + 1, l - 1, aid + 4, l - 3);
+ s[l - 2] = '>';
+ s[l - 1] = '\0';
content->id = s;
}
}
@@ -7551,18 +8337,18 @@ soap_attachment(struct soap *soap, const char *tag, int id, const void *p, const
}
else
pp->mark2 = 3;
-#endif
return -1;
}
#endif
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_1
static void
soap_init_iht(struct soap *soap)
-{ register int i;
+{ int i;
for (i = 0; i < SOAP_IDHASH; i++)
soap->iht[i] = NULL;
}
@@ -7570,13 +8356,14 @@ soap_init_iht(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_1
static void
soap_free_iht(struct soap *soap)
-{ register int i;
- register struct soap_ilist *ip = NULL, *p = NULL;
- register struct soap_flist *fp = NULL, *fq = NULL;
+{ int i;
+ struct soap_ilist *ip = NULL, *p = NULL;
+ struct soap_flist *fp = NULL, *fq = NULL;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free ID hashtable\n"));
for (i = 0; i < SOAP_IDHASH; i++)
{ for (ip = soap->iht[i]; ip; ip = p)
@@ -7594,13 +8381,14 @@ soap_free_iht(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
struct soap_ilist *
SOAP_FMAC2
soap_lookup(struct soap *soap, const char *id)
-{ register struct soap_ilist *ip = NULL;
+{ struct soap_ilist *ip = NULL;
for (ip = soap->iht[soap_hash(id)]; ip; ip = ip->next)
if (!strcmp(ip->id, id))
return ip;
@@ -7610,17 +8398,28 @@ soap_lookup(struct soap *soap, const char *id)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
struct soap_ilist *
SOAP_FMAC2
-soap_enter(struct soap *soap, const char *id)
-{ register size_t h;
- register struct soap_ilist *ip;
- ip = (struct soap_ilist*)SOAP_MALLOC(soap, sizeof(struct soap_ilist) + strlen(id));
+soap_enter(struct soap *soap, const char *id, int t, size_t n)
+{ size_t h;
+ struct soap_ilist *ip;
+ size_t l = strlen(id);
+ ip = (struct soap_ilist*)SOAP_MALLOC(soap, sizeof(struct soap_ilist) + l);
if (ip)
- { strcpy((char*)ip->id, id);
+ { ip->type = t;
+ ip->size = n;
+ ip->ptr = NULL;
+ ip->spine = NULL;
+ ip->link = NULL;
+ ip->copy = NULL;
+ ip->flist = NULL;
+ ip->smart = NULL;
+ ip->shaky = 0;
+ soap_strcpy((char*)ip->id, l + 1, id);
h = soap_hash(id); /* h = (HASH(id) % SOAP_IDHASH) so soap->iht[h] is safe */
ip->next = soap->iht[h];
soap->iht[h] = ip;
@@ -7631,14 +8430,13 @@ soap_enter(struct soap *soap, const char *id)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void*
SOAP_FMAC2
soap_malloc(struct soap *soap, size_t n)
-{ register char *p;
- if (!n)
- return (void*)SOAP_NON_NULL;
+{ char *p;
if (!soap)
return SOAP_MALLOC(soap, n);
if (soap->fmalloc)
@@ -7646,38 +8444,40 @@ soap_malloc(struct soap *soap, size_t n)
else
{ n += sizeof(short);
n += (-(long)n) & (sizeof(void*)-1); /* align at 4-, 8- or 16-byte boundary */
- if (!(p = (char*)SOAP_MALLOC(soap, n + sizeof(void*) + sizeof(size_t))))
+ p = (char*)SOAP_MALLOC(soap, n + sizeof(void*) + sizeof(size_t));
+ if (!p)
{ soap->error = SOAP_EOM;
return NULL;
}
- /* set the canary to detect corruption */
+ /* set a canary word to detect memory overruns and data corruption */
*(unsigned short*)(p + n - sizeof(unsigned short)) = (unsigned short)SOAP_CANARY;
/* keep chain of alloced cells for destruction */
*(void**)(p + n) = soap->alist;
*(size_t*)(p + n + sizeof(void*)) = n;
soap->alist = p + n;
}
- soap->alloced = 1;
return p;
}
#endif
/******************************************************************************/
+
#ifdef SOAP_MEM_DEBUG
static void
soap_init_mht(struct soap *soap)
-{ register int i;
+{ int i;
for (i = 0; i < (int)SOAP_PTRHASH; i++)
soap->mht[i] = NULL;
}
#endif
/******************************************************************************/
+
#ifdef SOAP_MEM_DEBUG
static void
soap_free_mht(struct soap *soap)
-{ register int i;
- register struct soap_mlist *mp, *mq;
+{ int i;
+ struct soap_mlist *mp, *mq;
for (i = 0; i < (int)SOAP_PTRHASH; i++)
{ for (mp = soap->mht[i]; mp; mp = mq)
{ mq = mp->next;
@@ -7691,15 +8491,16 @@ soap_free_mht(struct soap *soap)
#endif
/******************************************************************************/
+
#ifdef SOAP_MEM_DEBUG
SOAP_FMAC1
void*
SOAP_FMAC2
soap_track_malloc(struct soap *soap, const char *file, int line, size_t size)
-{ register void *p = malloc(size);
+{ void *p = malloc(size);
if (soap)
- { register size_t h = soap_hash_ptr(p);
- register struct soap_mlist *mp = (struct soap_mlist*)malloc(sizeof(struct soap_mlist));
+ { size_t h = soap_hash_ptr(p);
+ struct soap_mlist *mp = (struct soap_mlist*)malloc(sizeof(struct soap_mlist));
if (soap->fdebug[SOAP_INDEX_TEST])
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): malloc(%lu) = %p\n", file, line, (unsigned long)size, p));
}
@@ -7715,38 +8516,44 @@ soap_track_malloc(struct soap *soap, const char *file, int line, size_t size)
#endif
/******************************************************************************/
+
#ifdef SOAP_MEM_DEBUG
SOAP_FMAC1
void
SOAP_FMAC2
soap_track_free(struct soap *soap, const char *file, int line, void *p)
-{ register size_t h = soap_hash_ptr(p);
- register struct soap_mlist *mp;
- for (mp = soap->mht[h]; mp; mp = mp->next)
- if (mp->ptr == p)
- break;
- if (mp)
- { if (mp->live)
- { free(p);
- if (soap->fdebug[SOAP_INDEX_TEST])
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): free(%p)\n", file, line, p));
+{ if (!soap)
+ free(p);
+ else
+ { size_t h = soap_hash_ptr(p);
+ struct soap_mlist *mp;
+ for (mp = soap->mht[h]; mp; mp = mp->next)
+ if (mp->ptr == p)
+ break;
+ if (mp)
+ { if (mp->live)
+ { if (soap->fdebug[SOAP_INDEX_TEST])
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): free(%p)\n", file, line, p));
+ }
+ free(p);
+ mp->live = 0;
}
- mp->live = 0;
+ else
+ fprintf(stderr, "%s(%d): free(%p) double free of pointer malloced at %s(%d)\n", file, line, p, mp->file, mp->line);
}
else
- fprintf(stderr, "%s(%d): free(%p) double free of pointer malloced at %s(%d)\n", file, line, p, mp->file, mp->line);
+ fprintf(stderr, "%s(%d): free(%p) pointer not malloced\n", file, line, p);
}
- else
- fprintf(stderr, "%s(%d): free(%p) pointer not malloced\n", file, line, p);
}
#endif
/******************************************************************************/
+
#ifdef SOAP_MEM_DEBUG
static void
soap_track_unlink(struct soap *soap, const void *p)
-{ register size_t h = soap_hash_ptr(p);
- register struct soap_mlist *mp;
+{ size_t h = soap_hash_ptr(p);
+ struct soap_mlist *mp;
for (mp = soap->mht[h]; mp; mp = mp->next)
if (mp->ptr == p)
break;
@@ -7756,6 +8563,7 @@ soap_track_unlink(struct soap *soap, const void *p)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void
@@ -7764,8 +8572,8 @@ soap_dealloc(struct soap *soap, void *p)
{ if (soap_check_state(soap))
return;
if (p)
- { register char **q;
- for (q = (char**)&soap->alist; *q; q = *(char***)q)
+ { char **q;
+ for (q = (char**)(void*)&soap->alist; *q; q = *(char***)q)
{
if (*(unsigned short*)(char*)(*q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY)
{
@@ -7788,7 +8596,7 @@ soap_dealloc(struct soap *soap, void *p)
soap_delete(soap, p);
}
else
- { register char *q;
+ { char *q;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free all soap_malloc() data\n"));
while (soap->alist)
{ q = (char*)soap->alist;
@@ -7807,7 +8615,7 @@ soap_dealloc(struct soap *soap, void *p)
q -= *(size_t*)(q + sizeof(void*));
SOAP_FREE(soap, q);
}
- /* we must assume these were deallocated: */
+ /* assume these were deallocated: */
soap->http_content = NULL;
soap->action = NULL;
soap->fault = NULL;
@@ -7826,19 +8634,20 @@ soap_dealloc(struct soap *soap, void *p)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void
SOAP_FMAC2
soap_delete(struct soap *soap, void *p)
-{ register struct soap_clist **cp;
+{ struct soap_clist **cp;
if (soap_check_state(soap))
return;
cp = &soap->clist;
if (p)
{ while (*cp)
{ if (p == (*cp)->ptr)
- { register struct soap_clist *q = *cp;
+ { struct soap_clist *q = *cp;
*cp = q->next;
if (q->fdelete(q))
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: deletion callback failed for object type %d\n", q->ptr, q->type));
@@ -7855,8 +8664,9 @@ soap_delete(struct soap *soap, void *p)
}
else
{ while (*cp)
- { register struct soap_clist *q = *cp;
+ { struct soap_clist *q = *cp;
*cp = q->next;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Delete %p type=%d (cp=%p)\n", q->ptr, q->type, q));
if (q->fdelete(q))
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: deletion callback failed for object type %d\n", q->ptr, q->type));
#ifdef SOAP_MEM_DEBUG
@@ -7866,25 +8676,26 @@ soap_delete(struct soap *soap, void *p)
SOAP_FREE(soap, q);
}
}
- soap->fault = NULL; /* this was possibly deallocated */
- soap->header = NULL; /* this was possibly deallocated */
+ soap->fault = NULL; /* assume this was deallocated */
+ soap->header = NULL; /* assume this was deallocated */
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void
SOAP_FMAC2
soap_delegate_deletion(struct soap *soap, struct soap *soap_to)
-{ register struct soap_clist *cp;
- register char **q;
+{ struct soap_clist *cp;
+ char **q;
#ifdef SOAP_MEM_DEBUG
- register void *p;
- register struct soap_mlist **mp, *mq;
+ void *p;
+ struct soap_mlist **mp, *mq;
size_t h;
#endif
- for (q = (char**)&soap->alist; *q; q = *(char***)q)
+ for (q = (char**)(void*)&soap->alist; *q; q = *(char***)q)
{
if (*(unsigned short*)(char*)(*q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY)
{
@@ -7943,41 +8754,51 @@ soap_delegate_deletion(struct soap *soap, struct soap *soap_to)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
struct soap_clist *
SOAP_FMAC2
soap_link(struct soap *soap, void *p, int t, int n, int (*fdelete)(struct soap_clist*))
-{ register struct soap_clist *cp;
- if ((cp = (struct soap_clist*)SOAP_MALLOC(soap, sizeof(struct soap_clist))))
- { cp->next = soap->clist;
- cp->type = t;
- cp->size = n;
- cp->ptr = p;
- cp->fdelete = fdelete;
- soap->clist = cp;
+{ struct soap_clist *cp = NULL;
+ if (soap)
+ { if (p && n != SOAP_NO_LINK_TO_DELETE)
+ { cp = (struct soap_clist*)SOAP_MALLOC(soap, sizeof(struct soap_clist));
+ if (!cp)
+ soap->error = SOAP_EOM;
+ else
+ { cp->next = soap->clist;
+ cp->type = t;
+ cp->size = n;
+ cp->ptr = p;
+ cp->fdelete = fdelete;
+ soap->clist = cp;
+ }
+ }
+ soap->alloced = t;
}
return cp;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_unlink(struct soap *soap, const void *p)
-{ register char **q;
- register struct soap_clist **cp;
+{ char **q;
+ struct soap_clist **cp;
if (soap && p)
- { for (q = (char**)&soap->alist; *q; q = *(char***)q)
+ { for (q = (char**)(void*)&soap->alist; *q; q = *(char***)q)
{ if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*))))
{ *q = **(char***)q;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked data %p\n", p));
#ifdef SOAP_MEM_DEBUG
soap_track_unlink(soap, p);
#endif
- return SOAP_OK; /* found and removed from dealloc chain */
+ return SOAP_OK; /* found and removed from dealloc chain */
}
}
for (cp = &soap->clist; *cp; cp = &(*cp)->next)
@@ -7986,7 +8807,7 @@ soap_unlink(struct soap *soap, const void *p)
q = (char**)*cp;
*cp = (*cp)->next;
SOAP_FREE(soap, q);
- return SOAP_OK; /* found and removed from dealloc chain */
+ return SOAP_OK; /* found and removed from dealloc chain */
}
}
}
@@ -7995,13 +8816,14 @@ soap_unlink(struct soap *soap, const void *p)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_lookup_type(struct soap *soap, const char *id)
-{ register struct soap_ilist *ip;
+{ struct soap_ilist *ip;
if (id && *id)
{ ip = soap_lookup(soap, id);
if (ip)
@@ -8016,87 +8838,119 @@ soap_lookup_type(struct soap *soap, const char *id)
#endif
/******************************************************************************/
+
+#ifndef WITH_NOIDREF
+#ifndef PALM_1
+SOAP_FMAC1
+short
+SOAP_FMAC2
+soap_begin_shaky(struct soap *soap)
+{ short f = soap->shaky;
+ soap->shaky = 1;
+ return f;
+}
+#endif
+#endif
+
+/******************************************************************************/
+
+#ifndef WITH_NOIDREF
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_end_shaky(struct soap *soap, short f)
+{ soap->shaky = f;
+}
+#endif
+#endif
+
+/******************************************************************************/
+
+#ifndef WITH_NOIDREF
+static int
+soap_is_shaky(struct soap *soap, void *p)
+{ (void)p;
+ if (!soap->blist && !soap->shaky)
+ return 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Shaky %p\n", p));
+ return 1;
+}
+#endif
+
+/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
void*
SOAP_FMAC2
-soap_id_lookup(struct soap *soap, const char *id, void **p, int t, size_t n, unsigned int k)
+soap_id_lookup(struct soap *soap, const char *id, void **p, int t, size_t n, unsigned int k, int (*fbase)(int, int))
{ struct soap_ilist *ip;
- void **q;
if (!p || !id || !*id)
return p;
ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */
if (!ip)
- { if (!(ip = soap_enter(soap, id))) /* new hash table entry for string id */
+ { ip = soap_enter(soap, id, t, n); /* new hash table entry for string id */
+ if (!ip)
return NULL;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding first href='%s' type=%d %p (%u bytes)\n", id, t, p, (unsigned int)n));
- ip->type = t;
- ip->size = n;
- ip->link = p;
- ip->copy = NULL;
- ip->flist = NULL;
- ip->ptr = NULL;
- ip->level = k;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding first href='%s' type=%d location=%p (%u bytes) level=%u\n", id, t, p, (unsigned int)n, k));
*p = NULL;
- }
- else if (ip->ptr)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolved href='%s' type=%d location=%p (%u bytes)\n", id, t, ip->ptr, (unsigned int)n));
- if (ip->type != t)
- { strcpy(soap->id, id);
- soap->error = SOAP_HREF;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Type incompatibility: href='%s' id-type=%d href-type=%d\n", id, ip->type, t));
- return NULL;
- }
- while (ip->level < k)
- { q = (void**)soap_malloc(soap, sizeof(void*));
- if (!q)
+ if (k)
+ { int i;
+ if (k > SOAP_MAXPTRS)
return NULL;
- *p = (void*)q;
- p = q;
- k--;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level...\n"));
+ ip->spine = (void**)soap_malloc(soap, SOAP_MAXPTRS * sizeof(void*));
+ if (!ip->spine)
+ return NULL;
+ ip->spine[0] = NULL;
+ for (i = 1; i < SOAP_MAXPTRS; i++)
+ ip->spine[i] = &ip->spine[i - 1];
+ *p = &ip->spine[k - 1];
+ }
+ else
+ { ip->link = p;
+ ip->shaky = soap_is_shaky(soap, (void*)p);
}
+ }
+ else if (ip->type != t && (!fbase || !fbase(ip->type, t)) && (!fbase || !fbase(t, ip->type) || soap_type_punned(soap, ip)))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup type incompatibility: ref='%s' id-type=%d ref-type=%d\n", id, ip->type, t));
+ (void)soap_id_nullify(soap, id);
+ return NULL;
+ }
+ else if (k == 0 && ip->ptr && !ip->shaky) /* when block lists are in use, ip->ptr will change */
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolved href='%s' type=%d location=%p (%u bytes) level=%u\n", id, t, ip->ptr, (unsigned int)n, k));
*p = ip->ptr;
}
- else if (ip->level > k)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving level %u pointers to href='%s'\n", ip->level, id));
- while (ip->level > k)
- { void *s, **r = &ip->link;
- q = (void**)ip->link;
- while (q)
- { *r = (void*)soap_malloc(soap, sizeof(void*));
- if (!*r)
+ else
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarded href='%s' type=%d location=%p (%u bytes) level=%u\n", id, t, p, (unsigned int)n, k));
+ if (fbase && fbase(t, ip->type) && !soap_type_punned(soap, ip))
+ { ip->type = t;
+ ip->size = n;
+ }
+ *p = NULL;
+ if (k)
+ { if (!ip->spine)
+ { int i;
+ if (k > SOAP_MAXPTRS)
+ return NULL;
+ ip->spine = (void**)soap_malloc(soap, SOAP_MAXPTRS * sizeof(void*));
+ if (!ip->spine)
return NULL;
- s = *q;
- *q = *r;
- r = (void**)*r;
- q = (void**)s;
+ ip->spine[0] = NULL;
+ for (i = 1; i < SOAP_MAXPTRS; i++)
+ ip->spine[i] = &ip->spine[i - 1];
}
- *r = NULL;
- ip->size = n;
- ip->copy = NULL;
- ip->level = ip->level - 1;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level...\n"));
+ *p = &ip->spine[k - 1];
+ if (ip->ptr && !ip->shaky)
+ ip->spine[0] = ip->ptr;
}
- q = (void**)ip->link;
- ip->link = p;
- *p = (void*)q;
- }
- else
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarded href='%s' type=%d location=%p (%u bytes)\n", id, t, p, (unsigned int)n));
- while (ip->level < k)
- { q = (void**)soap_malloc(soap, sizeof(void*));
- if (!q)
- return NULL;
+ else
+ { void *q = ip->link;
+ ip->link = p;
+ ip->shaky = soap_is_shaky(soap, (void*)p);
*p = q;
- p = q;
- k--;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level...\n"));
}
- q = (void**)ip->link;
- ip->link = p;
- *p = (void*)q;
}
return p;
}
@@ -8104,81 +8958,87 @@ soap_id_lookup(struct soap *soap, const char *id, void **p, int t, size_t n, uns
#endif
/******************************************************************************/
+
#ifndef WITH_NOIDREF
#ifndef PALM_2
SOAP_FMAC1
void*
SOAP_FMAC2
-soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void (*fcopy)(struct soap*, int, int, void*, size_t, const void*, size_t))
+soap_id_forward(struct soap *soap, const char *href, void *p, size_t i, int t, int tt, size_t n, unsigned int k, void (*finsert)(struct soap*, int, int, void*, size_t, const void*, void**), int (*fbase)(int, int))
{ struct soap_ilist *ip;
if (!p || !href || !*href)
return p;
ip = soap_lookup(soap, href); /* lookup pointer to hash table entry for string id */
if (!ip)
- { if (!(ip = soap_enter(soap, href))) /* new hash table entry for string id */
+ { ip = soap_enter(soap, href, t, n); /* new hash table entry for string id */
+ if (!ip)
return NULL;
- ip->type = st;
- ip->size = n;
- ip->link = NULL;
- ip->copy = NULL;
- ip->ptr = NULL;
- ip->level = 0;
- ip->flist = NULL;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "New entry href='%s' type=%d size=%lu level=%d location=%p\n", href, st, (unsigned long)n, k, p));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New entry href='%s' type=%d size=%lu level=%d location=%p\n", href, t, (unsigned long)n, k, p));
}
- else if (ip->type != st || (ip->level == k && ip->size != n))
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", href, ip->type, (unsigned long)ip->size, k, st, (unsigned long)n));
- strcpy(soap->id, href);
- soap->error = SOAP_HREF;
+ else if ((ip->type != t || ip->size != n) && k == 0)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forward type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", href, ip->type, (unsigned long)ip->size, k, t, (unsigned long)n));
+ (void)soap_id_nullify(soap, href);
return NULL;
}
- if (fcopy || n < sizeof(void*) || *href != '#')
- { register struct soap_flist *fp = (struct soap_flist*)SOAP_MALLOC(soap, sizeof(struct soap_flist));
+ if (finsert || n < sizeof(void*))
+ { struct soap_flist *fp = (struct soap_flist*)SOAP_MALLOC(soap, sizeof(struct soap_flist));
if (!fp)
{ soap->error = SOAP_EOM;
return NULL;
}
+ if (fbase && fbase(t, ip->type) && !soap_type_punned(soap, ip))
+ { ip->type = t;
+ ip->size = n;
+ }
+ if ((ip->type != t || ip->size != n) && (!fbase || !fbase(ip->type, t)))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forward type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", href, ip->type, (unsigned long)ip->size, k, t, (unsigned long)n));
+ SOAP_FREE(soap, fp);
+ (void)soap_id_nullify(soap, href);
+ return NULL;
+ }
fp->next = ip->flist;
fp->type = tt;
fp->ptr = p;
fp->level = k;
- fp->len = len;
- if (fcopy)
- fp->fcopy = fcopy;
- else
- fp->fcopy = soap_fcopy;
+ fp->index = i;
+ fp->finsert = finsert;
ip->flist = fp;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding type=%d (target type=%d) size=%lu location=%p level=%u len=%lu href='%s'\n", st, tt, (unsigned long)n, p, k, (unsigned long)len, href));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding type=%d (target type=%d) size=%lu location=%p level=%u index=%lu href='%s'\n", t, tt, (unsigned long)n, p, k, (unsigned long)i, href));
}
else
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding copying address %p for type=%d href='%s'\n", p, st, href));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding copying address %p for type=%d href='%s'\n", p, t, href));
*(void**)p = ip->copy;
ip->copy = p;
}
+ ip->shaky = soap_is_shaky(soap, p);
return p;
}
#endif
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void*
SOAP_FMAC2
-soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap*, int, const char*, const char*, size_t*))
+soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, const char *type, const char *arrayType, void *(*finstantiate)(struct soap*, int, const char*, const char*, size_t*), int (*fbase)(int, int))
{
#ifndef WITH_NOIDREF
struct soap_ilist *ip;
#endif
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Enter id='%s' type=%d loc=%p size=%lu level=%u\n", id, t, p, (unsigned long)n, k));
+ (void)id; (void)fbase;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enter id='%s' type=%d location=%p size=%lu\n", id, t, p, (unsigned long)n));
soap->alloced = 0;
if (!p)
{ if (finstantiate)
- p = finstantiate(soap, t, type, arrayType, &n);
+ { p = finstantiate(soap, t, type, arrayType, &n); /* soap->alloced is set in soap_link() */
+ t = soap->alloced;
+ }
else
- p = soap_malloc(soap, n);
- if (p)
- soap->alloced = 1;
+ { p = soap_malloc(soap, n);
+ soap->alloced = t;
+ }
}
#ifndef WITH_NOIDREF
if (!id || !*id)
@@ -8186,36 +9046,48 @@ soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsig
return p;
#ifndef WITH_NOIDREF
ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Lookup entry id='%s for location=%p'\n", id, p));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup entry id='%s' for location=%p type=%d\n", id, p, t));
if (!ip)
- { if (!(ip = soap_enter(soap, id))) /* new hash table entry for string id */
+ { ip = soap_enter(soap, id, t, n); /* new hash table entry for string id */
+ if (!ip)
return NULL;
- ip->type = t;
- ip->link = NULL;
- ip->copy = NULL;
- ip->flist = NULL;
- ip->size = n;
ip->ptr = p;
- ip->level = k;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "New entry id='%s' type=%d size=%lu level=%u location=%p\n", id, t, (unsigned long)n, k, p));
- }
- else if ((ip->type != t || (ip->level == k && ip->size != n)) && (ip->copy || ip->flist))
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", id, ip->type, (unsigned long)ip->size, k, t, (unsigned long)n));
- strcpy(soap->id, id);
- soap->error = SOAP_HREF;
- return NULL;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New entry id='%s' type=%d size=%lu location=%p\n", id, t, (unsigned long)n, p));
+ if (!soap->alloced)
+ ip->shaky = soap_is_shaky(soap, p);
}
else if (ip->ptr)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Multiply defined id='%s'\n", id));
- strcpy(soap->id, id);
+ soap_strcpy(soap->id, sizeof(soap->id), id);
soap->error = SOAP_DUPLICATE_ID;
return NULL;
}
+ else if ((ip->type != t && (!fbase || !fbase(t, ip->type) || soap_type_punned(soap, ip)))
+ || (ip->type == t && ip->size != n && soap_type_punned(soap, ip)))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enter type incompatibility id='%s' expect type=%d size=%lu got type=%d size=%lu\n", id, ip->type, (unsigned long)ip->size, t, (unsigned long)n));
+ (void)soap_id_nullify(soap, id);
+ return NULL;
+ }
else
- { ip->size = n;
+ { ip->type = t;
+ ip->size = n;
ip->ptr = p;
- ip->level = k;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update entry id='%s' type=%d location=%p size=%lu level=%u\n", id, t, p, (unsigned long)n, k));
+ if (!soap->alloced)
+ ip->shaky = soap_is_shaky(soap, p);
+ if (soap->alloced || !ip->shaky)
+ { void **q; /* ptr will not change later, so resolve links now */
+ if (ip->spine)
+ ip->spine[0] = p;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Traversing link chain to resolve id='%s' type=%d\n", ip->id, ip->type));
+ q = (void**)ip->link;
+ while (q)
+ { void *r = *q;
+ *q = p;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... link %p -> %p\n", q, p));
+ q = (void**)r;
+ }
+ ip->link = NULL;
+ }
}
return ip->ptr;
#endif
@@ -8223,18 +9095,75 @@ soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsig
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
-void
+void**
SOAP_FMAC2
-soap_fcopy(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
-{ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Copying data type=%d (target type=%d) %p -> %p (%lu bytes)\n", st, tt, q, p, (unsigned long)n));
- memcpy(p, q, n);
- (void)soap; (void)st; (void)tt; (void)len;
+soap_id_smart(struct soap *soap, const char *id, int t, size_t n)
+{ (void)soap; (void)id; (void)t; (void)n;
+#ifndef WITH_NOIDREF
+ if (id && *id)
+ { struct soap_ilist *ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */
+ if (!ip)
+ { ip = soap_enter(soap, id, t, n); /* new hash table entry for string id */
+ if (!ip)
+ return NULL;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New smart shared pointer entry id='%s' type=%d size=%lu smart=%p\n", id, t, (unsigned long)n, ip->smart));
+ return &ip->smart;
+ }
+#endif
+ return NULL;
}
#endif
/******************************************************************************/
+
+#ifndef WITH_NOIDREF
+#ifndef PALM_2
+static int
+soap_type_punned(struct soap *soap, const struct soap_ilist *ip)
+{ const struct soap_flist *fp;
+ (void)soap;
+ if (ip->ptr || ip->copy)
+ return 1;
+ for (fp = ip->flist; fp; fp = fp->next)
+ if (fp->level == 0)
+ return 1;
+ return 0;
+}
+#endif
+#endif
+
+/******************************************************************************/
+
+#ifndef WITH_NOIDREF
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_id_nullify(struct soap *soap, const char *id)
+{ int i;
+ for (i = 0; i < SOAP_IDHASH; i++)
+ { struct soap_ilist *ip;
+ for (ip = soap->iht[i]; ip; ip = ip->next)
+ { void *p, *q;
+ for (p = ip->link; p; p = q)
+ { q = *(void**)p;
+ *(void**)p = NULL;
+ }
+ ip->link = NULL;
+ }
+ }
+ soap_strcpy(soap->id, sizeof(soap->id), id);
+ return soap->error = SOAP_HREF;
+}
+#endif
+#endif
+
+/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -8250,7 +9179,8 @@ soap_end_send(struct soap *soap)
soap->dime.list->next = NULL;
soap->dime.last = soap->dime.list;
}
- if (!(err = soap_putdime(soap)))
+ err = soap_putdime(soap);
+ if (!err)
err = soap_putmime(soap);
soap->mime.list = NULL;
soap->mime.first = NULL;
@@ -8266,6 +9196,7 @@ soap_end_send(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -8285,20 +9216,20 @@ soap_end_send_flush(struct soap *soap)
return soap->error;
#endif
#ifdef WITH_ZLIB
- if (soap->mode & SOAP_ENC_ZLIB)
+ if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream)
{ int r;
soap->d_stream->avail_in = 0;
do
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflating remainder\n"));
r = deflate(soap->d_stream, Z_FINISH);
- if (soap->d_stream->avail_out != SOAP_BUFLEN)
- { if (soap_flush_raw(soap, soap->z_buf, SOAP_BUFLEN - soap->d_stream->avail_out))
+ if (soap->d_stream->avail_out != sizeof(soap->buf))
+ { if (soap_flush_raw(soap, soap->z_buf, sizeof(soap->buf) - soap->d_stream->avail_out))
{ soap->zlib_state = SOAP_ZLIB_NONE;
deflateEnd(soap->d_stream);
return soap->error;
}
soap->d_stream->next_out = (Byte*)soap->z_buf;
- soap->d_stream->avail_out = SOAP_BUFLEN;
+ soap->d_stream->avail_out = sizeof(soap->buf);
}
} while (r == Z_OK);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflated total %lu->%lu bytes\n", soap->d_stream->total_in, soap->d_stream->total_out));
@@ -8327,49 +9258,65 @@ soap_end_send_flush(struct soap *soap)
}
#endif
if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
- { char *p;
-#ifndef WITH_NOHTTP
- if (!(soap->mode & SOAP_ENC_XML))
- { soap->mode--;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending buffered message of length %u\n", (unsigned int)soap->blist->size));
- if (soap->status >= SOAP_POST)
- soap->error = soap->fpost(soap, soap->endpoint, soap->host, soap->port, soap->path, soap->action, soap->blist->size);
- else if (soap->status != SOAP_STOP)
- soap->error = soap->fresponse(soap, soap->status, soap->blist->size);
- if (soap->error || soap_flush(soap))
- return soap->error;
- soap->mode++;
+ {
+#if !defined(__cplusplus) || defined(WITH_COMPAT)
+ if (soap->os)
+ { char *b = (char*)soap_push_block(soap, NULL, 1);
+ if (b)
+ *soap->os = soap_save_block(soap, NULL, NULL, 0);
}
+ else
#endif
- for (p = soap_first_block(soap, NULL); p; p = soap_next_block(soap, NULL))
- { DBGMSG(SENT, p, soap_block_size(soap, NULL));
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Send %u bytes to socket=%d/fd=%d\n", (unsigned int)soap_block_size(soap, NULL), soap->socket, soap->sendfd));
- if ((soap->error = soap->fsend(soap, p, soap_block_size(soap, NULL))))
- { soap_end_block(soap, NULL);
- return soap->error;
+ { char *p;
+#ifndef WITH_NOHTTP
+ if (!(soap->mode & SOAP_ENC_XML))
+ { soap->mode--;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending buffered message of length %u\n", (unsigned int)soap->blist->size));
+ if (soap->status >= SOAP_POST)
+ soap->error = soap->fpost(soap, soap->endpoint, soap->host, soap->port, soap->path, soap->action, soap->blist->size);
+ else if (soap->status != SOAP_STOP)
+ soap->error = soap->fresponse(soap, soap->status, soap->blist->size);
+ if (soap->error || soap_flush(soap))
+ return soap->error;
+ soap->mode++;
}
+#endif
+ for (p = soap_first_block(soap, NULL); p; p = soap_next_block(soap, NULL))
+ { DBGMSG(SENT, p, soap_block_size(soap, NULL));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Send %u bytes to socket=%d/fd=%d\n", (unsigned int)soap_block_size(soap, NULL), soap->socket, soap->sendfd));
+ soap->error = soap->fsend(soap, p, soap_block_size(soap, NULL));
+ if (soap->error)
+ { soap_end_block(soap, NULL);
+ return soap->error;
+ }
+ }
+ soap_end_block(soap, NULL);
}
- soap_end_block(soap, NULL);
- if (soap->fpreparefinalsend && (soap->error = soap->fpreparefinalsend(soap)))
+#ifndef WITH_LEANER
+ if (soap->fpreparefinalsend && (soap->error = soap->fpreparefinalsend(soap)) != SOAP_OK)
return soap->error;
+#endif
}
#ifndef WITH_LEANER
else if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
{ DBGMSG(SENT, "\r\n0\r\n\r\n", 7);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Send 7 bytes to socket=%d/fd=%d\n", soap->socket, soap->sendfd));
- if ((soap->error = soap->fsend(soap, "\r\n0\r\n\r\n", 7)))
+ soap->error = soap->fsend(soap, "\r\n0\r\n\r\n", 7);
+ if (soap->error)
return soap->error;
}
#endif
}
#ifdef WITH_TCPFIN
-#ifdef WITH_OPENSSL
- if (!soap->ssl && soap_valid_socket(soap->socket) && !soap->keep_alive && !(soap->omode & SOAP_IO_UDP))
- soap->fshutdownsocket(soap, soap->socket, SOAP_SHUT_WR); /* Send TCP FIN */
-#else
- if (soap_valid_socket(soap->socket) && !soap->keep_alive && !(soap->omode & SOAP_IO_UDP))
- soap->fshutdownsocket(soap, soap->socket, SOAP_SHUT_WR); /* Send TCP FIN */
+#if defined(WITH_OPENSSL) || defined(WITH_SYSTEMSSL)
+ if (!soap->ssl)
#endif
+ if (soap_valid_socket(soap->socket) && !soap->keep_alive && !(soap->omode & SOAP_IO_UDP))
+ soap->fshutdownsocket(soap, soap->socket, SOAP_SHUT_WR); /* Send TCP FIN */
+#endif
+#if defined(__cplusplus) && !defined(WITH_COMPAT)
+ if (soap->os)
+ soap->os->flush();
#endif
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of send phase\n"));
soap->omode &= ~SOAP_SEC_WSUID;
@@ -8380,6 +9327,7 @@ soap_end_send_flush(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -8387,8 +9335,9 @@ SOAP_FMAC2
soap_end_recv(struct soap *soap)
{ soap->part = SOAP_END;
#ifndef WITH_LEAN
- soap->wsuid = NULL; /* reset before next send */
- soap->c14nexclude = NULL; /* reset before next send */
+ soap->wsuid = NULL; /* reset before next send */
+ soap->c14nexclude = NULL; /* reset before next send */
+ soap->c14ninclude = NULL; /* reset before next send */
#endif
#ifndef WITH_LEANER
soap->ffilterrecv = NULL;
@@ -8403,7 +9352,7 @@ soap_end_recv(struct soap *soap)
/* Check if MIME attachments and mime-post-check flag is set, if so call soap_resolve() and return */
if (soap->mode & SOAP_ENC_MIME)
{ if (soap->mode & SOAP_MIME_POSTCHECK)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Post checking MIME attachments\n"));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Post checking MIME attachments\n"));
if (!soap->keep_alive)
soap->keep_alive = -1;
#ifndef WITH_NOIDREF
@@ -8424,39 +9373,39 @@ soap_end_recv(struct soap *soap)
soap_resolve_attachment(soap, content);
}
#endif
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "End of receive message ok\n"));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of receive message ok\n"));
#ifdef WITH_ZLIB
- if (soap->mode & SOAP_ENC_ZLIB)
+ if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream)
{ /* Make sure end of compressed content is reached */
while (soap->d_stream->next_out != Z_NULL)
if ((int)soap_get1(soap) == EOF)
break;
soap->mode &= ~SOAP_ENC_ZLIB;
- memcpy(soap->buf, soap->z_buf, SOAP_BUFLEN);
+ soap_memcpy((void*)soap->buf, sizeof(soap->buf), (const void*)soap->z_buf, sizeof(soap->buf));
soap->bufidx = (char*)soap->d_stream->next_in - soap->z_buf;
soap->buflen = soap->z_buflen;
soap->zlib_state = SOAP_ZLIB_NONE;
if (inflateEnd(soap->d_stream) != Z_OK)
return soap->error = SOAP_ZLIB_ERROR;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Inflate end ok\n"));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate end ok\n"));
#ifdef WITH_GZIP
if (soap->zlib_in == SOAP_ZLIB_GZIP)
{ soap_wchar c;
short i;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Inflate gzip crc check\n"));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate gzip crc check\n"));
for (i = 0; i < 8; i++)
{ if ((int)(c = soap_get1(soap)) == EOF)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Gzip error: unable to read crc value\n"));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip error: unable to read crc value\n"));
return soap->error = SOAP_ZLIB_ERROR;
}
soap->z_buf[i] = (char)c;
}
if (soap->z_crc != ((uLong)(unsigned char)soap->z_buf[0] | ((uLong)(unsigned char)soap->z_buf[1] << 8) | ((uLong)(unsigned char)soap->z_buf[2] << 16) | ((uLong)(unsigned char)soap->z_buf[3] << 24)))
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Gzip inflate error: crc check failed, message corrupted? (crc32=%lu)\n", (unsigned long)soap->z_crc));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip inflate error: crc check failed, message corrupted? (crc32=%lu)\n", (unsigned long)soap->z_crc));
return soap->error = SOAP_ZLIB_ERROR;
}
if (soap->d_stream->total_out != ((uLong)(unsigned char)soap->z_buf[4] | ((uLong)(unsigned char)soap->z_buf[5] << 8) | ((uLong)(unsigned char)soap->z_buf[6] << 16) | ((uLong)(unsigned char)soap->z_buf[7] << 24)))
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Gzip inflate error: incorrect message length\n"));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip inflate error: incorrect message length\n"));
return soap->error = SOAP_ZLIB_ERROR;
}
}
@@ -8466,7 +9415,7 @@ soap_end_recv(struct soap *soap)
#endif
if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
while (soap->ahead != EOF && !soap_recv_raw(soap))
- ;
+ continue;
#ifndef WITH_NOIDREF
if (soap_resolve(soap))
return soap->error;
@@ -8488,13 +9437,14 @@ soap_end_recv(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
SOAP_FMAC2
soap_free_temp(struct soap *soap)
-{ register struct soap_attribute *tp, *tq;
- register struct Namespace *ns;
+{ struct soap_attribute *tp, *tq;
+ struct Namespace *ns;
soap_free_ns(soap);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free any remaining temp blocks\n"));
while (soap->blist)
@@ -8533,17 +9483,18 @@ soap_free_temp(struct soap *soap)
}
#endif
#ifndef WITH_NOIDREF
- soap_free_pht(soap);
soap_free_iht(soap);
#endif
+ soap_free_pht(soap);
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
static void
soap_free_ns(struct soap *soap)
-{ register struct soap_nlist *np, *nq;
+{ struct soap_nlist *np, *nq;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free namespace stack\n"));
for (np = soap->nlist; np; np = nq)
{ nq = np->next;
@@ -8554,6 +9505,7 @@ soap_free_ns(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
#if !defined(WITH_LEAN) || defined(SOAP_DEBUG)
static void
@@ -8568,6 +9520,7 @@ soap_init_logs(struct soap *soap)
#endif
/******************************************************************************/
+
#if !defined(WITH_LEAN) || defined(SOAP_DEBUG)
SOAP_FMAC1
void
@@ -8579,6 +9532,7 @@ soap_open_logfile(struct soap *soap, int i)
#endif
/******************************************************************************/
+
#ifdef SOAP_DEBUG
static void
soap_close_logfile(struct soap *soap, int i)
@@ -8590,6 +9544,7 @@ soap_close_logfile(struct soap *soap, int i)
#endif
/******************************************************************************/
+
#ifdef SOAP_DEBUG
SOAP_FMAC1
void
@@ -8602,6 +9557,7 @@ soap_close_logfiles(struct soap *soap)
#endif
/******************************************************************************/
+
#ifdef SOAP_DEBUG
static void
soap_set_logfile(struct soap *soap, int i, const char *logfile)
@@ -8611,58 +9567,73 @@ soap_set_logfile(struct soap *soap, int i, const char *logfile)
s = soap->logfile[i];
soap->logfile[i] = logfile;
if (s)
- SOAP_FREE(soap, (void*)s);
+ SOAP_FREE(soap, s);
if (logfile)
- if ((t = (char*)SOAP_MALLOC(soap, strlen(logfile) + 1)))
- strcpy(t, logfile);
+ { size_t l = strlen(logfile) + 1;
+ t = (char*)SOAP_MALLOC(soap, l);
+ if (t)
+ soap_memcpy((void*)t, l, (const void*)logfile, l);
+ }
soap->logfile[i] = t;
}
#endif
/******************************************************************************/
+
SOAP_FMAC1
void
SOAP_FMAC2
soap_set_recv_logfile(struct soap *soap, const char *logfile)
{
+ (void)soap; (void)logfile;
#ifdef SOAP_DEBUG
soap_set_logfile(soap, SOAP_INDEX_RECV, logfile);
#endif
}
/******************************************************************************/
+
SOAP_FMAC1
void
SOAP_FMAC2
soap_set_sent_logfile(struct soap *soap, const char *logfile)
{
+ (void)soap; (void)logfile;
#ifdef SOAP_DEBUG
soap_set_logfile(soap, SOAP_INDEX_SENT, logfile);
#endif
}
/******************************************************************************/
+
SOAP_FMAC1
void
SOAP_FMAC2
soap_set_test_logfile(struct soap *soap, const char *logfile)
{
+ (void)soap; (void)logfile;
#ifdef SOAP_DEBUG
soap_set_logfile(soap, SOAP_INDEX_TEST, logfile);
#endif
}
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
struct soap*
SOAP_FMAC2
soap_copy(const struct soap *soap)
-{ return soap_copy_context((struct soap*)malloc(sizeof(struct soap)), soap);
+{ struct soap *copy = soap_versioning(soap_new)(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
+ if (soap_copy_context(copy, soap) != NULL)
+ return copy;
+ soap_free(copy);
+ return NULL;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
struct soap*
@@ -8673,13 +9644,9 @@ soap_copy_context(struct soap *copy, const struct soap *soap)
if (soap_check_state(soap))
return NULL;
if (copy)
- { register struct soap_plugin *p = NULL;
+ { struct soap_plugin *p = NULL;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying context\n"));
-#ifdef __cplusplus
- *copy = *soap;
-#else
- memcpy(copy, soap, sizeof(struct soap));
-#endif
+ soap_memcpy((void*)copy, sizeof(struct soap), (const void*)soap, sizeof(struct soap));
copy->state = SOAP_COPY;
copy->error = SOAP_OK;
copy->userid = NULL;
@@ -8710,15 +9677,7 @@ soap_copy_context(struct soap *copy, const struct soap *soap)
copy->local_namespaces = NULL;
soap_set_local_namespaces(copy); /* copy content of soap->local_namespaces */
copy->namespaces = soap->namespaces; /* point to shared read-only namespaces table */
-#ifdef WITH_C_LOCALE
-# ifdef WIN32
- copy->c_locale = _create_locale(LC_ALL, "C");
-# else
- copy->c_locale = duplocale(soap->c_locale);
-# endif
-#else
copy->c_locale = NULL;
-#endif
#ifdef WITH_OPENSSL
copy->bio = NULL;
copy->ssl = NULL;
@@ -8728,16 +9687,13 @@ soap_copy_context(struct soap *copy, const struct soap *soap)
copy->session = NULL;
#endif
#ifdef WITH_ZLIB
- copy->d_stream = (z_stream*)SOAP_MALLOC(copy, sizeof(z_stream));
- copy->d_stream->zalloc = Z_NULL;
- copy->d_stream->zfree = Z_NULL;
- copy->d_stream->opaque = Z_NULL;
+ copy->d_stream = NULL;
copy->z_buf = NULL;
#endif
#ifndef WITH_NOIDREF
soap_init_iht(copy);
- soap_init_pht(copy);
#endif
+ soap_init_pht(copy);
copy->header = NULL;
copy->fault = NULL;
copy->action = NULL;
@@ -8750,14 +9706,20 @@ soap_copy_context(struct soap *copy, const struct soap *soap)
#endif
copy->plugins = NULL;
for (p = soap->plugins; p; p = p->next)
- { register struct soap_plugin *q = (struct soap_plugin*)SOAP_MALLOC(copy, sizeof(struct soap_plugin));
+ { struct soap_plugin *q = (struct soap_plugin*)SOAP_MALLOC(copy, sizeof(struct soap_plugin));
if (!q)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not allocate plugin '%s'\n", p->id));
+ soap_end(copy);
+ soap_done(copy);
return NULL;
+ }
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying plugin '%s'\n", p->id));
*q = *p;
- if (p->fcopy && p->fcopy(copy, q, p))
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not copy plugin '%s'\n", p->id));
+ if (p->fcopy && (copy->error = p->fcopy(copy, q, p)) != SOAP_OK)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not copy plugin '%s' error = %d\n", p->id, copy->error));
SOAP_FREE(copy, q);
+ soap_end(copy);
+ soap_done(copy);
return NULL;
}
q->next = copy->plugins;
@@ -8769,6 +9731,7 @@ soap_copy_context(struct soap *copy, const struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
@@ -8787,10 +9750,20 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
copy->recvsk = soap->recvsk;
copy->recv_timeout = soap->recv_timeout;
copy->send_timeout = soap->send_timeout;
-#if defined(__cplusplus) && !defined(WITH_LEAN)
+ copy->connect_timeout = soap->connect_timeout;
+ copy->accept_timeout = soap->accept_timeout;
+ copy->socket_flags = soap->socket_flags;
+ copy->connect_flags = soap->connect_flags;
+ copy->bind_flags = soap->bind_flags;
+ copy->accept_flags = soap->accept_flags;
+ copy->sndbuf = soap->sndbuf;
+ copy->rcvbuf = soap->rcvbuf;
+ copy->linger_time = soap->linger_time;
+ copy->maxlevel = soap->maxlevel;
+ copy->maxlength = soap->maxlength;
+ copy->maxoccurs = soap->maxoccurs;
copy->os = soap->os;
copy->is = soap->is;
-#endif
copy->sendfd = soap->sendfd;
copy->recvfd = soap->recvfd;
copy->bufidx = soap->bufidx;
@@ -8810,8 +9783,8 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
copy->peerlen = soap->peerlen;
copy->ip = soap->ip;
copy->port = soap->port;
- memcpy(copy->host, soap->host, sizeof(soap->host));
- memcpy(copy->endpoint, soap->endpoint, sizeof(soap->endpoint));
+ soap_memcpy((void*)copy->host, sizeof(copy->host), (const void*)soap->host, sizeof(soap->host));
+ soap_memcpy((void*)copy->endpoint, sizeof(copy->endpoint), (const void*)soap->endpoint, sizeof(soap->endpoint));
#endif
#ifdef WITH_OPENSSL
copy->bio = soap->bio;
@@ -8821,14 +9794,20 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
#ifdef WITH_GNUTLS
copy->session = soap->session;
#endif
+#ifdef WITH_SYSTEMSSL
+ copy->ctx = soap->ctx;
+ copy->ssl = soap->ssl;
+#endif
#ifdef WITH_ZLIB
copy->zlib_state = soap->zlib_state;
copy->zlib_in = soap->zlib_in;
copy->zlib_out = soap->zlib_out;
- if (!copy->d_stream)
- copy->d_stream = (z_stream*)SOAP_MALLOC(copy, sizeof(z_stream));
- if (copy->d_stream)
- memcpy(copy->d_stream, soap->d_stream, sizeof(z_stream));
+ if (soap->d_stream && soap->zlib_state != SOAP_ZLIB_NONE)
+ { if (!copy->d_stream)
+ copy->d_stream = (z_stream*)SOAP_MALLOC(copy, sizeof(z_stream));
+ if (copy->d_stream)
+ soap_memcpy((void*)copy->d_stream, sizeof(z_stream), (const void*)soap->d_stream, sizeof(z_stream));
+ }
copy->z_crc = soap->z_crc;
copy->z_ratio_in = soap->z_ratio_in;
copy->z_ratio_out = soap->z_ratio_out;
@@ -8836,32 +9815,32 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
copy->z_buflen = soap->z_buflen;
copy->z_level = soap->z_level;
if (soap->z_buf && soap->zlib_state != SOAP_ZLIB_NONE)
- { copy->z_buf = (char*)SOAP_MALLOC(copy, SOAP_BUFLEN);
+ { copy->z_buf = (char*)SOAP_MALLOC(copy, sizeof(soap->buf));
if (copy->z_buf)
- memcpy(copy->z_buf, soap->z_buf, SOAP_BUFLEN);
+ soap_memcpy((void*)copy->z_buf, sizeof(soap->buf), (const void*)soap->z_buf, sizeof(soap->buf));
}
copy->z_dict = soap->z_dict;
copy->z_dict_len = soap->z_dict_len;
#endif
- memcpy(copy->buf, soap->buf, sizeof(soap->buf));
+ soap_memcpy((void*)copy->buf, sizeof(copy->buf), (const void*)soap->buf, sizeof(soap->buf));
/* copy XML parser state */
soap_free_ns(copy);
soap_set_local_namespaces(copy);
copy->version = soap->version;
if (soap->nlist && soap->local_namespaces)
- { register struct soap_nlist *np = NULL, *nq;
+ { struct soap_nlist *np = NULL, *nq;
/* copy reversed nlist */
for (nq = soap->nlist; nq; nq = nq->next)
- { register struct soap_nlist *nr = np;
+ { struct soap_nlist *nr = np;
size_t n = sizeof(struct soap_nlist) + strlen(nq->id);
np = (struct soap_nlist*)SOAP_MALLOC(copy, n);
if (!np)
break;
- memcpy(np, nq, n);
+ soap_memcpy((void*)np, n, (const void*)nq, n);
np->next = nr;
}
while (np)
- { register const char *s = np->ns;
+ { const char *s = np->ns;
copy->level = np->level; /* preserve element nesting level */
if (!s && np->index >= 0)
{ s = soap->local_namespaces[np->index].out;
@@ -8875,10 +9854,10 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
SOAP_FREE(copy, nq);
}
}
- memcpy(copy->tag, soap->tag, sizeof(copy->tag));
- memcpy(copy->id, soap->id, sizeof(copy->id));
- memcpy(copy->href, soap->href, sizeof(copy->href));
- memcpy(copy->type, soap->type, sizeof(copy->type));
+ soap_memcpy((void*)copy->tag, sizeof(copy->tag), (const void*)soap->tag, sizeof(soap->tag));
+ soap_memcpy((void*)copy->id, sizeof(copy->id), (const void*)soap->id, sizeof(soap->id));
+ soap_memcpy((void*)copy->href, sizeof(copy->href), (const void*)soap->href, sizeof(soap->href));
+ soap_memcpy((void*)copy->type, sizeof(copy->type), (const void*)soap->type, sizeof(soap->type));
copy->other = soap->other;
copy->root = soap->root;
copy->null = soap->null;
@@ -8892,11 +9871,11 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
{ struct soap_attribute *tr = tp;
size_t n = sizeof(struct soap_attribute) + strlen(tq->name);
tp = (struct soap_attribute*)SOAP_MALLOC(copy, n);
- memcpy(tp, tq, n);
+ soap_memcpy((void*)tp, n, (const void*)tq, n);
if (tp->size)
{ tp->value = (char*)SOAP_MALLOC(copy, tp->size);
if (tp->value)
- strcpy(tp->value, tq->value);
+ soap_memcpy((void*)tp->value, tp->size, (const void*)tq->value, tp->size);
}
tp->ns = NULL;
tp->next = tr;
@@ -8906,6 +9885,7 @@ soap_copy_stream(struct soap *copy, struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
@@ -8927,6 +9907,10 @@ soap_free_stream(struct soap *soap)
soap->dh_params = NULL;
soap->rsa_params = NULL;
#endif
+#ifdef WITH_SYSTEMSSL
+ soap->ctx = (gsk_handle)NULL;
+ soap->ssl = (gsk_handle)NULL;
+#endif
#ifdef WITH_ZLIB
if (soap->z_buf)
SOAP_FREE(soap, soap->z_buf);
@@ -8936,6 +9920,7 @@ soap_free_stream(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
@@ -8946,6 +9931,7 @@ soap_initialize(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
@@ -8971,9 +9957,9 @@ soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
#endif
#endif
soap->version = 0;
- soap_mode(soap, imode);
- soap_imode(soap, imode);
- soap_omode(soap, omode);
+ soap->imode = imode;
+ soap->omode = omode;
+ soap->mode = imode;
soap->plugins = NULL;
soap->user = NULL;
for (i = 0; i < sizeof(soap->data)/sizeof(*soap->data); i++)
@@ -9028,6 +10014,8 @@ soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
soap->fplugin = fplugin;
soap->fmalloc = NULL;
#ifndef WITH_LEANER
+ soap->fsvalidate = NULL;
+ soap->fwvalidate = NULL;
soap->feltbegin = NULL;
soap->feltendin = NULL;
soap->feltbegout = NULL;
@@ -9055,7 +10043,27 @@ soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
#endif
soap->float_format = "%.9G"; /* Alternative: use "%G" */
soap->double_format = "%.17lG"; /* Alternative: use "%lG" */
- soap->dime_id_format = "cid:id%d"; /* default DIME id format */
+ soap->long_double_format = NULL; /* Defined in custom serializer custom/long_double.c */
+ soap->dime_id_format = "cid:id%d"; /* default DIME id format for int id index */
+ soap->recv_timeout = 0;
+ soap->send_timeout = 0;
+ soap->connect_timeout = 0;
+ soap->accept_timeout = 0;
+ soap->socket_flags = 0;
+ soap->connect_flags = 0;
+ soap->bind_flags = 0;
+ soap->accept_flags = 0;
+#ifdef WIN32
+ soap->sndbuf = SOAP_BUFLEN + 1; /* this size speeds up windows xfer */
+ soap->rcvbuf = SOAP_BUFLEN + 1;
+#else
+ soap->sndbuf = SOAP_BUFLEN;
+ soap->rcvbuf = SOAP_BUFLEN;
+#endif
+ soap->linger_time = 0;
+ soap->maxlevel = SOAP_MAXLEVEL;
+ soap->maxlength = SOAP_MAXLENGTH;
+ soap->maxoccurs = SOAP_MAXOCCURS;
soap->http_version = "1.1";
soap->proxy_http_version = "1.0";
soap->http_content = NULL;
@@ -9067,15 +10075,6 @@ soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
soap->tcp_keep_intvl = 0;
soap->tcp_keep_cnt = 0;
soap->max_keep_alive = SOAP_MAXKEEPALIVE;
- soap->recv_timeout = 0;
- soap->send_timeout = 0;
- soap->connect_timeout = 0;
- soap->accept_timeout = 0;
- soap->socket_flags = 0;
- soap->connect_flags = 0;
- soap->bind_flags = 0;
- soap->accept_flags = 0;
- soap->linger_time = 0;
soap->ip = 0;
soap->labbuf = NULL;
soap->lablen = 0;
@@ -9091,6 +10090,7 @@ soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
soap->blist = NULL;
soap->clist = NULL;
soap->alist = NULL;
+ soap->shaky = 0;
soap->attributes = NULL;
soap->header = NULL;
soap->fault = NULL;
@@ -9120,21 +10120,19 @@ soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
soap->sendfd = stdout;
#endif
soap->host[0] = '\0';
+ soap->path[0] = '\0';
soap->port = 0;
soap->action = NULL;
soap->proxy_host = NULL;
soap->proxy_port = 8080;
soap->proxy_userid = NULL;
soap->proxy_passwd = NULL;
- soap->prolog = NULL;
+ soap->prolog = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
#ifdef WITH_ZLIB
soap->zlib_state = SOAP_ZLIB_NONE;
soap->zlib_in = SOAP_ZLIB_NONE;
soap->zlib_out = SOAP_ZLIB_NONE;
- soap->d_stream = (z_stream*)SOAP_MALLOC(soap, sizeof(z_stream));
- soap->d_stream->zalloc = Z_NULL;
- soap->d_stream->zfree = Z_NULL;
- soap->d_stream->opaque = Z_NULL;
+ soap->d_stream = NULL;
soap->z_buf = NULL;
soap->z_level = 6;
soap->z_dict = NULL;
@@ -9143,6 +10141,7 @@ soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
#ifndef WITH_LEAN
soap->wsuid = NULL;
soap->c14nexclude = NULL;
+ soap->c14ninclude = NULL;
soap->cookies = NULL;
soap->cookie_domain = NULL;
soap->cookie_path = NULL;
@@ -9156,13 +10155,13 @@ soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
#endif
#ifndef WITH_NOIDREF
soap_init_iht(soap);
- soap_init_pht(soap);
#endif
+ soap_init_pht(soap);
#ifdef WITH_OPENSSL
if (!soap_ssl_init_done)
soap_ssl_init();
soap->fsslauth = ssl_auth_init;
- soap->fsslverify = ssl_verify_callback;
+ soap->fsslverify = NULL;
soap->bio = NULL;
soap->ssl = NULL;
soap->ctx = NULL;
@@ -9196,15 +10195,24 @@ soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
soap->dh_params = NULL;
soap->rsa_params = NULL;
#endif
-#ifdef WITH_C_LOCALE
-# ifdef WIN32
- soap->c_locale = _create_locale(LC_ALL, "C");
-# else
- soap->c_locale = newlocale(LC_ALL_MASK, "C", NULL);
-# endif
-#else
- soap->c_locale = NULL;
+#ifdef WITH_SYSTEMSSL
+ soap->fsslauth = ssl_auth_init;
+ soap->fsslverify = NULL;
+ soap->bio = NULL;
+ soap->ssl = (gsk_handle)NULL;
+ soap->ctx = (gsk_handle)NULL;
+ soap->session = NULL;
+ soap->ssl_flags = SOAP_SSL_DEFAULT;
+ soap->keyfile = NULL;
+ soap->keyid = NULL;
+ soap->password = NULL;
+ soap->cafile = NULL;
+ soap->capath = NULL;
+ soap->crlfile = NULL;
+ soap->dhfile = NULL;
+ soap->randfile = NULL;
#endif
+ soap->c_locale = NULL;
soap->buflen = 0;
soap->bufidx = 0;
#ifndef WITH_LEANER
@@ -9233,12 +10241,15 @@ soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void
SOAP_FMAC2
soap_begin(struct soap *soap)
-{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reinitializing context\n"));
+{ if (soap_check_state(soap))
+ return;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reinitializing context\n"));
if (!soap->keep_alive)
{ soap->buflen = 0;
soap->bufidx = 0;
@@ -9252,7 +10263,6 @@ soap_begin(struct soap *soap)
soap->part = SOAP_END;
soap->event = 0;
soap->evlev = 0;
- soap->alloced = 0;
soap->count = 0;
soap->length = 0;
soap->cdata = 0;
@@ -9272,6 +10282,7 @@ soap_begin(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void
@@ -9282,7 +10293,7 @@ soap_end(struct soap *soap)
soap_free_temp(soap);
soap_dealloc(soap, NULL);
while (soap->clist)
- { register struct soap_clist *cp = soap->clist->next;
+ { struct soap_clist *cp = soap->clist->next;
SOAP_FREE(soap, soap->clist);
soap->clist = cp;
}
@@ -9297,13 +10308,14 @@ soap_end(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
SOAP_FMAC2
soap_set_version(struct soap *soap, short version)
{ soap_set_local_namespaces(soap);
- if (soap->version != version)
+ if (soap->version != version && soap->local_namespaces && soap->local_namespaces[0].id && soap->local_namespaces[1].id)
{ if (version == 1)
{ soap->local_namespaces[0].ns = soap_env1;
soap->local_namespaces[1].ns = soap_enc1;
@@ -9314,18 +10326,55 @@ soap_set_version(struct soap *soap, short version)
}
soap->version = version;
}
+ if (version == 0)
+ soap->encodingStyle = SOAP_STR_EOS;
+ else
+ soap->encodingStyle = NULL;
}
#endif
/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_get_version(struct soap *soap)
+{ struct Namespace *p = soap->local_namespaces;
+ if (p)
+ { const char *ns = p[0].out;
+ if (!ns)
+ ns = p[0].ns;
+ if (!strcmp(ns, soap_env1))
+ { soap->version = 1; /* make sure we use SOAP 1.1 */
+ if (p[1].out)
+ SOAP_FREE(soap, p[1].out);
+ p[1].out = (char*)SOAP_MALLOC(soap, sizeof(soap_enc1));
+ if (p[1].out)
+ soap_strncpy(p[1].out, sizeof(soap_enc1), soap_enc1, sizeof(soap_enc1) - 1);
+ }
+ else if (!strcmp(ns, soap_env2))
+ { soap->version = 2; /* make sure we use SOAP 1.2 */
+ if (p[1].out)
+ SOAP_FREE(soap, p[1].out);
+ p[1].out = (char*)SOAP_MALLOC(soap, sizeof(soap_enc2));
+ if (p[1].out)
+ soap_strncpy(p[1].out, sizeof(soap_enc2), soap_enc2, sizeof(soap_enc2) - 1);
+ }
+ }
+}
+#endif
+
+/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_set_namespaces(struct soap *soap, const struct Namespace *p)
-{ register struct Namespace *ns = soap->local_namespaces;
- register struct soap_nlist *np, *nq, *nr;
- register unsigned int level = soap->level;
+{ struct Namespace *ns = soap->local_namespaces;
+ struct soap_nlist *np, *nq, *nr;
+ unsigned int level = soap->level;
soap->namespaces = p;
soap->local_namespaces = NULL;
soap_set_local_namespaces(soap);
@@ -9344,7 +10393,7 @@ soap_set_namespaces(struct soap *soap, const struct Namespace *p)
}
/* then push on new stack */
while (np)
- { register const char *s;
+ { const char *s;
soap->level = np->level; /* preserve element nesting level */
s = np->ns;
if (!s && np->index >= 0 && ns)
@@ -9359,7 +10408,7 @@ soap_set_namespaces(struct soap *soap, const struct Namespace *p)
SOAP_FREE(soap, nq);
}
if (ns)
- { register int i;
+ { int i;
for (i = 0; ns[i].id; i++)
{ if (ns[i].out)
{ SOAP_FREE(soap, ns[i].out);
@@ -9374,21 +10423,22 @@ soap_set_namespaces(struct soap *soap, const struct Namespace *p)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
SOAP_FMAC2
soap_set_local_namespaces(struct soap *soap)
{ if (soap->namespaces && !soap->local_namespaces)
- { register const struct Namespace *ns1;
- register struct Namespace *ns2;
- register size_t n = 1;
+ { const struct Namespace *ns1;
+ struct Namespace *ns2;
+ size_t n = 1;
for (ns1 = soap->namespaces; ns1->id; ns1++)
n++;
n *= sizeof(struct Namespace);
ns2 = (struct Namespace*)SOAP_MALLOC(soap, n);
if (ns2)
- { memcpy(ns2, soap->namespaces, n);
+ { soap_memcpy((void*)ns2, n, (const void*)soap->namespaces, n);
if (ns2[0].ns)
{ if (!strcmp(ns2[0].ns, soap_env1))
soap->version = 1;
@@ -9404,18 +10454,19 @@ soap_set_local_namespaces(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
#ifndef PALM_1
SOAP_FMAC1
const char *
SOAP_FMAC2
soap_tagsearch(const char *big, const char *little)
-{ if (little)
- { register size_t n = strlen(little);
- register const char *s = big;
+{ if (big && little)
+ { size_t n = strlen(little);
+ const char *s = big;
while (s)
- { register const char *t = s;
- register size_t i;
+ { const char *t = s;
+ size_t i;
for (i = 0; i < n; i++, t++)
{ if (*t != little[i])
break;
@@ -9435,27 +10486,26 @@ soap_tagsearch(const char *big, const char *little)
#endif
/******************************************************************************/
-#ifndef WITH_LEAN
+
#ifndef PALM_1
SOAP_FMAC1
struct soap_nlist *
SOAP_FMAC2
soap_lookup_ns(struct soap *soap, const char *tag, size_t n)
-{ register struct soap_nlist *np;
+{ struct soap_nlist *np;
for (np = soap->nlist; np; np = np->next)
- { if (!strncmp(np->id, tag, n) && !np->id[n])
+ if (!strncmp(np->id, tag, n) && !np->id[n])
return np;
- }
return NULL;
}
#endif
-#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
static struct soap_nlist *
soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized)
-{ register struct soap_nlist *np;
+{ struct soap_nlist *np;
size_t n, k;
if (soap_tagsearch(soap->c14nexclude, id))
return NULL;
@@ -9484,9 +10534,11 @@ soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized)
}
np->next = soap->nlist;
soap->nlist = np;
- strcpy((char*)np->id, id);
+ soap_strcpy((char*)np->id, n + 1, id);
if (ns)
- np->ns = strcpy((char*)np->id + n + 1, ns);
+ { np->ns = np->id + n + 1;
+ soap_strcpy((char*)np->ns, k + 1, ns);
+ }
else
np->ns = NULL;
np->level = soap->level;
@@ -9496,32 +10548,34 @@ soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
static void
soap_utilize_ns(struct soap *soap, const char *tag)
-{ register struct soap_nlist *np;
+{ struct soap_nlist *np;
size_t n = 0;
const char *t = strchr(tag, ':');
if (t)
- { n = t - tag;
- if (n >= sizeof(soap->tmpbuf))
- n = sizeof(soap->tmpbuf) - 1;
- }
+ n = t - tag;
np = soap_lookup_ns(soap, tag, n);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Utilizing namespace of '%s'\n", tag));
if (np)
{ if (np->index <= 0)
- soap_push_ns(soap, np->id, np->ns, 1);
+ { if (np->level == soap->level)
+ np->index = 1;
+ else
+ soap_push_ns(soap, np->id, np->ns, 1);
+ }
}
- else if (strncmp(tag, "xml", 3))
- { strncpy(soap->tmpbuf, tag, n);
- soap->tmpbuf[n] = '\0';
+ else if (n && strncmp(tag, "xml", 3))
+ { soap_strncpy(soap->tmpbuf, sizeof(soap->tmpbuf), tag, n);
soap_push_ns(soap, soap->tmpbuf, NULL, 1);
}
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -9529,13 +10583,15 @@ SOAP_FMAC2
soap_element(struct soap *soap, const char *tag, int id, const char *type)
{
#ifndef WITH_LEAN
- register const char *s;
+ const char *s;
#endif
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element begin tag='%s' level='%u' id='%d' type='%s'\n", tag, soap->level, id, type ? type : SOAP_STR_EOS));
soap->level++;
+ if (soap->level > soap->maxlevel)
+ return soap->error = SOAP_LEVEL;
#ifdef WITH_DOM
#ifndef WITH_LEAN
- if (soap->wsuid && soap_tagsearch(soap->wsuid, tag))
+ if (soap_tagsearch(soap->wsuid, tag))
{ size_t i;
for (s = tag, i = 0; *s && i < sizeof(soap->tag) - 1; s++, i++)
soap->tag[i] = *s == ':' ? '-' : *s;
@@ -9547,12 +10603,13 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
{ if (soap->evlev >= soap->level)
soap->evlev = 0;
if (soap->event == SOAP_SEC_BEGIN && !soap->evlev)
- { register struct soap_nlist *np;
+ { struct soap_nlist *np;
/* non-nested wsu:Id found: clear xmlns, re-emit them for exc-c14n */
for (np = soap->nlist; np; np = np->next)
- { if (np->index == 2)
+ { int p = soap_tagsearch(soap->c14ninclude, np->id) != NULL;
+ if (np->index == 2 || p)
{ struct soap_nlist *np1 = soap_push_ns(soap, np->id, np->ns, 1);
- if (np1)
+ if (np1 && !p)
np1->index = 0;
}
}
@@ -9561,22 +10618,22 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
}
#endif
if (soap->mode & SOAP_XML_DOM)
- { register struct soap_dom_element *elt = (struct soap_dom_element*)soap_malloc(soap, sizeof(struct soap_dom_element));
+ { struct soap_dom_element *elt = (struct soap_dom_element*)soap_malloc(soap, sizeof(struct soap_dom_element));
if (!elt)
return soap->error;
elt->soap = soap;
elt->next = NULL;
elt->prnt = soap->dom;
- elt->name = soap_strdup(soap, tag);
elt->elts = NULL;
elt->atts = NULL;
elt->nstr = NULL;
- elt->data = NULL;
- elt->wide = NULL;
+ elt->name = soap_strdup(soap, tag);
+ elt->lead = NULL;
+ elt->text = NULL;
+ elt->code = NULL;
+ elt->tail = NULL;
elt->node = NULL;
elt->type = 0;
- elt->head = NULL;
- elt->tail = NULL;
if (soap->dom)
{ struct soap_dom_element *p = soap->dom->elts;
if (p)
@@ -9594,8 +10651,7 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
#endif
#ifndef WITH_LEAN
if (!soap->ns)
- { if (!(soap->mode & SOAP_XML_CANONICAL)
- && soap_send(soap, soap->prolog ? soap->prolog : "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"))
+ { if (!(soap->mode & SOAP_XML_CANONICAL) && soap_send(soap, soap->prolog))
return soap->error;
}
else if (soap->mode & SOAP_XML_INDENT)
@@ -9603,22 +10659,34 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
return soap->error;
soap->body = 1;
}
- if ((soap->mode & SOAP_XML_DEFAULTNS) && (s = strchr(tag, ':')))
+ if ((soap->mode & SOAP_XML_DEFAULTNS))
{ struct Namespace *ns = soap->local_namespaces;
- size_t n = s - tag;
+ size_t n = 0;
+ s = strchr(tag, ':');
+ if (s)
+ n = s++ - tag;
+ else
+ s = tag;
if (soap_send_raw(soap, "<", 1)
- || soap_send(soap, s + 1))
+ || soap_send(soap, s))
return soap->error;
- if (soap->nlist && !strncmp(soap->nlist->id, tag, n) && !soap->nlist->id[n])
- ns = NULL;
- for (; ns && ns->id; ns++)
- { if (*ns->id && (ns->out || ns->ns) && !strncmp(ns->id, tag, n) && !ns->id[n])
- { soap_push_ns(soap, ns->id, ns->out ? ns->out : ns->ns, 0);
- if (soap_attribute(soap, "xmlns", ns->out ? ns->out : ns->ns))
- return soap->error;
- break;
+ if (n)
+ { if (soap->nlist && !strncmp(soap->nlist->id, tag, n) && !soap->nlist->id[n])
+ ns = NULL;
+ for (; ns && ns->id; ns++)
+ { if (*ns->id && ns->ns && !strncmp(ns->id, tag, n) && !ns->id[n])
+ { soap_push_ns(soap, ns->id, ns->out ? ns->out : ns->ns, 0);
+ if (soap_attribute(soap, "xmlns", ns->out ? ns->out : ns->ns))
+ return soap->error;
+ break;
+ }
}
}
+ else if (!soap->nlist || *soap->nlist->id)
+ { soap_push_ns(soap, "", "", 0);
+ if (soap_attribute(soap, "xmlns", ""))
+ return soap->error;
+ }
}
else
#endif
@@ -9646,14 +10714,12 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
}
#endif
while (k-- && ns->id)
- { if (*ns->id && (ns->out || ns->ns))
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "xmlns:%s", ns->id);
-#else
- sprintf(soap->tmpbuf, "xmlns:%s", ns->id);
-#endif
- if (soap_attribute(soap, soap->tmpbuf, ns->out ? ns->out : ns->ns))
+ { const char *t = ns->out;
+ if (!t)
+ t = ns->ns;
+ if (*ns->id && t && *t)
+ { (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(ns->id) + 6), "xmlns:%s", ns->id);
+ if (soap_attribute(soap, soap->tmpbuf, t))
return soap->error;
}
ns++;
@@ -9662,16 +10728,11 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
}
soap->ns = 1; /* namespace table control: ns = 0 or 2 to start, then 1 to stop dumping the table */
#ifndef WITH_LEAN
- if (soap->mode & SOAP_XML_CANONICAL)
+ if ((soap->mode & SOAP_XML_CANONICAL))
soap_utilize_ns(soap, tag);
#endif
if (id > 0)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "_%d", id);
-#else
- sprintf(soap->tmpbuf, "_%d", id);
-#endif
+ { (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), sizeof(SOAP_BASEREFNAME) + 20), SOAP_BASEREFNAME "%d", id);
if (soap->version == 2)
{ if (soap_attribute(soap, "SOAP-ENC:id", soap->tmpbuf))
return soap->error;
@@ -9679,41 +10740,30 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
else if (soap_attribute(soap, "id", soap->tmpbuf))
return soap->error;
}
- if (type && *type && !(soap->mode & SOAP_XML_NOTYPE) && soap->part != SOAP_IN_HEADER)
+ if (type && *type && !(soap->mode & SOAP_XML_NOTYPE))
{ const char *t = type;
#ifndef WITH_LEAN
- if (soap->mode & SOAP_XML_DEFAULTNS)
+ if ((soap->mode & SOAP_XML_DEFAULTNS))
{ t = strchr(type, ':');
if (t)
t++;
else
t = type;
}
+ else if ((soap->mode & SOAP_XML_CANONICAL))
+ soap_utilize_ns(soap, type);
#endif
if (soap->attributes ? soap_set_attr(soap, "xsi:type", t, 1) : soap_attribute(soap, "xsi:type", t))
return soap->error;
-#ifndef WITH_LEAN
- if (soap->mode & SOAP_XML_CANONICAL)
- soap_utilize_ns(soap, type);
-#endif
}
- if (soap->null && soap->position > 0)
- { register int i;
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf) - 1, "[%d", soap->positions[0]);
-#else
- sprintf(soap->tmpbuf, "[%d", soap->positions[0]);
-#endif
+ if (soap->null && soap->position > 0 && soap->version == 1)
+ { int i;
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf) - 1, 20), "[%d", soap->positions[0]);
for (i = 1; i < soap->position; i++)
- { register size_t l = strlen(soap->tmpbuf);
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf + l, sizeof(soap->tmpbuf)-l-1, ",%d", soap->positions[i]);
-#else
- if (l + 13 < sizeof(soap->tmpbuf))
- sprintf(soap->tmpbuf + l, ",%d", soap->positions[i]);
-#endif
+ { size_t l = strlen(soap->tmpbuf);
+ (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l - 1, 20), ",%d", soap->positions[i]);
}
- strcat(soap->tmpbuf, "]");
+ soap_strncat(soap->tmpbuf, sizeof(soap->tmpbuf), "]", 1);
if (soap_attribute(soap, "SOAP-ENC:position", soap->tmpbuf))
return soap->error;
}
@@ -9750,6 +10800,7 @@ soap_element(struct soap *soap, const char *tag, int id, const char *type)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -9772,13 +10823,14 @@ soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *t
#endif
/******************************************************************************/
+
#ifndef PALM_2
#ifndef HAVE_STRRCHR
SOAP_FMAC1
char*
SOAP_FMAC2
soap_strrchr(const char *s, int t)
-{ register char *r = NULL;
+{ char *r = NULL;
while (*s)
if (*s++ == t)
r = (char*)s - 1;
@@ -9788,14 +10840,15 @@ soap_strrchr(const char *s, int t)
#endif
/******************************************************************************/
+
#ifndef PALM_2
#ifndef HAVE_STRTOL
SOAP_FMAC1
long
SOAP_FMAC2
soap_strtol(const char *s, char **t, int b)
-{ register long n = 0;
- register int c;
+{ long n = 0;
+ int c;
while (*s > 0 && *s <= 32)
s++;
if (b == 10)
@@ -9808,7 +10861,13 @@ soap_strtol(const char *s, char **t, int b)
s++;
while ((c = *s) && c >= '0' && c <= '9')
{ if (n >= 214748364 && (n > 214748364 || c >= '8'))
+ { if (neg && n == 214748364 && c == '8')
+ { if (t)
+ *t = (char*)(s + 1);
+ return -2147483648;
+ }
break;
+ }
n *= 10;
n += c - '0';
s++;
@@ -9839,6 +10898,7 @@ soap_strtol(const char *s, char **t, int b)
#endif
/******************************************************************************/
+
#ifndef PALM_2
#ifndef HAVE_STRTOUL
SOAP_FMAC1
@@ -9846,11 +10906,16 @@ unsigned long
SOAP_FMAC2
soap_strtoul(const char *s, char **t, int b)
{ unsigned long n = 0;
- register int c;
+ int c;
while (*s > 0 && *s <= 32)
s++;
if (b == 10)
- { if (*s == '+')
+ { short neg = 0;
+ if (*s == '-')
+ { s++;
+ neg = 1;
+ }
+ else if (*s == '+')
s++;
while ((c = *s) && c >= '0' && c <= '9')
{ if (n >= 429496729 && (n > 429496729 || c >= '6'))
@@ -9859,6 +10924,8 @@ soap_strtoul(const char *s, char **t, int b)
n += c - '0';
s++;
}
+ if (neg && n > 0)
+ s--;
}
else /* b == 16 */
{ while ((c = *s))
@@ -9883,39 +10950,38 @@ soap_strtoul(const char *s, char **t, int b)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_array_begin_out(struct soap *soap, const char *tag, int id, const char *type, const char *offset)
-{ if (!type || !*type)
+{ if (!type || !*type || soap->version == 0)
return soap_element_begin_out(soap, tag, id, NULL);
- if (soap_element(soap, tag, id, "SOAP-ENC:Array"))
+ if (soap_element(soap, tag, id, NULL))
return soap->error;
- if (soap->version == 2)
+ if (soap->version == 1)
+ { if (offset && soap_attribute(soap, "SOAP-ENC:offset", offset))
+ return soap->error;
+ if (soap_attribute(soap, "SOAP-ENC:arrayType", type))
+ return soap->error;
+ }
+ else
{ const char *s;
s = soap_strrchr(type, '[');
if (s && (size_t)(s - type) < sizeof(soap->tmpbuf))
- { strncpy(soap->tmpbuf, type, s - type);
- soap->tmpbuf[s - type] = '\0';
+ { soap_strncpy(soap->tmpbuf, sizeof(soap->tmpbuf), type, s - type);
if (soap_attribute(soap, "SOAP-ENC:itemType", soap->tmpbuf))
return soap->error;
s++;
if (*s)
- { strncpy(soap->tmpbuf, s, sizeof(soap->tmpbuf));
- soap->tmpbuf[sizeof(soap->tmpbuf) - 1] = '\0';
+ { soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), s);
soap->tmpbuf[strlen(soap->tmpbuf) - 1] = '\0';
if (soap_attribute(soap, "SOAP-ENC:arraySize", soap->tmpbuf))
return soap->error;
}
}
}
- else
- { if (offset && soap_attribute(soap, "SOAP-ENC:offset", offset))
- return soap->error;
- if (soap_attribute(soap, "SOAP-ENC:arrayType", type))
- return soap->error;
- }
#ifndef WITH_LEAN
if ((soap->mode & SOAP_XML_CANONICAL))
soap_utilize_ns(soap, type);
@@ -9925,41 +10991,40 @@ soap_array_begin_out(struct soap *soap, const char *tag, int id, const char *typ
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_element_start_end_out(struct soap *soap, const char *tag)
-{ register struct soap_attribute *tp;
+{ struct soap_attribute *tp;
#ifndef WITH_LEAN
- if (soap->mode & SOAP_XML_CANONICAL)
+ if ((soap->mode & SOAP_XML_CANONICAL))
{ struct soap_nlist *np;
for (tp = soap->attributes; tp; tp = tp->next)
- { if (tp->visible && tp->name)
+ { if (tp->visible && *tp->name)
soap_utilize_ns(soap, tp->name);
}
for (np = soap->nlist; np; np = np->next)
- { if (np->index == 1 && np->ns)
+ { if (np->ns && (np->index == 1 || (np->index == 0 && soap->event == SOAP_SEC_BEGIN && soap_tagsearch(soap->c14ninclude, np->id))))
{ if (*(np->id))
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "xmlns:%s", np->id);
-#else
- sprintf(soap->tmpbuf, "xmlns:%s", np->id);
-#endif
- }
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(np->id) + 6), "xmlns:%s", np->id);
else
- strcpy(soap->tmpbuf, "xmlns");
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enabling utilized binding (level=%u) %s='%s'\n", np->level, soap->tmpbuf, np->ns));
+ soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "xmlns");
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enabling utilized binding (level=%u) %s='%s' c14ninclude='%s'\n", np->level, soap->tmpbuf, np->ns, soap->c14ninclude ? soap->c14ninclude : "(null)"));
soap_set_attr(soap, soap->tmpbuf, np->ns, 1);
np->index = 2;
}
+ else
+ {
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Binding (level=%u) %s='%s' utilized=%d\n", np->level, np->id, np->ns, np->index));
+ }
}
}
#endif
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- { register struct soap_dom_attribute **att;
+ { struct soap_dom_attribute **att;
att = &soap->dom->atts;
for (tp = soap->attributes; tp; tp = tp->next)
{ if (tp->visible)
@@ -9969,8 +11034,7 @@ soap_element_start_end_out(struct soap *soap, const char *tag)
(*att)->next = NULL;
(*att)->nstr = NULL;
(*att)->name = soap_strdup(soap, tp->name);
- (*att)->data = soap_strdup(soap, tp->value);
- (*att)->wide = NULL;
+ (*att)->text = soap_strdup(soap, tp->value);
(*att)->soap = soap;
att = &(*att)->next;
tp->visible = 0;
@@ -9981,41 +11045,35 @@ soap_element_start_end_out(struct soap *soap, const char *tag)
#endif
for (tp = soap->attributes; tp; tp = tp->next)
{ if (tp->visible)
- {
-#ifndef WITH_LEAN
- const char *s;
- if ((soap->mode & SOAP_XML_DEFAULTNS) && (s = strchr(tp->name, ':')))
- { size_t n = s - tp->name;
- if (soap->nlist && !strncmp(soap->nlist->id, tp->name, n) && !soap->nlist->id[n])
- s++;
- else
- s = tp->name;
- if (soap_send(soap, " ") || soap_send(soap, s))
- return soap->error;
- }
- else
-#endif
- if (soap_send(soap, " ") || soap_send(soap, tp->name))
+ { if (soap_send_raw(soap, " ", 1) || soap_send(soap, tp->name))
return soap->error;
if (tp->visible == 2 && tp->value)
- if (soap_send_raw(soap, "=\"", 2)
+ { if (soap_send_raw(soap, "=\"", 2)
|| soap_string_out(soap, tp->value, tp->flag)
|| soap_send_raw(soap, "\"", 1))
return soap->error;
+ }
+ else if (soap->mode & SOAP_XML_STRICT)
+ { if (soap_send_raw(soap, "=\"\"", 3))
+ return soap->error;
+ }
tp->visible = 0;
}
}
if (tag)
{
#ifndef WITH_LEAN
- if (soap->mode & SOAP_XML_CANONICAL)
+ if ((soap->mode & SOAP_XML_CANONICAL))
{ if (soap_send_raw(soap, ">", 1)
|| soap_element_end_out(soap, tag))
return soap->error;
return SOAP_OK;
}
#endif
- soap->level--; /* decrement level just before /> */
+ if (soap->nlist)
+ soap_pop_namespace(soap);
+ soap->level--; /* decrement level just before /> */
+ soap->body = 0;
return soap_send_raw(soap, "/>", 2);
}
return soap_send_raw(soap, ">", 1);
@@ -10023,6 +11081,7 @@ soap_element_start_end_out(struct soap *soap, const char *tag)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -10036,7 +11095,7 @@ soap_element_end_out(struct soap *soap, const char *tag)
return SOAP_OK;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element ending tag='%s'\n", tag));
#ifdef WITH_DOM
- if (soap->feltendout && (soap->error = soap->feltendout(soap, tag)))
+ if (soap->feltendout && (soap->error = soap->feltendout(soap, tag)) != SOAP_OK)
return soap->error;
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
{ if (soap->dom->prnt)
@@ -10045,7 +11104,7 @@ soap_element_end_out(struct soap *soap, const char *tag)
}
#endif
#ifndef WITH_LEAN
- if (soap->mode & SOAP_XML_CANONICAL)
+ if (soap->nlist)
soap_pop_namespace(soap);
if (soap->mode & SOAP_XML_INDENT)
{ if (!soap->body)
@@ -10054,43 +11113,39 @@ soap_element_end_out(struct soap *soap, const char *tag)
}
soap->body = 0;
}
- if ((soap->mode & SOAP_XML_DEFAULTNS) && (s = strchr(tag, ':')))
- { soap_pop_namespace(soap);
+ if ((soap->mode & SOAP_XML_DEFAULTNS) && (s = strchr(tag, ':')) != NULL)
tag = s + 1;
- }
#endif
if (soap_send_raw(soap, "</", 2)
|| soap_send(soap, tag))
return soap->error;
- soap->level--; /* decrement level just before > */
+ soap->level--; /* decrement level just before > */
return soap_send_raw(soap, ">", 1);
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_element_ref(struct soap *soap, const char *tag, int id, int href)
-{ register const char *s = "ref";
- register int n = 1;
+{ const char *s = "ref";
+ int n = 1;
if (soap->version == 1)
{ s = "href";
n = 0;
}
else if (soap->version == 2)
s = "SOAP-ENC:ref";
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->href, sizeof(soap->href), "#_%d", href);
-#else
- sprintf(soap->href, "#_%d", href);
-#endif
+ (SOAP_SNPRINTF(soap->href, sizeof(soap->href), sizeof(SOAP_BASEREFNAME) + 21), "#" SOAP_BASEREFNAME "%d", href);
return soap_element_href(soap, tag, id, s, soap->href + n);
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -10101,11 +11156,13 @@ soap_element_href(struct soap *soap, const char *tag, int id, const char *ref, c
|| soap_attribute(soap, ref, val)
|| soap_element_start_end_out(soap, tag))
return soap->error;
+ soap->body = 0;
return SOAP_OK;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -10117,44 +11174,55 @@ soap_element_null(struct soap *soap, const char *tag, int id, const char *type)
break;
if (tp || (soap->version == 2 && soap->position > 0) || id > 0 || (soap->mode & SOAP_XML_NIL))
{ if (soap_element(soap, tag, id, type)
- || (!tp && soap_attribute(soap, "xsi:nil", "true")))
+ || (!tp && soap_attribute(soap, "xsi:nil", "true"))
+ || soap_element_start_end_out(soap, tag))
return soap->error;
- return soap_element_start_end_out(soap, tag);
+ soap->body = 0;
+ }
+ else
+ { soap->null = 1;
+ soap->position = 0;
+ soap->mustUnderstand = 0;
}
- soap->null = 1;
- soap->position = 0;
- soap->mustUnderstand = 0;
return SOAP_OK;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_element_nil(struct soap *soap, const char *tag)
{ if (soap_element(soap, tag, -1, NULL)
- || ((soap->mode & SOAP_XML_NIL) && soap_attribute(soap, "xsi:nil", "true")))
+ || (soap_attribute(soap, "xsi:nil", "true")))
return soap->error;
return soap_element_start_end_out(soap, tag);
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
-soap_element_id(struct soap *soap, const char *tag, int id, const void *p, const struct soap_array *a, int n, const char *type, int t)
-{ if (!p)
+soap_element_id(struct soap *soap, const char *tag, int id, const void *p, const void *a, int n, const char *type, int t, char **mark)
+{ (void)a; (void)n;
+ if (!p)
{ soap->error = soap_element_null(soap, tag, id, type);
return -1;
}
#ifndef WITH_NOIDREF
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element_id %p type=%d id=%d\n", p, t, id));
if ((!soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH)) || (soap->omode & SOAP_XML_TREE))
- return 0;
- if (id < 0)
+ return soap_check_and_mark(soap, p, t, mark);
+ if (mark)
+ *mark = NULL;
+ if (id < -1)
+ return soap_embed(soap, p, a, n, t);
+ else if (id <= 0)
{ struct soap_plist *pp;
if (a)
id = soap_array_pointer_lookup(soap, p, a, n, t, &pp);
@@ -10172,12 +11240,113 @@ soap_element_id(struct soap *soap, const char *tag, int id, const void *p, const
}
return id;
#else
+ return soap_check_and_mark(soap, p, t, mark);
+#endif
+}
+#endif
+
+/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_check_and_mark(struct soap *soap, const void *p, int t, char **mark)
+{ if (mark)
+ { struct soap_plist *pp;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Check %p and mark %p\n", p, mark));
+ if (!soap_pointer_lookup(soap, p, t, &pp))
+ if (!soap_pointer_enter(soap, p, NULL, 0, t, &pp))
+ return -1;
+ if (soap->mode & SOAP_IO_LENGTH)
+ { if (pp->mark1 > 0)
+ return -1;
+ pp->mark1 = 1;
+ *mark = &pp->mark1;
+ }
+ else
+ { if (pp->mark2 > 0)
+ return -1;
+ pp->mark2 = 1;
+ *mark = &pp->mark2;
+ }
+ }
return 0;
+}
#endif
+
+/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+void *
+SOAP_FMAC2
+soap_mark_lookup(struct soap *soap, const void *p, int t, struct soap_plist **ppp, char **mark)
+{ if (!soap)
+ return NULL;
+ if (mark || !(soap->mode & SOAP_XML_TREE))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Mark lookup %p type %d\n", p, t));
+ if (!soap_pointer_lookup(soap, p, t, ppp))
+ { if (!soap_pointer_enter(soap, p, NULL, 0, t, ppp))
+ return NULL;
+ }
+ else if (!(soap->mode & SOAP_XML_TREE))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Mark found %p\n", (*ppp)->dup));
+ return (*ppp)->dup;
+ }
+ if (mark)
+ { if ((*ppp)->mark1 > 0)
+ (*ppp)->mark1 = 2; /* cycle */
+ else
+ (*ppp)->mark1 = 1; /* cycle detection */
+ *mark = &(*ppp)->mark1;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Mark cycle %d\n", (*ppp)->mark1));
+ }
+ }
+ return NULL;
}
#endif
/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_mark_cycle(struct soap *soap, struct soap_plist *pp)
+{ (void)soap;
+ return pp && pp->mark1 == 2 && (soap->mode & SOAP_XML_TREE);
+}
+#endif
+
+/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_mark_dup(struct soap *soap, void *a, struct soap_plist *pp)
+{ (void)soap;
+ if (pp)
+ pp->dup = a;
+}
+#endif
+
+/******************************************************************************/
+
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_unmark(struct soap *soap, char *mark)
+{ (void)soap;
+ if (mark)
+ *mark = 0; /* release detection */
+}
+#endif
+
+/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -10196,44 +11365,44 @@ soap_element_result(struct soap *soap, const char *tag)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
SOAP_FMAC2
soap_check_result(struct soap *soap, const char *tag)
-{ if (soap->version == 2 && soap->encodingStyle)
- { soap_instring(soap, ":result", NULL, NULL, 0, 2, -1, -1);
+{ (void)tag;
+ if (soap->version == 2 && soap->encodingStyle)
+ { soap_instring(soap, ":result", NULL, NULL, 0, 2, -1, -1, NULL);
/* just ignore content for compliance reasons, but should compare tag to element's QName value? */
}
- (void)tag;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_attribute(struct soap *soap, const char *name, const char *value)
-{
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attribute '%s'='%s'\n", name, value));
+{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attribute '%s'='%s'\n", name, value));
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && !(soap->mode & SOAP_XML_CANONICAL) && soap->dom)
- { register struct soap_dom_attribute *a = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute));
+ { struct soap_dom_attribute *a = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute));
if (!a)
return soap->error;
a->next = soap->dom->atts;
a->nstr = NULL;
a->name = soap_strdup(soap, name);
- a->data = soap_strdup(soap, value);
- a->wide = NULL;
+ a->text = soap_strdup(soap, value);
a->soap = soap;
soap->dom->atts = a;
return SOAP_OK;
}
#endif
#ifndef WITH_LEAN
- if (soap->mode & SOAP_XML_CANONICAL)
+ if ((soap->mode & SOAP_XML_CANONICAL))
{ /* push namespace */
if (!strncmp(name, "xmlns", 5) && (name[5] == ':' || name[5] == '\0'))
soap_push_ns(soap, name + 5 + (name[5] == ':'), value, 0);
@@ -10242,7 +11411,8 @@ soap_attribute(struct soap *soap, const char *name, const char *value)
}
else
#endif
- { if (soap_send(soap, " ") || soap_send(soap, name))
+ { if (soap_send_raw(soap, " ", 1)
+ || soap_send(soap, name))
return soap->error;
if (value)
if (soap_send_raw(soap, "=\"", 2)
@@ -10255,6 +11425,7 @@ soap_attribute(struct soap *soap, const char *name, const char *value)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -10265,15 +11436,19 @@ soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const ch
return soap->error = SOAP_TAG_MISMATCH;
if (tag && *tag == '-')
return SOAP_OK;
- if (!(soap->error = soap_match_tag(soap, soap->tag, tag)))
+ soap->error = soap_match_tag(soap, soap->tag, tag);
+ if (!soap->error)
{ soap->peeked = 0;
if (type && *soap->type && soap_match_tag(soap, soap->type, type))
return soap->error = SOAP_TYPE;
if (!nillable && soap->null && (soap->mode & SOAP_XML_STRICT))
return soap->error = SOAP_NULL;
if (soap->body)
- soap->level++;
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS ));
+ { soap->level++;
+ if (soap->level > soap->maxlevel)
+ return soap->error = SOAP_LEVEL;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin tag found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS ));
soap->error = SOAP_OK;
}
}
@@ -10284,25 +11459,32 @@ soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const ch
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_element_end_in(struct soap *soap, const char *tag)
-{ register soap_wchar c;
- register char *s;
- register int n = 0;
+{ soap_wchar c;
+ char *s;
+ int n = 0;
if (tag && *tag == '-')
return SOAP_OK;
if (soap->error == SOAP_NO_TAG)
soap->error = SOAP_OK;
#ifdef WITH_DOM
- /* this whitespace or mixed content is significant for DOM */
+ /* this whitespace or mixed content is significant for DOM "as-is" */
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- { if (!soap->peeked && !soap_string_in(soap, 3, -1, -1))
+ { s = soap_string_in(soap, -1, -1, -1, NULL);
+ if (!soap->peeked && !s)
return soap->error;
if (soap->dom->prnt)
soap->dom = soap->dom->prnt;
+ if ((soap->mode & SOAP_XML_STRICT))
+ { for (; *s; s++)
+ if (soap_notblank(*s))
+ return soap->error = SOAP_SYNTAX_ERROR; /* reject mixed content before ending tag */
+ }
}
#endif
if (soap->peeked)
@@ -10314,14 +11496,18 @@ soap_element_end_in(struct soap *soap, const char *tag)
{ while (((c = soap_get(soap)) != SOAP_TT))
{ if ((int)c == EOF)
return soap->error = SOAP_CHK_EOF;
- if (c == SOAP_LT)
- n++;
- else if (c == '/')
- { c = soap_get(soap);
- if (c == SOAP_GT)
- n--;
- else
- soap_unget(soap, c);
+ if (!soap_blank(c))
+ { if ((soap->mode & SOAP_XML_STRICT))
+ return soap->error = SOAP_SYNTAX_ERROR; /* reject mixed content before ending tag */
+ if (c == SOAP_LT)
+ n++;
+ else if (c == '/')
+ { c = soap_get(soap);
+ if (c == SOAP_GT && n > 0)
+ n--;
+ else
+ soap_unget(soap, c);
+ }
}
}
} while (n--);
@@ -10348,37 +11534,38 @@ soap_element_end_in(struct soap *soap, const char *tag)
if (tag && (soap->mode & SOAP_XML_STRICT))
{ soap_pop_namespace(soap);
if (soap_match_tag(soap, soap->tag, tag))
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element tag '%s' does not match '%s'\n", soap->tag, tag ? tag : SOAP_STR_EOS));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End tag '%s' does not match '%s'\n", soap->tag, tag ? tag : SOAP_STR_EOS));
return soap->error = SOAP_SYNTAX_ERROR;
}
}
#endif
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End tag found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS));
soap->level--;
return SOAP_OK;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char *
SOAP_FMAC2
soap_attr_value(struct soap *soap, const char *name, int flag)
-{ register struct soap_attribute *tp;
+{ struct soap_attribute *tp;
if (*name == '-')
return SOAP_STR_EOS;
for (tp = soap->attributes; tp; tp = tp->next)
- { if (tp->visible && !soap_match_tag(soap, tp->name, name))
+ { if (!soap_match_att(soap, tp->name, name))
break;
}
- if (tp)
- { if (flag == 2 && (soap->mode & SOAP_XML_STRICT))
+ if (tp && tp->visible == 2)
+ { if (flag == 4 || (flag == 2 && (soap->mode & SOAP_XML_STRICT)))
soap->error = SOAP_PROHIBITED;
else
return tp->value;
}
- else if (flag == 1 && (soap->mode & SOAP_XML_STRICT))
+ else if (flag == 3 || (flag == 1 && (soap->mode & SOAP_XML_STRICT)))
soap->error = SOAP_REQUIRED;
else
soap->error = SOAP_OK;
@@ -10387,22 +11574,26 @@ soap_attr_value(struct soap *soap, const char *name, int flag)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_set_attr(struct soap *soap, const char *name, const char *value, int flag)
-{ register struct soap_attribute *tp;
+{ struct soap_attribute *tp, *tq;
if (*name == '-')
return SOAP_OK;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set attribute %s='%s'\n", name, value ? value : SOAP_STR_EOS));
- for (tp = soap->attributes; tp; tp = tp->next)
+ tq = NULL;
+ for (tp = soap->attributes; tp; tq = tp, tp = tp->next)
{ if (!strcmp(tp->name, name))
break;
}
if (!tp)
- { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute %s\n", name));
- if (!(tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + strlen(name))))
+ { size_t l = strlen(name);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute %s\n", name));
+ tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + l);
+ if (!tp)
return soap->error = SOAP_EOM;
tp->ns = NULL;
#ifndef WITH_LEAN
@@ -10444,10 +11635,15 @@ soap_set_attr(struct soap *soap, const char *name, const char *value, int flag)
}
else
#endif
+ if (tq)
+ { tq->next = tp;
+ tp->next = NULL;
+ }
+ else
{ tp->next = soap->attributes;
soap->attributes = tp;
}
- strcpy((char*)tp->name, name);
+ soap_strcpy((char*)tp->name, l + 1, name);
tp->value = NULL;
}
else if (tp->visible)
@@ -10462,11 +11658,12 @@ soap_set_attr(struct soap *soap, const char *name, const char *value, int flag)
if (value)
{ if (!tp->value)
{ tp->size = strlen(value) + 1;
- if (!(tp->value = (char*)SOAP_MALLOC(soap, tp->size)))
+ tp->value = (char*)SOAP_MALLOC(soap, tp->size);
+ if (!tp->value)
return soap->error = SOAP_EOM;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute value for %s (%p)\n", tp->name, tp->value));
}
- strcpy(tp->value, value);
+ soap_strcpy(tp->value, tp->size, value);
if (!strncmp(tp->name, "xmlns:", 6))
tp->ns = tp->value;
tp->visible = 2;
@@ -10474,8 +11671,18 @@ soap_set_attr(struct soap *soap, const char *name, const char *value, int flag)
#ifndef WITH_LEAN
if (!strcmp(name, "wsu:Id"))
{ soap->event = SOAP_SEC_BEGIN;
- strncpy(soap->id, value, sizeof(soap->id));
- soap->id[sizeof(soap->id) - 1] = '\0';
+ soap_strcpy(soap->id, sizeof(soap->id), value);
+ }
+ if ((soap->mode & SOAP_XML_CANONICAL))
+ { const char *s = strchr(name, ':');
+ if (s) /* should also check default namespace when 'type' is not qualified? */
+ { struct soap_nlist *np = soap_lookup_ns(soap, name, s - name);
+ if (np && np->ns && soap->local_namespaces)
+ { if ((!strcmp(s + 1, "type") && !strcmp(np->ns, soap->local_namespaces[2].ns)) /* xsi:type QName */
+ || ((!strcmp(s + 1, "arrayType") || !strcmp(s + 1, "itemType")) && !strcmp(np->ns, soap->local_namespaces[1].ns))) /* SOAP-ENC:arrayType and SOAP-ENC:itemType QName */
+ soap_utilize_ns(soap, value);
+ }
+ }
}
#endif
}
@@ -10486,12 +11693,13 @@ soap_set_attr(struct soap *soap, const char *name, const char *value, int flag)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void
SOAP_FMAC2
soap_clr_attr(struct soap *soap)
-{ register struct soap_attribute *tp;
+{ struct soap_attribute *tp;
#ifndef WITH_LEAN
if ((soap->mode & SOAP_XML_CANONICAL))
{ while (soap->attributes)
@@ -10511,12 +11719,62 @@ soap_clr_attr(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
static int
-soap_getattrval(struct soap *soap, char *s, size_t n, soap_wchar d)
-{ register size_t i;
- for (i = 0; i < n; i++)
- { register soap_wchar c = soap_get(soap);
+soap_getattrval(struct soap *soap, char *s, size_t *n, soap_wchar d)
+{ char buf[8];
+ size_t i;
+ size_t k = *n;
+ size_t m = 0;
+ char *t = buf;
+ for (i = 0; i < k; i++)
+ { soap_wchar c;
+ if (m)
+ { *s++ = *t++;
+ m--;
+ continue;
+ }
+ if ((soap->mode & SOAP_C_UTFSTRING))
+ { c = soap_get(soap);
+ if ((c & 0x80000000) && c >= -0x7FFFFF80 && c < SOAP_AP)
+ { t = buf;
+ c &= 0x7FFFFFFF;
+ if (c < 0x0800)
+ *t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
+ else
+ { if (c < 0x010000)
+ *t++ = (char)(0xE0 | ((c >> 12) & 0x0F));
+ else
+ { if (c < 0x200000)
+ *t++ = (char)(0xF0 | ((c >> 18) & 0x07));
+ else
+ { if (c < 0x04000000)
+ *t++ = (char)(0xF8 | ((c >> 24) & 0x03));
+ else
+ { *t++ = (char)(0xFC | ((c >> 30) & 0x01));
+ *t++ = (char)(0x80 | ((c >> 24) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 18) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 12) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 6) & 0x3F));
+ }
+ *t++ = (char)(0x80 | (c & 0x3F));
+ m = t - buf - 1;
+ if (i + m >= k)
+ { soap_unget(soap, c | 0x80000000);
+ *n = i;
+ return soap->error = SOAP_EOM;
+ }
+ t = buf;
+ *s++ = *t++;
+ continue;
+ }
+ }
+ else
+ c = soap_getutf8(soap);
switch (c)
{
case SOAP_TT:
@@ -10530,6 +11788,7 @@ soap_getattrval(struct soap *soap, char *s, size_t n, soap_wchar d)
if (d == ' ')
{ soap_unget(soap, c);
*s = '\0';
+ *n = i + 1;
return SOAP_OK;
}
*s++ = '>';
@@ -10537,6 +11796,7 @@ soap_getattrval(struct soap *soap, char *s, size_t n, soap_wchar d)
case SOAP_QT:
if (c == d)
{ *s = '\0';
+ *n = i + 1;
return SOAP_OK;
}
*s++ = '"';
@@ -10544,6 +11804,7 @@ soap_getattrval(struct soap *soap, char *s, size_t n, soap_wchar d)
case SOAP_AP:
if (c == d)
{ *s = '\0';
+ *n = i + 1;
return SOAP_OK;
}
*s++ = '\'';
@@ -10556,11 +11817,15 @@ soap_getattrval(struct soap *soap, char *s, size_t n, soap_wchar d)
if (d == ' ')
{ soap_unget(soap, c);
*s = '\0';
+ *n = i + 1;
return SOAP_OK;
}
+ *s++ = (char)c;
+ break;
default:
if ((int)c == EOF)
{ *s = '\0';
+ *n = i + 1;
return soap->error = SOAP_CHK_EOF;
}
*s++ = (char)c;
@@ -10571,6 +11836,7 @@ soap_getattrval(struct soap *soap, char *s, size_t n, soap_wchar d)
#endif
/******************************************************************************/
+
#ifdef WITH_FAST
#ifndef PALM_2
SOAP_FMAC1
@@ -10584,6 +11850,7 @@ soap_store_lab(struct soap *soap, const char *s, size_t n)
#endif
/******************************************************************************/
+
#ifdef WITH_FAST
#ifndef PALM_2
SOAP_FMAC1
@@ -10591,7 +11858,7 @@ int
SOAP_FMAC2
soap_append_lab(struct soap *soap, const char *s, size_t n)
{ if (soap->labidx + n >= soap->lablen)
- { register char *t = soap->labbuf;
+ { char *t = soap->labbuf;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enlarging look-aside buffer to append data, size=%lu\n", (unsigned long)soap->lablen));
if (soap->lablen == 0)
soap->lablen = SOAP_LABLEN;
@@ -10605,12 +11872,12 @@ soap_append_lab(struct soap *soap, const char *s, size_t n)
return soap->error = SOAP_EOM;
}
if (t)
- { memcpy(soap->labbuf, t, soap->labidx);
+ { soap_memcpy((void*)soap->labbuf, soap->lablen, (const void*)t, soap->labidx);
SOAP_FREE(soap, t);
}
}
if (s)
- { memcpy(soap->labbuf + soap->labidx, s, n);
+ { soap_memcpy((void*)(soap->labbuf + soap->labidx), soap->lablen - soap->labidx, (const void*)s, n);
soap->labidx += n;
}
return SOAP_OK;
@@ -10619,6 +11886,7 @@ soap_append_lab(struct soap *soap, const char *s, size_t n)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -10626,14 +11894,14 @@ SOAP_FMAC2
soap_peek_element(struct soap *soap)
{
#ifdef WITH_DOM
- register struct soap_dom_attribute **att = NULL;
- register char *lead = NULL;
-#endif
- register struct soap_attribute *tp, *tq = NULL;
- register const char *t;
- register char *s;
- register soap_wchar c;
- register int i;
+ struct soap_dom_attribute **att = NULL;
+ char *lead = NULL;
+#endif
+ struct soap_attribute *tp, *tq = NULL;
+ const char *t;
+ char *s;
+ soap_wchar c;
+ int i;
if (soap->peeked)
{ if (!*soap->tag)
return soap->error = SOAP_NO_TAG;
@@ -10654,8 +11922,9 @@ soap_peek_element(struct soap *soap)
/* UTF-8 BOM? */
c = soap_getchar(soap);
if (c == 0xEF && soap_get0(soap) == 0xBB)
- { c = soap_get1(soap);
- if ((c = soap_get1(soap)) == 0xBF)
+ { soap_get1(soap);
+ c = soap_get1(soap);
+ if (c == 0xBF)
soap->mode &= ~SOAP_ENC_LATIN;
else
soap_unget(soap, (0x0F << 12) | (0xBB << 6) | (c & 0x3F)); /* UTF-8 */
@@ -10667,7 +11936,7 @@ soap_peek_element(struct soap *soap)
soap_unget(soap, c);
c = soap_get(soap);
#ifdef WITH_DOM
- /* whitespace leading to tag is not insignificant for DOM */
+ /* whitespace leading up to the start tag is significant for DOM as-is (but comments and PIs are removed from this lead) */
if (soap_blank(c))
{ soap->labidx = 0;
do
@@ -10680,8 +11949,7 @@ soap_peek_element(struct soap *soap)
{ *s++ = c;
c = soap_get(soap);
}
- }
- while (soap_blank(c));
+ } while (soap_blank(c));
*s = '\0';
lead = soap->labbuf;
}
@@ -10696,12 +11964,12 @@ soap_peek_element(struct soap *soap)
return soap->error = SOAP_CHK_EOF;
soap_unget(soap, c);
#ifdef WITH_DOM
- /* whitespace leading to end tag is significant for DOM */
+ /* whitespace leading up to the end tag is significant for DOM as-is */
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
{ if (lead && *lead)
soap->dom->tail = soap_strdup(soap, lead);
else
- soap->dom->tail = (char*)SOAP_STR_EOS;
+ soap->dom->tail = SOAP_STR_EOS; /* body with closing tag instead of <tag/> */
}
#endif
return soap->error = SOAP_NO_TAG;
@@ -10720,22 +11988,25 @@ soap_peek_element(struct soap *soap)
c = soap_get1(soap);
#ifdef WITH_DOM
if (soap->mode & SOAP_XML_DOM)
- { register struct soap_dom_element *elt;
+ { struct soap_dom_element *elt;
elt = (struct soap_dom_element*)soap_malloc(soap, sizeof(struct soap_dom_element));
if (!elt)
return soap->error;
elt->next = NULL;
- elt->nstr = NULL;
- elt->name = soap_strdup(soap, soap->tag);
elt->prnt = soap->dom;
elt->elts = NULL;
elt->atts = NULL;
- elt->data = NULL;
- elt->wide = NULL;
- elt->type = 0;
- elt->node = NULL;
- elt->head = soap_strdup(soap, lead);
+ elt->nstr = NULL;
+ elt->name = soap_strdup(soap, soap->tag);
+ elt->text = NULL;
+ elt->code = NULL;
elt->tail = NULL;
+ elt->node = NULL;
+ elt->type = 0;
+ if (lead && *lead)
+ elt->lead = soap_strdup(soap, lead);
+ else
+ elt->lead = NULL;
elt->soap = soap;
if (soap->dom)
{ struct soap_dom_element *p = soap->dom->elts;
@@ -10774,8 +12045,7 @@ soap_peek_element(struct soap *soap)
(*att)->next = NULL;
(*att)->nstr = NULL;
(*att)->name = soap_strdup(soap, soap->tmpbuf);
- (*att)->data = NULL;
- (*att)->wide = NULL;
+ (*att)->text = NULL;
(*att)->soap = soap;
}
#endif
@@ -10795,15 +12065,16 @@ soap_peek_element(struct soap *soap)
break;
}
if (!tp)
- { tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + strlen(soap->tmpbuf));
+ { size_t l = strlen(soap->tmpbuf);
+ tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + l);
if (!tp)
return soap->error = SOAP_EOM;
- strcpy((char*)tp->name, soap->tmpbuf);
+ soap_strcpy((char*)tp->name, l + 1, soap->tmpbuf);
tp->value = NULL;
tp->size = 0;
tp->ns = NULL;
- /* if attribute name is qualified, append it to the end of the list */
- if (tq && strchr(soap->tmpbuf, ':'))
+ /* append attribute to the end of the list */
+ if (tq)
{ tq->next = tp;
tp->next = NULL;
}
@@ -10815,25 +12086,28 @@ soap_peek_element(struct soap *soap)
while (soap_blank(c))
c = soap_get1(soap);
if (c == '=')
- { do c = soap_getutf8(soap);
+ { size_t k;
+ do c = soap_getutf8(soap);
while (soap_blank(c));
if (c != SOAP_QT && c != SOAP_AP)
{ soap_unget(soap, c);
c = ' '; /* blank delimiter */
}
- if (soap_getattrval(soap, tp->value, tp->size, c))
+ k = tp->size;
+ if (soap_getattrval(soap, tp->value, &k, c))
{
#ifdef WITH_FAST
if (soap->error != SOAP_EOM)
return soap->error;
soap->error = SOAP_OK;
- if (soap_store_lab(soap, tp->value, tp->size))
+ if (soap_store_lab(soap, tp->value, k))
return soap->error;
if (tp->value)
SOAP_FREE(soap, tp->value);
tp->value = NULL;
for (;;)
- { if (soap_getattrval(soap, soap->labbuf + soap->labidx, soap->lablen - soap->labidx, c))
+ { k = soap->lablen - soap->labidx;
+ if (soap_getattrval(soap, soap->labbuf + soap->labidx, &k, c))
{ if (soap->error != SOAP_EOM)
return soap->error;
soap->error = SOAP_OK;
@@ -10851,37 +12125,42 @@ soap_peek_element(struct soap *soap)
if (tp->size < SOAP_LABLEN)
tp->size = SOAP_LABLEN;
}
- if (!(tp->value = (char*)SOAP_MALLOC(soap, tp->size)))
+ tp->value = (char*)SOAP_MALLOC(soap, tp->size);
+ if (!tp->value)
return soap->error = SOAP_EOM;
- strcpy(tp->value, soap->labbuf);
+ soap_strcpy(tp->value, tp->size, soap->labbuf);
#else
- size_t n;
+ tp->size = k;
if (soap->error != SOAP_EOM)
return soap->error;
soap->error = SOAP_OK;
if (soap_new_block(soap) == NULL)
return soap->error;
for (;;)
- { if (!(s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN)))
+ { s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN);
+ if (!s)
return soap->error;
- if (soap_getattrval(soap, s, SOAP_BLKLEN, c))
+ k = SOAP_BLKLEN;
+ if (soap_getattrval(soap, s, &k, c))
{ if (soap->error != SOAP_EOM)
return soap->error;
soap->error = SOAP_OK;
+ soap_size_block(soap, NULL, k);
}
else
break;
}
- n = tp->size + soap->blist->size;
- if (!(s = (char*)SOAP_MALLOC(soap, n)))
+ k = tp->size + soap->blist->size;
+ s = (char*)SOAP_MALLOC(soap, k);
+ if (!s)
return soap->error = SOAP_EOM;
if (tp->value)
- { memcpy(s, tp->value, tp->size);
+ { soap_memcpy((void*)s, k, (const void*)tp->value, tp->size);
SOAP_FREE(soap, tp->value);
}
soap_save_block(soap, NULL, s + tp->size, 0);
tp->value = s;
- tp->size = n;
+ tp->size = k;
#endif
}
do c = soap_get1(soap);
@@ -10889,7 +12168,7 @@ soap_peek_element(struct soap *soap)
tp->visible = 2; /* seen this attribute w/ value */
#ifdef WITH_DOM
if (att)
- (*att)->data = soap_strdup(soap, tp->value);
+ (*att)->text = soap_strdup(soap, tp->value);
#endif
}
else
@@ -10905,16 +12184,18 @@ soap_peek_element(struct soap *soap)
}
#ifdef WITH_DOM
if (att)
- { soap->dom->nstr = soap_current_namespace(soap, soap->tag);
+ { soap->dom->nstr = soap_current_namespace_tag(soap, soap->tag);
for (att = &soap->dom->atts; *att; att = &(*att)->next)
- (*att)->nstr = soap_current_namespace(soap, (*att)->name);
+ (*att)->nstr = soap_current_namespace_att(soap, (*att)->name);
}
#endif
if ((int)c == EOF)
return soap->error = SOAP_CHK_EOF;
- if (!(soap->body = (c != '/')))
- do c = soap_get1(soap);
+ soap->body = (c != '/');
+ if (!soap->body)
+ { do c = soap_get1(soap);
while (soap_blank(c));
+ }
#ifdef WITH_DOM
if (soap->mode & SOAP_XML_DOM)
{ if (!soap->body && soap->dom->prnt)
@@ -10929,32 +12210,30 @@ soap_peek_element(struct soap *soap)
{ if ((soap->version > 0 && !(soap->imode & SOAP_XML_TREE))
|| (soap->mode & SOAP_XML_GRAPH))
{ *soap->id = '#';
- strncpy(soap->id + 1, tp->value, sizeof(soap->id) - 2);
- soap->id[sizeof(soap->id) - 1] = '\0';
+ soap_strcpy(soap->id + 1, sizeof(soap->id) - 1, tp->value);
}
}
else if (!strcmp(tp->name, "href"))
{ if ((soap->version == 1 && !(soap->imode & SOAP_XML_TREE))
|| (soap->mode & SOAP_XML_GRAPH)
- || (soap->mode & SOAP_ENC_MTOM)
- || (soap->mode & SOAP_ENC_DIME))
- { strncpy(soap->href, tp->value, sizeof(soap->href) - 1);
- soap->href[sizeof(soap->href) - 1] = '\0';
- }
+ || ((soap->mode & (SOAP_ENC_MTOM | SOAP_ENC_DIME)) && *tp->value != '#'))
+ soap_strcpy(soap->href, sizeof(soap->href), tp->value);
}
else if (!strcmp(tp->name, "ref"))
{ if ((soap->version == 2 && !(soap->imode & SOAP_XML_TREE))
|| (soap->mode & SOAP_XML_GRAPH))
{ *soap->href = '#';
- strncpy(soap->href + (*tp->value != '#'), tp->value, sizeof(soap->href) - 2);
- soap->href[sizeof(soap->href) - 1] = '\0';
+ soap_strcpy(soap->href + (*tp->value != '#'), sizeof(soap->href) - 1, tp->value);
}
}
- else
+#else
+ if (!strcmp(tp->name, "href"))
+ { if ((soap->mode & (SOAP_ENC_MTOM | SOAP_ENC_DIME)) && *tp->value != '#')
+ soap_strcpy(soap->href, sizeof(soap->href), tp->value);
+ }
#endif
- if (!soap_match_tag(soap, tp->name, "xsi:type"))
- { strncpy(soap->type, tp->value, sizeof(soap->type) - 1);
- soap->type[sizeof(soap->type) - 1] = '\0';
+ else if (!soap_match_tag(soap, tp->name, "xsi:type"))
+ { soap_strcpy(soap->type, sizeof(soap->type), tp->value);
}
else if ((!soap_match_tag(soap, tp->name, "xsi:null")
|| !soap_match_tag(soap, tp->name, "xsi:nil"))
@@ -10962,21 +12241,24 @@ soap_peek_element(struct soap *soap)
|| !strcmp(tp->value, "true")))
{ soap->null = 1;
}
+ else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:encodingStyle"))
+ { if (!soap->encodingStyle)
+ soap->encodingStyle = SOAP_STR_EOS;
+ soap_get_version(soap);
+ }
else if (soap->version == 1)
- { if (!soap_match_tag(soap, tp->name, "SOAP-ENC:arrayType"))
+ {
+ if (!soap_match_tag(soap, tp->name, "SOAP-ENC:arrayType"))
{ s = soap_strrchr(tp->value, '[');
if (s && (size_t)(s - tp->value) < sizeof(soap->arrayType))
- { strncpy(soap->arrayType, tp->value, s - tp->value);
- soap->arrayType[s - tp->value] = '\0';
- strncpy(soap->arraySize, s, sizeof(soap->arraySize));
+ { soap_strncpy(soap->arrayType, sizeof(soap->arrayType), tp->value, s - tp->value);
+ soap_strcpy(soap->arraySize, sizeof(soap->arraySize), s);
}
else
- strncpy(soap->arrayType, tp->value, sizeof(soap->arrayType));
- soap->arraySize[sizeof(soap->arraySize) - 1] = '\0';
- soap->arrayType[sizeof(soap->arrayType) - 1] = '\0';
+ soap_strcpy(soap->arrayType, sizeof(soap->arrayType), tp->value);
}
else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:offset"))
- strncpy(soap->arrayOffset, tp->value, sizeof(soap->arrayOffset));
+ soap_strcpy(soap->arrayOffset, sizeof(soap->arrayOffset), tp->value);
else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:position"))
soap->position = soap_getposition(tp->value, soap->positions);
else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:root"))
@@ -10995,20 +12277,18 @@ soap_peek_element(struct soap *soap)
#ifndef WITH_NOIDREF
if (!soap_match_tag(soap, tp->name, "SOAP-ENC:id"))
{ *soap->id = '#';
- strncpy(soap->id + 1, tp->value, sizeof(soap->id) - 2);
- soap->id[sizeof(soap->id) - 1] = '\0';
+ soap_strcpy(soap->id + 1, sizeof(soap->id) - 1, tp->value);
}
else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:ref"))
{ *soap->href = '#';
- strncpy(soap->href + (*tp->value != '#'), tp->value, sizeof(soap->href) - 2);
- soap->href[sizeof(soap->href) - 1] = '\0';
+ soap_strcpy(soap->href + (*tp->value != '#'), sizeof(soap->href) - 1, tp->value);
}
else
#endif
if (!soap_match_tag(soap, tp->name, "SOAP-ENC:itemType"))
- strncpy(soap->arrayType, tp->value, sizeof(soap->arrayType) - 1);
+ soap_strcpy(soap->arrayType, sizeof(soap->arrayType), tp->value);
else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:arraySize"))
- strncpy(soap->arraySize, tp->value, sizeof(soap->arraySize) - 1);
+ soap_strcpy(soap->arraySize, sizeof(soap->arraySize), tp->value);
else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:mustUnderstand")
&& (!strcmp(tp->value, "1") || !strcmp(tp->value, "true")))
soap->mustUnderstand = 1;
@@ -11033,6 +12313,7 @@ soap_peek_element(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void
@@ -11044,6 +12325,7 @@ soap_retry(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void
@@ -11059,21 +12341,68 @@ soap_revert(struct soap *soap)
#endif
/******************************************************************************/
+
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_ignore(struct soap *soap)
+{ int n = 0;
+ soap_wchar c;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Ignoring XML content at level=%u\n", soap->level));
+#ifdef WITH_DOM
+ if ((soap->mode & SOAP_XML_DOM) && soap->dom)
+ { if (!soap_string_in(soap, -1, -1, -1, NULL))
+ return soap->error;
+ return SOAP_OK;
+ }
+#endif
+ for (;;)
+ { c = soap_get(soap);
+ switch (c)
+ { case SOAP_TT:
+ if (n == 0)
+ goto end;
+ n--;
+ break;
+ case SOAP_LT:
+ n++;
+ break;
+ case '/':
+ if (n > 0)
+ { c = soap_getchar(soap);
+ if (c == '>')
+ n--;
+ }
+ break;
+ default:
+ if ((int)c == EOF)
+ goto end;
+ }
+ }
+end:
+ soap_unget(soap, c);
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_string_out(struct soap *soap, const char *s, int flag)
-{ register const char *t;
- register soap_wchar c;
- register soap_wchar mask = (soap_wchar)0xFFFFFF80UL;
+{ const char *t;
+ soap_wchar c;
+ soap_wchar mask = (soap_wchar)0xFFFFFF80UL;
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- { soap->dom->data = soap_strdup(soap, s);
+ { soap->dom->text = soap_strdup(soap, s);
return SOAP_OK;
}
#endif
- if (flag == 2 || soap->mode & SOAP_C_UTFSTRING)
+ if (flag == 2 || (soap->mode & SOAP_C_UTFSTRING))
mask = 0;
t = s;
while ((c = *t++))
@@ -11093,11 +12422,6 @@ soap_string_out(struct soap *soap, const char *s, int flag)
s = t;
}
break;
- case 0x0D:
- if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&#xD;", 5))
- return soap->error;
- s = t;
- break;
case '&':
if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&amp;", 5))
return soap->error;
@@ -11122,12 +12446,17 @@ soap_string_out(struct soap *soap, const char *s, int flag)
s = t;
}
break;
+ case 0x7F:
+ if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&#x7F;", 6))
+ return soap->error;
+ s = t;
+ break;
default:
#ifndef WITH_LEANER
#ifdef HAVE_MBTOWC
if (soap->mode & SOAP_C_MBSTRING)
{ wchar_t wc;
- register int m = mbtowc(&wc, t - 1, MB_CUR_MAX);
+ int m = mbtowc(&wc, t - 1, MB_CUR_MAX);
if (m > 0 && !((soap_wchar)wc == c && m == 1 && c < 0x80))
{ if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, (unsigned long)wc))
return soap->error;
@@ -11151,47 +12480,51 @@ soap_string_out(struct soap *soap, const char *s, int flag)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
char *
SOAP_FMAC2
-soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
-{ register char *s;
+soap_string_in(struct soap *soap, int flag, long minlen, long maxlen, const char *pattern)
+{ char *s;
char *t = NULL;
- register size_t i;
- register long l = 0;
- register int n = 0, f = 0, m = 0;
- register soap_wchar c;
+ size_t i;
+ long l = 0;
+ int n = 0, f = 0, m = 0;
+ soap_wchar c;
#if !defined(WITH_LEANER) && defined(HAVE_WCTOMB)
char buf[MB_LEN_MAX > 8 ? MB_LEN_MAX : 8];
#else
char buf[8];
#endif
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Reading string content, flag=%d\n", flag));
- if (soap->peeked && *soap->tag)
+ if (maxlen < 0 && soap->maxlength > 0)
+ maxlen = soap->maxlength;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reading string content, flag=%d\n", flag));
+ if (flag <= 0 && soap->peeked && *soap->tag)
{
#ifndef WITH_LEAN
struct soap_attribute *tp;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "String content includes tag '%s' and attributes\n", soap->tag));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String content includes tag '%s' and attributes\n", soap->tag));
t = soap->tmpbuf;
*t = '<';
- strncpy(t + 1, soap->tag, sizeof(soap->tmpbuf) - 2);
- t[sizeof(soap->tmpbuf) - 1] = '\0';
+ soap_strcpy(t + 1, sizeof(soap->tmpbuf) - 1, soap->tag);
t += strlen(t);
for (tp = soap->attributes; tp; tp = tp->next)
{ if (tp->visible)
- { if (t >= soap->tmpbuf + sizeof(soap->tmpbuf) - 2)
- break;
+ { size_t l = strlen(tp->name);
+ if (t + l + 1 >= soap->tmpbuf + sizeof(soap->tmpbuf))
+ break; /* too many or attribute values to large */
*t++ = ' ';
- strcpy(t, tp->name);
- t += strlen(t);
- if (t >= soap->tmpbuf + sizeof(soap->tmpbuf) - 2)
- break; /* too many or large attribute values */
+ soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->name, l);
+ t += l;
if (tp->value)
- { *t++ = '=';
+ { l = strlen(tp->value);
+ if (t + l + 3 >= soap->tmpbuf + sizeof(soap->tmpbuf))
+ break; /* too many or attribute values to large */
+ *t++ = '=';
*t++ = '"';
- strcpy(t, tp->value);
- t += strlen(t);
+ soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->value, l);
+ t += l;
*t++ = '"';
}
}
@@ -11209,10 +12542,10 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
soap->peeked = 0;
}
#ifdef WITH_CDATA
- if (!flag)
- { register int state = 0;
+ if (flag <= 0)
+ { int state = 0;
#ifdef WITH_FAST
- soap->labidx = 0; /* use look-aside buffer */
+ soap->labidx = 0; /* use look-aside buffer */
#else
if (soap_new_block(soap) == NULL)
return NULL;
@@ -11220,20 +12553,21 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
for (;;)
{
#ifdef WITH_FAST
- register size_t k;
- if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */
+ size_t k;
+ if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */
return NULL;
- s = soap->labbuf + soap->labidx; /* space to populate */
- k = soap->lablen - soap->labidx; /* number of bytes available */
- soap->labidx = soap->lablen; /* claim this space */
+ s = soap->labbuf + soap->labidx; /* space to populate */
+ k = soap->lablen - soap->labidx; /* number of bytes available */
+ soap->labidx = soap->lablen; /* claim this space */
#else
- register size_t k = SOAP_BLKLEN;
- if (!(s = (char*)soap_push_block(soap, NULL, k)))
+ size_t k = SOAP_BLKLEN;
+ s = (char*)soap_push_block(soap, NULL, k);
+ if (!s)
return NULL;
#endif
for (i = 0; i < k; i++)
{ if (m > 0)
- { *s++ = *t++; /* copy multibyte characters */
+ { *s++ = *t++; /* copy multibyte characters */
m--;
continue;
}
@@ -11245,7 +12579,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
{ soap_unget(soap, c);
c = soap_getutf8(soap);
}
- if ((c & 0x7FFFFFFF) >= 0x80 && (!flag || (soap->mode & SOAP_C_UTFSTRING)))
+ if ((c & 0x7FFFFFFF) >= 0x80 && (flag <= 0 || (soap->mode & SOAP_C_UTFSTRING)))
{ c &= 0x7FFFFFFF;
t = buf;
if (c < 0x0800)
@@ -11303,7 +12637,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
case 5:
if (c == '>')
state = 0;
- else if (c != ']')
+ else if (c != ']')
state = 1;
*s++ = (char)c;
continue;
@@ -11342,7 +12676,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
m = 1;
break;
case SOAP_LT:
- if (f && n == 0)
+ if (flag == 3 || (f && n == 0))
goto end;
n++;
*s++ = '<';
@@ -11386,7 +12720,8 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
state = 1;
}
else if (c == '-')
- { if ((c = soap_getchar(soap)) == '-')
+ { c = soap_getchar(soap);
+ if (c == '-')
state = 2;
t = (char*)"!-";
m = 2;
@@ -11402,7 +12737,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
}
else if (c == '?')
state = 3;
- else if (f && n == 0)
+ else if (flag == 3 || (f && n == 0))
{ soap_revget1(soap);
c = '<';
goto end;
@@ -11422,7 +12757,13 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
#ifndef WITH_LEANER
#ifdef HAVE_WCTOMB
if (soap->mode & SOAP_C_MBSTRING)
- { m = wctomb(buf, (wchar_t)(c & 0x7FFFFFFF));
+ {
+#ifdef WIN32
+ m = 0;
+ wctomb_s(&m, buf, sizeof(buf), (wchar_t)(c & 0x7FFFFFFF));
+#else
+ m = wctomb(buf, (wchar_t)(c & 0x7FFFFFFF));
+#endif
if (m >= 1 && m <= (int)MB_CUR_MAX)
{ t = buf;
*s++ = *t++;
@@ -11440,7 +12781,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
}
l++;
if (maxlen >= 0 && l > maxlen)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
soap->error = SOAP_LENGTH;
return NULL;
}
@@ -11449,7 +12790,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
}
#endif
#ifdef WITH_FAST
- soap->labidx = 0; /* use look-aside buffer */
+ soap->labidx = 0; /* use look-aside buffer */
#else
if (soap_new_block(soap) == NULL)
return NULL;
@@ -11457,62 +12798,69 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
for (;;)
{
#ifdef WITH_FAST
- register size_t k;
- if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */
+ size_t k;
+ if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */
return NULL;
- s = soap->labbuf + soap->labidx; /* space to populate */
- k = soap->lablen - soap->labidx; /* number of bytes available */
- soap->labidx = soap->lablen; /* claim this space */
+ s = soap->labbuf + soap->labidx; /* space to populate */
+ k = soap->lablen - soap->labidx; /* number of bytes available */
+ soap->labidx = soap->lablen; /* claim this space */
#else
- register size_t k = SOAP_BLKLEN;
- if (!(s = (char*)soap_push_block(soap, NULL, k)))
+ size_t k = SOAP_BLKLEN;
+ s = (char*)soap_push_block(soap, NULL, k);
+ if (!s)
return NULL;
#endif
for (i = 0; i < k; i++)
{ if (m > 0)
- { *s++ = *t++; /* copy multibyte characters */
+ { *s++ = *t++; /* copy multibyte characters */
m--;
continue;
}
#ifndef WITH_CDATA
- if (!flag)
+ if (flag <= 0)
c = soap_getchar(soap);
else
#endif
- if ((soap->mode & SOAP_C_UTFSTRING))
- { if (((c = soap_get(soap)) & 0x80000000) && c >= -0x7FFFFF80 && c < SOAP_AP)
- { c &= 0x7FFFFFFF;
- t = buf;
- if (c < 0x0800)
- *t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
- else
- { if (c < 0x010000)
- *t++ = (char)(0xE0 | ((c >> 12) & 0x0F));
+ { c = soap_getutf8(soap);
+ if ((soap->mode & SOAP_C_UTFSTRING))
+ { if (c >= 0x80 || (c < SOAP_AP && c >= -0x7FFFFF80))
+ { c &= 0x7FFFFFFF;
+ t = buf;
+ if (c < 0x0800)
+ *t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
else
- { if (c < 0x200000)
- *t++ = (char)(0xF0 | ((c >> 18) & 0x07));
+ { if (c < 0x010000)
+ *t++ = (char)(0xE0 | ((c >> 12) & 0x0F));
else
- { if (c < 0x04000000)
- *t++ = (char)(0xF8 | ((c >> 24) & 0x03));
+ { if (c < 0x200000)
+ *t++ = (char)(0xF0 | ((c >> 18) & 0x07));
else
- { *t++ = (char)(0xFC | ((c >> 30) & 0x01));
- *t++ = (char)(0x80 | ((c >> 24) & 0x3F));
+ { if (c < 0x04000000)
+ *t++ = (char)(0xF8 | ((c >> 24) & 0x03));
+ else
+ { *t++ = (char)(0xFC | ((c >> 30) & 0x01));
+ *t++ = (char)(0x80 | ((c >> 24) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 18) & 0x3F));
}
- *t++ = (char)(0x80 | ((c >> 18) & 0x3F));
+ *t++ = (char)(0x80 | ((c >> 12) & 0x3F));
}
- *t++ = (char)(0x80 | ((c >> 12) & 0x3F));
+ *t++ = (char)(0x80 | ((c >> 6) & 0x3F));
}
- *t++ = (char)(0x80 | ((c >> 6) & 0x3F));
+ *t++ = (char)(0x80 | (c & 0x3F));
+ m = (int)(t - buf) - 1;
+ t = buf;
+ *s++ = *t++;
+ l++;
+ if (maxlen >= 0 && l > maxlen)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
+ soap->error = SOAP_LENGTH;
+ return NULL;
+ }
+ continue;
}
- *t++ = (char)(0x80 | (c & 0x3F));
- m = (int)(t - buf) - 1;
- t = buf;
- *s++ = *t++;
- continue;
}
}
- else
- c = soap_getutf8(soap);
switch (c)
{
case SOAP_TT:
@@ -11524,7 +12872,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
m = 1;
break;
case SOAP_LT:
- if (f && n == 0)
+ if (flag == 3 || (f && n == 0))
goto end;
n++;
*s++ = '<';
@@ -11540,22 +12888,22 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
break;
case '/':
if (n > 0)
- { if (!flag)
- { c = soap_getchar(soap);
- if (c == '>')
- n--;
- }
- else
- { c = soap_get(soap);
+ { if (flag > 0)
+ { c = soap_get(soap);
if (c == SOAP_GT)
n--;
- }
+ }
+ else
+ { c = soap_getchar(soap);
+ if (c == '>')
+ n--;
+ }
soap_unget(soap, c);
}
*s++ = '/';
break;
case (soap_wchar)('<' | 0x80000000):
- if (flag)
+ if (flag > 0)
*s++ = '<';
else
{ *s++ = '&';
@@ -11564,7 +12912,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
}
break;
case (soap_wchar)('>' | 0x80000000):
- if (flag)
+ if (flag > 0)
*s++ = '>';
else
{ *s++ = '&';
@@ -11573,7 +12921,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
}
break;
case (soap_wchar)('&' | 0x80000000):
- if (flag)
+ if (flag > 0)
*s++ = '&';
else
{ *s++ = '&';
@@ -11582,7 +12930,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
}
break;
case (soap_wchar)('"' | 0x80000000):
- if (flag)
+ if (flag > 0)
*s++ = '"';
else
{ *s++ = '&';
@@ -11591,7 +12939,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
}
break;
case (soap_wchar)('\'' | 0x80000000):
- if (flag)
+ if (flag > 0)
*s++ = '\'';
else
{ *s++ = '&';
@@ -11603,28 +12951,31 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
if ((int)c == EOF)
goto end;
#ifndef WITH_CDATA
- if (c == '<' && !flag)
- { if (f && n == 0)
+ if (c == '<')
+ { c = soap_getchar(soap);
+ soap_unget(soap, c);
+ if (c == '/')
+ { c = SOAP_TT;
+ if (n == 0)
goto end;
- c = soap_getchar(soap);
- soap_unget(soap, c);
- if (c == '/')
- { c = SOAP_TT;
- if (n == 0)
- goto end;
- n--;
- }
- else
- n++;
- *s++ = '<';
- break;
+ n--;
+ }
+ else
+ n++;
+ *s++ = '<';
}
else
#endif
#ifndef WITH_LEANER
#ifdef HAVE_WCTOMB
if (soap->mode & SOAP_C_MBSTRING)
- { m = wctomb(buf, (wchar_t)(c & 0x7FFFFFFF));
+ {
+#ifdef WIN32
+ m = 0;
+ wctomb_s(&m, buf, sizeof(buf), (wchar_t)(c & 0x7FFFFFFF));
+#else
+ m = wctomb(buf, (wchar_t)(c & 0x7FFFFFFF));
+#endif
if (m >= 1 && m <= (int)MB_CUR_MAX)
{ t = buf;
*s++ = *t++;
@@ -11642,7 +12993,7 @@ soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
}
l++;
if (maxlen >= 0 && l > maxlen)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
soap->error = SOAP_LENGTH;
return NULL;
}
@@ -11655,29 +13006,38 @@ end:
t = soap_strdup(soap, soap->labbuf);
#else
soap_size_block(soap, NULL, i + 1);
- t = soap_save_block(soap, NULL, 0);
+ t = soap_save_block(soap, NULL, NULL, 0);
#endif
if (l < minlen)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "String too short: %ld chars, minlen=%ld\n", l, minlen));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too short: %ld chars, minlen=%ld\n", l, minlen));
soap->error = SOAP_LENGTH;
return NULL;
}
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- { if (flag == 3)
- soap->dom->tail = t;
+ { if (flag > 0)
+ soap->dom->text = t;
else
- soap->dom->data = t;
+ soap->dom->code = t;
}
#endif
if (flag == 2)
- if (soap_s2QName(soap, t, &t, minlen, maxlen))
+ { if (soap_s2QName(soap, t, &t, minlen, maxlen, pattern))
+ return NULL;
+ }
+#ifndef WITH_LEANER
+ else if (pattern && soap->fsvalidate)
+ { soap->error = soap->fsvalidate(soap, pattern, t);
+ if (soap->error)
return NULL;
+ }
+#endif
return t;
}
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_2
SOAP_FMAC1
@@ -11686,16 +13046,10 @@ SOAP_FMAC2
soap_wstring_out(struct soap *soap, const wchar_t *s, int flag)
{ const char *t;
char tmp;
- register soap_wchar c;
+ soap_wchar c;
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- { wchar_t *r = (wchar_t*)s;
- int n = 1;
- while (*r++)
- n++;
- soap->dom->wide = r = (wchar_t*)soap_malloc(soap, n * sizeof(wchar_t));
- while (n--)
- *r++ = *s++;
+ { soap->dom->text = soap_wchar2s(soap, s);
return SOAP_OK;
}
#endif
@@ -11744,7 +13098,7 @@ soap_wstring_out(struct soap *soap, const wchar_t *s, int flag)
else
{ /* check for UTF16 encoding when wchar_t is too small to hold UCS */
if (sizeof(wchar_t) < 4 && (c & 0xFC00) == 0xD800)
- { register soap_wchar d = *s++;
+ { soap_wchar d = *s++;
if ((d & 0xFC00) == 0xDC00)
c = ((c - 0xD800) << 10) + (d - 0xDC00) + 0x10000;
else
@@ -11764,62 +13118,65 @@ soap_wstring_out(struct soap *soap, const wchar_t *s, int flag)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_2
SOAP_FMAC1
wchar_t *
SOAP_FMAC2
-soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
+soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen, const char *pattern)
{ wchar_t *s;
- register int i, n = 0, f = 0;
- register long l = 0;
- register soap_wchar c;
+ int i, n = 0, f = 0;
+ long l = 0;
+ soap_wchar c;
char *t = NULL;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Reading wide string content\n"));
- if (soap->peeked)
- { if (*soap->tag)
- {
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reading wide string content\n"));
+ if (maxlen < 0 && soap->maxlength > 0)
+ maxlen = soap->maxlength;
+ if (flag <= 0 && soap->peeked && *soap->tag)
+ {
#ifndef WITH_LEAN
- struct soap_attribute *tp;
- t = soap->tmpbuf;
- *t = '<';
- strncpy(t + 1, soap->tag, sizeof(soap->tmpbuf) - 2);
- t[sizeof(soap->tmpbuf) - 1] = '\0';
- t += strlen(t);
- for (tp = soap->attributes; tp; tp = tp->next)
- { if (tp->visible)
- { if (t >= soap->tmpbuf + sizeof(soap->tmpbuf) - 2)
- break;
- *t++ = ' ';
- strcpy(t, tp->name);
- t += strlen(t);
- if (t >= soap->tmpbuf + sizeof(soap->tmpbuf) - 2)
+ struct soap_attribute *tp;
+ t = soap->tmpbuf;
+ *t = '<';
+ soap_strcpy(t + 1, sizeof(soap->tmpbuf) - 1, soap->tag);
+ t += strlen(t);
+ for (tp = soap->attributes; tp; tp = tp->next)
+ { if (tp->visible)
+ { size_t l = strlen(tp->name);
+ if (t + l + 1 >= soap->tmpbuf + sizeof(soap->tmpbuf))
+ break;
+ *t++ = ' ';
+ soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->name, l);
+ t += l;
+ if (tp->value)
+ { l = strlen(tp->value);
+ if (t + l + 3 >= soap->tmpbuf + sizeof(soap->tmpbuf))
break;
- if (tp->value)
- { *t++ = '=';
- *t++ = '"';
- strcpy(t, tp->value);
- t += strlen(t);
- *t++ = '"';
- }
+ *t++ = '=';
+ *t++ = '"';
+ soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->value, l);
+ t += l;
+ *t++ = '"';
}
}
- if (!soap->body)
- *t++ = '/';
- *t++ = '>';
- *t = '\0';
- t = soap->tmpbuf;
-#endif
- if (soap->body)
- n = 1;
- f = 1;
- soap->peeked = 0;
}
+ if (!soap->body)
+ *t++ = '/';
+ *t++ = '>';
+ *t = '\0';
+ t = soap->tmpbuf;
+#endif
+ if (soap->body)
+ n = 1;
+ f = 1;
+ soap->peeked = 0;
}
if (soap_new_block(soap) == NULL)
return NULL;
for (;;)
- { if (!(s = (wchar_t*)soap_push_block(soap, NULL, sizeof(wchar_t)*SOAP_BLKLEN)))
+ { s = (wchar_t*)soap_push_block(soap, NULL, sizeof(wchar_t)*SOAP_BLKLEN);
+ if (!s)
return NULL;
for (i = 0; i < SOAP_BLKLEN; i++)
{ if (t)
@@ -11839,7 +13196,7 @@ soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
soap_unget(soap, '/');
break;
case SOAP_LT:
- if (f && n == 0)
+ if (flag == 3 || (f && n == 0))
goto end;
n++;
*s++ = '<';
@@ -11863,7 +13220,7 @@ soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
*s++ = '/';
break;
case '<':
- if (flag)
+ if (flag > 0)
*s++ = (soap_wchar)'<';
else
{ *s++ = (soap_wchar)'&';
@@ -11871,7 +13228,7 @@ soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
}
break;
case '>':
- if (flag)
+ if (flag > 0)
*s++ = (soap_wchar)'>';
else
{ *s++ = (soap_wchar)'&';
@@ -11879,7 +13236,7 @@ soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
}
break;
case '"':
- if (flag)
+ if (flag > 0)
*s++ = (soap_wchar)'"';
else
{ *s++ = (soap_wchar)'&';
@@ -11891,7 +13248,7 @@ soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
goto end;
/* use UTF16 encoding when wchar_t is too small to hold UCS */
if (sizeof(wchar_t) < 4 && c > 0xFFFF)
- { register soap_wchar c1, c2;
+ { soap_wchar c1, c2;
c1 = 0xD800 - (0x10000 >> 10) + (c >> 10);
c2 = 0xDC00 + (c & 0x3FF);
c = c1;
@@ -11901,7 +13258,7 @@ soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
}
l++;
if (maxlen >= 0 && l > maxlen)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
soap->error = SOAP_LENGTH;
return NULL;
}
@@ -11912,14 +13269,21 @@ end:
*s = '\0';
soap_size_block(soap, NULL, sizeof(wchar_t) * (i + 1));
if (l < minlen)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "String too short: %ld chars, minlen=%ld\n", l, minlen));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too short: %ld chars, minlen=%ld\n", l, minlen));
soap->error = SOAP_LENGTH;
return NULL;
}
s = (wchar_t*)soap_save_block(soap, NULL, NULL, 0);
+#ifndef WITH_LEANER
+ if (pattern && soap->fwvalidate)
+ { soap->error = soap->fwvalidate(soap, pattern, s);
+ if (soap->error)
+ return NULL;
+ }
+#endif
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- soap->dom->wide = s;
+ soap->dom->text = soap_wchar2s(soap, s);
#endif
return s;
}
@@ -11927,6 +13291,7 @@ end:
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
@@ -11937,6 +13302,7 @@ soap_int2s(struct soap *soap, int n)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -11950,6 +13316,7 @@ soap_outint(struct soap *soap, const char *tag, int id, const int *p, const char
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -11982,6 +13349,7 @@ soap_s2int(struct soap *soap, const char *s, int *p)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int *
@@ -11999,10 +13367,12 @@ soap_inint(struct soap *soap, const char *tag, int *p, const char *type, int t)
soap_revert(soap);
return NULL;
}
+#else
+ (void)type;
#endif
- p = (int*)soap_id_enter(soap, soap->id, p, t, sizeof(int), 0, NULL, NULL, NULL);
+ p = (int*)soap_id_enter(soap, soap->id, p, t, sizeof(int), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (int*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(int), 0, NULL);
+ p = (int*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(int), 0, NULL, NULL);
else if (p)
{ if (soap_s2int(soap, soap_value(soap), p))
return NULL;
@@ -12014,22 +13384,19 @@ soap_inint(struct soap *soap, const char *tag, int *p, const char *type, int t)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_long2s(struct soap *soap, long n)
-{
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%ld", n);
-#else
- sprintf(soap->tmpbuf, "%ld", n);
-#endif
+{ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), "%ld", n);
return soap->tmpbuf;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12043,6 +13410,7 @@ soap_outlong(struct soap *soap, const char *tag, int id, const long *p, const ch
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12070,6 +13438,7 @@ soap_s2long(struct soap *soap, const char *s, long *p)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
long *
@@ -12087,10 +13456,12 @@ soap_inlong(struct soap *soap, const char *tag, long *p, const char *type, int t
soap_revert(soap);
return NULL;
}
+#else
+ (void)type;
#endif
- p = (long*)soap_id_enter(soap, soap->id, p, t, sizeof(long), 0, NULL, NULL, NULL);
+ p = (long*)soap_id_enter(soap, soap->id, p, t, sizeof(long), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (long*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(long), 0, NULL);
+ p = (long*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(long), 0, NULL, NULL);
else if (p)
{ if (soap_s2long(soap, soap_value(soap), p))
return NULL;
@@ -12102,22 +13473,19 @@ soap_inlong(struct soap *soap, const char *tag, long *p, const char *type, int t
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_LONG642s(struct soap *soap, LONG64 n)
-{
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), SOAP_LONG_FORMAT, n);
-#else
- sprintf(soap->tmpbuf, SOAP_LONG_FORMAT, n);
-#endif
+{ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), SOAP_LONG_FORMAT, n);
return soap->tmpbuf;
}
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
int
@@ -12131,15 +13499,14 @@ soap_outLONG64(struct soap *soap, const char *tag, int id, const LONG64 *p, cons
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
int
SOAP_FMAC2
soap_s2LONG64(struct soap *soap, const char *s, LONG64 *p)
{ if (s)
- {
-#ifdef HAVE_STRTOLL
- char *r;
+ { char *r;
#ifndef WITH_NOIO
#ifndef WITH_LEAN
soap_reset_errno;
@@ -12153,11 +13520,6 @@ soap_s2LONG64(struct soap *soap, const char *s, LONG64 *p)
#endif
#endif
)
-#else
-# ifdef HAVE_SSCANF
- if (sscanf(s, SOAP_LONG_FORMAT, p) != 1)
-# endif
-#endif
soap->error = SOAP_TYPE;
}
return soap->error;
@@ -12165,6 +13527,7 @@ soap_s2LONG64(struct soap *soap, const char *s, LONG64 *p)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
LONG64 *
@@ -12189,9 +13552,9 @@ soap_inLONG64(struct soap *soap, const char *tag, LONG64 *p, const char *type, i
return NULL;
}
#endif
- p = (LONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(LONG64), 0, NULL, NULL, NULL);
+ p = (LONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(LONG64), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (LONG64*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(LONG64), 0, NULL);
+ p = (LONG64*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(LONG64), 0, NULL, NULL);
else if (p)
{ if (soap_s2LONG64(soap, soap_value(soap), p))
return NULL;
@@ -12203,6 +13566,7 @@ soap_inLONG64(struct soap *soap, const char *tag, LONG64 *p, const char *type, i
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
@@ -12213,6 +13577,7 @@ soap_byte2s(struct soap *soap, char n)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12226,6 +13591,7 @@ soap_outbyte(struct soap *soap, const char *tag, int id, const char *p, const ch
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12244,6 +13610,7 @@ soap_s2byte(struct soap *soap, const char *s, char *p)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
char *
@@ -12259,10 +13626,12 @@ soap_inbyte(struct soap *soap, const char *tag, char *p, const char *type, int t
soap_revert(soap);
return NULL;
}
+#else
+ (void)type;
#endif
- p = (char*)soap_id_enter(soap, soap->id, p, t, sizeof(char), 0, NULL, NULL, NULL);
+ p = (char*)soap_id_enter(soap, soap->id, p, t, sizeof(char), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (char*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(char), 0, NULL);
+ p = (char*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(char), 0, NULL, NULL);
else if (p)
{ if (soap_s2byte(soap, soap_value(soap), p))
return NULL;
@@ -12274,6 +13643,7 @@ soap_inbyte(struct soap *soap, const char *tag, char *p, const char *type, int t
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
@@ -12284,6 +13654,7 @@ soap_short2s(struct soap *soap, short n)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12297,6 +13668,7 @@ soap_outshort(struct soap *soap, const char *tag, int id, const short *p, const
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12315,6 +13687,7 @@ soap_s2short(struct soap *soap, const char *s, short *p)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
short *
@@ -12331,10 +13704,12 @@ soap_inshort(struct soap *soap, const char *tag, short *p, const char *type, int
soap_revert(soap);
return NULL;
}
+#else
+ (void)type;
#endif
- p = (short*)soap_id_enter(soap, soap->id, p, t, sizeof(short), 0, NULL, NULL, NULL);
+ p = (short*)soap_id_enter(soap, soap->id, p, t, sizeof(short), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (short*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(short), 0, NULL);
+ p = (short*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(short), 0, NULL, NULL);
else if (p)
{ if (soap_s2short(soap, soap_value(soap), p))
return NULL;
@@ -12346,31 +13721,31 @@ soap_inshort(struct soap *soap, const char *tag, short *p, const char *type, int
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_float2s(struct soap *soap, float n)
-{ char *s;
+{
+#if !defined(WITH_C_LOCALE) || !defined(HAVE_SPRINTF_L)
+ char *s;
+#endif
if (soap_isnan((double)n))
return "NaN";
if (soap_ispinff(n))
return "INF";
if (soap_isninff(n))
return "-INF";
-#if defined(HAVE_SPRINTF_L)
+#if defined(WITH_C_LOCALE) && defined(HAVE_SPRINTF_L)
# ifdef WIN32
- _sprintf_s_l(soap->tmpbuf, _countof(soap->tmpbuf), soap->float_format, soap->c_locale, n);
+ _sprintf_s_l(soap->tmpbuf, _countof(soap->tmpbuf), soap->float_format, SOAP_LOCALE(soap), n);
# else
- sprintf_l(soap->tmpbuf, soap->c_locale, soap->float_format, n);
+ sprintf_l(soap->tmpbuf, SOAP_LOCALE(soap), soap->float_format, n);
# endif
#else
-# ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), soap->float_format, n);
-# else
- sprintf(soap->tmpbuf, soap->float_format, n);
-# endif
- s = strchr(soap->tmpbuf, ','); /* convert decimal comma to DP */
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), soap->float_format, n);
+ s = strchr(soap->tmpbuf, ','); /* convert decimal comma to DP */
if (s)
*s = '.';
#endif
@@ -12379,6 +13754,7 @@ soap_float2s(struct soap *soap, float n)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12392,6 +13768,7 @@ soap_outfloat(struct soap *soap, const char *tag, int id, const float *p, const
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12411,38 +13788,43 @@ soap_s2float(struct soap *soap, const char *s, float *p)
else
{
/* On some systems strtof requires -std=c99 or does not even link: so we try to use strtod first */
-#if defined(HAVE_STRTOD_L)
+#if defined(WITH_C_LOCALE) && defined(HAVE_STRTOD_L)
char *r;
# ifdef WIN32
- *p = (float)_strtod_l(s, &r, soap->c_locale);
+ *p = (float)_strtod_l(s, &r, SOAP_LOCALE(soap));
# else
- *p = (float)strtod_l(s, &r, soap->c_locale);
+ *p = (float)strtod_l(s, &r, SOAP_LOCALE(soap));
# endif
if (*r)
+ soap->error = SOAP_TYPE;
#elif defined(HAVE_STRTOD)
char *r;
*p = (float)strtod(s, &r);
if (*r)
-#elif defined(HAVE_STRTOF_L)
+ soap->error = SOAP_TYPE;
+#elif defined(WITH_C_LOCALE) && defined(HAVE_STRTOF_L)
char *r;
- *p = strtof_l((char*)s, &r, soap->c_locale);
+ *p = strtof_l((char*)s, &r, SOAP_LOCALE(soap));
if (*r)
+ soap->error = SOAP_TYPE;
#elif defined(HAVE_STRTOF)
char *r;
*p = strtof((char*)s, &r);
if (*r)
-#endif
- {
-#if defined(HAVE_SSCANF_L) && !defined(HAVE_STRTOF_L) && !defined(HAVE_STRTOD_L)
- if (sscanf_l(s, soap->c_locale, "%f", p) != 1)
- soap->error = SOAP_TYPE;
+ soap->error = SOAP_TYPE;
+#elif defined(WITH_C_LOCALE) && defined(HAVE_SSCANF_L) && !defined(HAVE_STRTOF_L) && !defined(HAVE_STRTOD_L)
+ double n;
+ if (sscanf_l(s, SOAP_LOCALE(soap), "%lf", &n) != 1)
+ soap->error = SOAP_TYPE;
+ *p = (float)n;
#elif defined(HAVE_SSCANF)
- if (sscanf(s, "%f", p) != 1)
- soap->error = SOAP_TYPE;
-#else
+ double n;
+ if (sscanf(s, "%lf", &n) != 1)
soap->error = SOAP_TYPE;
+ *p = (float)n;
+#else
+ soap->error = SOAP_TYPE;
#endif
- }
}
}
return soap->error;
@@ -12450,6 +13832,7 @@ soap_s2float(struct soap *soap, const char *s, float *p)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
static int soap_isnumeric(struct soap *soap, const char *type)
{ if (soap_match_tag(soap, soap->type, type)
@@ -12478,6 +13861,7 @@ static int soap_isnumeric(struct soap *soap, const char *type)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
float *
@@ -12488,10 +13872,12 @@ soap_infloat(struct soap *soap, const char *tag, float *p, const char *type, int
#ifndef WITH_LEAN
if (*soap->type != '\0' && soap_isnumeric(soap, type))
return NULL;
+#else
+ (void)type;
#endif
- p = (float*)soap_id_enter(soap, soap->id, p, t, sizeof(float), 0, NULL, NULL, NULL);
+ p = (float*)soap_id_enter(soap, soap->id, p, t, sizeof(float), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (float*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(float), 0, NULL);
+ p = (float*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(float), 0, NULL, NULL);
else if (p)
{ if (soap_s2float(soap, soap_value(soap), p))
return NULL;
@@ -12503,31 +13889,31 @@ soap_infloat(struct soap *soap, const char *tag, float *p, const char *type, int
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_double2s(struct soap *soap, double n)
-{ char *s;
+{
+#if !defined(WITH_C_LOCALE) || !defined(HAVE_SPRINTF_L)
+ char *s;
+#endif
if (soap_isnan(n))
return "NaN";
if (soap_ispinfd(n))
return "INF";
if (soap_isninfd(n))
return "-INF";
-#if defined(HAVE_SPRINTF_L)
+#if defined(WITH_C_LOCALE) && defined(HAVE_SPRINTF_L)
# ifdef WIN32
- _sprintf_s_l(soap->tmpbuf, _countof(soap->tmpbuf), soap->double_format, soap->c_locale, n);
+ _sprintf_s_l(soap->tmpbuf, _countof(soap->tmpbuf), soap->double_format, SOAP_LOCALE(soap), n);
# else
- sprintf_l(soap->tmpbuf, soap->c_locale, soap->double_format, n);
+ sprintf_l(soap->tmpbuf, SOAP_LOCALE(soap), soap->double_format, n);
# endif
#else
-# ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), soap->double_format, n);
-#else
- sprintf(soap->tmpbuf, soap->double_format, n);
-#endif
- s = strchr(soap->tmpbuf, ','); /* convert decimal comma to DP */
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 40), soap->double_format, n);
+ s = strchr(soap->tmpbuf, ','); /* convert decimal comma to DP */
if (s)
*s = '.';
#endif
@@ -12536,6 +13922,7 @@ soap_double2s(struct soap *soap, double n)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12549,6 +13936,7 @@ soap_outdouble(struct soap *soap, const char *tag, int id, const double *p, cons
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12567,30 +13955,29 @@ soap_s2double(struct soap *soap, const char *s, double *p)
*p = DBL_NAN;
else
{
-#if defined(HAVE_STRTOD_L)
+#if defined(WITH_C_LOCALE) && defined(HAVE_STRTOD_L)
char *r;
# ifdef WIN32
- *p = _strtod_l(s, &r, soap->c_locale);
+ *p = _strtod_l(s, &r, SOAP_LOCALE(soap));
# else
- *p = strtod_l(s, &r, soap->c_locale);
+ *p = strtod_l(s, &r, SOAP_LOCALE(soap));
# endif
if (*r)
+ soap->error = SOAP_TYPE;
#elif defined(HAVE_STRTOD)
char *r;
*p = strtod(s, &r);
if (*r)
-#endif
- {
-#if defined(HAVE_SSCANF_L) && !defined(HAVE_STRTOF_L) && !defined(HAVE_STRTOD_L)
- if (sscanf_l(s, soap->c_locale, "%lf", p) != 1)
- soap->error = SOAP_TYPE;
+ soap->error = SOAP_TYPE;
+#elif defined(WITH_C_LOCALE) && defined(HAVE_SSCANF_L) && !defined(HAVE_STRTOF_L) && !defined(HAVE_STRTOD_L)
+ if (sscanf_l(s, SOAP_LOCALE(soap), "%lf", p) != 1)
+ soap->error = SOAP_TYPE;
#elif defined(HAVE_SSCANF)
- if (sscanf(s, "%lf", p) != 1)
- soap->error = SOAP_TYPE;
-#else
+ if (sscanf(s, "%lf", p) != 1)
soap->error = SOAP_TYPE;
+#else
+ soap->error = SOAP_TYPE;
#endif
- }
}
}
return soap->error;
@@ -12598,6 +13985,7 @@ soap_s2double(struct soap *soap, const char *s, double *p)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
double *
@@ -12608,10 +13996,12 @@ soap_indouble(struct soap *soap, const char *tag, double *p, const char *type, i
#ifndef WITH_LEAN
if (*soap->type != '\0' && soap_isnumeric(soap, type))
return NULL;
+#else
+ (void)type;
#endif
- p = (double*)soap_id_enter(soap, soap->id, p, t, sizeof(double), 0, NULL, NULL, NULL);
+ p = (double*)soap_id_enter(soap, soap->id, p, t, sizeof(double), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (double*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(double), 0, NULL);
+ p = (double*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(double), 0, NULL, NULL);
else if (p)
{ if (soap_s2double(soap, soap_value(soap), p))
return NULL;
@@ -12623,6 +14013,7 @@ soap_indouble(struct soap *soap, const char *tag, double *p, const char *type, i
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
@@ -12633,6 +14024,7 @@ soap_unsignedByte2s(struct soap *soap, unsigned char n)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12646,16 +14038,17 @@ soap_outunsignedByte(struct soap *soap, const char *tag, int id, const unsigned
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_s2unsignedByte(struct soap *soap, const char *s, unsigned char *p)
{ if (s)
- { unsigned long n;
+ { long n;
char *r;
- n = soap_strtoul(s, &r, 10);
- if (s == r || *r || n > 255)
+ n = soap_strtol(s, &r, 10);
+ if (s == r || *r || n < 0 || n > 255)
soap->error = SOAP_TYPE;
*p = (unsigned char)n;
}
@@ -12664,6 +14057,7 @@ soap_s2unsignedByte(struct soap *soap, const char *s, unsigned char *p)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
unsigned char *
@@ -12679,10 +14073,12 @@ soap_inunsignedByte(struct soap *soap, const char *tag, unsigned char *p, const
soap_revert(soap);
return NULL;
}
+#else
+ (void)type;
#endif
- p = (unsigned char*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned char), 0, NULL, NULL, NULL);
+ p = (unsigned char*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned char), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (unsigned char*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(unsigned char), 0, NULL);
+ p = (unsigned char*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned char), 0, NULL, NULL);
else if (p)
{ if (soap_s2unsignedByte(soap, soap_value(soap), p))
return NULL;
@@ -12694,6 +14090,7 @@ soap_inunsignedByte(struct soap *soap, const char *tag, unsigned char *p, const
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
@@ -12704,6 +14101,7 @@ soap_unsignedShort2s(struct soap *soap, unsigned short n)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12717,16 +14115,17 @@ soap_outunsignedShort(struct soap *soap, const char *tag, int id, const unsigned
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_s2unsignedShort(struct soap *soap, const char *s, unsigned short *p)
{ if (s)
- { unsigned long n;
+ { long n;
char *r;
- n = soap_strtoul(s, &r, 10);
- if (s == r || *r || n > 65535)
+ n = soap_strtol(s, &r, 10);
+ if (s == r || *r || n < 0 || n > 65535)
soap->error = SOAP_TYPE;
*p = (unsigned short)n;
}
@@ -12735,6 +14134,7 @@ soap_s2unsignedShort(struct soap *soap, const char *s, unsigned short *p)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
unsigned short *
@@ -12751,10 +14151,12 @@ soap_inunsignedShort(struct soap *soap, const char *tag, unsigned short *p, cons
soap_revert(soap);
return NULL;
}
+#else
+ (void)type;
#endif
- p = (unsigned short*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned short), 0, NULL, NULL, NULL);
+ p = (unsigned short*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned short), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (unsigned short*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(unsigned short), 0, NULL);
+ p = (unsigned short*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned short), 0, NULL, NULL);
else if (p)
{ if (soap_s2unsignedShort(soap, soap_value(soap), p))
return NULL;
@@ -12766,6 +14168,7 @@ soap_inunsignedShort(struct soap *soap, const char *tag, unsigned short *p, cons
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
@@ -12776,6 +14179,7 @@ soap_unsignedInt2s(struct soap *soap, unsigned int n)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12789,6 +14193,7 @@ soap_outunsignedInt(struct soap *soap, const char *tag, int id, const unsigned i
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12802,7 +14207,7 @@ soap_s2unsignedInt(struct soap *soap, const char *s, unsigned int *p)
#endif
#endif
*p = (unsigned int)soap_strtoul(s, &r, 10);
- if ((s == r && (soap->mode & SOAP_XML_STRICT)) || *r
+ if (s == r || *r
#ifndef WITH_NOIO
#ifndef WITH_LEAN
|| soap_errno == SOAP_ERANGE
@@ -12810,12 +14215,17 @@ soap_s2unsignedInt(struct soap *soap, const char *s, unsigned int *p)
#endif
)
soap->error = SOAP_TYPE;
+#ifdef HAVE_STRTOUL
+ if (*p > 0 && strchr(s, '-'))
+ return soap->error = SOAP_TYPE;
+#endif
}
return soap->error;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
unsigned int *
@@ -12833,10 +14243,12 @@ soap_inunsignedInt(struct soap *soap, const char *tag, unsigned int *p, const ch
soap_revert(soap);
return NULL;
}
+#else
+ (void)type;
#endif
- p = (unsigned int*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned int), 0, NULL, NULL, NULL);
+ p = (unsigned int*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned int), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (unsigned int*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(unsigned int), 0, NULL);
+ p = (unsigned int*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned int), 0, NULL, NULL);
else if (p)
{ if (soap_s2unsignedInt(soap, soap_value(soap), p))
return NULL;
@@ -12848,22 +14260,19 @@ soap_inunsignedInt(struct soap *soap, const char *tag, unsigned int *p, const ch
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_unsignedLong2s(struct soap *soap, unsigned long n)
-{
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%lu", n);
-#else
- sprintf(soap->tmpbuf, "%lu", n);
-#endif
+{ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), "%lu", n);
return soap->tmpbuf;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12877,6 +14286,7 @@ soap_outunsignedLong(struct soap *soap, const char *tag, int id, const unsigned
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -12890,7 +14300,7 @@ soap_s2unsignedLong(struct soap *soap, const char *s, unsigned long *p)
#endif
#endif
*p = soap_strtoul(s, &r, 10);
- if ((s == r && (soap->mode & SOAP_XML_STRICT)) || *r
+ if (s == r || *r
#ifndef WITH_NOIO
#ifndef WITH_LEAN
|| soap_errno == SOAP_ERANGE
@@ -12898,12 +14308,17 @@ soap_s2unsignedLong(struct soap *soap, const char *s, unsigned long *p)
#endif
)
soap->error = SOAP_TYPE;
+#ifdef HAVE_STRTOUL
+ if (*p > 0 && strchr(s, '-'))
+ return soap->error = SOAP_TYPE;
+#endif
}
return soap->error;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
unsigned long *
@@ -12921,10 +14336,12 @@ soap_inunsignedLong(struct soap *soap, const char *tag, unsigned long *p, const
soap_revert(soap);
return NULL;
}
+#else
+ (void)type;
#endif
- p = (unsigned long*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned long), 0, NULL, NULL, NULL);
+ p = (unsigned long*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned long), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (unsigned long*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(unsigned long), 0, NULL);
+ p = (unsigned long*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned long), 0, NULL, NULL);
else if (p)
{ if (soap_s2unsignedLong(soap, soap_value(soap), p))
return NULL;
@@ -12936,23 +14353,20 @@ soap_inunsignedLong(struct soap *soap, const char *tag, unsigned long *p, const
#endif
/******************************************************************************/
-#ifndef WITH_LEAN
+
+#ifndef PALM_2
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_ULONG642s(struct soap *soap, ULONG64 n)
-{
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), SOAP_ULONG_FORMAT, n);
-#else
- sprintf(soap->tmpbuf, SOAP_ULONG_FORMAT, n);
-#endif
+{ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), SOAP_ULONG_FORMAT, n);
return soap->tmpbuf;
}
#endif
/******************************************************************************/
-#ifndef WITH_LEAN
+
+#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
@@ -12965,41 +14379,38 @@ soap_outULONG64(struct soap *soap, const char *tag, int id, const ULONG64 *p, co
#endif
/******************************************************************************/
-#ifndef WITH_LEAN
+
+#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_s2ULONG64(struct soap *soap, const char *s, ULONG64 *p)
{ if (s)
- {
-#ifdef HAVE_STRTOULL
- char *r;
+ { char *r;
#ifndef WITH_NOIO
#ifndef WITH_LEAN
soap_reset_errno;
#endif
#endif
*p = soap_strtoull(s, &r, 10);
- if ((s == r && (soap->mode & SOAP_XML_STRICT)) || *r
+ if (s == r || *r
#ifndef WITH_NOIO
#ifndef WITH_LEAN
|| soap_errno == SOAP_ERANGE
#endif
#endif
)
-#else
-#ifdef HAVE_SSCANF
- if (sscanf(s, SOAP_ULONG_FORMAT, p) != 1)
-#endif
-#endif
soap->error = SOAP_TYPE;
+ if (*p > 0 && strchr(s, '-'))
+ return soap->error = SOAP_TYPE;
}
return soap->error;
}
#endif
/******************************************************************************/
-#ifndef WITH_LEAN
+
+#ifndef PALM_2
SOAP_FMAC1
ULONG64 *
SOAP_FMAC2
@@ -13018,9 +14429,9 @@ soap_inULONG64(struct soap *soap, const char *tag, ULONG64 *p, const char *type,
soap_revert(soap);
return NULL;
}
- p = (ULONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(ULONG64), 0, NULL, NULL, NULL);
+ p = (ULONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(ULONG64), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (ULONG64*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(ULONG64), 0, NULL);
+ p = (ULONG64*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(ULONG64), 0, NULL, NULL);
else if (p)
{ if (soap_s2ULONG64(soap, soap_value(soap), p))
return NULL;
@@ -13032,47 +14443,148 @@ soap_inULONG64(struct soap *soap, const char *tag, ULONG64 *p, const char *type,
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
-soap_s2string(struct soap *soap, const char *s, char **t, long minlen, long maxlen)
+soap_s2char(struct soap *soap, const char *s, char **t, long minlen, long maxlen, const char *pattern)
{ if (s)
- { long l = (long)strlen(s);
- if ((maxlen >= 0 && l > maxlen) || l < minlen)
- return soap->error = SOAP_LENGTH;
- if (!(*t = soap_strdup(soap, s)))
+ { const char *r = soap_string(soap, s, minlen, maxlen, pattern);
+ if (r && (*t = soap_strdup(soap, r)) == NULL)
return soap->error = SOAP_EOM;
- if (!(soap->mode & (SOAP_ENC_LATIN | SOAP_C_UTFSTRING)))
- { char *r = *t;
- /* remove non-ASCII chars */
- for (s = *t; *s; s++)
- if (!(*s & 0x80))
- *r++ = *s;
- *r = '\0';
+ }
+ return soap->error;
+}
+#endif
+
+/******************************************************************************/
+
+#ifndef WITH_COMPAT
+#ifdef __cplusplus
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2stdchar(struct soap *soap, const char *s, std::string *t, long minlen, long maxlen, const char *pattern)
+{ if (s)
+ { const char *r = soap_string(soap, s, minlen, maxlen, pattern);
+ if (r)
+ t->assign(r);
+ }
+ return soap->error;
+}
+#endif
+#endif
+#endif
+
+/******************************************************************************/
+
+#ifndef PALM_2
+static const char*
+soap_string(struct soap *soap, const char *s, long minlen, long maxlen, const char *pattern)
+{ if (s)
+ { if (maxlen < 0 && soap->maxlength > 0)
+ maxlen = soap->maxlength;
+ if (minlen > 0 || maxlen >= 0)
+ { long l;
+ if ((soap->mode & SOAP_C_UTFSTRING))
+ l = (long)soap_utf8len(s);
+ else
+ l = (long)strlen(s);
+ if ((maxlen >= 0 && l > maxlen) || l < minlen)
+ { soap->error = SOAP_LENGTH;
+ return NULL;
+ }
}
+#ifndef WITH_LEANER
+ if (pattern && soap->fsvalidate)
+ { soap->error = soap->fsvalidate(soap, pattern, s);
+ if (soap->error)
+ return NULL;
+ }
+#else
+ (void)pattern;
+#endif
+ }
+ return s;
+}
+#endif
+
+/******************************************************************************/
+
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2QName(struct soap *soap, const char *s, char **t, long minlen, long maxlen, const char *pattern)
+{ if (s)
+ { const char *r = soap_QName(soap, s, minlen, maxlen, pattern);
+ if (r && (*t = soap_strdup(soap, r)) == NULL)
+ return soap->error = SOAP_EOM;
}
return soap->error;
}
#endif
/******************************************************************************/
+
+#ifndef WITH_COMPAT
+#ifdef __cplusplus
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
-soap_s2QName(struct soap *soap, const char *s, char **t, long minlen, long maxlen)
+soap_s2stdQName(struct soap *soap, const char *s, std::string *t, long minlen, long maxlen, const char *pattern)
{ if (s)
- { long l = (long)strlen(s);
- if ((maxlen >= 0 && l > maxlen) || l < minlen)
- return soap->error = SOAP_LENGTH;
+ { const char *r = soap_QName(soap, s, minlen, maxlen, pattern);
+ if (r)
+ t->assign(r);
+ }
+ return soap->error;
+}
+#endif
+#endif
+#endif
+
+/******************************************************************************/
+
+#ifndef PALM_2
+static const char*
+soap_QName(struct soap *soap, const char *s, long minlen, long maxlen, const char *pattern)
+{ if (s)
+ { char *b;
+ if (maxlen < 0 && soap->maxlength > 0)
+ maxlen = soap->maxlength;
+ if (minlen > 0 || maxlen >= 0)
+ { long l;
+ if ((soap->mode & SOAP_C_UTFSTRING))
+ l = (long)soap_utf8len(s);
+ else
+ l = (long)strlen(s);
+ if ((maxlen >= 0 && l > maxlen) || l < minlen)
+ { soap->error = SOAP_LENGTH;
+ return NULL;
+ }
+ }
+#ifdef WITH_FAST
soap->labidx = 0;
+#else
+ if (soap_new_block(soap) == NULL)
+ return NULL;
+#endif
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Normalized namespace(s) of QNames '%s'", s));
/* convert (by prefix normalize prefix) all QNames in s */
for (;;)
{ size_t n;
struct soap_nlist *np;
- register const char *p;
+ const char *p = NULL;
+ short flag = 0;
+ const char *r = NULL;
+ size_t m = 0;
+#ifndef WITH_FAST
+ size_t k = 0;
+#endif
/* skip blanks */
while (*s && soap_blank((soap_wchar)*s))
s++;
@@ -13085,7 +14597,8 @@ soap_s2QName(struct soap *soap, const char *s, char **t, long minlen, long maxle
np = soap->nlist;
/* if there is no namespace stack, or prefix is "#" or "xml" then copy string */
if (!np || *s == '#' || !strncmp(s, "xml:", 4))
- { soap_append_lab(soap, s, n);
+ { r = s;
+ m = n;
}
else /* we normalize the QName by replacing its prefix */
{ const char *q;
@@ -13105,49 +14618,110 @@ soap_s2QName(struct soap *soap, const char *s, char **t, long minlen, long maxle
}
/* replace prefix */
if (np)
- { if (np->index >= 0 && soap->local_namespaces && (q = soap->local_namespaces[np->index].id))
+ { if (np->index >= 0 && soap->local_namespaces && (q = soap->local_namespaces[np->index].id) != NULL)
{ size_t k = strlen(q);
if (q[k-1] != '_')
- soap_append_lab(soap, q, k);
+ { r = q;
+ m = k;
+ }
else
- { soap_append_lab(soap, "\"", 1);
- soap_append_lab(soap, soap->local_namespaces[np->index].ns, strlen(soap->local_namespaces[np->index].ns));
- soap_append_lab(soap, "\"", 1);
+ { flag = 1;
+ r = soap->local_namespaces[np->index].ns;
+ m = strlen(r);
}
}
else if (np->ns)
- { soap_append_lab(soap, "\"", 1);
- soap_append_lab(soap, np->ns, strlen(np->ns));
- soap_append_lab(soap, "\"", 1);
+ { flag = 1;
+ r = np->ns;
+ m = strlen(r);
}
else
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\nNamespace prefix of '%s' not defined (index=%d, URI='%s')\n", s, np->index, np->ns ? np->ns : SOAP_STR_EOS));
- return soap->error = SOAP_NAMESPACE;
+ soap->error = SOAP_NAMESPACE;
+ return NULL;
}
}
else if (s[n]) /* no namespace, part of string */
- { soap_append_lab(soap, s, n);
+ { r = s;
+ m = n;
}
else /* no namespace: assume "" namespace */
- { soap_append_lab(soap, "\"\"", 2);
+ { flag = 1;
+ }
+ }
+#ifdef WITH_FAST
+ if ((flag && soap_append_lab(soap, "\"", 1))
+ || (m && soap_append_lab(soap, r, m))
+ || (flag && soap_append_lab(soap, "\"", 1))
+ || (p && (soap_append_lab(soap, ":", 1) || soap_append_lab(soap, p, n - (p-s)))))
+ return NULL;
+#else
+ k = 2*flag + m + (p ? n - (p-s) + 1 : 0) + (s[n] != '\0');
+ b = (char*)soap_push_block(soap, NULL, k);
+ if (!b)
+ return NULL;
+ if (flag)
+ *b++ = '"';
+ if (m)
+ { if (soap_memcpy((void*)b, k, (const void*)r, m))
+ { soap->error = SOAP_EOM;
+ return NULL;
+ }
+ b += m;
+ }
+ if (flag)
+ *b++ = '"';
+ if (p)
+ { *b++ = ':';
+ if (soap_memcpy((void*)b, k - m - flag - 1, (const void*)p, n - (p-s)))
+ { soap->error = SOAP_EOM;
+ return NULL;
}
- soap_append_lab(soap, ":", 1);
- soap_append_lab(soap, p, n - (p-s));
+ b += n - (p-s);
}
+#endif
/* advance to next and add spacing */
s += n;
+ while (*s && soap_blank(*s))
+ s++;
if (*s)
- soap_append_lab(soap, " ", 1);
+ {
+#ifdef WITH_FAST
+ if (soap_append_lab(soap, " ", 1))
+ return NULL;
+#else
+ *b = ' ';
+#endif
+ }
}
- soap_append_lab(soap, SOAP_STR_EOS, 1);
- *t = soap_strdup(soap, soap->labbuf);
- DBGLOG(TEST, SOAP_MESSAGE(fdebug, " into '%s'\n", *t));
+#ifdef WITH_FAST
+ if (soap_append_lab(soap, SOAP_STR_EOS, 1))
+ return NULL;
+ b = soap->labbuf;
+#else
+ b = (char*)soap_push_block(soap, NULL, 1);
+ if (!b)
+ return NULL;
+ *b = '\0';
+ b = (char*)soap_save_block(soap, NULL, NULL, 0);
+#endif
+#ifndef WITH_LEANER
+ if (pattern && soap->fsvalidate)
+ { soap->error = soap->fsvalidate(soap, pattern, b);
+ if (soap->error)
+ return NULL;
+ }
+#else
+ (void)pattern;
+#endif
+ return b;
}
- return soap->error;
+ return NULL;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char*
@@ -13155,16 +14729,39 @@ SOAP_FMAC2
soap_QName2s(struct soap *soap, const char *s)
{ const char *t = NULL;
if (s)
- { soap->labidx = 0;
+ {
+#ifdef WITH_FAST
+ soap->labidx = 0;
+#else
+ char *b = NULL;
+ if (soap_new_block(soap) == NULL)
+ return NULL;
+#endif
for (;;)
{ size_t n;
+ const char *q = NULL;
+ const char *r = NULL;
+ size_t m = 0;
+#ifndef WITH_FAST
+ size_t k = 0;
+#endif
/* skip blanks */
while (*s && soap_blank((soap_wchar)*s))
s++;
if (!*s)
+ {
+#ifdef WITH_FAST
+ soap->labbuf[soap->labidx > 0 ? soap->labidx - 1 : 0] = '\0';
+#else
+ if (!b)
+ return soap_strdup(soap, SOAP_STR_EOS);
+ --b;
+ *b = '\0';
+#endif
break;
+ }
/* find next QName */
- n = 1;
+ n = 0;
while (s[n] && !soap_blank((soap_wchar)s[n]))
n++;
/* normal prefix: pass string as is */
@@ -13174,18 +14771,18 @@ soap_QName2s(struct soap *soap, const char *s)
if ((soap->mode & SOAP_XML_CANONICAL))
soap_utilize_ns(soap, s);
if ((soap->mode & SOAP_XML_DEFAULTNS))
- { const char *r = strchr(s, ':');
- if (r && soap->nlist && !strncmp(soap->nlist->id, s, r-s) && !soap->nlist->id[r-s])
- { n -= r-s + 1;
+ { r = strchr(s, ':');
+ if (r && soap->nlist && !strncmp(soap->nlist->id, s, r - s) && !soap->nlist->id[r - s])
+ { n -= r - s + 1;
s = r + 1;
}
}
#endif
- soap_append_lab(soap, s, n);
+ r = s;
+ m = n + 1;
}
else /* URL-based string prefix */
- { const char *q;
- s++;
+ { s++;
q = strchr(s, '"');
if (q)
{ struct Namespace *p = soap->local_namespaces;
@@ -13199,108 +14796,187 @@ soap_QName2s(struct soap *soap, const char *s)
break;
}
}
+ q++;
/* URL is in the namespace table? */
if (p && p->id)
- { const char *r = p->id;
+ { r = p->id;
#ifndef WITH_LEAN
if ((soap->mode & SOAP_XML_DEFAULTNS) && soap->nlist && !strcmp(soap->nlist->id, r))
q++;
else
#endif
- soap_append_lab(soap, r, strlen(r));
+ m = strlen(r);
}
else /* not in namespace table: create xmlns binding */
- { char *r = soap_strdup(soap, s);
- r[q-s] = '\0';
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "xmlns:_%d", soap->idnum++);
-#else
- sprintf(soap->tmpbuf, "xmlns:_%d", soap->idnum++);
-#endif
- soap_set_attr(soap, soap->tmpbuf, r, 1);
- soap_append_lab(soap, soap->tmpbuf + 6, strlen(soap->tmpbuf + 6));
+ { char *x = soap_strdup(soap, s);
+ x[q - s - 1] = '\0';
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 27), "xmlns:_%d", soap->idnum++);
+ soap_set_attr(soap, soap->tmpbuf, x, 1);
+ r = soap->tmpbuf + 6;
+ m = strlen(r);
}
- soap_append_lab(soap, q + 1, n - (q-s) - 1);
}
}
- /* advance to next and add spacing */
+ /* copy normalized QName into buffer, including the ending blank or NUL */
+#ifdef WITH_FAST
+ if ((m && soap_append_lab(soap, r, m))
+ || (q && soap_append_lab(soap, q, n - (q - s))))
+ return NULL;
+#else
+ k = m + (q ? n - (q - s) : 0);
+ b = (char*)soap_push_block(soap, NULL, k);
+ if (!b)
+ { soap->error = SOAP_EOM;
+ return NULL;
+ }
+ if (soap_memcpy((void*)b, k, (const void*)r, m))
+ { soap->error = SOAP_EOM;
+ return NULL;
+ }
+ b += m;
+ if (q)
+ { if (soap_memcpy((void*)b, k - m, (const void*)q, n - (q - s)))
+ { soap->error = SOAP_EOM;
+ return NULL;
+ }
+ b += n - (q - s);
+ }
+#endif
+ /* advance to next */
s += n;
- if (*s)
- soap_append_lab(soap, " ", 1);
}
- soap_append_lab(soap, SOAP_STR_EOS, 1);
+#ifdef WITH_FAST
t = soap_strdup(soap, soap->labbuf);
+#else
+ t = (char*)soap_save_block(soap, NULL, NULL, 0);
+#endif
}
return t;
}
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
int
SOAP_FMAC2
-soap_s2wchar(struct soap *soap, const char *s, wchar_t **t, long minlen, long maxlen)
+soap_s2wchar(struct soap *soap, const char *s, wchar_t **t, long minlen, long maxlen, const char *pattern)
{ if (s)
- { long l;
- wchar_t *r;
- *t = r = (wchar_t*)soap_malloc(soap, sizeof(wchar_t) * (strlen(s) + 1));
- if (!r)
+ { const wchar_t *r = soap_wstring(soap, s, minlen, maxlen, pattern);
+ if (r && (*t = soap_wstrdup(soap, r)) == NULL)
return soap->error = SOAP_EOM;
+ }
+ return soap->error;
+}
+#endif
+
+/******************************************************************************/
+
+#ifndef WITH_COMPAT
+#ifdef __cplusplus
+#ifndef WITH_LEAN
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2stdwchar(struct soap *soap, const char *s, std::wstring *t, long minlen, long maxlen, const char *pattern)
+{ if (s)
+ { const wchar_t *r = soap_wstring(soap, s, minlen, maxlen, pattern);
+ if (r)
+ t->assign(r);
+ }
+ return soap->error;
+}
+#endif
+#endif
+#endif
+
+/******************************************************************************/
+
+#ifndef WITH_LEAN
+static const wchar_t*
+soap_wstring(struct soap *soap, const char *s, long minlen, long maxlen, const char *pattern)
+{ if (s)
+ { long l;
+ wchar_t wc;
+ if (maxlen < 0 && soap->maxlength > 0)
+ maxlen = soap->maxlength;
+ soap->labidx = 0;
if (soap->mode & SOAP_ENC_LATIN)
- { while (*s)
+ { wchar_t *r;
+ if (soap_append_lab(soap, NULL, sizeof(wchar_t) * (strlen(s) + 1)))
+ return NULL;
+ r = (wchar_t*)soap->labbuf;
+ while (*s)
*r++ = (wchar_t)*s++;
}
else
{ /* Convert UTF8 to wchar */
while (*s)
- { register soap_wchar c, c1, c2, c3, c4;
+ { soap_wchar c, c1, c2, c3, c4;
c = (unsigned char)*s++;
if (c < 0x80)
- *r++ = (wchar_t)c;
+ wc = (wchar_t)c;
else
{ c1 = (soap_wchar)*s++ & 0x3F;
if (c < 0xE0)
- *r++ = (wchar_t)(((soap_wchar)(c & 0x1F) << 6) | c1);
+ wc = (wchar_t)(((soap_wchar)(c & 0x1F) << 6) | c1);
else
{ c2 = (soap_wchar)*s++ & 0x3F;
if (c < 0xF0)
- *r++ = (wchar_t)(((soap_wchar)(c & 0x0F) << 12) | (c1 << 6) | c2);
+ wc = (wchar_t)(((soap_wchar)(c & 0x0F) << 12) | (c1 << 6) | c2);
else
{ c3 = (soap_wchar)*s++ & 0x3F;
if (c < 0xF8)
- *r++ = (wchar_t)(((soap_wchar)(c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3);
+ wc = (wchar_t)(((soap_wchar)(c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3);
else
{ c4 = (soap_wchar)*s++ & 0x3F;
if (c < 0xFC)
- *r++ = (wchar_t)(((soap_wchar)(c & 0x03) << 24) | (c1 << 18) | (c2 << 12) | (c3 << 6) | c4);
+ wc = (wchar_t)(((soap_wchar)(c & 0x03) << 24) | (c1 << 18) | (c2 << 12) | (c3 << 6) | c4);
else
- *r++ = (wchar_t)(((soap_wchar)(c & 0x01) << 30) | (c1 << 24) | (c2 << 18) | (c3 << 12) | (c4 << 6) | (soap_wchar)(*s++ & 0x3F));
+ wc = (wchar_t)(((soap_wchar)(c & 0x01) << 30) | (c1 << 24) | (c2 << 18) | (c3 << 12) | (c4 << 6) | (soap_wchar)(*s++ & 0x3F));
}
}
}
}
+ if (soap_append_lab(soap, (const char*)&wc, sizeof(wc)))
+ return NULL;
}
}
- *r = L'\0';
- l = (long)(r - *t);
+ l = (long)(soap->labidx / sizeof(wchar_t));
+ wc = L'\0';
+ if (soap_append_lab(soap, (const char*)&wc, sizeof(wc)))
+ return NULL;
if ((maxlen >= 0 && l > maxlen) || l < minlen)
- return soap->error = SOAP_LENGTH;
+ { soap->error = SOAP_LENGTH;
+ return NULL;
+ }
+#ifndef WITH_LEANER
+ if (pattern && soap->fwvalidate)
+ { soap->error = soap->fwvalidate(soap, pattern, (wchar_t*)soap->labbuf);
+ if (soap->error)
+ return NULL;
+ }
+#endif
+ return (wchar_t*)soap->labbuf;
}
- return soap->error;
+ return NULL;
}
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_wchar2s(struct soap *soap, const wchar_t *s)
-{ register soap_wchar c;
- register char *r, *t;
+{ soap_wchar c;
+ char *r, *t;
const wchar_t *q = s;
size_t n = 0;
+ if (!s)
+ return NULL;
while ((c = *q++))
{ if (c > 0 && c < 0x80)
n++;
@@ -13345,12 +15021,13 @@ soap_wchar2s(struct soap *soap, const wchar_t *s)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_outstring(struct soap *soap, const char *tag, int id, char *const*p, const char *type, int n)
-{ id = soap_element_id(soap, tag, id, *p, NULL, 0, type, n);
+{ id = soap_element_id(soap, tag, id, *p, NULL, 0, type, n, NULL);
if (id < 0)
return soap->error;
if (!**p && (soap->mode & SOAP_C_NILSTRING))
@@ -13364,11 +15041,12 @@ soap_outstring(struct soap *soap, const char *tag, int id, char *const*p, const
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
char **
SOAP_FMAC2
-soap_instring(struct soap *soap, const char *tag, char **p, const char *type, int t, int flag, long minlen, long maxlen)
+soap_instring(struct soap *soap, const char *tag, char **p, const char *type, int t, int flag, long minlen, long maxlen, const char *pattern)
{ (void)type;
if (soap_element_begin_in(soap, tag, 1, NULL))
{ if (!tag || *tag != '-' || soap->error != SOAP_NO_TAG)
@@ -13376,14 +15054,15 @@ soap_instring(struct soap *soap, const char *tag, char **p, const char *type, in
soap->error = SOAP_OK;
}
if (!p)
- { if (!(p = (char**)soap_malloc(soap, sizeof(char*))))
+ { p = (char**)soap_malloc(soap, sizeof(char*));
+ if (!p)
return NULL;
}
if (soap->null)
*p = NULL;
else if (soap->body)
- { *p = soap_string_in(soap, flag, minlen, maxlen);
- if (!*p || !(char*)soap_id_enter(soap, soap->id, *p, t, sizeof(char*), 0, NULL, NULL, NULL))
+ { *p = soap_string_in(soap, flag, minlen, maxlen, pattern);
+ if (!*p || !(char*)soap_id_enter(soap, soap->id, *p, t, sizeof(char*), NULL, NULL, NULL, NULL))
return NULL;
if (!**p && tag && *tag == '-')
{ soap->error = SOAP_NO_TAG;
@@ -13394,14 +15073,15 @@ soap_instring(struct soap *soap, const char *tag, char **p, const char *type, in
{ soap->error = SOAP_NO_TAG;
return NULL;
}
- else if (!*soap->href && minlen > 0)
- { soap->error = SOAP_LENGTH;
- return NULL;
- }
- else
+ else if (!*soap->href)
+ { if (minlen > 0)
+ { soap->error = SOAP_LENGTH;
+ return NULL;
+ }
*p = soap_strdup(soap, SOAP_STR_EOS);
+ }
if (*soap->href)
- p = (char**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(char**), 0);
+ p = (char**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(char**), 0, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
return p;
@@ -13409,13 +15089,14 @@ soap_instring(struct soap *soap, const char *tag, char **p, const char *type, in
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_outwstring(struct soap *soap, const char *tag, int id, wchar_t *const*p, const char *type, int n)
-{ id = soap_element_id(soap, tag, id, *p, NULL, 0, type, n);
+{ id = soap_element_id(soap, tag, id, *p, NULL, 0, type, n, NULL);
if (id < 0)
return soap->error;
if (!**p && (soap->mode & SOAP_C_NILSTRING))
@@ -13430,12 +15111,13 @@ soap_outwstring(struct soap *soap, const char *tag, int id, wchar_t *const*p, co
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_2
SOAP_FMAC1
wchar_t **
SOAP_FMAC2
-soap_inwstring(struct soap *soap, const char *tag, wchar_t **p, const char *type, int t, long minlen, long maxlen)
+soap_inwstring(struct soap *soap, const char *tag, wchar_t **p, const char *type, int t, long minlen, long maxlen, const char *pattern)
{ (void)type;
if (soap_element_begin_in(soap, tag, 1, NULL))
{ if (!tag || *tag != '-' || soap->error != SOAP_NO_TAG)
@@ -13443,12 +15125,15 @@ soap_inwstring(struct soap *soap, const char *tag, wchar_t **p, const char *type
soap->error = SOAP_OK;
}
if (!p)
- { if (!(p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*))))
+ { p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*));
+ if (!p)
return NULL;
}
- if (soap->body)
- { *p = soap_wstring_in(soap, 1, minlen, maxlen);
- if (!*p || !(wchar_t*)soap_id_enter(soap, soap->id, *p, t, sizeof(wchar_t*), 0, NULL, NULL, NULL))
+ if (soap->null)
+ *p = NULL;
+ else if (soap->body)
+ { *p = soap_wstring_in(soap, 1, minlen, maxlen, pattern);
+ if (!*p || !(wchar_t*)soap_id_enter(soap, soap->id, *p, t, sizeof(wchar_t*), NULL, NULL, NULL, NULL))
return NULL;
if (!**p && tag && *tag == '-')
{ soap->error = SOAP_NO_TAG;
@@ -13459,12 +15144,15 @@ soap_inwstring(struct soap *soap, const char *tag, wchar_t **p, const char *type
{ soap->error = SOAP_NO_TAG;
return NULL;
}
- else if (soap->null)
- *p = NULL;
- else
- *p = soap_wstrdup(soap, (wchar_t*)SOAP_STR_EOS);
+ else if (!*soap->href)
+ { if (minlen > 0)
+ { soap->error = SOAP_LENGTH;
+ return NULL;
+ }
+ *p = soap_wstrdup(soap, L"");
+ }
if (*soap->href)
- p = (wchar_t**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(wchar_t**), 0);
+ p = (wchar_t**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(wchar_t**), 0, NULL);
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
return p;
@@ -13473,6 +15161,89 @@ soap_inwstring(struct soap *soap, const char *tag, wchar_t **p, const char *type
#endif
/******************************************************************************/
+
+#ifndef WITH_LEAN
+#ifdef UNDER_CE
+/* WinCE mktime (based on the mingw-runtime, public domain) */
+#define __FILETIME_to_ll(f) ((long long)(f).dwHighDateTime << 32 | (long long)(f).dwLowDateTime)
+static time_t
+mktime(struct tm *pt)
+{ SYSTEMTIME s, s1, s2;
+ FILETIME f, f1, f2;
+ long long diff;
+ GetSystemTime(&s1);
+ GetLocalTime(&s2);
+ SystemTimeToFileTime(&s1, &f1);
+ SystemTimeToFileTime(&s2, &f2);
+ diff = (__FILETIME_to_ll(f2) - __FILETIME_to_ll(f1)) / 10000000LL;
+ s.wYear = pt->tm_year + 1900;
+ s.wMonth = pt->tm_mon + 1;
+ s.wDayOfWeek = pt->tm_wday;
+ s.wDay = pt->tm_mday;
+ s.wHour = pt->tm_hour;
+ s.wMinute = pt->tm_min;
+ s.wSecond = pt->tm_sec;
+ s.wMilliseconds = 0;
+ SystemTimeToFileTime(&s, &f);
+ return (time_t)((__FILETIME_to_ll(f) - 116444736000000000LL) / 10000000LL) - (time_t)diff;
+}
+#endif
+#endif
+
+/******************************************************************************/
+
+#ifndef WITH_LEAN
+#ifdef UNDER_CE
+/* WinCE gmtime_r (based on the mingw-runtime, public domain) */
+#define HAVE_GMTIME_R
+static struct tm*
+gmtime_r(const time_t *t, struct tm *pt)
+{ FILETIME f, f1, f2;
+ SYSTEMTIME s, s1 = {0};
+ long long time = (long long)(*t) * 10000000LL + 116444736000000000LL;
+ f.dwHighDateTime = (DWORD)((time >> 32) & 0x00000000FFFFFFFF);
+ f.dwLowDateTime = (DWORD)(time & 0x00000000FFFFFFFF);
+ FileTimeToSystemTime(&f, &s);
+ pt->tm_year = s.wYear - 1900;
+ pt->tm_mon = s.wMonth - 1;
+ pt->tm_wday = s.wDayOfWeek;
+ pt->tm_mday = s.wDay;
+ s1.wYear = s.wYear;
+ s1.wMonth = 1;
+ s1.wDayOfWeek = 1;
+ s1.wDay = 1;
+ SystemTimeToFileTime(&s1, &f1);
+ SystemTimeToFileTime(&s, &f2);
+ pt->tm_yday = (((__FILETIME_to_ll(f2) - __FILETIME_to_ll(f1)) / 10000000LL) / (60 * 60 * 24));
+ pt->tm_hour = s.wHour;
+ pt->tm_min = s.wMinute;
+ pt->tm_sec = s.wSecond;
+ pt->tm_isdst = 0;
+ return pt;
+}
+#endif
+#endif
+
+/******************************************************************************/
+
+#ifndef WITH_LEAN
+#ifdef UNDER_CE
+/* WinCE very simple strftime for format "%Y-%m-%dT%H:%M:%SZ", note: %F and %T not supported by MS */
+static size_t
+strftime(char *buf, size_t len, const char *format, const struct tm *pT)
+{ (void)len; (void)format;
+#ifndef WITH_NOZONE
+ (SOAP_SNPRINTF(buf, len, 20), "%04d-%02d-%02dT%02d:%02d:%02dZ", pT->tm_year + 1900, pT->tm_mon + 1, pT->tm_mday, pT->tm_hour, pT->tm_min, pT->tm_sec);
+#else
+ (SOAP_SNPRINTF(buf, len, 20), "%04d-%02d-%02dT%02d:%02d:%02d", pT->tm_year + 1900, pT->tm_mon + 1, pT->tm_mday, pT->tm_hour, pT->tm_min, pT->tm_sec);
+#endif
+ return len;
+}
+#endif
+#endif
+
+/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
time_t
@@ -13484,13 +15255,20 @@ soap_timegm(struct tm *T)
#else
time_t t, g, z;
struct tm tm;
+#ifndef HAVE_GMTIME_R
+ struct tm *tp;
+#endif
t = mktime(T);
if (t == (time_t)-1)
return (time_t)-1;
#ifdef HAVE_GMTIME_R
- gmtime_r(&t, &tm);
+ if (gmtime_r(&t, &tm) == SOAP_FUNC_R_ERR)
+ return (time_t)-1;
#else
- tm = *gmtime(&t);
+ tp = gmtime(&t);
+ if (!tp)
+ return (time_t)-1;
+ tm = *tp;
#endif
tm.tm_isdst = 0;
g = mktime(&tm);
@@ -13503,106 +15281,108 @@ soap_timegm(struct tm *T)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_dateTime2s(struct soap *soap, time_t n)
{ struct tm T, *pT = &T;
-#if defined(HAVE_GMTIME_R)
- if (gmtime_r(&n, pT))
- strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT);
-#elif defined(HAVE_GMTIME)
- if ((pT = gmtime(&n)))
- strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT);
-#elif defined(HAVE_TM_GMTOFF) || defined(HAVE_STRUCT_TM_TM_GMTOFF) || defined(HAVE_STRUCT_TM___TM_GMTOFF)
+ size_t l = 0;
+#if defined(HAVE_GMTIME_R) && !defined(WITH_NOZONE)
+ if (gmtime_r(&n, pT) != SOAP_FUNC_R_ERR)
+ l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT);
+#elif defined(HAVE_GMTIME) && !defined(WITH_NOZONE)
+ pT = gmtime(&n);
+ if (pT)
+ l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT);
+#elif (defined(HAVE_TM_GMTOFF) || defined(HAVE_STRUCT_TM_TM_GMTOFF) || defined(HAVE_STRUCT_TM___TM_GMTOFF)) && !defined(WITH_NOZONE)
#if defined(HAVE_LOCALTIME_R)
- if (localtime_r(&n, pT))
- { strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S%z", pT);
- memmove(soap->tmpbuf + 23, soap->tmpbuf + 22, 3); /* 2000-03-01T02:00:00+0300 */
- soap->tmpbuf[22] = ':'; /* 2000-03-01T02:00:00+03:00 */
+ if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR)
+ { l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S%z", pT);
+ if (l)
+ { soap_memmove(soap->tmpbuf + 23, sizeof(soap->tmpbuf) - 23, soap->tmpbuf + 22, 3); /* 2000-03-01T02:00:00+0300 */
+ soap->tmpbuf[22] = ':'; /* 2000-03-01T02:00:00+03:00 */
+ }
}
#else
- if ((pT = localtime(&n)))
- { strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S%z", pT);
- memmove(soap->tmpbuf + 23, soap->tmpbuf + 22, 3); /* 2000-03-01T02:00:00+0300 */
- soap->tmpbuf[22] = ':'; /* 2000-03-01T02:00:00+03:00 */
+ pT = localtime(&n);
+ if (pT)
+ { l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S%z", pT);
+ if (l)
+ { soap_memmove(soap->tmpbuf + 23, sizeof(soap->tmpbuf) - 23, soap->tmpbuf + 22, 3); /* 2000-03-01T02:00:00+0300 */
+ soap->tmpbuf[22] = ':'; /* 2000-03-01T02:00:00+03:00 */
+ }
}
#endif
-#elif defined(HAVE_GETTIMEOFDAY)
- struct timezone tz;
- memset((void*)&tz, 0, sizeof(tz));
+#elif defined(HAVE_GETTIMEOFDAY) && !defined(WITH_NOZONE)
#if defined(HAVE_LOCALTIME_R)
- if (localtime_r(&n, pT))
+ if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR)
{ struct timeval tv;
+ struct timezone tz;
+ memset((void*)&tz, 0, sizeof(tz));
gettimeofday(&tv, &tz);
- strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf + strlen(soap->tmpbuf), sizeof(soap->tmpbuf) - strlen(soap->tmpbuf), "%+03d:%02d", -tz.tz_minuteswest/60+(pT->tm_isdst!=0), abs(tz.tz_minuteswest)%60);
-#else
- sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -tz.tz_minuteswest/60+(pT->tm_isdst!=0), abs(tz.tz_minuteswest)%60);
-#endif
+ l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ if (l)
+ (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -tz.tz_minuteswest/60+(pT->tm_isdst!=0), abs(tz.tz_minuteswest)%60);
}
#else
- if ((pT = localtime(&n)))
+ pT = localtime(&n);
+ if (pT)
{ struct timeval tv;
+ struct timezone tz;
+ memset((void*)&tz, 0, sizeof(tz));
gettimeofday(&tv, &tz);
- strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf + strlen(soap->tmpbuf), sizeof(soap->tmpbuf) - strlen(soap->tmpbuf), "%+03d:%02d", -tz.tz_minuteswest/60+(pT->tm_isdst!=0), abs(tz.tz_minuteswest)%60);
-#else
- sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -tz.tz_minuteswest/60+(pT->tm_isdst!=0), abs(tz.tz_minuteswest)%60);
-#endif
+ l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ if (l)
+ (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -tz.tz_minuteswest/60+(pT->tm_isdst!=0), abs(tz.tz_minuteswest)%60);
}
#endif
-#elif defined(HAVE_FTIME)
- struct timeb t;
- memset((void*)&t, 0, sizeof(t));
+#elif defined(HAVE_FTIME) && !defined(WITH_NOZONE)
#if defined(HAVE_LOCALTIME_R)
- if (localtime_r(&n, pT))
- {
+ if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR)
+ { struct timeb t;
+ memset((void*)&t, 0, sizeof(t));
#ifdef __BORLANDC__
::ftime(&t);
#else
ftime(&t);
#endif
- strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf + strlen(soap->tmpbuf), sizeof(soap->tmpbuf) - strlen(soap->tmpbuf), "%+03d:%02d", -t.timezone/60+(pT->tm_isdst!=0), abs(t.timezone)%60);
-#else
- sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -t.timezone/60+(pT->tm_isdst!=0), abs(t.timezone)%60);
-#endif
+ l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ if (l)
+ (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -t.timezone/60+(pT->tm_isdst!=0), abs(t.timezone)%60);
}
#else
- if ((pT = localtime(&n)))
- {
+ pT = localtime(&n);
+ if (pT)
+ { struct timeb t;
+ memset((void*)&t, 0, sizeof(t));
#ifdef __BORLANDC__
::ftime(&t);
#else
ftime(&t);
#endif
- strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf + strlen(soap->tmpbuf), sizeof(soap->tmpbuf) - strlen(soap->tmpbuf), "%+03d:%02d", -t.timezone/60+(pT->tm_isdst!=0), abs(t.timezone)%60);
-#else
- sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -t.timezone/60+(pT->tm_isdst!=0), abs(t.timezone)%60);
-#endif
+ l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ if (l)
+ (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -t.timezone/60+(pT->tm_isdst!=0), abs(t.timezone)%60);
}
#endif
#elif defined(HAVE_LOCALTIME_R)
- if (localtime_r(&n, pT))
- strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR)
+ l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
#else
- if ((pT = localtime(&n)))
- strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ pT = localtime(&n);
+ if (pT)
+ l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
#endif
- else
- strcpy(soap->tmpbuf, "1969-12-31T23:59:59Z");
+ if (!l)
+ soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "1969-12-31T23:59:59Z");
return soap->tmpbuf;
}
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
int
@@ -13616,53 +15396,87 @@ soap_outdateTime(struct soap *soap, const char *tag, int id, const time_t *p, co
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
int
SOAP_FMAC2
soap_s2dateTime(struct soap *soap, const char *s, time_t *p)
-{ if (s)
- { char zone[32];
+{ *p = 0;
+ if (s)
+ { char *t;
+ unsigned long d;
struct tm T;
- const char *t;
- *zone = '\0';
memset((void*)&T, 0, sizeof(T));
- if (strchr(s, '-'))
- t = "%d-%d-%dT%d:%d:%d%31s";
- else if (strchr(s, ':'))
- t = "%4d%2d%2dT%d:%d:%d%31s";
- else /* parse non-XSD-standard alternative ISO 8601 format */
- t = "%4d%2d%2dT%2d%2d%2d%31s";
- if (sscanf(s, t, &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec, zone) < 6)
+ d = soap_strtoul(s, &t, 10);
+ if (*t == '-')
+ { /* YYYY-MM-DD */
+ T.tm_year = (int)d;
+ T.tm_mon = (int)soap_strtoul(t + 1, &t, 10);
+ T.tm_mday = (int)soap_strtoul(t + 1, &t, 10);
+ }
+ else if (!(soap->mode & SOAP_XML_STRICT))
+ { /* YYYYMMDD */
+ T.tm_year = (int)(d / 10000);
+ T.tm_mon = (int)(d / 100 % 100);
+ T.tm_mday = (int)(d % 100);
+ }
+ else
return soap->error = SOAP_TYPE;
+ if (*t == 'T' || ((*t == 't' || *t == ' ') && !(soap->mode & SOAP_XML_STRICT)))
+ { d = soap_strtoul(t + 1, &t, 10);
+ if (*t == ':')
+ { /* Thh:mm:ss */
+ T.tm_hour = (int)d;
+ T.tm_min = (int)soap_strtoul(t + 1, &t, 10);
+ T.tm_sec = (int)soap_strtoul(t + 1, &t, 10);
+ }
+ else if (!(soap->mode & SOAP_XML_STRICT))
+ { /* Thhmmss */
+ T.tm_hour = (int)(d / 10000);
+ T.tm_min = (int)(d / 100 % 100);
+ T.tm_sec = (int)(d % 100);
+ }
+ else
+ return soap->error = SOAP_TYPE;
+ }
if (T.tm_year == 1)
T.tm_year = 70;
else
T.tm_year -= 1900;
T.tm_mon--;
- if (*zone == '.')
- { for (s = zone + 1; *s; s++)
- if (*s < '0' || *s > '9')
+ if (*t == '.')
+ { for (t++; *t; t++)
+ if (*t < '0' || *t > '9')
break;
}
- else
- s = zone;
- if (*s)
+ if (*t == ' ' && !(soap->mode & SOAP_XML_STRICT))
+ t++;
+ if (*t)
{
#ifndef WITH_NOZONE
- if (*s == '+' || *s == '-')
- { int h = 0, m = 0;
- if (s[3] == ':')
+ if (*t == '+' || *t == '-')
+ { int h, m;
+ m = (int)soap_strtol(t, &t, 10);
+ if (*t == ':')
{ /* +hh:mm */
- sscanf(s, "%d:%d", &h, &m);
+ h = m;
+ m = (int)soap_strtol(t + 1, &t, 10);
if (h < 0)
m = -m;
}
- else /* +hhmm */
- { m = (int)soap_strtol(s, NULL, 10);
+ else if (!(soap->mode & SOAP_XML_STRICT))
+ { /* +hhmm */
h = m / 100;
m = m % 100;
}
+ else
+ { /* +hh */
+ h = m;
+ m = 0;
+ }
+ if (*t)
+ return soap->error = SOAP_TYPE;
T.tm_min -= m;
T.tm_hour -= h;
/* put hour and min in range */
@@ -13680,6 +15494,8 @@ soap_s2dateTime(struct soap *soap, const char *s, time_t *p)
}
/* note: day of the month may be out of range, timegm() handles it */
}
+ else if (*t != 'Z')
+ return soap->error = SOAP_TYPE;
#endif
*p = soap_timegm(&T);
}
@@ -13693,6 +15509,7 @@ soap_s2dateTime(struct soap *soap, const char *s, time_t *p)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
time_t *
@@ -13707,9 +15524,9 @@ soap_indateTime(struct soap *soap, const char *tag, time_t *p, const char *type,
soap_revert(soap);
return NULL;
}
- p = (time_t*)soap_id_enter(soap, soap->id, p, t, sizeof(time_t), 0, NULL, NULL, NULL);
+ p = (time_t*)soap_id_enter(soap, soap->id, p, t, sizeof(time_t), NULL, NULL, NULL, NULL);
if (*soap->href)
- p = (time_t*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(time_t), 0, NULL);
+ p = (time_t*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(time_t), 0, NULL, NULL);
else if (p)
{ if (soap_s2dateTime(soap, soap_value(soap), p))
return NULL;
@@ -13721,62 +15538,46 @@ soap_indateTime(struct soap *soap, const char *tag, time_t *p, const char *type,
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_outliteral(struct soap *soap, const char *tag, char *const*p, const char *type)
-{ int i;
- const char *t = NULL;
- if (tag && *tag != '-')
- { if (soap->local_namespaces && (t = strchr(tag, ':')))
- { size_t n = t - tag;
- if (n >= sizeof(soap->tmpbuf))
- n = sizeof(soap->tmpbuf) - 1;
- strncpy(soap->tmpbuf, tag, n);
- soap->tmpbuf[n] = '\0';
- for (i = 0; soap->local_namespaces[i].id; i++)
- if (!strcmp(soap->tmpbuf, soap->local_namespaces[i].id))
- break;
- t++;
- if (soap_element(soap, t, 0, type)
- || soap_attribute(soap, "xmlns", soap->local_namespaces[i].ns ? soap->local_namespaces[i].ns : SOAP_STR_EOS)
- || soap_element_start_end_out(soap, NULL))
- return soap->error;
- }
- else
- { t = tag;
- if (soap_element_begin_out(soap, t, 0, type))
- return soap->error;
- }
- }
+{ if (tag && *tag != '-')
+ if (soap_element_begin_out(soap, tag, 0, type))
+ return soap->error;
if (p && *p)
- { if (soap_send(soap, *p)) /* send as-is */
+ if (soap_send(soap, *p)) /* send as-is */
return soap->error;
- }
- if (t)
- return soap_element_end_out(soap, t);
+ if (tag && *tag != '-')
+ return soap_element_end_out(soap, tag);
return SOAP_OK;
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
char **
SOAP_FMAC2
soap_inliteral(struct soap *soap, const char *tag, char **p)
{ if (soap_element_begin_in(soap, tag, 1, NULL))
- { if (soap->error != SOAP_NO_TAG || soap_unget(soap, soap_get(soap)) == SOAP_TT)
+ { if (soap->error != SOAP_NO_TAG || soap_peek(soap) == SOAP_TT)
return NULL;
soap->error = SOAP_OK;
}
if (!p)
- { if (!(p = (char**)soap_malloc(soap, sizeof(char*))))
+ { p = (char**)soap_malloc(soap, sizeof(char*));
+ if (!p)
return NULL;
}
if (soap->body || (tag && *tag == '-'))
- { *p = soap_string_in(soap, 0, -1, -1);
+ { if (tag && *tag != '-')
+ *p = soap_string_in(soap, -1, -1, -1, NULL);
+ else
+ *p = soap_string_in(soap, 0, -1, -1, NULL);
if (!*p)
return NULL;
if (!**p && tag && *tag == '-')
@@ -13795,36 +15596,16 @@ soap_inliteral(struct soap *soap, const char *tag, char **p)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_outwliteral(struct soap *soap, const char *tag, wchar_t *const*p, const char *type)
-{ int i;
- const char *t = NULL;
- if (tag && *tag != '-')
- { if (soap->local_namespaces && (t = strchr(tag, ':')))
- { size_t n = t - tag;
- if (n >= sizeof(soap->tmpbuf))
- n = sizeof(soap->tmpbuf) - 1;
- strncpy(soap->tmpbuf, tag, n);
- soap->tmpbuf[n] = '\0';
- for (i = 0; soap->local_namespaces[i].id; i++)
- if (!strcmp(soap->tmpbuf, soap->local_namespaces[i].id))
- break;
- t++;
- if (soap_element(soap, t, 0, type)
- || soap_attribute(soap, "xmlns", soap->local_namespaces[i].ns ? soap->local_namespaces[i].ns : SOAP_STR_EOS)
- || soap_element_start_end_out(soap, NULL))
- return soap->error;
- }
- else
- { t = tag;
- if (soap_element_begin_out(soap, t, 0, type))
- return soap->error;
- }
- }
+{ if (tag && *tag != '-')
+ if (soap_element_begin_out(soap, tag, 0, type))
+ return soap->error;
if (p)
{ wchar_t c;
const wchar_t *s = *p;
@@ -13833,14 +15614,15 @@ soap_outwliteral(struct soap *soap, const char *tag, wchar_t *const*p, const cha
return soap->error;
}
}
- if (t)
- return soap_element_end_out(soap, t);
+ if (tag && *tag != '-')
+ return soap_element_end_out(soap, tag);
return SOAP_OK;
}
#endif
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_2
SOAP_FMAC1
@@ -13848,16 +15630,20 @@ wchar_t **
SOAP_FMAC2
soap_inwliteral(struct soap *soap, const char *tag, wchar_t **p)
{ if (soap_element_begin_in(soap, tag, 1, NULL))
- { if (soap->error != SOAP_NO_TAG || soap_unget(soap, soap_get(soap)) == SOAP_TT)
+ { if (soap->error != SOAP_NO_TAG || soap_peek(soap) == SOAP_TT)
return NULL;
soap->error = SOAP_OK;
}
if (!p)
- { if (!(p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*))))
+ { p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*));
+ if (!p)
return NULL;
}
if (soap->body)
- { *p = soap_wstring_in(soap, 0, -1, -1);
+ { if (tag && *tag != '-')
+ *p = soap_wstring_in(soap, -1, -1, -1, NULL);
+ else
+ *p = soap_wstring_in(soap, 0, -1, -1, NULL);
if (!*p)
return NULL;
if (!**p && tag && *tag == '-')
@@ -13872,7 +15658,7 @@ soap_inwliteral(struct soap *soap, const char *tag, wchar_t **p)
else if (soap->null)
*p = NULL;
else
- *p = soap_wstrdup(soap, (wchar_t*)SOAP_STR_EOS);
+ *p = soap_wstrdup(soap, L"");
if (soap->body && soap_element_end_in(soap, tag))
return NULL;
return p;
@@ -13881,14 +15667,15 @@ soap_inwliteral(struct soap *soap, const char *tag, wchar_t **p)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
const char *
SOAP_FMAC2
soap_value(struct soap *soap)
-{ register size_t i;
- register soap_wchar c = 0;
- register char *s = soap->tmpbuf;
+{ size_t i;
+ soap_wchar c = 0;
+ char *s = soap->tmpbuf;
if (!soap->body)
return SOAP_STR_EOS;
do c = soap_get(soap);
@@ -13908,26 +15695,28 @@ soap_value(struct soap *soap)
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element content value='%s'\n", soap->tmpbuf));
if (c == SOAP_TT || c == SOAP_LT || (int)c == EOF)
soap_unget(soap, c);
- else if (soap->mode & SOAP_XML_STRICT)
+ else
{ soap->error = SOAP_LENGTH;
return NULL;
}
#ifdef WITH_DOM
if ((soap->mode & SOAP_XML_DOM) && soap->dom)
- soap->dom->data = soap_strdup(soap, soap->tmpbuf);
+ soap->dom->text = soap_strdup(soap, soap->tmpbuf);
#endif
return soap->tmpbuf; /* return non-null pointer */
}
#endif
/******************************************************************************/
+
#if !defined(WITH_LEANER) || !defined(WITH_NOHTTP)
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
-soap_getline(struct soap *soap, char *s, int len)
-{ int i = len;
+soap_getline(struct soap *soap, char *buf, int len)
+{ char *s = buf;
+ int i = len;
soap_wchar c = 0;
for (;;)
{ while (--i > 0)
@@ -13959,13 +15748,14 @@ soap_getline(struct soap *soap, char *s, int len)
#endif
/******************************************************************************/
+
#ifndef PALM_1
static size_t
soap_count_attachments(struct soap *soap)
{
#ifndef WITH_LEANER
- register struct soap_multipart *content;
- register size_t count = soap->count;
+ struct soap_multipart *content;
+ size_t count = soap->count;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Calculating the message size with attachments, current count=%lu\n", (unsigned long)count));
if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM))
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Calculating the size of DIME attachments\n"));
@@ -13981,10 +15771,10 @@ soap_count_attachments(struct soap *soap)
}
}
if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary)
- { register size_t n = strlen(soap->mime.boundary);
+ { size_t n = strlen(soap->mime.boundary);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Calculating the size of MIME attachments\n"));
for (content = soap->mime.first; content; content = content->next)
- { register const char *s;
+ { const char *s;
/* count \r\n--boundary\r\n */
count += 6 + n;
/* count Content-Type: ...\r\n */
@@ -14019,6 +15809,7 @@ soap_count_attachments(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
static int
@@ -14031,6 +15822,7 @@ soap_putdimefield(struct soap *soap, const char *s, size_t n)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14047,7 +15839,7 @@ soap_dime_option(struct soap *soap, unsigned short optype, const char *option)
s[1] = (char)(optype & 0xFF);
s[2] = (char)(n >> 8);
s[3] = (char)(n & 0xFF);
- strcpy(s + 4, option);
+ soap_strcpy(s + 4, n + 1, option);
}
}
return s;
@@ -14056,6 +15848,7 @@ soap_dime_option(struct soap *soap, unsigned short optype, const char *option)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14100,6 +15893,7 @@ soap_putdimehdr(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14116,7 +15910,7 @@ soap_putdime(struct soap *soap)
soap->dime.type = content->type;
soap->dime.options = content->options;
soap->dime.flags = SOAP_DIME_VERSION | SOAP_DIME_MEDIA;
- if (soap->fdimereadopen && ((handle = soap->fdimereadopen(soap, (void*)content->ptr, content->id, content->type, content->options)) || soap->error))
+ if (soap->fdimereadopen && ((handle = soap->fdimereadopen(soap, (void*)content->ptr, content->id, content->type, content->options)) != NULL || soap->error))
{ size_t size = content->size;
if (!handle)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadopen failed\n"));
@@ -14158,7 +15952,8 @@ soap_putdime(struct soap *soap)
bufsize = size;
else
bufsize = sizeof(soap->tmpbuf);
- if (!(bufsize = soap->fdimeread(soap, handle, soap->tmpbuf, bufsize)))
+ bufsize = soap->fdimeread(soap, handle, soap->tmpbuf, bufsize);
+ if (!bufsize)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimeread failed: insufficient data (%lu bytes remaining from %lu bytes)\n", (unsigned long)size, (unsigned long)content->size));
soap->error = SOAP_CHK_EOF;
break;
@@ -14168,7 +15963,8 @@ soap_putdime(struct soap *soap)
size -= bufsize;
} while (size);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadclose\n"));
- soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime.size&3);
+ if (soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime.size&3))
+ return soap->error;
}
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadclose\n"));
if (soap->fdimereadclose)
@@ -14188,27 +15984,30 @@ soap_putdime(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
static char *
soap_getdimefield(struct soap *soap, size_t n)
-{ register soap_wchar c;
- register size_t i;
- register char *s;
- register char *p = NULL;
+{ soap_wchar c;
+ size_t i;
+ char *s;
+ char *p = NULL;
if (n)
{ p = (char*)soap_malloc(soap, n + 1);
if (p)
{ s = p;
for (i = n; i > 0; i--)
- { if ((int)(c = soap_get1(soap)) == EOF)
+ { c = soap_get1(soap);
+ if ((int)c == EOF)
{ soap->error = SOAP_CHK_EOF;
return NULL;
}
*s++ = (char)c;
}
- *s = '\0';
- if ((soap->error = soap_move(soap, (size_t)(-(long)n&3))))
+ *s = '\0'; /* force NUL terminated */
+ soap->error = soap_move(soap, (size_t)(-(long)n&3));
+ if (soap->error)
return NULL;
}
else
@@ -14220,15 +16019,16 @@ soap_getdimefield(struct soap *soap, size_t n)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_getdimehdr(struct soap *soap)
-{ register soap_wchar c;
- register char *s;
- register int i;
+{ soap_wchar c;
+ char *s;
+ int i;
unsigned char tmp[12];
size_t optlen, idlen, typelen;
if (!(soap->mode & SOAP_ENC_DIME))
@@ -14243,7 +16043,8 @@ soap_getdimehdr(struct soap *soap)
}
s = (char*)tmp;
for (i = 12; i > 0; i--)
- { if ((int)(c = soap_getchar(soap)) == EOF)
+ { c = soap_getchar(soap);
+ if ((int)c == EOF)
return soap->error = SOAP_CHK_EOF;
*s++ = (char)c;
}
@@ -14255,11 +16056,14 @@ soap_getdimehdr(struct soap *soap)
typelen = (tmp[6] << 8) | tmp[7];
soap->dime.size = ((size_t)tmp[8] << 24) | ((size_t)tmp[9] << 16) | ((size_t)tmp[10] << 8) | ((size_t)tmp[11]);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME size=%lu flags=0x%X\n", (unsigned long)soap->dime.size, soap->dime.flags));
- if (!(soap->dime.options = soap_getdimefield(soap, optlen)) && soap->error)
+ soap->dime.options = soap_getdimefield(soap, optlen);
+ if (!soap->dime.options && soap->error)
return soap->error;
- if (!(soap->dime.id = soap_getdimefield(soap, idlen)) && soap->error)
+ soap->dime.id = soap_getdimefield(soap, idlen);
+ if (!soap->dime.id && soap->error)
return soap->error;
- if (!(soap->dime.type = soap_getdimefield(soap, typelen)) && soap->error)
+ soap->dime.type = soap_getdimefield(soap, typelen);
+ if (!soap->dime.type && soap->error)
return soap->error;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME id='%s', type='%s', options='%s'\n", soap->dime.id ? soap->dime.id : SOAP_STR_EOS, soap->dime.type ? soap->dime.type : "", soap->dime.options ? soap->dime.options+4 : SOAP_STR_EOS));
if (soap->dime.flags & SOAP_DIME_ME)
@@ -14270,6 +16074,7 @@ soap_getdimehdr(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14285,10 +16090,10 @@ soap_getdime(struct soap *soap)
if (soap_move(soap, (size_t)(((soap->dime.size+3)&(~3)) - soap_tell(soap))))
return soap->error = SOAP_EOF;
for (;;)
- { register struct soap_multipart *content;
+ { struct soap_multipart *content;
if (soap_getdimehdr(soap))
break;
- if (soap->fdimewriteopen && ((soap->dime.ptr = (char*)soap->fdimewriteopen(soap, soap->dime.id, soap->dime.type, soap->dime.options)) || soap->error))
+ if (soap->fdimewriteopen && ((soap->dime.ptr = (char*)soap->fdimewriteopen(soap, soap->dime.id, soap->dime.type, soap->dime.options)) != NULL || soap->error))
{ const char *id, *type, *options;
size_t size, n;
if (!soap->dime.ptr)
@@ -14302,7 +16107,8 @@ soap_getdime(struct soap *soap)
{ n = soap->buflen - soap->bufidx;
if (size < n)
n = size;
- if ((soap->error = soap->fdimewrite(soap, (void*)soap->dime.ptr, soap->buf + soap->bufidx, n)))
+ soap->error = soap->fdimewrite(soap, (void*)soap->dime.ptr, soap->buf + soap->bufidx, n);
+ if (soap->error)
break;
size -= n;
if (!size)
@@ -14339,9 +16145,9 @@ end:
if (soap_new_block(soap) == NULL)
return SOAP_EOM;
for (;;)
- { register soap_wchar c;
- register size_t i;
- register char *s;
+ { soap_wchar c;
+ size_t i;
+ char *s;
if (soap->dime.size > SOAP_MAXDIMESIZE)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME size=%lu exceeds SOAP_MAXDIMESIZE=%lu\n", (unsigned long)soap->dime.size, (unsigned long)SOAP_MAXDIMESIZE));
return soap->error = SOAP_DIME_ERROR;
@@ -14350,7 +16156,8 @@ end:
if (!s)
return soap->error = SOAP_EOM;
for (i = soap->dime.size; i > 0; i--)
- { if ((int)(c = soap_get1(soap)) == EOF)
+ { c = soap_get1(soap);
+ if ((int)c == EOF)
return soap->error = SOAP_EOF;
*s++ = (char)c;
}
@@ -14362,7 +16169,8 @@ end:
return soap->error;
}
soap->dime.size = soap->blist->size++; /* allocate one more byte in blist for the terminating '\0' */
- if (!(soap->dime.ptr = soap_save_block(soap, NULL, NULL, 0)))
+ soap->dime.ptr = soap_save_block(soap, NULL, NULL, 0);
+ if (!soap->dime.ptr)
return soap->error;
soap->dime.ptr[soap->dime.size] = '\0'; /* make 0-terminated */
soap->dime.id = id;
@@ -14389,6 +16197,7 @@ end:
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14396,11 +16205,11 @@ int
SOAP_FMAC2
soap_getmimehdr(struct soap *soap)
{ struct soap_multipart *content;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get MIME header\n"));
do
{ if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf)))
return soap->error;
- }
- while (!*soap->msgbuf);
+ } while (!*soap->msgbuf);
if (soap->msgbuf[0] == '-' && soap->msgbuf[1] == '-')
{ char *s = soap->msgbuf + strlen(soap->msgbuf) - 1;
/* remove white space */
@@ -14420,11 +16229,11 @@ soap_getmimehdr(struct soap *soap)
return soap->error = SOAP_EOM;
content = soap->mime.last;
for (;;)
- { register char *key = soap->msgbuf;
- register char *val;
+ { char *key = soap->msgbuf;
+ char *val;
if (!*key)
break;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "MIME header: %s\n", key));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "MIME header: %s\n", key));
val = strchr(soap->msgbuf, ':');
if (val)
{ *val = '\0';
@@ -14434,14 +16243,14 @@ soap_getmimehdr(struct soap *soap)
content->id = soap_strdup(soap, val);
else if (!soap_tag_cmp(key, "Content-Location"))
content->location = soap_strdup(soap, val);
- else if (!soap_tag_cmp(key, "Content-Disposition"))
+ else if (!content->id && !soap_tag_cmp(key, "Content-Disposition"))
content->id = soap_strdup(soap, soap_get_header_attribute(soap, val, "name"));
else if (!soap_tag_cmp(key, "Content-Type"))
content->type = soap_strdup(soap, val);
else if (!soap_tag_cmp(key, "Content-Description"))
content->description = soap_strdup(soap, val);
else if (!soap_tag_cmp(key, "Content-Transfer-Encoding"))
- content->encoding = (enum soap_mime_encoding)soap_code_int(mime_codes, val, (long)SOAP_MIME_NONE);
+ content->encoding = (enum soap_mime_encoding)soap_code_int(mime_codes, val, (LONG64)SOAP_MIME_NONE);
}
if (soap_getline(soap, key, sizeof(soap->msgbuf)))
return soap->error;
@@ -14452,6 +16261,7 @@ soap_getmimehdr(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14459,13 +16269,14 @@ int
SOAP_FMAC2
soap_getmime(struct soap *soap)
{ while (soap_get_mime_attachment(soap, NULL))
- ;
+ continue;
return soap->error;
}
#endif
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14478,6 +16289,7 @@ soap_post_check_mime_attachments(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14492,27 +16304,29 @@ soap_check_mime_attachments(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
struct soap_multipart *
SOAP_FMAC2
soap_get_mime_attachment(struct soap *soap, void *handle)
-{ register soap_wchar c = 0;
- register size_t i, m = 0;
- register char *s, *t = NULL;
- register struct soap_multipart *content;
- register short flag = 0;
+{ soap_wchar c = 0;
+ size_t i, m = 0;
+ char *s, *t = NULL;
+ struct soap_multipart *content;
+ short flag = 0;
if (!(soap->mode & SOAP_ENC_MIME))
return NULL;
content = soap->mime.last;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get MIME (%p)\n", content));
if (!content)
{ if (soap_getmimehdr(soap))
return NULL;
content = soap->mime.last;
}
else if (content != soap->mime.first)
- { if (soap->fmimewriteopen && ((content->ptr = (char*)soap->fmimewriteopen(soap, (void*)handle, content->id, content->type, content->description, content->encoding)) || soap->error))
+ { if (soap->fmimewriteopen && ((content->ptr = (char*)soap->fmimewriteopen(soap, (void*)handle, content->id, content->type, content->description, content->encoding)) != NULL || soap->error))
{ if (!content->ptr)
return NULL;
}
@@ -14524,10 +16338,15 @@ soap_get_mime_attachment(struct soap *soap, void *handle)
}
for (;;)
{ if (content->ptr)
+ {
s = soap->tmpbuf;
- else if (!(s = (char*)soap_push_block(soap, NULL, sizeof(soap->tmpbuf))))
- { soap->error = SOAP_EOM;
- return NULL;
+ }
+ else
+ { s = (char*)soap_push_block(soap, NULL, sizeof(soap->tmpbuf));
+ if (!s)
+ { soap->error = SOAP_EOM;
+ return NULL;
+ }
}
for (i = 0; i < sizeof(soap->tmpbuf); i++)
{ if (m > 0)
@@ -14536,7 +16355,7 @@ soap_get_mime_attachment(struct soap *soap, void *handle)
}
else
{ if (!flag)
- { c = soap_get1(soap);
+ { c = soap_getchar(soap);
if ((int)c == EOF)
{ if (content->ptr && soap->fmimewriteclose)
soap->fmimewriteclose(soap, (void*)content->ptr);
@@ -14545,11 +16364,11 @@ soap_get_mime_attachment(struct soap *soap, void *handle)
}
}
if (flag || c == '\r')
- { t = soap->msgbuf;
- memset(t, 0, sizeof(soap->msgbuf));
- strcpy(t, "\n--");
+ { memset((void*)soap->msgbuf, 0, sizeof(soap->msgbuf));
+ soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), "\n--");
if (soap->mime.boundary)
- strncat(t, soap->mime.boundary, sizeof(soap->msgbuf)-4);
+ soap_strncat(soap->msgbuf, sizeof(soap->msgbuf), soap->mime.boundary, sizeof(soap->msgbuf) - 4);
+ t = soap->msgbuf;
do c = soap_getchar(soap);
while (c == *t++);
if ((int)c == EOF)
@@ -14570,12 +16389,12 @@ soap_get_mime_attachment(struct soap *soap, void *handle)
}
}
if (content->ptr && soap->fmimewrite)
- { if ((soap->error = soap->fmimewrite(soap, (void*)content->ptr, soap->tmpbuf, i)))
+ { soap->error = soap->fmimewrite(soap, (void*)content->ptr, soap->tmpbuf, i);
+ if (soap->error)
break;
}
}
end:
- *s = '\0'; /* make 0-terminated */
if (content->ptr)
{ if (!soap->error && soap->fmimewrite)
soap->error = soap->fmimewrite(soap, (void*)content->ptr, soap->tmpbuf, i);
@@ -14585,7 +16404,8 @@ end:
return NULL;
}
else
- { content->size = soap_size_block(soap, NULL, i+1) - 1; /* last block with '\0' */
+ { *s = '\0'; /* make 0-terminated, just in case */
+ content->size = soap_size_block(soap, NULL, i+1) - 1; /* last block with '\0' */
content->ptr = soap_save_block(soap, NULL, NULL, 0);
}
soap_resolve_attachment(soap, content);
@@ -14614,13 +16434,14 @@ end:
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_match_cid(struct soap *soap, const char *s, const char *t)
-{ register size_t n;
+{ size_t n;
if (!s)
return 1;
if (!strcmp(s, t))
@@ -14643,15 +16464,16 @@ soap_match_cid(struct soap *soap, const char *s, const char *t)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
static void
soap_resolve_attachment(struct soap *soap, struct soap_multipart *content)
{ if (content->id)
- { register struct soap_xlist **xp = &soap->xlist;
+ { struct soap_xlist **xp = &soap->xlist;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving attachment data for id='%s'\n", content->id));
while (*xp)
- { register struct soap_xlist *xq = *xp;
+ { struct soap_xlist *xq = *xp;
if (!soap_match_cid(soap, xq->id, content->id))
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Found matching attachment id='%s' for content id='%s'\n", xq->id, content->id));
*xp = xq->next;
@@ -14673,6 +16495,7 @@ soap_resolve_attachment(struct soap *soap, struct soap_multipart *content)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14700,6 +16523,7 @@ soap_putmimehdr(struct soap *soap, struct soap_multipart *content)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14712,7 +16536,7 @@ soap_putmime(struct soap *soap)
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending MIME attachments\n"));
for (content = soap->mime.first; content; content = content->next)
{ void *handle;
- if (soap->fmimereadopen && ((handle = soap->fmimereadopen(soap, (void*)content->ptr, content->id, content->type, content->description)) || soap->error))
+ if (soap->fmimereadopen && ((handle = soap->fmimereadopen(soap, (void*)content->ptr, content->id, content->type, content->description)) != NULL || soap->error))
{ size_t size = content->size;
if (!handle)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimereadopen failed\n"));
@@ -14741,7 +16565,8 @@ soap_putmime(struct soap *soap)
bufsize = size;
else
bufsize = sizeof(soap->tmpbuf);
- if (!(bufsize = soap->fmimeread(soap, handle, soap->tmpbuf, bufsize)))
+ bufsize = soap->fmimeread(soap, handle, soap->tmpbuf, bufsize);
+ if (!bufsize)
{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimeread failed: insufficient data (%lu bytes remaining from %lu bytes)\n", (unsigned long)size, (unsigned long)content->size));
soap->error = SOAP_EOF;
break;
@@ -14766,6 +16591,7 @@ soap_putmime(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14780,6 +16606,7 @@ soap_set_dime(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14796,6 +16623,7 @@ soap_set_mime(struct soap *soap, const char *boundary, const char *start)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14810,6 +16638,7 @@ soap_clr_dime(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14826,11 +16655,13 @@ soap_clr_mime(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
static struct soap_multipart*
soap_new_multipart(struct soap *soap, struct soap_multipart **first, struct soap_multipart **last, char *ptr, size_t size)
{ struct soap_multipart *content;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New MIME attachment %p (%lu)\n", ptr, (unsigned long)size));
content = (struct soap_multipart*)soap_malloc(soap, sizeof(struct soap_multipart));
if (content)
{ content->next = NULL;
@@ -14854,6 +16685,7 @@ soap_new_multipart(struct soap *soap, struct soap_multipart **first, struct soap
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14872,6 +16704,7 @@ soap_set_dime_attachment(struct soap *soap, char *ptr, size_t size, const char *
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14892,6 +16725,7 @@ soap_set_mime_attachment(struct soap *soap, char *ptr, size_t size, enum soap_mi
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
SOAP_FMAC1
@@ -14906,13 +16740,14 @@ soap_next_multipart(struct soap_multipart *content)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
static void
soap_select_mime_boundary(struct soap *soap)
{ while (!soap->mime.boundary || soap_valid_mime_boundary(soap))
- { register char *s = soap->mime.boundary;
- register size_t n = 0;
+ { char *s = soap->mime.boundary;
+ size_t n = 0;
if (s)
n = strlen(s);
if (n < 16)
@@ -14921,14 +16756,16 @@ soap_select_mime_boundary(struct soap *soap)
if (!s)
return;
}
- strcpy(s, "==");
- s += 2;
+ *s++ = '=';
+ *s++ = '=';
n -= 4;
while (n)
{ *s++ = soap_base64o[soap_random & 0x3F];
n--;
}
- strcpy(s, "==");
+ *s++ = '=';
+ *s++ = '=';
+ *s = '\0';
}
if (!soap->mime.start)
soap->mime.start = "<SOAP-ENV:Envelope>";
@@ -14937,19 +16774,20 @@ soap_select_mime_boundary(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEANER
#ifndef PALM_1
static int
soap_valid_mime_boundary(struct soap *soap)
-{ register struct soap_multipart *content;
- register size_t k;
+{ struct soap_multipart *content;
+ size_t k;
if (soap->fmimeread)
return SOAP_OK;
k = strlen(soap->mime.boundary);
for (content = soap->mime.first; content; content = content->next)
{ if (content->ptr && content->size >= k)
- { register const char *p = (const char*)content->ptr;
- register size_t i;
+ { const char *p = (const char*)content->ptr;
+ size_t i;
for (i = 0; i < content->size - k; i++, p++)
{ if (!strncmp(p, soap->mime.boundary, k))
return SOAP_ERR;
@@ -14962,6 +16800,7 @@ soap_valid_mime_boundary(struct soap *soap)
#endif
/******************************************************************************/
+
#ifdef WITH_GZIP
#ifndef PALM_1
static int
@@ -14970,15 +16809,16 @@ soap_getgziphdr(struct soap *soap)
soap_wchar c = 0, f = 0;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get gzip header\n"));
for (i = 0; i < 9; i++)
- { if ((int)(c = soap_get1(soap) == EOF))
- return soap->error = SOAP_ZLIB_ERROR;
+ { c = soap_get1(soap);
if (i == 1 && c == 8)
soap->z_dict = 0;
if (i == 2)
f = c;
}
if (f & 0x04) /* FEXTRA */
- { for (i = soap_get1(soap) | (soap_get1(soap) << 8); i; i--)
+ { i = soap_get1(soap);
+ i |= soap_get1(soap) << 8;
+ while (i-- > 0)
{ if ((int)soap_get1(soap) == EOF)
return soap->error = SOAP_ZLIB_ERROR;
}
@@ -14994,7 +16834,8 @@ soap_getgziphdr(struct soap *soap)
while (c && (int)c != EOF);
}
if ((int)c != EOF && (f & 0x02)) /* skip FHCRC (CRC32 is used) */
- { if ((int)(c = soap_get1(soap)) != EOF)
+ { c = soap_get1(soap);
+ if ((int)c != EOF)
c = soap_get1(soap);
}
if ((int)c == EOF)
@@ -15005,6 +16846,7 @@ soap_getgziphdr(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -15025,7 +16867,7 @@ soap_begin_serve(struct soap *soap)
{ if (soap->error < SOAP_STOP)
{
#ifdef WITH_FASTCGI
- soap_send_fault(soap);
+ (void)soap_send_fault(soap);
#else
return soap_send_fault(soap);
#endif
@@ -15037,18 +16879,21 @@ soap_begin_serve(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_begin_recv(struct soap *soap)
-{ register soap_wchar c;
+{ soap_wchar c;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing for input from socket=%d/fd=%d\n", soap->socket, soap->recvfd));
soap->error = SOAP_OK;
- soap->filterstop = SOAP_OK;
+#ifndef WITH_LEANER
+ soap->recverror = SOAP_OK;
+#endif
soap_free_temp(soap);
soap_set_local_namespaces(soap);
- soap->version = 0; /* don't assume we're parsing SOAP content by default */
+ soap->version = 0; /* don't assume we're parsing SOAP content by default */
#ifndef WITH_NOIDREF
soap_free_iht(soap);
#endif
@@ -15062,11 +16907,11 @@ soap_begin_recv(struct soap *soap)
}
if (!(soap->mode & SOAP_IO_KEEPALIVE))
soap->keep_alive = 0;
+ soap->shaky = 0;
soap->ahead = 0;
soap->peeked = 0;
soap->level = 0;
soap->part = SOAP_BEGIN;
- soap->alloced = 0;
soap->body = 1;
soap->count = 0;
soap->length = 0;
@@ -15093,7 +16938,7 @@ soap_begin_recv(struct soap *soap)
#ifdef WIN32
#ifndef UNDER_CE
#ifndef WITH_FASTCGI
- if (!soap_valid_socket(soap->socket) && !soap->is) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */
+ if (!soap_valid_socket(soap->socket) && !soap->is && soap->recvfd >= 0) /* Set win32 stdin or soap->recvfd to BINARY, e.g. to support DIME */
#ifdef __BORLANDC__
setmode(soap->recvfd, _O_BINARY);
#else
@@ -15106,10 +16951,16 @@ soap_begin_recv(struct soap *soap)
soap->mode &= ~SOAP_ENC_ZLIB;
soap->zlib_in = SOAP_ZLIB_NONE;
soap->zlib_out = SOAP_ZLIB_NONE;
- soap->d_stream->next_in = Z_NULL;
+ if (!soap->d_stream)
+ { soap->d_stream = (z_stream*)SOAP_MALLOC(soap, sizeof(z_stream));
+ soap->d_stream->zalloc = Z_NULL;
+ soap->d_stream->zfree = Z_NULL;
+ soap->d_stream->opaque = Z_NULL;
+ soap->d_stream->next_in = Z_NULL;
+ }
soap->d_stream->avail_in = 0;
soap->d_stream->next_out = (Byte*)soap->buf;
- soap->d_stream->avail_out = SOAP_BUFLEN;
+ soap->d_stream->avail_out = sizeof(soap->buf);
soap->z_ratio_in = 1.0;
#endif
#ifdef WITH_OPENSSL
@@ -15117,7 +16968,7 @@ soap_begin_recv(struct soap *soap)
ERR_clear_error();
#endif
#ifndef WITH_LEANER
- if (soap->fprepareinitrecv && (soap->error = soap->fprepareinitrecv(soap)))
+ if (soap->fprepareinitrecv && (soap->error = soap->fprepareinitrecv(soap)) != SOAP_OK)
return soap->error;
#endif
c = soap_getchar(soap);
@@ -15137,8 +16988,8 @@ soap_begin_recv(struct soap *soap)
soap->z_crc = crc32(0L, NULL, 0);
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n"));
if (!soap->z_buf)
- soap->z_buf = (char*)SOAP_MALLOC(soap, SOAP_BUFLEN);
- memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
+ soap->z_buf = (char*)SOAP_MALLOC(soap, sizeof(soap->buf));
+ soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)soap->buf, sizeof(soap->buf));
/* should not chunk over plain transport, so why bother to check? */
/* if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) */
/* soap->z_buflen = soap->bufidx; */
@@ -15161,8 +17012,9 @@ soap_begin_recv(struct soap *soap)
#endif
{ /* skip BOM */
if (c == 0xEF && soap_get0(soap) == 0xBB)
- { c = soap_get1(soap);
- if ((c = soap_get1(soap)) == 0xBF)
+ { soap_get1(soap);
+ c = soap_get1(soap);
+ if (c == 0xBF)
{ soap->mode &= ~SOAP_ENC_LATIN;
c = soap_getchar(soap);
}
@@ -15186,7 +17038,8 @@ soap_begin_recv(struct soap *soap)
soap->mode &= ~SOAP_IO;
soap->error = soap->fparse(soap);
if (soap->error && soap->error < SOAP_STOP)
- { soap->keep_alive = 0; /* force close later */
+ { if (soap->error < 200 || soap->error > 202)
+ soap->keep_alive = 0; /* force close later if error but excluding HTTP codes 200..202 */
return soap->error;
}
if (soap->error == SOAP_STOP)
@@ -15248,8 +17101,8 @@ soap_begin_recv(struct soap *soap)
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate initialized\n"));
soap->mode |= SOAP_ENC_ZLIB;
if (!soap->z_buf)
- soap->z_buf = (char*)SOAP_MALLOC(soap, SOAP_BUFLEN);
- memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
+ soap->z_buf = (char*)SOAP_MALLOC(soap, sizeof(soap->buf));
+ soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)soap->buf, sizeof(soap->buf));
soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx);
soap->d_stream->avail_in = (unsigned int)(soap->buflen - soap->bufidx);
soap->z_buflen = soap->buflen;
@@ -15260,14 +17113,15 @@ soap_begin_recv(struct soap *soap)
if (soap->fpreparerecv && (soap->mode & SOAP_IO) != SOAP_IO_CHUNK && soap->buflen > soap->bufidx)
{ int r;
DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Invoking fpreparerecv\n"));
- if ((r = soap->fpreparerecv(soap, soap->buf + soap->bufidx, soap->buflen - soap->bufidx)))
+ r = soap->fpreparerecv(soap, soap->buf + soap->bufidx, soap->buflen - soap->bufidx);
+ if (r)
return soap->error = r;
}
#endif
if (soap_get0(soap) == (int)EOF)
- { if (soap->status == 0 || soap->status == 200)
- return soap->error = SOAP_NO_DATA; /* HTTP OK: always expect data */
- return soap->error = soap->status;
+ { if (soap->status == 0)
+ return soap->error = SOAP_NO_DATA; /* server side expects data */
+ return soap->error = soap->status; /* client side received HTTP status code */
}
if (soap->error)
{ if (soap->error == SOAP_FORM && soap->fform)
@@ -15282,7 +17136,8 @@ soap_begin_recv(struct soap *soap)
#ifndef WITH_LEANER
if (soap->mode & SOAP_ENC_MIME)
{ do /* skip preamble */
- { if ((int)(c = soap_getchar(soap)) == EOF)
+ { c = soap_getchar(soap);
+ if ((int)c == EOF)
return soap->error = SOAP_CHK_EOF;
} while (c != '-' || soap_get0(soap) != '-');
soap_unget(soap, c);
@@ -15320,6 +17175,7 @@ soap_begin_recv(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -15328,8 +17184,10 @@ soap_envelope_begin_out(struct soap *soap)
{
#ifndef WITH_LEANER
size_t n = 0;
- if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary && soap->mime.start && strlen(soap->mime.boundary) + strlen(soap->mime.start) < sizeof(soap->tmpbuf) - 80 )
+ if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary && soap->mime.start)
{ const char *s;
+ if (strlen(soap->mime.boundary) + strlen(soap->mime.start) + 140 > sizeof(soap->tmpbuf))
+ return soap->error = SOAP_EOM;
if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM))
s = "application/dime";
else if (soap->version == 2)
@@ -15342,17 +17200,13 @@ soap_envelope_begin_out(struct soap *soap)
s = "application/xop+xml; charset=utf-8; type=\"text/xml\"";
else
s = "text/xml; charset=utf-8";
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "--%s\r\nContent-Type: %s\r\nContent-Transfer-Encoding: binary\r\nContent-ID: %s\r\n\r\n", soap->mime.boundary, s, soap->mime.start);
-#else
- sprintf(soap->tmpbuf, "--%s\r\nContent-Type: %s\r\nContent-Transfer-Encoding: binary\r\nContent-ID: %s\r\n\r\n", soap->mime.boundary, s, soap->mime.start);
-#endif
+ (SOAP_SNPRINTF_SAFE(soap->tmpbuf, sizeof(soap->tmpbuf)), "--%s\r\nContent-Type: %s\r\nContent-Transfer-Encoding: binary\r\nContent-ID: %s\r\n\r\n", soap->mime.boundary, s, soap->mime.start);
n = strlen(soap->tmpbuf);
if (soap_send_raw(soap, soap->tmpbuf, n))
return soap->error;
}
if (soap->mode & SOAP_IO_LENGTH)
- soap->dime.size = soap->count; /* DIME in MIME correction */
+ soap->dime.size = soap->count; /* DIME in MIME correction */
if (!(soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME))
{ if (soap_putdimehdr(soap))
return soap->error;
@@ -15366,6 +17220,7 @@ soap_envelope_begin_out(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -15374,16 +17229,12 @@ soap_envelope_end_out(struct soap *soap)
{ if (soap->version == 0)
return SOAP_OK;
if (soap_element_end_out(soap, "SOAP-ENV:Envelope")
- || soap_send_raw(soap, "\r\n", 2)) /* 2.8: always emit \r\n */
+ || soap_send_raw(soap, "\r\n", 2)) /* 2.8: always emit \r\n */
return soap->error;
#ifndef WITH_LEANER
if ((soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM))
- { soap->dime.size = soap->count - soap->dime.size; /* DIME in MIME correction */
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->id, sizeof(soap->id), soap->dime_id_format, 0);
-#else
- sprintf(soap->id, soap->dime_id_format, 0);
-#endif
+ { soap->dime.size = soap->count - soap->dime.size; /* DIME in MIME correction */
+ (SOAP_SNPRINTF(soap->id, sizeof(soap->id), strlen(soap->dime_id_format) + 20), soap->dime_id_format, 0);
soap->dime.id = soap->id;
if (soap->local_namespaces)
{ if (soap->local_namespaces[0].out)
@@ -15406,26 +17257,28 @@ soap_envelope_end_out(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
#ifndef PALM_1
SOAP_FMAC1
char*
SOAP_FMAC2
soap_get_http_body(struct soap *soap, size_t *len)
-{ if (len)
- *len = 0;
+{
#ifndef WITH_LEAN
- register size_t l = 0, n = 0;
- register char *s;
+ size_t l = 0, n = 0;
+ char *s;
+ if (len)
+ *len = 0;
/* get HTTP body length */
if (!(soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) != SOAP_IO_CHUNK)
{ n = soap->length;
if (!n)
return NULL;
}
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Parsing HTTP body (mode=0x%x,len=%lu)\n", soap->mode, (unsigned long)n));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Parsing HTTP body (mode=0x%x,len=%lu)\n", soap->mode, (unsigned long)n));
#ifdef WITH_FAST
- soap->labidx = 0; /* use look-aside buffer */
+ soap->labidx = 0; /* use look-aside buffer */
#else
if (soap_new_block(soap) == NULL)
return NULL;
@@ -15433,19 +17286,20 @@ soap_get_http_body(struct soap *soap, size_t *len)
for (;;)
{
#ifdef WITH_FAST
- register size_t i, k;
- if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */
+ size_t i, k;
+ if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */
return NULL;
- s = soap->labbuf + soap->labidx; /* space to populate */
- k = soap->lablen - soap->labidx; /* number of bytes available */
- soap->labidx = soap->lablen; /* claim this space */
+ s = soap->labbuf + soap->labidx; /* space to populate */
+ k = soap->lablen - soap->labidx; /* number of bytes available */
+ soap->labidx = soap->lablen; /* claim this space */
#else
- register size_t i, k = SOAP_BLKLEN;
- if (!(s = (char*)soap_push_block(soap, NULL, k)))
+ size_t i, k = SOAP_BLKLEN;
+ s = (char*)soap_push_block(soap, NULL, k);
+ if (!s)
return NULL;
#endif
for (i = 0; i < k; i++)
- { register soap_wchar c;
+ { soap_wchar c;
l++;
if (n > 0 && l > n)
goto end;
@@ -15460,14 +17314,17 @@ end:
if (len)
*len = l - 1; /* len excludes terminating \0 */
#ifdef WITH_FAST
- if ((s = (char*)soap_malloc(soap, l)))
- memcpy(s, soap->labbuf, l);
+ s = (char*)soap_malloc(soap, l);
+ if (s)
+ soap_memcpy((void*)s, l, (const void*)soap->labbuf, l);
#else
soap_size_block(soap, NULL, i+1);
- s = soap_save_block(soap, NULL, 0);
+ s = soap_save_block(soap, NULL, NULL, 0);
#endif
return s;
#else
+ if (len)
+ *len = 0;
return NULL;
#endif
}
@@ -15475,50 +17332,32 @@ end:
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_envelope_begin_in(struct soap *soap)
-{ register struct Namespace *p;
- soap->part = SOAP_IN_ENVELOPE;
+{ soap->part = SOAP_IN_ENVELOPE;
if (soap_element_begin_in(soap, "SOAP-ENV:Envelope", 0, NULL))
{ if (soap->error == SOAP_TAG_MISMATCH)
{ if (!soap_element_begin_in(soap, "Envelope", 0, NULL))
soap->error = SOAP_VERSIONMISMATCH;
else if (soap->status == 0 || (soap->status >= 200 && soap->status <= 299))
- return SOAP_OK; /* allow non-SOAP XML content to be captured */
+ return SOAP_OK; /* allow non-SOAP (REST) XML content to be captured */
soap->error = soap->status;
}
else if (soap->status)
soap->error = soap->status;
return soap->error;
}
- p = soap->local_namespaces;
- if (p)
- { const char *ns = p[0].out;
- if (!ns)
- ns = p[0].ns;
- if (!strcmp(ns, soap_env1))
- { soap->version = 1; /* make sure we use SOAP 1.1 */
- if (p[1].out)
- SOAP_FREE(soap, p[1].out);
- if ((p[1].out = (char*)SOAP_MALLOC(soap, sizeof(soap_enc1))))
- strcpy(p[1].out, soap_enc1);
- }
- else if (!strcmp(ns, soap_env2))
- { soap->version = 2; /* make sure we use SOAP 1.2 */
- if (p[1].out)
- SOAP_FREE(soap, p[1].out);
- if ((p[1].out = (char*)SOAP_MALLOC(soap, sizeof(soap_enc2))))
- strcpy(p[1].out, soap_enc2);
- }
- }
+ soap_get_version(soap);
return SOAP_OK;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -15532,6 +17371,7 @@ soap_envelope_end_in(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -15551,6 +17391,7 @@ soap_body_begin_out(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -15566,6 +17407,7 @@ soap_body_end_out(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -15583,6 +17425,7 @@ soap_body_begin_in(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -15598,6 +17441,7 @@ soap_body_end_in(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -15612,13 +17456,14 @@ soap_recv_header(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
SOAP_FMAC2
soap_set_endpoint(struct soap *soap, const char *endpoint)
-{ register const char *s;
- register size_t i, n;
+{ const char *s, *t;
+ size_t i, n;
soap->endpoint[0] = '\0';
soap->host[0] = '\0';
soap->path[0] = '/';
@@ -15630,13 +17475,36 @@ soap_set_endpoint(struct soap *soap, const char *endpoint)
if (!soap_tag_cmp(endpoint, "https:*"))
soap->port = 443;
#endif
- strncpy(soap->endpoint, endpoint, sizeof(soap->endpoint));
- soap->endpoint[sizeof(soap->endpoint) - 1] = '\0';
+ soap_strcpy(soap->endpoint, sizeof(soap->endpoint), endpoint);
s = strchr(endpoint, ':');
if (s && s[1] == '/' && s[2] == '/')
s += 3;
else
s = endpoint;
+#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER)
+ t = strchr(s, '@');
+ if (t && *s != ':' && *s != '@')
+ { size_t l = t - s + 1;
+ char *r = (char*)soap_malloc(soap, l);
+ n = s - endpoint;
+ if (r)
+ { s = soap_decode(r, l, s, ":@");
+ soap->userid = r;
+ soap->passwd = SOAP_STR_EOS;
+ if (*s == ':')
+ { s++;
+ if (*s != '@')
+ { l = t - s + 1;
+ r = r + strlen(r) + 1;
+ s = soap_decode(r, l, s, "@");
+ soap->passwd = r;
+ }
+ }
+ }
+ s++;
+ soap_strcpy(soap->endpoint + n, sizeof(soap->endpoint) - n, s);
+ }
+#endif
n = strlen(s);
if (n >= sizeof(soap->host))
n = sizeof(soap->host) - 1;
@@ -15674,13 +17542,14 @@ soap_set_endpoint(struct soap *soap, const char *endpoint)
break;
}
if (i < n && s[i])
- { strncpy(soap->path, s + i, sizeof(soap->path));
- soap->path[sizeof(soap->path) - 1] = '\0';
- }
+ soap_strcpy(soap->path, sizeof(soap->path), s + i);
+ if (soap->userid && !soap->authrealm)
+ soap->authrealm = soap->host;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
@@ -15691,39 +17560,44 @@ soap_connect(struct soap *soap, const char *endpoint, const char *action)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_connect_command(struct soap *soap, int http_command, const char *endpoints, const char *action)
-{ char *endpoint;
- const char *s;
- if (endpoints && (s = strchr(endpoints, ' ')))
- { endpoint = (char*)SOAP_MALLOC(soap, strlen(endpoints) + 1);
- for (;;)
- { strncpy(endpoint, endpoints, s - endpoints);
- endpoint[s - endpoints] = '\0';
- if (soap_try_connect_command(soap, http_command, endpoint, action) != SOAP_TCP_ERROR)
- break;
- if (!*s)
- break;
- soap->error = SOAP_OK;
- while (*s == ' ')
- s++;
- endpoints = s;
- s = strchr(endpoints, ' ');
- if (!s)
- s = endpoints + strlen(endpoints);
+{ if (endpoints)
+ { const char *s;
+ s = strchr(endpoints, ' ');
+ if (s)
+ { size_t l = strlen(endpoints);
+ char *endpoint = (char*)SOAP_MALLOC(soap, l + 1);
+ for (;;)
+ { soap_strncpy(endpoint, l + 1, endpoints, s - endpoints);
+ endpoint[s - endpoints] = '\0';
+ if (soap_try_connect_command(soap, http_command, endpoint, action) != SOAP_TCP_ERROR)
+ break;
+ if (!*s)
+ break;
+ soap->error = SOAP_OK;
+ while (*s == ' ')
+ s++;
+ endpoints = s;
+ s = strchr(endpoints, ' ');
+ if (!s)
+ s = endpoints + strlen(endpoints);
+ }
+ SOAP_FREE(soap, endpoint);
}
- SOAP_FREE(soap, endpoint);
+ else
+ soap_try_connect_command(soap, http_command, endpoints, action);
}
- else
- soap_try_connect_command(soap, http_command, endpoints, action);
return soap->error;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
static int
soap_try_connect_command(struct soap *soap, int http_command, const char *endpoint, const char *action)
@@ -15731,18 +17605,19 @@ soap_try_connect_command(struct soap *soap, int http_command, const char *endpoi
int port;
size_t count;
soap->error = SOAP_OK;
- strcpy(host, soap->host); /* save previous host name: if != then reconnect */
+ soap_strcpy(host, sizeof(soap->host), soap->host); /* save previous host name: if != then reconnect */
port = soap->port; /* save previous port to compare */
soap->status = http_command;
soap_set_endpoint(soap, endpoint);
+ soap->action = soap_strdup(soap, action);
#ifndef WITH_LEANER
if (soap->fconnect)
- { if ((soap->error = soap->fconnect(soap, endpoint, soap->host, soap->port)))
+ { soap->error = soap->fconnect(soap, endpoint, soap->host, soap->port);
+ if (soap->error)
return soap->error;
}
else
#endif
- soap->action = soap_strdup(soap, action);
if (soap->fopen && *soap->host)
{ if (!soap->keep_alive || !soap_valid_socket(soap->socket) || strcmp(soap->host, host) || soap->port != port || !soap->fpoll || soap->fpoll(soap))
{ soap->error = SOAP_OK;
@@ -15755,7 +17630,7 @@ soap_try_connect_command(struct soap *soap, int http_command, const char *endpoi
soap->omode &= ~SOAP_IO_UDP; /* to force close */
}
soap_closesock(soap);
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Connect/reconnect to '%s' host='%s' path='%s' port=%d\n", endpoint?endpoint:"(null)", soap->host, soap->path, soap->port));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connect/reconnect to '%s' host='%s' path='%s' port=%d\n", endpoint?endpoint:"(null)", soap->host, soap->path, soap->port));
if (!soap->keep_alive || !soap_valid_socket(soap->socket))
{ soap->socket = soap->fopen(soap, endpoint, soap->host, soap->port);
if (soap->error)
@@ -15781,7 +17656,8 @@ soap_try_connect_command(struct soap *soap, int http_command, const char *endpoi
soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB);
if ((k & SOAP_IO) != SOAP_IO_FLUSH)
soap->mode |= SOAP_IO_BUFFER;
- if ((soap->error = soap->fpost(soap, endpoint, soap->host, soap->port, soap->path, action, count)))
+ soap->error = soap->fpost(soap, endpoint, soap->host, soap->port, soap->path, action, count);
+ if (soap->error)
return soap->error;
#ifndef WITH_LEANER
if ((k & SOAP_IO) == SOAP_IO_CHUNK)
@@ -15799,6 +17675,7 @@ soap_try_connect_command(struct soap *soap, int http_command, const char *endpoi
#endif
/******************************************************************************/
+
#ifdef WITH_NTLM
#ifndef PALM_1
static int
@@ -15818,15 +17695,15 @@ soap_ntlm_handshake(struct soap *soap, int command, const char *endpoint, const
int s = soap->status;
char *a = soap->action;
short v = soap->version;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "NTLM '%s'\n", soap->ntlm_challenge));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM '%s'\n", soap->ntlm_challenge));
if (!*soap->ntlm_challenge)
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "NTLM S->C Type 1: received NTLM authentication challenge from server\n"));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM S->C Type 1: received NTLM authentication challenge from server\n"));
/* S -> C 401 Unauthorized
WWW-Authenticate: NTLM
*/
buildSmbNtlmAuthRequest(&req, userid, soap->authrealm);
- soap->ntlm_challenge = soap_s2base64(soap, (unsigned char*)&req, NULL, SmbLength(&req));
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "NTLM C->S Type 2: sending NTLM authorization to server\nAuthorization: NTLM %s\n", soap->ntlm_challenge));
+ soap->ntlm_challenge = soap_s2base64(soap, (unsigned char*)(void*)&req, NULL, SmbLength(&req));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM C->S Type 2: sending NTLM authorization to server\nAuthorization: NTLM %s\n", soap->ntlm_challenge));
/* C -> S GET ...
Authorization: NTLM TlRMTVNTUAABAAAAA7IAAAoACgApAAAACQAJACAAAABMSUdIVENJVFlVUlNBLU1JTk9S
*/
@@ -15840,12 +17717,12 @@ soap_ntlm_handshake(struct soap *soap, int command, const char *endpoint, const
return soap->error;
soap->mode = m;
soap->keep_alive = k;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "NTLM S->C Type 2: waiting on server NTLM response\n"));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM S->C Type 2: waiting on server NTLM response\n"));
oldheader = soap->header;
if (soap_begin_recv(soap))
if (soap->error == SOAP_EOF)
return soap->error;
- soap_end_recv(soap);
+ (void)soap_end_recv(soap);
soap->header = oldheader;
soap->length = l;
if (soap->status != 401 && soap->status != 407)
@@ -15857,8 +17734,8 @@ soap_ntlm_handshake(struct soap *soap, int command, const char *endpoint, const
*/
soap_base642s(soap, soap->ntlm_challenge, (char*)&ch, sizeof(tSmbNtlmAuthChallenge), NULL);
buildSmbNtlmAuthResponse(&ch, &res, userid, passwd);
- soap->ntlm_challenge = soap_s2base64(soap, (unsigned char*)&res, NULL, SmbLength(&res));
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "NTLM C->S Type 3: sending NTLM authorization to server\nAuthorization: NTLM %s\n", soap->ntlm_challenge));
+ soap->ntlm_challenge = soap_s2base64(soap, (unsigned char*)(void*)&res, NULL, SmbLength(&res));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM C->S Type 3: sending NTLM authorization to server\nAuthorization: NTLM %s\n", soap->ntlm_challenge));
/* C -> S GET ...
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAHIAAAAYABgAigAAABQAFABAAAAADAAMAFQAAAASABIAYAAAAAAAAACiAAAAAYIAAFUAUgBTAEEALQBNAEkATgBPAFIAWgBhAHAAaABvAGQATABJAEcASABUAEMASQBUAFkArYfKbe/jRoW5xDxHeoxC1gBmfWiS5+iX4OAN4xBKG/IFPwfH3agtPEia6YnhsADT
*/
@@ -15881,14 +17758,15 @@ soap_ntlm_handshake(struct soap *soap, int command, const char *endpoint, const
#endif
/******************************************************************************/
-#ifndef WITH_LEAN
+
+#if !defined(WITH_LEAN) || defined(WITH_NTLM)
SOAP_FMAC1
char*
SOAP_FMAC2
soap_s2base64(struct soap *soap, const unsigned char *s, char *t, int n)
-{ register int i;
- register unsigned long m;
- register char *p;
+{ int i;
+ unsigned long m;
+ char *p;
if (!t)
t = (char*)soap_malloc(soap, (n + 2) / 3 * 4 + 1);
if (!t)
@@ -15923,15 +17801,16 @@ soap_s2base64(struct soap *soap, const unsigned char *s, char *t, int n)
#endif
/******************************************************************************/
-#ifndef WITH_LEAN
+
+#if !defined(WITH_LEAN) || defined(WITH_NTLM)
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n)
-{ register size_t i, j;
- register soap_wchar c;
- register unsigned long m;
- register const char *p;
+{ size_t i, j;
+ soap_wchar c;
+ unsigned long m;
+ const char *p;
if (!s || !*s)
{ if (n)
*n = 0;
@@ -15940,7 +17819,7 @@ soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n)
return SOAP_NON_NULL;
}
if (!t)
- { l = (strlen(s) + 3) / 4 * 3 + 1; /* make sure enough space for \0 */
+ { l = (strlen(s) + 3) / 4 * 3 + 1; /* space for raw binary and \0 */
t = (char*)soap_malloc(soap, l);
}
if (!t)
@@ -16004,12 +17883,13 @@ soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
char*
SOAP_FMAC2
soap_s2hex(struct soap *soap, const unsigned char *s, char *t, int n)
-{ register char *p;
+{ char *p;
if (!t)
t = (char*)soap_malloc(soap, 2 * n + 1);
if (!t)
@@ -16018,7 +17898,7 @@ soap_s2hex(struct soap *soap, const unsigned char *s, char *t, int n)
t[0] = '\0';
if (s)
{ for (; n > 0; n--)
- { register int m = *s++;
+ { int m = *s++;
*t++ = (char)((m >> 4) + (m > 159 ? 'a' - 10 : '0'));
m &= 0x0F;
*t++ = (char)(m + (m > 9 ? 'a' - 10 : '0'));
@@ -16030,12 +17910,13 @@ soap_s2hex(struct soap *soap, const unsigned char *s, char *t, int n)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_hex2s(struct soap *soap, const char *s, char *t, size_t l, int *n)
-{ register const char *p;
+{ const char *p;
if (!s || !*s)
{ if (n)
*n = 0;
@@ -16044,14 +17925,14 @@ soap_hex2s(struct soap *soap, const char *s, char *t, size_t l, int *n)
return SOAP_NON_NULL;
}
if (!t)
- { l = strlen(s) / 2 + 1; /* make sure enough space for \0 */
+ { l = strlen(s) / 2 + 1; /* make sure enough space for \0 */
t = (char*)soap_malloc(soap, l);
}
if (!t)
return NULL;
p = t;
while (l)
- { register int d1, d2;
+ { int d1, d2;
d1 = *s++;
if (!d1)
break;
@@ -16070,6 +17951,7 @@ soap_hex2s(struct soap *soap, const char *s, char *t, size_t l, int *n)
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
SOAP_FMAC1
@@ -16077,10 +17959,11 @@ int
SOAP_FMAC2
soap_puthttphdr(struct soap *soap, int status, size_t count)
{ if (soap->status != SOAP_GET && soap->status != SOAP_DEL && soap->status != SOAP_CONNECT)
- { register const char *s = "text/xml; charset=utf-8";
- register int err = SOAP_OK;
+ { const char *s = "text/xml; charset=utf-8";
+ int err = SOAP_OK;
#ifndef WITH_LEANER
- register const char *r = NULL;
+ const char *r = NULL;
+ size_t n;
#endif
if ((status == SOAP_FILE || soap->status == SOAP_PUT || soap->status == SOAP_POST_FILE) && soap->http_content && !strchr(s, 10) && !strchr(s, 13))
s = soap->http_content;
@@ -16102,44 +17985,43 @@ soap_puthttphdr(struct soap *soap, int status, size_t count)
else
s = "application/dime";
}
- if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary && strlen(soap->mime.boundary) + strlen(soap->mime.start ? soap->mime.start : SOAP_STR_EOS) < sizeof(soap->tmpbuf) - 80)
- { register const char *t;
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "multipart/related; charset=utf-8; boundary=\"%s\"; type=\"", soap->mime.boundary);
-#else
- sprintf(soap->tmpbuf, "multipart/related; charset=utf-8; boundary=\"%s\"; type=\"", soap->mime.boundary);
-#endif
+ if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary)
+ { const char *t;
+ size_t l;
+ n = strlen(soap->mime.boundary);
+ (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), n + 53), "multipart/related; charset=utf-8; boundary=\"%s\"; type=\"", soap->mime.boundary);
t = strchr(s, ';');
if (t)
- strncat(soap->tmpbuf, s, t - s);
+ n = t - s;
else
- strcat(soap->tmpbuf, s);
- if (soap->mime.start && strlen(soap->tmpbuf) + strlen(soap->mime.start) + 11 < sizeof(soap->tmpbuf))
- { strcat(soap->tmpbuf, "\"; start=\"");
- strcat(soap->tmpbuf, soap->mime.start);
+ n = strlen(s);
+ l = strlen(soap->tmpbuf);
+ if (sizeof(soap->tmpbuf) - l > n)
+ soap_strncpy(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, s, n);
+ if (soap->mime.start)
+ { l = strlen(soap->tmpbuf);
+ n = strlen(soap->mime.start);
+ (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, n + 10), "\"; start=\"%s", soap->mime.start);
}
- strcat(soap->tmpbuf, "\"");
- if (r && strlen(soap->tmpbuf) + strlen(r) + 15 < sizeof(soap->tmpbuf))
- { strcat(soap->tmpbuf, "; start-info=\"");
- strcat(soap->tmpbuf, r);
- strcat(soap->tmpbuf, "\"");
+ if (r)
+ { l = strlen(soap->tmpbuf);
+ n = strlen(r);
+ (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, n + 15), "\"; start-info=\"%s", r);
}
+ l = strlen(soap->tmpbuf);
+ if (sizeof(soap->tmpbuf) - l > 1)
+ soap_strncpy(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, "\"", 1);
}
else
- strncpy(soap->tmpbuf, s, sizeof(soap->tmpbuf));
- soap->tmpbuf[sizeof(soap->tmpbuf) - 1] = '\0';
- s = soap->tmpbuf;
- if (status == SOAP_OK && soap->version == 2 && soap->action && strlen(soap->action) + strlen(s) < sizeof(soap->tmpbuf) - 80)
- {
-#ifdef HAVE_SNPRINTF
- size_t l = strlen(s);
- soap_snprintf(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, "; action=\"%s\"", soap->action);
-#else
- sprintf(soap->tmpbuf + strlen(s), "; action=\"%s\"", soap->action);
-#endif
+ soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), s);
+ if (status == SOAP_OK && soap->version == 2 && soap->action)
+ { size_t l = strlen(soap->tmpbuf);
+ n = strlen(soap->action);
+ (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, n + 11), "; action=\"%s\"", soap->action);
}
#endif
- if ((err = soap->fposthdr(soap, "Content-Type", s)))
+ err = soap->fposthdr(soap, "Content-Type", soap->tmpbuf);
+ if (err)
return err;
#ifdef WITH_ZLIB
if ((soap->omode & SOAP_ENC_ZLIB))
@@ -16158,13 +18040,7 @@ soap_puthttphdr(struct soap *soap, int status, size_t count)
err = soap->fposthdr(soap, "Transfer-Encoding", "chunked");
else
#endif
- if (s)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "%lu", (unsigned long)count);
-#else
- sprintf(soap->tmpbuf, "%lu", (unsigned long)count);
-#endif
+ { (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), SOAP_ULONG_FORMAT, (ULONG64)count);
err = soap->fposthdr(soap, "Content-Length", soap->tmpbuf);
}
if (err)
@@ -16176,38 +18052,22 @@ soap_puthttphdr(struct soap *soap, int status, size_t count)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
static const char*
soap_set_validation_fault(struct soap *soap, const char *s, const char *t)
{ if (!t)
t = SOAP_STR_EOS;
if (*soap->tag)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Validation constraint violation: %s%s in element '%s'", s, t ? t : SOAP_STR_EOS, soap->tag);
-#else
- if (strlen(soap->tag) + strlen(t) < sizeof(soap->msgbuf) - 100)
- sprintf(soap->msgbuf, "Validation constraint violation: %s%s in element '%s'", s, t, soap->tag);
- else
- sprintf(soap->msgbuf, "Validation constraint violation: %s", s);
-#endif
- }
+ (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(s) + strlen(t) + strlen(soap->tag) + 47), "Validation constraint violation: %s%s in element '%s'", s, t, soap->tag);
else
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Validation constraint violation: %s%s", s, t ? t : SOAP_STR_EOS);
-#else
- if (strlen(soap->tag) + strlen(t) < sizeof(soap->msgbuf) - 100)
- sprintf(soap->msgbuf, "Validation constraint violation: %s%s", s, t);
- else
- sprintf(soap->msgbuf, "Validation constraint violation: %s", s);
-#endif
- }
+ (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(s) + strlen(t) + 33), "Validation constraint violation: %s%s", s, t);
return soap->msgbuf;
}
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
void
@@ -16220,8 +18080,10 @@ soap_set_fault(struct soap *soap)
if (!*c)
{ if (soap->version == 2)
*c = "SOAP-ENV:Sender";
- else
+ else if (soap->version == 1)
*c = "SOAP-ENV:Client";
+ else
+ *c = "at source";
}
if (*s)
return;
@@ -16238,22 +18100,25 @@ soap_set_fault(struct soap *soap)
*s = soap_set_validation_fault(soap, "tag name or namespace mismatch", NULL);
break;
case SOAP_TYPE:
- *s = soap_set_validation_fault(soap, "data type mismatch ", soap->type);
+ if (*soap->type)
+ *s = soap_set_validation_fault(soap, "type mismatch ", soap->type);
+ else
+ *s = soap_set_validation_fault(soap, "invalid value", NULL);
break;
case SOAP_SYNTAX_ERROR:
- *s = "Well-formedness violation";
+ *s = soap_set_validation_fault(soap, "syntax error", NULL);
break;
case SOAP_NO_TAG:
- *s = "No tag: no XML root element or missing SOAP message body element";
+ if (soap->version == 0 && soap->level == 0)
+ *s = soap_set_validation_fault(soap, "missing root element", NULL);
+ else if (soap->version != 0 && soap->level < 3)
+ *s = soap_set_validation_fault(soap, "missing SOAP message", NULL);
+ else
+ *s = soap_set_validation_fault(soap, "missing element", NULL);
break;
case SOAP_MUSTUNDERSTAND:
*c = "SOAP-ENV:MustUnderstand";
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "The data in element '%s' must be understood but cannot be handled", soap->tag);
-#else
- strncpy(soap->msgbuf, soap->tag, sizeof(soap->msgbuf));
- soap->msgbuf[sizeof(soap->msgbuf) - 1] = '\0';
-#endif
+ (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(soap->tag) + 65), "The data in element '%s' must be understood but cannot be processed", soap->tag);
*s = soap->msgbuf;
break;
case SOAP_VERSIONMISMATCH:
@@ -16268,17 +18133,13 @@ soap_set_fault(struct soap *soap)
*s = soap_set_validation_fault(soap, "namespace error", NULL);
break;
case SOAP_USER_ERROR:
- *s = "User data error";
+ *s = "User data access error";
break;
case SOAP_FATAL_ERROR:
- *s = "Fatal error";
+ *s = "A fatal error has occurred";
break;
case SOAP_NO_METHOD:
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Method '%s' not implemented: method name or namespace not recognized", soap->tag);
-#else
- sprintf(soap->msgbuf, "Method '%s' not implemented: method name or namespace not recognized", soap->tag);
-#endif
+ (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(soap->tag) + 66), "Method '%s' not implemented: method name or namespace not recognized", soap->tag);
*s = soap->msgbuf;
break;
case SOAP_NO_DATA:
@@ -16348,7 +18209,7 @@ soap_set_fault(struct soap *soap)
*s = "Plugin registry error";
break;
case SOAP_DIME_ERROR:
- *s = "DIME format error or max DIME size exceeds SOAP_MAXDIMESIZE";
+ *s = "DIME format error or max DIME size exceeds SOAP_MAXDIMESIZE currently set to " SOAP_XSTRINGIFY(SOAP_MAXDIMESIZE);
break;
case SOAP_DIME_HREF:
*s = "DIME href to missing attachment";
@@ -16370,11 +18231,7 @@ soap_set_fault(struct soap *soap)
break;
case SOAP_ZLIB_ERROR:
#ifdef WITH_ZLIB
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Zlib/gzip error: '%s'", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS);
-#else
- sprintf(soap->msgbuf, "Zlib/gzip error: '%s'", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS);
-#endif
+ (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), (soap->d_stream && soap->d_stream->msg ? strlen(soap->d_stream->msg) : 0) + 19), "Zlib/gzip error: '%s'", soap->d_stream && soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS);
*s = soap->msgbuf;
#else
*s = "Zlib/gzip not installed for (de)compression: recompile with -DWITH_GZIP";
@@ -16386,14 +18243,17 @@ soap_set_fault(struct soap *soap)
case SOAP_PROHIBITED:
*s = soap_set_validation_fault(soap, "prohibited attribute present", NULL);
break;
- case SOAP_OCCURS:
- *s = soap_set_validation_fault(soap, "occurrence violation", NULL);
+ case SOAP_LEVEL:
+ *s = "Maximum XML nesting depth level exceeded: increase maxlevel";
break;
case SOAP_LENGTH:
- *s = soap_set_validation_fault(soap, "content range or length violation", NULL);
+ *s = soap_set_validation_fault(soap, "value range or content length violation", NULL);
+ break;
+ case SOAP_OCCURS:
+ *s = soap_set_validation_fault(soap, "occurrence constraint violation or maxoccurs exceeded", NULL);
break;
case SOAP_FD_EXCEEDED:
- *s = "Maximum number of open connections was reached (no define HAVE_POLL): increase FD_SETSIZE";
+ *s = "Maximum number of open connections was reached: increase FD_SETSIZE or define HAVE_POLL";
break;
case SOAP_UTF_ERROR:
*s = "UTF content encoding error";
@@ -16407,8 +18267,15 @@ soap_set_fault(struct soap *soap)
*s = soap_strerror(soap); /* *s = soap->msgbuf */
#ifndef WITH_LEAN
if (strlen(soap->msgbuf) + 25 < sizeof(soap->msgbuf))
- { memmove(soap->msgbuf + 25, soap->msgbuf, strlen(soap->msgbuf) + 1);
- memcpy(soap->msgbuf, "End of file or no input: ", 25);
+ { soap_memmove((void*)(soap->msgbuf + 25), sizeof(soap->tmpbuf) - 25, (const void*)soap->msgbuf, strlen(soap->msgbuf) + 1);
+ if (soap->is)
+#if defined(__cplusplus) && !defined(WITH_COMPAT)
+ soap_memcpy((void*)soap->msgbuf, sizeof(soap->msgbuf), (const void*)"End or bad std::istream: ", 25);
+#else
+ soap_memcpy((void*)soap->msgbuf, sizeof(soap->msgbuf), (const void*)"End at NUL buffer input: ", 25);
+#endif
+ else
+ soap_memcpy((void*)soap->msgbuf, sizeof(soap->msgbuf), (const void*)"End of file or no input: ", 25);
}
#endif
break;
@@ -16419,24 +18286,15 @@ soap_set_fault(struct soap *soap)
default:
#ifndef WITH_NOHTTP
#ifndef WITH_LEAN
- if (soap->error > 200 && soap->error < 600)
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "HTTP Error: %d %s", soap->error, http_error(soap, soap->error));
-#else
- sprintf(soap->msgbuf, "HTTP Error: %d %s", soap->error, http_error(soap, soap->error));
-#endif
+ if (soap->error >= 200 && soap->error < 600)
+ { const char *t = http_error(soap, soap->error);
+ (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(t) + 54), "Error %d: HTTP %d %s", soap->error, soap->error, t);
*s = soap->msgbuf;
}
else
#endif
#endif
- {
-#ifdef HAVE_SNPRINTF
- soap_snprintf(soap->msgbuf, sizeof(soap->msgbuf), "Error %d", soap->error);
-#else
- sprintf(soap->msgbuf, "Error %d", soap->error);
-#endif
+ { (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), 26), "Error %d", soap->error);
*s = soap->msgbuf;
}
}
@@ -16444,21 +18302,22 @@ soap_set_fault(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_send_fault(struct soap *soap)
-{ register int status = soap->error;
+{ int status = soap->error;
if (status == SOAP_OK || status == SOAP_STOP)
return soap_closesock(soap);
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Sending back fault struct for error code %d\n", soap->error));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending back fault struct for error code %d\n", soap->error));
soap->keep_alive = 0; /* to terminate connection */
soap_set_fault(soap);
if (soap->error < 200 && soap->error != SOAP_FAULT)
soap->header = NULL;
if (status != SOAP_EOF || (!soap->recv_timeout && !soap->send_timeout))
- { register int r = 1;
+ { int r = 1;
#ifndef WITH_NOIO
if (soap->fpoll && soap->fpoll(soap))
r = 0;
@@ -16480,25 +18339,26 @@ soap_send_fault(struct soap *soap)
soap->encodingStyle = NULL; /* no encodingStyle in Faults */
soap_serializeheader(soap);
soap_serializefault(soap);
- soap_begin_count(soap);
+ (void)soap_begin_count(soap);
if (soap->mode & SOAP_IO_LENGTH)
- { soap_envelope_begin_out(soap);
- soap_putheader(soap);
- soap_body_begin_out(soap);
- soap_putfault(soap);
- soap_body_end_out(soap);
- soap_envelope_end_out(soap);
- }
- soap_end_count(soap);
+ { if (soap_envelope_begin_out(soap)
+ || soap_putheader(soap)
+ || soap_body_begin_out(soap)
+ || soap_putfault(soap)
+ || soap_body_end_out(soap)
+ || soap_envelope_end_out(soap))
+ return soap_closesock(soap);
+ }
+ (void)soap_end_count(soap);
if (soap_response(soap, status)
|| soap_envelope_begin_out(soap)
|| soap_putheader(soap)
|| soap_body_begin_out(soap)
|| soap_putfault(soap)
|| soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
+ || soap_envelope_end_out(soap)
+ || soap_end_send(soap))
return soap_closesock(soap);
- soap_end_send(soap);
}
}
soap->error = status;
@@ -16507,13 +18367,14 @@ soap_send_fault(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_recv_fault(struct soap *soap, int check)
-{ register int status = soap->error;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Check if receiving SOAP Fault\n"));
+{ int status = soap->status;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Check (%d) if receiving SOAP Fault (status = %d)\n", check, status));
if (!check)
{ /* try getfault when no tag or tag mismatched at level 2, otherwise ret */
if (soap->error != SOAP_NO_TAG
@@ -16521,55 +18382,64 @@ soap_recv_fault(struct soap *soap, int check)
return soap->error;
}
else if (soap->version == 0) /* check == 1 but no SOAP: do not parse SOAP Fault */
+ {
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Not a SOAP protocol\n"));
return SOAP_OK;
+ }
soap->error = SOAP_OK;
if (soap_getfault(soap))
{ /* check flag set: check if SOAP Fault is present, if not just return */
- if (check && soap->error == SOAP_TAG_MISMATCH && soap->level == 2)
+ if (check && ((soap->error == SOAP_TAG_MISMATCH && soap->level == 2) || soap->error == SOAP_NO_TAG))
return soap->error = SOAP_OK;
- DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Error: soap_get_soapfault() failed at level %u tag '%s'\n", soap->level, soap->tag));
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error: soap_get_soapfault() failed at level %u tag '%s'\n", soap->level, soap->tag));
*soap_faultcode(soap) = (soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client");
- soap->error = status;
+ if (status)
+ soap->error = status;
+ else
+ soap->error = status = SOAP_NO_DATA;
soap_set_fault(soap);
}
else
- { register const char *s = *soap_faultcode(soap);
- if (!soap_match_tag(soap, s, "SOAP-ENV:Server") || !soap_match_tag(soap, s, "SOAP-ENV:Receiver"))
+ { const char *s = *soap_faultcode(soap);
+ if (!soap_match_tag(soap, s, "SOAP-ENV:Server")
+ || !soap_match_tag(soap, s, "SOAP-ENV:Receiver"))
status = SOAP_SVR_FAULT;
- else if (!soap_match_tag(soap, s, "SOAP-ENV:Client") || !soap_match_tag(soap, s, "SOAP-ENV:Sender"))
+ else if (!soap_match_tag(soap, s, "SOAP-ENV:Client")
+ || !soap_match_tag(soap, s, "SOAP-ENV:Sender"))
status = SOAP_CLI_FAULT;
else if (!soap_match_tag(soap, s, "SOAP-ENV:MustUnderstand"))
status = SOAP_MUSTUNDERSTAND;
else if (!soap_match_tag(soap, s, "SOAP-ENV:VersionMismatch"))
status = SOAP_VERSIONMISMATCH;
else
- { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Received SOAP Fault code %s\n", s));
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Received SOAP Fault code %s\n", s));
status = SOAP_FAULT;
}
if (!soap_body_end_in(soap))
soap_envelope_end_in(soap);
}
- soap_end_recv(soap);
+ (void)soap_end_recv(soap);
soap->error = status;
return soap_closesock(soap);
}
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_send_empty_response(struct soap *soap, int httpstatuscode)
-{ register soap_mode m = soap->omode;
+{ soap_mode m = soap->omode;
if (!(m & SOAP_IO_UDP))
{ soap->count = 0;
if ((m & SOAP_IO) == SOAP_IO_CHUNK)
soap->omode = (m & ~SOAP_IO) | SOAP_IO_BUFFER;
- soap_response(soap, httpstatuscode);
- soap_end_send(soap); /* force end of sends */
- soap->error = SOAP_STOP; /* stops the server (from returning a response) */
+ (void)soap_response(soap, httpstatuscode);
+ (void)soap_end_send(soap); /* force end of sends */
+ soap->error = SOAP_STOP; /* stops the server (from returning another response */
soap->omode = m;
}
return soap_closesock(soap);
@@ -16578,6 +18448,7 @@ soap_send_empty_response(struct soap *soap, int httpstatuscode)
#endif
/******************************************************************************/
+
#ifndef WITH_NOHTTP
#ifndef PALM_1
SOAP_FMAC1
@@ -16586,14 +18457,28 @@ SOAP_FMAC2
soap_recv_empty_response(struct soap *soap)
{ if (!(soap->omode & SOAP_IO_UDP))
{ if (!soap_begin_recv(soap))
- {
+ { if (soap->body)
+ { if ((soap->status != 400 && soap->status != 500)
+ || soap_envelope_begin_in(soap)
+ || soap_recv_header(soap)
+ || soap_body_begin_in(soap))
+ {
#ifndef WITH_LEAN
- if (soap->body)
- soap_get_http_body(soap, NULL); /* read (empty?) HTTP body and discard */
+ const char *s = soap_get_http_body(soap, NULL);
+#endif
+ (void)soap_end_recv(soap);
+#ifndef WITH_LEAN
+ if (s)
+ soap_set_receiver_error(soap, "HTTP Error", s, soap->status);
#endif
- soap_end_recv(soap);
+ }
+ else
+ return soap_recv_fault(soap, 1);
+ }
+ else
+ (void)soap_end_recv(soap);
}
- else if (soap->error == SOAP_NO_DATA || soap->error == 202)
+ else if (soap->error == SOAP_NO_DATA || soap->error == 200 || soap->error == 202)
soap->error = SOAP_OK;
}
return soap_closesock(soap);
@@ -16602,17 +18487,18 @@ soap_recv_empty_response(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef WITH_NOIO
#ifndef PALM_1
static const char*
soap_strerror(struct soap *soap)
-{ register int err = soap->errnum;
+{ int err = soap->errnum;
*soap->msgbuf = '\0';
if (err)
{
#ifndef WIN32
# ifdef HAVE_STRERROR_R
-# ifdef _GNU_SOURCE
+# if defined(_GNU_SOURCE) && !defined(__ANDROID__)
return strerror_r(err, soap->msgbuf, sizeof(soap->msgbuf)); /* GNU-specific */
# else
strerror_r(err, soap->msgbuf, sizeof(soap->msgbuf)); /* XSI-compliant */
@@ -16639,12 +18525,13 @@ soap_strerror(struct soap *soap)
#endif
}
else
- { char *s = soap->msgbuf;
+ { int rt = soap->recv_timeout, st = soap->send_timeout;
#ifndef WITH_LEAN
- int rt = soap->recv_timeout, st = soap->send_timeout;
int ru = ' ', su = ' ';
#endif
- strcpy(s, "Operation interrupted or timed out");
+ soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), "message transfer interrupted");
+ if (rt || st)
+ soap_strcpy(soap->msgbuf + 28, sizeof(soap->msgbuf) - 28, " or timed out");
#ifndef WITH_LEAN
if (rt < 0)
{ rt = -rt;
@@ -16655,22 +18542,12 @@ soap_strerror(struct soap *soap)
su = 'u';
}
if (rt)
- {
-#ifdef HAVE_SNPRINTF
- size_t l = strlen(s);
- soap_snprintf(s + l, sizeof(soap->msgbuf) - l, " (%d%cs recv delay)", rt, ru);
-#else
- sprintf(s + strlen(s), " (%d%cs recv delay)", rt, ru);
-#endif
+ { size_t l = strlen(soap->msgbuf);
+ (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, 36), " (%d%cs recv delay)", rt, ru);
}
if (st)
- {
-#ifdef HAVE_SNPRINTF
- size_t l = strlen(s);
- soap_snprintf(s + l, sizeof(soap->msgbuf) - l, " (%d%cs send delay)", st, su);
-#else
- sprintf(s + strlen(s), " (%d%cs send delay)", st, su);
-#endif
+ { size_t l = strlen(soap->msgbuf);
+ (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, 36), " (%d%cs send delay)", st, su);
}
#endif
}
@@ -16680,6 +18557,7 @@ soap_strerror(struct soap *soap)
#endif
/******************************************************************************/
+
#ifndef PALM_2
static int
soap_set_error(struct soap *soap, const char *faultcode, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML, int soaperror)
@@ -16688,7 +18566,7 @@ soap_set_error(struct soap *soap, const char *faultcode, const char *faultsubcod
*soap_faultsubcode(soap) = faultsubcodeQName;
*soap_faultstring(soap) = faultstring;
if (faultdetailXML && *faultdetailXML)
- { register const char **s = soap_faultdetail(soap);
+ { const char **s = soap_faultdetail(soap);
if (s)
*s = faultdetailXML;
}
@@ -16697,26 +18575,29 @@ soap_set_error(struct soap *soap, const char *faultcode, const char *faultsubcod
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_set_sender_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
-{ return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client", NULL, faultstring, faultdetailXML, soaperror);
+{ return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Sender" : soap->version == 1 ? "SOAP-ENV:Client" : "at source", NULL, faultstring, faultdetailXML, soaperror);
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_set_receiver_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
-{ return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : "SOAP-ENV:Server", NULL, faultstring, faultdetailXML, soaperror);
+{ return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : soap->version == 1 ? "SOAP-ENV:Server" : "is internal", NULL, faultstring, faultdetailXML, soaperror);
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
static int
soap_copy_fault(struct soap *soap, const char *faultcode, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML)
@@ -16732,6 +18613,7 @@ soap_copy_fault(struct soap *soap, const char *faultcode, const char *faultsubco
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -16742,16 +18624,18 @@ soap_sender_fault(struct soap *soap, const char *faultstring, const char *faultd
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_sender_fault_subcode(struct soap *soap, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML)
-{ return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client", faultsubcodeQName, faultstring, faultdetailXML);
+{ return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Sender" : soap->version == 1 ? "SOAP-ENV:Client" : "at source", faultsubcodeQName, faultstring, faultdetailXML);
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
@@ -16762,16 +18646,18 @@ soap_receiver_fault(struct soap *soap, const char *faultstring, const char *faul
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
int
SOAP_FMAC2
soap_receiver_fault_subcode(struct soap *soap, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML)
-{ return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : "SOAP-ENV:Server", faultsubcodeQName, faultstring, faultdetailXML);
+{ return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : soap->version == 1 ? "SOAP-ENV:Server" : "is internal", faultsubcodeQName, faultstring, faultdetailXML);
}
#endif
/******************************************************************************/
+
#ifndef PALM_2
#ifndef WITH_NOSTDLIB
SOAP_FMAC1
@@ -16779,23 +18665,26 @@ void
SOAP_FMAC2
soap_print_fault(struct soap *soap, FILE *fd)
{ if (soap_check_state(soap))
- fprintf(fd, "Error: soap struct state not initialized\n");
+ fprintf(fd, "Error: soap struct state not initialized with soap_init\n");
else if (soap->error)
{ const char **c, *v = NULL, *s, *d;
c = soap_faultcode(soap);
if (!*c)
- soap_set_fault(soap);
+ { soap_set_fault(soap);
+ c = soap_faultcode(soap);
+ }
if (soap->version == 2)
v = soap_check_faultsubcode(soap);
s = *soap_faultstring(soap);
d = soap_check_faultdetail(soap);
- fprintf(fd, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v ? v : "no subcode", s ? s : "[no reason]", d ? d : "[no detail]");
+ fprintf(fd, "%s%d fault %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v ? v : "no subcode", s ? s : "[no reason]", d ? d : "[no detail]");
}
}
#endif
#endif
/******************************************************************************/
+
#ifdef __cplusplus
#ifndef WITH_LEAN
#ifndef WITH_NOSTDLIB
@@ -16805,19 +18694,21 @@ void
SOAP_FMAC2
soap_stream_fault(struct soap *soap, std::ostream& os)
{ if (soap_check_state(soap))
- os << "Error: soap struct state not initialized\n";
+ os << "Error: soap struct state not initialized with soap_init\n";
else if (soap->error)
{ const char **c, *v = NULL, *s, *d;
c = soap_faultcode(soap);
if (!*c)
- soap_set_fault(soap);
+ { soap_set_fault(soap);
+ c = soap_faultcode(soap);
+ }
if (soap->version == 2)
v = soap_check_faultsubcode(soap);
s = *soap_faultstring(soap);
d = soap_check_faultdetail(soap);
os << (soap->version ? "SOAP 1." : "Error ")
<< (soap->version ? (int)soap->version : soap->error)
- << " fault: " << *c
+ << " fault " << *c
<< "[" << (v ? v : "no subcode") << "]"
<< std::endl
<< "\"" << (s ? s : "[no reason]") << "\""
@@ -16832,6 +18723,7 @@ soap_stream_fault(struct soap *soap, std::ostream& os)
#endif
/******************************************************************************/
+
#ifndef WITH_LEAN
#ifndef WITH_NOSTDLIB
SOAP_FMAC1
@@ -16839,28 +18731,20 @@ char*
SOAP_FMAC2
soap_sprint_fault(struct soap *soap, char *buf, size_t len)
{ if (soap_check_state(soap))
- { strncpy(buf, "Error: soap struct not initialized", len);
- buf[len - 1] = '\0';
+ { soap_strcpy(buf, len, "Error: soap struct not initialized with soap_init");
}
else if (soap->error)
{ const char **c, *v = NULL, *s, *d;
c = soap_faultcode(soap);
if (!*c)
- soap_set_fault(soap);
+ { soap_set_fault(soap);
+ c = soap_faultcode(soap);
+ }
if (soap->version == 2)
- v = *soap_faultsubcode(soap);
+ v = soap_check_faultsubcode(soap);
s = *soap_faultstring(soap);
d = soap_check_faultdetail(soap);
-#ifdef HAVE_SNPRINTF
- soap_snprintf(buf, len, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v ? v : "no subcode", s ? s : "[no reason]", d ? d : "[no detail]");
-#else
- if (len > 40 + (v ? strlen(v) : 0) + (s ? strlen(s) : 0) + (d ? strlen(d) : 0))
- sprintf(buf, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v ? v : "no subcode", s ? s : "[no reason]", d ? d : "[no detail]");
- else if (len > 40)
- sprintf(buf, "%s%d fault: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c);
- else
- buf[0] = '\0';
-#endif
+ (SOAP_SNPRINTF(buf, len, strlen(*c) + strlen(v) + strlen(s) + strlen(d) + 72), "%s%d fault %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v ? v : "no subcode", s ? s : "[no reason]", d ? d : "[no detail]");
}
return buf;
}
@@ -16868,6 +18752,7 @@ soap_sprint_fault(struct soap *soap, char *buf, size_t len)
#endif
/******************************************************************************/
+
#ifndef PALM_1
#ifndef WITH_NOSTDLIB
SOAP_FMAC1
@@ -16877,7 +18762,7 @@ soap_print_fault_location(struct soap *soap, FILE *fd)
{
#ifndef WITH_LEAN
int i, j, c1, c2;
- if (soap->error && soap->error != SOAP_STOP && soap->bufidx <= soap->buflen && soap->buflen > 0 && soap->buflen <= SOAP_BUFLEN)
+ if (soap->error && soap->error != SOAP_STOP && soap->bufidx <= soap->buflen && soap->buflen > 0 && soap->buflen <= sizeof(soap->buf))
{ i = (int)soap->bufidx - 1;
if (i <= 0)
i = 0;
@@ -16895,20 +18780,25 @@ soap_print_fault_location(struct soap *soap, FILE *fd)
soap->buf[i] = (char)c1;
soap->buf[j] = (char)c2;
}
+#else
+ (void)soap;
+ (void)fd;
#endif
}
#endif
#endif
/******************************************************************************/
+
#ifndef PALM_1
SOAP_FMAC1
int
SOAP_FMAC2
soap_register_plugin_arg(struct soap *soap, int (*fcreate)(struct soap*, struct soap_plugin*, void*), void *arg)
-{ register struct soap_plugin *p;
- register int r;
- if (!(p = (struct soap_plugin*)SOAP_MALLOC(soap, sizeof(struct soap_plugin))))
+{ struct soap_plugin *p;
+ int r;
+ p = (struct soap_plugin*)SOAP_MALLOC(soap, sizeof(struct soap_plugin));
+ if (!p)
return soap->error = SOAP_EOM;
p->id = NULL;
p->data = NULL;
@@ -16928,10 +18818,11 @@ soap_register_plugin_arg(struct soap *soap, int (*fcreate)(struct soap*, struct
#endif
/******************************************************************************/
+
#ifndef PALM_1
static void *
fplugin(struct soap *soap, const char *id)
-{ register struct soap_plugin *p;
+{ struct soap_plugin *p;
for (p = soap->plugins; p; p = p->next)
if (p->id == id || !strcmp(p->id, id))
return p->data;
@@ -16940,6 +18831,7 @@ fplugin(struct soap *soap, const char *id)
#endif
/******************************************************************************/
+
#ifndef PALM_2
SOAP_FMAC1
void *
@@ -16950,23 +18842,29 @@ soap_lookup_plugin(struct soap *soap, const char *id)
#endif
/******************************************************************************/
+
#ifdef __cplusplus
}
#endif
/******************************************************************************\
*
- * C++ soap struct methods
+ * C++ soap struct methods
*
\******************************************************************************/
#ifdef __cplusplus
soap::soap()
{ soap_init(this);
+ /* no logs to prevent leaks when user calls soap_init() on this context */
+ soap_set_test_logfile(this, NULL);
+ soap_set_sent_logfile(this, NULL);
+ soap_set_recv_logfile(this, NULL);
}
#endif
/******************************************************************************/
+
#ifdef __cplusplus
soap::soap(soap_mode m)
{ soap_init1(this, m);
@@ -16974,6 +18872,7 @@ soap::soap(soap_mode m)
#endif
/******************************************************************************/
+
#ifdef __cplusplus
soap::soap(soap_mode im, soap_mode om)
{ soap_init2(this, im, om);
@@ -16981,6 +18880,7 @@ soap::soap(soap_mode im, soap_mode om)
#endif
/******************************************************************************/
+
#ifdef __cplusplus
soap::soap(const struct soap& soap)
{ soap_copy_context(this, &soap);
@@ -16988,11 +18888,19 @@ soap::soap(const struct soap& soap)
#endif
/******************************************************************************/
+
+#ifdef __cplusplus
+struct soap& soap::operator=(const struct soap& soap)
+{ soap_copy_context(this, &soap);
+ return *this;
+}
+#endif
+
+/******************************************************************************/
+
#ifdef __cplusplus
soap::~soap()
-{ soap_destroy(this);
- soap_end(this);
- soap_done(this);
+{ soap_done(this);
}
#endif
diff --git a/dep/gsoap/stdsoap2.h b/dep/gsoap/stdsoap2.h
index 31aece07f1a..7b1a0eb8b77 100644
--- a/dep/gsoap/stdsoap2.h
+++ b/dep/gsoap/stdsoap2.h
@@ -1,10 +1,10 @@
/*
- stdsoap2.h 2.8.17r
+ stdsoap2.h 2.8.33
- gSOAP runtime engine
+ gSOAP runtime engine
gSOAP XML Web services tools
-Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc., All Rights Reserved.
+Copyright (C) 2000-2016, Robert van Engelen, Genivia Inc., All Rights Reserved.
This part of the software is released under ONE of the following licenses:
GPL, or the gSOAP public license, or Genivia's license for commercial use.
--------------------------------------------------------------------------------
@@ -24,7 +24,7 @@ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the License.
The Initial Developer of the Original Code is Robert A. van Engelen.
-Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc., All Rights Reserved.
+Copyright (C) 2000-2016, Robert van Engelen, Genivia Inc., All Rights Reserved.
--------------------------------------------------------------------------------
GPL license.
@@ -51,10 +51,10 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
--------------------------------------------------------------------------------
*/
-#define GSOAP_VERSION 20817
+#define GSOAP_VERSION 20833
#ifdef WITH_SOAPDEFS_H
-# include "soapdefs.h" /* include user-defined stuff */
+# include "soapdefs.h" /* include user-defined stuff in soapdefs.h */
#endif
#ifndef _THREAD_SAFE
@@ -67,43 +67,63 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
#endif
-#ifndef SOAP_FMAC1 /* stdsoap2.h declaration macro */
+#ifdef WIN32
+# ifdef SOAP_STD_EXPORTS /* dllexport the API functions and classes */
+# ifndef SOAP_STD_API
+# define SOAP_STD_API __declspec(dllexport)
+# endif
+# ifndef SOAP_CMAC
+# define SOAP_CMAC SOAP_STD_API /* export soap struct and generated classes */
+# endif
+# ifndef SOAP_FMAC1
+# define SOAP_FMAC1 SOAP_STD_API /* export stdsoap2.cpp API */
+# endif
+# ifndef SOAP_FMAC3
+# define SOAP_FMAC3 SOAP_STD_API /* export soapC.cpp serializers API */
+# endif
+# ifndef SOAP_FMAC5
+# define SOAP_FMAC5 SOAP_STD_API /* export soapClient.cpp and soapServer.cpp API */
+# endif
+# endif
+#endif
+
+#ifndef SOAP_FMAC1 /* stdsoap2.h declaration macro */
# define SOAP_FMAC1
#endif
-#ifndef SOAP_FMAC2 /* stdsoap2.h declaration macro */
+#ifndef SOAP_FMAC2 /* stdsoap2.h declaration macro */
# define SOAP_FMAC2
#endif
-#ifndef SOAP_FMAC3 /* (de)serializer declaration macro */
+#ifndef SOAP_FMAC3 /* (de)serializer declaration macro */
# define SOAP_FMAC3
#endif
-#ifndef SOAP_FMAC3S /* string converter for (de)serializer declaration macro */
+#ifndef SOAP_FMAC3S /* string converter for (de)serializer declaration macro */
# define SOAP_FMAC3S SOAP_FMAC3
#endif
-#ifndef SOAP_FMAC4 /* (de)serializer declaration macro */
+#ifndef SOAP_FMAC4 /* (de)serializer declaration macro */
# define SOAP_FMAC4
#endif
-#ifndef SOAP_FMAC4S /* string converter for (de)serializer declaration macro */
+#ifndef SOAP_FMAC4S /* string converter for (de)serializer declaration macro */
# define SOAP_FMAC4S SOAP_FMAC4
#endif
-#ifndef SOAP_FMAC5 /* stub/skeleton declaration macro */
+#ifndef SOAP_FMAC5 /* stub/skeleton declaration macro */
# define SOAP_FMAC5
#endif
-#ifndef SOAP_FMAC6 /* stub/skeleton declaration macro */
+#ifndef SOAP_FMAC6 /* stub/skeleton declaration macro */
# define SOAP_FMAC6
#endif
-#ifndef SOAP_CMAC /* class declaration macro */
+#ifndef SOAP_CMAC /* class declaration macro */
# define SOAP_CMAC
#endif
-#ifndef SOAP_NMAC /* namespace table declaration macro */
+#ifndef SOAP_NMAC /* namespace table declaration macro */
# define SOAP_NMAC
#endif
@@ -111,14 +131,16 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define SOAP_SOURCE_STAMP(str)
#endif
-/* gSOAP 2.7.4 and higher: fast look-aside buffering is stable */
-#ifndef WITH_FAST
-# define WITH_FAST
-#endif
-
#ifndef STDSOAP_H
#define STDSOAP_H
+#define SOAP_XSTRINGIFY(s) SOAP_STRINGIFY(s)
+#define SOAP_STRINGIFY(s) #s
+
+#ifdef SOAPDEFS_H
+# include SOAP_XSTRINGIFY(SOAPDEFS_H) /* include user-defined "SOAPDEFS_H" */
+#endif
+
#if defined(__vxworks) || defined(__VXWORKS__)
# ifndef VXWORKS
# define VXWORKS
@@ -131,7 +153,7 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
#endif
-/* for legacy purposes we use WIN32 macro even though 64 bit is supported */
+/* for legacy purposes we use WIN32 macro, even when WIN64 is supported */
#ifdef _WIN64
# ifndef WIN32
# define WIN32
@@ -193,6 +215,12 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
#endif
+#if defined(__sun) && defined(__SVR4)
+# ifndef SUN_OS
+# define SUN_OS
+# endif
+#endif
+
#ifdef HAVE_CONFIG_H
# include "config.h"
# if defined(WITH_OPENSSL)
@@ -213,7 +241,13 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
#else
# if defined(UNDER_CE)
-# define WITH_LEAN
+# define SOAP_BUFLEN (2048)
+# define SOAP_PTRHASH (32)
+# define SOAP_IDHASH (19)
+# define SOAP_BLKLEN (32)
+# define SOAP_TAGLEN (128)
+# define SOAP_HDRLEN (1024)
+# define SOAP_MAXDIMS (4)
# define HAVE_SSCANF
# elif defined(WIN32)
# if _MSC_VER >= 1400
@@ -227,8 +261,8 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define HAVE_STRTOL
# define HAVE_STRTOUL
# if _MSC_VER >= 1300
-# define HAVE_STRTOLL /* use _strtoi64 */
-# define HAVE_STRTOULL /* use _strtoui64 */
+# define HAVE_STRTOLL /* use _strtoi64 */
+# define HAVE_STRTOULL /* use _strtoui64 */
# endif
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
@@ -256,6 +290,7 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# elif defined(__APPLE__)
# define HAVE_POLL
# define HAVE_SNPRINTF
+# define HAVE_STRLCPY
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
@@ -264,6 +299,8 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define HAVE_SPRINTF_L
# define HAVE_STRTOL
# define HAVE_STRTOUL
+# define HAVE_STRTOLL
+# define HAVE_STRTOULL
# define HAVE_RAND_R
# define HAVE_GMTIME_R
# define HAVE_TM_GMTOFF
@@ -299,12 +336,19 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define HAVE_WCTOMB
# define HAVE_MBTOWC
# elif defined(HP_UX)
+# include <sys/_inttypes.h>
+extern intmax_t __strtoll(const char*, char**, int);
+extern intmax_t __strtoull(const char*, char**, int);
+# define strtoll __strtoll
+# define strtoull __strtoull
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
+# define HAVE_STRTOLL
+# define HAVE_STRTOULL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
@@ -316,6 +360,7 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# elif defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD)
# define HAVE_POLL
# define HAVE_SNPRINTF
+# define HAVE_STRLCPY
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
@@ -415,7 +460,7 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# elif defined(PALM)
# define WITH_LEAN
# define HAVE_STRTOD /* strtod() is defined in palmFunctions.h */
-# include <stdlib.h> /* Needs to be included before unix headers */
+# include <stdlib.h> /* Needs to be included before unix headers */
# include <sys_types.h>
# define IGNORE_STDIO_STUBS
# include <StdIOPalm.h>
@@ -425,7 +470,7 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# elif defined(SYMBIAN)
# define WITH_LEAN
# define WITH_NONAMESPACES
-# define HAVE_STRTOD /* use STRTOD since sscanf doesn't seem to work */
+# define HAVE_STRTOD /* use STRTOD since sscanf doesn't seem to work */
# include <e32def.h>
# include <sys/ioctl.h>
# elif defined(VXWORKS)
@@ -478,6 +523,8 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
+# define HAVE_STRTOLL
+# define HAVE_STRTOULL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
@@ -500,14 +547,15 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define HAVE_GETHOSTBYNAME_R
# define HAVE_GMTIME_R
# define HAVE_LOCALTIME_R
-# else
-/* Default assumptions for supported functions */
+# else /* Default assumptions for supported library functions when not including config.h */
# define HAVE_SNPRINTF
# define HAVE_STRRCHR
# define HAVE_STRTOD
# define HAVE_SSCANF
# define HAVE_STRTOL
# define HAVE_STRTOUL
+# define HAVE_STRTOLL
+# define HAVE_STRTOULL
# define HAVE_SYS_TIMEB_H
# define HAVE_FTIME
# define HAVE_RAND_R
@@ -522,8 +570,17 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
#endif
-/* gSOAP 2.7.15 and higher: always retain CDATA in literal XML, unless WITH_LEAN or WITH_NOCDATA */
+#ifdef WITH_LEANER
+# ifndef WITH_LEAN
+# define WITH_LEAN
+# endif
+#endif
+
+/* gSOAP 2.7.15 and higher: always use FAST and retain CDATA in literal XML, unless WITH_LEAN or WITH_NOCDATA */
#ifndef WITH_LEAN
+# ifndef WITH_FAST
+# define WITH_FAST
+# endif
# ifndef WITH_NOCDATA
# ifndef WITH_CDATA
# define WITH_CDATA
@@ -531,34 +588,28 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
#endif
-#ifdef WITH_LEANER
-# ifndef WITH_LEAN
-# define WITH_LEAN
-# endif
-#endif
-
#ifdef WITH_LEAN
# ifdef WITH_COOKIES
# error "Cannot build WITH_LEAN code WITH_COOKIES enabled"
# endif
#endif
-/* native Win, HP-UX, and AIX compilers don't like empty structs */
-#if defined(WIN32) || defined(HP_UX) || defined(_AIX) || defined(AIX) || defined(VXWORKS)
+/* allowing empty struct/union in C is a GNU extension */
+#if !defined(__GNU__)
# define WITH_NOEMPTYSTRUCT
#endif
+/* silence clang's C99 variadic macro warnings */
+#ifdef __clang__
+# pragma clang diagnostic ignored "-Wvariadic-macros"
+#endif
+
#ifdef WITH_PURE_VIRTUAL
# define SOAP_PURE_VIRTUAL = 0
#else
# define SOAP_PURE_VIRTUAL
#endif
-#ifdef HP_UX
-# undef HAVE_STRTOLL
-# undef HAVE_STRTOULL
-#endif
-
/* older OpenVMS TCP/IP stacks cannot handle 65536 bytes */
#ifdef __VMS
# ifndef SOAP_BUFLEN
@@ -566,12 +617,14 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
#endif
-/* if we have xlocale.h we use it to avoid decimal point conversion issues */
+/* if we have xlocale.h then we can use it WITH_C_LOCALE enabled to avoid decimal point conversion issues */
#ifdef WITH_C_LOCALE
# ifdef WIN32
# include <locale.h>
+# define SOAP_LOCALE(soap) ((soap)->c_locale ? (soap)->c_locale : ((soap)->c_locale = _create_locale(LC_ALL, "C")))
# else
# include <xlocale.h>
+# define SOAP_LOCALE(soap) ((soap)->c_locale ? (soap)->c_locale : ((soap)->c_locale = newlocale(LC_ALL_MASK, "C", NULL)))
# endif
#else
# undef HAVE_STRTOF_L
@@ -589,7 +642,6 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# define LONG64 long long
# define ULONG64 long long
# define DBL_PINFTY (1.1579208923716189e77)
-# define WITH_NOEMPTYSTRUCT
# undef HAVE_WCTOMB
# undef HAVE_MBTOWC
# undef HAVE_GMTIME_R
@@ -622,8 +674,20 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# include <stdio.h>
# include <string.h>
# endif
-# include <ctype.h>
-# include <limits.h>
+# if !defined(HAVE_CONFIG_H) || defined(HAVE_CTYPE_H)
+# include <ctype.h>
+# endif
+# if !defined(HAVE_CONFIG_H) || defined(HAVE_LIMITS_H)
+# include <limits.h> /* for MB_LEN_MAX */
+# endif
+# if !defined(HAVE_CONFIG_H) || defined(HAVE_FLOAT_H)
+# include <float.h> /* for INFINITY */
+# endif
+# if !defined(HAVE_CONFIG_H) || defined(HAVE_MATH_H)
+# ifndef PALM
+# include <math.h> /* for isnan() and isinf() */
+# endif
+# endif
#endif
#ifdef WITH_NTLM
@@ -634,9 +698,13 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# include <poll.h>
#endif
-#if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
-# include <string>
-# include <iostream>
+#if defined(__cplusplus)
+# include <new>
+# include <memory>
+# if !defined(WITH_COMPAT)
+# include <string>
+# include <iostream>
+# endif
#endif
#ifdef WITH_NOHTTP
@@ -659,7 +727,7 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
# ifndef WITH_LEAN
# ifdef HAVE_SYS_TIMEB_H
-# include <sys/timeb.h> /* for ftime() */
+# include <sys/timeb.h> /* for ftime() */
# endif
# include <time.h>
# endif
@@ -689,8 +757,8 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
# endif
# ifdef SUN_OS
-# include <sys/stream.h> /* SUN */
-# include <sys/socketvar.h> /* SUN < 2.8 (?) */
+# include <sys/stream.h> /* SUN */
+# include <sys/socketvar.h> /* only needed with SUN < 2.8 ? */
# endif
# ifdef VXWORKS
# ifdef _WRS_KERNEL
@@ -703,7 +771,7 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# ifdef OS390
# include <netinet/tcp_var.h>
# else
-# include <netinet/tcp.h> /* TCP_NODELAY */
+# include <netinet/tcp.h> /* TCP_NODELAY, TCP_FASTOPEN */
# endif
# include <arpa/inet.h>
# endif
@@ -798,6 +866,10 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
# endif
#endif
+#ifdef WITH_SYSTEMSSL
+# include <gskssl.h>
+#endif
+
#ifdef WITH_GZIP
# ifndef WITH_ZLIB
# define WITH_ZLIB
@@ -805,21 +877,15 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
#endif
#ifdef WITH_CASEINSENSITIVETAGS
-# define SOAP_STRCMP soap_tag_cmp /* case insensitve XML element/attribute names */
+# define SOAP_STRCMP soap_tag_cmp /* case insensitve XML element/attribute names */
#else
-# define SOAP_STRCMP strcmp /* case sensitive XML element/attribute names */
+# define SOAP_STRCMP strcmp /* case sensitive XML element/attribute names */
#endif
#ifdef WITH_ZLIB
# include <zlib.h>
#endif
-#ifndef WITH_NOSTDLIB
-# ifndef PALM
-# include <math.h> /* for isnan() */
-# endif
-#endif
-
/* #define DEBUG */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and internal operations (in file TEST.log) */
/* #define DEBUG_STAMP */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and time-stamped operations (in file TEST.log) */
@@ -828,7 +894,7 @@ A commercial use license is available from Genivia, Inc., contact@genivia.com
extern "C" {
#endif
-/* Portability: define SOAP_SOCKLEN_T */
+/* Portability (X/Open, BSD sockets etc): define SOAP_SOCKLEN_T as socklen_t or int or ... */
#if defined(_AIX) || defined(AIX)
# if defined(_AIX43)
# define SOAP_SOCKLEN_T socklen_t
@@ -837,14 +903,21 @@ extern "C" {
# endif
#elif defined(SOCKLEN_T)
# define SOAP_SOCKLEN_T SOCKLEN_T
-#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN) || defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD) || defined(__QNX__) || defined(QNX) || defined(OS390) || defined(__ANDROID__)
+#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN) || defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD) || defined(__QNX__) || defined(QNX) || defined(OS390) || defined(__ANDROID__) || defined(_XOPEN_SOURCE)
# define SOAP_SOCKLEN_T socklen_t
#elif defined(IRIX) || defined(WIN32) || defined(__APPLE__) || defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS) || defined(HP_UX)
# define SOAP_SOCKLEN_T int
-#else
+#elif !defined(SOAP_SOCKLEN_T)
# define SOAP_SOCKLEN_T size_t
#endif
+/* AIX DCE threads portability: define SOAP_FUNC_R_ERR gmtime_r and localtime_r err ret val as -1 */
+#ifdef _AIX32_THREADS
+# define SOAP_FUNC_R_ERR (-1)
+#elif !defined(SOAP_FUNC_R_ERR)
+# define SOAP_FUNC_R_ERR (NULL)
+#endif
+
#ifndef SOAP_SOCKET
# ifdef WIN32
# define SOAP_SOCKET SOCKET
@@ -858,8 +931,8 @@ extern "C" {
#define SOAP_INVALID_SOCKET ((SOAP_SOCKET)-1)
#define soap_valid_socket(n) ((n) != SOAP_INVALID_SOCKET)
-#define SOAP_SHUT_WR 1
-#define SOAP_SHUT_RDWR 2
+#define SOAP_SHUT_WR (1)
+#define SOAP_SHUT_RDWR (2)
#ifndef SOAP_GAI_STRERROR
# define SOAP_GAI_STRERROR gai_strerror
@@ -884,6 +957,17 @@ extern "C" {
#if defined(SYMBIAN)
# define LONG64 long
# define ULONG64 unsigned LONG64
+#elif !defined(__cplusplus) && defined(__STDC__) && !defined(__STDC_VERSION__) /* C90? */
+# define LONG64 long
+# define ULONG64 unsigned LONG64
+# ifndef SOAP_LONG_FORMAT
+# define SOAP_LONG_FORMAT "%ld"
+# endif
+# ifndef SOAP_ULONG_FORMAT
+# define SOAP_ULONG_FORMAT "%lu"
+# endif
+# define soap_strtoll soap_strtol
+# define soap_strtoull soap_strtoul
#elif !defined(WIN32) || defined(CYGWIN) || defined(__GLIBC__) || defined(__GNU__)
# ifndef LONG64
# if defined(HAVE_INTTYPES_H)
@@ -942,11 +1026,11 @@ extern "C" {
#endif
#ifndef SOAP_LONG_FORMAT
-# define SOAP_LONG_FORMAT "%lld" /* printf format for 64 bit ints */
+# define SOAP_LONG_FORMAT "%lld" /* printf format for 64 bit ints */
#endif
#ifndef SOAP_ULONG_FORMAT
-# define SOAP_ULONG_FORMAT "%llu" /* printf format for unsigned 64 bit ints */
+# define SOAP_ULONG_FORMAT "%llu" /* printf format for unsigned 64 bit ints */
#endif
#if defined(WIN32) && !defined(CYGWIN)
@@ -972,11 +1056,17 @@ extern "C" {
# define SOAP_EWOULDBLOCK WSAEWOULDBLOCK
# define SOAP_EINPROGRESS WSAEINPROGRESS
# define SOAP_EADDRINUSE WSAEADDRINUSE
+# define SOAP_ECONNREFUSED WSAECONNREFUSED
#else
-# define SOAP_ERANGE ERANGE
+# ifdef ERANGE
+# define SOAP_ERANGE ERANGE
+# else
+# define SOAP_ERANGE (34)
+# endif
# define SOAP_EINTR EINTR
# define SOAP_EAGAIN EAGAIN
# define SOAP_EADDRINUSE EADDRINUSE
+# define SOAP_ECONNREFUSED ECONNREFUSED
# ifdef SYMBIAN
# define SOAP_EWOULDBLOCK 9898
# define SOAP_EINPROGRESS 9899
@@ -1056,45 +1146,109 @@ extern "C" {
# define SOAP_HDRLEN (1024)
# endif
#endif
+#ifndef SOAP_TMPLEN
+# ifndef WITH_LEAN
+# define SOAP_TMPLEN (1024) /* maximum length of msgbuf and tmpbuf short message buffers, must be >=1024 */
+# else
+# define SOAP_TMPLEN (1024)
+# endif
+#endif
#ifndef SOAP_MAXDIMS
# ifndef WITH_LEAN
-# define SOAP_MAXDIMS (16) /* maximum array dimensions (array nestings) must be less than 64 to protect soap->tmpbuf */
+# define SOAP_MAXDIMS (16) /* maximum array dimensions (array nestings) must be less than 64 to protect soap->tmpbuf */
# else
-# define SOAP_MAXDIMS (4)
+# define SOAP_MAXDIMS (4)
+# endif
+#endif
+#ifndef SOAP_MAXPTRS
+# ifndef WITH_LEAN
+# define SOAP_MAXPTRS (4) /* maximum depth + 1 of id-ref deserialized pointer types (int* has depth 0, int*** has depth 2) */
+# else
+# define SOAP_MAXPTRS (2)
# endif
#endif
#ifndef SOAP_MAXLOGS
-# define SOAP_MAXLOGS (3) /* max number of debug logs per struct soap environment */
+# define SOAP_MAXLOGS (3) /* max number of debug logs per struct soap environment */
# define SOAP_INDEX_RECV (0)
# define SOAP_INDEX_SENT (1)
# define SOAP_INDEX_TEST (2)
#endif
+/* Tag name of multiref elements in SOAP 1.1 encoding */
+#ifndef SOAP_MULTIREFTAG
+# define SOAP_MULTIREFTAG "id"
+#endif
+
+/* href-id value base name in multiref SOAP encoding */
+#ifndef SOAP_BASEREFNAME
+# define SOAP_BASEREFNAME "_"
+#endif
+
/* Max number of EINTR while poll/select on a socket */
/* Each EINTR can lengthen the I/O blocking time by at most one second */
#ifndef SOAP_MAXEINTR
# define SOAP_MAXEINTR (10)
#endif
-/* Max iterations in soap_serve() to keep server connection alive */
+/* SOAP_MAXKEEPALIVE: Max iterations in soap_serve() to keep server connection alive */
#ifndef SOAP_MAXKEEPALIVE
# define SOAP_MAXKEEPALIVE (100)
#endif
-/* Trusted max size of inbound SOAP array for compound array allocation.
- Increase if necessary to allow larger arrays.
+/* SOAP_MAXARRAYSIZE: Trusted total max size of an inbound SOAP Array.
+ Arrays of larger size are not pre-allocated, but deserialized
+ on an element-by-element basis until XML validation contrains kick in.
+ This macro only affects the efficiency of parsing SOAP arrays.
*/
#ifndef SOAP_MAXARRAYSIZE
-# define SOAP_MAXARRAYSIZE (1000000)
+# define SOAP_MAXARRAYSIZE (100000)
#endif
-/* Trusted max size of inbound DIME data.
+/* SOAP_MAXDIMESIZE: Trusted max size of inbound DIME data.
Increase if necessary to allow larger attachments, or decrease when server
resources are limited.
*/
#ifndef SOAP_MAXDIMESIZE
-# define SOAP_MAXDIMESIZE (8388608) /* 8 MB */
+# define SOAP_MAXDIMESIZE (8*1048576) /* 8 MB */
+#endif
+
+/* SOAP_MAXINFLATESIZE: Trusted inflated content size.
+ Larger content is subject to the SOAP_MINDEFLATERATIO constraint.
+ If SOAP_MINDEFLATERATIO is 1.0, SOAP_MAXINFLATESIZE is always the max
+ size of uncompressed content.
+*/
+#ifndef SOAP_MAXINFLATESIZE
+# define SOAP_MAXINFLATESIZE (1*1048576) /* 1 MB */
+#endif
+
+/* SOAP_MINDEFLATERATIO: Trusted deflation ratio after SOAP_MAXINFLATESIZE is reached.
+ Trust when compressed / deflated > SOAP_MINDEFLATERATIO
+ Sets a ratio > 0.00096899224806 (1032:1)
+ According to the zlib site: the limit (1032:1) comes from the fact that one
+ length/distance pair can represent at most 258 output bytes. A length
+ requires at least one bit and a distance requires at least one bit, so two
+ bits in can give 258 bytes out, or eight bits in give 1032 bytes out. A
+ dynamic block has no length restriction, so you could get arbitrarily close
+ to the limit of 1032:1.
+*/
+#ifndef SOAP_MINDEFLATERATIO
+# define SOAP_MINDEFLATERATIO (1.0/1032.0) /* ratio of deflated/inflated */
+#endif
+
+/* maximum XML nesting depth level allowed for inbound XML parsing, must be greater than zero (0) */
+#ifndef SOAP_MAXLEVEL
+# define SOAP_MAXLEVEL (10000)
+#endif
+
+/* maximum string content length if not already constrained by XML schema validation maxLength constraints, zero or negative means unlimited string lengths are allowed unless restricted by XML schema maxLength */
+#ifndef SOAP_MAXLENGTH
+# define SOAP_MAXLENGTH (0)
+#endif
+
+/* maximum number of array or container elements, must be greater than zero (0) */
+#ifndef SOAP_MAXOCCURS
+# define SOAP_MAXOCCURS (100000)
#endif
#ifdef VXWORKS
@@ -1116,7 +1270,6 @@ extern "C" {
#endif
#ifdef WIN32
-# include <float.h>
# ifndef HAVE_ISNAN
# define HAVE_ISNAN
# endif
@@ -1168,7 +1321,9 @@ extern const char soap_base64o[], soap_base64i[];
#endif
#ifndef FLT_PINFTY
-# if defined(FLT_MAX)
+# if defined(INFINITY)
+# define FLT_PINFTY INFINITY
+# elif defined(FLT_MAX)
# define FLT_PINFTY FLT_MAX
# elif defined(HUGE_VALF)
# define FLT_PINFTY (float)HUGE_VALF
@@ -1190,7 +1345,9 @@ extern const char soap_base64o[], soap_base64i[];
#endif
#ifndef DBL_PINFTY
-# if defined(DBL_MAX)
+# if defined(INFINITY)
+# define DBL_PINFTY INFINITY
+# elif defined(DBL_MAX)
# define DBL_PINFTY DBL_MAX
# elif defined(HUGE_VALF)
# define DBL_PINFTY (double)HUGE_VALF
@@ -1228,75 +1385,132 @@ extern const char soap_base64o[], soap_base64i[];
#define soap_isninfd(n) ((n) < 0 && soap_isinf(n))
#define soap_isninff(n) ((n) < 0 && soap_isinf(n))
-#ifdef HAVE_SNPRINTF
-# ifdef WIN32
-# define soap_snprintf(buf, len, ...) (_snprintf((buf), (len), __VA_ARGS__), (buf)[(len)-1] = '\0')
+/* Safer str & mem functions */
+
+/* The gSOAP code uses guards to ensure that these functions are well behaved
+ and do not raise errors. Therefore, the WIN _s functions should never
+ execute the "invalid parameter handler".
+*/
+
+/* use safer snprintf if possible or guard sprintf against overrun (assumes no variadic macros) */
+# ifdef HAVE_SNPRINTF
+# if _MSC_VER >= 1400
+# define SOAP_SNPRINTF(buf, len, num) void)_snprintf_s((buf), (len), _TRUNCATE
+# define SOAP_SNPRINTF_SAFE(buf, len) void)_snprintf_s((buf), (len), _TRUNCATE
+# else
+# define SOAP_SNPRINTF(buf, len, num) void)snprintf((buf), (len)
+# define SOAP_SNPRINTF_SAFE(buf, len) void)snprintf((buf), (len)
+# endif
# else
-# define soap_snprintf snprintf
+# define SOAP_SNPRINTF(buf, len, num) (len) <= (num)) ? (void)((buf)[0] = '\0') : (void)sprintf((buf)
+# define SOAP_SNPRINTF_SAFE(buf, len) void)sprintf((buf)
# endif
+
+/* copy string (truncating the result) */
+#if _MSC_VER >= 1400
+# define soap_strcpy(buf, len, src) (void)strncpy_s((buf), (len), (src), _TRUNCATE)
+#elif defined(HAVE_STRLCPY)
+# define soap_strcpy(buf, len, src) (void)strlcpy((buf), (src), (len))
+#else
+# define soap_strcpy(buf, len, src) (void)((buf) == NULL || (len) <= 0 || (strncpy((buf), (src), (len) - 1), (buf)[(len) - 1] = '\0') || 1)
+#endif
+
+/* copy string up to n chars (nul on overrun) */
+#if _MSC_VER >= 1400
+# define soap_strncpy(buf, len, src, num) (void)strncpy_s((buf), (len), (src), (num))
+#else
+# define soap_strncpy(buf, len, src, num) (void)((buf) == NULL || ((size_t)(len) > (size_t)(num) ? (strncpy((buf), (src), (num)), (buf)[(size_t)(num)] = '\0') : ((buf)[0] = '\0')) || 1)
+#endif
+
+/* concat string up to n chars (nul on overrun) */
+#if _MSC_VER >= 1400
+# define soap_strncat(buf, len, src, num) (void)strncat_s((buf), (len), (src), (num))
+#else
+# define soap_strncat(buf, len, src, num) (void)((buf) == NULL || ((size_t)(len) > strlen((buf)) + (size_t)(num) ? (strncat((buf), (src), (num)), (buf)[(size_t)(len) - 1] = '\0') : ((buf)[0] = '\0')) || 1)
+#endif
+
+/* copy memory (error on overrun) */
+#if _MSC_VER >= 1400
+# define soap_memcpy(buf, len, src, num) ((buf) && (size_t)(len) >= (size_t)(num) ? memcpy_s((buf), (len), (src), (num)) : SOAP_ERANGE)
+#else
+# define soap_memcpy(buf, len, src, num) ((buf) && (size_t)(len) >= (size_t)(num) ? !memcpy((buf), (src), (num)) : SOAP_ERANGE)
+#endif
+
+/* move memory (error on overrun) */
+#if _MSC_VER >= 1400
+# define soap_memmove(buf, len, src, num) ((buf) && (size_t)(len) >= (size_t)(num) ? memmove_s((buf), (len), (src), (num)) : SOAP_ERANGE)
+#else
+# define soap_memmove(buf, len, src, num) ((buf) && (size_t)(len) >= (size_t)(num) ? !memmove((buf), (src), (num)) : SOAP_ERANGE)
#endif
/* gSOAP status/error codes */
typedef soap_int32 soap_status;
-#define SOAP_EOF EOF
-#define SOAP_ERR EOF
-#define SOAP_OK 0
-#define SOAP_CLI_FAULT 1
-#define SOAP_SVR_FAULT 2
-#define SOAP_TAG_MISMATCH 3
-#define SOAP_TYPE 4
-#define SOAP_SYNTAX_ERROR 5
-#define SOAP_NO_TAG 6
-#define SOAP_IOB 7
-#define SOAP_MUSTUNDERSTAND 8
-#define SOAP_NAMESPACE 9
-#define SOAP_USER_ERROR 10
-#define SOAP_FATAL_ERROR 11
-#define SOAP_FAULT 12
-#define SOAP_NO_METHOD 13
-#define SOAP_NO_DATA 14
-#define SOAP_GET_METHOD 15
-#define SOAP_PUT_METHOD 16
-#define SOAP_DEL_METHOD 17 /* deprecated */
-#define SOAP_HEAD_METHOD 18 /* deprecated */
-#define SOAP_HTTP_METHOD 19
-#define SOAP_EOM 20
-#define SOAP_MOE 21
-#define SOAP_HDR 22
-#define SOAP_NULL 23
-#define SOAP_DUPLICATE_ID 24
-#define SOAP_MISSING_ID 25
-#define SOAP_HREF 26
-#define SOAP_UDP_ERROR 27
-#define SOAP_TCP_ERROR 28
-#define SOAP_HTTP_ERROR 29
-#define SOAP_SSL_ERROR 30
-#define SOAP_ZLIB_ERROR 31
-#define SOAP_DIME_ERROR 32
-#define SOAP_DIME_HREF 33
-#define SOAP_DIME_MISMATCH 34
-#define SOAP_DIME_END 35
-#define SOAP_MIME_ERROR 36
-#define SOAP_MIME_HREF 37
-#define SOAP_MIME_END 38
-#define SOAP_VERSIONMISMATCH 39
-#define SOAP_PLUGIN_ERROR 40
-#define SOAP_DATAENCODINGUNKNOWN 41
-#define SOAP_REQUIRED 42
-#define SOAP_PROHIBITED 43
-#define SOAP_OCCURS 44
-#define SOAP_LENGTH 45
-#define SOAP_FD_EXCEEDED 46
-#define SOAP_UTF_ERROR 47
-#define SOAP_NTLM_ERROR 48
-
-#define soap_xml_error_check(e) ((e) == SOAP_TAG_MISMATCH || (e) == SOAP_NO_TAG || (e) == SOAP_SYNTAX_ERROR || (e) == SOAP_NAMESPACE || (e) == SOAP_DUPLICATE_ID || (e) == SOAP_MISSING_ID || (e) == SOAP_REQUIRED || (e) == SOAP_PROHIBITED || (e) == SOAP_OCCURS || (e) == SOAP_LENGTH || (e) == SOAP_NULL || (e) == SOAP_HREF)
+#define SOAP_EOF EOF
+#define SOAP_ERR EOF
+#define SOAP_OK 0
+#define SOAP_CLI_FAULT 1
+#define SOAP_SVR_FAULT 2
+#define SOAP_TAG_MISMATCH 3
+#define SOAP_TYPE 4
+#define SOAP_SYNTAX_ERROR 5
+#define SOAP_NO_TAG 6
+#define SOAP_IOB 7
+#define SOAP_MUSTUNDERSTAND 8
+#define SOAP_NAMESPACE 9
+#define SOAP_USER_ERROR 10
+#define SOAP_FATAL_ERROR 11
+#define SOAP_FAULT 12
+#define SOAP_NO_METHOD 13
+#define SOAP_NO_DATA 14
+#define SOAP_GET_METHOD 15
+#define SOAP_PUT_METHOD 16
+#define SOAP_DEL_METHOD 17 /* deprecated */
+#define SOAP_HEAD_METHOD 18 /* deprecated */
+#define SOAP_HTTP_METHOD 19
+#define SOAP_EOM 20
+#define SOAP_MOE 21
+#define SOAP_HDR 22
+#define SOAP_NULL 23
+#define SOAP_DUPLICATE_ID 24
+#define SOAP_MISSING_ID 25
+#define SOAP_HREF 26
+#define SOAP_UDP_ERROR 27
+#define SOAP_TCP_ERROR 28
+#define SOAP_HTTP_ERROR 29
+#define SOAP_SSL_ERROR 30
+#define SOAP_ZLIB_ERROR 31
+#define SOAP_DIME_ERROR 32
+#define SOAP_DIME_HREF 33
+#define SOAP_DIME_MISMATCH 34
+#define SOAP_DIME_END 35
+#define SOAP_MIME_ERROR 36
+#define SOAP_MIME_HREF 37
+#define SOAP_MIME_END 38
+#define SOAP_VERSIONMISMATCH 39
+#define SOAP_PLUGIN_ERROR 40
+#define SOAP_DATAENCODINGUNKNOWN 41
+#define SOAP_REQUIRED 42
+#define SOAP_PROHIBITED 43
+#define SOAP_OCCURS 44
+#define SOAP_LENGTH 45
+#define SOAP_PATTERN 46
+#define SOAP_FD_EXCEEDED 47
+#define SOAP_UTF_ERROR 48
+#define SOAP_NTLM_ERROR 49
+#define SOAP_LEVEL 50
+
+#define soap_xml_error_check(e) ((e) == SOAP_TAG_MISMATCH || (e) == SOAP_NO_TAG || (e) == SOAP_SYNTAX_ERROR || (e) == SOAP_NAMESPACE || (e) == SOAP_TYPE || (e) == SOAP_DUPLICATE_ID || (e) == SOAP_MISSING_ID || (e) == SOAP_REQUIRED || (e) == SOAP_PROHIBITED || (e) == SOAP_OCCURS || (e) == SOAP_LENGTH || (e) == SOAP_LEVEL || (e) == SOAP_PATTERN || (e) == SOAP_NULL || (e) == SOAP_HREF)
+
#define soap_soap_error_check(e) ((e) == SOAP_CLI_FAULT || (e) == SOAP_SVR_FAULT || (e) == SOAP_VERSIONMISMATCH || (e) == SOAP_MUSTUNDERSTAND || (e) == SOAP_FAULT || (e) == SOAP_NO_METHOD)
+
#define soap_tcp_error_check(e) ((e) == SOAP_EOF || (e) == SOAP_TCP_ERROR)
+
#define soap_ssl_error_check(e) ((e) == SOAP_SSL_ERROR)
+
#define soap_zlib_error_check(e) ((e) == SOAP_ZLIB_ERROR)
+
#define soap_http_error_check(e) ((e) == SOAP_HTTP_ERROR || (e) == SOAP_NO_DATA || ((e) >= SOAP_GET_METHOD && (e) <= SOAP_HTTP_METHOD) || ((e) >= 100 && (e) < 600))
/* gSOAP HTTP response status codes 100 to 599 are reserved */
@@ -1305,132 +1519,137 @@ typedef soap_int32 soap_status;
/* Exceptional gSOAP HTTP server response status codes >= 1000 */
-#define SOAP_STOP 1000 /* No HTTP response */
-#define SOAP_FORM 1001 /* Request (form) data is present, no HTTP response */
-#define SOAP_HTML 1002 /* Custom HTML response */
-#define SOAP_FILE 1003 /* Custom file-based response */
+#define SOAP_STOP 1000 /* No HTTP response */
+#define SOAP_FORM 1001 /* Request (form) data is present, no HTTP response */
+#define SOAP_HTML 1002 /* Custom HTML response */
+#define SOAP_FILE 1003 /* Custom file-based response */
/* gSOAP HTTP method codes (client) */
-#define SOAP_POST 2000 /* POST request */
-#define SOAP_POST_FILE 2001 /* Custom file-based POST request */
-#define SOAP_GET 2002 /* GET request */
-#define SOAP_PUT 2003 /* PUT request */
-#define SOAP_DEL 2004 /* DELETE request */
-#define SOAP_CONNECT 2005 /* CONNECT request */
+#define SOAP_POST 2000 /* POST request */
+#define SOAP_POST_FILE 2001 /* Custom file-based POST request */
+#define SOAP_GET 2002 /* GET request */
+#define SOAP_PUT 2003 /* PUT request */
+#define SOAP_DEL 2004 /* DELETE request */
+#define SOAP_CONNECT 2005 /* CONNECT request */
/* gSOAP DIME */
-#define SOAP_DIME_CF 0x01
-#define SOAP_DIME_ME 0x02
-#define SOAP_DIME_MB 0x04
-#define SOAP_DIME_VERSION 0x08 /* DIME version 1 */
-#define SOAP_DIME_MEDIA 0x10
-#define SOAP_DIME_ABSURI 0x20
+#define SOAP_DIME_CF 0x01
+#define SOAP_DIME_ME 0x02
+#define SOAP_DIME_MB 0x04
+#define SOAP_DIME_VERSION 0x08 /* DIME version 1 */
+#define SOAP_DIME_MEDIA 0x10
+#define SOAP_DIME_ABSURI 0x20
/* gSOAP ZLIB */
-#define SOAP_ZLIB_NONE 0x00
-#define SOAP_ZLIB_DEFLATE 0x01
-#define SOAP_ZLIB_INFLATE 0x02
-#define SOAP_ZLIB_GZIP 0x02
+#define SOAP_ZLIB_NONE 0x00
+#define SOAP_ZLIB_DEFLATE 0x01
+#define SOAP_ZLIB_INFLATE 0x02
+#define SOAP_ZLIB_GZIP 0x02
/* gSOAP transport, connection, and content encoding modes */
typedef soap_int32 soap_mode;
-#define SOAP_IO 0x00000003 /* IO mask */
-#define SOAP_IO_FLUSH 0x00000000 /* flush output immediately, no buffering */
-#define SOAP_IO_BUFFER 0x00000001 /* buffer output in packets of size SOAP_BUFLEN */
-#define SOAP_IO_STORE 0x00000002 /* store entire output to determine length for transport */
-#define SOAP_IO_CHUNK 0x00000003 /* use HTTP chunked transfer AND buffer packets */
-
-#define SOAP_IO_UDP 0x00000004 /* TCP or UDP */
-#define SOAP_IO_LENGTH 0x00000008 /* calc message length (internal) */
-#define SOAP_IO_KEEPALIVE 0x00000010 /* keep connection alive */
-
-#define SOAP_ENC 0x00000FFF /* IO and ENC mask */
-#define SOAP_ENC_LATIN 0x00000020 /* in: accept iso-8859-1 */
-#define SOAP_ENC_XML 0x00000040 /* out: plain XML encoding, no HTTP header */
-#define SOAP_ENC_DIME 0x00000080
-#define SOAP_ENC_MIME 0x00000100
-#define SOAP_ENC_MTOM 0x00000200
-#define SOAP_ENC_ZLIB 0x00000400
-#define SOAP_ENC_SSL 0x00000800
-
-#define SOAP_XML_STRICT 0x00001000 /* in: strict validation */
-#define SOAP_XML_INDENT 0x00002000 /* out: emit indented XML */
-#define SOAP_XML_IGNORENS 0x00004000 /* in: ignore namespaces */
-#define SOAP_XML_DEFAULTNS 0x00008000 /* out: emit xmlns="..." */
-#define SOAP_XML_CANONICAL 0x00010000 /* out: excC14N canonical XML */
-#define SOAP_XML_TREE 0x00020000 /* in/out: XML tree (no id/ref) */
-#define SOAP_XML_NIL 0x00040000 /* out: NULLs as xsi:nil */
-#define SOAP_XML_NOTYPE 0x00080000 /* out: do not add xsi:type */
-
-#define SOAP_DOM_TREE 0x00100000 /* see DOM manual */
-#define SOAP_DOM_NODE 0x00200000
-#define SOAP_DOM_ASIS 0x00400000
-
-#define SOAP_C_NOIOB 0x01000000 /* don't fault on array index out of bounds (just ignore) */
-#define SOAP_C_UTFSTRING 0x02000000 /* (de)serialize strings with UTF8 content */
-#define SOAP_C_MBSTRING 0x04000000 /* (de)serialize strings with multi-byte content */
-#define SOAP_C_NILSTRING 0x08000000 /* serialize empty strings as nil (omitted) */
-
-#define SOAP_XML_DOM 0x10000000 /* enable internal DOM */
-#define SOAP_XML_GRAPH 0x20000000 /* force id-ref XML graph */
-
-#define SOAP_MIME_POSTCHECK 0x40000000 /* MIME flag (internal) */
-
-#define SOAP_SEC_WSUID 0x80000000 /* Add Body wsu:Id */
+#define SOAP_IO 0x00000003 /* IO mask */
+#define SOAP_IO_FLUSH 0x00000000 /* flush output immediately, no buffering */
+#define SOAP_IO_BUFFER 0x00000001 /* buffer output in packets of size SOAP_BUFLEN */
+#define SOAP_IO_STORE 0x00000002 /* store entire output to determine length for transport */
+#define SOAP_IO_CHUNK 0x00000003 /* use HTTP chunked transfer AND buffer packets */
+
+#define SOAP_IO_UDP 0x00000004 /* TCP or UDP */
+#define SOAP_IO_LENGTH 0x00000008 /* calc message length (internal) */
+#define SOAP_IO_KEEPALIVE 0x00000010 /* keep connection alive */
+
+#define SOAP_ENC 0x00000FFF /* IO and ENC mask */
+#define SOAP_ENC_LATIN 0x00000020 /* in: accept iso-8859-1 */
+#define SOAP_ENC_XML 0x00000040 /* out: plain (XML or other) body, no HTTP header */
+#define SOAP_ENC_DIME 0x00000080
+#define SOAP_ENC_MIME 0x00000100
+#define SOAP_ENC_MTOM 0x00000200
+#define SOAP_ENC_ZLIB 0x00000400
+#define SOAP_ENC_SSL 0x00000800
+
+#define SOAP_XML_STRICT 0x00001000 /* in: strict validation */
+#define SOAP_XML_INDENT 0x00002000 /* out: emit indented XML */
+#define SOAP_XML_IGNORENS 0x00004000 /* in: ignore namespaces */
+#define SOAP_XML_DEFAULTNS 0x00008000 /* out: emit xmlns="..." */
+#define SOAP_XML_CANONICAL 0x00010000 /* out: excC14N canonical XML */
+#define SOAP_XML_TREE 0x00020000 /* in/out: XML tree (no id/ref) */
+#define SOAP_XML_NIL 0x00040000 /* out: all NULLs as xsi:nil */
+#define SOAP_XML_NOTYPE 0x00080000 /* out: do not add xsi:type */
+
+#define SOAP_DOM_TREE 0x00100000 /* see DOM manual */
+#define SOAP_DOM_NODE 0x00200000
+#define SOAP_DOM_ASIS 0x00400000
+
+#define SOAP_RESERVED 0x00800000 /* reserved for future use */
+
+#define SOAP_C_NOIOB 0x01000000 /* don't fault on array index out of bounds (just ignore) */
+#define SOAP_C_UTFSTRING 0x02000000 /* (de)serialize strings with UTF8 content */
+#define SOAP_C_MBSTRING 0x04000000 /* (de)serialize strings with multi-byte content */
+#define SOAP_C_NILSTRING 0x08000000 /* serialize empty strings as nil (omitted) */
+
+#define SOAP_XML_DOM 0x10000000 /* enable internal DOM */
+#define SOAP_XML_GRAPH 0x20000000 /* force id-ref XML graph */
+
+#define SOAP_MIME_POSTCHECK 0x40000000 /* MIME flag (internal) */
+
+#define SOAP_SEC_WSUID 0x80000000 /* Add Body wsu:Id flag (internal) */
/* WITH_XMLNS backward compatibility: always use XML default namespaces */
#ifdef WITH_XMLNS
-# define SOAP_IO_DEFAULT (SOAP_IO_FLUSH | SOAP_XML_DEFAULTNS)
+# define SOAP_IO_DEFAULT (SOAP_IO_FLUSH | SOAP_XML_DEFAULTNS)
#else
-# define SOAP_IO_DEFAULT SOAP_IO_FLUSH
+# define SOAP_IO_DEFAULT SOAP_IO_FLUSH
#endif
/* SSL client/server authentication settings */
-#define SOAP_SSL_NO_AUTHENTICATION 0x00 /* for testing purposes */
-#define SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION 0x01 /* client requires server to authenticate */
-#define SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION 0x02 /* server requires client to authenticate */
-#define SOAP_SSL_SKIP_HOST_CHECK 0x04 /* client does not check the common name of the host in certificate */
-#define SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE 0x08 /* client does not check the expiration date of the host certificate */
-#define SOAP_SSL_NO_DEFAULT_CA_PATH 0x10 /* don't use default_verify_paths */
-#define SOAP_SSL_RSA 0x20 /* use RSA */
-#define SOAP_SSLv3 0x40 /* SSL v3 only */
-#define SOAP_TLSv1 0x80 /* TLS v1 only */
-#define SOAP_SSLv3_TLSv1 0x00 /* SSL v3 and TLS v1 support by default (no SSL v1/v2) */
-#define SOAP_SSL_CLIENT 0x100 /* client context */
-
-#define SOAP_SSL_DEFAULT (SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION | SOAP_SSLv3_TLSv1)
+#define SOAP_SSL_NO_AUTHENTICATION 0x0000 /* for testing purposes */
+#define SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION 0x0001 /* client requires server to authenticate (default) */
+#define SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION 0x0002 /* server requires client to authenticate */
+#define SOAP_SSL_SKIP_HOST_CHECK 0x0004 /* client skips common name check against host name */
+#define SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE 0x0008 /* allow self-signed and expired certificates and those w/o CRL */
+#define SOAP_SSL_NO_DEFAULT_CA_PATH 0x0010 /* don't use default_verify_paths */
+#define SOAP_SSL_RSA 0x0020 /* use RSA */
+#define SOAP_TLSv1 0x0000 /* enable TLS v1.0/1.1/1.2 only (default) */
+#define SOAP_SSLv3_TLSv1 0x0040 /* enable SSL v3 and TLS v1.0/1.1/1.2 */
+#define SOAP_SSLv3 0x0080 /* only SSL v3 */
+#define SOAP_TLSv1_0 0x0100 /* only TLS v1.0 */
+#define SOAP_TLSv1_1 0x0200 /* only TLS v1.1 */
+#define SOAP_TLSv1_2 0x0400 /* only TLS v1.2 */
+#define SOAP_SSL_CLIENT 0x1000 /* client context */
+
+#define SOAP_SSL_DEFAULT (SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION | SOAP_TLSv1)
/* state */
-#define SOAP_NONE 0
-#define SOAP_INIT 1
-#define SOAP_COPY 2
+#define SOAP_NONE 0
+#define SOAP_INIT 1
+#define SOAP_COPY 2
#define soap_check_state(soap) (!(soap) || ((soap)->state != SOAP_INIT && (soap)->state != SOAP_COPY))
/* parts */
-#define SOAP_BEGIN 0
-#define SOAP_IN_ENVELOPE 2
-#define SOAP_IN_HEADER 3
-#define SOAP_END_HEADER 4
-#define SOAP_NO_BODY 5
-#define SOAP_IN_BODY 6
-#define SOAP_END_BODY 7
-#define SOAP_END_ENVELOPE 8
-#define SOAP_END 9
+#define SOAP_BEGIN 0
+#define SOAP_IN_ENVELOPE 2
+#define SOAP_IN_HEADER 3
+#define SOAP_END_HEADER 4
+#define SOAP_NO_BODY 5
+#define SOAP_IN_BODY 6
+#define SOAP_END_BODY 7
+#define SOAP_END_ENVELOPE 8
+#define SOAP_END 9
/* events */
-#define SOAP_SEC_BEGIN 1
-#define SOAP_SEC_SIGN 2
-#define SOAP_SEC_DECRYPT 3
+#define SOAP_SEC_BEGIN 1
+#define SOAP_SEC_SIGN 2
+#define SOAP_SEC_DECRYPT 3
/* DEBUG macros */
@@ -1452,27 +1671,29 @@ typedef soap_int32 soap_mode;
#ifdef SOAP_MEM_DEBUG
# ifndef SOAP_MALLOC
-# define SOAP_MALLOC(soap, size) soap_track_malloc(soap, __FILE__, __LINE__, size)
+# define SOAP_MALLOC(soap, size) soap_track_malloc((soap), __FILE__, __LINE__, (size))
# endif
# ifndef SOAP_FREE
-# define SOAP_FREE(soap, ptr) soap_track_free(soap, __FILE__, __LINE__, ptr)
+# define SOAP_FREE(soap, ptr) soap_track_free((soap), __FILE__, __LINE__, (void*)(ptr))
# endif
#endif
-#ifndef SOAP_MALLOC /* use libc malloc */
+#ifndef SOAP_MALLOC /* use libc malloc */
# define SOAP_MALLOC(soap, size) malloc(size)
#endif
-#ifndef SOAP_FREE /* use libc free */
-# define SOAP_FREE(soap, ptr) free(ptr)
+#ifndef SOAP_FREE /* use libc free */
+# define SOAP_FREE(soap, ptr) free((void*)(ptr))
#endif
-#if defined(__GNUC__) && (__GNUC__ <= 2)
-# define SOAP_NOTHROW
-#elif !defined(WITH_LEAN) && !defined(WITH_COMPAT) && !defined(SOAP_NOTHROW)
-# define SOAP_NOTHROW (std::nothrow)
-#else
-# define SOAP_NOTHROW
+#ifndef SOAP_NOTHROW
+# if defined(__GNUC__) && (__GNUC__ <= 2)
+# define SOAP_NOTHROW
+# elif defined(WITH_LEAN) || defined(WITH_COMPAT)
+# define SOAP_NOTHROW
+# else
+# define SOAP_NOTHROW (std::nothrow)
+# endif
#endif
#if (defined(__GNUC__) && (__GNUC__ <= 2) && !defined(__BORLANDC__)) || defined(__clang__) || defined(_AIX) || defined(AIX)
@@ -1499,15 +1720,15 @@ typedef soap_int32 soap_mode;
# endif
#endif
-#ifndef SOAP_NEW_COPY /* use C++ new operator for ::copy() */
+#ifndef SOAP_NEW_COPY /* use C++ new operator for ::copy() */
# define SOAP_NEW_COPY(clas) new SOAP_NOTHROW clas
#endif
-#ifndef SOAP_DELETE /* use C++ delete operator */
+#ifndef SOAP_DELETE /* use C++ delete operator */
# define SOAP_DELETE(obj) delete obj
#endif
-#ifndef SOAP_DELETE_ARRAY /* use C++ delete[] operator */
+#ifndef SOAP_DELETE_ARRAY /* use C++ delete[] operator */
# define SOAP_DELETE_ARRAY(obj) delete[] obj
#endif
@@ -1570,7 +1791,7 @@ typedef soap_int32 soap_mode;
{ if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\
soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\
if (soap->fdebug[SOAP_INDEX_##DBGFILE])\
- { fwrite((MSG), 1, (LEN), soap->fdebug[SOAP_INDEX_##DBGFILE]);\
+ { fwrite((void*)(MSG), 1, (size_t)(LEN), soap->fdebug[SOAP_INDEX_##DBGFILE]);\
fflush(soap->fdebug[SOAP_INDEX_##DBGFILE]);\
}\
}\
@@ -1623,27 +1844,30 @@ struct soap_nlist
unsigned int level; /* nesting depth level */
short index; /* corresponding entry in ns mapping table */
const char *ns; /* only set when parsed ns URI is not in the ns mapping table */
- char id[1]; /* the actual string value flows into the allocated region below this struct */
+ char id[1]; /* the actual string value flows into the allocated region id[0...] below this struct */
+};
+
+/* block header, the data flows into the allocated region below this struct */
+struct soap_bhead
+{ struct soap_bhead *next;
+ size_t size;
};
/* block stack for nested block allocations */
struct soap_blist
{ struct soap_blist *next;
- char *ptr;
+ struct soap_bhead *head;
size_t size;
-};
-
-/* array layout */
-struct soap_array
-{ void *__ptr;
- int __size;
+ size_t item;
};
/* pointer serialization management */
struct soap_plist
{ struct soap_plist *next;
const void *ptr;
- const struct soap_array *array;
+ void *dup;
+ const void *array; /* array pointer */
+ int size; /* array size */
int type;
int id;
char mark1; /* 0=single-ref, 1=embedded-multi-ref (SOAP1.1), 2=multi-ref, 3=attachment */
@@ -1672,14 +1896,14 @@ struct soap_clist
{ struct soap_clist *next;
void *ptr;
int type;
- int size;
+ int size; /* array size */
int (*fdelete)(struct soap_clist*);
};
/* attributes */
struct soap_attribute
{ struct soap_attribute *next;
- short flag; /* soap_set_attr: 1 = normal, 2 = utf content */
+ short flag; /* soap_set_attr: 1 = normal, 2 = utf content */
char *value;
size_t size;
const char *ns;
@@ -1694,13 +1918,13 @@ struct soap_cookie
char *value;
char *domain;
char *path;
- time_t expire; /* client-side: local time to expire */
- long maxage; /* server-side: seconds to expire */
+ time_t expire; /* client-side: local time to expire */
+ long maxage; /* server-side: seconds to expire */
unsigned int version;
short secure;
- short session; /* server-side */
- short env; /* server-side: got cookie from client and should not be (re)send */
- short modified; /* server-side: client cookie was modified and should be send */
+ short session; /* server-side */
+ short env; /* server-side: got cookie from client and should not be (re)send */
+ short modified; /* server-side: client cookie was modified and should be send */
};
#endif
@@ -1709,7 +1933,8 @@ SOAP_FMAC1 struct soap_multipart* SOAP_FMAC2 soap_next_multipart(struct soap_mul
#ifdef __cplusplus
class soap_multipart_iterator
-{ public:
+{
+ public:
struct soap_multipart *content;
bool operator==(const soap_multipart_iterator& iter) const
{ return (bool)(content == iter.content); }
@@ -1724,6 +1949,7 @@ class soap_multipart_iterator
soap_multipart_iterator(struct soap_multipart *p) : content(p)
{ }
};
+
#endif
#ifndef WITH_LEANER
@@ -1737,8 +1963,8 @@ struct soap_dime
const char *id;
const char *type;
const char *options;
- struct soap_multipart *list; /* list of DIME attachments received */
- struct soap_multipart *first, *last; /* temporary in/out queue */
+ struct soap_multipart *list; /* list of DIME attachments received */
+ struct soap_multipart *first, *last; /* temporary in/out queue */
#ifdef __cplusplus
soap_multipart_iterator begin()
{ soap_multipart_iterator iter(list); return iter; };
@@ -1750,10 +1976,10 @@ struct soap_dime
#ifndef WITH_LEANER
struct soap_mime
-{ char *boundary; /* MIME boundary */
- const char *start; /* MIME start ID */
- struct soap_multipart *list; /* list of MIME attachments received */
- struct soap_multipart *first, *last; /* temporary in/out queue */
+{ char *boundary; /* MIME boundary */
+ const char *start; /* MIME start ID */
+ struct soap_multipart *list; /* list of MIME attachments received */
+ struct soap_multipart *first, *last; /* temporary in/out queue */
#ifdef __cplusplus
soap_multipart_iterator begin()
{ soap_multipart_iterator iter(list); return iter; };
@@ -1781,14 +2007,14 @@ enum soap_mime_encoding
/* DIME/MIME multipart list */
struct soap_multipart
{ struct soap_multipart *next;
- char *ptr; /* points to raw data content */
- size_t size; /* size of data content */
- const char *id; /* DIME/MIME content ID or form data name */
- const char *type; /* DIME/MIME type (MIME type format) */
- const char *options; /* DIME options */
- enum soap_mime_encoding encoding; /* MIME Content-Transfer-Encoding */
- const char *location; /* MIME Content-Location (optional) */
- const char *description; /* MIME Content-Description (optional) */
+ char *ptr; /* points to raw data content */
+ size_t size; /* size of data content */
+ const char *id; /* DIME/MIME content ID or form data name */
+ const char *type; /* DIME/MIME type (MIME type format) */
+ const char *options; /* DIME options */
+ enum soap_mime_encoding encoding; /* MIME Content-Transfer-Encoding */
+ const char *location; /* MIME Content-Location (optional) */
+ const char *description; /* MIME Content-Description (optional) */
#ifdef __cplusplus
typedef soap_multipart_iterator iterator;
#endif
@@ -1810,16 +2036,155 @@ struct soap_xlist
/******************************************************************************/
#ifndef WITH_LEANER
+
+/* dom.c[pp] functions (optional, compile and link dom.c[pp] */
+struct SOAP_CMAC soap;
+struct SOAP_CMAC soap_dom_element;
+struct SOAP_CMAC soap_dom_attribute;
+
+/* soap_dom_element construction */
+
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_new(struct soap *soap, const char *ns, const char *tag);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_new_w(struct soap *soap, const char *ns, const wchar_t *tag);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_set(struct soap_dom_element *elt, const char *ns, const char *tag);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_set_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag);
+
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att(struct soap_dom_element *elt, const char *ns, const char *tag);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt(struct soap_dom_element *elt, const char *ns, const char *tag);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_nth_elt(struct soap_dom_element *elt, const char *ns, const char *tag, size_t n);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_nth_elt_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag, size_t n);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_nth(struct soap_dom_element *elt, size_t n);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_att(struct soap_dom_element *elt, const struct soap_dom_attribute *node);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_elt(struct soap_dom_element *elt, const struct soap_dom_element *node);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_atts(struct soap_dom_element *elt, const struct soap_dom_attribute *atts);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_elts(struct soap_dom_element *elt, const struct soap_dom_element *elts);
+
+/* soap_dom_element assignment */
+
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_bool(struct soap_dom_element *elt, LONG64 b);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_int(struct soap_dom_element *elt, LONG64 n);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_double(struct soap_dom_element *elt, double x);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_text(struct soap_dom_element *elt, const char *text);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_text_w(struct soap_dom_element *elt, const wchar_t *text);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_node(struct soap_dom_element *elt, const void *node, int type);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_copy(struct soap_dom_element *elt, const struct soap_dom_element *node);
+
+/* soap_dom_element properties */
+
+SOAP_FMAC1 int SOAP_FMAC2 soap_elt_match(const struct soap_dom_element *elt, const char *ns, const char *patt);
+SOAP_FMAC1 int SOAP_FMAC2 soap_elt_match_w(const struct soap_dom_element *elt, const char *ns, const wchar_t *patt);
+SOAP_FMAC1 const char * SOAP_FMAC2 soap_elt_get_ns(const struct soap_dom_element *elt);
+SOAP_FMAC1 const char * SOAP_FMAC2 soap_elt_get_tag(const struct soap_dom_element *elt);
+SOAP_FMAC1 int SOAP_FMAC2 soap_elt_is_true(const struct soap_dom_element *elt);
+SOAP_FMAC1 int SOAP_FMAC2 soap_elt_is_false(const struct soap_dom_element *elt);
+SOAP_FMAC1 int SOAP_FMAC2 soap_elt_get_int(const struct soap_dom_element *elt);
+SOAP_FMAC1 long SOAP_FMAC2 soap_elt_get_long(const struct soap_dom_element *elt);
+SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_elt_get_LONG64(const struct soap_dom_element *elt);
+SOAP_FMAC1 double SOAP_FMAC2 soap_elt_get_double(const struct soap_dom_element *elt);
+SOAP_FMAC1 const char * SOAP_FMAC2 soap_elt_get_text(const struct soap_dom_element *elt);
+SOAP_FMAC1 const void * SOAP_FMAC2 soap_elt_get_node(const struct soap_dom_element *elt, int type);
+SOAP_FMAC1 int SOAP_FMAC2 soap_elt_get_type(const struct soap_dom_element *elt, const void **node);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_parent(const struct soap_dom_element *elt);
+SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_depth(const struct soap_dom_element *elt);
+SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_index(const struct soap_dom_element *elt);
+SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_len(const struct soap_dom_element *elt);
+SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_nth(const struct soap_dom_element *elt);
+
+/* soap_dom_attribute construction */
+
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_new(struct soap *soap, const char *ns, const char *tag);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_new_w(struct soap *soap, const char *ns, const wchar_t *tag);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_set(struct soap_dom_attribute *att, const char *ns, const char *tag);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_set_w(struct soap_dom_attribute *att, const char *ns, const wchar_t *tag);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_add(struct soap_dom_attribute *att, const char *ns, const char *tag);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_add_w(struct soap_dom_attribute *att, const char *ns, const wchar_t *tag);
+
+/* soap_dom_attribute assignment */
+
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_bool(struct soap_dom_attribute *att, LONG64 b);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_int(struct soap_dom_attribute *att, LONG64 n);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_double(struct soap_dom_attribute *att, double x);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_text(struct soap_dom_attribute *att, const char *text);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_text_w(struct soap_dom_attribute *att, const wchar_t *text);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_copy(struct soap_dom_attribute *att, const struct soap_dom_attribute *node);
+
+/* soap_dom_attribute properties */
+
+SOAP_FMAC1 int SOAP_FMAC2 soap_att_match(const struct soap_dom_attribute *att, const char *ns, const char *patt);
+SOAP_FMAC1 int SOAP_FMAC2 soap_att_match_w(const struct soap_dom_attribute *att, const char *ns, const wchar_t *patt);
+SOAP_FMAC1 const char * SOAP_FMAC2 soap_att_get_ns(const struct soap_dom_attribute *att);
+SOAP_FMAC1 const char * SOAP_FMAC2 soap_att_get_tag(const struct soap_dom_attribute *att);
+SOAP_FMAC1 int SOAP_FMAC2 soap_att_is_true(const struct soap_dom_attribute *att);
+SOAP_FMAC1 int SOAP_FMAC2 soap_att_is_false(const struct soap_dom_attribute *att);
+SOAP_FMAC1 int SOAP_FMAC2 soap_att_get_int(const struct soap_dom_attribute *att);
+SOAP_FMAC1 long SOAP_FMAC2 soap_att_get_long(const struct soap_dom_attribute *att);
+SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_att_get_LONG64(const struct soap_dom_attribute *att);
+SOAP_FMAC1 double SOAP_FMAC2 soap_att_get_double(const struct soap_dom_attribute *att);
+SOAP_FMAC1 const char * SOAP_FMAC2 soap_att_get_text(const struct soap_dom_attribute *att);
+
+/* DOM local traversal */
+
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_first(struct soap_dom_element *elt);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_next(const struct soap_dom_attribute *att);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_first(struct soap_dom_element *elt);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_next(const struct soap_dom_element *elt);
+
+/* DOM local retrieval */
+
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_get(const struct soap_dom_element *elt, const char *ns, const char *tag);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_get_w(const struct soap_dom_element *elt, const char *ns, const wchar_t *tag);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get(const struct soap_dom_element *elt, const char *ns, const char *tag);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get_w(const struct soap_dom_element *elt, const char *ns, const wchar_t *tag);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get_next(const struct soap_dom_element *elt);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get_nth(struct soap_dom_element *elt, size_t n);
+
+/* DOM local search */
+
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_find(struct soap_dom_element *elt, const char *ns, const char *patt);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_find_next(const struct soap_dom_attribute *att, const char *ns, const char *patt);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find(struct soap_dom_element *elt, const char *ns, const char *patt);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find_next(const struct soap_dom_element *elt, const char *ns, const char *patt);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find_type(struct soap_dom_element *elt, const char *ns, const char *patt, int type);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find_next_type(const struct soap_dom_element *elt, const char *ns, const char *patt, int type);
+
+/* DOM size of local search results */
+
+SOAP_FMAC1 size_t SOAP_FMAC2 soap_att_size(struct soap_dom_element *elt, const char *ns, const char *patt);
+SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_size(struct soap_dom_element *elt, const char *ns, const char *patt);
+SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_size_type(struct soap_dom_element *elt, const char *ns, const char *patt, int type);
+
+/* DOM deep traversal */
+
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_dom_next_attribute(const struct soap_dom_attribute *att);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_next_element(const struct soap_dom_element *elt, const struct soap_dom_element *end);
+
+/* DOM deep search */
+
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_find(struct soap_dom_element *begin, const struct soap_dom_element *end, const char *ns, const char *patt, int type);
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_find_next(const struct soap_dom_element *elt, const struct soap_dom_element *end, const char *ns, const char *patt, int type);
+
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+#ifndef WITH_LEANER
#ifdef __cplusplus
-class soap_dom_attribute_iterator
-{ public:
- struct soap_dom_attribute *att;
+class SOAP_CMAC soap_dom_attribute_iterator
+{
+ public:
+ struct soap_dom_attribute *iter;
const char *nstr;
const char *name;
bool operator==(const soap_dom_attribute_iterator&) const;
bool operator!=(const soap_dom_attribute_iterator&) const;
- struct soap_dom_attribute &operator*() const;
- soap_dom_attribute_iterator &operator++();
+ struct soap_dom_attribute& operator*() const;
+ struct soap_dom_attribute *operator->() const;
+ soap_dom_attribute_iterator& operator++();
+ soap_dom_attribute_iterator operator++(int);
soap_dom_attribute_iterator();
soap_dom_attribute_iterator(struct soap_dom_attribute*);
~soap_dom_attribute_iterator();
@@ -1828,41 +2193,100 @@ class soap_dom_attribute_iterator
#endif
#ifndef WITH_LEANER
-struct soap_dom_attribute
+struct SOAP_CMAC soap_dom_attribute
{ struct soap_dom_attribute *next;
const char *nstr;
- char *name;
- char *data;
- wchar_t *wide;
+ const char *name;
+ const char *text;
struct soap *soap;
#ifdef __cplusplus
typedef soap_dom_attribute_iterator iterator;
- struct soap_dom_attribute &set(const char *nstr, const char *name); /* set namespace and name */
- struct soap_dom_attribute &set(const char *data); /* set data */
- soap_dom_attribute_iterator begin();
- soap_dom_attribute_iterator end();
- soap_dom_attribute_iterator find(const char *nstr, const char *name);
- void unlink();
- soap_dom_attribute();
- soap_dom_attribute(struct soap *soap);
- soap_dom_attribute(struct soap *soap, const char *nstr, const char *name, const char *data);
+ soap_dom_attribute(struct soap *soap = NULL);
+ soap_dom_attribute(const soap_dom_attribute& att);
+ soap_dom_attribute(struct soap *soap, const char *tag);
+ soap_dom_attribute(struct soap *soap, const wchar_t *tag);
+ soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const char *text);
+ soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const wchar_t *text);
+ soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const char *text);
+ soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const wchar_t *text);
+ soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const std::string& text);
+ soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const std::wstring& text);
+ soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const std::string& text);
+ soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const std::wstring& text);
~soap_dom_attribute();
+ soap_dom_attribute& set(const char *ns, const char *tag) { return *soap_att_set(this, ns, tag); }
+ soap_dom_attribute& set(const char *ns, const wchar_t *tag) { return *soap_att_set_w(this, ns, tag); }
+ soap_dom_attribute& set(bool b) { return *soap_att_bool(this, b); }
+ soap_dom_attribute& set(int n) { return *soap_att_int(this, n); }
+ soap_dom_attribute& set(LONG64 n) { return *soap_att_int(this, n); }
+ soap_dom_attribute& set(float x) { return *soap_att_double(this, x); }
+ soap_dom_attribute& set(double x) { return *soap_att_double(this, x); }
+ soap_dom_attribute& set(const char *text) { return *soap_att_text(this, text); }
+ soap_dom_attribute& set(const wchar_t *text) { return *soap_att_text_w(this, text); }
+#ifndef WITH_COMPAT
+ soap_dom_attribute& set(const std::string& text) { return *soap_att_text(this, text.c_str()); }
+ soap_dom_attribute& set(const std::wstring& text) { return *soap_att_text_w(this, text.c_str()); }
+#endif
+ soap_dom_attribute& operator=(bool b) { return *soap_att_bool(this, b); }
+ soap_dom_attribute& operator=(int n) { return *soap_att_int(this, n); }
+ soap_dom_attribute& operator=(LONG64 n) { return *soap_att_int(this, n); }
+ soap_dom_attribute& operator=(float x) { return *soap_att_double(this, x); }
+ soap_dom_attribute& operator=(double x) { return *soap_att_double(this, x); }
+ soap_dom_attribute& operator=(const char *text) { return *soap_att_text(this, text); }
+ soap_dom_attribute& operator=(const wchar_t *text) { return *soap_att_text_w(this, text); }
+#ifndef WITH_COMPAT
+ soap_dom_attribute& operator=(const std::string& text) { return *soap_att_text(this, text.c_str()); }
+ soap_dom_attribute& operator=(const std::wstring& text) { return *soap_att_text_w(this, text.c_str()); }
+#endif
+ soap_dom_attribute& operator=(const soap_dom_attribute& att) { return *soap_att_copy(this, &att); }
+ soap_dom_attribute& att(const char *tag) { return *soap_att_add(this, NULL, tag); }
+ soap_dom_attribute& att(const wchar_t *tag) { return *soap_att_add_w(this, NULL, tag); }
+ soap_dom_attribute& att(const char *ns, const char *tag) { return *soap_att_add(this, ns, tag); }
+ soap_dom_attribute& att(const char *ns, const wchar_t *tag) { return *soap_att_add_w(this, ns, tag); }
+ bool match(const char *patt) const { return soap_att_match(this, NULL, patt) != 0; }
+ bool match(const wchar_t *patt) const { return soap_att_match_w(this, NULL, patt) != 0; }
+ bool match(const char *ns, const char *patt) const { return soap_att_match(this, ns, patt) != 0; }
+ bool match(const char *ns, const wchar_t *patt) const { return soap_att_match_w(this, ns, patt) != 0; }
+ const char *ns() const { return this->nstr; }
+ const char *tag() const { return this->name; }
+ bool is_true() const { return soap_att_is_true(this) != 0; }
+ bool is_false() const { return soap_att_is_false(this) != 0; }
+ LONG64 get_int() const { return soap_att_get_LONG64(this); }
+ double get_double() const { return soap_att_get_double(this); }
+ const char *get_text() const { return this->text; }
+ operator bool() const { return soap_att_is_true(this) != 0; }
+ operator int() const { return soap_att_get_int(this); }
+ operator LONG64() const { return soap_att_get_LONG64(this); }
+ operator double() const { return soap_att_get_double(this); }
+ operator const char*() const { return this->text; }
+ soap_dom_attribute_iterator att_begin() { return soap_dom_attribute_iterator(this); }
+ soap_dom_attribute_iterator att_end() { return soap_dom_attribute_iterator(NULL); }
+ soap_dom_attribute_iterator att_find(const char *patt) { return att_find(NULL, patt); }
+ soap_dom_attribute_iterator att_find(const wchar_t *patt) { return att_find(NULL, patt); }
+ soap_dom_attribute_iterator att_find(const char *ns, const char *patt);
+ soap_dom_attribute_iterator att_find(const char *ns, const wchar_t *patt);
+ void unlink();
#endif
};
#endif
#ifndef WITH_LEANER
#ifdef __cplusplus
-class soap_dom_element_iterator
-{ public:
- struct soap_dom_element *elt;
+class SOAP_CMAC soap_dom_element_iterator
+{
+ public:
+ struct soap_dom_element *iter;
+ struct soap_dom_element *stop;
const char *nstr;
const char *name;
int type;
+ bool deep;
bool operator==(const soap_dom_element_iterator&) const;
bool operator!=(const soap_dom_element_iterator&) const;
- struct soap_dom_element &operator*() const;
- soap_dom_element_iterator &operator++();
+ struct soap_dom_element& operator*() const;
+ struct soap_dom_element *operator->() const;
+ soap_dom_element_iterator& operator++();
+ soap_dom_element_iterator operator++(int);
soap_dom_element_iterator();
soap_dom_element_iterator(struct soap_dom_element*);
~soap_dom_element_iterator();
@@ -1871,121 +2295,249 @@ class soap_dom_element_iterator
#endif
#ifndef WITH_LEANER
-struct soap_dom_element
-{ struct soap_dom_element *next; /* next sibling */
- struct soap_dom_element *prnt; /* parent */
- struct soap_dom_element *elts; /* list of child elements */
- struct soap_dom_attribute *atts; /* list of attributes */
- const char *nstr; /* namespace string */
- char *name; /* element tag name */
- char *data; /* element content data (with SOAP_C_UTFSTRING flag set) */
- wchar_t *wide; /* element content data */
- int type; /* optional: serialized C/C++ data type */
- void *node; /* optional: pointer to serialized C/C++ data */
- char *head; /* leading content before start tag */
- char *tail; /* leading content before end tag */
- struct soap *soap; /* soap context that manages this node */
+struct SOAP_CMAC soap_dom_element
+{ struct soap_dom_element *next;
+ struct soap_dom_element *prnt;
+ struct soap_dom_element *elts;
+ struct soap_dom_attribute *atts;
+ const char *nstr;
+ const char *name;
+ const char *lead;
+ const char *text;
+ const char *code;
+ const char *tail;
+ const void *node;
+ int type;
+ struct soap *soap;
#ifdef __cplusplus
typedef soap_dom_element_iterator iterator;
- struct soap_dom_element &set(const char *nstr, const char *name);
- struct soap_dom_element &set(const char *data);
- struct soap_dom_element &set(void *node, int type);
- struct soap_dom_element &add(struct soap_dom_element*);
- struct soap_dom_element &add(struct soap_dom_element&);
- struct soap_dom_element &add(struct soap_dom_attribute*);
- struct soap_dom_element &add(struct soap_dom_attribute&);
+ soap_dom_element(struct soap *soap = NULL);
+ soap_dom_element(const soap_dom_element& elt);
+ soap_dom_element(struct soap *soap, const char *tag);
+ soap_dom_element(struct soap *soap, const wchar_t *tag);
+ soap_dom_element(struct soap *soap, const char *ns, const char *tag);
+ soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag);
+ soap_dom_element(struct soap *soap, const char *ns, const char *tag, const char *text);
+ soap_dom_element(struct soap *soap, const char *ns, const char *tag, const wchar_t *text);
+ soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const char *text);
+ soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const wchar_t *text);
+#ifndef WITH_COMPAT
+ soap_dom_element(struct soap *soap, const char *ns, const char *tag, const std::string& text);
+ soap_dom_element(struct soap *soap, const char *ns, const char *tag, const std::wstring& text);
+ soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const std::string& text);
+ soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const std::wstring& text);
+#endif
+ soap_dom_element(struct soap *soap, const char *ns, const char *tag, const void *node, int type);
+ soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const void *node, int type);
+ ~soap_dom_element();
+ soap_dom_element& set(const char *ns, const char *tag) { return *soap_elt_set(this, ns, tag); }
+ soap_dom_element& set(const char *ns, const wchar_t *tag) { return *soap_elt_set_w(this, ns, tag); }
+ soap_dom_element& set(bool b) { return *soap_elt_bool(this, b); }
+ soap_dom_element& set(int n) { return *soap_elt_int(this, n); }
+ soap_dom_element& set(LONG64 n) { return *soap_elt_int(this, n); }
+ soap_dom_element& set(float x) { return *soap_elt_double(this, x); }
+ soap_dom_element& set(double x) { return *soap_elt_double(this, x); }
+ soap_dom_element& set(const char *text) { return *soap_elt_text(this, text); }
+ soap_dom_element& set(const wchar_t *text) { return *soap_elt_text_w(this, text); }
+#ifndef WITH_COMPAT
+ soap_dom_element& set(const std::string& text) { return *soap_elt_text(this, text.c_str()); }
+ soap_dom_element& set(const std::wstring& text) { return *soap_elt_text_w(this, text.c_str()); }
+#endif
+ soap_dom_element& set(const void *node, int type) { return *soap_elt_node(this, node, type); }
+ soap_dom_element& add(soap_dom_element& elt) { return *soap_add_elt(this, &elt); }
+ soap_dom_element& add(soap_dom_element *elt) { return *soap_add_elt(this, elt); }
+ soap_dom_element& add(soap_dom_attribute& att) { return *soap_add_att(this, &att); }
+ soap_dom_element& add(soap_dom_attribute *att) { return *soap_add_att(this, att); }
+ soap_dom_element& adds(soap_dom_element& elts) { return *soap_add_elts(this, &elts); }
+ soap_dom_element& adds(soap_dom_element *elts) { return *soap_add_elts(this, elts); }
+ soap_dom_element& adds(soap_dom_attribute& atts) { return *soap_add_atts(this, &atts); }
+ soap_dom_element& adds(soap_dom_attribute *atts) { return *soap_add_atts(this, atts); }
+ soap_dom_element& operator=(bool b) { return *soap_elt_bool(this, b); }
+ soap_dom_element& operator=(int n) { return *soap_elt_int(this, n); }
+ soap_dom_element& operator=(LONG64 n) { return *soap_elt_int(this, n); }
+ soap_dom_element& operator=(float x) { return *soap_elt_double(this, x); }
+ soap_dom_element& operator=(double x) { return *soap_elt_double(this, x); }
+ soap_dom_element& operator=(const char *text) { return *soap_elt_text(this, text); }
+ soap_dom_element& operator=(const wchar_t *text) { return *soap_elt_text_w(this, text); }
+#ifndef WITH_COMPAT
+ soap_dom_element& operator=(const std::string& text) { return *soap_elt_text(this, text.c_str()); }
+ soap_dom_element& operator=(const std::wstring& text) { return *soap_elt_text_w(this, text.c_str()); }
+#endif
+ soap_dom_element& operator=(const soap_dom_element& elt) { return *soap_elt_copy(this, &elt); }
+ template<class T> soap_dom_element& operator=(const T& node) { return this->set(&node, node.soap_type()); }
+ template<class T> soap_dom_element& operator=(const T *node) { return this->set(node, node->soap_type()); }
+ template<class T> soap_dom_element& operator=(T *node) { return this->set(node, node->soap_type()); }
+ soap_dom_attribute& att(const char *tag) { return *soap_att(this, NULL, tag); }
+ soap_dom_attribute& att(const wchar_t *tag) { return *soap_att_w(this, NULL, tag); }
+ soap_dom_attribute& att(const char *ns, const char *tag) { return *soap_att(this, ns, tag); }
+ soap_dom_attribute& att(const char *ns, const wchar_t *tag) { return *soap_att_w(this, ns, tag); }
+ soap_dom_element& elt() { return *soap_elt(this, NULL, NULL); }
+ soap_dom_element& elt(const char *tag) { return *soap_elt(this, NULL, tag); }
+ soap_dom_element& elt(const wchar_t *tag) { return *soap_elt_w(this, NULL, tag); }
+ soap_dom_element& elt(const char *ns, const char *tag) { return *soap_elt(this, ns, tag); }
+ soap_dom_element& elt(const char *ns, const wchar_t *tag) { return *soap_elt_w(this, ns, tag); }
+ soap_dom_element& operator[](const char *tag) { return *soap_elt(this, NULL, tag); }
+ soap_dom_element& operator[](const wchar_t *tag) { return *soap_elt_w(this, NULL, tag); }
+ soap_dom_element& operator[](size_t n) { return *soap_nth(this, n); }
+ soap_dom_attribute *att_get(const char *tag) const { return soap_att_get(this, NULL, tag); }
+ soap_dom_attribute *att_get(const wchar_t *tag) const { return soap_att_get_w(this, NULL, tag); }
+ soap_dom_attribute *att_get(const char *ns, const char *tag) const { return soap_att_get(this, ns, tag); }
+ soap_dom_attribute *att_get(const char *ns, const wchar_t *tag) const { return soap_att_get_w(this, ns, tag); }
+ soap_dom_element *elt_get() const { return soap_elt_get(this, NULL, NULL); }
+ soap_dom_element *elt_get(const char *tag) const { return soap_elt_get(this, NULL, tag); }
+ soap_dom_element *elt_get(const wchar_t *tag) const { return soap_elt_get_w(this, NULL, tag); }
+ soap_dom_element *elt_get(const char *ns, const char *tag) const { return soap_elt_get(this, ns, tag); }
+ soap_dom_element *elt_get(const char *ns, const wchar_t *tag) const { return soap_elt_get_w(this, ns, tag); }
+ soap_dom_element *get_next() const { return soap_elt_get_next(this); }
+ soap_dom_element *get_nth(size_t n) { return soap_elt_get_nth(this, n); }
+ bool match(const char *patt) const { return soap_elt_match(this, NULL, patt) != 0; }
+ bool match(const wchar_t *patt) const { return soap_elt_match_w(this, NULL, patt) != 0; }
+ bool match(const char *ns, const char *patt) const { return soap_elt_match(this, ns, patt) != 0; }
+ bool match(const char *ns, const wchar_t *patt) const { return soap_elt_match_w(this, ns, patt) != 0; }
+ const char *ns() const { return this->nstr; }
+ const char *tag() const { return this->name; }
+ soap_dom_element *parent() { return this->prnt; }
+ size_t depth() const { return soap_elt_depth(this); }
+ size_t index() const { return soap_elt_index(this); }
+ size_t len() const { return soap_elt_len(this); }
+ size_t nth() const { return soap_elt_nth(this); }
+ size_t elt_size() { return soap_elt_size(this, NULL, NULL); }
+ size_t elt_size(const char *patt, int type = 0) { return elt_size(NULL, patt, type); }
+ size_t elt_size(const char *ns, const char *patt, int type = 0) { return soap_elt_size_type(this, ns, patt, type); }
+ size_t att_size() { return soap_att_size(this, NULL, NULL); }
+ size_t att_size(const char *patt) { return att_size(NULL, patt); }
+#ifndef WITH_COMPAT
+ size_t att_size(const std::string& patt) { return att_size(NULL, patt); }
+#endif
+ size_t att_size(const char *ns, const char *patt) { return soap_att_size(this, ns, patt); }
+#ifndef WITH_COMPAT
+ size_t att_size(const char *ns, const std::string& patt) { return soap_att_size(this, ns, patt.c_str()); }
+#endif
+ bool is_true() const { return soap_elt_is_true(this) != 0; }
+ bool is_false() const { return soap_elt_is_false(this) != 0; }
+ LONG64 get_int() const { return soap_elt_get_LONG64(this); }
+ double get_double() const { return soap_elt_get_double(this); }
+ const char *get_text() const { return this->text; }
+ const void *get_node(int type) const { return soap_elt_get_node(this, type); }
+ int get_type(const void **node) const { return soap_elt_get_type(this, node); }
+ operator bool() const { return soap_elt_is_true(this) != 0; }
+ operator int() const { return soap_elt_get_int(this); }
+ operator LONG64() const { return soap_elt_get_LONG64(this); }
+ operator double() const { return soap_elt_get_double(this); }
+ operator const char*() const { return this->text; }
soap_dom_element_iterator begin();
- soap_dom_element_iterator end();
- soap_dom_element_iterator find(const char *nstr, const char *name);
+ soap_dom_element_iterator end() { return soap_dom_element_iterator(NULL); }
+ soap_dom_element_iterator elt_begin() { return soap_dom_element_iterator(this->elts); }
+ soap_dom_element_iterator elt_end() { return soap_dom_element_iterator(NULL); }
+ soap_dom_attribute_iterator att_begin() { return soap_dom_attribute_iterator(this->atts); }
+ soap_dom_attribute_iterator att_end() { return soap_dom_attribute_iterator(NULL); }
+ soap_dom_element_iterator find(const char *patt, int type = 0) { return find(NULL, patt, type); }
+ soap_dom_element_iterator find(const wchar_t *patt, int type = 0) { return find(NULL, patt, type); }
+ soap_dom_element_iterator find(const char *ns, const char *patt, int type = 0);
+ soap_dom_element_iterator find(const char *ns, const wchar_t *patt, int type = 0);
soap_dom_element_iterator find(int type);
+ soap_dom_element_iterator elt_find(const char *patt, int type = 0) { return elt_find(NULL, patt, type); }
+ soap_dom_element_iterator elt_find(const wchar_t *patt, int type = 0) { return elt_find(NULL, patt, type); }
+ soap_dom_element_iterator elt_find(const char *ns, const char *patt, int type = 0);
+ soap_dom_element_iterator elt_find(const char *ns, const wchar_t *patt, int type = 0);
+ soap_dom_element_iterator elt_find(int type);
+ soap_dom_attribute_iterator att_find(const char *patt) { return att_find(NULL, patt); }
+ soap_dom_attribute_iterator att_find(const wchar_t *patt) { return att_find(NULL, patt); }
+ soap_dom_attribute_iterator att_find(const char *ns, const char *patt);
+ soap_dom_attribute_iterator att_find(const char *ns, const wchar_t *patt);
void unlink();
- soap_dom_element();
- soap_dom_element(struct soap *soap);
- soap_dom_element(struct soap *soap, const char *nstr, const char *name);
- soap_dom_element(struct soap *soap, const char *nstr, const char *name, const char *data);
- soap_dom_element(struct soap *soap, const char *nstr, const char *name, void *node, int type);
- ~soap_dom_element();
#endif
};
-SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_next_element(struct soap_dom_element *elt);
-SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_dom_next_attribute(struct soap_dom_attribute *att);
#endif
-#if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
-}
+#ifndef WITH_LEANER
+SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dup_xsd__anyType(struct soap *soap, struct soap_dom_element *d, const struct soap_dom_element *a);
+SOAP_FMAC1 void SOAP_FMAC2 soap_del_xsd__anyType(const struct soap_dom_element *a);
+SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_dup_xsd__anyAttribute(struct soap *soap, struct soap_dom_attribute *d, const struct soap_dom_attribute *a);
+SOAP_FMAC1 void SOAP_FMAC2 soap_del_xsd__anyAttribute(const struct soap_dom_attribute *a);
+SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element *in, struct soap_dom_element *out);
+#endif
+
+#ifndef WITH_LEANER
+#if defined(__cplusplus) && !defined(WITH_COMPAT)
extern std::ostream &operator<<(std::ostream&, const struct soap_dom_element&);
extern std::istream &operator>>(std::istream&, struct soap_dom_element&);
+
+SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element& in, struct soap_dom_element& out);
+SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element *in, struct soap_dom_element& out);
+SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element& in, struct soap_dom_element *out);
+#endif
+#endif
+
+#if defined(__cplusplus)
extern "C" {
#endif
/******************************************************************************/
-#ifdef WIN32
-# ifdef SOAP_STD_EXPORTS
-# define SOAP_STD_API __declspec(dllexport)
-# else
-# define SOAP_STD_API
-# endif
-#else
-# define SOAP_STD_API
-#endif
-
-struct SOAP_STD_API soap
-{ short state; /* 0 = uninitialized, 1 = initialized, 2 = copy of another soap struct */
- short version; /* 1 = SOAP1.1 and 2 = SOAP1.2 (set automatically from namespace URI in nsmap table), 0 indicates non-SOAP content */
+struct SOAP_CMAC soap
+{ short state; /* 0 = uninitialized, 1 = initialized, 2 = copy of another soap struct */
+ short version; /* 1 = SOAP1.1 and 2 = SOAP1.2 (set automatically from namespace URI in nsmap table), 0 indicates non-SOAP content */
soap_mode mode;
soap_mode imode;
soap_mode omode;
- const char *float_format; /* user-definable format string for floats (<1024 chars) */
- const char *double_format; /* user-definable format string for doubles (<1024 chars) */
- const char *dime_id_format; /* user-definable format string for integer DIME id (<SOAP_TAGLEN chars) */
- const char *http_version; /* HTTP version used "1.0" or "1.1" */
- const char *http_content; /* optional custom response content type (with SOAP_FILE) */
- const char *encodingStyle; /* default = "" which means that SOAP encoding is used */
- const char *actor; /* SOAP-ENV:actor or role attribute value */
- const char *lang; /* xml:lang attribute value of SOAP-ENV:Text */
- int recv_timeout; /* when > 0, gives socket recv timeout in seconds, < 0 in usec */
- int send_timeout; /* when > 0, gives socket send timeout in seconds, < 0 in usec */
- int connect_timeout; /* when > 0, gives socket connect() timeout in seconds, < 0 in usec */
- int accept_timeout; /* when > 0, gives socket accept() timeout in seconds, < 0 in usec */
- int socket_flags; /* socket recv() and send() flags, e.g. set to MSG_NOSIGNAL to disable sigpipe */
- int connect_flags; /* connect() SOL_SOCKET sockopt flags, e.g. set to SO_DEBUG to debug socket */
- int bind_flags; /* bind() SOL_SOCKET sockopt flags, e.g. set to SO_REUSEADDR to enable reuse */
- int accept_flags; /* accept() SOL_SOCKET sockopt flags */
- unsigned short linger_time; /* linger time for SO_LINGER option */
- const struct Namespace *namespaces; /* Pointer to global namespace mapping table */
- struct Namespace *local_namespaces; /* Local namespace mapping table */
- struct soap_nlist *nlist; /* namespace stack */
- struct soap_blist *blist; /* block allocation stack */
- struct soap_clist *clist; /* class instance allocation list */
- void *alist; /* memory allocation (malloc) list */
-#if !defined(WITH_LEAN) || !defined(WITH_NOIDREF)
+ const char *float_format; /* user-definable format string for floats (<1024 chars) */
+ const char *double_format; /* user-definable format string for doubles (<1024 chars) */
+ const char *long_double_format; /* user-definable format string for long doubles (<1024 chars) */
+ const char *dime_id_format; /* user-definable format string for integer DIME id (<SOAP_TAGLEN chars) */
+ int recv_timeout; /* user-definable, when > 0, gives socket recv timeout in seconds, < 0 in usec */
+ int send_timeout; /* user-definable, when > 0, gives socket send timeout in seconds, < 0 in usec */
+ int connect_timeout; /* user-definable, when > 0, gives socket connect() timeout in seconds, < 0 in usec */
+ int accept_timeout; /* user-definable, when > 0, gives socket accept() timeout in seconds, < 0 in usec */
+ int socket_flags; /* user-definable socket recv() and send() flags, e.g. set to MSG_NOSIGNAL to disable sigpipe */
+ int connect_flags; /* user-definable connect() SOL_SOCKET sockopt flags, e.g. set to SO_DEBUG to debug socket */
+ int bind_flags; /* user-definable bind() SOL_SOCKET sockopt flags, e.g. set to SO_REUSEADDR to enable reuse */
+ int accept_flags; /* user-definable accept() SOL_SOCKET sockopt flags */
+ int sndbuf; /* user-definable SO_SNFBUF setsockopt */
+ int rcvbuf; /* user-definable SO_SNFBUF setsockopt */
+ unsigned short linger_time; /* user-definable linger time for SO_LINGER option */
+ unsigned int maxlevel; /* user-definable max XML nesting depth levels, initialized to SOAP_MAXLEVEL */
+ long maxlength; /* user-definable max string length, initialized to SOAP_MAXLENGTH, maxlength<=0 is unbounded */
+ size_t maxoccurs; /* user-definable max array/container size, initialized to SOAP_MAXOCCURS */
+ const char *http_version; /* HTTP version used "1.0" or "1.1" */
+ const char *http_content; /* optional custom response content type (with SOAP_FILE) */
+ const char *encodingStyle; /* default = "" which means that SOAP encoding is used */
+ const char *actor; /* SOAP-ENV:actor or role attribute value */
+ const char *lang; /* user-definable xml:lang attribute value of SOAP-ENV:Text */
+ const struct Namespace *namespaces; /* Pointer to global namespace mapping table */
+ struct Namespace *local_namespaces; /* Local namespace mapping table */
+ struct soap_nlist *nlist; /* namespace stack */
+ struct soap_blist *blist; /* block allocation stack */
+ struct soap_clist *clist; /* class instance allocation list */
+ void *alist; /* memory allocation (malloc) list */
+ short shaky; /* objects in reallocatable containers are on shaky grounds */
+#if !defined(WITH_LEANER) || !defined(WITH_NOIDREF)
struct soap_ilist *iht[SOAP_IDHASH];
- struct soap_plist *pht[SOAP_PTRHASH];
- struct soap_pblk *pblk; /* plist block allocation */
- short pidx; /* plist block allocation */
#endif
+ struct soap_plist *pht[SOAP_PTRHASH];
+ struct soap_pblk *pblk; /* plist block allocation */
+ short pidx; /* plist block allocation */
struct SOAP_ENV__Header *header;
struct SOAP_ENV__Fault *fault;
int idnum;
- void *user; /* for user to pass user-defined data */
- void *data[4]; /* extension data = {smdevp, mecevp, ...} */
- struct soap_plugin *plugins; /* linked list of plug-in data */
- const char *userid; /* HTTP Basic authorization userid */
- const char *passwd; /* HTTP Basic authorization passwd */
- const char *authrealm; /* HTTP authentication realm (NTLM domain) */
+ void *user; /* for user to pass user-defined data to callbacks */
+ void *data[4]; /* extension data = {smdevp, mecevp, ...} */
+ struct soap_plugin *plugins; /* linked list of plug-in data */
+ const char *userid; /* HTTP Basic authorization userid */
+ const char *passwd; /* HTTP Basic authorization passwd */
+ const char *authrealm; /* HTTP authentication realm (and NTLM domain) */
#if !defined(WITH_LEAN) || defined(WITH_NTLM)
- const char *ntlm_challenge; /* HTTP NTLM challenge key string */
- short ntlm_auth; /* HTTP NTLM authentication type */
- short ntlm_stage; /* HTTP NTLM stage 0..3 */
+ const char *ntlm_challenge; /* HTTP NTLM challenge key string */
+ short ntlm_auth; /* HTTP NTLM authentication type */
+ short ntlm_stage; /* HTTP NTLM stage 0..3 */
#endif
int (*fpost)(struct soap*, const char*, const char*, int, const char*, const char*, size_t);
- int (*fget)(struct soap*); /* HTTP GET hook (not set by default) */
- int (*fput)(struct soap*); /* HTTP PUT hook (handled as POST by default) */
- int (*fdel)(struct soap*); /* HTTP DELETE hook (not set by default) */
- int (*fopt)(struct soap*); /* HTTP OPTIONS hook (not set by default) */
- int (*fhead)(struct soap*); /* HTTP HEAD hook (not set by default) */
- int (*fform)(struct soap*); /* HTTP/HTML form handler for plugins */
+ int (*fget)(struct soap*); /* HTTP GET hook (not set by default) */
+ int (*fput)(struct soap*); /* HTTP PUT hook (handled as POST by default) */
+ int (*fdel)(struct soap*); /* HTTP DELETE hook (not set by default) */
+ int (*fopt)(struct soap*); /* HTTP OPTIONS hook (not set by default) */
+ int (*fhead)(struct soap*); /* HTTP HEAD hook (not set by default) */
+ int (*fform)(struct soap*); /* HTTP/HTML form handler for plugins */
int (*fposthdr)(struct soap*, const char*, const char*);
int (*fresponse)(struct soap*, int, size_t);
int (*fparse)(struct soap*);
@@ -2008,6 +2560,8 @@ struct SOAP_STD_API soap
void *(*fplugin)(struct soap*, const char*);
void *(*fmalloc)(struct soap*, size_t);
#ifndef WITH_LEANER
+ int (*fsvalidate)(struct soap*, const char*, const char*);
+ int (*fwvalidate)(struct soap*, const char*, const wchar_t*);
int (*feltbegin)(struct soap*, const char*);
int (*feltendin)(struct soap*, const char*, const char*);
int (*feltbegout)(struct soap*, const char*);
@@ -2018,7 +2572,7 @@ struct SOAP_STD_API soap
int (*fpreparerecv)(struct soap*, const char*, size_t);
int (*fpreparefinalsend)(struct soap*);
int (*fpreparefinalrecv)(struct soap*);
- int filterstop;
+ int recverror; /* last soap_recv_raw error code for filterrecv */
int (*ffiltersend)(struct soap*, const char**, size_t*);
int (*ffilterrecv)(struct soap*, char*, size_t*, size_t);
void *(*fdimereadopen)(struct soap*, void*, const char*, const char*, const char*);
@@ -2034,38 +2588,38 @@ struct SOAP_STD_API soap
size_t (*fmimeread)(struct soap*, void*, char*, size_t);
int (*fmimewrite)(struct soap*, void*, const char*, size_t);
#endif
- SOAP_SOCKET master; /* socket bound to TCP/IP port */
- SOAP_SOCKET socket; /* socket to send and receive */
- SOAP_SOCKET sendsk; /* socket to send (overrides ::socket) */
- SOAP_SOCKET recvsk; /* socket to receive (overrides ::socket) */
-#if defined(__cplusplus) && !defined(WITH_LEAN) && !defined(WITH_COMPAT)
- std::ostream *os; /* stream to send */
- std::istream *is; /* stream to receive */
+ SOAP_SOCKET master; /* socket bound to TCP/IP port */
+ SOAP_SOCKET socket; /* socket to send and receive */
+ SOAP_SOCKET sendsk; /* socket to send (overrides ::socket) */
+ SOAP_SOCKET recvsk; /* socket to receive (overrides ::socket) */
+#if defined(__cplusplus) && !defined(WITH_COMPAT)
+ std::ostream *os; /* C++ only: ostream to send */
+ std::istream *is; /* C++ only: istream to receive */
#else
- void *os; /* preserve struct size */
- void *is; /* preserve struct size */
+ const char **os; /* C only: pointer to a const char*, will be set to point to the string output */
+ const char *is; /* C only: a const char* to read from (soap->is will advance) */
#endif
#ifndef UNDER_CE
- int sendfd; /* WinCE FD to send */
- int recvfd; /* WinCE FD to receive */
+ int sendfd; /* int file descriptor for sending */
+ int recvfd; /* int file descriptor for receiving */
#else
- FILE *sendfd; /* FD to send */
- FILE *recvfd; /* FD to receive */
-#endif
- size_t bufidx; /* index in soap.buf[] */
- size_t buflen; /* length of soap.buf[] content */
- soap_wchar ahead; /* parser lookahead */
- short cdata; /* CDATA parser state */
- short body; /* HTTP or XML element has a body (1) or not (0) */
- unsigned int level; /* XML nesting level */
- size_t count; /* message length counter */
- size_t length; /* message length as set by HTTP header */
- char *labbuf; /* look-aside buffer */
- size_t lablen; /* look-aside buffer allocated length */
- size_t labidx; /* look-aside buffer index to available part */
+ FILE *sendfd; /* WinCE FILE* to send */
+ FILE *recvfd; /* WinCE FILE* to receive */
+#endif
+ size_t bufidx; /* index in soap.buf[] */
+ size_t buflen; /* length of soap.buf[] content */
+ soap_wchar ahead; /* parser lookahead */
+ short cdata; /* CDATA parser state */
+ short body; /* HTTP or XML element has a body (1) or not (0) */
+ unsigned int level; /* XML nesting level */
+ size_t count; /* message length counter */
+ size_t length; /* message length as set by HTTP header */
+ char *labbuf; /* look-aside buffer */
+ size_t lablen; /* look-aside buffer allocated length */
+ size_t labidx; /* look-aside buffer index to available part */
char buf[SOAP_BUFLEN];/* send and receive buffer */
- char msgbuf[1024]; /* in/out buffer for HTTP/MIME headers >=1024 bytes */
- char tmpbuf[1024]; /* in/out buffer for HTTP/MIME headers, simpleType values, element and attribute tag names, and DIME must be >=1024 bytes */
+ char msgbuf[SOAP_TMPLEN]; /* in/out buffer for HTTP/MIME headers and short messages, must be >=1024 bytes */
+ char tmpbuf[SOAP_TMPLEN]; /* in/out buffer for HTTP/MIME headers, simpleType values, element and attribute tag names, and DIME must be >=1024 bytes */
char tag[SOAP_TAGLEN];
char id[SOAP_TAGLEN];
char href[SOAP_TAGLEN];
@@ -2077,38 +2631,38 @@ struct SOAP_STD_API soap
short root;
int position;
int positions[SOAP_MAXDIMS];
- struct soap_attribute *attributes; /* attribute list */
- short encoding; /* when set, output encodingStyle */
- short mustUnderstand; /* a mustUnderstand element was parsed or is output */
- short null; /* parsed XML is xsi:nil */
- short ns; /* when not set, output full xmlns bindings */
- short part; /* SOAP part state (header or body) */
- short event; /* engine events and states for use by plugins */
- unsigned int evlev; /* event level */
- short alloced;
+ struct soap_attribute *attributes; /* attribute list */
+ short encoding; /* when set, output encodingStyle */
+ short mustUnderstand; /* a mustUnderstand element was parsed or is output */
+ short null; /* parsed XML is xsi:nil */
+ short ns; /* zero to output all xmlns */
+ short part; /* SOAP part state (header or body) */
+ short event; /* engine events and states for use by plugins */
short peeked;
+ unsigned int evlev; /* event level */
+ int alloced;
size_t chunksize;
size_t chunkbuflen;
char endpoint[SOAP_TAGLEN];
char path[SOAP_TAGLEN];
char host[SOAP_TAGLEN];
char *action;
- char *prolog; /* XML declaration prolog */
- unsigned long ip; /* IP number */
- int port; /* port number */
- short keep_alive; /* connection should be kept open */
- short tcp_keep_alive; /* enable SO_KEEPALIVE */
- unsigned int tcp_keep_idle; /* set TCP_KEEPIDLE */
- unsigned int tcp_keep_intvl; /* set TCP_KEEPINTVL */
- unsigned int tcp_keep_cnt; /* set TCP_KEEPCNT */
+ const char *prolog; /* XML declaration prolog */
+ unsigned long ip; /* IP number */
+ int port; /* port number */
+ short keep_alive; /* connection should be kept open */
+ short tcp_keep_alive; /* enable SO_KEEPALIVE */
+ unsigned int tcp_keep_idle; /* set TCP_KEEPIDLE */
+ unsigned int tcp_keep_intvl; /* set TCP_KEEPINTVL */
+ unsigned int tcp_keep_cnt; /* set TCP_KEEPCNT */
unsigned int max_keep_alive; /* maximum keep-alive session (default=100) */
const char *proxy_http_version;/* HTTP version of proxy "1.0" or "1.1" */
- const char *proxy_host; /* Proxy Server host name */
- int proxy_port; /* Proxy Server port (default = 8080) */
- const char *proxy_userid; /* Proxy Authorization user name */
- const char *proxy_passwd; /* Proxy Authorization password */
- const char *proxy_from; /* X-Forwarding-For header returned by proxy */
- int status; /* -1 when request, else error code to be returned by server */
+ const char *proxy_host; /* Proxy Server host name */
+ int proxy_port; /* Proxy Server port (default = 8080) */
+ const char *proxy_userid; /* Proxy Authorization user name */
+ const char *proxy_passwd; /* Proxy Authorization password */
+ const char *proxy_from; /* X-Forwarding-For header returned by proxy */
+ int status; /* -1 when request, else error code to be returned by server */
int error;
int errmode;
int errnum;
@@ -2124,8 +2678,9 @@ struct SOAP_STD_API soap
struct soap_mlist *mht[SOAP_PTRHASH];
#endif
#ifndef WITH_LEAN
- const char *wsuid; /* space-separated string of element tags */
- const char *c14nexclude; /* space-separated string of prefixes */
+ const char *wsuid; /* space-separated string of element tags */
+ const char *c14nexclude; /* space-separated string of prefixes for c14n exclusion */
+ const char *c14ninclude; /* space-separated string of prefixes for c14n inclusion */
struct soap_cookie *cookies;
const char *cookie_domain;
const char *cookie_path;
@@ -2135,14 +2690,14 @@ struct SOAP_STD_API soap
unsigned int ipv6_multicast_if; /* in_addr_t in6addr->sin6_scope_id IPv6 value */
char* ipv4_multicast_if; /* IP_MULTICAST_IF IPv4 setsockopt interface_addr */
unsigned char ipv4_multicast_ttl; /* IP_MULTICAST_TTL value 0..255 */
-#ifdef WITH_IPV6
- struct sockaddr_storage peer; /* IPv6: set by soap_accept and by UDP recv */
-#else
- struct sockaddr_in peer; /* IPv4: set by soap_connect/soap_accept and by UDP recv */
-#endif
+ union
+ { struct sockaddr addr;
+ struct sockaddr_in in;
+ struct sockaddr_storage storage;
+ } peer; /* set by soap_connect/soap_accept and by UDP recv */
#endif
size_t peerlen;
-#if defined(WITH_OPENSSL) /* OpenSSL */
+#if defined(WITH_OPENSSL) /* OpenSSL */
int (*fsslauth)(struct soap*);
int (*fsslverify)(int, X509_STORE_CTX*);
BIO *bio;
@@ -2151,17 +2706,26 @@ struct SOAP_STD_API soap
SSL_SESSION *session;
const char *dhfile;
const char *randfile;
-#elif defined(WITH_GNUTLS) /* GNUTLS */
+#elif defined(WITH_GNUTLS) /* GNUTLS */
int (*fsslauth)(struct soap*);
void *fsslverify;
- gnutls_certificate_credentials_t xcred; /* cert pointer */
- gnutls_anon_client_credentials_t acred; /* anon pointer */
- gnutls_priority_t cache; /* priority cache pointer */
- gnutls_session_t session; /* session pointer */
+ gnutls_certificate_credentials_t xcred; /* cert pointer */
+ gnutls_anon_client_credentials_t acred; /* anon pointer */
+ gnutls_priority_t cache; /* priority cache pointer */
+ gnutls_session_t session; /* session pointer */
gnutls_dh_params_t dh_params;
gnutls_rsa_params_t rsa_params;
-#else /* No SSL/TLS */
- void *fsslauth; /* dummy members, to preserve struct size */
+#elif defined(WITH_SYSTEMSSL) /* SYSTEM SSL */
+ int (*fsslauth)(struct soap*);
+ void *fsslverify; /* N/A */
+ void *bio; /* N/A */
+ gsk_handle ctx; /* environment */
+ gsk_handle ssl; /* ssl socket */
+ void *session; /* N/A */
+ const char *dhfile; /* N/A */
+ const char *randfile; /* N/A */
+#else /* No SSL/TLS */
+ void *fsslauth; /* dummy members, to preserve struct size */
void *fsslverify;
void *bio;
void *ssl;
@@ -2181,31 +2745,31 @@ struct SOAP_STD_API soap
int session_port;
#ifdef WITH_C_LOCALE
# ifdef WIN32
- _locale_t c_locale; /* set to C locale by default */
+ _locale_t c_locale; /* set to C locale by default */
# else
- locale_t c_locale; /* set to C locale by default */
+ locale_t c_locale; /* set to C locale by default */
# endif
#else
void *c_locale;
#endif
#ifdef WITH_ZLIB
- z_stream *d_stream; /* decompression stream */
- uLong z_crc; /* internal gzip crc */
+ z_stream *d_stream; /* decompression stream */
+ uLong z_crc; /* internal gzip crc */
#else
- void *d_stream; /* dummy members, to preserve struct size */
+ void *d_stream; /* dummy members, to preserve struct size */
soap_int32 z_crc;
#endif
- const char *z_dict; /* support for zlib static dictionaries */
+ const char *z_dict; /* support for zlib static dictionaries */
unsigned int z_dict_len;
- short zlib_state; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_INFLATE */
- short zlib_in; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_GZIP */
- short zlib_out; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_GZIP */
- char *z_buf; /* buffer */
+ short zlib_state; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_INFLATE */
+ short zlib_in; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_GZIP */
+ short zlib_out; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_GZIP */
+ char *z_buf; /* buffer */
size_t z_buflen;
- unsigned short z_level; /* compression level to be used (0=none, 1=fast to 9=best) */
- float z_ratio_in; /* detected compression ratio compressed_length/length of inbound message */
- float z_ratio_out; /* detected compression ratio compressed_length/length of outbound message */
-#ifdef WMW_RPM_IO /* VxWorks */
+ unsigned short z_level; /* compression level to be used (0=none, 1=fast to 9=best) */
+ float z_ratio_in; /* detected compression ratio compressed_length/length of inbound message */
+ float z_ratio_out; /* detected compression ratio compressed_length/length of outbound message */
+#ifdef WMW_RPM_IO /* VxWorks */
void *rpmreqid;
#endif
#ifdef __cplusplus
@@ -2213,14 +2777,13 @@ struct SOAP_STD_API soap
soap(soap_mode);
soap(soap_mode, soap_mode);
soap(const struct soap&);
- virtual ~soap();
-#else
- void (*dummy)(void);
+ struct soap& operator=(const struct soap&);
+ ~soap(); /* no virtual methods, so sizeof(soap) should be the same in C and C++ */
#endif
};
struct soap_code_map
-{ long code;
+{ LONG64 code;
const char *string;
};
@@ -2230,8 +2793,8 @@ struct soap_flist
int type;
void *ptr;
unsigned int level;
- size_t len;
- void (*fcopy)(struct soap*, int, int, void*, size_t, const void*, size_t);
+ size_t index;
+ void (*finsert)(struct soap*, int, int, void*, size_t, const void*, void**);
};
/* id-ref forwarding list */
@@ -2239,11 +2802,13 @@ struct soap_ilist
{ struct soap_ilist *next;
int type;
size_t size;
+ void *ptr;
+ void **spine;
void *link;
void *copy;
struct soap_flist *flist;
- void *ptr;
- unsigned int level;
+ void *smart;
+ short shaky;
char id[1]; /* the actual id string value flows into the allocated region below this struct */
};
@@ -2265,10 +2830,7 @@ soap_wchar soap_get0(struct soap*);
soap_wchar soap_get1(struct soap*);
#endif
-#define SOAP_XSTRINGIFY(s) SOAP_STRINGIFY(s)
-#define SOAP_STRINGIFY(s) #s
-
-#define soap_versioning_paste(name, ext) name##_LIBRARY_VERSION_REQUIRED_##ext
+#define soap_versioning_paste(name, ext) name##_REQUIRE_lib_v##ext
#define soap_versioning_ext(name, ext) soap_versioning_paste(name, ext)
#define soap_versioning(name) soap_versioning_ext(name, GSOAP_VERSION)
@@ -2282,6 +2844,7 @@ soap_wchar soap_get1(struct soap*);
#define soap_revget1(soap) ((soap)->bufidx--)
#define soap_unget(soap, c) ((soap)->ahead = c)
+#define soap_peek(soap) ((soap)->ahead = soap_get(soap))
#define soap_register_plugin(soap, plugin) soap_register_plugin_arg(soap, plugin, NULL)
#define soap_mode(soap, n) ((soap)->mode = (soap)->imode = (soap)->omode = (n))
#define soap_imode(soap, n) ((soap)->imode = (n))
@@ -2290,10 +2853,12 @@ soap_wchar soap_get1(struct soap*);
#define soap_clr_imode(soap, n) ((soap)->imode &= ~(n))
#define soap_set_omode(soap, n) ((soap)->omode |= (n))
#define soap_clr_omode(soap, n) ((soap)->omode &= ~(n))
-#define soap_set_mode(soap, n) ((soap)->imode |= (n), (soap)->omode |= (n))
-#define soap_clr_mode(soap, n) ((soap)->imode &= ~(n), (soap)->omode &= ~(n))
+#define soap_set_mode(soap, n) ((soap)->mode |= (n), (soap)->imode |= (n), (soap)->omode |= (n))
+#define soap_clr_mode(soap, n) ((soap)->mode &= ~(n), (soap)->imode &= ~(n), (soap)->omode &= ~(n))
#define soap_destroy(soap) soap_delete((soap), NULL)
+#define SOAP_NO_LINK_TO_DELETE (-2) /* pass to soap_link() as size n: do not manage, smart pointers are self-managing */
+
#ifdef HAVE_STRRCHR
# define soap_strrchr(s, t) strrchr(s, t)
#else
@@ -2303,24 +2868,24 @@ soap_wchar soap_get1(struct soap*);
#ifdef HAVE_STRTOL
# define soap_strtol(s, t, b) strtol(s, t, b)
#else
- SOAP_FMAC1 long SOAP_FMAC2 soap_strtol(const char *s, char **t, int b);
+ SOAP_FMAC1 long SOAP_FMAC2 soap_strtol(const char*, char**, int);
#endif
#ifdef HAVE_STRTOUL
# define soap_strtoul(s, t, b) strtoul(s, t, b)
#else
- SOAP_FMAC1 unsigned long SOAP_FMAC2 soap_strtoul(const char *s, char **t, int b);
+ SOAP_FMAC1 unsigned long SOAP_FMAC2 soap_strtoul(const char*, char**, int);
#endif
-#if defined(WIN32) && !defined(__MINGW32__)
+#if defined(WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__)
# define soap_strtoll _strtoi64
-#else
+#elif !defined(soap_strtoll)
# define soap_strtoll strtoll
#endif
-#if defined(WIN32) && !defined(__MINGW32__)
+#if defined(WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__)
# define soap_strtoull _strtoui64
-#else
+#elif !defined(soap_strtoull)
# define soap_strtoull strtoull
#endif
@@ -2334,19 +2899,22 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_rand(void);
#endif
#ifdef WITH_NOIDREF
-# define soap_embedded(s, p, t) (0)
-# define soap_id_lookup(s, i, p, t, n, k) (p)
-# define soap_id_forward(s, h, p, len, st, tt, n, k, fc) (p)
-# define soap_reference(s, a, t) (1)
-# define soap_array_reference(s, p, a, n, t) (1)
-# define soap_embed(s, p, a, n, t, pp) (0)
-# define soap_embedded_id(s, i, p, t) (i)
-# define soap_is_embedded(s, p) (0)
-# define soap_is_single(s, p) (1)
-# define soap_lookup_type(s, i) (0)
-# define soap_getindependent(s) (0)
-# define soap_putindependent(s) (0)
-# define soap_markelement(s, p, n) (0)
+# define soap_embedded(s, p, t) ((void)(s), 0)
+# define soap_id_lookup(s, i, p, t, n, k, fb) ((void)(s), (p))
+# define soap_id_forward(s, h, p, i, t, tt, n, k, fi, fb) ((void)(s), (p))
+# define soap_id_nullify(s, i) ((void)(s), (i))
+# define soap_reference(s, a, t) ((void)(s), 1)
+# define soap_array_reference(s, p, a, n, t) ((void)(s), 1)
+# define soap_embed(s, p, a, n, t) ((void)(s), 0)
+# define soap_embedded_id(s, i, p, t) ((void)(s), (void)(t), i)
+# define soap_is_embedded(s, p) ((void)(s), 0)
+# define soap_is_single(s, p) ((void)(s), 1)
+# define soap_lookup_type(s, i) ((void)(s), 0)
+# define soap_getindependent(s) ((void)(s), 0)
+# define soap_putindependent(s) ((void)(s), 0)
+# define soap_markelement(s, p, t) ((void)(s), 0)
+# define soap_begin_shaky(s) ((void)(s), 0)
+# define soap_end_shaky(s, f) ((void)(s), (void)(f), 0)
#endif
/* soap_traverse() traversal/walker routines take walker function arguments */
@@ -2372,6 +2940,7 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_getfault(struct soap*);
SOAP_FMAC1 int SOAP_FMAC2 soap_putfault(struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_ssl_init(void);
+SOAP_FMAC1 void SOAP_FMAC2 soap_ssl_noinit(void);
SOAP_FMAC1 int SOAP_FMAC2 soap_poll(struct soap*);
SOAP_FMAC1 int SOAP_FMAC2 soap_connect_command(struct soap*, int, const char*, const char*);
SOAP_FMAC1 int SOAP_FMAC2 soap_connect(struct soap*, const char*, const char*);
@@ -2379,6 +2948,7 @@ SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_bind(struct soap*, const char*, int, int)
SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_accept(struct soap*);
SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_accept(struct soap*);
SOAP_FMAC1 const char * SOAP_FMAC2 soap_ssl_error(struct soap*, int);
+SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_crl(struct soap*, const char*);
#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE)
SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *keyid, const char *password, const char *cafile, const char *capath, const char *dhfile, const char *randfile, const char *sid);
@@ -2421,6 +2991,7 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_send3(struct soap*, const char*, const char*, con
SOAP_FMAC1 int SOAP_FMAC2 soap_pututf8(struct soap*, unsigned long);
SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getutf8(struct soap*);
+SOAP_FMAC1 size_t SOAP_FMAC2 soap_utf8len(const char*);
SOAP_FMAC1 int SOAP_FMAC2 soap_putbase64(struct soap*, const unsigned char*, int);
SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_getbase64(struct soap*, int*, int);
@@ -2429,26 +3000,31 @@ SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_gethex(struct soap*, int*);
#ifndef WITH_LEANER
SOAP_FMAC1 int SOAP_FMAC2 soap_xop_forward(struct soap*, unsigned char**, int*, char**, char**, char**);
-SOAP_FMAC1 int SOAP_FMAC2 soap_dime_forward(struct soap*, unsigned char**, int*, char**, char**, char**);
+SOAP_FMAC1 int SOAP_FMAC2 soap_attachment_forward(struct soap*, unsigned char**, int*, char**, char**, char**);
#endif
+SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_lookup(struct soap*, const void *p, int t, struct soap_plist**);
+SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_enter(struct soap*, const void *p, const void *a, int n, int t, struct soap_plist**);
+SOAP_FMAC1 int SOAP_FMAC2 soap_array_pointer_lookup(struct soap*, const void *p, const void *a, int n, int t, struct soap_plist**);
#ifndef WITH_NOIDREF
SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_lookup_id(struct soap*, void *p, int t, struct soap_plist**);
-SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_lookup(struct soap*, const void *p, int t, struct soap_plist**);
-SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_enter(struct soap*, const void *p, const struct soap_array *a, int n, int t, struct soap_plist**);
-SOAP_FMAC1 int SOAP_FMAC2 soap_array_pointer_lookup(struct soap*, const void *p, const struct soap_array *a, int n, int t, struct soap_plist**);
-SOAP_FMAC1 int SOAP_FMAC2 soap_embed(struct soap *soap, const void *p, const struct soap_array *a, int n, const char *tag, int type);
+SOAP_FMAC1 int SOAP_FMAC2 soap_embed(struct soap *soap, const void *p, const void *a, int n, int type);
SOAP_FMAC1 struct soap_ilist* SOAP_FMAC2 soap_lookup(struct soap*, const char*);
-SOAP_FMAC1 struct soap_ilist* SOAP_FMAC2 soap_enter(struct soap*, const char*);
+SOAP_FMAC1 struct soap_ilist* SOAP_FMAC2 soap_enter(struct soap*, const char*, int, size_t);
SOAP_FMAC1 int SOAP_FMAC2 soap_resolve(struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_embedded(struct soap*, const void *p, int t);
SOAP_FMAC1 int SOAP_FMAC2 soap_reference(struct soap*, const void *p, int t);
-SOAP_FMAC1 int SOAP_FMAC2 soap_array_reference(struct soap*, const void *p, const struct soap_array *a, int n, int t);
+SOAP_FMAC1 int SOAP_FMAC2 soap_array_reference(struct soap*, const void *p, const void *a, int n, int t);
SOAP_FMAC1 int SOAP_FMAC2 soap_embedded_id(struct soap*, int id, const void *p, int t);
SOAP_FMAC1 int SOAP_FMAC2 soap_is_embedded(struct soap*, struct soap_plist*);
SOAP_FMAC1 int SOAP_FMAC2 soap_is_single(struct soap*, struct soap_plist*);
SOAP_FMAC1 void SOAP_FMAC2 soap_set_embedded(struct soap*, struct soap_plist*);
#endif
+SOAP_FMAC1 int SOAP_FMAC2 soap_check_and_mark(struct soap *soap, const void *p, int t, char **mark);
+SOAP_FMAC1 void * SOAP_FMAC2 soap_mark_lookup(struct soap *soap, const void *p, int t, struct soap_plist **pp, char **mark);
+SOAP_FMAC1 int SOAP_FMAC2 soap_mark_cycle(struct soap *soap, struct soap_plist *pp);
+SOAP_FMAC1 void SOAP_FMAC2 soap_mark_dup(struct soap *soap, void *a, struct soap_plist *pp);
+SOAP_FMAC1 void SOAP_FMAC2 soap_unmark(struct soap *soap, char *mark);
SOAP_FMAC1 int SOAP_FMAC2 soap_begin_count(struct soap*);
SOAP_FMAC1 int SOAP_FMAC2 soap_end_count(struct soap*);
@@ -2457,9 +3033,9 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_end_send(struct soap*);
SOAP_FMAC1 int SOAP_FMAC2 soap_end_send_flush(struct soap*);
SOAP_FMAC1 const struct soap_code_map* SOAP_FMAC2 soap_code(const struct soap_code_map*, const char*);
-SOAP_FMAC1 long SOAP_FMAC2 soap_code_int(const struct soap_code_map*, const char*, long);
+SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_code_int(const struct soap_code_map*, const char*, LONG64);
SOAP_FMAC1 const char* SOAP_FMAC2 soap_code_str(const struct soap_code_map*, long);
-SOAP_FMAC1 long SOAP_FMAC2 soap_code_bits(const struct soap_code_map*, const char*);
+SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_code_bits(const struct soap_code_map*, const char*);
SOAP_FMAC1 const char* SOAP_FMAC2 soap_code_list(struct soap*, const struct soap_code_map*, long);
SOAP_FMAC1 int SOAP_FMAC2 soap_getline(struct soap*, char*, int);
@@ -2479,22 +3055,22 @@ SOAP_FMAC1 void SOAP_FMAC2 soap_track_free(struct soap*, const char*, int, void*
#ifndef WITH_NOIDREF
SOAP_FMAC1 int SOAP_FMAC2 soap_lookup_type(struct soap*, const char *id);
-SOAP_FMAC1 void* SOAP_FMAC2 soap_id_lookup(struct soap*, const char *id, void **p, int t, size_t n, unsigned int k);
-SOAP_FMAC1 void* SOAP_FMAC2 soap_id_forward(struct soap*, const char *id, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap*, int, int, void*, size_t, const void*, size_t));
+SOAP_FMAC1 short SOAP_FMAC2 soap_begin_shaky(struct soap*);
+SOAP_FMAC1 void SOAP_FMAC2 soap_end_shaky(struct soap*, short);
+SOAP_FMAC1 void* SOAP_FMAC2 soap_id_lookup(struct soap*, const char *id, void **p, int t, size_t n, unsigned int k, int (*fbase)(int, int));
+SOAP_FMAC1 void* SOAP_FMAC2 soap_id_forward(struct soap*, const char *id, void *p, size_t i, int t, int tt, size_t n, unsigned int k, void(*finsert)(struct soap*, int, int, void*, size_t, const void*, void**), int (*fbase)(int, int));
+SOAP_FMAC1 int SOAP_FMAC2 soap_id_nullify(struct soap*, const char*);
#endif
-SOAP_FMAC1 void* SOAP_FMAC2 soap_id_enter(struct soap*, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap*, int, const char*, const char*, size_t*));
-SOAP_FMAC1 void SOAP_FMAC2 soap_fcopy(struct soap *soap, int st, int tt, void *p, size_t, const void *q, size_t n);
+SOAP_FMAC1 void* SOAP_FMAC2 soap_id_enter(struct soap*, const char *id, void *p, int t, size_t n, const char *type, const char *arrayType, void *(*finstantiate)(struct soap*, int, const char*, const char*, size_t*), int (*fbase)(int, int));
+SOAP_FMAC1 void** SOAP_FMAC2 soap_id_smart(struct soap *soap, const char*, int, size_t);
-SOAP_FMAC1 int SOAP_FMAC2 soap_size(const int *, int);
+SOAP_FMAC1 size_t SOAP_FMAC2 soap_size(const int *, int);
+SOAP_FMAC1 size_t SOAP_FMAC2 soap_getsizes(const char *, int *, int);
SOAP_FMAC1 int SOAP_FMAC2 soap_getoffsets(const char *, const int *, int *, int);
-SOAP_FMAC1 int SOAP_FMAC2 soap_getsize(const char *, const char *, int *);
-SOAP_FMAC1 int SOAP_FMAC2 soap_getsizes(const char *, int *, int);
+
SOAP_FMAC1 int SOAP_FMAC2 soap_getposition(const char *, int *);
-SOAP_FMAC1 char* SOAP_FMAC2 soap_putsize(struct soap*, const char *, int);
SOAP_FMAC1 char* SOAP_FMAC2 soap_putsizesoffsets(struct soap*, const char *, const int *, const int *, int);
-SOAP_FMAC1 char* SOAP_FMAC2 soap_putsizes(struct soap*, const char *, const int *, int);
-SOAP_FMAC1 char* SOAP_FMAC2 soap_putoffset(struct soap*, int);
SOAP_FMAC1 char* SOAP_FMAC2 soap_putoffsets(struct soap*, const int *, int);
SOAP_FMAC1 int SOAP_FMAC2 soap_closesock(struct soap*);
@@ -2526,6 +3102,7 @@ SOAP_FMAC1 void SOAP_FMAC2 soap_open_logfile(struct soap*, int);
SOAP_FMAC1 const char* SOAP_FMAC2 soap_value(struct soap*);
SOAP_FMAC1 int SOAP_FMAC2 soap_match_tag(struct soap*, const char*, const char *);
+SOAP_FMAC1 int SOAP_FMAC2 soap_match_att(struct soap*, const char*, const char *);
SOAP_FMAC1 int SOAP_FMAC2 soap_match_array(struct soap*, const char*);
SOAP_FMAC1 int SOAP_FMAC2 soap_element(struct soap*, const char*, int, const char*);
@@ -2535,7 +3112,7 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_element_ref(struct soap*, const char *tag, int id
SOAP_FMAC1 int SOAP_FMAC2 soap_element_href(struct soap*, const char *tag, int id, const char *ref, const char *val);
SOAP_FMAC1 int SOAP_FMAC2 soap_element_null(struct soap*, const char *tag, int id, const char *type);
SOAP_FMAC1 int SOAP_FMAC2 soap_element_nil(struct soap*, const char *tag);
-SOAP_FMAC1 int SOAP_FMAC2 soap_element_id(struct soap*, const char *tag, int id, const void *p, const struct soap_array *a, int d, const char *type, int n);
+SOAP_FMAC1 int SOAP_FMAC2 soap_element_id(struct soap*, const char *tag, int id, const void *p, const void *a, int n, const char *type, int t, char **mark);
SOAP_FMAC1 int SOAP_FMAC2 soap_element_result(struct soap*, const char *tag);
SOAP_FMAC1 void SOAP_FMAC2 soap_check_result(struct soap*, const char *tag);
SOAP_FMAC1 int SOAP_FMAC2 soap_element_end_out(struct soap*, const char *tag);
@@ -2551,28 +3128,34 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_peek_element(struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_retry(struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_revert(struct soap*);
+SOAP_FMAC1 int SOAP_FMAC2 soap_ignore(struct soap*);
+SOAP_FMAC1 void* SOAP_FMAC2 soap_memdup(struct soap*, const void*, size_t);
SOAP_FMAC1 char* SOAP_FMAC2 soap_strdup(struct soap*, const char*);
SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstrdup(struct soap*, const wchar_t*);
+SOAP_FMAC1 char* SOAP_FMAC2 soap_strtrim(struct soap*, char*);
+SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstrtrim(struct soap*, wchar_t*);
SOAP_FMAC1 const char * SOAP_FMAC2 soap_tagsearch(const char *big, const char *little);
SOAP_FMAC1 int SOAP_FMAC2 soap_string_out(struct soap*, const char *s, int flag);
-SOAP_FMAC1 char* SOAP_FMAC2 soap_string_in(struct soap*, int, long, long);
+SOAP_FMAC1 char* SOAP_FMAC2 soap_string_in(struct soap*, int, long, long, const char*);
#ifndef WITH_LEANER
SOAP_FMAC1 int SOAP_FMAC2 soap_wstring_out(struct soap*, const wchar_t *s, int flag);
-SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstring_in(struct soap*, int, long, long);
+SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstring_in(struct soap*, int, long, long, const char*);
#endif
SOAP_FMAC1 int SOAP_FMAC2 soap_match_namespace(struct soap*, const char *, const char*, size_t n1, size_t n2);
SOAP_FMAC1 void SOAP_FMAC2 soap_set_version(struct soap*, short);
+SOAP_FMAC1 void SOAP_FMAC2 soap_get_version(struct soap*);
SOAP_FMAC1 int SOAP_FMAC2 soap_set_namespaces(struct soap*, const struct Namespace*);
SOAP_FMAC1 void SOAP_FMAC2 soap_set_local_namespaces(struct soap*);
SOAP_FMAC1 void SOAP_FMAC2 soap_pop_namespace(struct soap*);
SOAP_FMAC1 struct soap_nlist* SOAP_FMAC2 soap_push_namespace(struct soap*, const char *,const char *);
-SOAP_FMAC1 const char* SOAP_FMAC2 soap_current_namespace(struct soap *soap, const char *tag);
+SOAP_FMAC1 const char* SOAP_FMAC2 soap_current_namespace_tag(struct soap *soap, const char *tag);
+SOAP_FMAC1 const char* SOAP_FMAC2 soap_current_namespace_att(struct soap *soap, const char *tag);
SOAP_FMAC1 struct soap_nlist* SOAP_FMAC2 soap_lookup_ns(struct soap *soap, const char *tag, size_t n);
@@ -2581,6 +3164,7 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_append_lab(struct soap*, const char*, size_t);
SOAP_FMAC1 struct soap_blist* SOAP_FMAC2 soap_new_block(struct soap*);
SOAP_FMAC1 void* SOAP_FMAC2 soap_push_block(struct soap*, struct soap_blist*, size_t);
+SOAP_FMAC1 void* SOAP_FMAC2 soap_push_block_max(struct soap*, struct soap_blist*, size_t);
SOAP_FMAC1 void SOAP_FMAC2 soap_pop_block(struct soap*, struct soap_blist*);
SOAP_FMAC1 size_t SOAP_FMAC2 soap_size_block(struct soap*, struct soap_blist*, size_t);
SOAP_FMAC1 char* SOAP_FMAC2 soap_first_block(struct soap*, struct soap_blist*);
@@ -2588,7 +3172,7 @@ SOAP_FMAC1 char* SOAP_FMAC2 soap_next_block(struct soap*, struct soap_blist*);
SOAP_FMAC1 size_t SOAP_FMAC2 soap_block_size(struct soap*, struct soap_blist*);
SOAP_FMAC1 char* SOAP_FMAC2 soap_save_block(struct soap*, struct soap_blist*, char*, int);
SOAP_FMAC1 void SOAP_FMAC2 soap_end_block(struct soap*, struct soap_blist*);
-SOAP_FMAC1 void SOAP_FMAC2 soap_update_pointers(struct soap *soap, char *start, char *end, char *p1, char *p2);
+SOAP_FMAC1 void SOAP_FMAC2 soap_update_pointers(struct soap *soap, const char *dst, const char *src, size_t len);
SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_begin_out(struct soap*);
SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_end_out(struct soap*);
@@ -2639,11 +3223,19 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedShort(struct soap*, const char*, unsign
SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedInt(struct soap*, const char*, unsigned int*);
SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedLong(struct soap*, const char*, unsigned long*);
SOAP_FMAC1 int SOAP_FMAC2 soap_s2ULONG64(struct soap*, const char*, ULONG64*);
-SOAP_FMAC1 int SOAP_FMAC2 soap_s2string(struct soap*, const char*, char**, long minlen, long maxlen);
-SOAP_FMAC1 int SOAP_FMAC2 soap_s2QName(struct soap*, const char*, char**, long minlen, long maxlen);
+SOAP_FMAC1 int SOAP_FMAC2 soap_s2char(struct soap*, const char*, char**, long minlen, long maxlen, const char *pattern);
+SOAP_FMAC1 int SOAP_FMAC2 soap_s2QName(struct soap*, const char*, char**, long minlen, long maxlen, const char *pattern);
-#ifndef WITH_LEAN
-SOAP_FMAC1 int SOAP_FMAC2 soap_s2wchar(struct soap*, const char*, wchar_t**, long minlen, long maxlen);
+#ifndef WITH_COMPAT
+#ifdef __cplusplus
+SOAP_FMAC1 int SOAP_FMAC2 soap_s2stdQName(struct soap*, const char*, std::string*, long minlen, long maxlen, const char *pattern);
+SOAP_FMAC1 int SOAP_FMAC2 soap_s2stdchar(struct soap*, const char*, std::string*, long minlen, long maxlen, const char *pattern);
+SOAP_FMAC1 int SOAP_FMAC2 soap_s2stdwchar(struct soap*, const char*, std::wstring*, long minlen, long maxlen, const char *pattern);
+#endif
+#endif
+
+#if !defined(WITH_LEAN) || defined(WITH_NTLM)
+SOAP_FMAC1 int SOAP_FMAC2 soap_s2wchar(struct soap*, const char*, wchar_t**, long minlen, long maxlen, const char *pattern);
SOAP_FMAC1 int SOAP_FMAC2 soap_s2dateTime(struct soap*, const char*, time_t*);
SOAP_FMAC1 char* SOAP_FMAC2 soap_s2base64(struct soap*, const unsigned char*, char*, int);
SOAP_FMAC1 char* SOAP_FMAC2 soap_s2hex(struct soap*, const unsigned char*, char*, int);
@@ -2663,7 +3255,7 @@ SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedLong2s(struct soap*, unsigned lon
SOAP_FMAC1 const char* SOAP_FMAC2 soap_ULONG642s(struct soap*, ULONG64);
SOAP_FMAC1 const char* SOAP_FMAC2 soap_QName2s(struct soap*, const char*);
-#ifndef WITH_LEAN
+#if !defined(WITH_LEAN) || defined(WITH_NTLM)
SOAP_FMAC1 const char* SOAP_FMAC2 soap_wchar2s(struct soap*, const wchar_t*);
SOAP_FMAC1 const char* SOAP_FMAC2 soap_dateTime2s(struct soap*, time_t);
SOAP_FMAC1 const char* SOAP_FMAC2 soap_base642s(struct soap*, const char*, char*, size_t, int*);
@@ -2683,7 +3275,7 @@ SOAP_FMAC1 unsigned short* SOAP_FMAC2 soap_inunsignedShort(struct soap*, const c
SOAP_FMAC1 unsigned int* SOAP_FMAC2 soap_inunsignedInt(struct soap*, const char *tag, unsigned int *p, const char *, int);
SOAP_FMAC1 unsigned long* SOAP_FMAC2 soap_inunsignedLong(struct soap*, const char *tag, unsigned long *p, const char *, int);
SOAP_FMAC1 ULONG64* SOAP_FMAC2 soap_inULONG64(struct soap*, const char *tag, ULONG64 *p, const char *, int);
-SOAP_FMAC1 char** SOAP_FMAC2 soap_instring(struct soap*, const char *tag, char **p, const char *, int, int, long, long);
+SOAP_FMAC1 char** SOAP_FMAC2 soap_instring(struct soap*, const char *tag, char **p, const char *, int, int, long, long, const char*);
SOAP_FMAC1 char** SOAP_FMAC2 soap_inliteral(struct soap*, const char *tag, char **p);
#ifndef WITH_LEAN
@@ -2692,7 +3284,7 @@ SOAP_FMAC1 time_t SOAP_FMAC2 soap_timegm(struct tm*);
#endif
#ifndef WITH_LEANER
-SOAP_FMAC1 wchar_t** SOAP_FMAC2 soap_inwstring(struct soap*, const char *tag, wchar_t **p, const char *, int, long, long);
+SOAP_FMAC1 wchar_t** SOAP_FMAC2 soap_inwstring(struct soap*, const char *tag, wchar_t **p, const char *, int, long, long, const char*);
SOAP_FMAC1 wchar_t** SOAP_FMAC2 soap_inwliteral(struct soap*, const char *tag, wchar_t **p);
#endif
@@ -2721,7 +3313,7 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_outwliteral(struct soap*, const char *tag, wchar_
#endif
#ifndef WITH_LEANER
-SOAP_FMAC1 int SOAP_FMAC2 soap_attachment(struct soap *, const char*, int, const void*, const struct soap_array*, const char*, const char*, const char*, int, const char*, int);
+SOAP_FMAC1 int SOAP_FMAC2 soap_attachment(struct soap *, const char*, int, const void*, const void*, int, const char*, const char*, const char*, const char*, int);
SOAP_FMAC1 int SOAP_FMAC2 soap_move(struct soap*, size_t);
SOAP_FMAC1 size_t SOAP_FMAC2 soap_tell(struct soap*);
SOAP_FMAC1 char* SOAP_FMAC2 soap_dime_option(struct soap*, unsigned short, const char*);
@@ -2752,7 +3344,8 @@ SOAP_FMAC1 const char* SOAP_FMAC2 soap_attr_value(struct soap *soap, const char
SOAP_FMAC1 int SOAP_FMAC2 soap_set_attr(struct soap *soap, const char *name, const char *value, int flag);
SOAP_FMAC1 void SOAP_FMAC2 soap_clr_attr(struct soap *soap);
-SOAP_FMAC1 const char* SOAP_FMAC2 soap_url(struct soap *soap, const char*, const char*);
+SOAP_FMAC1 const char* SOAP_FMAC2 soap_extend_url(struct soap *soap, const char*, const char*);
+SOAP_FMAC1 const char* SOAP_FMAC2 soap_extend_url_query(struct soap *soap, const char*, const char*);
SOAP_FMAC1 size_t SOAP_FMAC2 soap_encode_url(const char*, char*, size_t);
SOAP_FMAC1 const char* SOAP_FMAC2 soap_encode_url_string(struct soap*, const char*);
#ifdef WITH_COOKIES
@@ -2777,4 +3370,49 @@ SOAP_FMAC1 int SOAP_FMAC2 soap_putcookies(struct soap *soap, const char *domain,
} /* extern "C" */
#endif
+#ifdef __cplusplus
+
+/* C++ templates (for generated C++ only, not needed nor used in generated C code) */
+
+template<class T>
+struct soap_block
+{ static T *push(struct soap *soap, struct soap_blist *b)
+ { if (!b)
+ b = soap->blist;
+ if (!b)
+ return NULL;
+ T *p = (T*)soap_push_block_max(soap, b, sizeof(T));
+ if (p)
+ SOAP_PLACEMENT_NEW(p, T);
+ return p;
+ }
+ static void pop(struct soap *soap, struct soap_blist *b)
+ { if (!b)
+ b = soap->blist;
+ if (!b || !b->head)
+ return;
+ ((T*)(b->head + 1))->T::~T();
+ soap_pop_block(soap, b);
+ }
+ static void save(struct soap *soap, struct soap_blist *b, T *p)
+ { if (!b)
+ b = soap->blist;
+ for (T *q = (T*)soap_first_block(soap, b); q; q = (T*)soap_next_block(soap, b))
+ { soap_update_pointers(soap, (const char*)p, (const char*)q, sizeof(T));
+ *p++ = *q;
+ q->T::~T();
+ }
+ soap_end_block(soap, b);
+ }
+ static void end(struct soap *soap, struct soap_blist *b)
+ { if (!b)
+ b = soap->blist;
+ for (T *p = (T*)soap_first_block(soap, b); p; p = (T*)soap_next_block(soap, b))
+ p->T::~T();
+ soap_end_block(soap, b);
+ }
+};
+
+#endif
+
#endif /* STDSOAP_H */
diff --git a/dep/gsoap/tc_changes.diff b/dep/gsoap/tc_changes.diff
deleted file mode 100644
index e5c47c66b78..00000000000
--- a/dep/gsoap/tc_changes.diff
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -r 830b8f9ed332 dep/gsoap/stdsoap2.cpp
---- a/dep/gsoap/stdsoap2.cpp Tue Dec 21 10:07:43 2010 -0500
-+++ b/dep/gsoap/stdsoap2.cpp Tue Dec 21 10:07:55 2010 -0500
-@@ -15038,10 +15038,12 @@
- }
- s = soap->tmpbuf;
- }
-+/*
- else if (status == SOAP_OK && soap->action && strlen(soap->action) < sizeof(soap->tmpbuf) - 80)
- { sprintf(soap->tmpbuf, "%s; action=\"%s\"", s, soap->action);
- s = soap->tmpbuf;
- }
-+*/
- #endif
- if (s && (err = soap->fposthdr(soap, "Content-Type", s)))
- return err;
diff --git a/dep/gsoap/tc_upgrades.txt b/dep/gsoap/tc_upgrades.txt
index 04298b2ae82..cda096cd0f9 100644
--- a/dep/gsoap/tc_upgrades.txt
+++ b/dep/gsoap/tc_upgrades.txt
@@ -1,5 +1,5 @@
* Generate new headers based on TrinityCore soap-services stub:
-gsoap/bin/linux386/soapcpp2 -1 -S -L -w -x -y soap.stub
+gsoap/bin/linux386/soapcpp2 -1 -S -L -w -x -y -c++11 gsoap.stub
* Copy the following files from the gsoap package:
gsoap/stdsoap2.h
@@ -7,6 +7,5 @@ gsoap/stdsoap2.cpp
* Remove the following files after generation:
ns1.nsmap
-soapObject.h
* Test compile and see if SOAP works...
diff --git a/dep/jemalloc/CMakeLists.txt b/dep/jemalloc/CMakeLists.txt
index cf0ac435f0a..6774e5a75d2 100644
--- a/dep/jemalloc/CMakeLists.txt
+++ b/dep/jemalloc/CMakeLists.txt
@@ -8,54 +8,79 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# We need to generate the jemalloc_def.h header based on platform-specific settings
-if (PLATFORM EQUAL 32)
- set(JEM_SIZEDEF 2)
- set(JEM_TLSMODEL)
+if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT NOJEM)
+ # We need to generate the jemalloc_def.h header based on platform-specific settings
+ if (PLATFORM EQUAL 32)
+ set(JEM_SIZEDEF 2)
+ set(JEM_TLSMODEL)
+ else()
+ set(JEM_SIZEDEF 3)
+ set(JEM_TLSMODEL "__attribute__\(\(tls_model\(\"initial-exec\"\)\)\)")
+ endif()
+
+ # Create the header, so we can use it
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/dep/jemalloc/jemalloc_defs.h.in.cmake"
+ "${BUILDDIR}/jemalloc_defs.h"
+ @ONLY
+ )
+
+ # Done, let's continue
+ set(jemalloc_STAT_SRC
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/arena.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/atomic.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/base.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/bitmap.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/chunk.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/chunk_dss.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/chunk_mmap.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/ckh.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/ctl.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/extent.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/hash.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/huge.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/jemalloc.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/mb.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/mutex.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/prof.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/quarantine.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/rtree.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/stats.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/tcache.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/tsd.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/util.c
+ )
+
+ add_library(jemalloc STATIC ${jemalloc_STAT_SRC})
+
+ target_include_directories(jemalloc
+ PRIVATE
+ ${BUILDDIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+ target_compile_definitions(jemalloc
+ PUBLIC
+ -DNO_BUFFERPOOL
+ PRIVATE
+ -D_GNU_SOURCE
+ -D_REENTRAN)
+
+ target_link_libraries(jemalloc
+ PUBLIC
+ threads
+ valgrind)
+
+ set_target_properties(jemalloc
+ PROPERTIES
+ FOLDER
+ "dep")
+
else()
- set(JEM_SIZEDEF 3)
- set(JEM_TLSMODEL "__attribute__\(\(tls_model\(\"initial-exec\"\)\)\)")
-endif()
+ # Provide a dummy target for jemalloc which is used when jemalloc
+ # is disabled or not supported.
+ add_library(jemalloc INTERFACE)
+ target_link_libraries(jemalloc
+ INTERFACE
+ valgrind)
-# Create the header, so we can use it
-configure_file(
- "${CMAKE_SOURCE_DIR}/dep/jemalloc/jemalloc_defs.h.in.cmake"
- "${BUILDDIR}/jemalloc_defs.h"
- @ONLY
-)
-
-# Done, let's continue
-set(jemalloc_STAT_SRC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/arena.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/atomic.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/base.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/bitmap.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/chunk.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/chunk_dss.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/chunk_mmap.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/ckh.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/ctl.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/extent.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/hash.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/huge.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/jemalloc.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/mb.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/mutex.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/prof.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/quarantine.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/rtree.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/stats.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/tcache.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/tsd.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/util.c
-)
-
-include_directories(
- ${BUILDDIR}/
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${VALGRIND_INCLUDE_DIR}
-)
-
-add_definitions(-D_GNU_SOURCE -D_REENTRANT)
-
-add_library(jemalloc STATIC ${jemalloc_STAT_SRC})
+endif()
diff --git a/dep/libmpq/CMakeLists.txt b/dep/libmpq/CMakeLists.txt
index 1213e6b11b7..e8b420fca53 100644
--- a/dep/libmpq/CMakeLists.txt
+++ b/dep/libmpq/CMakeLists.txt
@@ -8,27 +8,29 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-file(GLOB sources_mpq libmpq/*.c libmpq/*.h)
+file(GLOB sources libmpq/*.c libmpq/*.h)
-set(mpq_STAT_SRCS
- ${sources_mpq}
-)
+add_library(mpq STATIC ${sources})
-if( UNIX )
- include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_SOURCE_DIR}/dep/zlib
- ${CMAKE_SOURCE_DIR}/dep/bzip2
- )
-elseif( WIN32 )
- include_directories(
+set_target_properties(mpq PROPERTIES LINKER_LANGUAGE CXX)
+
+if(WIN32)
+ set(WIN_EXTRA_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/win)
+endif()
+
+target_include_directories(mpq
+ PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/win
+ ${WIN_EXTRA_INCLUDE}
${CMAKE_SOURCE_DIR}/dep/zlib
- ${CMAKE_SOURCE_DIR}/dep/bzip2
- )
-endif()
+ ${CMAKE_SOURCE_DIR}/dep/bzip2)
-add_library(mpq STATIC ${mpq_STAT_SRCS})
+target_link_libraries(mpq
+ PUBLIC
+ zlib
+ bzip2)
-set_target_properties(mpq PROPERTIES LINKER_LANGUAGE CXX)
+set_target_properties(mpq
+ PROPERTIES
+ FOLDER
+ "dep")
diff --git a/dep/mysql/CMakeLists.txt b/dep/mysql/CMakeLists.txt
new file mode 100644
index 00000000000..472535b0356
--- /dev/null
+++ b/dep/mysql/CMakeLists.txt
@@ -0,0 +1,22 @@
+# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+if (NOT MYSQL_FOUND)
+ message(FATAL_ERROR "MySQL wasn't found on your system but it's required to build the servers!")
+endif()
+
+add_library(mysql STATIC IMPORTED GLOBAL)
+
+set_target_properties(mysql
+ PROPERTIES
+ IMPORTED_LOCATION
+ "${MYSQL_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES
+ "${MYSQL_INCLUDE_DIR}")
diff --git a/dep/openssl/CMakeLists.txt b/dep/openssl/CMakeLists.txt
new file mode 100644
index 00000000000..98561b2a0ed
--- /dev/null
+++ b/dep/openssl/CMakeLists.txt
@@ -0,0 +1,26 @@
+# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+# basic packagesearching and setup
+# (further support will be needed, this is a preliminary release!)
+set(OPENSSL_EXPECTED_VERSION 1.0.0)
+
+find_package(OpenSSL REQUIRED)
+
+add_library(openssl INTERFACE)
+
+target_link_libraries(openssl
+ INTERFACE
+ ${OPENSSL_LIBRARIES})
+
+target_include_directories(openssl
+ INTERFACE
+ ${OPENSSL_INCLUDE_DIR})
diff --git a/src/server/scripts/Commands/CMakeLists.txt b/dep/process/CMakeLists.txt
index d4d75cd175f..5a51917a00c 100644
--- a/src/server/scripts/Commands/CMakeLists.txt
+++ b/dep/process/CMakeLists.txt
@@ -8,11 +8,12 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-file(GLOB_RECURSE sources_Commands Commands/*.cpp Commands/*.h)
+add_library(process INTERFACE)
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- ${sources_Commands}
-)
+target_include_directories(process
+ INTERFACE
+ ${CMAKE_CURRENT_SOURCE_DIR})
-message(" -> Prepared: Commands")
+target_link_libraries(process
+ INTERFACE
+ boost)
diff --git a/dep/readline/CMakeLists.txt b/dep/readline/CMakeLists.txt
new file mode 100644
index 00000000000..0e8679ba718
--- /dev/null
+++ b/dep/readline/CMakeLists.txt
@@ -0,0 +1,38 @@
+# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+if( UNIX )
+ # find Readline (terminal input library) includes and library
+ #
+ # READLINE_INCLUDE_DIR - where the directory containing the READLINE headers can be found
+ # READLINE_LIBRARY - full path to the READLINE library
+ find_path(READLINE_INCLUDE_DIR readline/readline.h)
+ find_library(READLINE_LIBRARY NAMES readline)
+
+ message(STATUS "Found Readline library: ${READLINE_LIBRARY}")
+ message(STATUS "Include dir is: ${READLINE_INCLUDE_DIR}")
+
+ if (NOT READLINE_INCLUDE_DIR OR NOT READLINE_LIBRARY)
+ message(FATAL_ERROR "** Readline library not found!\n** Your distro may provide a binary for Readline e.g. for ubuntu try apt-get install libreadline5-dev")
+ endif ()
+
+ add_library(readline SHARED IMPORTED GLOBAL)
+
+ set_target_properties(readline
+ PROPERTIES
+ IMPORTED_LOCATION
+ "${READLINE_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES
+ "${READLINE_INCLUDE_DIR}")
+
+else()
+ # Provide a dummy target
+ add_library(readline INTERFACE)
+endif()
diff --git a/dep/recastnavigation/CMakeLists.txt b/dep/recastnavigation/CMakeLists.txt
index 4a406f7833c..dd28884eb1f 100644
--- a/dep/recastnavigation/CMakeLists.txt
+++ b/dep/recastnavigation/CMakeLists.txt
@@ -1,4 +1,4 @@
-#
+# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
# Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
#
# This program is free software; you can redistribute it and/or modify
diff --git a/dep/recastnavigation/Detour/CMakeLists.txt b/dep/recastnavigation/Detour/CMakeLists.txt
index b21e4ca6273..12be71d32b4 100644
--- a/dep/recastnavigation/Detour/CMakeLists.txt
+++ b/dep/recastnavigation/Detour/CMakeLists.txt
@@ -16,14 +16,18 @@ set(Detour_STAT_SRCS
Source/DetourNavMeshQuery.cpp
Source/DetourNode.cpp
)
-include_directories(Include)
-
-if(WIN32)
- include_directories(
- ${CMAKE_SOURCE_DIR}/dep/zlib
- )
-endif()
add_library(Detour STATIC ${Detour_STAT_SRCS})
-target_link_libraries(Detour ${ZLIB_LIBRARIES})
+target_include_directories(Detour
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/Include)
+
+target_link_libraries(Detour
+ PUBLIC
+ zlib)
+
+set_target_properties(Detour
+ PROPERTIES
+ FOLDER
+ "dep")
diff --git a/dep/recastnavigation/Recast/CMakeLists.txt b/dep/recastnavigation/Recast/CMakeLists.txt
index 738c010eb05..1eac4e75399 100644
--- a/dep/recastnavigation/Recast/CMakeLists.txt
+++ b/dep/recastnavigation/Recast/CMakeLists.txt
@@ -14,21 +14,24 @@ set(Recast_STAT_SRCS
Source/RecastArea.cpp
Source/RecastContour.cpp
Source/RecastFilter.cpp
- Source/RecastLayers.cpp
+ Source/RecastLayers.cpp
Source/RecastMesh.cpp
Source/RecastMeshDetail.cpp
Source/RecastRasterization.cpp
Source/RecastRegion.cpp
)
-include_directories(Include)
+add_library(Recast STATIC ${Recast_STAT_SRCS})
-if(WIN32)
- include_directories(
- ${CMAKE_SOURCE_DIR}/dep/zlib
- )
-endif()
+target_include_directories(Recast
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/Include)
-add_library(Recast STATIC ${Recast_STAT_SRCS})
+target_link_libraries(Recast
+ PUBLIC
+ zlib)
-target_link_libraries(Recast ${ZLIB_LIBRARIES}) \ No newline at end of file
+set_target_properties(Recast
+ PROPERTIES
+ FOLDER
+ "dep")
diff --git a/src/server/scripts/Events/CMakeLists.txt b/dep/threads/CMakeLists.txt
index 1c9e5cfe8e1..48e5eb00723 100644
--- a/src/server/scripts/Events/CMakeLists.txt
+++ b/dep/threads/CMakeLists.txt
@@ -8,11 +8,9 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-file(GLOB_RECURSE sources_Events Events/*.cpp Events/*.h)
+find_package(Threads REQUIRED)
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- ${sources_Events}
-)
-
-message(" -> Prepared: Events")
+add_library(threads INTERFACE)
+target_link_libraries(threads
+ INTERFACE
+ ${CMAKE_THREAD_LIBS_INIT})
diff --git a/src/server/scripts/Custom/CMakeLists.txt b/dep/utf8cpp/CMakeLists.txt
index 595ff801813..edf8604d44c 100644
--- a/src/server/scripts/Custom/CMakeLists.txt
+++ b/dep/utf8cpp/CMakeLists.txt
@@ -8,11 +8,8 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# file(GLOB_RECURSE sources_Custom Custom/*.cpp Custom/*.h)
+add_library(utf8cpp INTERFACE)
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
-# ${sources_Custom}
-)
-
-message(" -> Prepared: Custom")
+target_include_directories(utf8cpp
+ INTERFACE
+ ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/dep/valgrind/CMakeLists.txt b/dep/valgrind/CMakeLists.txt
new file mode 100644
index 00000000000..d67cd33b426
--- /dev/null
+++ b/dep/valgrind/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+add_library(valgrind INTERFACE)
+
+target_include_directories(valgrind
+ INTERFACE
+ "${VALGRIND_INCLUDE_DIR}")
diff --git a/dep/zlib/CMakeLists.txt b/dep/zlib/CMakeLists.txt
index 7feb134bcd5..b3e3d58fe55 100644
--- a/dep/zlib/CMakeLists.txt
+++ b/dep/zlib/CMakeLists.txt
@@ -8,22 +8,43 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-SET(zlib_STAT_SRCS
- adler32.c
- compress.c
- crc32.c
- deflate.c
- infback.c
- inffast.c
- inflate.c
- inftrees.c
- trees.c
- uncompr.c
- zutil.c
-)
+if(UNIX)
+ # Look for an installed zlib on unix
+ find_package(ZLIB REQUIRED)
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
-)
+ add_library(zlib SHARED IMPORTED GLOBAL)
-add_library(zlib STATIC ${zlib_STAT_SRCS})
+ set_target_properties(zlib
+ PROPERTIES
+ IMPORTED_LOCATION
+ "${ZLIB_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES
+ "${ZLIB_INCLUDE_DIRS}")
+else()
+ # Use the bundled source on windows
+ SET(zlib_STAT_SRCS
+ adler32.c
+ compress.c
+ crc32.c
+ deflate.c
+ infback.c
+ inffast.c
+ inflate.c
+ inftrees.c
+ trees.c
+ uncompr.c
+ zutil.c
+ )
+
+ add_library(zlib STATIC
+ ${zlib_STAT_SRCS})
+
+ target_include_directories(zlib
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR})
+
+ set_target_properties(zlib
+ PROPERTIES
+ FOLDER
+ "dep")
+endif()
diff --git a/issue_template.md b/issue_template.md
new file mode 100644
index 00000000000..1bcd91ae766
--- /dev/null
+++ b/issue_template.md
@@ -0,0 +1,23 @@
+**Description**:
+
+**Current behaviour**: Tell us what happens
+
+**Expected behaviour**: Tell us what should happen instead
+
+**Steps to reproduce the problem**:
+
+1.
+2.
+3.
+
+**Branch(es)**: 335/6x
+
+**TC hash/commit**:
+
+**TDB version**:
+
+**Operating system**:
+
+
+[//]: # (This template is for problem reports, for other type of reports edit it accordingly)
+[//]: # (If this is a crash report, include the crashlog with https://gist.github.com/)
diff --git a/pull_request_template.md b/pull_request_template.md
new file mode 100644
index 00000000000..f0066dc8f66
--- /dev/null
+++ b/pull_request_template.md
@@ -0,0 +1,16 @@
+**Changes proposed**:
+
+-
+-
+-
+
+**Target branch(es)**: 335/6x
+
+**Issues addressed**: Fixes #
+
+**Tests performed**: (Does it build, tested in-game, etc)
+
+**Known issues and TODO list**:
+
+- [ ]
+- [ ]
diff --git a/revision_data.h.in.cmake b/revision_data.h.in.cmake
index 64c754c700b..14faa04a0bc 100644
--- a/revision_data.h.in.cmake
+++ b/revision_data.h.in.cmake
@@ -3,15 +3,15 @@
#define _HASH "@rev_hash@"
#define _DATE "@rev_date@"
#define _BRANCH "@rev_branch@"
- #define _SOURCE_DIRECTORY "@CMAKE_SOURCE_DIR@"
- #define _MYSQL_EXECUTABLE "@MYSQL_EXECUTABLE@"
- #define _FULL_DATABASE "TDB_full_world_335.60_2015_11_07.sql"
+ #define _CMAKE_COMMAND R"(@CMAKE_COMMAND@)"
+ #define _SOURCE_DIRECTORY R"(@CMAKE_SOURCE_DIR@)"
+ #define _BUILD_DIRECTORY R"(@BUILDDIR@)"
+ #define _MYSQL_EXECUTABLE R"(@MYSQL_EXECUTABLE@)"
+ #define _FULL_DATABASE "TDB_full_world_335.61_2016_04_11.sql"
#define VER_COMPANYNAME_STR "TrinityCore Developers"
#define VER_LEGALCOPYRIGHT_STR "(c)2008-2016 TrinityCore"
#define VER_FILEVERSION 0,0,0
#define VER_FILEVERSION_STR "@rev_hash@ @rev_date@ (@rev_branch@ branch)"
#define VER_PRODUCTVERSION VER_FILEVERSION
#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR
- #define COMPILER_C_FLAGS "@CMAKE_C_FLAGS@"
- #define COMPILER_CXX_FLAGS "@CMAKE_CXX_FLAGS@"
#endif // __REVISION_DATA_H__
diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql
index 0ac0ffaf9d1..05d2acbe0e8 100644
--- a/sql/base/auth_database.sql
+++ b/sql/base/auth_database.sql
@@ -1,6 +1,6 @@
-- MySQL dump 10.13 Distrib 5.6.26, for Win64 (x86_64)
--
--- Host: localhost Database: auth335
+-- Host: localhost Database: auth
-- ------------------------------------------------------
-- Server version 5.6.26-log
@@ -375,7 +375,7 @@ CREATE TABLE `rbac_linked_permissions` (
LOCK TABLES `rbac_linked_permissions` WRITE;
/*!40000 ALTER TABLE `rbac_linked_permissions` DISABLE KEYS */;
-INSERT INTO `rbac_linked_permissions` VALUES (192,21),(192,42),(192,43),(192,193),(192,196),(192,778),(192,779),(192,780),(192,781),(192,782),(192,783),(192,784),(192,785),(192,786),(192,787),(192,788),(192,789),(192,790),(192,791),(192,792),(192,793),(192,794),(192,795),(192,796),(192,835),(193,48),(193,194),(193,197),(194,1),(194,2),(194,11),(194,13),(194,14),(194,15),(194,16),(194,17),(194,18),(194,19),(194,20),(194,22),(194,23),(194,25),(194,26),(194,27),(194,28),(194,29),(194,30),(194,31),(194,32),(194,33),(194,34),(194,35),(194,36),(194,37),(194,38),(194,39),(194,40),(194,41),(194,44),(194,46),(194,47),(194,51),(194,195),(194,198),(194,632),(194,798),(195,3),(195,4),(195,5),(195,6),(195,24),(195,49),(195,199),(196,200),(196,201),(196,226),(196,227),(196,230),(196,231),(196,233),(196,234),(196,235),(196,238),(196,239),(196,240),(196,241),(196,242),(196,243),(196,244),(196,245),(196,246),(196,247),(196,248),(196,249),(196,250),(196,251),(196,252),(196,253),(196,254),(196,255),(196,256),(196,257),(196,258),(196,259),(196,260),(196,261),(196,262),(196,264),(196,265),(196,266),(196,267),(196,268),(196,269),(196,270),(196,271),(196,272),(196,279),(196,280),(196,283),(196,287),(196,288),(196,289),(196,290),(196,291),(196,292),(196,293),(196,294),(196,295),(196,296),(196,297),(196,298),(196,299),(196,302),(196,303),(196,304),(196,305),(196,306),(196,307),(196,308),(196,309),(196,310),(196,313),(196,314),(196,319),(196,320),(196,321),(196,322),(196,323),(196,324),(196,325),(196,326),(196,327),(196,328),(196,329),(196,330),(196,331),(196,332),(196,333),(196,334),(196,335),(196,336),(196,337),(196,338),(196,339),(196,340),(196,341),(196,342),(196,343),(196,344),(196,345),(196,346),(196,347),(196,348),(196,349),(196,350),(196,351),(196,352),(196,353),(196,354),(196,355),(196,356),(196,357),(196,358),(196,359),(196,360),(196,361),(196,362),(196,363),(196,364),(196,365),(196,366),(196,373),(196,375),(196,400),(196,401),(196,402),(196,403),(196,404),(196,405),(196,406),(196,407),(196,417),(196,418),(196,419),(196,420),(196,421),(196,422),(196,423),(196,424),(196,425),(196,426),(196,427),(196,428),(196,429),(196,434),(196,435),(196,436),(196,437),(196,438),(196,439),(196,440),(196,441),(196,442),(196,443),(196,444),(196,445),(196,446),(196,447),(196,448),(196,449),(196,450),(196,451),(196,452),(196,453),(196,454),(196,455),(196,456),(196,457),(196,458),(196,459),(196,461),(196,463),(196,464),(196,465),(196,472),(196,473),(196,474),(196,475),(196,476),(196,477),(196,478),(196,488),(196,489),(196,491),(196,492),(196,493),(196,495),(196,497),(196,498),(196,499),(196,500),(196,502),(196,503),(196,505),(196,508),(196,511),(196,513),(196,514),(196,516),(196,519),(196,522),(196,523),(196,526),(196,527),(196,529),(196,530),(196,533),(196,535),(196,536),(196,537),(196,538),(196,539),(196,540),(196,541),(196,556),(196,581),(196,582),(196,592),(196,593),(196,596),(196,602),(196,603),(196,604),(196,605),(196,606),(196,607),(196,608),(196,609),(196,610),(196,611),(196,612),(196,613),(196,614),(196,615),(196,616),(196,617),(196,618),(196,619),(196,620),(196,621),(196,622),(196,623),(196,624),(196,625),(196,626),(196,627),(196,628),(196,629),(196,630),(196,631),(196,633),(196,634),(196,635),(196,636),(196,637),(196,638),(196,639),(196,640),(196,641),(196,642),(196,643),(196,644),(196,645),(196,646),(196,647),(196,648),(196,649),(196,650),(196,651),(196,652),(196,653),(196,654),(196,655),(196,656),(196,657),(196,658),(196,659),(196,660),(196,661),(196,662),(196,663),(196,664),(196,665),(196,666),(196,667),(196,668),(196,669),(196,670),(196,671),(196,672),(196,673),(196,674),(196,675),(196,676),(196,677),(196,678),(196,679),(196,680),(196,681),(196,682),(196,683),(196,684),(196,685),(196,686),(196,687),(196,688),(196,689),(196,690),(196,691),(196,692),(196,693),(196,694),(196,695),(196,696),(196,697),(196,698),(196,699),(196,700),(196,701),(196,702),(196,703),(196,704),(196,705),(196,706),(196,707),(196,708),(196,709),(196,710),(196,711),(196,712),(196,713),(196,714),(196,715),(196,716),(196,717),(196,718),(196,719),(196,721),(196,722),(196,723),(196,724),(196,725),(196,726),(196,727),(196,728),(196,729),(196,730),(196,733),(196,734),(196,735),(196,736),(196,738),(196,739),(196,748),(196,753),(196,757),(196,773),(196,777),(196,836),(197,232),(197,236),(197,237),(197,273),(197,274),(197,275),(197,276),(197,277),(197,284),(197,285),(197,286),(197,301),(197,311),(197,387),(197,388),(197,389),(197,390),(197,391),(197,392),(197,393),(197,394),(197,395),(197,396),(197,397),(197,398),(197,399),(197,479),(197,480),(197,481),(197,482),(197,485),(197,486),(197,487),(197,494),(197,506),(197,509),(197,510),(197,517),(197,518),(197,521),(197,542),(197,543),(197,550),(197,558),(197,568),(197,571),(197,572),(197,573),(197,574),(197,575),(197,576),(197,577),(197,578),(197,579),(197,580),(197,583),(197,584),(197,585),(197,586),(197,587),(197,588),(197,589),(197,590),(197,591),(197,594),(197,595),(197,601),(197,743),(197,750),(197,758),(197,761),(197,762),(197,763),(197,764),(197,765),(197,766),(197,767),(197,768),(197,769),(197,770),(197,771),(197,772),(197,774),(198,218),(198,300),(198,312),(198,315),(198,316),(198,317),(198,318),(198,367),(198,368),(198,369),(198,370),(198,371),(198,372),(198,374),(198,376),(198,377),(198,378),(198,379),(198,380),(198,381),(198,382),(198,383),(198,384),(198,385),(198,386),(198,408),(198,409),(198,410),(198,411),(198,412),(198,413),(198,414),(198,415),(198,416),(198,430),(198,431),(198,432),(198,433),(198,462),(198,466),(198,467),(198,468),(198,469),(198,470),(198,471),(198,483),(198,484),(198,490),(198,504),(198,512),(198,515),(198,520),(198,524),(198,528),(198,531),(198,532),(198,544),(198,545),(198,546),(198,547),(198,548),(198,549),(198,551),(198,552),(198,553),(198,554),(198,555),(198,557),(198,559),(198,560),(198,561),(198,562),(198,563),(198,564),(198,565),(198,566),(198,567),(198,569),(198,570),(198,597),(198,598),(198,599),(198,600),(198,737),(198,740),(198,741),(198,742),(198,744),(198,745),(198,746),(198,747),(198,749),(198,751),(198,752),(198,754),(198,755),(198,756),(198,759),(198,760),(199,217),(199,221),(199,222),(199,223),(199,225),(199,263),(199,496),(199,501),(199,507),(199,525),(199,534),(199,797);
+INSERT INTO `rbac_linked_permissions` VALUES (192,21),(192,42),(192,43),(192,193),(192,196),(192,778),(192,779),(192,780),(192,781),(192,782),(192,783),(192,784),(192,785),(192,786),(192,787),(192,788),(192,789),(192,790),(192,791),(192,792),(192,793),(192,794),(192,795),(192,796),(192,835),(193,48),(193,194),(193,197),(194,1),(194,2),(194,11),(194,13),(194,14),(194,15),(194,16),(194,17),(194,18),(194,19),(194,20),(194,22),(194,23),(194,25),(194,26),(194,27),(194,28),(194,29),(194,30),(194,31),(194,32),(194,33),(194,34),(194,35),(194,36),(194,37),(194,38),(194,39),(194,40),(194,41),(194,44),(194,46),(194,47),(194,51),(194,195),(194,198),(194,632),(194,798),(195,3),(195,4),(195,5),(195,6),(195,24),(195,49),(195,199),(196,200),(196,201),(196,226),(196,227),(196,230),(196,231),(196,233),(196,234),(196,235),(196,238),(196,239),(196,240),(196,241),(196,242),(196,243),(196,244),(196,245),(196,246),(196,247),(196,248),(196,249),(196,250),(196,251),(196,252),(196,253),(196,254),(196,255),(196,256),(196,257),(196,258),(196,259),(196,260),(196,261),(196,262),(196,264),(196,265),(196,266),(196,267),(196,268),(196,269),(196,270),(196,271),(196,272),(196,279),(196,280),(196,283),(196,287),(196,288),(196,289),(196,290),(196,291),(196,292),(196,293),(196,294),(196,295),(196,296),(196,297),(196,298),(196,299),(196,302),(196,303),(196,304),(196,305),(196,306),(196,307),(196,308),(196,309),(196,310),(196,313),(196,314),(196,319),(196,320),(196,321),(196,322),(196,323),(196,324),(196,325),(196,326),(196,327),(196,328),(196,329),(196,330),(196,331),(196,332),(196,333),(196,334),(196,335),(196,336),(196,337),(196,338),(196,339),(196,340),(196,341),(196,342),(196,343),(196,344),(196,345),(196,346),(196,347),(196,348),(196,349),(196,350),(196,351),(196,352),(196,353),(196,354),(196,355),(196,356),(196,357),(196,358),(196,359),(196,360),(196,361),(196,362),(196,363),(196,364),(196,365),(196,366),(196,373),(196,375),(196,400),(196,401),(196,402),(196,403),(196,404),(196,405),(196,406),(196,407),(196,417),(196,418),(196,419),(196,420),(196,421),(196,422),(196,423),(196,424),(196,425),(196,426),(196,427),(196,428),(196,429),(196,434),(196,435),(196,436),(196,437),(196,438),(196,439),(196,440),(196,441),(196,442),(196,443),(196,444),(196,445),(196,446),(196,447),(196,448),(196,449),(196,450),(196,451),(196,452),(196,453),(196,454),(196,455),(196,456),(196,457),(196,458),(196,459),(196,461),(196,463),(196,464),(196,465),(196,472),(196,473),(196,474),(196,475),(196,476),(196,477),(196,478),(196,488),(196,489),(196,491),(196,492),(196,493),(196,495),(196,497),(196,498),(196,499),(196,500),(196,502),(196,503),(196,505),(196,508),(196,511),(196,513),(196,514),(196,516),(196,519),(196,522),(196,523),(196,526),(196,527),(196,529),(196,530),(196,533),(196,535),(196,536),(196,537),(196,538),(196,539),(196,540),(196,541),(196,556),(196,581),(196,582),(196,592),(196,593),(196,596),(196,602),(196,603),(196,604),(196,605),(196,606),(196,607),(196,608),(196,609),(196,610),(196,611),(196,612),(196,613),(196,614),(196,615),(196,616),(196,617),(196,618),(196,619),(196,620),(196,621),(196,622),(196,623),(196,624),(196,625),(196,626),(196,627),(196,628),(196,629),(196,630),(196,631),(196,633),(196,634),(196,635),(196,636),(196,637),(196,638),(196,639),(196,640),(196,641),(196,642),(196,643),(196,644),(196,645),(196,646),(196,647),(196,648),(196,649),(196,650),(196,651),(196,652),(196,653),(196,654),(196,655),(196,656),(196,657),(196,658),(196,659),(196,660),(196,661),(196,662),(196,663),(196,664),(196,665),(196,666),(196,667),(196,668),(196,669),(196,670),(196,671),(196,672),(196,673),(196,674),(196,675),(196,676),(196,677),(196,678),(196,679),(196,680),(196,681),(196,682),(196,683),(196,684),(196,685),(196,686),(196,687),(196,688),(196,689),(196,690),(196,691),(196,692),(196,693),(196,694),(196,695),(196,696),(196,697),(196,698),(196,699),(196,700),(196,701),(196,702),(196,703),(196,704),(196,705),(196,706),(196,707),(196,708),(196,709),(196,710),(196,711),(196,712),(196,713),(196,714),(196,715),(196,716),(196,717),(196,718),(196,719),(196,721),(196,722),(196,723),(196,724),(196,725),(196,726),(196,727),(196,728),(196,729),(196,730),(196,733),(196,734),(196,735),(196,736),(196,738),(196,739),(196,748),(196,753),(196,757),(196,773),(196,777),(196,836),(196,837),(196,838),(196,839),(196,840),(196,841),(197,232),(197,236),(197,237),(197,273),(197,274),(197,275),(197,276),(197,277),(197,284),(197,285),(197,286),(197,301),(197,311),(197,387),(197,388),(197,389),(197,390),(197,391),(197,392),(197,393),(197,394),(197,395),(197,396),(197,397),(197,398),(197,399),(197,479),(197,480),(197,481),(197,482),(197,485),(197,486),(197,487),(197,494),(197,506),(197,509),(197,510),(197,517),(197,518),(197,521),(197,542),(197,543),(197,550),(197,558),(197,568),(197,571),(197,572),(197,573),(197,574),(197,575),(197,576),(197,577),(197,578),(197,579),(197,580),(197,583),(197,584),(197,585),(197,586),(197,587),(197,588),(197,589),(197,590),(197,591),(197,594),(197,595),(197,601),(197,743),(197,750),(197,758),(197,761),(197,762),(197,763),(197,764),(197,765),(197,766),(197,767),(197,768),(197,769),(197,770),(197,771),(197,772),(197,774),(198,218),(198,300),(198,312),(198,315),(198,316),(198,317),(198,318),(198,367),(198,368),(198,369),(198,370),(198,371),(198,372),(198,374),(198,376),(198,377),(198,378),(198,379),(198,380),(198,381),(198,382),(198,383),(198,384),(198,385),(198,386),(198,408),(198,409),(198,410),(198,411),(198,412),(198,413),(198,414),(198,415),(198,416),(198,430),(198,431),(198,432),(198,433),(198,462),(198,466),(198,467),(198,468),(198,469),(198,470),(198,471),(198,483),(198,484),(198,490),(198,504),(198,512),(198,515),(198,520),(198,524),(198,528),(198,531),(198,532),(198,544),(198,545),(198,546),(198,547),(198,548),(198,549),(198,551),(198,552),(198,553),(198,554),(198,555),(198,557),(198,559),(198,560),(198,561),(198,562),(198,563),(198,564),(198,565),(198,566),(198,567),(198,569),(198,570),(198,597),(198,598),(198,599),(198,600),(198,737),(198,740),(198,741),(198,742),(198,744),(198,745),(198,746),(198,747),(198,749),(198,751),(198,752),(198,754),(198,755),(198,756),(198,759),(198,760),(199,217),(199,221),(199,222),(199,223),(199,225),(199,263),(199,496),(199,501),(199,507),(199,525),(199,534),(199,797);
/*!40000 ALTER TABLE `rbac_linked_permissions` ENABLE KEYS */;
UNLOCK TABLES;
@@ -399,7 +399,7 @@ CREATE TABLE `rbac_permissions` (
LOCK TABLES `rbac_permissions` WRITE;
/*!40000 ALTER TABLE `rbac_permissions` DISABLE KEYS */;
-INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(11,'Log GM trades'),(13,'Skip Instance required bosses check'),(14,'Skip character creation team mask check'),(15,'Skip character creation class mask check'),(16,'Skip character creation race mask check'),(17,'Skip character creation reserved name check'),(18,'Skip character creation heroic min level check'),(19,'Skip needed requirements to use channel check'),(20,'Skip disable map check'),(21,'Skip reset talents when used more than allowed check'),(22,'Skip spam chat check'),(23,'Skip over-speed ping check'),(24,'Two side faction characters on the same account'),(25,'Allow say chat between factions'),(26,'Allow channel chat between factions'),(27,'Two side mail interaction'),(28,'See two side who list'),(29,'Add friends of other faction'),(30,'Save character without delay with .save command'),(31,'Use params with .unstuck command'),(32,'Can be assigned tickets with .assign ticket command'),(33,'Notify if a command was not found'),(34,'Check if should appear in list using .gm ingame command'),(35,'See all security levels with who command'),(36,'Filter whispers'),(37,'Use staff badge in chat'),(38,'Resurrect with full Health Points'),(39,'Restore saved gm setting states'),(40,'Allows to add a gm to friend list'),(41,'Use Config option START_GM_LEVEL to assign new character level'),(42,'Allows to use CMSG_WORLD_TELEPORT opcode'),(43,'Allows to use CMSG_WHOIS opcode'),(44,'Receive global GM messages/texts'),(45,'Join channels without announce'),(46,'Change channel settings without being channel moderator'),(47,'Enables lower security than target check'),(48,'Enable IP, Last Login and EMail output in pinfo'),(49,'Forces to enter the email for confirmation on password change'),(50,'Allow user to check his own email with .account'),(51,'Allow trading between factions'),(192,'Role: Sec Level Administrator'),(193,'Role: Sec Level Gamemaster'),(194,'Role: Sec Level Moderator'),(195,'Role: Sec Level Player'),(196,'Role: Administrator Commands'),(197,'Role: Gamemaster Commands'),(198,'Role: Moderator Commands'),(199,'Role: Player Commands'),(200,'Command: rbac'),(201,'Command: rbac account'),(202,'Command: rbac account list'),(203,'Command: rbac account grant'),(204,'Command: rbac account deny'),(205,'Command: rbac account revoke'),(206,'Command: rbac list'),(217,'Command: account'),(218,'Command: account addon'),(219,'Command: account create'),(220,'Command: account delete'),(221,'Command: account lock'),(222,'Command: account lock country'),(223,'Command: account lock ip'),(224,'Command: account onlinelist'),(225,'Command: account password'),(226,'Command: account set'),(227,'Command: account set addon'),(228,'Command: account set gmlevel'),(229,'Command: account set password'),(230,'Command: achievement'),(231,'Command: achievement add'),(232,'Command: arena'),(233,'Command: arena captain'),(234,'Command: arena create'),(235,'Command: arena disband'),(236,'Command: arena info'),(237,'Command: arena lookup'),(238,'Command: arena rename'),(239,'Command: ban'),(240,'Command: ban account'),(241,'Command: ban character'),(242,'Command: ban ip'),(243,'Command: ban playeraccount'),(244,'Command: baninfo'),(245,'Command: baninfo account'),(246,'Command: baninfo character'),(247,'Command: baninfo ip'),(248,'Command: banlist'),(249,'Command: banlist account'),(250,'Command: banlist character'),(251,'Command: banlist ip'),(252,'Command: unban'),(253,'Command: unban account'),(254,'Command: unban character'),(255,'Command: unban ip'),(256,'Command: unban playeraccount'),(257,'Command: bf'),(258,'Command: bf start'),(259,'Command: bf stop'),(260,'Command: bf switch'),(261,'Command: bf timer'),(262,'Command: bf enable'),(263,'Command: account email'),(264,'Command: account set sec'),(265,'Command: account set sec email'),(266,'Command: account set sec regmail'),(267,'Command: cast'),(268,'Command: cast back'),(269,'Command: cast dist'),(270,'Command: cast self'),(271,'Command: cast target'),(272,'Command: cast dest'),(273,'Command: character'),(274,'Command: character customize'),(275,'Command: character changefaction'),(276,'Command: character changerace'),(277,'Command: character deleted'),(279,'Command: character deleted list'),(280,'Command: character deleted restore'),(283,'Command: character level'),(284,'Command: character rename'),(285,'Command: character reputation'),(286,'Command: character titles'),(287,'Command: levelup'),(288,'Command: pdump'),(289,'Command: pdump load'),(290,'Command: pdump write'),(291,'Command: cheat'),(292,'Command: cheat casttime'),(293,'Command: cheat cooldown'),(294,'Command: cheat explore'),(295,'Command: cheat god'),(296,'Command: cheat power'),(297,'Command: cheat status'),(298,'Command: cheat taxi'),(299,'Command: cheat waterwalk'),(300,'Command: debug'),(301,'Command: debug anim'),(302,'Command: debug areatriggers'),(303,'Command: debug arena'),(304,'Command: debug bg'),(305,'Command: debug entervehicle'),(306,'Command: debug getitemstate'),(307,'Command: debug getitemvalue'),(308,'Command: debug getvalue'),(309,'Command: debug hostil'),(310,'Command: debug itemexpire'),(311,'Command: debug lootrecipient'),(312,'Command: debug los'),(313,'Command: debug mod32value'),(314,'Command: debug moveflags'),(315,'Command: debug play'),(316,'Command: debug play cinematics'),(317,'Command: debug play movie'),(318,'Command: debug play sound'),(319,'Command: debug send'),(320,'Command: debug send buyerror'),(321,'Command: debug send channelnotify'),(322,'Command: debug send chatmessage'),(323,'Command: debug send equiperror'),(324,'Command: debug send largepacket'),(325,'Command: debug send opcode'),(326,'Command: debug send qinvalidmsg'),(327,'Command: debug send qpartymsg'),(328,'Command: debug send sellerror'),(329,'Command: debug send setphaseshift'),(330,'Command: debug send spellfail'),(331,'Command: debug setaurastate'),(332,'Command: debug setbit'),(333,'Command: debug setitemvalue'),(334,'Command: debug setvalue'),(335,'Command: debug setvid'),(336,'Command: debug spawnvehicle'),(337,'Command: debug threat'),(338,'Command: debug update'),(339,'Command: debug uws'),(340,'Command: wpgps'),(341,'Command: deserter'),(342,'Command: deserter bg'),(343,'Command: deserter bg add'),(344,'Command: deserter bg remove'),(345,'Command: deserter instance'),(346,'Command: deserter instance add'),(347,'Command: deserter instance remove'),(348,'Command: disable'),(349,'Command: disable add'),(350,'Command: disable add achievement_criteria'),(351,'Command: disable add battleground'),(352,'Command: disable add map'),(353,'Command: disable add mmap'),(354,'Command: disable add outdoorpvp'),(355,'Command: disable add quest'),(356,'Command: disable add spell'),(357,'Command: disable add vmap'),(358,'Command: disable remove'),(359,'Command: disable remove achievement_criteria'),(360,'Command: disable remove battleground'),(361,'Command: disable remove map'),(362,'Command: disable remove mmap'),(363,'Command: disable remove outdoorpvp'),(364,'Command: disable remove quest'),(365,'Command: disable remove spell'),(366,'Command: disable remove vmap'),(367,'Command: event'),(368,'Command: event activelist'),(369,'Command: event start'),(370,'Command: event stop'),(371,'Command: gm'),(372,'Command: gm chat'),(373,'Command: gm fly'),(374,'Command: gm ingame'),(375,'Command: gm list'),(376,'Command: gm visible'),(377,'Command: go'),(378,'Command: go creature'),(379,'Command: go graveyard'),(380,'Command: go grid'),(381,'Command: go object'),(382,'Command: go taxinode'),(383,'Command: go ticket'),(384,'Command: go trigger'),(385,'Command: go xyz'),(386,'Command: go zonexy'),(387,'Command: gobject'),(388,'Command: gobject activate'),(389,'Command: gobject add'),(390,'Command: gobject add temp'),(391,'Command: gobject delete'),(392,'Command: gobject info'),(393,'Command: gobject move'),(394,'Command: gobject near'),(395,'Command: gobject set'),(396,'Command: gobject set phase'),(397,'Command: gobject set state'),(398,'Command: gobject target'),(399,'Command: gobject turn'),(400,'debug transport'),(401,'Command: guild'),(402,'Command: guild create'),(403,'Command: guild delete'),(404,'Command: guild invite'),(405,'Command: guild uninvite'),(406,'Command: guild rank'),(407,'Command: guild rename'),(408,'Command: honor'),(409,'Command: honor add'),(410,'Command: honor add kill'),(411,'Command: honor update'),(412,'Command: instance'),(413,'Command: instance listbinds'),(414,'Command: instance unbind'),(415,'Command: instance stats'),(416,'Command: instance savedata'),(417,'Command: learn'),(418,'Command: learn all'),(419,'Command: learn all my'),(420,'Command: learn all my class'),(421,'Command: learn all my pettalents'),(422,'Command: learn all my spells'),(423,'Command: learn all my talents'),(424,'Command: learn all gm'),(425,'Command: learn all crafts'),(426,'Command: learn all default'),(427,'Command: learn all lang'),(428,'Command: learn all recipes'),(429,'Command: unlearn'),(430,'Command: lfg'),(431,'Command: lfg player'),(432,'Command: lfg group'),(433,'Command: lfg queue'),(434,'Command: lfg clean'),(435,'Command: lfg options'),(436,'Command: list'),(437,'Command: list creature'),(438,'Command: list item'),(439,'Command: list object'),(440,'Command: list auras'),(441,'Command: list mail'),(442,'Command: lookup'),(443,'Command: lookup area'),(444,'Command: lookup creature'),(445,'Command: lookup event'),(446,'Command: lookup faction'),(447,'Command: lookup item'),(448,'Command: lookup itemset'),(449,'Command: lookup object'),(450,'Command: lookup quest'),(451,'Command: lookup player'),(452,'Command: lookup player ip'),(453,'Command: lookup player account'),(454,'Command: lookup player email'),(455,'Command: lookup skill'),(456,'Command: lookup spell'),(457,'Command: lookup spell id'),(458,'Command: lookup taxinode'),(459,'Command: lookup tele'),(460,'Command: lookup title'),(461,'Command: lookup map'),(462,'Command: announce'),(463,'Command: channel'),(464,'Command: channel set'),(465,'Command: channel set ownership'),(466,'Command: gmannounce'),(467,'Command: gmnameannounce'),(468,'Command: gmnotify'),(469,'Command: nameannounce'),(470,'Command: notify'),(471,'Command: whispers'),(472,'Command: group'),(473,'Command: group leader'),(474,'Command: group disband'),(475,'Command: group remove'),(476,'Command: group join'),(477,'Command: group list'),(478,'Command: group summon'),(479,'Command: pet'),(480,'Command: pet create'),(481,'Command: pet learn'),(482,'Command: pet unlearn'),(483,'Command: send'),(484,'Command: send items'),(485,'Command: send mail'),(486,'Command: send message'),(487,'Command: send money'),(488,'Command: additem'),(489,'Command: additemset'),(490,'Command: appear'),(491,'Command: aura'),(492,'Command: bank'),(493,'Command: bindsight'),(494,'Command: combatstop'),(495,'Command: cometome'),(496,'Command: commands'),(497,'Command: cooldown'),(498,'Command: damage'),(499,'Command: dev'),(500,'Command: die'),(501,'Command: dismount'),(502,'Command: distance'),(503,'Command: flusharenapoints'),(504,'Command: freeze'),(505,'Command: gps'),(506,'Command: guid'),(507,'Command: help'),(508,'Command: hidearea'),(509,'Command: itemmove'),(510,'Command: kick'),(511,'Command: linkgrave'),(512,'Command: listfreeze'),(513,'Command: maxskill'),(514,'Command: movegens'),(515,'Command: mute'),(516,'Command: neargrave'),(517,'Command: pinfo'),(518,'Command: playall'),(519,'Command: possess'),(520,'Command: recall'),(521,'Command: repairitems'),(522,'Command: respawn'),(523,'Command: revive'),(524,'Command: saveall'),(525,'Command: save'),(526,'Command: setskill'),(527,'Command: showarea'),(528,'Command: summon'),(529,'Command: unaura'),(530,'Command: unbindsight'),(531,'Command: unfreeze'),(532,'Command: unmute'),(533,'Command: unpossess'),(534,'Command: unstuck'),(535,'Command: wchange'),(536,'Command: mmap'),(537,'Command: mmap loadedtiles'),(538,'Command: mmap loc'),(539,'Command: mmap path'),(540,'Command: mmap stats'),(541,'Command: mmap testarea'),(542,'Command: morph'),(543,'Command: demorph'),(544,'Command: modify'),(545,'Command: modify arenapoints'),(546,'Command: modify bit'),(547,'Command: modify drunk'),(548,'Command: modify energy'),(549,'Command: modify faction'),(550,'Command: modify gender'),(551,'Command: modify honor'),(552,'Command: modify hp'),(553,'Command: modify mana'),(554,'Command: modify money'),(555,'Command: modify mount'),(556,'Command: modify phase'),(557,'Command: modify rage'),(558,'Command: modify reputation'),(559,'Command: modify runicpower'),(560,'Command: modify scale'),(561,'Command: modify speed'),(562,'Command: modify speed all'),(563,'Command: modify speed backwalk'),(564,'Command: modify speed fly'),(565,'Command: modify speed walk'),(566,'Command: modify speed swim'),(567,'Command: modify spell'),(568,'Command: modify standstate'),(569,'Command: modify talentpoints'),(570,'Command: npc'),(571,'Command: npc add'),(572,'Command: npc add formation'),(573,'Command: npc add item'),(574,'Command: npc add move'),(575,'Command: npc add temp'),(576,'Command: npc add delete'),(577,'Command: npc add delete item'),(578,'Command: npc add follow'),(579,'Command: npc add follow stop'),(580,'Command: npc set'),(581,'Command: npc set allowmove'),(582,'Command: npc set entry'),(583,'Command: npc set factionid'),(584,'Command: npc set flag'),(585,'Command: npc set level'),(586,'Command: npc set link'),(587,'Command: npc set model'),(588,'Command: npc set movetype'),(589,'Command: npc set phase'),(590,'Command: npc set spawndist'),(591,'Command: npc set spawntime'),(592,'Command: npc set data'),(593,'Command: npc info'),(594,'Command: npc near'),(595,'Command: npc move'),(596,'Command: npc playemote'),(597,'Command: npc say'),(598,'Command: npc textemote'),(599,'Command: npc whisper'),(600,'Command: npc yell'),(601,'Command: npc tame'),(602,'Command: quest'),(603,'Command: quest add'),(604,'Command: quest complete'),(605,'Command: quest remove'),(606,'Command: quest reward'),(607,'Command: reload'),(608,'Command: reload access_requirement'),(609,'Command: reload achievement_criteria_data'),(610,'Command: reload achievement_reward'),(611,'Command: reload all'),(612,'Command: reload all achievement'),(613,'Command: reload all area'),(614,'Command: broadcast_text'),(615,'Command: reload all gossips'),(616,'Command: reload all item'),(617,'Command: reload all locales'),(618,'Command: reload all loot'),(619,'Command: reload all npc'),(620,'Command: reload all quest'),(621,'Command: reload all scripts'),(622,'Command: reload all spell'),(623,'Command: reload areatrigger_involvedrelation'),(624,'Command: reload areatrigger_tavern'),(625,'Command: reload areatrigger_teleport'),(626,'Command: reload auctions'),(627,'Command: reload autobroadcast'),(628,'Command: reload command'),(629,'Command: reload conditions'),(630,'Command: reload config'),(631,'Command: reload battleground_template'),(632,'Command: .mutehistory'),(633,'Command: reload creature_linked_respawn'),(634,'Command: reload creature_loot_template'),(635,'Command: reload creature_onkill_reputation'),(636,'Command: reload creature_questender'),(637,'Command: reload creature_queststarter'),(638,'Command: reload creature_summon_groups'),(639,'Command: reload creature_template'),(640,'Command: reload creature_text'),(641,'Command: reload disables'),(642,'Command: reload disenchant_loot_template'),(643,'Command: reload event_scripts'),(644,'Command: reload fishing_loot_template'),(645,'Command: reload game_graveyard_zone'),(646,'Command: reload game_tele'),(647,'Command: reload gameobject_questender'),(648,'Command: reload gameobject_loot_template'),(649,'Command: reload gameobject_queststarter'),(650,'Command: reload gm_tickets'),(651,'Command: reload gossip_menu'),(652,'Command: reload gossip_menu_option'),(653,'Command: reload item_enchantment_template'),(654,'Command: reload item_loot_template'),(655,'Command: reload item_set_names'),(656,'Command: reload lfg_dungeon_rewards'),(657,'Command: reload locales_achievement_reward'),(658,'Command: reload locales_creature'),(659,'Command: reload locales_creature_text'),(660,'Command: reload locales_gameobject'),(661,'Command: reload locales_gossip_menu_option'),(662,'Command: reload locales_item'),(663,'Command: reload locales_item_set_name'),(664,'Command: reload locales_npc_text'),(665,'Command: reload locales_page_text'),(666,'Command: reload locales_points_of_interest'),(667,'Command: reload locales_quest'),(668,'Command: reload mail_level_reward'),(669,'Command: reload mail_loot_template'),(670,'Command: reload milling_loot_template'),(671,'Command: reload npc_spellclick_spells'),(672,'Command: reload npc_trainer'),(673,'Command: reload npc_vendor'),(674,'Command: reload page_text'),(675,'Command: reload pickpocketing_loot_template'),(676,'Command: reload points_of_interest'),(677,'Command: reload prospecting_loot_template'),(678,'Command: reload quest_poi'),(679,'Command: reload quest_template'),(680,'Command: reload rbac'),(681,'Command: reload reference_loot_template'),(682,'Command: reload reserved_name'),(683,'Command: reload reputation_reward_rate'),(684,'Command: reload reputation_spillover_template'),(685,'Command: reload skill_discovery_template'),(686,'Command: reload skill_extra_item_template'),(687,'Command: reload skill_fishing_base_level'),(688,'Command: reload skinning_loot_template'),(689,'Command: reload smart_scripts'),(690,'Command: reload spell_required'),(691,'Command: reload spell_area'),(692,'Command: reload spell_bonus_data'),(693,'Command: reload spell_group'),(694,'Command: reload spell_learn_spell'),(695,'Command: reload spell_loot_template'),(696,'Command: reload spell_linked_spell'),(697,'Command: reload spell_pet_auras'),(698,'Command: reload spell_proc_event'),(699,'Command: reload spell_proc'),(700,'Command: reload spell_scripts'),(701,'Command: reload spell_target_position'),(702,'Command: reload spell_threats'),(703,'Command: reload spell_group_stack_rules'),(704,'Command: reload trinity_string'),(705,'Command: reload warden_action'),(706,'Command: reload waypoint_scripts'),(707,'Command: reload waypoint_data'),(708,'Command: reload vehicle_accessory'),(709,'Command: reload vehicle_template_accessory'),(710,'Command: reset'),(711,'Command: reset achievements'),(712,'Command: reset honor'),(713,'Command: reset level'),(714,'Command: reset spells'),(715,'Command: reset stats'),(716,'Command: reset talents'),(717,'Command: reset all'),(718,'Command: server'),(719,'Command: server corpses'),(720,'Command: server exit'),(721,'Command: server idlerestart'),(722,'Command: server idlerestart cancel'),(723,'Command: server idleshutdown'),(724,'Command: server idleshutdown cancel'),(725,'Command: server info'),(726,'Command: server plimit'),(727,'Command: server restart'),(728,'Command: server restart cancel'),(729,'Command: server set'),(730,'Command: server set closed'),(731,'Command: server set difftime'),(732,'Command: server set loglevel'),(733,'Command: server set motd'),(734,'Command: server shutdown'),(735,'Command: server shutdown cancel'),(736,'Command: server motd'),(737,'Command: tele'),(738,'Command: tele add'),(739,'Command: tele del'),(740,'Command: tele name'),(741,'Command: tele group'),(742,'Command: ticket'),(743,'Command: ticket assign'),(744,'Command: ticket close'),(745,'Command: ticket closedlist'),(746,'Command: ticket comment'),(747,'Command: ticket complete'),(748,'Command: ticket delete'),(749,'Command: ticket escalate'),(750,'Command: ticket escalatedlist'),(751,'Command: ticket list'),(752,'Command: ticket onlinelist'),(753,'Command: ticket reset'),(754,'Command: ticket response'),(755,'Command: ticket response append'),(756,'Command: ticket response appendln'),(757,'Command: ticket togglesystem'),(758,'Command: ticket unassign'),(759,'Command: ticket viewid'),(760,'Command: ticket viewname'),(761,'Command: titles'),(762,'Command: titles add'),(763,'Command: titles current'),(764,'Command: titles remove'),(765,'Command: titles set'),(766,'Command: titles set mask'),(767,'Command: wp'),(768,'Command: wp add'),(769,'Command: wp event'),(770,'Command: wp load'),(771,'Command: wp modify'),(772,'Command: wp unload'),(773,'Command: wp reload'),(774,'Command: wp show'),(777,'Command: mailbox'),(778,'Command: ahbot'),(779,'Command: ahbot items'),(780,'Command: ahbot items gray'),(781,'Command: ahbot items white'),(782,'Command: ahbot items green'),(783,'Command: ahbot items blue'),(784,'Command: ahbot items purple'),(785,'Command: ahbot items orange'),(786,'Command: ahbot items yellow'),(787,'Command: ahbot ratio'),(788,'Command: ahbot ratio alliance'),(789,'Command: ahbot ratio horde'),(790,'Command: ahbot ratio neutral'),(791,'Command: ahbot rebuild'),(792,'Command: ahbot reload'),(793,'Command: ahbot status'),(794,'Command: .guild info'),(795,'Command: .instance setbossstate'),(796,'Command: instance getbossstate'),(797,'Command: pvpstats'),(798,'Command: .mod xp'),(835,'Command: debug loadcells'),(836,'Command: .debug boundary');
+INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(11,'Log GM trades'),(13,'Skip Instance required bosses check'),(14,'Skip character creation team mask check'),(15,'Skip character creation class mask check'),(16,'Skip character creation race mask check'),(17,'Skip character creation reserved name check'),(18,'Skip character creation heroic min level check'),(19,'Skip needed requirements to use channel check'),(20,'Skip disable map check'),(21,'Skip reset talents when used more than allowed check'),(22,'Skip spam chat check'),(23,'Skip over-speed ping check'),(24,'Two side faction characters on the same account'),(25,'Allow say chat between factions'),(26,'Allow channel chat between factions'),(27,'Two side mail interaction'),(28,'See two side who list'),(29,'Add friends of other faction'),(30,'Save character without delay with .save command'),(31,'Use params with .unstuck command'),(32,'Can be assigned tickets with .assign ticket command'),(33,'Notify if a command was not found'),(34,'Check if should appear in list using .gm ingame command'),(35,'See all security levels with who command'),(36,'Filter whispers'),(37,'Use staff badge in chat'),(38,'Resurrect with full Health Points'),(39,'Restore saved gm setting states'),(40,'Allows to add a gm to friend list'),(41,'Use Config option START_GM_LEVEL to assign new character level'),(42,'Allows to use CMSG_WORLD_TELEPORT opcode'),(43,'Allows to use CMSG_WHOIS opcode'),(44,'Receive global GM messages/texts'),(45,'Join channels without announce'),(46,'Change channel settings without being channel moderator'),(47,'Enables lower security than target check'),(48,'Enable IP, Last Login and EMail output in pinfo'),(49,'Forces to enter the email for confirmation on password change'),(50,'Allow user to check his own email with .account'),(51,'Allow trading between factions'),(192,'Role: Sec Level Administrator'),(193,'Role: Sec Level Gamemaster'),(194,'Role: Sec Level Moderator'),(195,'Role: Sec Level Player'),(196,'Role: Administrator Commands'),(197,'Role: Gamemaster Commands'),(198,'Role: Moderator Commands'),(199,'Role: Player Commands'),(200,'Command: rbac'),(201,'Command: rbac account'),(202,'Command: rbac account list'),(203,'Command: rbac account grant'),(204,'Command: rbac account deny'),(205,'Command: rbac account revoke'),(206,'Command: rbac list'),(217,'Command: account'),(218,'Command: account addon'),(219,'Command: account create'),(220,'Command: account delete'),(221,'Command: account lock'),(222,'Command: account lock country'),(223,'Command: account lock ip'),(224,'Command: account onlinelist'),(225,'Command: account password'),(226,'Command: account set'),(227,'Command: account set addon'),(228,'Command: account set gmlevel'),(229,'Command: account set password'),(230,'Command: achievement'),(231,'Command: achievement add'),(232,'Command: arena'),(233,'Command: arena captain'),(234,'Command: arena create'),(235,'Command: arena disband'),(236,'Command: arena info'),(237,'Command: arena lookup'),(238,'Command: arena rename'),(239,'Command: ban'),(240,'Command: ban account'),(241,'Command: ban character'),(242,'Command: ban ip'),(243,'Command: ban playeraccount'),(244,'Command: baninfo'),(245,'Command: baninfo account'),(246,'Command: baninfo character'),(247,'Command: baninfo ip'),(248,'Command: banlist'),(249,'Command: banlist account'),(250,'Command: banlist character'),(251,'Command: banlist ip'),(252,'Command: unban'),(253,'Command: unban account'),(254,'Command: unban character'),(255,'Command: unban ip'),(256,'Command: unban playeraccount'),(257,'Command: bf'),(258,'Command: bf start'),(259,'Command: bf stop'),(260,'Command: bf switch'),(261,'Command: bf timer'),(262,'Command: bf enable'),(263,'Command: account email'),(264,'Command: account set sec'),(265,'Command: account set sec email'),(266,'Command: account set sec regmail'),(267,'Command: cast'),(268,'Command: cast back'),(269,'Command: cast dist'),(270,'Command: cast self'),(271,'Command: cast target'),(272,'Command: cast dest'),(273,'Command: character'),(274,'Command: character customize'),(275,'Command: character changefaction'),(276,'Command: character changerace'),(277,'Command: character deleted'),(279,'Command: character deleted list'),(280,'Command: character deleted restore'),(283,'Command: character level'),(284,'Command: character rename'),(285,'Command: character reputation'),(286,'Command: character titles'),(287,'Command: levelup'),(288,'Command: pdump'),(289,'Command: pdump load'),(290,'Command: pdump write'),(291,'Command: cheat'),(292,'Command: cheat casttime'),(293,'Command: cheat cooldown'),(294,'Command: cheat explore'),(295,'Command: cheat god'),(296,'Command: cheat power'),(297,'Command: cheat status'),(298,'Command: cheat taxi'),(299,'Command: cheat waterwalk'),(300,'Command: debug'),(301,'Command: debug anim'),(302,'Command: debug areatriggers'),(303,'Command: debug arena'),(304,'Command: debug bg'),(305,'Command: debug entervehicle'),(306,'Command: debug getitemstate'),(307,'Command: debug getitemvalue'),(308,'Command: debug getvalue'),(309,'Command: debug hostil'),(310,'Command: debug itemexpire'),(311,'Command: debug lootrecipient'),(312,'Command: debug los'),(313,'Command: debug mod32value'),(314,'Command: debug moveflags'),(315,'Command: debug play'),(316,'Command: debug play cinematics'),(317,'Command: debug play movie'),(318,'Command: debug play sound'),(319,'Command: debug send'),(320,'Command: debug send buyerror'),(321,'Command: debug send channelnotify'),(322,'Command: debug send chatmessage'),(323,'Command: debug send equiperror'),(324,'Command: debug send largepacket'),(325,'Command: debug send opcode'),(326,'Command: debug send qinvalidmsg'),(327,'Command: debug send qpartymsg'),(328,'Command: debug send sellerror'),(329,'Command: debug send setphaseshift'),(330,'Command: debug send spellfail'),(331,'Command: debug setaurastate'),(332,'Command: debug setbit'),(333,'Command: debug setitemvalue'),(334,'Command: debug setvalue'),(335,'Command: debug setvid'),(336,'Command: debug spawnvehicle'),(337,'Command: debug threat'),(338,'Command: debug update'),(339,'Command: debug uws'),(340,'Command: wpgps'),(341,'Command: deserter'),(342,'Command: deserter bg'),(343,'Command: deserter bg add'),(344,'Command: deserter bg remove'),(345,'Command: deserter instance'),(346,'Command: deserter instance add'),(347,'Command: deserter instance remove'),(348,'Command: disable'),(349,'Command: disable add'),(350,'Command: disable add achievement_criteria'),(351,'Command: disable add battleground'),(352,'Command: disable add map'),(353,'Command: disable add mmap'),(354,'Command: disable add outdoorpvp'),(355,'Command: disable add quest'),(356,'Command: disable add spell'),(357,'Command: disable add vmap'),(358,'Command: disable remove'),(359,'Command: disable remove achievement_criteria'),(360,'Command: disable remove battleground'),(361,'Command: disable remove map'),(362,'Command: disable remove mmap'),(363,'Command: disable remove outdoorpvp'),(364,'Command: disable remove quest'),(365,'Command: disable remove spell'),(366,'Command: disable remove vmap'),(367,'Command: event'),(368,'Command: event activelist'),(369,'Command: event start'),(370,'Command: event stop'),(371,'Command: gm'),(372,'Command: gm chat'),(373,'Command: gm fly'),(374,'Command: gm ingame'),(375,'Command: gm list'),(376,'Command: gm visible'),(377,'Command: go'),(378,'Command: go creature'),(379,'Command: go graveyard'),(380,'Command: go grid'),(381,'Command: go object'),(382,'Command: go taxinode'),(383,'Command: go ticket'),(384,'Command: go trigger'),(385,'Command: go xyz'),(386,'Command: go zonexy'),(387,'Command: gobject'),(388,'Command: gobject activate'),(389,'Command: gobject add'),(390,'Command: gobject add temp'),(391,'Command: gobject delete'),(392,'Command: gobject info'),(393,'Command: gobject move'),(394,'Command: gobject near'),(395,'Command: gobject set'),(396,'Command: gobject set phase'),(397,'Command: gobject set state'),(398,'Command: gobject target'),(399,'Command: gobject turn'),(400,'debug transport'),(401,'Command: guild'),(402,'Command: guild create'),(403,'Command: guild delete'),(404,'Command: guild invite'),(405,'Command: guild uninvite'),(406,'Command: guild rank'),(407,'Command: guild rename'),(408,'Command: honor'),(409,'Command: honor add'),(410,'Command: honor add kill'),(411,'Command: honor update'),(412,'Command: instance'),(413,'Command: instance listbinds'),(414,'Command: instance unbind'),(415,'Command: instance stats'),(416,'Command: instance savedata'),(417,'Command: learn'),(418,'Command: learn all'),(419,'Command: learn all my'),(420,'Command: learn all my class'),(421,'Command: learn all my pettalents'),(422,'Command: learn all my spells'),(423,'Command: learn all my talents'),(424,'Command: learn all gm'),(425,'Command: learn all crafts'),(426,'Command: learn all default'),(427,'Command: learn all lang'),(428,'Command: learn all recipes'),(429,'Command: unlearn'),(430,'Command: lfg'),(431,'Command: lfg player'),(432,'Command: lfg group'),(433,'Command: lfg queue'),(434,'Command: lfg clean'),(435,'Command: lfg options'),(436,'Command: list'),(437,'Command: list creature'),(438,'Command: list item'),(439,'Command: list object'),(440,'Command: list auras'),(441,'Command: list mail'),(442,'Command: lookup'),(443,'Command: lookup area'),(444,'Command: lookup creature'),(445,'Command: lookup event'),(446,'Command: lookup faction'),(447,'Command: lookup item'),(448,'Command: lookup itemset'),(449,'Command: lookup object'),(450,'Command: lookup quest'),(451,'Command: lookup player'),(452,'Command: lookup player ip'),(453,'Command: lookup player account'),(454,'Command: lookup player email'),(455,'Command: lookup skill'),(456,'Command: lookup spell'),(457,'Command: lookup spell id'),(458,'Command: lookup taxinode'),(459,'Command: lookup tele'),(460,'Command: lookup title'),(461,'Command: lookup map'),(462,'Command: announce'),(463,'Command: channel'),(464,'Command: channel set'),(465,'Command: channel set ownership'),(466,'Command: gmannounce'),(467,'Command: gmnameannounce'),(468,'Command: gmnotify'),(469,'Command: nameannounce'),(470,'Command: notify'),(471,'Command: whispers'),(472,'Command: group'),(473,'Command: group leader'),(474,'Command: group disband'),(475,'Command: group remove'),(476,'Command: group join'),(477,'Command: group list'),(478,'Command: group summon'),(479,'Command: pet'),(480,'Command: pet create'),(481,'Command: pet learn'),(482,'Command: pet unlearn'),(483,'Command: send'),(484,'Command: send items'),(485,'Command: send mail'),(486,'Command: send message'),(487,'Command: send money'),(488,'Command: additem'),(489,'Command: additemset'),(490,'Command: appear'),(491,'Command: aura'),(492,'Command: bank'),(493,'Command: bindsight'),(494,'Command: combatstop'),(495,'Command: cometome'),(496,'Command: commands'),(497,'Command: cooldown'),(498,'Command: damage'),(499,'Command: dev'),(500,'Command: die'),(501,'Command: dismount'),(502,'Command: distance'),(503,'Command: flusharenapoints'),(504,'Command: freeze'),(505,'Command: gps'),(506,'Command: guid'),(507,'Command: help'),(508,'Command: hidearea'),(509,'Command: itemmove'),(510,'Command: kick'),(511,'Command: linkgrave'),(512,'Command: listfreeze'),(513,'Command: maxskill'),(514,'Command: movegens'),(515,'Command: mute'),(516,'Command: neargrave'),(517,'Command: pinfo'),(518,'Command: playall'),(519,'Command: possess'),(520,'Command: recall'),(521,'Command: repairitems'),(522,'Command: respawn'),(523,'Command: revive'),(524,'Command: saveall'),(525,'Command: save'),(526,'Command: setskill'),(527,'Command: showarea'),(528,'Command: summon'),(529,'Command: unaura'),(530,'Command: unbindsight'),(531,'Command: unfreeze'),(532,'Command: unmute'),(533,'Command: unpossess'),(534,'Command: unstuck'),(535,'Command: wchange'),(536,'Command: mmap'),(537,'Command: mmap loadedtiles'),(538,'Command: mmap loc'),(539,'Command: mmap path'),(540,'Command: mmap stats'),(541,'Command: mmap testarea'),(542,'Command: morph'),(543,'Command: demorph'),(544,'Command: modify'),(545,'Command: modify arenapoints'),(546,'Command: modify bit'),(547,'Command: modify drunk'),(548,'Command: modify energy'),(549,'Command: modify faction'),(550,'Command: modify gender'),(551,'Command: modify honor'),(552,'Command: modify hp'),(553,'Command: modify mana'),(554,'Command: modify money'),(555,'Command: modify mount'),(556,'Command: modify phase'),(557,'Command: modify rage'),(558,'Command: modify reputation'),(559,'Command: modify runicpower'),(560,'Command: modify scale'),(561,'Command: modify speed'),(562,'Command: modify speed all'),(563,'Command: modify speed backwalk'),(564,'Command: modify speed fly'),(565,'Command: modify speed walk'),(566,'Command: modify speed swim'),(567,'Command: modify spell'),(568,'Command: modify standstate'),(569,'Command: modify talentpoints'),(570,'Command: npc'),(571,'Command: npc add'),(572,'Command: npc add formation'),(573,'Command: npc add item'),(574,'Command: npc add move'),(575,'Command: npc add temp'),(576,'Command: npc add delete'),(577,'Command: npc add delete item'),(578,'Command: npc add follow'),(579,'Command: npc add follow stop'),(580,'Command: npc set'),(581,'Command: npc set allowmove'),(582,'Command: npc set entry'),(583,'Command: npc set factionid'),(584,'Command: npc set flag'),(585,'Command: npc set level'),(586,'Command: npc set link'),(587,'Command: npc set model'),(588,'Command: npc set movetype'),(589,'Command: npc set phase'),(590,'Command: npc set spawndist'),(591,'Command: npc set spawntime'),(592,'Command: npc set data'),(593,'Command: npc info'),(594,'Command: npc near'),(595,'Command: npc move'),(596,'Command: npc playemote'),(597,'Command: npc say'),(598,'Command: npc textemote'),(599,'Command: npc whisper'),(600,'Command: npc yell'),(601,'Command: npc tame'),(602,'Command: quest'),(603,'Command: quest add'),(604,'Command: quest complete'),(605,'Command: quest remove'),(606,'Command: quest reward'),(607,'Command: reload'),(608,'Command: reload access_requirement'),(609,'Command: reload achievement_criteria_data'),(610,'Command: reload achievement_reward'),(611,'Command: reload all'),(612,'Command: reload all achievement'),(613,'Command: reload all area'),(614,'Command: broadcast_text'),(615,'Command: reload all gossips'),(616,'Command: reload all item'),(617,'Command: reload all locales'),(618,'Command: reload all loot'),(619,'Command: reload all npc'),(620,'Command: reload all quest'),(621,'Command: reload all scripts'),(622,'Command: reload all spell'),(623,'Command: reload areatrigger_involvedrelation'),(624,'Command: reload areatrigger_tavern'),(625,'Command: reload areatrigger_teleport'),(626,'Command: reload auctions'),(627,'Command: reload autobroadcast'),(628,'Command: reload command'),(629,'Command: reload conditions'),(630,'Command: reload config'),(631,'Command: reload battleground_template'),(632,'Command: .mutehistory'),(633,'Command: reload creature_linked_respawn'),(634,'Command: reload creature_loot_template'),(635,'Command: reload creature_onkill_reputation'),(636,'Command: reload creature_questender'),(637,'Command: reload creature_queststarter'),(638,'Command: reload creature_summon_groups'),(639,'Command: reload creature_template'),(640,'Command: reload creature_text'),(641,'Command: reload disables'),(642,'Command: reload disenchant_loot_template'),(643,'Command: reload event_scripts'),(644,'Command: reload fishing_loot_template'),(645,'Command: reload game_graveyard_zone'),(646,'Command: reload game_tele'),(647,'Command: reload gameobject_questender'),(648,'Command: reload gameobject_loot_template'),(649,'Command: reload gameobject_queststarter'),(650,'Command: reload gm_tickets'),(651,'Command: reload gossip_menu'),(652,'Command: reload gossip_menu_option'),(653,'Command: reload item_enchantment_template'),(654,'Command: reload item_loot_template'),(655,'Command: reload item_set_names'),(656,'Command: reload lfg_dungeon_rewards'),(657,'Command: reload locales_achievement_reward'),(658,'Command: reload locales_creature'),(659,'Command: reload locales_creature_text'),(660,'Command: reload locales_gameobject'),(661,'Command: reload locales_gossip_menu_option'),(662,'Command: reload locales_item'),(663,'Command: reload locales_item_set_name'),(664,'Command: reload locales_npc_text'),(665,'Command: reload locales_page_text'),(666,'Command: reload locales_points_of_interest'),(667,'Command: reload locales_quest'),(668,'Command: reload mail_level_reward'),(669,'Command: reload mail_loot_template'),(670,'Command: reload milling_loot_template'),(671,'Command: reload npc_spellclick_spells'),(672,'Command: reload npc_trainer'),(673,'Command: reload npc_vendor'),(674,'Command: reload page_text'),(675,'Command: reload pickpocketing_loot_template'),(676,'Command: reload points_of_interest'),(677,'Command: reload prospecting_loot_template'),(678,'Command: reload quest_poi'),(679,'Command: reload quest_template'),(680,'Command: reload rbac'),(681,'Command: reload reference_loot_template'),(682,'Command: reload reserved_name'),(683,'Command: reload reputation_reward_rate'),(684,'Command: reload reputation_spillover_template'),(685,'Command: reload skill_discovery_template'),(686,'Command: reload skill_extra_item_template'),(687,'Command: reload skill_fishing_base_level'),(688,'Command: reload skinning_loot_template'),(689,'Command: reload smart_scripts'),(690,'Command: reload spell_required'),(691,'Command: reload spell_area'),(692,'Command: reload spell_bonus_data'),(693,'Command: reload spell_group'),(694,'Command: reload spell_learn_spell'),(695,'Command: reload spell_loot_template'),(696,'Command: reload spell_linked_spell'),(697,'Command: reload spell_pet_auras'),(698,'Command: reload spell_proc_event'),(699,'Command: reload spell_proc'),(700,'Command: reload spell_scripts'),(701,'Command: reload spell_target_position'),(702,'Command: reload spell_threats'),(703,'Command: reload spell_group_stack_rules'),(704,'Command: reload trinity_string'),(705,'Command: reload warden_action'),(706,'Command: reload waypoint_scripts'),(707,'Command: reload waypoint_data'),(708,'Command: reload vehicle_accessory'),(709,'Command: reload vehicle_template_accessory'),(710,'Command: reset'),(711,'Command: reset achievements'),(712,'Command: reset honor'),(713,'Command: reset level'),(714,'Command: reset spells'),(715,'Command: reset stats'),(716,'Command: reset talents'),(717,'Command: reset all'),(718,'Command: server'),(719,'Command: server corpses'),(720,'Command: server exit'),(721,'Command: server idlerestart'),(722,'Command: server idlerestart cancel'),(723,'Command: server idleshutdown'),(724,'Command: server idleshutdown cancel'),(725,'Command: server info'),(726,'Command: server plimit'),(727,'Command: server restart'),(728,'Command: server restart cancel'),(729,'Command: server set'),(730,'Command: server set closed'),(731,'Command: server set difftime'),(732,'Command: server set loglevel'),(733,'Command: server set motd'),(734,'Command: server shutdown'),(735,'Command: server shutdown cancel'),(736,'Command: server motd'),(737,'Command: tele'),(738,'Command: tele add'),(739,'Command: tele del'),(740,'Command: tele name'),(741,'Command: tele group'),(742,'Command: ticket'),(743,'Command: ticket assign'),(744,'Command: ticket close'),(745,'Command: ticket closedlist'),(746,'Command: ticket comment'),(747,'Command: ticket complete'),(748,'Command: ticket delete'),(749,'Command: ticket escalate'),(750,'Command: ticket escalatedlist'),(751,'Command: ticket list'),(752,'Command: ticket onlinelist'),(753,'Command: ticket reset'),(754,'Command: ticket response'),(755,'Command: ticket response append'),(756,'Command: ticket response appendln'),(757,'Command: ticket togglesystem'),(758,'Command: ticket unassign'),(759,'Command: ticket viewid'),(760,'Command: ticket viewname'),(761,'Command: titles'),(762,'Command: titles add'),(763,'Command: titles current'),(764,'Command: titles remove'),(765,'Command: titles set'),(766,'Command: titles set mask'),(767,'Command: wp'),(768,'Command: wp add'),(769,'Command: wp event'),(770,'Command: wp load'),(771,'Command: wp modify'),(772,'Command: wp unload'),(773,'Command: wp reload'),(774,'Command: wp show'),(777,'Command: mailbox'),(778,'Command: ahbot'),(779,'Command: ahbot items'),(780,'Command: ahbot items gray'),(781,'Command: ahbot items white'),(782,'Command: ahbot items green'),(783,'Command: ahbot items blue'),(784,'Command: ahbot items purple'),(785,'Command: ahbot items orange'),(786,'Command: ahbot items yellow'),(787,'Command: ahbot ratio'),(788,'Command: ahbot ratio alliance'),(789,'Command: ahbot ratio horde'),(790,'Command: ahbot ratio neutral'),(791,'Command: ahbot rebuild'),(792,'Command: ahbot reload'),(793,'Command: ahbot status'),(794,'Command: .guild info'),(795,'Command: .instance setbossstate'),(796,'Command: instance getbossstate'),(797,'Command: pvpstats'),(798,'Command: .mod xp'),(835,'Command: debug loadcells'),(836,'Command: .debug boundary'),(837,'Command: .npc evade'),(838,'Command: .pet level'),(839,'Command: .server shutdown force'),(840,'Command: .server restart force'),(841,'Command: .neargraveyard');
/*!40000 ALTER TABLE `rbac_permissions` ENABLE KEYS */;
UNLOCK TABLES;
@@ -486,7 +486,7 @@ CREATE TABLE `updates` (
LOCK TABLES `updates` WRITE;
/*!40000 ALTER TABLE `updates` DISABLE KEYS */;
-INSERT INTO `updates` VALUES ('2014_11_10_00_auth.sql','0E3CB119442D09DD88E967015319BBC8DAFBBFE0','ARCHIVED','2015-03-21 21:44:12',0),('2014_11_10_01_auth.sql','327E77A1DA3546D5275AB249915DD57EDD6FDD3D','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_10_00_auth.sql','821703A96D80F9080074852B5A46E2909C9562EA','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_21_00_auth.sql','CE2E5D2CD82E79C25294539ADED27A1429105B43','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_00_auth.sql','E8C5B74BB45F0F35DEC182C72BACF435C7066FB0','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_01_auth.sql','862961815354DA2746F5F71FBC8155F57CBE75AB','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_02_auth.sql','33E4F94086590768EF5D4855DD43D7DE7C06ADA4','ARCHIVED','2015-03-21 21:44:51',0),('2015_08_21_00_auth.sql','C31A9E1D28E11B60BE8F8198637DD51F6D75123F','ARCHIVED','2015-10-05 23:16:19',0),('2015_11_07_00_auth.sql','BAF9F6B8F97A30D04BDBBA8127A62A1720F9B904','RELEASED','2015-11-07 15:40:47',0),('2016_01_13_00_auth.sql','24615CC69B3CD7BB4699874647C35BA86E8A93FD','RELEASED','2016-01-13 00:00:00',0);
+INSERT INTO `updates` VALUES ('2014_11_10_00_auth.sql','0E3CB119442D09DD88E967015319BBC8DAFBBFE0','ARCHIVED','2015-03-21 21:44:12',0),('2014_11_10_01_auth.sql','327E77A1DA3546D5275AB249915DD57EDD6FDD3D','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_10_00_auth.sql','821703A96D80F9080074852B5A46E2909C9562EA','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_21_00_auth.sql','CE2E5D2CD82E79C25294539ADED27A1429105B43','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_00_auth.sql','E8C5B74BB45F0F35DEC182C72BACF435C7066FB0','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_01_auth.sql','862961815354DA2746F5F71FBC8155F57CBE75AB','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_02_auth.sql','33E4F94086590768EF5D4855DD43D7DE7C06ADA4','ARCHIVED','2015-03-21 21:44:51',0),('2015_08_21_00_auth.sql','C31A9E1D28E11B60BE8F8198637DD51F6D75123F','ARCHIVED','2015-10-05 23:16:19',0),('2015_11_07_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 00:42:36',92),('2016_01_13_00_auth.sql','24615CC69B3CD7BB4699874647C35BA86E8A93FD','ARCHIVED','2016-01-13 00:00:00',0),('2016_04_11_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','RELEASED','2016-04-11 03:18:17',0),('2016_05_11_00_auth.sql','95B66235B8D67BF1CA216EB09F313C1F8F393B47','RELEASED','2016-04-16 13:17:11',0),('2016_06_06_00_auth.sql','57603BB68C340A8C919FB424452C282C47A193F7','RELEASED','2016-06-06 18:20',0);
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
UNLOCK TABLES;
@@ -549,4 +549,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2015-11-07 14:42:34
+-- Dump completed on 2016-04-11 2:32:16
diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql
index c57e54918e6..1f071db3781 100644
--- a/sql/base/characters_database.sql
+++ b/sql/base/characters_database.sql
@@ -1,6 +1,6 @@
-- MySQL dump 10.13 Distrib 5.6.26, for Win64 (x86_64)
--
--- Host: localhost Database: characters335
+-- Host: localhost Database: characters
-- ------------------------------------------------------
-- Server version 5.6.26-log
@@ -783,7 +783,7 @@ CREATE TABLE `character_instance` (
`guid` int(10) unsigned NOT NULL DEFAULT '0',
`instance` int(10) unsigned NOT NULL DEFAULT '0',
`permanent` tinyint(3) unsigned NOT NULL DEFAULT '0',
- `extendState` TINYINT(2) UNSIGNED NOT NULL DEFAULT '1',
+ `extendState` tinyint(2) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`guid`,`instance`),
KEY `instance` (`instance`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1272,8 +1272,13 @@ CREATE TABLE `characters` (
`level` tinyint(3) unsigned NOT NULL DEFAULT '0',
`xp` int(10) unsigned NOT NULL DEFAULT '0',
`money` int(10) unsigned NOT NULL DEFAULT '0',
- `playerBytes` int(10) unsigned NOT NULL DEFAULT '0',
- `playerBytes2` int(10) unsigned NOT NULL DEFAULT '0',
+ `skin` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `face` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `hairStyle` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `hairColor` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `facialStyle` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `bankSlots` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `restState` tinyint(3) unsigned NOT NULL DEFAULT '0',
`playerFlags` int(10) unsigned NOT NULL DEFAULT '0',
`position_x` float NOT NULL DEFAULT '0',
`position_y` float NOT NULL DEFAULT '0',
@@ -2540,7 +2545,7 @@ CREATE TABLE `updates` (
LOCK TABLES `updates` WRITE;
/*!40000 ALTER TABLE `updates` DISABLE KEYS */;
-INSERT INTO `updates` VALUES ('2015_03_20_00_characters.sql','B761760804EA73BD297F296C5C1919687DF7191C','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_01_characters.sql','894F08B70449A5481FFAF394EE5571D7FC4D8A3A','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_02_characters.sql','97D7BE0CAADC79F3F11B9FD296B8C6CD40FE593B','ARCHIVED','2015-03-21 21:44:51',0),('2015_06_26_00_characters_335.sql','C2CC6E50AFA1ACCBEBF77CC519AAEB09F3BBAEBC','ARCHIVED','2015-07-13 23:49:22',0),('2015_09_28_00_characters_335.sql','F8682A431D50E54BDC4AC0E7DBED21AE8AAB6AD4','ARCHIVED','2015-09-28 21:00:00',0),('2015_08_26_00_characters_335.sql','C7D6A3A00FECA3EBFF1E71744CA40D3076582374','ARCHIVED','2015-08-26 21:00:00',0),('2015_10_06_00_characters.sql','16842FDD7E8547F2260D3312F53EFF8761EFAB35','ARCHIVED','2015-10-06 16:06:38',0),('2015_10_07_00_characters.sql','E15AB463CEBE321001D7BFDEA4B662FF618728FD','ARCHIVED','2015-10-07 23:32:00',0),('2015_10_12_00_characters.sql','D6F9927BDED72AD0A81D6EC2C6500CBC34A39FA2','ARCHIVED','2015-10-12 15:35:47',0),('2015_10_28_00_characters.sql','622A9CA8FCE690429EBE23BA071A37C7A007BF8B','ARCHIVED','2015-10-19 14:32:22',0),('2015_10_29_00_characters_335.sql','4555A7F35C107E54C13D74D20F141039ED42943E','ARCHIVED','2015-10-29 17:05:43',0),('2015_11_03_00_characters.sql','CC045717B8FDD9733351E52A5302560CD08AAD57','ARCHIVED','2015-10-12 15:23:33',0),('2015_11_07_00_characters.sql','BAF9F6B8F97A30D04BDBBA8127A62A1720F9B904','RELEASED','2015-11-07 15:40:47',0),('2016_02_10_00_characters.sql','418F9639F558346E0F7A33512059906E94E30E49','RELEASED','2016-02-10 00:00:00',0);
+INSERT INTO `updates` VALUES ('2015_03_20_00_characters.sql','B761760804EA73BD297F296C5C1919687DF7191C','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_01_characters.sql','894F08B70449A5481FFAF394EE5571D7FC4D8A3A','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_02_characters.sql','97D7BE0CAADC79F3F11B9FD296B8C6CD40FE593B','ARCHIVED','2015-03-21 21:44:51',0),('2015_06_26_00_characters_335.sql','C2CC6E50AFA1ACCBEBF77CC519AAEB09F3BBAEBC','ARCHIVED','2015-07-13 23:49:22',0),('2015_09_28_00_characters_335.sql','F8682A431D50E54BDC4AC0E7DBED21AE8AAB6AD4','ARCHIVED','2015-09-28 21:00:00',0),('2015_08_26_00_characters_335.sql','C7D6A3A00FECA3EBFF1E71744CA40D3076582374','ARCHIVED','2015-08-26 21:00:00',0),('2015_10_06_00_characters.sql','16842FDD7E8547F2260D3312F53EFF8761EFAB35','ARCHIVED','2015-10-06 16:06:38',0),('2015_10_07_00_characters.sql','E15AB463CEBE321001D7BFDEA4B662FF618728FD','ARCHIVED','2015-10-07 23:32:00',0),('2015_10_12_00_characters.sql','D6F9927BDED72AD0A81D6EC2C6500CBC34A39FA2','ARCHIVED','2015-10-12 15:35:47',0),('2015_10_28_00_characters.sql','622A9CA8FCE690429EBE23BA071A37C7A007BF8B','ARCHIVED','2015-10-19 14:32:22',0),('2015_10_29_00_characters_335.sql','4555A7F35C107E54C13D74D20F141039ED42943E','ARCHIVED','2015-10-29 17:05:43',0),('2015_11_03_00_characters.sql','CC045717B8FDD9733351E52A5302560CD08AAD57','ARCHIVED','2015-10-12 15:23:33',0),('2015_11_07_00_characters.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 00:42:36',94),('2016_02_10_00_characters.sql','F1B4DA202819CABC7319A4470A2D224A34609E97','ARCHIVED','2016-02-10 00:00:00',0),('2016_03_13_2016_01_05_00_characters.sql','0EAD24977F40DE2476B4567DA2B477867CC0DA1A','ARCHIVED','2016-03-13 20:03:56',0),('2016_04_11_00_characters.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','RELEASED','2016-04-11 03:18:17',0);
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
UNLOCK TABLES;
@@ -2625,4 +2630,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2015-11-07 14:42:34
+-- Dump completed on 2016-04-11 2:32:17
diff --git a/sql/base/dev/README.TXT b/sql/base/dev/README.TXT
new file mode 100644
index 00000000000..2717026f35b
--- /dev/null
+++ b/sql/base/dev/README.TXT
@@ -0,0 +1 @@
+The file world_database.sql is intended to be used only by travis compile test system, don't import it, you will break your core.
diff --git a/sql/base/dev/world_database.sql b/sql/base/dev/world_database.sql
index 02318987448..85e7c2391da 100644
--- a/sql/base/dev/world_database.sql
+++ b/sql/base/dev/world_database.sql
@@ -1,6 +1,6 @@
-- MySQL dump 10.13 Distrib 5.6.26, for Win64 (x86_64)
--
--- Host: localhost Database: world335
+-- Host: localhost Database: world
-- ------------------------------------------------------
-- Server version 5.6.26-log
@@ -1022,7 +1022,7 @@ CREATE TABLE `game_tele` (
`map` smallint(5) unsigned NOT NULL DEFAULT '0',
`name` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=1425 DEFAULT CHARSET=utf8 COMMENT='Tele Command';
+) ENGINE=MyISAM AUTO_INCREMENT=1429 DEFAULT CHARSET=utf8 COMMENT='Tele Command';
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -3785,4 +3785,4 @@ CREATE TABLE `waypoints` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2015-11-07 14:42:45
+-- Dump completed on 2016-04-11 2:32:19
diff --git a/sql/updates/auth/2015_11_07_00_auth.sql b/sql/old/3.3.5a/auth/60_2016_04_11/2015_11_07_00_auth.sql
index be8a4d21b66..be8a4d21b66 100644
--- a/sql/updates/auth/2015_11_07_00_auth.sql
+++ b/sql/old/3.3.5a/auth/60_2016_04_11/2015_11_07_00_auth.sql
diff --git a/sql/updates/auth/2016_01_13_00_auth.sql b/sql/old/3.3.5a/auth/60_2016_04_11/2016_01_13_00_auth.sql
index c70d4c09468..c70d4c09468 100644
--- a/sql/updates/auth/2016_01_13_00_auth.sql
+++ b/sql/old/3.3.5a/auth/60_2016_04_11/2016_01_13_00_auth.sql
diff --git a/sql/updates/characters/2015_11_07_00_characters.sql b/sql/old/3.3.5a/characters/60_2016_04_11/2015_11_07_00_characters.sql
index be8a4d21b66..be8a4d21b66 100644
--- a/sql/updates/characters/2015_11_07_00_characters.sql
+++ b/sql/old/3.3.5a/characters/60_2016_04_11/2015_11_07_00_characters.sql
diff --git a/sql/updates/characters/2016_02_10_00_characters.sql b/sql/old/3.3.5a/characters/60_2016_04_11/2016_02_10_00_characters.sql
index d49ed155bc8..d49ed155bc8 100644
--- a/sql/updates/characters/2016_02_10_00_characters.sql
+++ b/sql/old/3.3.5a/characters/60_2016_04_11/2016_02_10_00_characters.sql
diff --git a/sql/old/3.3.5a/characters/60_2016_04_11/2016_03_13_2016_01_05_00_characters.sql b/sql/old/3.3.5a/characters/60_2016_04_11/2016_03_13_2016_01_05_00_characters.sql
new file mode 100644
index 00000000000..11850067be9
--- /dev/null
+++ b/sql/old/3.3.5a/characters/60_2016_04_11/2016_03_13_2016_01_05_00_characters.sql
@@ -0,0 +1,19 @@
+ALTER TABLE `characters`
+ ADD `skin` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `money`,
+ ADD `face` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `skin`,
+ ADD `hairStyle` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `face`,
+ ADD `hairColor` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `hairStyle`,
+ ADD `facialStyle` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `hairColor`,
+ ADD `bankSlots` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `facialStyle`,
+ ADD `restState` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `bankSlots`;
+
+UPDATE `characters` SET
+ `skin`=`playerBytes`&0xFF,
+ `face`=(`playerBytes`>>8)&0xFF,
+ `hairStyle`=(`playerBytes`>>16)&0xFF,
+ `hairColor`=(`playerBytes`>>24)&0xFF,
+ `facialStyle`=`playerBytes2`&0xFF,
+ `bankSlots`=(`playerBytes2`>>16)&0xFF,
+ `restState`=(`playerBytes2`>>24)&0xFF;
+
+ALTER TABLE `characters` DROP `playerBytes`, DROP `playerBytes2`;
diff --git a/sql/updates/world/2015_11_07_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_07_02_world.sql
index 3e23e0e629b..3e23e0e629b 100644
--- a/sql/updates/world/2015_11_07_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_07_02_world.sql
diff --git a/sql/updates/world/2015_11_08_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_08_00_world.sql
index fea6f43bc64..fea6f43bc64 100644
--- a/sql/updates/world/2015_11_08_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_08_00_world.sql
diff --git a/sql/updates/world/2015_11_08_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_08_01_world.sql
index f5642f73af4..f5642f73af4 100644
--- a/sql/updates/world/2015_11_08_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_08_01_world.sql
diff --git a/sql/updates/world/2015_11_09_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_09_00_world.sql
index 6fd5dec39b7..6fd5dec39b7 100644
--- a/sql/updates/world/2015_11_09_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_09_00_world.sql
diff --git a/sql/updates/world/2015_11_09_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_09_01_world.sql
index e9360cf8963..e9360cf8963 100644
--- a/sql/updates/world/2015_11_09_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_09_01_world.sql
diff --git a/sql/updates/world/2015_11_09_02_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_09_02_world_335.sql
index 84c0fd423ad..84c0fd423ad 100644
--- a/sql/updates/world/2015_11_09_02_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_09_02_world_335.sql
diff --git a/sql/updates/world/2015_11_10_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_10_00_world.sql
index 6e969f288f1..6e969f288f1 100644
--- a/sql/updates/world/2015_11_10_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_10_00_world.sql
diff --git a/sql/updates/world/2015_11_10_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_10_01_world.sql
index fe9c0b1b8e2..fe9c0b1b8e2 100644
--- a/sql/updates/world/2015_11_10_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_10_01_world.sql
diff --git a/sql/updates/world/2015_11_10_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_10_02_world.sql
index 8ff255defa4..8ff255defa4 100644
--- a/sql/updates/world/2015_11_10_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_10_02_world.sql
diff --git a/sql/updates/world/2015_11_11_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_11_00_world.sql
index 07393641f3f..07393641f3f 100644
--- a/sql/updates/world/2015_11_11_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_11_00_world.sql
diff --git a/sql/updates/world/2015_11_11_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_11_01_world.sql
index 3c1ce85ec17..3c1ce85ec17 100644
--- a/sql/updates/world/2015_11_11_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_11_01_world.sql
diff --git a/sql/updates/world/2015_11_12_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_12_00_world.sql
index 79c2461e5ff..79c2461e5ff 100644
--- a/sql/updates/world/2015_11_12_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_12_00_world.sql
diff --git a/sql/updates/world/2015_11_12_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_12_01_world.sql
index c08ebda2471..c08ebda2471 100644
--- a/sql/updates/world/2015_11_12_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_12_01_world.sql
diff --git a/sql/updates/world/2015_11_20_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_20_00_world.sql
index 7c5fe7ea426..7c5fe7ea426 100644
--- a/sql/updates/world/2015_11_20_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_20_00_world.sql
diff --git a/sql/updates/world/2015_11_22_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_00_world.sql
index 2b70a2c97b6..2b70a2c97b6 100644
--- a/sql/updates/world/2015_11_22_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_00_world.sql
diff --git a/sql/updates/world/2015_11_22_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_01_world.sql
index ba63c72ba16..ba63c72ba16 100644
--- a/sql/updates/world/2015_11_22_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_01_world.sql
diff --git a/sql/updates/world/2015_11_22_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_02_world.sql
index 7fcbc7ec9aa..7fcbc7ec9aa 100644
--- a/sql/updates/world/2015_11_22_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_02_world.sql
diff --git a/sql/updates/world/2015_11_22_03_world_355.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_03_world_355.sql
index 9bf71a146d0..9bf71a146d0 100644
--- a/sql/updates/world/2015_11_22_03_world_355.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_22_03_world_355.sql
diff --git a/sql/updates/world/2015_11_23_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_00_world_335.sql
index fffc4531e5e..fffc4531e5e 100644
--- a/sql/updates/world/2015_11_23_00_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_00_world_335.sql
diff --git a/sql/updates/world/2015_11_23_01_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_01_world_335.sql
index 8432c2d14fd..8432c2d14fd 100644
--- a/sql/updates/world/2015_11_23_01_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_01_world_335.sql
diff --git a/sql/updates/world/2015_11_23_02_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_02_world_335.sql
index ba569d1420f..ba569d1420f 100644
--- a/sql/updates/world/2015_11_23_02_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_02_world_335.sql
diff --git a/sql/updates/world/2015_11_23_03_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_03_world_335.sql
index 9ef011f551e..9ef011f551e 100644
--- a/sql/updates/world/2015_11_23_03_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_03_world_335.sql
diff --git a/sql/updates/world/2015_11_23_04_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_04_world_335.sql
index 845eefeb7ca..845eefeb7ca 100644
--- a/sql/updates/world/2015_11_23_04_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_04_world_335.sql
diff --git a/sql/updates/world/2015_11_23_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_05_world.sql
index 579af5a5ca1..579af5a5ca1 100644
--- a/sql/updates/world/2015_11_23_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_23_05_world.sql
diff --git a/sql/updates/world/2015_11_24_00_world_355.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_24_00_world_355.sql
index 0983d03e649..0983d03e649 100644
--- a/sql/updates/world/2015_11_24_00_world_355.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_24_00_world_355.sql
diff --git a/sql/updates/world/2015_11_27_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_27_00_world.sql
index 632dec537dd..632dec537dd 100644
--- a/sql/updates/world/2015_11_27_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_27_00_world.sql
diff --git a/sql/updates/world/2015_11_28_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_28_00_world.sql
index 0a1dd574fb4..0a1dd574fb4 100644
--- a/sql/updates/world/2015_11_28_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_28_00_world.sql
diff --git a/sql/updates/world/2015_11_28_01_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_28_01_world_335.sql
index 4bec178ecee..4bec178ecee 100644
--- a/sql/updates/world/2015_11_28_01_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_28_01_world_335.sql
diff --git a/sql/updates/world/2015_11_29_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_29_00_world.sql
index fd64b65bd02..fd64b65bd02 100644
--- a/sql/updates/world/2015_11_29_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_29_00_world.sql
diff --git a/sql/updates/world/2015_11_29_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_29_01_world.sql
index cd46800c5dd..cd46800c5dd 100644
--- a/sql/updates/world/2015_11_29_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_11_29_01_world.sql
diff --git a/sql/updates/world/2015_12_01_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_01_00_world.sql
index 1572245a517..1572245a517 100644
--- a/sql/updates/world/2015_12_01_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_01_00_world.sql
diff --git a/sql/updates/world/2015_12_04_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_04_00_world.sql
index ee721273bef..ee721273bef 100644
--- a/sql/updates/world/2015_12_04_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_04_00_world.sql
diff --git a/sql/updates/world/2015_12_05_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_05_00_world.sql
index c2c90164a4f..c2c90164a4f 100644
--- a/sql/updates/world/2015_12_05_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_05_00_world.sql
diff --git a/sql/updates/world/2015_12_06_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_06_00_world.sql
index b60d4d3e88c..b60d4d3e88c 100644
--- a/sql/updates/world/2015_12_06_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_06_00_world.sql
diff --git a/sql/updates/world/2015_12_08_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_08_00_world_335.sql
index e742130b1a4..e742130b1a4 100644
--- a/sql/updates/world/2015_12_08_00_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_08_00_world_335.sql
diff --git a/sql/updates/world/2015_12_08_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_08_01_world.sql
index 9e24acd91db..9e24acd91db 100644
--- a/sql/updates/world/2015_12_08_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_08_01_world.sql
diff --git a/sql/updates/world/2015_12_08_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_08_02_world.sql
index 375d0941adb..375d0941adb 100644
--- a/sql/updates/world/2015_12_08_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_08_02_world.sql
diff --git a/sql/updates/world/2015_12_09_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_09_00_world.sql
index 6ac4da31404..6ac4da31404 100644
--- a/sql/updates/world/2015_12_09_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_09_00_world.sql
diff --git a/sql/updates/world/2015_12_09_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_09_01_world.sql
index d27bc7ff49a..d27bc7ff49a 100644
--- a/sql/updates/world/2015_12_09_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_09_01_world.sql
diff --git a/sql/updates/world/2015_12_11_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_11_00_world.sql
index dc5fd8c40b6..dc5fd8c40b6 100644
--- a/sql/updates/world/2015_12_11_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_11_00_world.sql
diff --git a/sql/updates/world/2015_12_14_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_14_00_world.sql
index 85faf4448e2..85faf4448e2 100644
--- a/sql/updates/world/2015_12_14_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_14_00_world.sql
diff --git a/sql/updates/world/2015_12_15_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_00_world.sql
index f27bb448bbd..f27bb448bbd 100644
--- a/sql/updates/world/2015_12_15_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_00_world.sql
diff --git a/sql/updates/world/2015_12_15_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_01_world.sql
index 86fbec83c38..86fbec83c38 100644
--- a/sql/updates/world/2015_12_15_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_01_world.sql
diff --git a/sql/updates/world/2015_12_15_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_02_world.sql
index eda5c26550f..eda5c26550f 100644
--- a/sql/updates/world/2015_12_15_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_02_world.sql
diff --git a/sql/updates/world/2015_12_15_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_03_world.sql
index 99cc9e14646..99cc9e14646 100644
--- a/sql/updates/world/2015_12_15_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_15_03_world.sql
diff --git a/sql/updates/world/2015_12_16_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_16_00_world.sql
index 62d640117f7..62d640117f7 100644
--- a/sql/updates/world/2015_12_16_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_16_00_world.sql
diff --git a/sql/updates/world/2015_12_16_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_16_01_world.sql
index 73c9675e5be..73c9675e5be 100644
--- a/sql/updates/world/2015_12_16_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_16_01_world.sql
diff --git a/sql/updates/world/2015_12_16_02_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_16_02_world_335.sql
index 20c1ac94a39..20c1ac94a39 100644
--- a/sql/updates/world/2015_12_16_02_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_16_02_world_335.sql
diff --git a/sql/updates/world/2015_12_17_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_17_00_world.sql
index 8419473b203..8419473b203 100644
--- a/sql/updates/world/2015_12_17_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_17_00_world.sql
diff --git a/sql/updates/world/2015_12_18_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_00_world_335.sql
index 3fb3e5a6e1e..3fb3e5a6e1e 100644
--- a/sql/updates/world/2015_12_18_00_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_00_world_335.sql
diff --git a/sql/updates/world/2015_12_18_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_01_world.sql
index 2ccc93def23..2ccc93def23 100644
--- a/sql/updates/world/2015_12_18_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_01_world.sql
diff --git a/sql/updates/world/2015_12_18_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_02_world.sql
index f590d18a8ab..f590d18a8ab 100644
--- a/sql/updates/world/2015_12_18_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_02_world.sql
diff --git a/sql/updates/world/2015_12_18_03_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_03_world_335.sql
index de778343a0e..de778343a0e 100644
--- a/sql/updates/world/2015_12_18_03_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_03_world_335.sql
diff --git a/sql/updates/world/2015_12_18_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_04_world.sql
index c8c3352319c..c8c3352319c 100644
--- a/sql/updates/world/2015_12_18_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_18_04_world.sql
diff --git a/sql/updates/world/2015_12_20_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_20_00_world.sql
index 7c658877f13..7c658877f13 100644
--- a/sql/updates/world/2015_12_20_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_20_00_world.sql
diff --git a/sql/updates/world/2015_12_24_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_24_00_world.sql
index 52d83bb63c3..52d83bb63c3 100644
--- a/sql/updates/world/2015_12_24_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_24_00_world.sql
diff --git a/sql/updates/world/2015_12_26_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_26_00_world.sql
index 02c0acbedae..02c0acbedae 100644
--- a/sql/updates/world/2015_12_26_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_26_00_world.sql
diff --git a/sql/updates/world/2015_12_26_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_26_01_world.sql
index 92a9d21af25..92a9d21af25 100644
--- a/sql/updates/world/2015_12_26_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_26_01_world.sql
diff --git a/sql/updates/world/2015_12_26_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_26_02_world.sql
index 021dec0be80..021dec0be80 100644
--- a/sql/updates/world/2015_12_26_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_26_02_world.sql
diff --git a/sql/updates/world/2015_12_29_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_00_world.sql
index da6de123190..da6de123190 100644
--- a/sql/updates/world/2015_12_29_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_00_world.sql
diff --git a/sql/updates/world/2015_12_29_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_01_world.sql
index 24b201b4d06..24b201b4d06 100644
--- a/sql/updates/world/2015_12_29_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_01_world.sql
diff --git a/sql/updates/world/2015_12_29_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_02_world.sql
index 3bfd0ba2a25..3bfd0ba2a25 100644
--- a/sql/updates/world/2015_12_29_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_02_world.sql
diff --git a/sql/updates/world/2015_12_29_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_03_world.sql
index f928061c269..f928061c269 100644
--- a/sql/updates/world/2015_12_29_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_03_world.sql
diff --git a/sql/updates/world/2015_12_29_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_04_world.sql
index 22a1ee3edcf..22a1ee3edcf 100644
--- a/sql/updates/world/2015_12_29_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_04_world.sql
diff --git a/sql/updates/world/2015_12_29_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_05_world.sql
index 056ea4fe230..056ea4fe230 100644
--- a/sql/updates/world/2015_12_29_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_05_world.sql
diff --git a/sql/updates/world/2015_12_29_06_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_06_world.sql
index 167c4c23005..167c4c23005 100644
--- a/sql/updates/world/2015_12_29_06_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_06_world.sql
diff --git a/sql/updates/world/2015_12_29_07_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_07_world.sql
index ec71d28c787..ec71d28c787 100644
--- a/sql/updates/world/2015_12_29_07_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_07_world.sql
diff --git a/sql/updates/world/2015_12_29_08_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_08_world.sql
index ce874d7a8d2..ce874d7a8d2 100644
--- a/sql/updates/world/2015_12_29_08_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_08_world.sql
diff --git a/sql/updates/world/2015_12_29_09_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_09_world.sql
index d57785e8d88..d57785e8d88 100644
--- a/sql/updates/world/2015_12_29_09_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_09_world.sql
diff --git a/sql/updates/world/2015_12_29_10_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_10_world.sql
index 919309dd558..919309dd558 100644
--- a/sql/updates/world/2015_12_29_10_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_10_world.sql
diff --git a/sql/updates/world/2015_12_29_11_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_11_world.sql
index 930baf15f78..930baf15f78 100644
--- a/sql/updates/world/2015_12_29_11_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_11_world.sql
diff --git a/sql/updates/world/2015_12_29_12_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_12_world.sql
index c065e1d6a18..c065e1d6a18 100644
--- a/sql/updates/world/2015_12_29_12_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_12_world.sql
diff --git a/sql/updates/world/2015_12_29_13_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_13_world.sql
index fc182ae49fb..fc182ae49fb 100644
--- a/sql/updates/world/2015_12_29_13_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_29_13_world.sql
diff --git a/sql/updates/world/2015_12_31_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_31_00_world.sql
index b7c310323ed..b7c310323ed 100644
--- a/sql/updates/world/2015_12_31_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_31_00_world.sql
diff --git a/sql/updates/world/2015_12_31_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_31_01_world.sql
index 3bee62963ef..3bee62963ef 100644
--- a/sql/updates/world/2015_12_31_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2015_12_31_01_world.sql
diff --git a/sql/updates/world/2016_01_01_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_01_00_world.sql
index 38991837113..38991837113 100644
--- a/sql/updates/world/2016_01_01_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_01_00_world.sql
diff --git a/sql/updates/world/2016_01_01_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_01_01_world.sql
index 025f2c07f9c..025f2c07f9c 100644
--- a/sql/updates/world/2016_01_01_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_01_01_world.sql
diff --git a/sql/updates/world/2016_01_02_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_02_00_world_335.sql
index b46a41bc6e9..b46a41bc6e9 100644
--- a/sql/updates/world/2016_01_02_00_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_02_00_world_335.sql
diff --git a/sql/updates/world/2016_01_02_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_02_01_world.sql
index b862cc0e644..b862cc0e644 100644
--- a/sql/updates/world/2016_01_02_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_02_01_world.sql
diff --git a/sql/updates/world/2016_01_03_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_00_world_335.sql
index 658b180a41a..658b180a41a 100644
--- a/sql/updates/world/2016_01_03_00_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_00_world_335.sql
diff --git a/sql/updates/world/2016_01_03_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_01_world.sql
index 3ddb56a9c72..3ddb56a9c72 100644
--- a/sql/updates/world/2016_01_03_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_01_world.sql
diff --git a/sql/updates/world/2016_01_03_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_02_world.sql
index 79eba012e41..79eba012e41 100644
--- a/sql/updates/world/2016_01_03_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_02_world.sql
diff --git a/sql/updates/world/2016_01_03_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_03_world.sql
index 1b1766ee557..1b1766ee557 100644
--- a/sql/updates/world/2016_01_03_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_03_world.sql
diff --git a/sql/updates/world/2016_01_03_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_04_world.sql
index ffe8eb07fd5..ffe8eb07fd5 100644
--- a/sql/updates/world/2016_01_03_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_04_world.sql
diff --git a/sql/updates/world/2016_01_03_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_05_world.sql
index 4c2fe0817f0..4c2fe0817f0 100644
--- a/sql/updates/world/2016_01_03_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_03_05_world.sql
diff --git a/sql/updates/world/2016_01_04_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_04_00_world.sql
index 57236a6f66e..57236a6f66e 100644
--- a/sql/updates/world/2016_01_04_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_04_00_world.sql
diff --git a/sql/updates/world/2016_01_05_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_05_00_world.sql
index 3f7f01449fc..3f7f01449fc 100644
--- a/sql/updates/world/2016_01_05_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_05_00_world.sql
diff --git a/sql/updates/world/2016_01_05_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_05_01_world.sql
index dc1064a75b9..dc1064a75b9 100644
--- a/sql/updates/world/2016_01_05_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_05_01_world.sql
diff --git a/sql/updates/world/2016_01_05_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_05_02_world.sql
index 64909129e60..64909129e60 100644
--- a/sql/updates/world/2016_01_05_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_05_02_world.sql
diff --git a/sql/updates/world/2016_01_07_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_07_00_world.sql
index d36dda80e50..d36dda80e50 100644
--- a/sql/updates/world/2016_01_07_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_07_00_world.sql
diff --git a/sql/updates/world/2016_01_07_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_07_01_world.sql
index 4a15aa405ec..4a15aa405ec 100644
--- a/sql/updates/world/2016_01_07_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_07_01_world.sql
diff --git a/sql/updates/world/2016_01_07_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_07_02_world.sql
index 7724b42ac9d..7724b42ac9d 100644
--- a/sql/updates/world/2016_01_07_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_07_02_world.sql
diff --git a/sql/updates/world/2016_01_08_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_00_world.sql
index 55ed3ddf336..55ed3ddf336 100644
--- a/sql/updates/world/2016_01_08_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_00_world.sql
diff --git a/sql/updates/world/2016_01_08_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_01_world.sql
index ebf4560d326..ebf4560d326 100644
--- a/sql/updates/world/2016_01_08_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_01_world.sql
diff --git a/sql/updates/world/2016_01_08_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_02_world.sql
index 28e55dfba3b..28e55dfba3b 100644
--- a/sql/updates/world/2016_01_08_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_02_world.sql
diff --git a/sql/updates/world/2016_01_08_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_03_world.sql
index 2899c6e06eb..2899c6e06eb 100644
--- a/sql/updates/world/2016_01_08_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_08_03_world.sql
diff --git a/sql/updates/world/2016_01_09_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_09_00_world.sql
index 534e17ccb00..534e17ccb00 100644
--- a/sql/updates/world/2016_01_09_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_09_00_world.sql
diff --git a/sql/updates/world/2016_01_10_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_00_world.sql
index 83ed21c8489..83ed21c8489 100644
--- a/sql/updates/world/2016_01_10_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_00_world.sql
diff --git a/sql/updates/world/2016_01_10_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_01_world.sql
index c79c157a1a1..c79c157a1a1 100644
--- a/sql/updates/world/2016_01_10_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_01_world.sql
diff --git a/sql/updates/world/2016_01_10_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_02_world.sql
index eca8ef07849..eca8ef07849 100644
--- a/sql/updates/world/2016_01_10_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_02_world.sql
diff --git a/sql/updates/world/2016_01_10_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_03_world.sql
index 5ac352ffe10..5ac352ffe10 100644
--- a/sql/updates/world/2016_01_10_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_03_world.sql
diff --git a/sql/updates/world/2016_01_10_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_04_world.sql
index da6eed191ad..da6eed191ad 100644
--- a/sql/updates/world/2016_01_10_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_04_world.sql
diff --git a/sql/updates/world/2016_01_10_05_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_05_world_335.sql
index 7fb021cc9dd..7fb021cc9dd 100644
--- a/sql/updates/world/2016_01_10_05_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_10_05_world_335.sql
diff --git a/sql/updates/world/2016_01_12_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_00_world.sql
index 8ed4099450b..8ed4099450b 100644
--- a/sql/updates/world/2016_01_12_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_00_world.sql
diff --git a/sql/updates/world/2016_01_12_01_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_01_world_335.sql
index c3206e70ac4..c3206e70ac4 100644
--- a/sql/updates/world/2016_01_12_01_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_01_world_335.sql
diff --git a/sql/updates/world/2016_01_12_02_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_02_world_335.sql
index 354d0bc129d..354d0bc129d 100644
--- a/sql/updates/world/2016_01_12_02_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_02_world_335.sql
diff --git a/sql/updates/world/2016_01_12_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_03_world.sql
index 6ff3a769918..6ff3a769918 100644
--- a/sql/updates/world/2016_01_12_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_03_world.sql
diff --git a/sql/updates/world/2016_01_12_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_04_world.sql
index 7cee9220060..7cee9220060 100644
--- a/sql/updates/world/2016_01_12_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_12_04_world.sql
diff --git a/sql/updates/world/2016_01_13_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_13_00_world.sql
index cba5d3a18a1..cba5d3a18a1 100644
--- a/sql/updates/world/2016_01_13_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_13_00_world.sql
diff --git a/sql/updates/world/2016_01_15_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_15_00_world.sql
index b5f3da2dd99..b5f3da2dd99 100644
--- a/sql/updates/world/2016_01_15_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_15_00_world.sql
diff --git a/sql/updates/world/2016_01_16_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_00_world_335.sql
index 14362432555..14362432555 100644
--- a/sql/updates/world/2016_01_16_00_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_00_world_335.sql
diff --git a/sql/updates/world/2016_01_16_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_01_world.sql
index 235378a7a84..235378a7a84 100644
--- a/sql/updates/world/2016_01_16_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_01_world.sql
diff --git a/sql/updates/world/2016_01_16_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_02_world.sql
index b36d7d69ff6..b36d7d69ff6 100644
--- a/sql/updates/world/2016_01_16_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_02_world.sql
diff --git a/sql/updates/world/2016_01_16_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_03_world.sql
index 5a06cfaecca..5a06cfaecca 100644
--- a/sql/updates/world/2016_01_16_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_03_world.sql
diff --git a/sql/updates/world/2016_01_16_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_04_world.sql
index a6bb7ae185c..a6bb7ae185c 100644
--- a/sql/updates/world/2016_01_16_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_04_world.sql
diff --git a/sql/updates/world/2016_01_16_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_05_world.sql
index 46511cb0de8..46511cb0de8 100644
--- a/sql/updates/world/2016_01_16_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_16_05_world.sql
diff --git a/sql/updates/world/2016_01_17_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_00_world_335.sql
index abb3579fb07..abb3579fb07 100644
--- a/sql/updates/world/2016_01_17_00_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_00_world_335.sql
diff --git a/sql/updates/world/2016_01_17_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_01_world.sql
index 8e5bcd22a07..8e5bcd22a07 100644
--- a/sql/updates/world/2016_01_17_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_01_world.sql
diff --git a/sql/updates/world/2016_01_17_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_02_world.sql
index f019b927228..f019b927228 100644
--- a/sql/updates/world/2016_01_17_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_02_world.sql
diff --git a/sql/updates/world/2016_01_17_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_03_world.sql
index cf43c650888..cf43c650888 100644
--- a/sql/updates/world/2016_01_17_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_03_world.sql
diff --git a/sql/updates/world/2016_01_17_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_04_world.sql
index 6d72807e0b1..6d72807e0b1 100644
--- a/sql/updates/world/2016_01_17_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_04_world.sql
diff --git a/sql/updates/world/2016_01_17_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_05_world.sql
index 2d253bae713..2d253bae713 100644
--- a/sql/updates/world/2016_01_17_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_05_world.sql
diff --git a/sql/updates/world/2016_01_17_06_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_06_world.sql
index 659f146845a..659f146845a 100644
--- a/sql/updates/world/2016_01_17_06_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_06_world.sql
diff --git a/sql/updates/world/2016_01_17_07_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_07_world.sql
index df588168d38..df588168d38 100644
--- a/sql/updates/world/2016_01_17_07_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_07_world.sql
diff --git a/sql/updates/world/2016_01_17_08_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_08_world.sql
index 48cd420a242..48cd420a242 100644
--- a/sql/updates/world/2016_01_17_08_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_08_world.sql
diff --git a/sql/updates/world/2016_01_17_09_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_09_world.sql
index 85e6f535866..85e6f535866 100644
--- a/sql/updates/world/2016_01_17_09_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_09_world.sql
diff --git a/sql/updates/world/2016_01_17_10_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_10_world.sql
index 0fdc04eb60f..0fdc04eb60f 100644
--- a/sql/updates/world/2016_01_17_10_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_10_world.sql
diff --git a/sql/updates/world/2016_01_17_11_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_11_world.sql
index 9ab963a2ff2..9ab963a2ff2 100644
--- a/sql/updates/world/2016_01_17_11_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_11_world.sql
diff --git a/sql/updates/world/2016_01_17_12_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_12_world.sql
index e4e8ab5e9e2..e4e8ab5e9e2 100644
--- a/sql/updates/world/2016_01_17_12_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_12_world.sql
diff --git a/sql/updates/world/2016_01_17_13_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_13_world.sql
index 163aa3fb659..163aa3fb659 100644
--- a/sql/updates/world/2016_01_17_13_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_13_world.sql
diff --git a/sql/updates/world/2016_01_17_14_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_14_world.sql
index c8b9405abff..c8b9405abff 100644
--- a/sql/updates/world/2016_01_17_14_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_14_world.sql
diff --git a/sql/updates/world/2016_01_17_15_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_15_world.sql
index da949d7100d..da949d7100d 100644
--- a/sql/updates/world/2016_01_17_15_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_17_15_world.sql
diff --git a/sql/updates/world/2016_01_18_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_00_world.sql
index 85f41cfc0c5..85f41cfc0c5 100644
--- a/sql/updates/world/2016_01_18_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_00_world.sql
diff --git a/sql/updates/world/2016_01_18_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_01_world.sql
index 9768ecda6c0..9768ecda6c0 100644
--- a/sql/updates/world/2016_01_18_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_01_world.sql
diff --git a/sql/updates/world/2016_01_18_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_02_world.sql
index ec9a8748cc8..ec9a8748cc8 100644
--- a/sql/updates/world/2016_01_18_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_02_world.sql
diff --git a/sql/updates/world/2016_01_18_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_03_world.sql
index 4b8eb4ae0c9..4b8eb4ae0c9 100644
--- a/sql/updates/world/2016_01_18_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_03_world.sql
diff --git a/sql/updates/world/2016_01_18_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_04_world.sql
index 28ab2d96731..28ab2d96731 100644
--- a/sql/updates/world/2016_01_18_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_04_world.sql
diff --git a/sql/updates/world/2016_01_18_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_05_world.sql
index 0d28cd17642..0d28cd17642 100644
--- a/sql/updates/world/2016_01_18_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_05_world.sql
diff --git a/sql/updates/world/2016_01_18_06_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_06_world.sql
index f8b90c15f54..f8b90c15f54 100644
--- a/sql/updates/world/2016_01_18_06_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_18_06_world.sql
diff --git a/sql/updates/world/2016_01_19_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_00_world.sql
index f210b95c13a..f210b95c13a 100644
--- a/sql/updates/world/2016_01_19_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_00_world.sql
diff --git a/sql/updates/world/2016_01_19_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_01_world.sql
index a10bc7e278f..a10bc7e278f 100644
--- a/sql/updates/world/2016_01_19_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_01_world.sql
diff --git a/sql/updates/world/2016_01_19_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_02_world.sql
index 7c71156b248..7c71156b248 100644
--- a/sql/updates/world/2016_01_19_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_02_world.sql
diff --git a/sql/updates/world/2016_01_19_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_03_world.sql
index 0d559ace044..0d559ace044 100644
--- a/sql/updates/world/2016_01_19_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_03_world.sql
diff --git a/sql/updates/world/2016_01_19_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_04_world.sql
index f4fe95f5539..f4fe95f5539 100644
--- a/sql/updates/world/2016_01_19_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_04_world.sql
diff --git a/sql/updates/world/2016_01_19_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_05_world.sql
index 5afd9e2b8a5..5afd9e2b8a5 100644
--- a/sql/updates/world/2016_01_19_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_05_world.sql
diff --git a/sql/updates/world/2016_01_19_06_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_06_world.sql
index cece0c623bf..cece0c623bf 100644
--- a/sql/updates/world/2016_01_19_06_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_06_world.sql
diff --git a/sql/updates/world/2016_01_19_07_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_07_world.sql
index e1a72398a5f..e1a72398a5f 100644
--- a/sql/updates/world/2016_01_19_07_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_07_world.sql
diff --git a/sql/updates/world/2016_01_19_08_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_08_world.sql
index d078c059201..d078c059201 100644
--- a/sql/updates/world/2016_01_19_08_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_19_08_world.sql
diff --git a/sql/updates/world/2016_01_20_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_20_00_world.sql
index 26ce069edd8..26ce069edd8 100644
--- a/sql/updates/world/2016_01_20_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_20_00_world.sql
diff --git a/sql/updates/world/2016_01_20_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_20_01_world.sql
index b1c6e0de756..b1c6e0de756 100644
--- a/sql/updates/world/2016_01_20_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_20_01_world.sql
diff --git a/sql/updates/world/2016_01_20_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_20_02_world.sql
index d026c3cb478..d026c3cb478 100644
--- a/sql/updates/world/2016_01_20_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_20_02_world.sql
diff --git a/sql/updates/world/2016_01_23_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_23_00_world.sql
index 02eaa7c370d..02eaa7c370d 100644
--- a/sql/updates/world/2016_01_23_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_23_00_world.sql
diff --git a/sql/updates/world/2016_01_24_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_24_00_world.sql
index a28b3fa25b8..a28b3fa25b8 100644
--- a/sql/updates/world/2016_01_24_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_24_00_world.sql
diff --git a/sql/updates/world/2016_01_26_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_26_00_world.sql
index 71fe8dc21e3..71fe8dc21e3 100644
--- a/sql/updates/world/2016_01_26_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_26_00_world.sql
diff --git a/sql/updates/world/2016_01_28_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_28_00_world_335.sql
index 64b32cb2d89..64b32cb2d89 100644
--- a/sql/updates/world/2016_01_28_00_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_28_00_world_335.sql
diff --git a/sql/updates/world/2016_01_28_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_28_01_world.sql
index 3c4cadb310d..3c4cadb310d 100644
--- a/sql/updates/world/2016_01_28_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_28_01_world.sql
diff --git a/sql/updates/world/2016_01_30_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_00_world_335.sql
index 43025f581d7..43025f581d7 100644
--- a/sql/updates/world/2016_01_30_00_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_00_world_335.sql
diff --git a/sql/updates/world/2016_01_30_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_01_world.sql
index c9405c4ee61..c9405c4ee61 100644
--- a/sql/updates/world/2016_01_30_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_01_world.sql
diff --git a/sql/updates/world/2016_01_30_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_02_world.sql
index 25325dddd7a..25325dddd7a 100644
--- a/sql/updates/world/2016_01_30_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_02_world.sql
diff --git a/sql/updates/world/2016_01_30_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_03_world.sql
index 06c4b0826c0..06c4b0826c0 100644
--- a/sql/updates/world/2016_01_30_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_03_world.sql
diff --git a/sql/updates/world/2016_01_30_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_04_world.sql
index b90e7b95810..b90e7b95810 100644
--- a/sql/updates/world/2016_01_30_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_04_world.sql
diff --git a/sql/updates/world/2016_01_30_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_05_world.sql
index 1e341506dfc..1e341506dfc 100644
--- a/sql/updates/world/2016_01_30_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_30_05_world.sql
diff --git a/sql/updates/world/2016_01_31_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_31_00_world.sql
index f64d9182784..f64d9182784 100644
--- a/sql/updates/world/2016_01_31_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_01_31_00_world.sql
diff --git a/sql/updates/world/2016_02_02_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_02_00_world.sql
index ce561af3a61..ce561af3a61 100644
--- a/sql/updates/world/2016_02_02_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_02_00_world.sql
diff --git a/sql/updates/world/2016_02_02_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_02_01_world.sql
index f1b181a29e3..f1b181a29e3 100644
--- a/sql/updates/world/2016_02_02_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_02_01_world.sql
diff --git a/sql/updates/world/2016_02_04_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_04_00_world.sql
index 758286544af..758286544af 100644
--- a/sql/updates/world/2016_02_04_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_04_00_world.sql
diff --git a/sql/updates/world/2016_02_05_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_05_00_world.sql
index 46f2b488b9a..46f2b488b9a 100644
--- a/sql/updates/world/2016_02_05_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_05_00_world.sql
diff --git a/sql/updates/world/2016_02_06_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_00_world.sql
index d303a8b5b85..d303a8b5b85 100644
--- a/sql/updates/world/2016_02_06_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_00_world.sql
diff --git a/sql/updates/world/2016_02_06_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_01_world.sql
index 6812c4af52e..6812c4af52e 100644
--- a/sql/updates/world/2016_02_06_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_01_world.sql
diff --git a/sql/updates/world/2016_02_06_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_02_world.sql
index b9fd7cd9d63..b9fd7cd9d63 100644
--- a/sql/updates/world/2016_02_06_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_02_world.sql
diff --git a/sql/updates/world/2016_02_06_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_03_world.sql
index 85f8d3c6ae7..85f8d3c6ae7 100644
--- a/sql/updates/world/2016_02_06_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_03_world.sql
diff --git a/sql/updates/world/2016_02_06_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_04_world.sql
index 188b3b5f2a7..188b3b5f2a7 100644
--- a/sql/updates/world/2016_02_06_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_04_world.sql
diff --git a/sql/updates/world/2016_02_06_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_05_world.sql
index 823a8abaca6..823a8abaca6 100644
--- a/sql/updates/world/2016_02_06_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_05_world.sql
diff --git a/sql/updates/world/2016_02_06_06_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_06_world.sql
index 37df2ef0868..37df2ef0868 100644
--- a/sql/updates/world/2016_02_06_06_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_06_world.sql
diff --git a/sql/updates/world/2016_02_06_07_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_07_world.sql
index c5d6434321a..c5d6434321a 100644
--- a/sql/updates/world/2016_02_06_07_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_07_world.sql
diff --git a/sql/updates/world/2016_02_06_08_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_08_world.sql
index f0855ba348a..f0855ba348a 100644
--- a/sql/updates/world/2016_02_06_08_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_08_world.sql
diff --git a/sql/updates/world/2016_02_06_09_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_09_world.sql
index bf92b89e1c2..bf92b89e1c2 100644
--- a/sql/updates/world/2016_02_06_09_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_09_world.sql
diff --git a/sql/updates/world/2016_02_06_10_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_10_world.sql
index 291bd0bb333..291bd0bb333 100644
--- a/sql/updates/world/2016_02_06_10_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_10_world.sql
diff --git a/sql/updates/world/2016_02_06_11_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_11_world.sql
index cea352fec36..cea352fec36 100644
--- a/sql/updates/world/2016_02_06_11_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_11_world.sql
diff --git a/sql/updates/world/2016_02_06_12_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_12_world.sql
index df550156bc1..df550156bc1 100644
--- a/sql/updates/world/2016_02_06_12_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_12_world.sql
diff --git a/sql/updates/world/2016_02_06_13_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_13_world_335.sql
index 22bd5596d98..22bd5596d98 100644
--- a/sql/updates/world/2016_02_06_13_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_13_world_335.sql
diff --git a/sql/updates/world/2016_02_06_14_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_14_world.sql
index 7bf05b61c71..7bf05b61c71 100644
--- a/sql/updates/world/2016_02_06_14_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_06_14_world.sql
diff --git a/sql/updates/world/2016_02_07_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_00_world.sql
index 5a49f8fd310..5a49f8fd310 100644
--- a/sql/updates/world/2016_02_07_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_00_world.sql
diff --git a/sql/updates/world/2016_02_07_01_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_01_world_335.sql
index 5f1d5f4280e..5f1d5f4280e 100644
--- a/sql/updates/world/2016_02_07_01_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_01_world_335.sql
diff --git a/sql/updates/world/2016_02_07_02_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_02_world_335.sql
index ea4608f3a6b..ea4608f3a6b 100644
--- a/sql/updates/world/2016_02_07_02_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_02_world_335.sql
diff --git a/sql/updates/world/2016_02_07_03_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_03_world_335.sql
index 8322ff59c4c..8322ff59c4c 100644
--- a/sql/updates/world/2016_02_07_03_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_03_world_335.sql
diff --git a/sql/updates/world/2016_02_07_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_04_world.sql
index 3a3a7a393d7..3a3a7a393d7 100644
--- a/sql/updates/world/2016_02_07_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_04_world.sql
diff --git a/sql/updates/world/2016_02_07_05_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_05_world_335.sql
index 794b3d80411..794b3d80411 100644
--- a/sql/updates/world/2016_02_07_05_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_05_world_335.sql
diff --git a/sql/updates/world/2016_02_07_06_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_06_world.sql
index 31ecf826660..31ecf826660 100644
--- a/sql/updates/world/2016_02_07_06_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_06_world.sql
diff --git a/sql/updates/world/2016_02_07_07_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_07_world_335.sql
index af323a47bda..af323a47bda 100644
--- a/sql/updates/world/2016_02_07_07_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_07_world_335.sql
diff --git a/sql/updates/world/2016_02_07_08_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_08_world_335.sql
index 2b78a317f95..2b78a317f95 100644
--- a/sql/updates/world/2016_02_07_08_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_08_world_335.sql
diff --git a/sql/updates/world/2016_02_07_09_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_09_world.sql
index 8057534fbb8..8057534fbb8 100644
--- a/sql/updates/world/2016_02_07_09_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_09_world.sql
diff --git a/sql/updates/world/2016_02_07_10_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_10_world.sql
index c2e59c15d9c..c2e59c15d9c 100644
--- a/sql/updates/world/2016_02_07_10_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_10_world.sql
diff --git a/sql/updates/world/2016_02_07_11_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_11_world.sql
index c40b663c205..c40b663c205 100644
--- a/sql/updates/world/2016_02_07_11_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_11_world.sql
diff --git a/sql/updates/world/2016_02_07_12_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_12_world.sql
index c85265d857d..c85265d857d 100644
--- a/sql/updates/world/2016_02_07_12_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_12_world.sql
diff --git a/sql/updates/world/2016_02_07_13_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_13_world.sql
index 612fef2274d..612fef2274d 100644
--- a/sql/updates/world/2016_02_07_13_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_13_world.sql
diff --git a/sql/updates/world/2016_02_07_14_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_14_world.sql
index 6550e53f9c9..6550e53f9c9 100644
--- a/sql/updates/world/2016_02_07_14_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_14_world.sql
diff --git a/sql/updates/world/2016_02_07_15_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_15_world.sql
index ceec02f881b..ceec02f881b 100644
--- a/sql/updates/world/2016_02_07_15_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_07_15_world.sql
diff --git a/sql/updates/world/2016_02_08_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_00_world_335.sql
index 83091035e3c..83091035e3c 100644
--- a/sql/updates/world/2016_02_08_00_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_00_world_335.sql
diff --git a/sql/updates/world/2016_02_08_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_01_world.sql
index 9f8fa3dc4ed..9f8fa3dc4ed 100644
--- a/sql/updates/world/2016_02_08_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_01_world.sql
diff --git a/sql/updates/world/2016_02_08_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_02_world.sql
index 0f22abafe8e..0f22abafe8e 100644
--- a/sql/updates/world/2016_02_08_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_02_world.sql
diff --git a/sql/updates/world/2016_02_08_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_03_world.sql
index fe429cf42c8..fe429cf42c8 100644
--- a/sql/updates/world/2016_02_08_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_03_world.sql
diff --git a/sql/updates/world/2016_02_08_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_04_world.sql
index f8a9e2c776a..f8a9e2c776a 100644
--- a/sql/updates/world/2016_02_08_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_04_world.sql
diff --git a/sql/updates/world/2016_02_08_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_05_world.sql
index d2cc597a6ac..d2cc597a6ac 100644
--- a/sql/updates/world/2016_02_08_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_05_world.sql
diff --git a/sql/updates/world/2016_02_08_06_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_06_world.sql
index c9e93889790..c9e93889790 100644
--- a/sql/updates/world/2016_02_08_06_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_06_world.sql
diff --git a/sql/updates/world/2016_02_08_07_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_07_world.sql
index 1d90630d829..1d90630d829 100644
--- a/sql/updates/world/2016_02_08_07_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_07_world.sql
diff --git a/sql/updates/world/2016_02_08_08_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_08_world.sql
index ae4f454bc91..ae4f454bc91 100644
--- a/sql/updates/world/2016_02_08_08_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_08_08_world.sql
diff --git a/sql/updates/world/2016_02_09_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_00_world.sql
index c93a1d8fed1..c93a1d8fed1 100644
--- a/sql/updates/world/2016_02_09_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_00_world.sql
diff --git a/sql/updates/world/2016_02_09_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_01_world.sql
index 7878ea7faa2..7878ea7faa2 100644
--- a/sql/updates/world/2016_02_09_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_01_world.sql
diff --git a/sql/updates/world/2016_02_09_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_02_world.sql
index 891c8c2ff4b..891c8c2ff4b 100644
--- a/sql/updates/world/2016_02_09_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_02_world.sql
diff --git a/sql/updates/world/2016_02_09_02_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_02_world_335.sql
index a8612c5d88d..a8612c5d88d 100644
--- a/sql/updates/world/2016_02_09_02_world_335.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_02_world_335.sql
diff --git a/sql/updates/world/2016_02_09_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_03_world.sql
index bd012f0d172..bd012f0d172 100644
--- a/sql/updates/world/2016_02_09_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_03_world.sql
diff --git a/sql/updates/world/2016_02_09_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_04_world.sql
index 015ab519557..015ab519557 100644
--- a/sql/updates/world/2016_02_09_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_04_world.sql
diff --git a/sql/updates/world/2016_02_09_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_05_world.sql
index 3612c270d02..3612c270d02 100644
--- a/sql/updates/world/2016_02_09_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_05_world.sql
diff --git a/sql/updates/world/2016_02_09_06_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_06_world.sql
index 03fe998cca5..03fe998cca5 100644
--- a/sql/updates/world/2016_02_09_06_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_06_world.sql
diff --git a/sql/updates/world/2016_02_09_07_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_07_world.sql
index 84d65e2eda5..84d65e2eda5 100644
--- a/sql/updates/world/2016_02_09_07_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_07_world.sql
diff --git a/sql/updates/world/2016_02_09_08_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_08_world.sql
index 307a9f9a0b3..307a9f9a0b3 100644
--- a/sql/updates/world/2016_02_09_08_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_09_08_world.sql
diff --git a/sql/updates/world/2016_02_10_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_00_world.sql
index 872861b08dc..872861b08dc 100644
--- a/sql/updates/world/2016_02_10_00_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_00_world.sql
diff --git a/sql/updates/world/2016_02_10_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_01_world.sql
index 9ffe2e81c1c..9ffe2e81c1c 100644
--- a/sql/updates/world/2016_02_10_01_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_01_world.sql
diff --git a/sql/updates/world/2016_02_10_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_02_world.sql
index 92ee165dd83..92ee165dd83 100644
--- a/sql/updates/world/2016_02_10_02_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_02_world.sql
diff --git a/sql/updates/world/2016_02_10_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_03_world.sql
index f52872c3431..f52872c3431 100644
--- a/sql/updates/world/2016_02_10_03_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_03_world.sql
diff --git a/sql/updates/world/2016_02_10_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_04_world.sql
index 1349b83f442..1349b83f442 100644
--- a/sql/updates/world/2016_02_10_04_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_04_world.sql
diff --git a/sql/updates/world/2016_02_10_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_05_world.sql
index c19dd8feb06..c19dd8feb06 100644
--- a/sql/updates/world/2016_02_10_05_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_05_world.sql
diff --git a/sql/updates/world/2016_02_10_06_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_06_world.sql
index 9e24ab31ce1..9e24ab31ce1 100644
--- a/sql/updates/world/2016_02_10_06_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_06_world.sql
diff --git a/sql/updates/world/2016_02_10_07_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_07_world.sql
index 5feb4f44163..5feb4f44163 100644
--- a/sql/updates/world/2016_02_10_07_world.sql
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_10_07_world.sql
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_00_world.sql
new file mode 100644
index 00000000000..b130133a2ca
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_00_world.sql
@@ -0,0 +1,6 @@
+-- Scarlet Insignia Ring - Questloot
+DELETE FROM `creature_loot_template` WHERE `Entry` IN (1538,1539,1540) AND `Item`= 2875;
+INSERT INTO `creature_loot_template` (`Entry`,`Item`,`Reference`,`Chance`,`QuestRequired`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`,`Comment`) VALUES
+(1538, 2875, 0, 40, 1, 1, 0, 1, 1, 'Scarlet Friar - Scarlet Insignia Ring'),
+(1539, 2875, 0, 40, 1, 1, 0, 1, 1, 'Scarlet Neophyte - Scarlet Insignia Ring'),
+(1540, 2875, 0, 40, 1, 1, 0, 1, 1, 'Scarlet Vanguard - Scarlet Insignia Ring');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_01_world.sql
new file mode 100644
index 00000000000..ec1c98659e1
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_01_world.sql
@@ -0,0 +1,5 @@
+-- Imperial Eagle SAI
+SET @ENTRY := 26369;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0 AND `id`=1;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,1,0,8,0,100,0,49546,0,0,0,41,4000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Imperial Eagle - On Spellhit 'Eagle Eyes' - Despawn In 4000 ms");
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_02_world.sql
new file mode 100644
index 00000000000..9228e2d99d7
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_02_world.sql
@@ -0,0 +1,18 @@
+-- DB/Item: Sealed Tome
+DELETE FROM `gameobject_loot_template` WHERE `Entry`=18509;
+INSERT INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
+(18509,1054,1054,100,0,1,1,1,1,NULL);
+
+DELETE FROM `reference_loot_template` WHERE `Entry`=1054;
+INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
+(1054,23864,0,0,0,1,1,1,1,NULL), -- Torment of the Worgen
+(1054,23857,0,0,0,1,1,1,1,NULL), -- Legacy of the Mountain King
+(1054,23862,0,0,0,1,1,1,1,NULL), -- Redemption of the Fallen
+(1054,23865,0,0,0,1,1,1,1, NULL); -- Wrath of the Titans
+
+DELETE FROM `conditions` WHERE `SourceEntry` IN (30562, 30557, 30550, 30567) AND `SourceTypeOrReferenceId`=17;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `Comment`) VALUES
+(17,0,30562,0,0,23,0,3457,0,0,0,0,0,'Legacy of the Mountain King needs area 3457'),
+(17,0,30557,0,0,23,0,3457,0,0,0,0,0,'Wrath of the Titans needs area 3457'),
+(17,0,30550,0,0,23,0,3457,0,0,0,0,0,'Redemption of the Fallen needs area 3457'),
+(17,0,30567,0,0,23,0,3457,0,0,0,0,0,'Torment of the Worgen needs area 3457');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_03_world.sql
new file mode 100644
index 00000000000..4dfefb12281
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_03_world.sql
@@ -0,0 +1,11 @@
+-- DB/Quest: Souls at Unrest
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceGroup`=0 AND `SourceEntry`=48974;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(17, 0, 48974, 0, 0, 31, 1, 3, 26891, 0, 0, 0, 0, '', 'Burn Corpse - only targets Undead Miner'),
+(17, 0, 48974, 0, 0, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Burn Corpse - only targets dead Undead Miner');
+
+-- Undead Miner SAI
+SET @ENTRY := 26891;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0 AND `id`=2;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,2,0,8,0,100,0,48974,0,0,0,41,2000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Undead Miner - On Spellhit 'Burn Corpse' - Despawn In 2000 ms");
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_04_world.sql
new file mode 100644
index 00000000000..41f648b5f6e
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_04_world.sql
@@ -0,0 +1,4 @@
+-- DB/Quest: The Exorcism ( Mage Quest 1955)
+DELETE FROM `smart_scripts` WHERE `entryorguid`=6546 AND `id`=5;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(6546, 0, 5, 0, 19, 0, 100, 0, 1955, 0, 0, 0, 80, 654600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tabetha - On Quest \'The Exorcism\' Taken - Run Script (No Repeat)');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_05_world.sql
new file mode 100644
index 00000000000..76b59765d08
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_05_world.sql
@@ -0,0 +1,2 @@
+-- Iron Rune Avenger
+UPDATE `creature_template` SET `flags_extra`=(`flags_extra`|2097152) WHERE `entry` IN (26786);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_06_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_06_world.sql
new file mode 100644
index 00000000000..bbf9880dca9
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_06_world.sql
@@ -0,0 +1,206 @@
+SET @OGUID:=79584;
+SET @CGUID:=61988;
+SET @Event:=7;
+
+-- Add missing lunar objects
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+182;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0 , 180766, 571, 1, 1, 5827.364, 638.9564, 647.2116, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613)
+(@OGUID+1 , 180766, 571, 1, 1, 5827.502, 645.6351, 647.1417, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613)
+(@OGUID+2 , 180766, 571, 1, 1, 5821.811, 633.4114, 647.1953, 0, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613)
+(@OGUID+3 , 180766, 571, 1, 1, 5822.486, 652.9247, 647.212, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613)
+(@OGUID+4 , 180766, 571, 1, 1, 5815.521, 643.1665, 647.1968, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613)
+(@OGUID+5 , 180766, 571, 1, 1, 5818.29, 648.6586, 647.173, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613)
+(@OGUID+6 , 180766, 571, 1, 1, 5818.406, 635.2549, 647.1855, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613)
+(@OGUID+7 , 180766, 571, 1, 1, 5816.469, 638.8152, 647.1979, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 4613)
+(@OGUID+8 , 180765, 571, 1, 1, 5862.578, 608.9785, 622.725, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4613)
+(@OGUID+9 , 180765, 571, 1, 1, 5818.557, 689.6754, 617.5377, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4613)
+(@OGUID+10 , 180765, 571, 1, 1, 5759.772, 714.2535, 653.2266, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4620)
+(@OGUID+11 , 180765, 571, 1, 1, 5760.561, 701.3275, 623.345, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 0)
+(@OGUID+12 , 180765, 571, 1, 1, 5731.914, 677.9752, 653.3376, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 0)
+(@OGUID+13 , 180765, 571, 1, 1, 5670.342, 779.5948, 669.5635, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4569)
+(@OGUID+14 , 180765, 571, 1, 1, 5753.294, 594.6252, 618.5057, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4560)
+(@OGUID+15 , 180765, 571, 1, 1, 5819.917, 557.6574, 655.4913, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 4570)
+(@OGUID+16 , 180878, 571, 1, 1, 5831.143, 655.095, 647.124, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613)
+(@OGUID+17 , 180878, 571, 1, 1, 5830.427, 655.5619, 647.1938, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613)
+(@OGUID+18 , 180878, 571, 1, 1, 5829.478, 652.8141, 647.3889, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613)
+(@OGUID+19 , 180878, 571, 1, 1, 5829.293, 656.304, 647.3473, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613)
+(@OGUID+20 , 180878, 571, 1, 1, 5830.003, 656.1676, 647.2794, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613)
+(@OGUID+21 , 180878, 571, 1, 1, 5829.671, 655.4982, 647.2844, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613)
+(@OGUID+22 , 180878, 571, 1, 1, 5828.868, 653.2474, 647.4297, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 4613)
+(@OGUID+23 , 180770, 571, 1, 1, 5948.266, 620.9393, 660.9077, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4613)
+(@OGUID+24 , 180770, 571, 1, 1, 5885.173, 625.6719, 667.6763, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4613)
+(@OGUID+25 , 180770, 571, 1, 1, 5834.693, 718.492, 659.2477, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4613)
+(@OGUID+26 , 180770, 571, 1, 1, 5728.38, 609.739, 668.472, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4560)
+(@OGUID+27 , 180770, 571, 1, 1, 5671.689, 646.728, 664.1037, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4560)
+(@OGUID+28 , 180770, 571, 1, 1, 5783.651, 561.3226, 663.734, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4560)
+(@OGUID+29 , 180770, 571, 1, 1, 5659.569, 679.338, 662.2587, 5.864307, 0, 0, 0, 1, 120, 255, 1), -- 180770 (Area: 4560)
+(@OGUID+30 , 180769, 571, 1, 1, 5909.365, 661.7691, 649.1791, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+31 , 180769, 571, 1, 1, 5886.387, 624.8147, 653.553, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+32 , 180769, 571, 1, 1, 5931.343, 575.7878, 615.0651, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+33 , 180769, 571, 1, 1, 5881.342, 611.066, 654.6136, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+34 , 180769, 571, 1, 1, 5901.177, 684.3577, 647.6432, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+35 , 180769, 571, 1, 1, 5929.563, 561.2188, 615.4888, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+36 , 180769, 571, 1, 1, 5913.596, 558.0538, 615.162, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+37 , 180769, 571, 1, 1, 5859.038, 634.4976, 653.8649, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+38 , 180769, 571, 1, 1, 5915.081, 710.2066, 646.7171, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+39 , 180769, 571, 1, 1, 5855.796, 664.7435, 653.7689, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+40 , 180769, 571, 1, 1, 5858.535, 699.8768, 647.4109, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+41 , 180769, 571, 1, 1, 5852.463, 690.137, 614.8257, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+42 , 180769, 571, 1, 1, 5873.14, 725.0781, 647.2786, 1.780234, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+43 , 180769, 571, 1, 1, 5883.378, 741.8604, 644.6421, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+44 , 180769, 571, 1, 1, 5817.372, 694.9447, 653.3386, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+45 , 180769, 571, 1, 1, 5901.752, 746.1671, 645.9257, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+46 , 180769, 571, 1, 1, 5864.876, 738.8313, 644.7396, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+47 , 180769, 571, 1, 1, 5835.081, 719.8969, 646.1445, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4613)
+(@OGUID+48 , 180769, 571, 1, 1, 5786.942, 691.6105, 653.3179, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4620)
+(@OGUID+49 , 180769, 571, 1, 1, 5768.04, 709.3449, 623.6602, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4620)
+(@OGUID+50 , 180769, 571, 1, 1, 5768.866, 732.3944, 645.68, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4620)
+(@OGUID+51 , 180769, 571, 1, 1, 5769.894, 668.6614, 650.4285, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 0)
+(@OGUID+52 , 180769, 571, 1, 1, 5788.438, 653.5104, 654.6097, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 0)
+(@OGUID+53 , 180769, 571, 1, 1, 5750.353, 646.9713, 656.329, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560)
+(@OGUID+54 , 180769, 571, 1, 1, 5753.372, 616.3696, 656.3885, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560)
+(@OGUID+55 , 180769, 571, 1, 1, 5730.582, 607.2877, 652.4621, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560)
+(@OGUID+56 , 180769, 571, 1, 1, 5687.786, 619.9709, 652.2067, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560)
+(@OGUID+57 , 180769, 571, 1, 1, 5675.173, 631.3223, 652.21, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560)
+(@OGUID+58 , 180769, 571, 1, 1, 5671.983, 646.4656, 652.1304, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560)
+(@OGUID+59 , 180769, 571, 1, 1, 5783.131, 561.6129, 655.8354, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560)
+(@OGUID+60 , 180769, 571, 1, 1, 5809.257, 575.9974, 656.7222, 4.834563, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4560)
+(@OGUID+61 , 180769, 571, 1, 1, 5844.062, 569.6259, 656.8289, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 4570)
+(@OGUID+62 , 180763, 571, 1, 1, 5944.821, 630.5286, 652.4573, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613)
+(@OGUID+63 , 180763, 571, 1, 1, 5890.119, 630.0712, 650.7103, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613)
+(@OGUID+64 , 180763, 571, 1, 1, 5883.333, 613.3351, 651.5501, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613)
+(@OGUID+65 , 180763, 571, 1, 1, 5983.581, 603.4676, 653.0666, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613)
+(@OGUID+66 , 180763, 571, 1, 1, 5986.168, 610.6107, 653.0659, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0)
+(@OGUID+67 , 180763, 571, 1, 1, 5913.733, 726.7258, 645.9022, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613)
+(@OGUID+68 , 180763, 571, 1, 1, 5820.595, 692.2194, 647.6371, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613)
+(@OGUID+69 , 180763, 571, 1, 1, 5867.973, 739.8099, 641.4172, 5.410522, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613)
+(@OGUID+70 , 180763, 571, 1, 1, 5903.759, 687.3698, 644.8055, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4620)
+(@OGUID+71 , 180763, 571, 1, 1, 5871.152, 724.772, 643.811, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4620)
+(@OGUID+72 , 180763, 571, 1, 1, 5752.106, 717.1315, 641.7864, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0)
+(@OGUID+73 , 180763, 571, 1, 1, 5746.831, 728.174, 641.7136, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0)
+(@OGUID+74 , 180763, 571, 1, 1, 5733.553, 726.9333, 642.7537, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0)
+(@OGUID+75 , 180763, 571, 1, 1, 5735.731, 678.2547, 647.2717, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0)
+(@OGUID+76 , 180763, 571, 1, 1, 5732.593, 674.2257, 647.2732, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+77 , 180763, 571, 1, 1, 5716.352, 722.8108, 643.5378, 0.9599299, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+78 , 180763, 571, 1, 1, 5709.845, 727.9358, 643.5585, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+79 , 180763, 571, 1, 1, 5703.215, 733.3229, 643.576, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+80 , 180763, 571, 1, 1, 5833.685, 645.7676, 610.1852, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+81 , 180763, 571, 1, 1, 5669.793, 808.6216, 655.2228, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569)
+(@OGUID+82 , 180763, 571, 1, 1, 5746.831, 728.174, 641.7136, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569)
+(@OGUID+83 , 180763, 571, 1, 1, 5657.733, 814.1997, 654.9894, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569)
+(@OGUID+84 , 180763, 571, 1, 1, 5640.182, 793.6152, 654.9894, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569)
+(@OGUID+85 , 180763, 571, 1, 1, 5648.342, 782.4639, 654.989, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569)
+(@OGUID+86 , 180763, 571, 1, 1, 5646.54, 805.8158, 654.9894, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569)
+(@OGUID+87 , 180763, 571, 1, 1, 5752.106, 717.1315, 641.7864, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4569)
+(@OGUID+88 , 180763, 571, 1, 1, 5733.553, 726.9333, 642.7537, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+89 , 180763, 571, 1, 1, 5820.595, 692.2194, 647.6371, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+90 , 180763, 571, 1, 1, 5703.215, 733.3229, 643.576, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+91 , 180763, 571, 1, 1, 5689.638, 617.3722, 649.33, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+92 , 180763, 571, 1, 1, 5668.561, 683.9375, 653.5638, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+93 , 180763, 571, 1, 1, 5821.209, 557.6127, 652.8544, 1.815142, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570)
+(@OGUID+94 , 180763, 571, 1, 1, 5845.696, 572.116, 653.2255, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570)
+(@OGUID+95 , 180763, 571, 1, 1, 5828.66, 517.7811, 659.3014, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570)
+(@OGUID+96 , 180763, 571, 1, 1, 5735.731, 678.2547, 647.2717, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570)
+(@OGUID+97 , 180763, 571, 1, 1, 5732.593, 674.2257, 647.2732, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570)
+(@OGUID+98 , 180763, 571, 1, 1, 5883.333, 613.3351, 651.5501, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570)
+(@OGUID+99 , 180763, 571, 1, 1, 5890.119, 630.0712, 650.7103, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4570)
+(@OGUID+100, 180763, 571, 1, 1, 5903.759, 687.3698, 644.8055, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0)
+(@OGUID+101, 180763, 571, 1, 1, 5944.821, 630.5286, 652.4573, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0)
+(@OGUID+102, 180763, 571, 1, 1, 5939.341, 616.0452, 652.3865, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0)
+(@OGUID+103, 180763, 571, 1, 1, 5871.152, 724.772, 643.811, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 0)
+(@OGUID+104, 180763, 571, 1, 1, 5983.581, 603.4676, 653.0666, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+105, 180763, 571, 1, 1, 5828.66, 517.7811, 659.3014, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4560)
+(@OGUID+106, 180763, 571, 1, 1, 5872.536, 687.5123, 647.7181, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4613)
+(@OGUID+107, 180763, 571, 1, 1, 5812.34, 554.8807, 652.9316, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4616)
+(@OGUID+108, 180763, 571, 1, 1, 5820.595, 692.2194, 647.6371, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4739)
+(@OGUID+109, 180763, 571, 1, 1, 5735.731, 678.2547, 647.2717, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4739)
+(@OGUID+110, 180763, 571, 1, 1, 5733.001, 605.4604, 649.6217, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 4739)
+(@OGUID+111, 180764, 571, 1, 1, 5939.341, 616.0452, 652.3865, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+112, 180764, 571, 1, 1, 5930.153, 592.1089, 640.6768, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+113, 180764, 571, 1, 1, 5920.96, 592.6715, 640.6837, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+114, 180764, 571, 1, 1, 5938.111, 587.7853, 640.6421, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+115, 180764, 571, 1, 1, 5912.436, 589.316, 640.6563, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+116, 180764, 571, 1, 1, 5943.503, 581.1985, 640.6602, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+117, 180764, 571, 1, 1, 5946.514, 572.8181, 640.6762, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+118, 180764, 571, 1, 1, 5986.168, 610.6107, 653.0659, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+119, 180764, 571, 1, 1, 5945.639, 564.164, 640.7072, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+120, 180764, 571, 1, 1, 5941.456, 556.3479, 640.7192, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+121, 180764, 571, 1, 1, 5934.847, 550.7705, 640.6883, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+122, 180764, 571, 1, 1, 5864.014, 600.7278, 652.6012, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+123, 180764, 571, 1, 1, 5903.759, 687.3698, 644.8055, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+124, 180764, 571, 1, 1, 5853.561, 587.517, 652.7214, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+125, 180764, 571, 1, 1, 5872.536, 687.5123, 647.7181, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+126, 180764, 571, 1, 1, 5914.998, 716.574, 643.6473, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+127, 180764, 571, 1, 1, 5893.063, 706.0598, 648.3202, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+128, 180764, 571, 1, 1, 5890.119, 630.0712, 650.7103, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0)
+(@OGUID+129, 180764, 571, 1, 1, 5938.111, 587.7853, 640.6421, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0)
+(@OGUID+130, 180764, 571, 1, 1, 5983.581, 603.4676, 653.0666, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0)
+(@OGUID+131, 180764, 571, 1, 1, 5912.436, 589.316, 640.6563, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0)
+(@OGUID+132, 180764, 571, 1, 1, 5934.847, 550.7705, 640.6883, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0)
+(@OGUID+133, 180764, 571, 1, 1, 5872.536, 687.5123, 647.7181, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+134, 180764, 571, 1, 1, 5945.639, 564.164, 640.7072, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+135, 180764, 571, 1, 1, 5833.685, 645.7676, 610.1852, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+136, 180764, 571, 1, 1, 5827.226, 645.5917, 648.326, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+137, 180764, 571, 1, 1, 5845.696, 572.116, 653.2255, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+138, 180764, 571, 1, 1, 5871.152, 724.772, 643.811, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+139, 180764, 571, 1, 1, 5816.614, 639.0052, 648.413, 2.164206, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+140, 180764, 571, 1, 1, 5883.333, 613.3351, 651.5501, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+141, 180764, 571, 1, 1, 5898.784, 746.4573, 642.1553, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4613)
+(@OGUID+142, 180764, 571, 1, 1, 5893.063, 706.0598, 648.3202, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4620)
+(@OGUID+143, 180764, 571, 1, 1, 5763.81, 725.4814, 620.0308, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4620)
+(@OGUID+144, 180764, 571, 1, 1, 5763.81, 725.4814, 620.0308, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560)
+(@OGUID+145, 180764, 571, 1, 1, 5867.973, 739.8099, 641.4172, 5.410522, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560)
+(@OGUID+146, 180764, 571, 1, 1, 5872.536, 687.5123, 647.7181, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560)
+(@OGUID+147, 180764, 571, 1, 1, 5733.001, 605.4604, 649.6217, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560)
+(@OGUID+148, 180764, 571, 1, 1, 5674.231, 639.6476, 649.1661, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560)
+(@OGUID+149, 180764, 571, 1, 1, 5785.611, 560.2617, 652.6686, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560)
+(@OGUID+150, 180764, 571, 1, 1, 5812.34, 554.8807, 652.9316, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560)
+(@OGUID+151, 180764, 571, 1, 1, 5662.389, 669.6667, 653.5421, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560)
+(@OGUID+152, 180764, 571, 1, 1, 5853.561, 587.517, 652.7214, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4570)
+(@OGUID+153, 180764, 571, 1, 1, 5864.014, 600.7278, 652.6012, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4570)
+(@OGUID+154, 180764, 571, 1, 1, 5920.96, 592.6715, 640.6837, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0)
+(@OGUID+155, 180764, 571, 1, 1, 5912.436, 589.316, 640.6563, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0)
+(@OGUID+156, 180764, 571, 1, 1, 5930.153, 592.1089, 640.6768, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0)
+(@OGUID+157, 180764, 571, 1, 1, 5938.111, 587.7853, 640.6421, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 0)
+(@OGUID+158, 180764, 571, 1, 1, 5943.503, 581.1985, 640.6602, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560)
+(@OGUID+159, 180764, 571, 1, 1, 5945.639, 564.164, 640.7072, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 4560)
+(@OGUID+160, 180879, 571, 1, 1, 5829.639, 654.4427, 647.3204, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 4613)
+(@OGUID+161, 180767, 571, 1, 1, 5867.941, 616.2357, 622.7247, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4613)
+(@OGUID+162, 180767, 571, 1, 1, 5897.854, 555.5522, 648.3434, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4613)
+(@OGUID+163, 180767, 571, 1, 1, 5892.568, 549.7327, 648.2482, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4613)
+(@OGUID+164, 180767, 571, 1, 1, 5814.174, 684.2547, 617.5809, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4613)
+(@OGUID+165, 180767, 571, 1, 1, 5774.229, 717.9037, 623.3556, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4620)
+(@OGUID+166, 180767, 571, 1, 1, 5770.015, 581.1361, 618.5083, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4560)
+(@OGUID+167, 180767, 571, 1, 1, 5813.308, 555.64, 655.5086, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 4560)
+(@OGUID+168, 188215, 571, 1, 1, 5927.629, 731.5903, 643.1697, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 188215 (Area: 4613)
+(@OGUID+169, 180880, 571, 1, 1, 5828.156, 651.3569, 647.5219, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 4613)
+(@OGUID+170, 180881, 571, 1, 1, 5829.097, 651.775, 647.4488, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 4613)
+(@OGUID+171, 180882, 571, 1, 1, 5829.017, 651.1241, 647.4738, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 4613)
+(@OGUID+172, 180883, 571, 1, 1, 5828.462, 652.3148, 647.4636, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 4613)
+(@OGUID+173, 180883, 571, 1, 1, 5828.013, 651.9222, 647.5066, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 4613)
+(@OGUID+174, 180868, 571, 1, 1, 5820.396, 633.1682, 647.392, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613)
+(@OGUID+175, 180868, 571, 1, 1, 5818.986, 634.1285, 647.392, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613)
+(@OGUID+176, 180868, 571, 1, 1, 5815.437, 644.6893, 647.392, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613)
+(@OGUID+177, 180868, 571, 1, 1, 5818.691, 650.1199, 647.3958, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613)
+(@OGUID+178, 180868, 571, 1, 1, 5817.034, 647.832, 647.392, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613)
+(@OGUID+179, 180868, 571, 1, 1, 5819.984, 651.618, 647.4, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613)
+(@OGUID+180, 180868, 571, 1, 1, 5816.064, 637.7977, 647.3924, 3.665196, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 4613)
+(@OGUID+181, 180869, 571, 1, 1, 5816.274, 646.3437, 647.392, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 4613)
+(@OGUID+182, 180869, 571, 1, 1, 5817.032, 636.2288, 647.392, 3.735006, 0, 0, 0, 1, 120, 255, 1); -- 180869 (Area: 4613)
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+182 AND `eventEntry`=@Event;
+INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+182;
+
+-- Add missing lunar spawns
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+5;
+INSERT INTO `creature` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `curhealth`) VALUES
+(@CGUID+0, 15892, 571, 5825.602, 642.9196, 647.8765, 3.106686, 120, 0), -- 15892 (Area: 4613)
+(@CGUID+1, 15892, 571, 5820.262, 646.1699, 647.8525, 5.235988, 120, 0), -- 15892 (Area: 4613)
+(@CGUID+2, 15892, 571, 5819.783, 639.3316, 647.9127, 1.029744, 120, 0), -- 15892 (Area: 4613)
+(@CGUID+3, 15898, 571, 5827.147, 654.6258, 647.5777, 3.159046, 120, 0), -- 15898 (Area: 4613) (Auras: )
+(@CGUID+4, 15895, 571, 5824.651, 657.0713, 647.6139, 3.246312, 120, 0), -- 15895 (Area: 4613) (Auras: )
+(@CGUID+5, 15897, 571, 5821.922, 642.784, 648.11, 5.166174, 120, 0); -- 15897 (Area: 4613) (Auras: 25824 - 25824)
+
+DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+5 AND `eventEntry`=@Event;
+INSERT INTO `game_event_creature` SELECT @Event, creature.guid FROM `creature` WHERE creature.guid BETWEEN @CGUID+0 AND @CGUID+5;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_07_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_07_world.sql
new file mode 100644
index 00000000000..e34106cb44c
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_11_07_world.sql
@@ -0,0 +1,145 @@
+SET @OGUID:=79767;
+SET @CGUID:=97677;
+SET @Event:=7;
+
+-- Add missing lunar objects
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+109;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0 , 180768, 530, 1, 1, -1813.065, 5493.691, -12.42814, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703)
+(@OGUID+1 , 180768, 530, 1, 1, -1810.529, 5502.124, -12.42814, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703)
+(@OGUID+2 , 180768, 530, 1, 1, -1797.383, 5484.879, -12.42814, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703)
+(@OGUID+3 , 180768, 530, 1, 1, -1802.372, 5503.944, -12.42814, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703)
+(@OGUID+4 , 180768, 530, 1, 1, -1804.87, 5483.975, -12.42814, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703)
+(@OGUID+5 , 180768, 530, 1, 1, -1796.439, 5505.653, -12.42814, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703)
+(@OGUID+6 , 180768, 530, 1, 1, -1791.092, 5498.224, -12.42814, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703)
+(@OGUID+7 , 180768, 530, 1, 1, -1793.718, 5492.52, -12.42814, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3703)
+(@OGUID+8 , 180768, 530, 1, 1, 9487.017, -7295.95, 14.34292, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487)
+(@OGUID+9 , 180768, 530, 1, 1, 9484.238, -7301.355, 14.38242, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487)
+(@OGUID+10 , 180768, 530, 1, 1, 9489.608, -7291.334, 14.31547, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487)
+(@OGUID+11 , 180768, 530, 1, 1, 9477.151, -7304.068, 14.36639, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487)
+(@OGUID+12 , 180768, 530, 1, 1, 9486.314, -7286.41, 14.28697, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487)
+(@OGUID+13 , 180768, 530, 1, 1, 9475.41, -7288.148, 14.25113, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487)
+(@OGUID+14 , 180768, 530, 1, 1, 9481.289, -7287.188, 14.267, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487)
+(@OGUID+15 , 180768, 530, 1, 1, 9470.736, -7293.924, 14.30253, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 180768 (Area: 3487)
+(@OGUID+16 , 180766, 530, 1, 1, -1784.918, 5443.967, -12.42814, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703)
+(@OGUID+17 , 180766, 530, 1, 1, -1782.34, 5432.168, -12.42814, 5.864307, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703)
+(@OGUID+18 , 180766, 530, 1, 1, -1779.882, 5450.221, -12.42814, 3.438303, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703)
+(@OGUID+19 , 180766, 530, 1, 1, -1771.785, 5447.635, -12.42814, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703)
+(@OGUID+20 , 180766, 530, 1, 1, -1768.499, 5435.3, -12.42814, 0.7853968, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703)
+(@OGUID+21 , 180766, 530, 1, 1, -1774.774, 5428.898, -12.42814, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703)
+(@OGUID+22 , 180766, 530, 1, 1, -1764.911, 5447.474, -12.42814, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703)
+(@OGUID+23 , 180766, 530, 1, 1, -1762.984, 5438.721, -12.42814, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 3703)
+(@OGUID+24 , 180778, 530, 1, 1, -1807.913, 5485.737, -12.42814, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180778 (Area: 3703)
+(@OGUID+25 , 180778, 530, 1, 1, -1812.186, 5490.322, -12.42814, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 180778 (Area: 3703)
+(@OGUID+26 , 180778, 530, 1, 1, 9471.936, -7298.056, 14.34922, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 180778 (Area: 3487)
+(@OGUID+27 , 180778, 530, 1, 1, 9474.56, -7301.353, 14.37097, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180778 (Area: 3487)
+(@OGUID+28 , 180878, 530, 1, 1, -1790.338, 5498.744, -12.42814, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+29 , 180878, 530, 1, 1, -1790.234, 5496.288, -12.42814, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+30 , 180878, 530, 1, 1, -1790.902, 5497.011, -12.42814, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+31 , 180878, 530, 1, 1, -1789.234, 5496.14, -12.42814, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+32 , 180878, 530, 1, 1, -1789.172, 5498.917, -12.42814, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+33 , 180878, 530, 1, 1, -1788.415, 5496.598, -12.42814, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+34 , 180878, 530, 1, 1, -1788.392, 5498.381, -12.42814, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+35 , 180878, 530, 1, 1, -1788.111, 5497.561, -12.42814, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+36 , 180878, 530, 1, 1, -1765.722, 5449.934, -12.42814, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+37 , 180878, 530, 1, 1, -1764.807, 5450.181, -12.42814, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+38 , 180878, 530, 1, 1, -1766.226, 5448.125, -12.42814, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+39 , 180878, 530, 1, 1, -1766.088, 5449.026, -12.42814, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+40 , 180878, 530, 1, 1, -1765.541, 5447.308, -12.42814, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+41 , 180878, 530, 1, 1, -1763.994, 5449.78, -12.42814, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+42 , 180878, 530, 1, 1, -1763.402, 5449.152, -12.42814, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3703)
+(@OGUID+43 , 180878, 530, 1, 1, 9491.685, -7292.46, 14.32974, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487)
+(@OGUID+44 , 180878, 530, 1, 1, 9490.622, -7293.794, 14.33648, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487)
+(@OGUID+45 , 180878, 530, 1, 1, 9491.373, -7293.285, 14.3349, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487)
+(@OGUID+46 , 180878, 530, 1, 1, 9489.716, -7293.833, 14.33415, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487)
+(@OGUID+47 , 180878, 530, 1, 1, 9488.958, -7293.352, 14.32843, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487)
+(@OGUID+48 , 180878, 530, 1, 1, 9491.266, -7291.555, 14.32187, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487)
+(@OGUID+49 , 180878, 530, 1, 1, 9488.673, -7292.52, 14.32149, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487)
+(@OGUID+50 , 180878, 530, 1, 1, 9488.967, -7291.694, 14.31627, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 3487)
+(@OGUID+51 , 180763, 530, 1, 1, -1804.848, 5484.874, -11.5462, 0.6981314, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703)
+(@OGUID+52 , 180763, 530, 1, 1, -1795.721, 5504.963, -11.49064, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703)
+(@OGUID+53 , 180763, 530, 1, 1, -1779.698, 5450.049, -11.14342, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703)
+(@OGUID+54 , 180763, 530, 1, 1, -1784.666, 5443.933, -11.10175, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703)
+(@OGUID+55 , 180763, 530, 1, 1, -1774.672, 5429.127, -11.12259, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703)
+(@OGUID+56 , 180763, 530, 1, 1, -1762.88, 5438.89, -11.18509, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 180763 (Area: 3703)
+(@OGUID+57 , 180764, 530, 1, 1, 9489.186, -7290.492, 15.29506, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 3487)
+(@OGUID+58 , 180764, 530, 1, 1, 9471.669, -7294.084, 15.2562, 0.6981314, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 3487)
+(@OGUID+59 , 180879, 530, 1, 1, -1764.911, 5448.846, -12.42814, 1.204277, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 3703)
+(@OGUID+60 , 180777, 530, 1, 1, -1784.936, 5439.937, -12.42814, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 3703)
+(@OGUID+61 , 180777, 530, 1, 1, -1784.008, 5435.997, -12.42814, 0.2094394, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 3703)
+(@OGUID+62 , 180880, 530, 1, 1, -1789.301, 5498.034, -11.72675, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 3703)
+(@OGUID+63 , 180880, 530, 1, 1, -1789.678, 5498.17, -11.71286, 1.989672, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 3703)
+(@OGUID+64 , 180880, 530, 1, 1, -1764.493, 5448.475, -10.58786, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 3703)
+(@OGUID+65 , 180880, 530, 1, 1, 9490.517, -7292.749, 15.03819, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 3487)
+(@OGUID+66 , 180880, 530, 1, 1, 9490.091, -7292.49, 15.04175, 1.989672, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 3487)
+(@OGUID+67 , 180881, 530, 1, 1, -1789.489, 5497.099, -11.74759, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 3703)
+(@OGUID+68 , 180881, 530, 1, 1, -1790.061, 5497.251, -11.74064, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 3703)
+(@OGUID+69 , 180881, 530, 1, 1, -1764.79, 5449.202, -10.61564, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 3703)
+(@OGUID+70 , 180881, 530, 1, 1, 9489.579, -7292.59, 15.02525, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 3487)
+(@OGUID+71 , 180881, 530, 1, 1, 9489.869, -7292.061, 15.01508, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 3487)
+(@OGUID+72 , 180882, 530, 1, 1, -1789.633, 5497.666, -11.7337, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 3703)
+(@OGUID+73 , 180882, 530, 1, 1, -1790.078, 5497.862, -11.7337, 4.956738, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 3703)
+(@OGUID+74 , 180882, 530, 1, 1, -1764.311, 5449.006, -10.6087, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 3703)
+(@OGUID+75 , 180882, 530, 1, 1, 9490.705, -7292.344, 15.01931, 4.956738, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 3487)
+(@OGUID+76 , 180882, 530, 1, 1, 9490.47, -7292.036, 15.02789, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 3487)
+(@OGUID+77 , 180883, 530, 1, 1, -1789.06, 5497.521, -11.7337, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 3703)
+(@OGUID+78 , 180883, 530, 1, 1, -1764.884, 5448.252, -10.58786, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 3703)
+(@OGUID+79 , 180883, 530, 1, 1, -1765.275, 5448.697, -10.6087, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 3703)
+(@OGUID+80 , 180883, 530, 1, 1, 9490.114, -7293.036, 15.03141, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 3487)
+(@OGUID+81 , 180888, 530, 1, 1, -1789.768, 5497.439, -12.42814, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180888 (Area: 3703)
+(@OGUID+82 , 180888, 530, 1, 1, 9489.949, -7292.669, 14.32627, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180888 (Area: 3487)
+(@OGUID+83 , 180868, 530, 1, 1, -1809.283, 5488.518, -12.42814, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+84 , 180868, 530, 1, 1, -1798.701, 5502.052, -12.42814, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+85 , 180868, 530, 1, 1, -1801.822, 5499.706, -12.42814, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+86 , 180868, 530, 1, 1, -1804.326, 5487.32, -12.42814, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+87 , 180868, 530, 1, 1, -1796.721, 5493.617, -12.42814, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+88 , 180868, 530, 1, 1, -1809.226, 5493.723, -12.42814, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+89 , 180868, 530, 1, 1, -1794.08, 5495.903, -12.42814, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+90 , 180868, 530, 1, 1, -1780.21, 5435.097, -12.42814, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+91 , 180868, 530, 1, 1, -1781.543, 5442.225, -12.42814, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+92 , 180868, 530, 1, 1, -1784.189, 5438.144, -12.42814, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+93 , 180868, 530, 1, 1, -1770.829, 5437.18, -12.42814, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+94 , 180868, 530, 1, 1, -1768.798, 5445.465, -12.42814, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+95 , 180868, 530, 1, 1, -1772.664, 5444.496, -12.42814, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+96 , 180868, 530, 1, 1, -1766.992, 5438.217, -12.42814, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3703)
+(@OGUID+97 , 180868, 530, 1, 1, 9487.395, -7292.862, 14.32032, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487)
+(@OGUID+98 , 180868, 530, 1, 1, 9485.133, -7294.792, 14.32811, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487)
+(@OGUID+99 , 180868, 530, 1, 1, 9483.845, -7288.145, 14.27744, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487)
+(@OGUID+100, 180868, 530, 1, 1, 9478.389, -7299.729, 14.37478, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487)
+(@OGUID+101, 180868, 530, 1, 1, 9474.005, -7299.41, 14.36638, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487)
+(@OGUID+102, 180868, 530, 1, 1, 9481.45, -7289.982, 14.28201, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487)
+(@OGUID+103, 180868, 530, 1, 1, 9474.831, -7294.813, 14.31686, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 3487)
+(@OGUID+104, 180869, 530, 1, 1, -1808.304, 5498.599, -12.42814, 5.148723, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 3703)
+(@OGUID+105, 180869, 530, 1, 1, -1799.88, 5487.621, -12.42814, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 3703)
+(@OGUID+106, 180869, 530, 1, 1, -1778.706, 5445.924, -12.42814, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 3703)
+(@OGUID+107, 180869, 530, 1, 1, -1775.92, 5433.098, -12.42814, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 3703)
+(@OGUID+108, 180869, 530, 1, 1, 9482.434, -7299.702, 14.37898, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 3487)
+(@OGUID+109, 180869, 530, 1, 1, 9476.028, -7289.976, 14.26634, 5.148723, 0, 0, 0, 1, 120, 255, 1); -- 180869 (Area: 3487)
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+109 AND `eventEntry`=@Event;
+INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+109;
+
+-- Add missing lunar spawns
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+17;
+INSERT INTO `creature` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `curhealth`) VALUES
+(@CGUID+0 , 15892, 530, -1781.75, 5438.715, -12.34481, 0.2617994, 120, 0), -- 15892 (Area: 3703)
+(@CGUID+1 , 15892, 530, -1775.563, 5444.455, -12.34481, 4.223697, 120, 0), -- 15892 (Area: 3703)
+(@CGUID+2 , 15892, 530, -1773.548, 5436.28, -12.3448, 2.495821, 120, 0), -- 15892 (Area: 3703)
+(@CGUID+3 , 15898, 530, -1790.075, 5499.826, -12.34481, 0.6981317, 120, 0), -- 15898 (Area: 3703)
+(@CGUID+4 , 15898, 530, -1763.572, 5447.717, -12.34481, 0.2268928, 120, 0), -- 15898 (Area: 3703) (Auras: )
+(@CGUID+5 , 15898, 530, 9490.617, -7290.235, 14.39641, 0.6981317, 120, 0), -- 15898 (Area: 3487)
+(@CGUID+6 , 15895, 530, -1794.924, 5506.388, -12.34481, 0.6806784, 120, 0), -- 15895 (Area: 3703)
+(@CGUID+7 , 15895, 530, -1762.115, 5439.025, -12.34481, 0.3316126, 120, 0), -- 15895 (Area: 3703) (Auras: )
+(@CGUID+8 , 15895, 530, 9487.328, -7285.737, 14.37371, 0.6806784, 120, 0), -- 15895 (Area: 3487)
+(@CGUID+9 , 15891, 530, -1799.079, 5491.603, -12.34481, 2.879793, 120, 0), -- 15891 (Area: 3703)
+(@CGUID+10, 15891, 530, -1804.241, 5498.248, -12.34481, 4.694936, 120, 0), -- 15891 (Area: 3703)
+(@CGUID+11, 15891, 530, -1807.636, 5489.974, -12.34481, 0.7504916, 120, 0), -- 15891 (Area: 3703)
+(@CGUID+12, 15891, 530, 9483.579, -7296.714, 14.43082, 2.879793, 120, 0), -- 15891 (Area: 3487)
+(@CGUID+13, 15891, 530, 9479.115, -7290.209, 14.36029, 4.694936, 120, 0), -- 15891 (Area: 3487)
+(@CGUID+14, 15891, 530, 9475.681, -7297.988, 14.43598, 0.7504916, 120, 0), -- 15891 (Area: 3487)
+(@CGUID+15, 15897, 530, -1804.344, 5492.794, -12.34481, 5.375614, 120, 0), -- 15897 (Area: 3703) (Auras: 25824 - 25824)
+(@CGUID+16, 15897, 530, -1778.063, 5439.687, -12.34481, 4.415683, 120, 0), -- 15897 (Area: 3703) (Auras: 25824 - 25824)
+(@CGUID+17, 15897, 530, 9479.258, -7295.212, 14.4095, 4.39823, 120, 0); -- 15897 (Area: 3487) (Auras: 25824 - 25824)
+
+DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+17 AND `eventEntry`=@Event;
+INSERT INTO `game_event_creature` SELECT @Event, creature.guid FROM `creature` WHERE creature.guid BETWEEN @CGUID+0 AND @CGUID+17;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_12_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_12_00_world.sql
new file mode 100644
index 00000000000..af599148e04
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_12_00_world.sql
@@ -0,0 +1,7 @@
+--
+-- Spawn creature ID 16399 Bloodsail Traitor:
+SET @CGUID := 1528; -- selected by TC team
+
+DELETE FROM `creature` WHERE `id` = 16399;
+INSERT INTO `creature` (`guid`,`id`,`map`,`zoneId`,`areaId`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`,`VerifiedBuild`) VALUES
+(@CGUID, 16399, 0, 0, 0, 1, 1, 2557, 1, -14184.4, 192.764, 20.6905, 3.735, 300, 0, 0, 2059, 0, 0, 0, 0, 0, 0);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_00_world.sql
new file mode 100644
index 00000000000..2341e33a8b5
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_00_world.sql
@@ -0,0 +1,4 @@
+SET @ENTRY:=23258;
+SET @AURA:=40670;
+DELETE FROM `creature_template_addon` WHERE `entry` = @ENTRY;
+INSERT INTO `creature_template_addon` (`entry`, `auras`) VALUES (@ENTRY, @AURA);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_01_world.sql
new file mode 100644
index 00000000000..29f94a9f41d
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_01_world.sql
@@ -0,0 +1,206 @@
+SET @OGUID:=79877;
+SET @Event:=7;
+
+-- Add missing lunar objects
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+152;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0 , 180879, 1, 1, 1, 7593.807, -2222.592, 469.1576, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 493)
+(@OGUID+1 , 180879, 1, 1, 1, 7595.46, -2226.798, 468.3849, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 493)
+(@OGUID+2 , 180879, 1, 1, 1, 7592.46, -2218.003, 469.6433, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 493)
+(@OGUID+3 , 180880, 1, 1, 1, 7593.197, -2221.986, 470.9921, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 493)
+(@OGUID+4 , 180880, 1, 1, 1, 7596.01, -2226.955, 470.215, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 493)
+(@OGUID+5 , 180880, 1, 1, 1, 7591.976, -2217.98, 471.4845, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 493)
+(@OGUID+6 , 180880, 1, 1, 1, 7593.209, -2218.238, 471.4679, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 493)
+(@OGUID+7 , 180881, 1, 1, 1, 7595.163, -2227.192, 470.1959, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 493)
+(@OGUID+8 , 180881, 1, 1, 1, 7594.063, -2222.041, 470.9863, 3.595379, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 493)
+(@OGUID+9 , 180881, 1, 1, 1, 7595.476, -2226.666, 470.2082, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 493)
+(@OGUID+10 , 180881, 1, 1, 1, 7592.764, -2218.324, 471.472, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 493)
+(@OGUID+11 , 180881, 1, 1, 1, 7592.445, -2217.559, 471.4581, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 493)
+(@OGUID+12 , 180882, 1, 1, 1, 7593.618, -2221.826, 470.969, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 493)
+(@OGUID+13 , 180882, 1, 1, 1, 7595.62, -2227.267, 470.2169, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 493)
+(@OGUID+14 , 180882, 1, 1, 1, 7595.934, -2226.421, 470.1891, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 493)
+(@OGUID+15 , 180882, 1, 1, 1, 7592.151, -2218.304, 471.4556, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 493)
+(@OGUID+16 , 180882, 1, 1, 1, 7592.401, -2218.573, 471.4416, 2.91469, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 493)
+(@OGUID+17 , 180883, 1, 1, 1, 7595.268, -2226.156, 470.2048, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 493)
+(@OGUID+18 , 180883, 1, 1, 1, 7594.821, -2226.714, 470.1994, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 493)
+(@OGUID+19 , 180883, 1, 1, 1, 7593.012, -2217.75, 471.4669, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 493)
+(@OGUID+20 , 180851, 1, 1, 1, 7564.366, -2224.284, 475.4654, 5.148725, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+21 , 180851, 1, 1, 1, 7600.833, -2219.168, 473.4156, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+22 , 180851, 1, 1, 1, 7588.353, -2200.221, 479.1006, 4.20625, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+23 , 180851, 1, 1, 1, 7592.721, -2256.181, 467.8657, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+24 , 180851, 1, 1, 1, 7600.807, -2205.065, 476.8404, 5.061459, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+25 , 180851, 1, 1, 1, 7588.353, -2200.221, 479.1006, 4.20625, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+26 , 180851, 1, 1, 1, 7612.306, -2222.548, 473.3903, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+27 , 180851, 1, 1, 1, 7577.153, -2226.377, 475.8007, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+28 , 180851, 1, 1, 1, 7573.452, -2244.367, 470.6506, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+29 , 180851, 1, 1, 1, 7588.164, -2211.207, 476.1555, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+30 , 180851, 1, 1, 1, 7581.566, -2236.441, 474.0557, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+31 , 180851, 1, 1, 1, 7607.799, -2215.778, 473.6258, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+32 , 180851, 1, 1, 1, 7592.721, -2256.181, 467.8657, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+33 , 180851, 1, 1, 1, 7579.257, -2243.993, 471.6541, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+34 , 180851, 1, 1, 1, 7612.306, -2222.548, 473.3903, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+35 , 180851, 1, 1, 1, 7600.601, -2238.859, 470.7188, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+36 , 180851, 1, 1, 1, 7588.164, -2211.207, 476.1555, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+37 , 180851, 1, 1, 1, 7617.579, -2233.563, 470.0322, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 180851 (Area: 493)
+(@OGUID+38 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+39 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+40 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+41 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+42 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+43 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+44 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+45 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+46 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+47 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+48 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+49 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+50 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+51 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+52 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+53 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+54 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+55 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+56 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+57 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+58 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+59 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+60 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+61 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+62 , 180861, 1, 1, 1, 7575.579, -2213.406, 477.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+63 , 180861, 1, 1, 1, 7575.579, -2213.406, 486.1616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+64 , 180861, 1, 1, 1, 7575.579, -2210.406, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180861 (Area: 493)
+(@OGUID+65 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+66 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+67 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+68 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+69 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+70 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+71 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+72 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+73 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+74 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+75 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+76 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+77 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+78 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+79 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+80 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+81 , 180864, 1, 1, 1, 7580.829, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+82 , 180864, 1, 1, 1, 7570.329, -2214.906, 481.6616, 4.084075, 0, 0, 0, 1, 120, 255, 1), -- 180864 (Area: 493)
+(@OGUID+83 , 180769, 1, 1, 1, 7879.087, -2219.161, 479.2853, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 2362)
+(@OGUID+84 , 180769, 1, 1, 1, 7837.341, -2197, 478.0439, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 2362)
+(@OGUID+85 , 180769, 1, 1, 1, 7868.952, -2191.253, 486.3665, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 2362)
+(@OGUID+86 , 180879, 1, 1, 1, 7946.622, -2621.156, 492.3542, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 2361)
+(@OGUID+87 , 180909, 1, 1, 1, 7946.665, -2621.123, 494.2065, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 180909 (Area: 2361)
+(@OGUID+88 , 180909, 1, 1, 1, 7946.252, -2621.753, 494.1519, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 180909 (Area: 2361)
+(@OGUID+89 , 180909, 1, 1, 1, 7946.777, -2621.559, 494.1994, 3.263772, 0, 0, 0, 1, 120, 255, 1), -- 180909 (Area: 2361)
+(@OGUID+90 , 180909, 1, 1, 1, 7947.238, -2621.351, 494.1782, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 180909 (Area: 2361)
+(@OGUID+91 , 180777, 1, 1, 1, 7951.528, -2615.867, 492.9226, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361)
+(@OGUID+92 , 180777, 1, 1, 1, 7948.855, -2629.297, 493.1261, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361)
+(@OGUID+93 , 180910, 1, 1, 1, 7946.681, -2621.326, 494.1927, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 180910 (Area: 2361)
+(@OGUID+94 , 188215, 1, 1, 1, 7947.822, -2622.942, 492.8509, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 188215 (Area: 2361) - !!! might be temporary spawn !!!
+(@OGUID+95 , 188215, 1, 1, 1, 7948.878, -2619.704, 492.7197, 2.303831, 0, 0, 0, 1, 120, 255, 1), -- 188215 (Area: 2361) - !!! might be temporary spawn !!!
+(@OGUID+96 , 180764, 1, 1, 1, 7781.23, -2437.568, 494.049, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 180764 (Area: 2361)
+(@OGUID+97 , 180769, 1, 1, 1, 7797.483, -2417.394, 497.058, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 2361)
+(@OGUID+98 , 180769, 1, 1, 1, 7439.099, -2809.767, 473.9281, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 180769 (Area: 656)
+(@OGUID+99 , 180777, 1, 1, 1, 7619.005, -2221.212, 469.807, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+100, 180777, 1, 1, 1, 7586.018, -2220.791, 471.5764, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+101, 180777, 1, 1, 1, 7591.077, -2214.273, 471.4059, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+102, 180777, 1, 1, 1, 7585.201, -2209.946, 473.8624, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+103, 180777, 1, 1, 1, 7580.083, -2215.166, 473.3982, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+104, 180777, 1, 1, 1, 7587.347, -2196.992, 476.204, 1.343901, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+105, 180777, 1, 1, 1, 7562.486, -2227.179, 471.6295, 3.595379, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+106, 180777, 1, 1, 1, 7571.573, -2207.698, 474.8347, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+107, 180777, 1, 1, 1, 7577.507, -2201.813, 475.4521, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+108, 180777, 1, 1, 1, 7497.841, -2203.225, 480.2202, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+109, 180777, 1, 1, 1, 7499.098, -2191.63, 480.452, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+110, 180777, 1, 1, 1, 7937.66, -2362.064, 488.5504, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2362)
+(@OGUID+111, 180777, 1, 1, 1, 7971.51, -2352.85, 488.2709, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2362)
+(@OGUID+112, 180777, 1, 1, 1, 7993.134, -2468.059, 489.5084, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361)
+(@OGUID+113, 180777, 1, 1, 1, 7960.454, -2515.816, 485.9554, 5.340709, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361)
+(@OGUID+114, 180777, 1, 1, 1, 7925.333, -2550.147, 486.0686, 4.101525, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361)
+(@OGUID+115, 180777, 1, 1, 1, 7951.528, -2615.867, 492.9226, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361)
+(@OGUID+116, 180777, 1, 1, 1, 7948.855, -2629.297, 493.1261, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 2361)
+(@OGUID+117, 180777, 1, 1, 1, 7530.31, -2850.198, 458.604, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 656)
+(@OGUID+118, 180777, 1, 1, 1, 7532.818, -2852.513, 458.175, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 656)
+(@OGUID+119, 180777, 1, 1, 1, 7562.452, -2873.018, 460.911, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 656)
+(@OGUID+120, 180777, 1, 1, 1, 7559.907, -2871.458, 460.6194, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 656)
+(@OGUID+121, 180875, 1, 1, 1, 7531.745, -2851.107, 457.8172, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 180875 (Area: 656)
+(@OGUID+122, 180875, 1, 1, 1, 7561.202, -2872.201, 459.9906, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 180875 (Area: 656)
+(@OGUID+123, 180773, 1, 1, 1, 7562.604, -2903.484, 462.9012, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 180773 (Area: 656)
+(@OGUID+124, 180773, 1, 1, 1, 7570.199, -2903.755, 462.812, 1.640607, 0, 0, 0, 1, 120, 255, 1), -- 180773 (Area: 656)
+(@OGUID+125, 180765, 1, 1, 1, 7478.559, -2652.309, 455.1449, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 656)
+(@OGUID+126, 180765, 1, 1, 1, 7532.16, -2467.022, 455.5912, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 0)
+(@OGUID+127, 180766, 1, 1, 1, 7572.346, -2366.04, 454.7335, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+128, 180766, 1, 1, 1, 7535.119, -2436.779, 453.7722, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+129, 180766, 1, 1, 1, 7528.662, -2481.222, 454.3387, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+130, 180766, 1, 1, 1, 7499.897, -2487.684, 457.2921, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+131, 180766, 1, 1, 1, 7520.417, -2504.377, 454.1295, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+132, 180766, 1, 1, 1, 7479.219, -2479.521, 461.8409, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+133, 180766, 1, 1, 1, 7497.929, -2564.247, 454.2826, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+134, 180766, 1, 1, 1, 7496.524, -2532.186, 452.8313, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+135, 180766, 1, 1, 1, 7464.938, -2691.611, 454.3436, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+136, 180766, 1, 1, 1, 7475.028, -2597.744, 452.8322, 1.239183, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+137, 180766, 1, 1, 1, 7483.91, -2632.364, 453.8647, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+138, 180766, 1, 1, 1, 7463.901, -2741.921, 459.2945, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+139, 180766, 1, 1, 1, 7494.413, -2822.02, 461.3461, 4.991644, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+140, 180766, 1, 1, 1, 7481.923, -2829.692, 461.2198, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+141, 180766, 1, 1, 1, 7461.356, -2813.827, 462.3748, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+142, 180766, 1, 1, 1, 7474.328, -2795.222, 462.4803, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+143, 180766, 1, 1, 1, 7461.583, -2802.854, 462.1353, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+144, 180766, 1, 1, 1, 7475.494, -2750.214, 460.2916, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+145, 180766, 1, 1, 1, 7533.194, -2849.556, 456.259, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+146, 180766, 1, 1, 1, 7560.079, -2900.277, 460.4167, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+147, 180766, 1, 1, 1, 7562.421, -2870.49, 458.3398, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+148, 180766, 1, 1, 1, 7572.878, -2900.665, 460.2018, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 656)
+(@OGUID+149, 180767, 1, 1, 1, 7472.893, -2651.321, 455.1381, 5.480334, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 656)
+(@OGUID+150, 180767, 1, 1, 1, 7526.87, -2464.803, 455.183, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 0)
+(@OGUID+151, 180767, 1, 1, 1, 7553.503, -2401.662, 456.9937, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 180767 (Area: 0)
+(@OGUID+152, 180767, 1, 1, 1, 7547.994, -2399.728, 456.7213, 0.8203033, 0, 0, 0, 1, 120, 255, 1); -- 180767 (Area: 0)
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+152 AND `eventEntry`=@Event;
+INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+152;
+
+UPDATE `creature_addon` SET `emote`=0 WHERE `guid` IN (91639, 91644, 91657, 91658, 91663, 91669, 91671, 91676);
+
+-- Darnassus Reveler SAI
+SET @ENTRY := 15905;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Darnassus Reveler - Out of Combat - Play Random Emote (11, 94)");
+
+-- Ironforge Reveler SAI
+SET @ENTRY := 15906;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Ironforge Reveler - Out of Combat - Play Random Emote (11, 94)");
+
+-- Stormwind Reveler SAI
+SET @ENTRY := 15694;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Stormwind Reveler - Out of Combat - Play Random Emote (11, 94)");
+
+-- Orgrimmar Reveler SAI
+SET @ENTRY := 15908;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Orgrimmar Reveler - Out of Combat - Play Random Emote (11, 94)");
+
+-- Thunder Bluff Reveler SAI
+SET @ENTRY := 15719;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Thunder Bluff Reveler - Out of Combat - Play Random Emote (11, 94)");
+
+-- Undercity Reveler SAI
+SET @ENTRY := 15907;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,1,0,100,0,5000,5000,5000,10000,10,11,94,0,0,0,0,1,0,0,0,0,0,0,0,"Undercity Reveler - Out of Combat - Play Random Emote (11, 94)");
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_02_world.sql
new file mode 100644
index 00000000000..5a4633fee41
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_02_world.sql
@@ -0,0 +1,74 @@
+-- Update aura for Manifest Nightmare
+UPDATE `creature_template_addon` SET `auras`='39579 37509' WHERE `entry`=22889;
+-- Update aura for Phantasmal Lash
+UPDATE `creature_template_addon` SET `auras`='34427' WHERE `entry`=22902;
+
+-- Pathing for Moonglade Warden Entry: 11822 'TDB FORMAT'
+SET @NPC := 42393;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7546.649,`position_y`=-2901.733,`position_z`=462.5362 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7546.649,-2901.733,462.5362,0,0,0,0,100,0), -- 13:28:53
+(@PATH,2,7528.728,-2908.457,461.338,0,0,0,0,100,0), -- 13:28:57
+(@PATH,3,7517.918,-2920.282,461.923,0,0,0,0,100,0), -- 13:29:03
+(@PATH,4,7512.568,-2933.285,464.4847,0,0,0,0,100,0), -- 13:29:09
+(@PATH,5,7509.731,-2947.129,463.4818,0,0,0,0,100,0), -- 13:29:15
+(@PATH,6,7510.136,-2952.441,461.5912,0,0,0,0,100,0), -- 13:29:20
+(@PATH,7,7511.554,-2961.568,462.0287,0,0,0,0,100,0), -- 13:29:26
+(@PATH,8,7529.275,-2970.313,461.0047,0,0,0,0,100,0), -- 13:29:30
+(@PATH,9,7534.475,-2972.501,460.6516,0,0,0,0,100,0), -- 13:29:36
+(@PATH,10,7542.61,-2984.713,461.6914,0,0,0,0,100,0), -- 13:29:41
+(@PATH,11,7541.939,-2996.007,464.5852,0,0,0,0,100,0), -- 13:29:44
+(@PATH,12,7537.476,-3005.4,466.0187,0,0,0,0,100,0), -- 13:29:47
+(@PATH,13,7535.565,-3017.812,466.2273,0,0,0,0,100,0), -- 13:29:52
+(@PATH,14,7550.125,-3028.802,462.2839,0,0,0,0,100,0), -- 13:29:57
+(@PATH,15,7566.678,-3023.841,461.0449,0,0,0,0,100,0), -- 13:30:05
+(@PATH,16,7574.592,-3019.921,460.4108,0,0,0,0,100,0), -- 13:30:16
+(@PATH,17,7580.481,-3005.122,461.308,0,0,0,0,100,0), -- 13:30:19
+(@PATH,18,7581.311,-2996.924,462.5332,0,0,0,0,100,0), -- 13:30:23
+(@PATH,19,7589.289,-2980.43,460.9365,0,0,0,0,100,0), -- 13:30:28
+(@PATH,20,7589.837,-2979.668,460.4661,0,0,0,0,100,0), -- 13:30:33
+(@PATH,21,7606.989,-2972.392,461.5837,0,0,0,0,100,0), -- 13:30:37
+(@PATH,22,7617.824,-2965.905,461.3898,0,0,0,0,100,0), -- 13:30:43
+(@PATH,23,7620.032,-2963.793,461.5444,0,0,0,0,100,0), -- 13:30:47
+(@PATH,24,7653.39,-2955.129,463.8018,0,0,0,0,100,0), -- 13:30:51
+(@PATH,25,7668.529,-2958.117,464.894,0,0,0,0,100,0), -- 13:31:05
+(@PATH,26,7652.024,-2942.818,463.3503,0,0,0,0,100,0), -- 13:31:13
+(@PATH,27,7648.988,-2940.365,462.6953,0,0,0,0,100,0), -- 13:31:24
+(@PATH,28,7623.73,-2923.926,462.5015,0,0,0,0,100,0), -- 13:31:36
+(@PATH,29,7596.945,-2907.005,462.287,0,0,0,0,100,0), -- 13:31:43
+(@PATH,30,7589.421,-2904.872,461.6304,0,0,0,0,100,0), -- 13:31:51
+(@PATH,31,7591.465,-2904.978,461.9995,0,0,0,0,100,0), -- 13:31:58
+(@PATH,32,7600.53,-2909.323,462.908,0,0,0,0,100,0), -- 13:32:02
+(@PATH,33,7610.539,-2915.46,462.7303,0,0,0,0,100,0), -- 13:32:10
+(@PATH,34,7623.934,-2924.251,462.4937,0,0,0,0,100,0), -- 13:32:16
+(@PATH,35,7670.327,-2956.833,465.3539,0,0,0,0,100,0), -- 13:32:28
+(@PATH,36,7656.929,-2955.638,464.1862,0,0,0,0,100,0), -- 13:32:40
+(@PATH,37,7622.145,-2953.092,462.1255,0,0,0,0,100,0), -- 13:32:49
+(@PATH,38,7621.655,-2953.013,461.7986,0,0,0,0,100,0), -- 13:33:01
+(@PATH,39,7615.943,-2966.924,461.1361,0,0,0,0,100,0), -- 13:33:06
+(@PATH,40,7603.335,-2972.608,460.9927,0,0,0,0,100,0), -- 13:33:12
+(@PATH,41,7598.073,-2973.764,460.5677,0,0,0,0,100,0), -- 13:33:16
+(@PATH,42,7584.056,-2987.697,461.8174,0,0,0,0,100,0), -- 13:33:20
+(@PATH,43,7581.24,-2999.696,462.0973,0,0,0,0,100,0), -- 13:33:25
+(@PATH,44,7580.043,-3009.624,460.9475,0,0,0,0,100,0), -- 13:33:29
+(@PATH,45,7579.715,-3010.909,460.7065,0,0,0,0,100,0), -- 13:33:34
+(@PATH,46,7556.479,-3028.306,461.8019,0,0,0,0,100,0), -- 13:33:38
+(@PATH,47,7535.963,-3018.814,465.7519,0,0,0,0,100,0), -- 13:33:48
+(@PATH,48,7541.39,-2997.226,464.9632,0,0,0,0,100,0), -- 13:34:01
+(@PATH,49,7544.303,-2989.159,462.7299,0,0,0,0,100,0), -- 13:34:06
+(@PATH,50,7542.205,-2983.293,461.2471,0,0,0,0,100,0), -- 13:34:09
+(@PATH,51,7540.801,-2981.162,461.0032,0,0,0,0,100,0), -- 13:34:13
+(@PATH,52,7521.677,-2967.251,461.8644,0,0,0,0,100,0), -- 13:34:17
+(@PATH,53,7519.106,-2965.93,461.9445,0,0,0,0,100,0), -- 13:34:24
+(@PATH,54,7509.905,-2950.868,462.2672,0,0,0,0,100,0), -- 13:34:28
+(@PATH,55,7510.615,-2942.81,464.3668,0,0,0,0,100,0), -- 13:34:33
+(@PATH,56,7515.797,-2924.253,463.1058,0,0,0,0,100,0), -- 13:34:37
+(@PATH,57,7521.769,-2915.139,460.8744,0,0,0,0,100,0), -- 13:34:45
+(@PATH,58,7537.507,-2902.868,462.3076,0,0,0,0,100,0), -- 13:34:50
+(@PATH,59,7538.777,-2902.161,462.3616,0,0,0,0,100,0), -- 13:34:56
+(@PATH,60,7546.649,-2901.733,462.5362,0,0,0,0,100,0); -- 13:35:03
+-- 0x1C392000200B8B8000003800003F2E06 .go 7546.649 -2901.733 462.5362
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_03_world.sql
new file mode 100644
index 00000000000..136a068bd9e
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_03_world.sql
@@ -0,0 +1,166 @@
+
+SET @CGUID := 145042;
+SET @OGUID := 82917;
+
+
+DELETE FROM `spell_area` WHERE `spell`=58139 AND `area`IN(4530,4531);
+INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES
+(58139, 4531, 13144, 0, 0, 0, 2, 1, 64, 11), -- The Fleshweks after Killing two scourge with one skeleton
+(58139, 4530, 13144, 0, 0, 0, 2, 1, 64, 11); -- Sanctumn on renaimation after Killing two scourge with one skeleton
+
+DELETE FROM `creature` WHERE `id` IN(30703,30704,31015,30697,30696,31432);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(@CGUID+0, 31015, 571, 1, 64, 6661.146, 3261.688, 668.9714, 4.115243, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+1, 31015, 571, 1, 64, 6627.71, 3189.896, 647.9885, 2.84596, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+2, 31015, 571, 1, 64, 6659.174, 3212.105, 667.0215, 0.1042775, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+3, 31015, 571, 1, 64, 6654.514, 3239.867, 670.2061, 5.907172, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+4, 31015, 571, 1, 64, 6610.869, 3232.499, 668.5587, 2.604744, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+5, 31015, 571, 1, 64, 6605.338, 3153.076, 665.3033, 5.409661, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+6, 31015, 571, 1, 64, 6702.106, 3154.25, 654.8233, 5.986479, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+7, 31015, 571, 1, 64, 6583.975, 3157.158, 665.6695, 2.269745, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+8, 31015, 571, 1, 64, 6565.48, 3315.214, 667.1922, 3.576956, 120, 0, 0), -- 31015 (Area: 4588)
+(@CGUID+9, 31015, 571, 1, 64, 6498.057, 3314.354, 664.8021, 0.5061455, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+10, 31015, 571, 1, 64, 6518.352, 3309.556, 665.1537, 5.462881, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+11, 31015, 571, 1, 64, 6571.921, 3315.821, 668.0949, 2.940412, 120, 0, 0), -- 31015 (Area: 4588)
+(@CGUID+12, 31015, 571, 1, 64, 6572.489, 3319.39, 667.0414, -1.827478, 120, 0, 0), -- 31015 (Area: 4588)
+(@CGUID+13, 31015, 571, 1, 64, 6530.034, 3256.114, 666.3459, 4.205114, 120, 0, 0), -- 31015 (Area: 4588)
+(@CGUID+14, 31015, 571, 1, 64, 6493.935, 3292.664, 664.7191, 5.110613, 120, 5, 1), -- 31015 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+15, 31015, 571, 1, 64, 6569.369, 3316.948, 667.7736, -0.4594761, 120, 0, 0), -- 31015 (Area: 4588) (Auras: )
+(@CGUID+16, 31015, 571, 1, 64, 6530.081, 3256.11, 666.2975, 4.193476, 120, 0, 0), -- 31015 (Area: 4588)
+(@CGUID+17, 31015, 571, 1, 64, 6464.674, 3252.994, 641.5389, 5.995564, 120, 0, 0), -- 31015 (Area: 4531)
+(@CGUID+18, 31015, 571, 1, 64, 6489.055, 3385.385, 598.3196, -1.682238, 120, 0, 0), -- 31015 (Area: 4531)
+(@CGUID+19, 31015, 571, 1, 64, 6456.603, 3166.644, 657.527, 1.598204, 120, 0, 0), -- 31015 (Area: 4531)
+(@CGUID+20, 31015, 571, 1, 64, 6461.294, 3153.185, 657.5644, 4.921828, 120, 5, 1), -- 31015 (Area: 4531) (possible waypoints or random movement)
+(@CGUID+21, 31015, 571, 1, 64, 6453.171, 3166.278, 657.5888, 0.3810751, 120, 0, 0), -- 31015 (Area: 4531)
+(@CGUID+22, 31015, 571, 1, 64, 6455.606, 3164.106, 657.6061, 1.870695, 120, 0, 0), -- 31015 (Area: 4531)
+(@CGUID+23, 31015, 571, 1, 64, 6412.766, 3231.688, 639.8654, 4.939847, 120, 5, 1), -- 31015 (Area: 4531) (possible waypoints or random movement)
+(@CGUID+24, 31015, 571, 1, 64, 6667.497, 3354.504, 704.6642, -2.447248, 120, 0, 0), -- 31015 (Area: 4531)
+(@CGUID+25, 30696, 571, 1, 64, 6638.812, 3160.733, 660.6064, 1.080401, 120, 5, 1), -- 30696 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+26, 30696, 571, 1, 64, 6686.414, 3147.764, 656.3453, 6.07866, 120, 5, 1), -- 30696 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+27, 30696, 571, 1, 64, 6526.674, 3303.937, 665.1752, 4.911891, 120, 5, 1), -- 30696 (Area: 4588) (possible waypoints or random movement)
+(@CGUID+28, 30696, 571, 1, 64, 6548.213, 3310.022, 665.8172, 2.349988, 120, 0, 0), -- 30696 (Area: 4588)
+(@CGUID+29, 30696, 571, 1, 64, 6532.149, 3256.876, 666.6301, -2.182277, 120, 0, 0), -- 30696 (Area: 4588)
+(@CGUID+30, 30696, 571, 1, 64, 6521.981, 3320.334, 664.9473, 4.594295, 120, 0, 0), -- 30696 (Area: 4588)
+(@CGUID+31, 30696, 571, 1, 64, 6470.161, 3250.802, 643.5604, 3.930473, 120, 0, 0), -- 30696 (Area: 4531)
+(@CGUID+32, 30696, 571, 1, 64, 6487.702, 3380.006, 599.0916, 6.272988, 120, 0, 0), -- 30696 (Area: 4531)
+(@CGUID+33, 30696, 571, 1, 64, 6488.242, 3194.719, 652.9039, 1.48353, 120, 0, 0), -- 30696 (Area: 4531)
+(@CGUID+34, 30696, 571, 1, 64, 6435.536, 3141.343, 657.5279, 0.1379021, 120, 5, 1), -- 30696 (Area: 4531) (possible waypoints or random movement)
+(@CGUID+35, 30696, 571, 1, 64, 6564.194, 3135.601, 666.2081, 0.4537856, 120, 0, 0), -- 30696 (Area: 4531)
+(@CGUID+36, 30696, 571, 1, 64, 6410.666, 3233.757, 640.489, 4.667454, 120, 5, 1), -- 30696 (Area: 4531) (possible waypoints or random movement)
+(@CGUID+37, 30696, 571, 1, 64, 6413.427, 3218.029, 638.4678, 0.122173, 120, 0, 0), -- 30696 (Area: 4531)
+(@CGUID+38, 30696, 571, 1, 64, 6452.031, 3161.715, 657.5867, 0.9863433, 120, 0, 0), -- 30696 (Area: 4531)
+(@CGUID+39, 30696, 571, 1, 64, 6459.535, 3110.506, 657.6054, 1.157361, 120, 5, 1), -- 30696 (Area: 4531) (possible waypoints or random movement)
+(@CGUID+40, 30696, 571, 1, 64, 6679.659, 3345.589, 704.6539, 3.205272, 120, 5, 1), -- 30696 (Area: 4531) (possible waypoints or random movement)
+(@CGUID+41, 30703, 571, 1, 64, 6571.963, 3314.406, 668.2784, 2.36651, 120, 0, 0), -- 30703 (Area: 4588)
+(@CGUID+42, 30703, 571, 1, 64, 6517.844, 3323.566, 664.8954, -0.663258, 120, 0, 0), -- 30703 (Area: 4588)
+(@CGUID+43, 30703, 571, 1, 64, 6528.306, 3259.301, 665.793, -1.073858, 120, 0, 0), -- 30703 (Area: 4588)
+(@CGUID+44, 30703, 571, 1, 64, 6454.563, 3168.846, 657.5237, 5.535412, 120, 0, 0), -- 30703 (Area: 4531)
+(@CGUID+45, 30703, 571, 1, 64, 6421.846, 3257.234, 640.0424, 2.456618, 120, 0, 0), -- 30703 (Area: 4531) (Auras: )
+(@CGUID+46, 30703, 571, 1, 64, 6669.027, 3354.094, 704.2711, 2.458861, 120, 0, 0), -- 30703 (Area: 4531)
+(@CGUID+47, 30704, 571, 1, 64, 6572.606, 3315.346, 668.405, -2.30596, 120, 0, 0), -- 30704 (Area: 4588)
+(@CGUID+48, 30704, 571, 1, 64, 6568.352, 3316.549, 667.683, 2.906086, 120, 0, 0), -- 30704 (Area: 4588)
+(@CGUID+49, 30704, 571, 1, 64, 6571.605, 3316.023, 668.1923, -2.073231, 120, 0, 0), -- 30704 (Area: 4588)
+(@CGUID+50, 30704, 571, 1, 64, 6530.246, 3252.483, 666.8104, 1.616269, 120, 0, 0), -- 30704 (Area: 4588)
+(@CGUID+51, 30704, 571, 1, 64, 6543.361, 3308.063, 665.3945, 0.383608, 120, 0, 0), -- 30704 (Area: 4588)
+(@CGUID+52, 30704, 571, 1, 64, 6529.136, 3252.577, 666.5628, 1.30948, 120, 0, 0), -- 30704 (Area: 4588) (Auras: )
+(@CGUID+53, 30704, 571, 1, 64, 6489.347, 3384.931, 598.3163, -1.893157, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+54, 30704, 571, 1, 64, 6492.296, 3382.427, 598.8416, 5.579057, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+55, 30704, 571, 1, 64, 6488.653, 3381.798, 598.9666, 1.330476, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+56, 30704, 571, 1, 64, 6492.833, 3385.416, 598.5916, -3.133257, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+57, 30704, 571, 1, 64, 6492.375, 3197.953, 653.0616, -2.477693, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+58, 30704, 571, 1, 64, 6571.54, 3281.336, 670.894, 5.986175, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+59, 30704, 571, 1, 64, 6463.915, 3257.741, 640.313, 0.01159616, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+60, 30704, 571, 1, 64, 6462.88, 3253.862, 641.1767, 0.2747464, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+61, 30704, 571, 1, 64, 6468.83, 3249.454, 643.105, 0.7893116, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+62, 30704, 571, 1, 64, 6509.02, 3212.699, 658.4735, 2.319517, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+63, 30704, 571, 1, 64, 6507.89, 3210.89, 658.0303, 1.634014, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+64, 30704, 571, 1, 64, 6456.575, 3167.642, 657.5801, -1.838321, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+65, 30704, 571, 1, 64, 6452.937, 3166.663, 657.6061, -0.005128502, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+66, 30704, 571, 1, 64, 6454.717, 3168.428, 657.5237, 2.709053, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+67, 30704, 571, 1, 64, 6455.861, 3167.833, 657.575, -1.598367, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+68, 30704, 571, 1, 64, 6416.846, 3214.117, 639.7312, 2.10443, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+69, 30704, 571, 1, 64, 6590.434, 3331.823, 667.183, 4.037075, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+70, 30704, 571, 1, 64, 6668.725, 3357.257, 704.2558, -3.137703, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+71, 30704, 571, 1, 64, 6664.69, 3352.166, 704.3459, 1.520238, 120, 0, 0), -- 30704 (Area: 4531)
+(@CGUID+72, 30697, 571, 1, 64, 6559.192, 3333.02, 664.9217, 4.991642, 120, 0, 0), -- 30697 (Area: 4588)
+(@CGUID+73, 30697, 571, 1, 64, 6512.84, 3320.273, 665.2345, 0.5819893, 120, 0, 0), -- 30697 (Area: 4588)
+(@CGUID+74, 30697, 571, 1, 64, 6515.811, 3280.09, 665.0708, 0.1396263, 120, 0, 0), -- 30697 (Area: 4531)
+(@CGUID+75, 30697, 571, 1, 64, 6476.128, 3146.229, 657.5644, 4.380776, 120, 0, 0), -- 30697 (Area: 4531)
+(@CGUID+76, 30697, 571, 1, 64, 6417.988, 3260.385, 640.6262, -0.6849744, 120, 0, 0), -- 30697 (Area: 4531)
+(@CGUID+77, 31432, 571, 1, 64, 6588.427, 3278.203, 818.2033, 5.044002, 120, 5, 1); -- 31432 (Area: 4588) (possible waypoints or random movement)
+
+
+UPDATE `creature` SET `phaseMask`=64 WHERE `id` IN(31314,30698,31306,31428);
+UPDATE `creature` SET `phaseMask`=65 WHERE `id` IN(30597,32467);
+UPDATE `creature_template` SET `unit_flags`=768 WHERE `entry`=31432;
+UPDATE `creature` SET `equipment_id`=1 WHERE `id` IN(30703,30704);
+
+DELETE FROM `vehicle_template_accessory` WHERE `entry`=31432;
+INSERT INTO `vehicle_template_accessory` (`entry`, `accessory_entry`, `seat_id`, `minion`, `description`, `summontype`, `summontimer`) VALUES
+(31432, 31428, 0, 0, '31432 - 31428', 6, 30000); -- 31432 - 31428
+
+
+DELETE FROM `gameobject` WHERE `id` IN(193203,193204);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0, 193203, 571, 1, 64, 6531.642, 3336.632, 666.5159, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+1, 193203, 571, 1, 64, 6541.198, 3337.612, 674.4935, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+2, 193203, 571, 1, 64, 6561.242, 3342.843, 667.0536, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+3, 193203, 571, 1, 64, 6575.444, 3336.632, 667.6539, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+4, 193203, 571, 1, 64, 6517.65, 3262.135, 668.0207, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+5, 193204, 571, 1, 64, 6509.69, 3298.966, 670.1282, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531)
+(@OGUID+6, 193203, 571, 1, 64, 6441.041, 3245.802, 643.5339, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+7, 193203, 571, 1, 64, 6523.465, 3403.516, 599.7352, 1.06465, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+8, 193204, 571, 1, 64, 6774.447, 3517.597, 670.3411, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531)
+(@OGUID+9, 193204, 571, 1, 64, 6774.1, 3539.328, 670.2827, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531)
+(@OGUID+10, 193203, 571, 1, 64, 6815.187, 3502.362, 691.7656, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+11, 193203, 571, 1, 64, 6836.54, 3514.926, 691.6472, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+12, 193204, 571, 1, 64, 6859.746, 3515.827, 696.0732, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531)
+(@OGUID+13, 193203, 571, 1, 64, 6717.095, 3499.194, 656.2964, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+14, 193203, 571, 1, 64, 6716.513, 3544.395, 670.4061, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+15, 193203, 571, 1, 64, 6671.143, 3539.871, 670.931, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+16, 193203, 571, 1, 64, 6656.081, 3455.363, 632.7549, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+17, 193203, 571, 1, 64, 6678.709, 3572.928, 671.7523, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+18, 193203, 571, 1, 64, 6665.039, 3553.045, 670.4769, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+19, 193203, 571, 1, 64, 6466.252, 3423.323, 598.091, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+20, 193203, 571, 1, 64, 6522.733, 3429.231, 599.0632, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+21, 193203, 571, 1, 64, 6516.931, 3478.982, 597.8824, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+22, 193203, 571, 1, 64, 6498.917, 3480.367, 596.7786, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+23, 193203, 571, 1, 64, 6544.474, 3464.513, 597.8202, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+24, 193203, 571, 1, 64, 6671.423, 3264.837, 669.0335, 5.724681, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+25, 193203, 571, 1, 64, 6669.524, 3338.208, 703.5842, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+26, 193204, 571, 1, 64, 6926.368, 3514.581, 713.6303, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531)
+(@OGUID+27, 193203, 571, 1, 64, 6901.291, 3446.396, 704.4607, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+28, 193204, 571, 1, 64, 6885.061, 3495.637, 707.6733, 6.056293, 0, 0, 0, 1, 120, 255, 1), -- 193204 (Area: 4531)
+(@OGUID+29, 193203, 571, 1, 64, 6907.985, 3453.707, 705.4143, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 193203 (Area: 4531)
+(@OGUID+30, 193203, 571, 1, 64, 6680.36, 3371.357, 701.1601, 0.3141584, 0, 0, 0, 1, 120, 255, 1); -- 193203 (Area: 4531)
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN(30703,30704,31432);
+INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(31432, 0, 0x3000000, 0x1, ''), -- 31432
+(30703, 25280, 0x0, 0x1, ''), -- 30703
+(30704, 28919, 0x0, 0x1, ''); -- 30704
+
+DELETE FROM `creature_addon` WHERE `guid` IN(@CGUID+41,@CGUID+42,@CGUID+43,@CGUID+47,@CGUID+48,@CGUID+49,@CGUID+50,@CGUID+51,@CGUID+52);
+INSERT INTO `creature_addon` (`guid`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(@CGUID+41, 0, 0x0, 0x1, ''),
+(@CGUID+42, 0, 0x0, 0x1, ''),
+(@CGUID+43, 0, 0x0, 0x1, ''),
+(@CGUID+47, 0, 0x0, 0x1, ''),
+(@CGUID+48, 0, 0x0, 0x1, ''),
+(@CGUID+49, 0, 0x0, 0x1, ''),
+(@CGUID+50, 0, 0x0, 0x1, ''),
+(@CGUID+51, 0, 0x0, 0x1, ''),
+(@CGUID+52, 0, 0x0, 0x1, '');
+
+UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry` IN(30703,30704,31015);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(30703,30704,31015) AND `source_type`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(30703,0,0,0,4,0,100,0,0,0,0,0,43,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ebon Blade Champion - On Agro - Dismount'),
+(30703,0,1,0,0,0,100,0,0,5000,25000,35000,11,58130,2,0,0,0,0,1,0,0,0,0,0,0,0,'Ebon Blade Champion - IC - Cast Icebound Fortitude'),
+(30703,0,2,0,9,0,100,0,0,5,20000,30000,11,50688,2,0,0,0,0,2,0,0,0,0,0,0,0,'Ebon Blade Champion - On Range - Cast Plague Strike'),
+(30704,0,0,0,4,0,100,0,0,0,0,0,43,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Argent Paladin - On Agro - Dismount'),
+(30704,0,1,0,9,0,100,0,0,5,12000,15000,11,58127,2,0,0,0,0,2,0,0,0,0,0,0,0,'Argent Paladin - On Range - Cast Divine Storm'),
+(31015,0,0,0,9,0,100,0,0,5,15000,25000,11,60873,2,0,0,0,0,2,0,0,0,0,0,0,0,'Intrepid Ghoul - On Range - Cast Festering Bite'),
+(31015,0,1,0,9,0,100,0,0,5,9000,16000,11,60872,2,0,0,0,0,2,0,0,0,0,0,0,0,'Intrepid Ghoul - On Range - Cast Festering Bite'),
+(31015,0,2,0,2,0,100,1,0,10,0,0,11,58137,2,0,0,0,0,2,0,0,0,0,0,0,0,'Intrepid Ghoul - On Less than 10% hp - Cast Ghoulplosion');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_04_world.sql
new file mode 100644
index 00000000000..83d95745052
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_13_04_world.sql
@@ -0,0 +1,51 @@
+--
+-- Arred
+UPDATE `creature` SET `spawndist` = 0, `MovementType` = 0 WHERE `guid` = 63008;
+UPDATE `creature_template` SET `MovementType` = 0 WHERE `Entry` = 17512;
+-- Arred SAI
+SET @ENTRY := 17512;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,25,0,100,0,0,0,0,0,53,0,17512,1,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Reset - Start Waypoint"),
+(@ENTRY,0,1,0,64,0,100,0,0,0,0,0,54,20000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Gossip Hello - Pause Waypoint"),
+(@ENTRY,0,2,0,40,0,100,0,1,17512,0,0,54,90000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Waypoint 1 Reached - Pause Waypoint"),
+(@ENTRY,0,3,0,40,0,100,0,3,17512,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Waypoint 3 Reached - Run Script"),
+(@ENTRY,0,4,0,40,0,100,0,7,17512,0,0,80,@ENTRY*100+01,2,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Waypoint 7 Reached - Run Script"),
+(@ENTRY,0,5,0,40,0,100,0,8,17512,0,0,80,@ENTRY*100+02,2,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Waypoint 8 Reached - Run Script"),
+(@ENTRY,0,6,0,40,0,100,0,9,17512,0,0,54,210000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Arred - On Waypoint 9 Reached - Pause Waypoint");
+
+-- Actionlist SAI
+SET @ENTRY := 1751200;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,54,90000,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Pause Waypoint"),
+(@ENTRY,9,1,0,0,0,100,0,88000,88000,0,0,5,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Play Emote 3");
+
+-- Actionlist SAI
+SET @ENTRY := 1751201;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,54,120000,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Pause Waypoint"),
+(@ENTRY,9,1,0,0,0,100,0,3000,3000,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Set Flag Standstate Kneel"),
+(@ENTRY,9,2,0,0,0,100,0,115000,115000,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Remove Flag Standstate Kneel");
+
+-- Actionlist SAI
+SET @ENTRY := 1751202;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,54,30000,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Pause Waypoint"),
+(@ENTRY,9,1,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Play Emote 25"),
+(@ENTRY,9,2,0,0,0,100,0,12000,12000,0,0,5,273,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Play Emote 273");
+
+DELETE FROM `waypoints` WHERE `entry`=17512;
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(17512,1,-3788.04,-11547.3,-134.842, 'Arred'),
+(17512,2,-3789.79,-11543.9,-134.849, 'Arred'),
+(17512,3,-3793.72,-11542.8,-134.892, 'Arred'),
+(17512,4,-3789.94,-11543.8,-134.851, 'Arred'),
+(17512,5,-3787.24,-11546.9,-134.831, 'Arred'),
+(17512,6,-3786.81,-11549.6,-134.836, 'Arred'),
+(17512,7,-3787.67,-11551.3,-134.853, 'Arred'),
+(17512,8,-3784.96,-11550.9,-134.819, 'Arred'),
+(17512,9,-3788.04,-11547.3,-134.842, 'Arred');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_00_world.sql
new file mode 100644
index 00000000000..961ecd74d4d
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_00_world.sql
@@ -0,0 +1,3 @@
+-- Disallow flight form while affected by no-mount shapeshift
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (-33943, 33943, 40120);
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (-33943, "spell_dru_flight_form");
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_01_world.sql
new file mode 100644
index 00000000000..2ce06020621
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_01_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature` SET `modelid`=0 WHERE `id`=27452;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_02_world.sql
new file mode 100644
index 00000000000..1459b702cf0
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_02_world.sql
@@ -0,0 +1,16 @@
+-- Free at Last
+
+UPDATE `smart_scripts` SET `action_type`=45, `action_param1`=1, `action_param2`=1, `target_type`=1, `comment`='Runed Giant - On Script - Set Data Self' WHERE `entryorguid`=2641700 AND `source_type`=9 AND `id`=2 AND `link`=0;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=26417 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(26417, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 11, 47329, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - On Spellhit \'Gavrock\'s Runebreaker\' - Run Script (No Repeat)'),
+(26417, 0, 1, 0, 38, 0, 100, 0, 1, 1, 0, 0, 33, 26783, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Runed Giant - On Script - Quest Credit \'Free at Last\''),
+(26417, 0, 2, 3, 8, 0, 25, 0, 47604, 0, 10000, 10000, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - On Spell Hit - Store Target List'),
+(26417, 0, 3, 0, 61, 0, 0, 0, 0, 0, 10000, 10000, 80, 2641700, 2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - On Spell Hit - Start Script for Free At Last');
+
+-- Put on Your Best Face for Loken
+UPDATE `creature_template` SET `unit_flags`=33555200 WHERE `entry`=27212;
+
+-- Send them Packing
+UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=23977 AND `source_type`=0 AND `id`=0 AND `link`=0;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_03_world.sql
new file mode 100644
index 00000000000..9a0237725c0
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_03_world.sql
@@ -0,0 +1,3 @@
+--
+DELETE FROM `linked_respawn` WHERE `guid`=150211 AND `linkedGuid`=150211;
+DELETE FROM `creature` WHERE `guid`=150212 AND `id`=38995;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_04_world.sql
new file mode 100644
index 00000000000..58e0aaee311
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_14_04_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `flags_extra`=(`flags_extra`|2097152) WHERE `entry` IN (31304);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_15_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_15_00_world.sql
new file mode 100644
index 00000000000..43c2ae69382
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_15_00_world.sql
@@ -0,0 +1,73 @@
+--
+UPDATE `creature_template` SET `unit_flags`=512, `VehicleId`=240, `InhabitType`=4 WHERE `entry`=30477;
+UPDATE `creature_template` SET `minlevel`=80, `maxlevel`=80, `exp`=2, `unit_flags`=512, `VehicleId`=240, `InhabitType`=4 WHERE `entry`=30487;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (29428,30477,30487);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (29428,30477,30487) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (30477*100,30487*100) AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(29428,0,0,2,62,0,100,0,9917,0,0,0,11,58061,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ricket - On gossip select - Spellcast Forcecast Summon Rocket (Alliance)'),
+(29428,0,1,2,62,0,100,0,9917,1,0,0,11,58062,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ricket - On gossip select - Spellcast Forcecast Summon Rocket (Horde)'),
+(29428,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ricket - On gossip select - Close gossip'),
+(30477,0,0,0,54,0,100,0,0,0,0,0,80,30477*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'D16 Propelled Delivery Device - Just summoned - Run script'),
+(30477,0,1,2,40,0,100,0,18,30477,0,0,11,50630,0,0,0,0,0,1,0,0,0,0,0,0,0,'D16 Propelled Delivery Device - On WP 18 reached - Spellcast Eject All Passengers'),
+(30477,0,2,0,61,0,100,0,0,0,0,0,11,42895,0,0,0,0,0,23,0,0,0,0,0,0,0,'D16 Propelled Delivery Device - On WP 18 reached - Spellcast Cosmetic - Combat Knockdown Foe'),
+(30477,0,3,0,40,0,100,0,24,30477,0,0,41,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'D16 Propelled Delivery Device - On WP 24 reached - Despawn'),
+(30487,0,0,0,54,0,100,0,0,0,0,0,80,30487*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'D16 Propelled Delivery Device - Just summoned - Run script'),
+(30487,0,1,2,40,0,100,0,13,30487,0,0,11,50630,0,0,0,0,0,1,0,0,0,0,0,0,0,'D16 Propelled Delivery Device - On WP 13 reached - Spellcast Eject All Passengers'),
+(30487,0,2,0,61,0,100,0,0,0,0,0,11,42895,0,0,0,0,0,23,0,0,0,0,0,0,0,'D16 Propelled Delivery Device - On WP 13 reached - Spellcast Cosmetic - Combat Knockdown Foe'),
+(30487,0,3,0,40,0,100,0,17,30487,0,0,41,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'D16 Propelled Delivery Device - On WP 17 reached - Despawn'),
+(30477*100,9,0,0,0,0,100,0,3000,3000,0,0,53,1,30477,0,0,0,0,1,0,0,0,0,0,0,0,'D16 Propelled Delivery Device script - Start WP movement'),
+(30487*100,9,0,0,0,0,100,0,3000,3000,0,0,53,1,30487,0,0,0,0,1,0,0,0,0,0,0,0,'D16 Propelled Delivery Device script - Start WP movement');
+
+DELETE FROM `waypoints` WHERE `entry` IN (30477,30487);
+INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
+(30477,1,6164.999,-1064.512,422.1189,'D16 Propelled Delivery Device'),
+(30477,2,6204.096,-998.4872,457.5628,'D16 Propelled Delivery Device'),
+(30477,3,6289.573,-952.1809,504.6187,'D16 Propelled Delivery Device'),
+(30477,4,6307.788,-872.7999,541.7296,'D16 Propelled Delivery Device'),
+(30477,5,6370.582,-821.9507,653.868,'D16 Propelled Delivery Device'),
+(30477,6,6413.268,-660.4708,808.3953,'D16 Propelled Delivery Device'),
+(30477,7,6554.813,-550.3772,1018.112,'D16 Propelled Delivery Device'),
+(30477,8,6633.265,-419.3159,1173.914,'D16 Propelled Delivery Device'),
+(30477,9,6760.503,-364.4665,1277.719,'D16 Propelled Delivery Device'),
+(30477,10,6807.88,-427.5194,1399.109,'D16 Propelled Delivery Device'),
+(30477,11,6808.07,-471.4465,1419.247,'D16 Propelled Delivery Device'),
+(30477,12,6775.634,-529.2309,1394.387,'D16 Propelled Delivery Device'),
+(30477,13,6720.645,-535.5529,1328.054,'D16 Propelled Delivery Device'),
+(30477,14,6660.31,-486.8651,1238.553,'D16 Propelled Delivery Device'),
+(30477,15,6658.937,-417.8409,1186.11,'D16 Propelled Delivery Device'),
+(30477,16,6680.49,-329.3087,1098.609,'D16 Propelled Delivery Device'),
+(30477,17,6683.783,-220.3454,972.7203,'D16 Propelled Delivery Device'),
+(30477,18,6663.772,-192.1261,962.2485,'D16 Propelled Delivery Device'),
+(30477,19,6654.82,-180.1689,958.1317,'D16 Propelled Delivery Device'),
+(30477,20,6631.467,-171.3305,966.4633,'D16 Propelled Delivery Device'),
+(30477,21,6598.223,-162.3664,984.2227,'D16 Propelled Delivery Device'),
+(30477,22,6566.67,-155.2077,992.0551,'D16 Propelled Delivery Device'),
+(30477,23,6529.651,-154.9363,992.0551,'D16 Propelled Delivery Device'),
+(30477,24,6454.417,-152.1311,962.305,'D16 Propelled Delivery Device'),
+(30487,1,6169.229,-1069.619,420.6945,'D16 Propelled Delivery Device'),
+(30487,2,6232.725,-1031.598,505.7779,'D16 Propelled Delivery Device'),
+(30487,3,6339.224,-1035.08,575.3331,'D16 Propelled Delivery Device'),
+(30487,4,6431.492,-987.6745,694.8887,'D16 Propelled Delivery Device'),
+(30487,5,6632.437,-925.9739,896.1384,'D16 Propelled Delivery Device'),
+(30487,6,6822.084,-755.521,1171.194,'D16 Propelled Delivery Device'),
+(30487,7,7090.693,-619.4874,1455.639,'D16 Propelled Delivery Device'),
+(30487,8,7260.75,-282.75,1513.362,'D16 Propelled Delivery Device'),
+(30487,9,7552.502,-334.6509,1657.668,'D16 Propelled Delivery Device'),
+(30487,10,7692.301,-509.425,1536.5,'D16 Propelled Delivery Device'),
+(30487,11,7799.192,-636.3267,1252.278,'D16 Propelled Delivery Device'),
+(30487,12,7841.555,-726.5501,1193.916,'D16 Propelled Delivery Device'),
+(30487,13,7844.731,-775.3613,1185.833,'D16 Propelled Delivery Device'),
+(30487,14,7842.449,-815.5735,1186.396,'D16 Propelled Delivery Device'),
+(30487,15,7838.703,-859.9572,1173.173,'D16 Propelled Delivery Device'),
+(30487,16,7865.014,-911.2181,1163.979,'D16 Propelled Delivery Device'),
+(30487,17,7856.225,-951.6568,1151.563,'D16 Propelled Delivery Device');
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=9917 AND `id`=1;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
+(9917,1,0,'I am ready to head further into Storm Peaks.',32890,1,1,0,0,0,0,'');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9917;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,9917,0,0,28,12862,0,0,0,'','Ricket - Show gossip option only if player has completed but not rewarded quest When All Else Fails'),
+(15,9917,1,0,28,13060,0,0,0,'','Ricket - Show gossip option only if player has completed but not rewarded quest When All Else Fails');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_00_world.sql
new file mode 100644
index 00000000000..8f22aaa3e4e
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_00_world.sql
@@ -0,0 +1,343 @@
+--
+DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id` IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175));
+DELETE FROM `game_event_creature` WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id` IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175)) AND `eventEntry` !=2;
+DELETE FROM `creature` WHERE `id` IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175) AND `guid` NOT IN (SELECT `guid` FROM `game_event_creature` WHERE `eventEntry` =2);
+DELETE FROM `creature_template_addon` WHERE `entry` IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+UPDATE `creature` SET `equipment_id`=0, `modelid`=0 WHERE `id` IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+UPDATE `creature_template` SET `npcflag`=3, `unit_flags`=`unit_flags`|768 WHERE `entry` IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+
+INSERT INTO `game_event_creature` SELECT 12, creature.guid FROM `creature` WHERE creature.id IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+INSERT INTO `game_event_creature` SELECT 24, creature.guid FROM `creature` WHERE creature.id IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+INSERT INTO `game_event_creature` SELECT 7, creature.guid FROM `creature` WHERE creature.id IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+INSERT INTO `game_event_creature` SELECT 1, creature.guid FROM `creature` WHERE creature.id IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+INSERT INTO `game_event_creature` SELECT 26, creature.guid FROM `creature` WHERE creature.id IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+INSERT INTO `game_event_creature` SELECT 51, creature.guid FROM `creature` WHERE creature.id IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+INSERT INTO `game_event_creature` SELECT 50, creature.guid FROM `creature` WHERE creature.id IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+INSERT INTO `game_event_creature` SELECT 9, creature.guid FROM `creature` WHERE creature.id IN (20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
+
+SET @entry1:=20102;
+SET @entry2:=19172;
+SET @entry3:=19169;
+SET @entry4:=19173;
+SET @entry5:=19171;
+SET @entry6:=19148;
+SET @entry7:=19177;
+SET @entry8:=19176;
+SET @entry9:=19178;
+SET @entry10:=18927;
+SET @entry11:=19175;
+
+DELETE FROM smart_scripts WHERE `entryorguid` IN(@entry1,@entry2,@entry3,@entry4,@entry5,@entry6,@entry7,@entry8,@entry9,@entry10,@entry11) AND source_type=0 AND id>12;
+DELETE FROM smart_scripts WHERE `entryorguid` IN (@entry1*100, @entry1*100+1, @entry2*100, @entry2*100+1, @entry3*100, @entry3*100+1, @entry4*100, @entry4*100+1, @entry5*100, @entry5*100+1, @entry6*100, @entry6*100+1, @entry7*100, @entry7*100+1, @entry8*100, @entry8*100+1, @entry9*100, @entry9*100+1, @entry10*100, @entry10*100+1, @entry11*100, @entry11*100+1) AND source_type=9;
+DELETE FROM smart_scripts WHERE `entryorguid` IN (@entry1*100+2, @entry1*100+3, @entry2*100+2, @entry2*100+3, @entry3*100+2, @entry3*100+3, @entry4*100+2, @entry4*100+3, @entry5*100+2, @entry5*100+3, @entry6*100+2, @entry6*100+3, @entry7*100+2, @entry7*100+3, @entry8*100+2, @entry8*100+3, @entry9*100+2, @entry9*100+3, @entry10*100+2, @entry10*100+3, @entry11*100+2, @entry11*100+3) AND source_type=9;
+DELETE FROM smart_scripts WHERE `entryorguid` IN (@entry1*100+4, @entry1*100+5, @entry2*100+4, @entry2*100+5, @entry3*100+4, @entry3*100+5, @entry4*100+5, @entry4*100+4, @entry5*100+4, @entry5*100+5, @entry6*100+4, @entry6*100+5, @entry7*100+4, @entry7*100+5, @entry8*100+4, @entry8*100+5, @entry9*100+4, @entry9*100+5, @entry10*100+4, @entry10*100+5, @entry11*100+4, @entry11*100+5) AND source_type=9;
+DELETE FROM smart_scripts WHERE `entryorguid` IN (@entry1*100+6, @entry1*100+7, @entry2*100+6, @entry2*100+7, @entry3*100+6, @entry3*100+7, @entry4*100+6, @entry4*100+7, @entry5*100+6, @entry5*100+7, @entry6*100+6, @entry6*100+7, @entry7*100+6, @entry7*100+7, @entry8*100+6, @entry8*100+7, @entry9*100+6, @entry9*100+7, @entry10*100+6, @entry10*100+7, @entry11*100+6, @entry11*100+7) AND source_type=9;
+DELETE FROM smart_scripts WHERE `entryorguid` IN (@entry1*100+8, @entry1*100+9, @entry2*100+8, @entry2*100+9, @entry3*100+8, @entry3*100+9, @entry4*100+8, @entry4*100+9, @entry5*100+8, @entry5*100+9, @entry6*100+8, @entry6*100+9, @entry7*100+8, @entry7*100+9, @entry8*100+8, @entry8*100+9, @entry9*100+8, @entry9*100+9, @entry10*100+8, @entry10*100+9, @entry11*100+8, @entry11*100+9) AND source_type=9;
+DELETE FROM smart_scripts WHERE `entryorguid` IN (@entry1*100+10, @entry1*100+11, @entry2*100+10, @entry2*100+11, @entry3*100+10, @entry3*100+11, @entry4*100+10, @entry4*100+11, @entry5*100+10, @entry5*100+11, @entry6*100+10, @entry6*100+11, @entry7*100+10, @entry7*100+11, @entry8*100+10, @entry8*100+11, @entry9*100+10, @entry9*100+11, @entry10*100+10, @entry10*100+11, @entry11*100+10, @entry11*100+11) AND source_type=9;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@entry1, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry1*100, @entry1*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - On respawn - random action list'), -- Goblin christmas
+(@entry1*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 34845, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - cast '),
+(@entry1*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 34849, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - cast'),
+(@entry1, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry1*100+2, @entry1*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - On respawn - random action list'), -- Goblin Halloween
+(@entry1*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43631, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - cast '),
+(@entry1*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43630, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - cast'),
+(@entry1, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry1*100+4, @entry1*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - On respawn - random action list'), -- Goblin Lunar
+(@entry1*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 34848, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - cast '),
+(@entry1*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 34851, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - cast'),
+(@entry1, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry1*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - On respawn - random action list'), -- Goblin Brewfest
+(@entry1*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43911, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - cast '),
+(@entry1*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 13861, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - Equip'),
+(@entry1, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry1*100+7, @entry1*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - On respawn - random action list'), -- Goblin DOTD
+(@entry1*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - Morph '),
+(@entry1*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - Morph'),
+(@entry1, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry1*100+9, @entry1*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - On respawn - random action list'), -- Goblin pirates
+(@entry1*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25036, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - Morph '),
+(@entry1*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25047, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - random action list - Morph'),
+(@entry1, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25872, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Goblin commoner - On respawn - Morph'), -- Goblin midsummer
+(@entry2, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry2*100, @entry2*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - On respawn - random action list'), -- Gnome christmas
+(@entry2*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33448, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - random action list - cast '),
+(@entry2*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33445, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - random action list - cast'),
+(@entry2, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry2*100+2, @entry2*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - On respawn - random action list'), -- Gnome Halloween
+(@entry2*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43629, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - random action list - cast '),
+(@entry2*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43628, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - random action list - cast'),
+(@entry2, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry2*100+4, @entry2*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome - On respawn - random action list'), -- Gnome Lunar
+(@entry2*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33446, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome - random action list - cast '),
+(@entry2*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33449, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome - random action list - cast'),
+(@entry2, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry2*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - On respawn - random action list'), -- Gnome Brewfest
+(@entry2*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43910, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - random action list - cast '),
+(@entry2*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 13861, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - random action list - Equip'),
+(@entry2, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry2*100+7, @entry2*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - On respawn - random action list'), -- Gnome DOTD
+(@entry2*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - random action list - Morph '),
+(@entry2*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - random action list - Morph'),
+(@entry2, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry2*100+9, @entry2*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - On respawn - random action list'), -- Gnome pirates
+(@entry2*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25035, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - random action list - Morph '),
+(@entry2*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25046, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - random action list - Morph'),
+(@entry2, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25871, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnome commoner - On respawn - Morph'), -- Gnome midsummer
+(@entry3, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry3*100, @entry3*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - On respawn - random action list'), -- blood elf christmas
+(@entry3*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33412, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - random action list - cast '),
+(@entry3*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33415, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - random action list - cast'),
+(@entry3, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry3*100+2, @entry3*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - On respawn - random action list'), -- blood elf Halloween
+(@entry3*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43406, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - random action list - cast '),
+(@entry3*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43405, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - random action list - cast'),
+(@entry3, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry3*100+4, @entry3*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - On respawn - random action list'), -- blood elf Lunar
+(@entry3*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33413, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - random action list - cast '),
+(@entry3*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33416, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - random action list - cast'),
+(@entry3, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry3*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - On respawn - random action list'), -- blood elf Brewfest
+(@entry3*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43907, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - random action list - cast '),
+(@entry3*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 2703, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodelf commoner - random action list - Equip'),
+(@entry3, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry3*100+7, @entry3*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'blood elf commoner - On respawn - random action list'), -- blood elf DOTD
+(@entry3*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'blood elf commoner - random action list - Morph '),
+(@entry3*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'blood elf commoner - random action list - Morph'),
+(@entry3, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry3*100+9, @entry3*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'blood elf commoner - On respawn - random action list'), -- blood elf pirates
+(@entry3*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25032, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'blood elf commoner - random action list - Morph '),
+(@entry3*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25043, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'blood elf commoner - random action list - Morph'),
+(@entry3, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25868, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'blood elf commoner - On respawn - Morph'), -- blood elf midsummer
+(@entry4, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry4*100, @entry4*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - On respawn - random action list'), -- night elf christmas
+(@entry4*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33439, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - random action list - cast '),
+(@entry4*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33442, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - random action list - cast'),
+(@entry4, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry4*100+2, @entry4*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - On respawn - random action list'), -- night elf Halloween
+(@entry4*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43635, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - random action list - cast '),
+(@entry4*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43634, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - random action list - cast'),
+(@entry4, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry4*100+4, @entry4*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - On respawn - random action list'), -- night elf Lunar
+(@entry4*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33443, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - random action list - cast '),
+(@entry4*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33440, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - random action list - cast'),
+(@entry4, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry4*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - On respawn - random action list'), -- night elf Brewfest
+(@entry4*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43913, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - random action list - cast '),
+(@entry4*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 2703, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - random action list - Equip'),
+(@entry4, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry4*100+7, @entry4*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - On respawn - random action list'), -- night commoner DOTD
+(@entry4*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - random action list - Morph '),
+(@entry4*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night commoner - random action list - Morph'),
+(@entry4, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry4*100+9, @entry4*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night elf commoner - On respawn - random action list'), -- night elf pirates
+(@entry4*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25038, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night elf commoner - random action list - Morph '),
+(@entry4*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25049, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night elf commoner - random action list - Morph'),
+(@entry4, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25874, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'night elf commoner - On respawn - Morph'), -- night elf midsummer
+(@entry5, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry5*100, @entry5*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - On respawn - random action list'), -- Draenei christmas
+(@entry5*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33427, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - random action list - cast '),
+(@entry5*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33430, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - random action list - cast'),
+(@entry5, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry5*100+2, @entry5*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - On respawn - random action list'), -- Draenei Halloween
+(@entry5*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43625, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - random action list - cast '),
+(@entry5*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43623, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - random action list - cast'),
+(@entry5, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry5*100+4, @entry5*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - On respawn - random action list'), -- Draenei Lunar
+(@entry5*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33428, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - random action list - cast '),
+(@entry5*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33431, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - random action list - cast'),
+(@entry5, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry5*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - On respawn - random action list'), -- Draenei Brewfest
+(@entry5*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43908, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei - random action list - cast '),
+(@entry5*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 2703, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei commoner - random action list - Equip'),
+(@entry5, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry5*100+7, @entry5*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei commoner - On respawn - random action list'), -- Draenei DOTD
+(@entry5*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei commoner - random action list - Morph '),
+(@entry5*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei commoner - random action list - Morph'),
+(@entry5, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry5*100+9, @entry5*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei commoner - On respawn - random action list'), -- Draenei pirates
+(@entry5*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25033, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei commoner - random action list - Morph '),
+(@entry5*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25044, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei commoner - random action list - Morph'),
+(@entry5, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25869, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Draenei commoner - On respawn - Morph'), -- Draenei midsummer
+(@entry6, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry6*100, @entry6*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - On respawn - random action list'), -- Dwarf christmas
+(@entry6*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33433, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - cast '),
+(@entry6*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33436, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - cast'),
+(@entry6, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry6*100+2, @entry6*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf - On respawn - random action list'), -- Dwarf Halloween
+(@entry6*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43626, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - cast '),
+(@entry6*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43627, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - cast'),
+(@entry6, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry6*100+4, @entry6*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf - On respawn - random action list'), -- Dwarf Lunar
+(@entry6*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33437, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - cast '),
+(@entry6*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33434, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - cast'),
+(@entry6, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry6*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - On respawn - random action list'), -- Dwarf Brewfest
+(@entry6*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43909, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - cast '),
+(@entry6*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 13861, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - Equip'),
+(@entry6, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry6*100+7, @entry6*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - On respawn - random action list'), -- Dwarf DOTD
+(@entry6*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - Morph '),
+(@entry6*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - Morph'),
+(@entry6, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry6*100+9, @entry6*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - On respawn - random action list'), -- Dwarf pirates
+(@entry6*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25034, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - Morph '),
+(@entry6*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25045, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - random action list - Morph'),
+(@entry6, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25870, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dwarf commoner - On respawn - Morph'), -- Dwarf midsummer
+(@entry7, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry7*100, @entry7*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll - On respawn - random action list'), -- Troll christmas
+(@entry7*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33471, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll - random action list - cast '),
+(@entry7*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33468, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll - random action list - cast'),
+(@entry7, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry7*100+2, @entry7*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll - On respawn - random action list'), -- Troll Halloween
+(@entry7*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43641, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll - random action list - cast '),
+(@entry7*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43640, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll - random action list - cast'),
+(@entry7, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry7*100+4, @entry7*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll - On respawn - random action list'), -- Troll Lunar
+(@entry7*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33472, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll - random action list - cast '),
+(@entry7*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33469, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll - random action list - cast'),
+(@entry7, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry7*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll commoner - On respawn - random action list'), -- Troll Brewfest
+(@entry7*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43916, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll commoner - random action list - cast '),
+(@entry7*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 2705, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll commoner - random action list - Equip'),
+(@entry7, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry7*100+7, @entry7*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll commoner - On respawn - random action list'), -- Troll DOTD
+(@entry7*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll commoner - random action list - Morph '),
+(@entry7*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll commoner - random action list - Morph'),
+(@entry7, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry7*100+9, @entry7*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll commoner - On respawn - random action list'), -- Troll pirates
+(@entry7*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25041, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll commoner - random action list - Morph '),
+(@entry7*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25052, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll commoner - random action list - Morph'),
+(@entry7, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25877, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Troll commoner - On respawn - Morph'), -- Troll midsummer
+(@entry8, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry8*100, @entry8*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren - On respawn - random action list'), -- Tauren christmas
+(@entry8*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33465, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren - random action list - cast '),
+(@entry8*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33458, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren - random action list - cast'),
+(@entry8, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry8*100+2, @entry8*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren - On respawn - random action list'), -- Tauren Halloween
+(@entry8*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43638, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren - random action list - cast '),
+(@entry8*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43639, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren - random action list - cast'),
+(@entry8, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry8*100+4, @entry8*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren - On respawn - random action list'), -- Tauren Lunar
+(@entry8*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33459, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren - random action list - cast '),
+(@entry8*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33466, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren - random action list - cast'),
+(@entry8, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry8*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren commoner - On respawn - random action list'), -- Tauren Brewfest
+(@entry8*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43915, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren commoner - random action list - cast '),
+(@entry8*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 2705, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren commoner - random action list - Equip'),
+(@entry8, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry8*100+7, @entry8*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren commoner - On respawn - random action list'), -- Tauren DOTD
+(@entry8*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren commoner - random action list - Morph '),
+(@entry8*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren commoner - random action list - Morph'),
+(@entry8, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry8*100+9, @entry8*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren commoner - On respawn - random action list'), -- Tauren pirates
+(@entry8*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25040, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren commoner - random action list - Morph '),
+(@entry8*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25051, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren commoner - random action list - Morph'),
+(@entry8, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25876, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tauren commoner - On respawn - Morph'), -- Tauren midsummer
+(@entry9, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry9*100, @entry9*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead - On respawn - random action list'), -- Undead christmas
+(@entry9*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33474, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead - random action list - cast '),
+(@entry9*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33477, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead - random action list - cast'),
+(@entry9, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry9*100+2, @entry9*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead - On respawn - random action list'), -- Undead christmas
+(@entry9*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43642, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead - random action list - cast '),
+(@entry9*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43643, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead - random action list - cast'),
+(@entry9, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry9*100+4, @entry9*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead - On respawn - random action list'), -- Undead Lunar
+(@entry9*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33478, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead - random action list - cast '),
+(@entry9*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33475, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead - random action list - cast'),
+(@entry9, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry9*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead commoner - On respawn - random action list'), -- Undead Brewfest
+(@entry9*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43917, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead commoner - random action list - cast '),
+(@entry9*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 2705, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead commoner - random action list - Equip'),
+(@entry9, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry9*100+7, @entry9*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead commoner - On respawn - random action list'), -- Undead DOTD
+(@entry9*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead commoner - random action list - Morph '),
+(@entry9*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undead commoner - random action list - Morph'),
+(@entry9, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry9*100+9, @entry9*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'undead commoner - On respawn - random action list'), -- undead pirates
+(@entry9*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25042, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'undead commoner - random action list - Morph '),
+(@entry9*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25053, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'undead commoner - random action list - Morph'),
+(@entry9, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25878, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'undead commoner - On respawn - Morph'), -- undead midsummer
+(@entry10, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry10*100, @entry10*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human - On respawn - random action list'), -- Human christmas
+(@entry10*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33402, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human - random action list - cast '),
+(@entry10*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33403, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human - random action list - cast'),
+(@entry10, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry10*100+2, @entry10*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human - On respawn - random action list'), -- Human Halloween
+(@entry10*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43633, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human - random action list - cast '),
+(@entry10*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43632, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human - random action list - cast'),
+(@entry10, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry10*100+4, @entry10*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human - On respawn - random action list'), -- Human Lunar
+(@entry10*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33397, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human - random action list - cast '),
+(@entry10*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33398, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human - random action list - cast'),
+(@entry10, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry10*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human commoner - On respawn - random action list'), -- Human Brewfest
+(@entry10*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43912, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human commoner - random action list - cast '),
+(@entry10*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 2705, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human commoner - random action list - Equip'),
+(@entry10, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry10*100+7, @entry10*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human commoner - On respawn - random action list'), -- Human DOTD
+(@entry10*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human commoner - random action list - Morph '),
+(@entry10*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human commoner - random action list - Morph'),
+(@entry10, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry10*100+9, @entry10*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human commoner - On respawn - random action list'), -- Human pirates
+(@entry10*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25037, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human commoner - random action list - Morph '),
+(@entry10*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25048, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human commoner - random action list - Morph'),
+(@entry10, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25873, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Human commoner - On respawn - Morph'), -- Human midsummer
+(@entry11, 0, 13, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry11*100, @entry11*100+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc - On respawn - random action list'), -- Orc christmas
+(@entry11*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33451, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc - random action list - cast '),
+(@entry11*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33455, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc - random action list - cast'),
+(@entry11, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry11*100+2, @entry11*100+3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc - On respawn - random action list'), -- Orc Halloween
+(@entry11*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43637, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc - random action list - cast '),
+(@entry11*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43636, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc - random action list - cast'),
+(@entry11, 0, 15, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry11*100+4, @entry11*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc - On respawn - random action list'), -- Orc Lunar
+(@entry11*100+4, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33456, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc - random action list - cast '),
+(@entry11*100+5, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33453, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc - random action list - cast'),
+(@entry11, 0, 16, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, @entry11*100+6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc commoner - On respawn - random action list'), -- Orc Brewfest
+(@entry11*100+6, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 43914, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc commoner - random action list - cast '),
+(@entry11*100+6, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 2705, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc commoner - random action list - Equip'),
+(@entry11, 0, 17, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry11*100+7, @entry11*100+8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc commoner - On respawn - random action list'), -- Orc DOTD
+(@entry11*100+7, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29203, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc commoner - random action list - Morph '),
+(@entry11*100+8, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 29204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc commoner - random action list - Morph'),
+(@entry11, 0, 18, 0, 11, 0, 100, 0, 0, 0, 0, 0, 87, @entry11*100+9, @entry11*100+10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc commoner - On respawn - random action list'), -- Orc pirates
+(@entry11*100+9, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25039, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc commoner - random action list - Morph '),
+(@entry11*100+10, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, 0, 25050, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc commoner - random action list - Morph'),
+(@entry11, 0, 19, 0, 11, 0, 100, 0, 0, 0, 0, 0, 3, 25875, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orc commoner - On respawn - Morph'); -- Orc midsummer
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN (20102,18927,19177,19169,19175,19171,19172,19176,19178,19173,19148) AND `SourceGroup` >13;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(22, 14, 19148, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 14, 20102, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 14, 18927, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 14, 19171, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 14, 19172, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 14, 19173, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 14, 19175, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 14, 19176, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 14, 19177, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 14, 19178, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 14, 19169, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winter Veil must be active'),
+(22, 15, 19148, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 15, 20102, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 15, 18927, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 15, 19171, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 15, 19172, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 15, 19173, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 15, 19175, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 15, 19176, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 15, 19177, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 15, 19178, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 15, 19169, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallow''s End must be active'),
+(22, 16, 19148, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 16, 20102, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 16, 18927, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 16, 19171, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 16, 19172, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 16, 19173, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 16, 19175, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 16, 19176, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 16, 19177, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 16, 19178, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 16, 19169, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Lunar Festival must be active'),
+(22, 17, 19148, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 17, 20102, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 17, 18927, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 17, 19171, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 17, 19172, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 17, 19173, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 17, 19175, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 17, 19176, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 17, 19177, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 17, 19178, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 17, 19169, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - Brew Fest must be active'),
+(22, 18, 19148, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 18, 20102, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 18, 18927, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 18, 19171, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 18, 19172, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 18, 19173, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 18, 19175, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 18, 19176, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 18, 19177, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 18, 19178, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 18, 19169, 0, 0, 12, 1, 51, 0, 0, 0, 0, 0, '', 'Commoner - DOTD must be active'),
+(22, 19, 19148, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 19, 20102, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 19, 18927, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 19, 19171, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 19, 19172, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 19, 19173, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 19, 19175, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 19, 19176, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 19, 19177, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 19, 19178, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 19, 19169, 0, 0, 12, 1, 50, 0, 0, 0, 0, 0, '', 'Commoner - Pirates Day must be active'),
+(22, 20, 19148, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active'),
+(22, 20, 20102, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active'),
+(22, 20, 18927, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active'),
+(22, 20, 19171, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active'),
+(22, 20, 19172, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active'),
+(22, 20, 19173, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active'),
+(22, 20, 19175, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active'),
+(22, 20, 19176, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active'),
+(22, 20, 19177, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active'),
+(22, 20, 19178, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active'),
+(22, 20, 19169, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer Fire Festival must be active');
+
+DELETE FROM `game_event_creature_quest` WHERE `quest` IN (13483, 13484);
+INSERT INTO `game_event_creature_quest` (`eventEntry`, `id`, `quest`) VALUES
+(9, 19148, 13484),
+(9, 18927, 13484),
+(9, 19178, 13483),
+(9, 19177, 13483),
+(9, 19176, 13483),
+(9, 19175, 13483),
+(9, 19169, 13483),
+(9, 19171, 13484),
+(9, 19172, 13484),
+(9, 19173, 13484),
+(9, 20102, 13484),
+(9, 20102, 13483);
+
+DELETE FROM `creature_queststarter` WHERE `id` IN(20102, 19172, 19169, 19173, 19171, 19148, 19177, 19176, 19178, 18927, 19175);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_01_world.sql
new file mode 100644
index 00000000000..20f3605b197
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_01_world.sql
@@ -0,0 +1,40 @@
+UPDATE `creature_template` SET `AIName`='SmartAI',`npcflag`=1,`gossip_menu_id`=10990 WHERE `entry`IN(37671,38065);
+UPDATE `creature` SET `npcflag`=3 WHERE `id`=38293;
+
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN(37172,38066) AND `id`>2;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN(37671,38065);
+
+DELETE FROM `smart_scripts` WHERE `source_type`=2 AND `entryorguid` IN(5703,5705) AND `id`=1;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(37671, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Crown Supply Guard - On Data Set - Say'),
+(38065, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Crown Supply Guard - On Data Set - Say'),
+(37172, 0, 3, 0, 8, 0, 100, 0, 69445, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Detective Snap Snagglebolt - On Spellhit - say'),
+(37172, 0, 4, 0, 8, 0, 100, 0, 69563, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Detective Snap Snagglebolt - On Spellhit - say'),
+(37172, 0, 5, 0, 8, 0, 100, 0, 69489, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Detective Snap Snagglebolt - On Spellhit - say'),
+(38066, 0, 3, 0, 8, 0, 100, 0, 69445, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Inspector Snip Snagglebolt - On Spellhit - say'),
+(38066, 0, 4, 0, 8, 0, 100, 0, 69563, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Inspector Snip Snagglebolt - On Spellhit - say'),
+(38066, 0, 5, 0, 8, 0, 100, 0, 69489, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Inspector Snip Snagglebolt - On Spellhit - say'),
+(5703,2,1,0,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,10,208843,38065,0,0,0,0,0,"On Trigger - Set Data"),
+(5705,2,1,0,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,10,48573,37671,0,0,0,0,0,"On Trigger - Set Data");
+
+UPDATE `smart_scripts` SET `link`=1 WHERE `entryorguid`IN(5703,5705) AND `source_type`=2 AND `id`=0 AND `link`=0;
+
+DELETE FROM `creature_text` WHERE `entry` IN(37172,38066,37671,38065);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(37671, 0, 0, 'That crate won''t deliver itself, friend. Get a move on!', 12, 0, 100, 1, 0, 0, 38024, 0, 'Crown Supply Guard'),
+(38065, 0, 0, 'That crate won''t deliver itself, friend. Get a move on!', 12, 0, 100, 1, 0, 0, 38024, 0, 'Crown Supply Guard'),
+(37172, 0, 0, 'You know, that does smell pretty... Hey! Stop spraying that thing at me!', 12, 0, 100, 1, 0, 0, 38296, 0, 'Detective Snap Snagglebolt'),
+(37172, 1, 0, 'Don''t tempt me! Do you even know what''s in those things?', 12, 0, 100, 1, 0, 0, 38382, 0, 'Detective Snap Snagglebolt'),
+(38066, 0, 0, 'You know, that does smell pretty... Hey! Stop spraying that thing at me!', 12, 0, 100, 1, 0, 0, 38296, 0, 'Inspector Snip Snagglebolt'),
+(38066, 1, 0, 'Don''t tempt me! Do you even know what''s in those things?', 12, 0, 100, 1, 0, 0, 38382, 0, 'Inspector Snip Snagglebolt');
+
+DELETE FROM `gossip_menu` WHERE `entry`=10990;
+INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
+(10990, 15282),
+(10990, 15280);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=10990;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(14, 10990, 15280, 0, 0, 1, 0, 71450, 0, 0, 1, 0, 0, '', 'Crown Guard has different gossip if player has no aura Crown Parcel Service Uniform'),
+(14, 10990, 15282, 0, 0, 1, 0, 71450, 0, 0, 0, 0, 0, '', 'Crown Guard has different gossip if player has aura Crown Parcel Service Uniform');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_02_world.sql
new file mode 100644
index 00000000000..6590396b7d9
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_17_02_world.sql
@@ -0,0 +1,21 @@
+ UPDATE `creature_template` SET `gossip_menu_id`=10948, `npcflag`=3, `AIName`='SmartAI' WHERE `entry` IN(38045,38044,38043,38042,38041,38040,38039,37887);
+
+ DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (38045,38044,38043,38042,38041,38040,38039,37887);
+
+ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+ (38045, 0, 0, 1, 62, 0, 100, 0, 10948, 0, 0, 0, 11, 70648, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Cast Create Lovely Charm Collectors Kit'),
+ (38045, 0, 1, 0, 61, 0, 100, 0, 10948, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Close Gossip'),
+ (38044, 0, 0, 1, 62, 0, 100, 0, 10948, 0, 0, 0, 11, 70648, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Cast Create Lovely Charm Collectors Kit'),
+ (38044, 0, 1, 0, 61, 0, 100, 0, 10948, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Close Gossip'),
+ (38043, 0, 0, 1, 62, 0, 100, 0, 10948, 0, 0, 0, 11, 70648, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Cast Create Lovely Charm Collectors Kit'),
+ (38043, 0, 1, 0, 61, 0, 100, 0, 10948, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Close Gossip'),
+ (38042, 0, 0, 1, 62, 0, 100, 0, 10948, 0, 0, 0, 11, 70648, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Cast Create Lovely Charm Collectors Kit'),
+ (38042, 0, 1, 0, 61, 0, 100, 0, 10948, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Close Gossip'),
+ (38041, 0, 0, 1, 62, 0, 100, 0, 10948, 0, 0, 0, 11, 70648, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Cast Create Lovely Charm Collectors Kit'),
+ (38041, 0, 1, 0, 61, 0, 100, 0, 10948, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Close Gossip'),
+ (38040, 0, 0, 1, 62, 0, 100, 0, 10948, 0, 0, 0, 11, 70648, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Cast Create Lovely Charm Collectors Kit'),
+ (38040, 0, 1, 0, 61, 0, 100, 0, 10948, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Close Gossip'),
+ (38039, 0, 0, 1, 62, 0, 100, 0, 10948, 0, 0, 0, 11, 70648, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Cast Create Lovely Charm Collectors Kit'),
+ (38039, 0, 1, 0, 61, 0, 100, 0, 10948, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Close Gossip'),
+ (37887, 0, 0, 1, 62, 0, 100, 0, 10948, 0, 0, 0, 11, 70648, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Cast Create Lovely Charm Collectors Kit'),
+ (37887, 0, 1, 0, 61, 0, 100, 0, 10948, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kwee Q. Peddlefeet - On Gossip Option Select - Close Gossip');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_00_world.sql
new file mode 100644
index 00000000000..c20196ddc80
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_00_world.sql
@@ -0,0 +1,7 @@
+-- Add missing creature text for Mr. Smite in Deadmines.
+DELETE FROM creature_text WHERE entry=646;
+INSERT INTO creature_text (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(646, 0, 0, 'You there, check out that noise!', 14, 0, 100, 0, 0, 5775, 1148, 2, 'smite SAY_ALARM1'),
+(646, 1, 0, 'We\'re under attack! Avast, ye swabs! Repel the invaders!', 14, 0, 100, 0, 0, 5777, 1149, 2, 'smite SAY_ALARM2'),
+(646, 2, 0, 'You landlubbers are tougher than I thought, I\'ll have to Improvise!', 12, 0, 100, 0, 0, 5778, 1344, 0, 'smite SAY_PHASE_1'),
+(646, 3, 0, 'D\'ah! Now you\'re making me angry!', 12, 0, 100, 0, 0, 5779, 1345, 0, 'smite SAY_PHASE_2');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_01_world.sql
new file mode 100644
index 00000000000..c3ffdbb6344
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_01_world.sql
@@ -0,0 +1,49 @@
+UPDATE `creature_template` SET `spell2`=61784,`spell3`=61785,`spell4`=61788,`spell5`=61786,`spell6`=61787 WHERE `entry` IN (34812,34819,34822,34823,34824);
+-- The Turkey Chair
+UPDATE `creature_template` SET `spell1`=66250 WHERE `entry`=34812;
+UPDATE `creature_template_addon` SET `auras`='61796 61801' WHERE `entry`=34812;
+-- The Stuffing Chair
+UPDATE `creature_template` SET `spell1`=66259 WHERE `entry`=34819;
+UPDATE `creature_template_addon` SET `auras`='61795 61800' WHERE `entry`=34819;
+-- The Pie Chair
+UPDATE `creature_template` SET `spell1`=66260 WHERE `entry`=34822;
+UPDATE `creature_template_addon` SET `auras`='61794 61799' WHERE `entry`=34822;
+-- The Cranberry Chair
+UPDATE `creature_template` SET `spell1`=66261 WHERE `entry`=34823;
+UPDATE `creature_template_addon` SET `auras`='61793 61798' WHERE `entry`=34823;
+-- The Potato Chair
+UPDATE `creature_template` SET `spell1`=66262 WHERE `entry`=34824;
+UPDATE `creature_template_addon` SET `auras`='61797 61802' WHERE `entry`=34824;
+
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_pilgrims_bounty_feast_on';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(61784, 'spell_pilgrims_bounty_feast_on'), -- Feast On Turkey
+(61785, 'spell_pilgrims_bounty_feast_on'), -- Feast On Cranberries
+(61786, 'spell_pilgrims_bounty_feast_on'), -- Feast On Sweet Potatoes
+(61787, 'spell_pilgrims_bounty_feast_on'), -- Feast On Pie
+(61788, 'spell_pilgrims_bounty_feast_on'); -- Feast On Stuffing
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN
+('spell_pilgrims_bounty_well_fed_cranberry',
+'spell_pilgrims_bounty_well_fed_turkey',
+'spell_pilgrims_bounty_well_fed_stuffing',
+'spell_pilgrims_bounty_well_fed_sweet_potatoes',
+'spell_pilgrims_bounty_well_fed_pie');
+INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES
+(61841, 'spell_pilgrims_bounty_well_fed_cranberry'),
+(61842, 'spell_pilgrims_bounty_well_fed_turkey'),
+(61843, 'spell_pilgrims_bounty_well_fed_stuffing'),
+(61844, 'spell_pilgrims_bounty_well_fed_sweet_potatoes'),
+(61845, 'spell_pilgrims_bounty_well_fed_pie');
+
+-- Pilgrim's Paunch criterias
+DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (11078,11079,11080,11081,11082,11083,11084,11085);
+INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`) VALUES
+(11078,6,1657,0),
+(11079,6,809,0),
+(11080,6,3557,0),
+(11081,6,12,0),
+(11082,6,14,0),
+(11083,6,3470,0),
+(11084,6,1638,0),
+(11085,6,1497,0);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_02_world.sql
new file mode 100644
index 00000000000..414c6fd9c3a
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_18_02_world.sql
@@ -0,0 +1,5 @@
+-- Change Egbert's script name
+UPDATE creature_template SET ScriptName = "npc_pet_gen_egbert" WHERE entry = 23258;
+
+-- Change Pandaran Monk's script name
+UPDATE creature_template SET ScriptName = "npc_pet_gen_pandaren_monk" WHERE entry = 36911;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_19_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_19_00_world.sql
new file mode 100644
index 00000000000..bee93f7bdd4
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_19_00_world.sql
@@ -0,0 +1,9 @@
+UPDATE `quest_template_addon` SET `PrevQuestID` =0 WHERE `ID` IN(24536,24655);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (19,20) AND `SourceEntry`IN(24805,24804) AND `ConditionTypeOrReference`=14 AND `ConditionValue1` IN(24536,24655);
+
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(19, 0, 24805, 0, 0, 14, 0, 24536, 0, 0, 0, 0, 0, '', 'Uncommon Scents is optional BreadCrumb Quest'),
+(20, 0, 24805, 0, 0, 14, 0, 24536, 0, 0, 0, 0, 0, '', 'Uncommon Scents is optional BreadCrumb Quest'),
+(19, 0, 24804, 0, 0, 14, 0, 24655, 0, 0, 0, 0, 0, '', 'Uncommon Scents is optional BreadCrumb Quest'),
+(20, 0, 24804, 0, 0, 14, 0, 24655, 0, 0, 0, 0, 0, '', 'Uncommon Scents is optional BreadCrumb Quest');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_19_01_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_19_01_world_335.sql
new file mode 100644
index 00000000000..f7fee657170
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_19_01_world_335.sql
@@ -0,0 +1,8 @@
+--
+DELETE FROM `spell_proc_event` WHERE `entry`= 56841;
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+(56841, 0, 9, 0x800, 0x800, 0x800, 0x100, 0, 0, 0, 0);
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_hun_glyph_of_arcane_shot';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(56841,'spell_hun_glyph_of_arcane_shot');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_00_world.sql
new file mode 100644
index 00000000000..d92ea91681a
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_00_world.sql
@@ -0,0 +1,2 @@
+-- baron geddon & ragnaros do pure fire elemental damage with melee attacks
+UPDATE `creature_template` SET `dmgschool`=2 WHERE `entry` in (12056,11502);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_01_world.sql
new file mode 100644
index 00000000000..b1345bb1aab
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_01_world.sql
@@ -0,0 +1,26 @@
+UPDATE`spell_dbc` SET `Effect1`=28, `EffectMiscValueB1`=64 WHERE `Id`IN(38953,38955,38956,38957,38958,38978);
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` =22355;
+DELETE FROM `smart_scripts` WHERE `entryorguid` =22355 AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` BETWEEN 2235500 AND 2235505;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(22355, 0, 0, 1, 11, 0, 100, 1, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - On Respawn - Disable Combat Movement (No Repeat)'),
+(22355, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 18, 2097152, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - On Respawn - Set Flag Disarmed (No Repeat)'),
+(22355, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - On Respawn - Set Invincibility HP'),
+(22355, 0, 3, 0, 4, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - On Agro - Store Target List (No Repeat)'),
+(22355, 0, 4, 5, 2, 0, 100, 1, 0, 0, 0, 0, 11, 38949, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - On 1% HP - Cast Terokkar Free Webbed Creature (No Repeat)'),
+(22355, 0, 5, 6,61, 0, 100, 1, 0, 0, 0, 0, 11, 38950, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - On 1% HP - Cast Terokkar Free Webbed Creature ON QUEST (No Repeat)'),
+(22355, 0, 6, 0,61, 0, 100, 1, 0, 0, 0, 0, 87, 2233500, 2233501, 2233502, 2233503, 2233504, 2233505, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - On 1% HP - Run Random Script (No Repeat)'),
+(2235500, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38953, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 1 - Cast Terokkar Free Webbed Creature '),
+(2235500, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 1 - Die'),
+(2235501, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38955, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 2 - Cast Terokkar Free Webbed Creature '),
+(2235501, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 2 - Die'),
+(2235502, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38956, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 3 - Cast Terokkar Free Webbed Creature '),
+(2235502, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 3 - Die'),
+(2235503, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38957, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 4 - Cast Terokkar Free Webbed Creature '),
+(2235503, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 4 - Die'),
+(2235504, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38958, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 5 - Cast Terokkar Free Webbed Creature '),
+(2235504, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 5 - Die'),
+(2235505, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 33, 22459, 2, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 6 - Kill Credit'),
+(2235505, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 38978, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 6 - Cast Terokkar Free Webbed Creature '),
+(2235505, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Netherweb Victim - Script 6 - Die');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_02_world.sql
new file mode 100644
index 00000000000..dd62e6dce29
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_22_02_world.sql
@@ -0,0 +1,34 @@
+SET @OGUID := 74901;
+
+UPDATE `gameobject` SET `spawntimesecs`=120 WHERE `id`=188441;
+DELETE FROM `gameobject` WHERE `id`=188441 AND `guid` BETWEEN @OGUID+0 AND @OGUID+28;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0 , 188441, 571, 1, 1, 4599.037, 285.0833, 95.23787, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+1 , 188441, 571, 1, 1, 4556.1, 231.2934, 96.77894, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+2 , 188441, 571, 1, 1, 4499.447, 108.0523, 89.83501, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+3 , 188441, 571, 1, 1, 4481.178, 127.8052, 88.98753, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+4 , 188441, 571, 1, 1, 4518.543, 226.8698, 90.04359, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+5 , 188441, 571, 1, 1, 4476.379, 92.48655, 88.96384, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+6 , 188441, 571, 1, 1, 4599.19, 760.0677, 93.87521, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+7, 188441, 571, 1, 1, 4593.348, 741.4844, 95.79951, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+8, 188441, 571, 1, 1, 4751.073, 453.6788, 126.705, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+9, 188441, 571, 1, 1, 4682.298, 401.2016, 113.0896, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+10, 188441, 571, 1, 1, 4751.073, 453.6788, 126.705, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+11, 188441, 571, 1, 1, 4682.298, 401.2016, 113.0896, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+12, 188441, 571, 1, 1, 4607.061, 650.2381, 99.33231, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+13, 188441, 571, 1, 1, 4617.78, 647.2289, 100.198, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+14, 188441, 571, 1, 1, 4603.35, 646.6047, 99.39375, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+15, 188441, 571, 1, 1, 4599.037, 285.0833, 95.23787, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+16, 188441, 571, 1, 1, 4601.033, 262.5729, 94.59935, 3.595379, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+17, 188441, 571, 1, 1, 4578.877, 274.382, 94.57744, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+18, 188441, 571, 1, 1, 4516.654, 214.9381, 90.17368, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+19, 188441, 571, 1, 1, 4570.082, 246.2316, 90.96891, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+20, 188441, 571, 1, 1, 4553.599, 249.401, 91.1224, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+21, 188441, 571, 1, 1, 4532.682, 221.2274, 92.86555, 5.340709, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+22, 188441, 571, 1, 1, 4481.178, 127.8052, 88.98753, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+23, 188441, 571, 1, 1, 4499.447, 108.0523, 89.83501, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+24, 188441, 571, 1, 1, 4505.154, 59.0905, 86.1317, 5.078908, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+25, 188441, 571, 1, 1, 4458.161, 127.8561, 89.45293, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+26, 188441, 571, 1, 1, 4556.1, 231.2934, 96.77894, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+27, 188441, 571, 1, 1, 4556.1, 231.2934, 96.77894, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 188441 (Area: 65)
+(@OGUID+28, 188441, 571, 1, 1, 4583.655, 232.1632, 95.92954, 4.729844, 0, 0, 0, 1, 120, 255, 1); -- 188441 (Area: 65)
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_00_world.sql
new file mode 100644
index 00000000000..871ce608f1c
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_00_world.sql
@@ -0,0 +1 @@
+UPDATE `smart_scripts` SET `action_param1`=2235500, `action_param2`=2235501, `action_param3`=2235502, `action_param4`=2235503, `action_param5`=2235504, `action_param6`=2235505 WHERE `entryorguid`=22355 AND `source_type`=0 AND `id`=6 AND `link`=0;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_01_world.sql
new file mode 100644
index 00000000000..0773487dbc7
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_01_world.sql
@@ -0,0 +1,119 @@
+SET @OGUID:=82948;
+SET @CGUID:=85532;
+SET @Event:=7;
+
+-- Add missing lunar objects
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+89;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0 , 180879, 530, 1, 1, -4021.671, -11847.32, 0.006294, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 0) -- exodar
+(@OGUID+1 , 180777, 530, 1, 1, -4016.04, -11831.66, 0.122772, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+2 , 180777, 530, 1, 1, -4019.716, -11831.79, 0.095343, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 0)
+(@OGUID+3 , 180880, 530, 1, 1, -4021.575, -11847.88, 1.865077, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 0)
+(@OGUID+4 , 180881, 530, 1, 1, -4021.983, -11847.42, 1.806305, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 0)
+(@OGUID+5 , 180882, 530, 1, 1, -4021.177, -11847.73, 1.821342, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 0)
+(@OGUID+6 , 180883, 530, 1, 1, -4021.107, -11847.26, 1.800923, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 0)
+(@OGUID+7 , 180883, 530, 1, 1, -4021.65, -11846.95, 1.829355, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 0)
+(@OGUID+8 , 180869, 530, 1, 1, -4023.456, -11837.75, 0.015313, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 0)
+(@OGUID+9 , 180869, 530, 1, 1, -4011.058, -11837.71, 0.147322, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 0)
+(@OGUID+10, 180766, 530, 1, 1, -4012.713, -11842.4, 0.117445, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+11, 180766, 530, 1, 1, -4020.125, -11847.21, 0.023653, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+12, 180766, 530, 1, 1, -4014.778, -11847.44, 0.082153, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+13, 180766, 530, 1, 1, -4022.487, -11842.52, 0.009148, 5.305802, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+14, 180766, 530, 1, 1, -4008.917, -11837.83, 0.170679, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+15, 180766, 530, 1, 1, -4012.804, -11831.57, 0.146643, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+16, 180766, 530, 1, 1, -4025.327, -11837.02, 0.008528, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+17, 180766, 530, 1, 1, -4023.502, -11831.39, 0.072735, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 0)
+(@OGUID+18, 180878, 530, 1, 1, -4022.725, -11846.54, -0.003436, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 0)
+(@OGUID+19, 180878, 530, 1, 1, -4023.054, -11847.33, -0.00903, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 0)
+(@OGUID+20, 180878, 530, 1, 1, -4022.056, -11846.02, 0.005262, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 0)
+(@OGUID+21, 180878, 530, 1, 1, -4021.267, -11845.9, 0.014263, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 0)
+(@OGUID+22, 180878, 530, 1, 1, -4021.343, -11848.85, 0.009881, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 0)
+(@OGUID+23, 180878, 530, 1, 1, -4022.729, -11848.02, -0.005639, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 0)
+(@OGUID+24, 180878, 530, 1, 1, -4022.064, -11848.56, 0.00076, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 0)
+(@OGUID+25, 180766, 1, 1, 1, 10147.02, 2574.3, 1320.719, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 1659) -- darnassus
+(@OGUID+26, 180766, 1, 1, 1, 10149.6, 2592.33, 1330.62, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 1659)
+(@OGUID+27, 180766, 1, 1, 1, 10154.62, 2593.352, 1330.546, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 1659)
+(@OGUID+28, 180766, 1, 1, 1, 10148.55, 2610.374, 1330.823, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 1658)
+(@OGUID+29, 180766, 1, 1, 1, 10159.98, 2604.604, 1330.823, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 1658)
+(@OGUID+30, 180766, 1, 1, 1, 10141.72, 2600.144, 1330.823, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180766 (Area: 1658)
+(@OGUID+31, 180765, 1, 1, 1, 10040.4, 2478.42, 1353.98, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 0)
+(@OGUID+32, 180765, 1, 1, 1, 10050.7, 2510.37, 1353.98, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 0)
+(@OGUID+33, 180765, 1, 1, 1, 10170.16, 2554.241, 1344.727, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+34, 180765, 1, 1, 1, 10088.98, 2580.349, 1341.743, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+35, 180765, 1, 1, 1, 10170.96, 2556.492, 1366.235, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+36, 180765, 1, 1, 1, 10163.1, 2568.72, 1353.59, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+37, 180765, 1, 1, 1, 10156.62, 2582.27, 1345.43, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+38, 180765, 1, 1, 1, 10107.72, 2590.667, 1341.86, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+39, 180765, 1, 1, 1, 10106.9, 2600.88, 1340.55, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+40, 180765, 1, 1, 1, 10080.89, 2586.866, 1340.509, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+41, 180765, 1, 1, 1, 10185.6, 2561.11, 1366.71, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+42, 180765, 1, 1, 1, 10165.39, 2580.426, 1361.882, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+43, 180765, 1, 1, 1, 10162.87, 2569.218, 1366.497, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1659)
+(@OGUID+44, 180765, 1, 1, 1, 10180.73, 2583.701, 1364.723, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1658)
+(@OGUID+45, 180765, 1, 1, 1, 10185.8, 2575.52, 1366.34, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 180765 (Area: 1658)
+(@OGUID+46, 180878, 1, 1, 1, 10147.58, 2574.047, 1320.637, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 1659)
+(@OGUID+47, 180878, 1, 1, 1, 10145.04, 2573.837, 1321.027, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 1659)
+(@OGUID+48, 180878, 1, 1, 1, 10146.93, 2572.094, 1320.741, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 1659)
+(@OGUID+49, 180878, 1, 1, 1, 10147.89, 2574.833, 1320.575, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 1659)
+(@OGUID+50, 180878, 1, 1, 1, 10145.3, 2572.096, 1320.981, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 1659)
+(@OGUID+51, 180878, 1, 1, 1, 10144.76, 2572.774, 1321.074, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 1659)
+(@OGUID+52, 180878, 1, 1, 1, 10148.35, 2574.187, 1320.516, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 180878 (Area: 1659)
+(@OGUID+53, 180879, 1, 1, 1, 10146.29, 2573.105, 1320.675, 5.864307, 0, 0, 0, 1, 120, 255, 1), -- 180879 (Area: 1659)
+(@OGUID+54, 180777, 1, 1, 1, 10155.51, 2571.573, 1320.54, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 1659)
+(@OGUID+55, 180777, 1, 1, 1, 10146.33, 2574.491, 1320.823, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 1659)
+(@OGUID+56, 180777, 1, 1, 1, 10148.78, 2592.293, 1330.527, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 1659)
+(@OGUID+57, 180777, 1, 1, 1, 10155.43, 2593.67, 1330.43, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 1659)
+(@OGUID+58, 180881, 1, 1, 1, 10146.31, 2573.473, 1322.492, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 1659)
+(@OGUID+59, 180882, 1, 1, 1, 10146.49, 2573.022, 1322.495, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 1659)
+(@OGUID+60, 180883, 1, 1, 1, 10145.72, 2573.401, 1322.479, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 1659)
+(@OGUID+61, 180883, 1, 1, 1, 10145.87, 2572.747, 1322.489, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 1659)
+(@OGUID+62, 180868, 1, 1, 1, 10148.56, 2596.947, 1330.823, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 1659)
+(@OGUID+63, 180868, 1, 1, 1, 10154.36, 2598.172, 1330.823, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 1658)
+(@OGUID+64, 180868, 1, 1, 1, 10152.6, 2607.9, 1330.82, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 1658)
+(@OGUID+65, 180868, 1, 1, 1, 10145.24, 2600.956, 1330.823, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 1658)
+(@OGUID+66, 180868, 1, 1, 1, 10146.67, 2607.012, 1330.823, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 1658)
+(@OGUID+67, 180868, 1, 1, 1, 10156.24, 2603.661, 1330.823, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 1658)
+(@OGUID+68, 180869, 1, 1, 1, 10147.5, 2600.15, 1330.82, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 1658)
+(@OGUID+69, 180869, 1, 1, 1, 10153.85, 2601.112, 1330.823, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 180869 (Area: 1658)
+(@OGUID+70, 180884, 0, 1, 1, -4643.956, -952.7753, 501.6609, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 180884 (Area: 4679) -- ironforge
+(@OGUID+71, 180777, 0, 1, 1, -4657.851, -970.8358, 502.1435, 1.780234, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 4679)
+(@OGUID+72, 180777, 0, 1, 1, -4647.056, -954.0901, 502.1464, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 4679)
+(@OGUID+73, 180777, 0, 1, 1, -4657.756, -940.899, 502.1457, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 4679)
+(@OGUID+74, 180777, 0, 1, 1, -4676.447, -948.0982, 502.145, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 180777 (Area: 4679)
+(@OGUID+75, 180880, 0, 1, 1, -4643.901, -952.4222, 502.6053, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 4679)
+(@OGUID+76, 180880, 0, 1, 1, -4644.116, -952.0615, 502.6122, 6.021387, 0, 0, 0, 1, 120, 255, 1), -- 180880 (Area: 4679)
+(@OGUID+77, 180881, 0, 1, 1, -4644.559, -952.6501, 502.5913, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 4679)
+(@OGUID+78, 180881, 0, 1, 1, -4644.697, -951.6542, 502.5873, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 180881 (Area: 4679)
+(@OGUID+79, 180882, 0, 1, 1, -4643.973, -951.5918, 502.5915, 5.061456, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 4679)
+(@OGUID+80, 180882, 0, 1, 1, -4643.597, -952.0538, 502.5845, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 180882 (Area: 4679)
+(@OGUID+81, 180883, 0, 1, 1, -4643.862, -952.8162, 502.5914, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 4679)
+(@OGUID+82, 180883, 0, 1, 1, -4644.573, -952.2311, 502.5913, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 180883 (Area: 4679)
+(@OGUID+83, 180868, 530, 1, 1, -4014.642, -11845.6, 0.088204, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 0) -- more exodar
+(@OGUID+84, 180868, 530, 1, 1, -4020.391, -11845.43, 0.025103, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 0)
+(@OGUID+85, 180868, 530, 1, 1, -4014.579, -11842.59, 0.096342, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 0)
+(@OGUID+86, 180868, 530, 1, 1, -4014.198, -11835.3, 0.118586, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 0)
+(@OGUID+87, 180868, 530, 1, 1, -4021.152, -11835.28, 0.0539, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 0)
+(@OGUID+88, 180868, 530, 1, 1, -4020.445, -11842.34, 0.032153, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 180868 (Area: 0)
+(@OGUID+89, 180868, 530, 1, 1, -4017.739, -11832.38, 0.104225, 4.729844, 0, 0, 0, 1, 120, 255, 1); -- 180868 (Area: 0)
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+89 AND `eventEntry`=@Event;
+INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+89;
+
+-- Add missing lunar spawns
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+11;
+INSERT INTO `creature` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `curhealth`) VALUES
+(@CGUID+0, 15892, 530, -4014.533, -11839.5, 0.1878313, 2.617994, 120, 0), -- 15892 (Area: 0)
+(@CGUID+1, 15892, 530, -4017.631, -11834.3, 0.1710953, 4.747295, 120, 0), -- 15892 (Area: 0)
+(@CGUID+2, 15892, 530, -4020.615, -11839.4, 0.1208633, 0.4712389, 120, 0), -- 15892 (Area: 0)
+(@CGUID+3, 15892, 1, 10146.8, 2603.15, 1330.903, 6.021386, 120, 0), -- 15892 (Area: 1658)
+(@CGUID+4, 15892, 1, 10151.3, 2598.93, 1330.903, 1.780236, 120, 0), -- 15892 (Area: 1658)
+(@CGUID+5, 15892, 1, 10153.2, 2604.51, 1330.903, 3.961897, 120, 0), -- 15892 (Area: 1658)
+(@CGUID+6, 15898, 530, -4020.056, -11848.42, 0.1050933, 4.677482, 120, 0), -- 15898 (Area: 0) (Auras: )
+(@CGUID+7, 15898, 1, 10148.03, 2572.627, 1320.697, 4.18879, 120, 0), -- 15898 (Area: 1659) (Auras: )
+(@CGUID+8, 15895, 530, -4014.714, -11848.54, 0.1634673, 4.799655, 120, 0), -- 15895 (Area: 0) (Auras: )
+(@CGUID+9, 15895, 1, 10153.6, 2593.45, 1330.843, 4.799655, 120, 0), -- 15895 (Area: 1659) (Auras: )
+(@CGUID+10, 15897, 530, -4017.511, -11837.73, 0.1593063, 4.39823, 120, 0), -- 15897 (Area: 0) (Auras: 25824 - 25824)
+(@CGUID+11, 15897, 1, 10150.53, 2602.14, 1330.906, 1.570796, 120, 0); -- 15897 (Area: 1658) (Auras: 25824 - 25824)
+
+DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+11 AND `eventEntry`=@Event;
+INSERT INTO `game_event_creature` SELECT @Event, creature.guid FROM `creature` WHERE creature.guid BETWEEN @CGUID+0 AND @CGUID+11;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_02_world.sql
new file mode 100644
index 00000000000..9e2c550dd65
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_23_02_world.sql
@@ -0,0 +1,6 @@
+DELETE FROM `creature_text` WHERE `entry` IN(37671,38065) AND `id`>0;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(37671, 0, 1, 'Time is money, friend. Go go go!', 12, 0, 100, 1, 0, 0, 38022, 0, 'Crown Supply Guard'),
+(38065, 0, 1, 'Time is money, friend. Go go go!', 12, 0, 100, 1, 0, 0, 38022, 0, 'Crown Supply Guard'),
+(37671, 0, 2, 'The Lovely Merchant is waiting for that. Hurry it up!', 12, 0, 100, 1, 0, 0, 38023, 0, 'Crown Supply Guard'),
+(38065, 0, 2, 'The Lovely Merchant is waiting for that. Hurry it up!', 12, 0, 100, 1, 0, 0, 38023, 0, 'Crown Supply Guard');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_24_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_24_00_world.sql
new file mode 100644
index 00000000000..06c7c29bd72
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_24_00_world.sql
@@ -0,0 +1,1966 @@
+SET @OGUID:=83038;
+SET @Event:=8;
+
+-- Add missing love is in the air objects
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+1941;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0 , 187575, 571, 1, 1, 5820.163, 557.1407, 653.0472, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4395)
+(@OGUID+1 , 187575, 571, 1, 1, 5813.242, 555.0104, 653.1141, 1.832595, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4395)
+(@OGUID+2 , 187575, 571, 1, 1, 5828.393, 518.7396, 659.42, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4395)
+(@OGUID+3 , 187575, 571, 1, 1, 5619.527, 688.4839, 653.2624, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4568)
+(@OGUID+4 , 187575, 571, 1, 1, 5622.715, 695.6467, 653.2054, 5.864307, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4568)
+(@OGUID+5 , 187575, 571, 1, 1, 5625.892, 702.7949, 653.3616, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4568)
+(@OGUID+6 , 187575, 571, 1, 1, 5982.965, 599.3807, 651.8081, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4618)
+(@OGUID+7 , 187575, 571, 1, 1, 5988.552, 613.9961, 651.6794, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4618)
+(@OGUID+8 , 187575, 571, 1, 1, 5985.754, 606.6982, 651.8865, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4618)
+(@OGUID+9 , 187575, 571, 1, 1, 6193.209, -1053.005, 410.5604, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4419)
+(@OGUID+10 , 187575, 571, 1, 1, 6111.217, -1074.599, 407.2788, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4419)
+(@OGUID+11 , 187575, 571, 1, 1, 6122.76, -1081.095, 406.5847, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4419)
+(@OGUID+12 , 187575, 571, 1, 1, 6139.989, -1079.811, 405.7787, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4419)
+(@OGUID+13 , 187575, 571, 1, 1, 6122.866, -1073.905, 407.455, 1.640607, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4419)
+(@OGUID+14 , 187575, 571, 1, 1, 6133.952, -1074.677, 406.6819, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4419)
+(@OGUID+15 , 187575, 571, 1, 1, 6105.763, -1080.907, 407.3781, 3.228859, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4419)
+(@OGUID+16 , 187575, 571, 1, 1, 6121.725, -1096.696, 406.5187, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4419)
+(@OGUID+17 , 187575, 571, 1, 1, 5141.983, -2154.615, 244.3087, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+18 , 187575, 571, 1, 1, 5179.932, -2192.024, 239.8268, 2.897245, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+19 , 187575, 571, 1, 1, 5193.838, -2203.542, 239.8356, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+20 , 187575, 571, 1, 1, 5111.679, -2201.835, 243.7792, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+21 , 187575, 571, 1, 1, 5196.897, -2215.816, 243.9398, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+22 , 187575, 571, 1, 1, 5526.034, -2669.764, 304.289, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4275)
+(@OGUID+23 , 187575, 571, 1, 1, 5762.96, -3526.665, 391.1757, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4324)
+(@OGUID+24 , 187575, 571, 1, 1, 5746.468, -3556.428, 390.0896, 6.056293, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4324)
+(@OGUID+25 , 187575, 571, 1, 1, 5768.534, -3620.057, 389.5159, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4324)
+(@OGUID+26 , 187575, 571, 1, 1, 5778.518, -3600.462, 387.3365, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4324)
+(@OGUID+27 , 187575, 571, 1, 1, 4608.65, -4233.896, 181.3112, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+28 , 187575, 571, 1, 1, 4583.46, -4214.486, 178.712, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4159)
+(@OGUID+29 , 187575, 571, 1, 1, 4588.769, -4259.397, 183.0127, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4159)
+(@OGUID+30 , 187575, 571, 1, 1, 4545.505, -4198.653, 174.6676, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4159)
+(@OGUID+31 , 187575, 571, 1, 1, 4516.881, -4237.698, 172.0961, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4159)
+(@OGUID+32 , 187575, 571, 1, 1, 4525.026, -4220.745, 171.4343, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4159)
+(@OGUID+33 , 187575, 571, 1, 1, 4524.598, -4165.28, 174.0965, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4159)
+(@OGUID+34 , 187575, 571, 1, 1, 4530.678, -4141.924, 175.9093, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4159)
+(@OGUID+35 , 187575, 571, 1, 1, 4456.922, -4314.456, 160.9202, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4159)
+(@OGUID+36 , 187575, 571, 1, 1, 3876.39, -4523.813, 218.0925, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4205)
+(@OGUID+37 , 187575, 571, 1, 1, 3454.602, -2802.049, 202.4846, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+38 , 187575, 571, 1, 1, 3259.021, -2267.587, 114.378, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4248)
+(@OGUID+39 , 187575, 571, 1, 1, 3263.253, -2264.287, 115.0179, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4248)
+(@OGUID+40 , 187575, 571, 1, 1, 1420.218, -3720.073, 139.7719, 3.752462, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+41 , 187575, 571, 1, 1, 737.0417, -2925.07, 7.038448, 5.969027, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3987)
+(@OGUID+42 , 187575, 571, 1, 1, 737.8021, -2929.837, 6.96212, 0.5934101, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3987)
+(@OGUID+43 , 187575, 571, 1, 1, 789.0579, -2887.322, 6.061472, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3988)
+(@OGUID+44 , 187575, 571, 1, 1, 2491.536, -5071.006, 298.8146, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4003)
+(@OGUID+45 , 187575, 571, 1, 1, 2472.029, -5066.281, 286.0714, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4003)
+(@OGUID+46 , 187575, 571, 1, 1, 2472.168, -5058.874, 292.4872, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4003)
+(@OGUID+47 , 187575, 571, 1, 1, 2474.881, -5069.709, 286.0041, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4003)
+(@OGUID+48 , 187575, 571, 1, 1, 2499.964, -5059.02, 286.9637, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4003)
+(@OGUID+49 , 187575, 571, 1, 1, 2653.467, -4398.361, 284.5294, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+50 , 187575, 571, 1, 1, 2645.279, -4389.678, 283.9462, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+51 , 187575, 571, 1, 1, 3644.348, -723.9233, 218.8718, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4177)
+(@OGUID+52 , 187575, 571, 1, 1, 3647.875, -707.9075, 217.1875, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4177)
+(@OGUID+53 , 187575, 571, 1, 1, 3658.615, -719.4378, 218.7648, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4177)
+(@OGUID+54 , 187575, 571, 1, 1, 3713.571, -686.2274, 216.503, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4177)
+(@OGUID+55 , 187575, 571, 1, 1, 3720.316, -705.8351, 216.0074, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4177)
+(@OGUID+56 , 187575, 571, 1, 1, 3827.11, 1482.655, 95.12893, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4165)
+(@OGUID+57 , 187575, 571, 1, 1, 3859.411, 1466.078, 94.9991, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4165)
+(@OGUID+58 , 187575, 571, 1, 1, 3825.417, 1465.946, 95.10252, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4165)
+(@OGUID+59 , 187575, 571, 1, 1, 3842.333, 1481.939, 97.79363, 1.640607, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4165)
+(@OGUID+60 , 187575, 571, 1, 1, 3857.466, 1482.773, 96.1758, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4165)
+(@OGUID+61 , 187575, 571, 1, 1, 3827.736, 1496.177, 95.10645, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4165)
+(@OGUID+62 , 187575, 571, 1, 1, 3857.144, 1496.144, 95.12449, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4165)
+(@OGUID+63 , 187575, 571, 1, 1, 3770.23, 1602.427, 95.77409, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4165)
+(@OGUID+64 , 187575, 571, 1, 1, 3781.036, 1623.459, 95.58131, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4165)
+(@OGUID+65 , 187575, 571, 1, 1, 3553.18, 1827.47, 81.077, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+66 , 187575, 571, 1, 1, 3643.384, 1884.3, 80.81538, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+67 , 187575, 571, 1, 1, 2756.815, 926.7635, 23.2116, 2.984498, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4152)
+(@OGUID+68 , 187575, 571, 1, 1, 2792.32, 944.9219, 23.26566, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4152)
+(@OGUID+69 , 187575, 571, 1, 1, 2798.089, 941.0677, 24.67208, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4152)
+(@OGUID+70 , 187575, 571, 1, 1, 2756.885, 920.0313, 24.40833, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4152)
+(@OGUID+71 , 187575, 571, 1, 1, 2791.102, 904.5616, 23.04511, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4152)
+(@OGUID+72 , 187575, 571, 1, 1, 2787.111, 910.8663, 32.01936, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4152)
+(@OGUID+73 , 187575, 571, 1, 1, 2742.9, 887.7947, 6.358366, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4152)
+(@OGUID+74 , 187575, 571, 1, 1, 2732.103, 881.1441, 6.379679, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4152)
+(@OGUID+75 , 187575, 571, 1, 1, 2713.987, 894.1632, 16.31461, 2.059488, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4152)
+(@OGUID+76 , 187575, 571, 1, 1, 4971.71, 1267.167, 228.3888, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4170)
+(@OGUID+77 , 187575, 571, 1, 1, 4967.139, 1265.599, 227.7066, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4170)
+(@OGUID+78 , 187575, 571, 1, 1, 4942.589, 1170.193, 239.8133, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4170)
+(@OGUID+79 , 187575, 571, 1, 1, 4951.857, 1167.702, 240.1477, 4.206246, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4170)
+(@OGUID+80 , 187575, 571, 1, 1, 4937.846, 1158.604, 240.5038, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4170)
+(@OGUID+81 , 187575, 571, 1, 1, 5009.385, 1205.95, 231.4591, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4170)
+(@OGUID+82 , 187575, 571, 1, 1, 3449.408, 4085.986, 17.83682, 1.815142, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4042)
+(@OGUID+83 , 187575, 571, 1, 1, 2980.379, 4053.99, 28.38085, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4113)
+(@OGUID+84 , 187575, 571, 1, 1, 3007.164, 4071.765, 35.89487, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4113)
+(@OGUID+85 , 187575, 571, 1, 1, 3026.245, 4045.878, 28.50895, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4113)
+(@OGUID+86 , 187575, 571, 1, 1, 2279.208, 5188.578, 16.22224, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+87 , 187575, 571, 1, 1, 2288.109, 5196.549, 14.44638, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+88 , 187575, 571, 1, 1, 2924.559, 6242.063, 209.8437, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4129)
+(@OGUID+89 , 187575, 571, 1, 1, 2924.903, 6244.5, 210.3616, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4129)
+(@OGUID+90 , 187575, 571, 1, 1, 4111.603, 5303.919, 31.3832, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+91 , 187575, 571, 1, 1, 4475.266, 5707.764, 82.36211, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+92 , 187575, 571, 1, 1, 4470.285, 5710.635, 82.27143, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+93 , 187575, 571, 1, 1, 5482.611, 4728.695, -191.6311, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4290)
+(@OGUID+94 , 187575, 571, 1, 1, 8473.581, -342.7954, 906.4036, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4436)
+(@OGUID+95 , 187575, 571, 1, 1, 8418.453, -349.0424, 909.3304, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4436)
+(@OGUID+96 , 187575, 571, 1, 1, 8433.876, -362.944, 908.5649, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 4436)
+(@OGUID+97 , 187575, 571, 1, 1, 7856.078, -735.8157, 1178.389, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+98 , 187575, 530, 1, 1, -2564.838, 4432.062, 39.61848, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3683)
+(@OGUID+99 , 187575, 530, 1, 1, -2560.156, 4422.9, 40.24272, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3683)
+(@OGUID+100 , 187575, 530, 1, 1, -2621.607, 4461.632, 39.31939, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3683)
+(@OGUID+101 , 187575, 530, 1, 1, -2618.607, 4461.301, 39.33173, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3683)
+(@OGUID+102 , 187575, 530, 1, 1, -2619.96, 4462.996, 39.3169, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3683)
+(@OGUID+103 , 187575, 530, 1, 1, -2620.309, 4459.896, 39.31923, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3683)
+(@OGUID+104 , 187575, 530, 1, 1, -3009.571, 3998.962, 5.706537, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3684)
+(@OGUID+105 , 187575, 530, 1, 1, -2991.61, 3988.035, 5.85871, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3684)
+(@OGUID+106 , 187575, 530, 1, 1, -3002.449, 3997.882, 5.743727, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3684)
+(@OGUID+107 , 187575, 530, 1, 1, -3026.769, 2565.998, 80.07526, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3744)
+(@OGUID+108 , 187575, 530, 1, 1, -3012.218, 2548.628, 79.43921, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3744)
+(@OGUID+109 , 187575, 530, 1, 1, -2979.819, 2565.84, 79.82945, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3744)
+(@OGUID+110 , 187575, 530, 1, 1, -2963.231, 2558.747, 80.31774, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3744)
+(@OGUID+111 , 187575, 530, 1, 1, -3977.41, 2165.698, 106.9871, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3745)
+(@OGUID+112 , 187575, 530, 1, 1, -4075.49, 2189.597, 111.462, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3745)
+(@OGUID+113 , 187575, 530, 1, 1, -4069.704, 2183.112, 108.5346, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3745)
+(@OGUID+114 , 187575, 530, 1, 1, -4064.588, 1124.245, 43.41816, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3929)
+(@OGUID+115 , 187575, 530, 1, 1, -3061.328, 737.1945, -8.771701, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3754)
+(@OGUID+116 , 187575, 530, 1, 1, -154.7856, 5523.646, 31.50904, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3565)
+(@OGUID+117 , 187575, 530, 1, 1, -158.5099, 5535.154, 31.47245, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3565)
+(@OGUID+118 , 187575, 530, 1, 1, 225.3918, 7813.881, 22.98265, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+119 , 187575, 530, 1, 1, 221.99, 7810.066, 23.68496, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+120 , 187575, 530, 1, 1, 332.2872, 7829.961, 39.40045, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3645)
+(@OGUID+121 , 187575, 530, 1, 1, 241.3687, 7913.663, 27.14164, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3645)
+(@OGUID+122 , 187575, 530, 1, 1, 342.1493, 7867.583, 45.30079, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3645)
+(@OGUID+123 , 187575, 530, 1, 1, 233.8486, 7910.588, 27.21144, 5.218536, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3645)
+(@OGUID+124 , 187575, 530, 1, 1, 1044.723, 7368.755, 43.1856, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3766)
+(@OGUID+125 , 187575, 530, 1, 1, 1052.611, 7359.699, 42.62963, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3766)
+(@OGUID+126 , 187575, 530, 1, 1, 1989.314, 6784.465, 167.9164, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3772)
+(@OGUID+127 , 187575, 530, 1, 1, 2016.857, 6885.055, 182.8496, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3772)
+(@OGUID+128 , 187575, 530, 1, 1, 2944.679, 5466.702, 150.6358, 0, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3951)
+(@OGUID+129 , 187575, 530, 1, 1, 3013.267, 5429.971, 148.0764, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3951)
+(@OGUID+130 , 187575, 530, 1, 1, 2165.546, 4727.486, 159.5631, 2.268925, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3844)
+(@OGUID+131 , 187575, 530, 1, 1, 2188.357, 4795.172, 158.674, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3844)
+(@OGUID+132 , 187575, 530, 1, 1, 2181.066, 4706.845, 159.5976, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3844)
+(@OGUID+133 , 187575, 530, 1, 1, 2045.43, 4686.257, 153.306, 1.029743, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3844)
+(@OGUID+134 , 187575, 530, 1, 1, 2032.304, 4663.961, 153.4191, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3844)
+(@OGUID+135 , 187575, 0, 1, 1, -4630.104, -928.945, 506.1224, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 5344)
+(@OGUID+136 , 187575, 530, 1, 1, -4227.08, -12484.05, 47.71632, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+137 , 187575, 530, 1, 1, -4231.724, -12498.08, 47.24671, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 0)
+(@OGUID+138 , 187575, 530, 1, 1, -4207.997, -12557.59, 46.31153, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3576)
+(@OGUID+139 , 187575, 530, 1, 1, -4183.172, -12564.08, 45.20827, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3576)
+(@OGUID+140 , 187575, 530, 1, 1, -4107.671, -12483.03, 47.42568, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3576)
+(@OGUID+141 , 187575, 530, 1, 1, -4105.227, -12501.2, 47.79556, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3576)
+(@OGUID+142 , 187575, 530, 1, 1, -4122.453, -12463.12, 48.0975, 3.842447, 0, 0, 0, 1, 120, 255, 1), -- 187575 (Area: 3576)
+(@OGUID+143 , 187668, 571, 1, 1, 5855.43, 634.2999, 649.2884, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4395)
+(@OGUID+144 , 187668, 571, 1, 1, 5858.512, 638.0903, 649.1016, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4395)
+(@OGUID+145 , 187668, 571, 1, 1, 5838.521, 520.3542, 659.7874, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4395)
+(@OGUID+146 , 187668, 571, 1, 1, 5819.291, 514.2288, 659.8239, 1.099556, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4395)
+(@OGUID+147 , 187668, 571, 1, 1, 5855.882, 661.2175, 649.2011, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4395)
+(@OGUID+148 , 187668, 571, 1, 1, 5852.286, 664.1205, 649.1534, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4395)
+(@OGUID+149 , 187668, 571, 1, 1, 5726.839, 678.6988, 648.3967, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4739)
+(@OGUID+150 , 187668, 571, 1, 1, 5730.19, 682.8389, 648.4232, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4739)
+(@OGUID+151 , 187668, 571, 1, 1, 5769.932, 711.6566, 619.6014, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4739)
+(@OGUID+152 , 187668, 571, 1, 1, 5766.1, 706.9418, 619.6938, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4739)
+(@OGUID+153 , 187668, 571, 1, 1, 5863.507, 473.3883, 642.9924, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4613)
+(@OGUID+154 , 187668, 571, 1, 1, 5904.753, 489.8196, 643.4774, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4616)
+(@OGUID+155 , 187668, 571, 1, 1, 5906.59, 480.6752, 643.4434, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4616)
+(@OGUID+156 , 187668, 571, 1, 1, 5864.693, 467.3737, 643.1257, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4616)
+(@OGUID+157 , 187668, 571, 1, 1, 6676.186, -199.1807, 956.5273, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4428)
+(@OGUID+158 , 187668, 571, 1, 1, 6124.218, -1074.936, 405.0566, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4419)
+(@OGUID+159 , 187668, 571, 1, 1, 6124.213, -1076.51, 404.6239, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4419)
+(@OGUID+160 , 187668, 571, 1, 1, 6120.367, -1076.484, 404.6041, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4419)
+(@OGUID+161 , 187668, 571, 1, 1, 6120.694, -1074.873, 405.0674, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4419)
+(@OGUID+162 , 187668, 571, 1, 1, 5796.578, -3553.885, 388.331, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4323)
+(@OGUID+163 , 187668, 571, 1, 1, 3416.354, -2799.535, 203.6574, 2.042035, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+164 , 187668, 571, 1, 1, 3404.744, -2783.643, 203.9436, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+165 , 187668, 571, 1, 1, 3421.742, -2795.542, 203.7708, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+166 , 187668, 571, 1, 1, 3410.07, -2779.702, 203.9763, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+167 , 187668, 571, 1, 1, 1454.493, -3273.58, 168.5273, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4071)
+(@OGUID+168 , 187668, 571, 1, 1, 1427.002, -3268.351, 169.1821, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3998)
+(@OGUID+169 , 187668, 571, 1, 1, 1431.483, -3274.533, 169.1915, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3998)
+(@OGUID+170 , 187668, 571, 1, 1, 1438.028, -3267.566, 169.513, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3998)
+(@OGUID+171 , 187668, 571, 1, 1, 1437.135, -3266.915, 169.5058, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3998)
+(@OGUID+172 , 187668, 571, 1, 1, 1429.582, -3265.274, 169.2192, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3998)
+(@OGUID+173 , 187668, 571, 1, 1, 1445.74, -3257.578, 169.2403, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3998)
+(@OGUID+174 , 187668, 571, 1, 1, 440.0521, -4547.913, 248.6341, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3991)
+(@OGUID+175 , 187668, 571, 1, 1, 441.8183, -4550.703, 248.5898, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3991)
+(@OGUID+176 , 187668, 571, 1, 1, 455.1633, -4536.68, 247.5673, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3991)
+(@OGUID+177 , 187668, 571, 1, 1, 458.6449, -4542.124, 247.7258, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3991)
+(@OGUID+178 , 187668, 571, 1, 1, 587.3395, -4934.356, 20.82388, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3981)
+(@OGUID+179 , 187668, 571, 1, 1, 586.2632, -4934.662, 20.74441, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3981)
+(@OGUID+180 , 187668, 571, 1, 1, 580.5126, -4939.842, 20.76777, 0.2094394, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3981)
+(@OGUID+181 , 187668, 571, 1, 1, 581.4718, -4943.683, 20.63075, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3981)
+(@OGUID+182 , 187668, 571, 1, 1, 1891.333, -6175.724, 26.62351, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4000)
+(@OGUID+183 , 187668, 571, 1, 1, 1894.171, -6177.047, 26.61499, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4000)
+(@OGUID+184 , 187668, 571, 1, 1, 1890.348, -6204.115, 26.52463, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4000)
+(@OGUID+185 , 187668, 571, 1, 1, 1872.679, -6195.768, 26.33468, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4000)
+(@OGUID+186 , 187668, 571, 1, 1, 2425.66, -5166.585, 282.1942, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4003)
+(@OGUID+187 , 187668, 571, 1, 1, 2482.925, -5077.249, 291.7695, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4003)
+(@OGUID+188 , 187668, 571, 1, 1, 2472.532, -5054.136, 292.9761, 0, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4003)
+(@OGUID+189 , 187668, 571, 1, 1, 2678.708, -4395.557, 285.5654, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+190 , 187668, 571, 1, 1, 2681.623, -4397.512, 285.5597, 0.9599299, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+191 , 187668, 571, 1, 1, 2677.323, -4386.643, 290.0943, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+192 , 187668, 571, 1, 1, 3217.361, -685.8459, 169.8989, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4232)
+(@OGUID+193 , 187668, 571, 1, 1, 3219.979, -680.9132, 169.6687, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4232)
+(@OGUID+194 , 187668, 571, 1, 1, 3207.445, -675.2426, 170.4363, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4232)
+(@OGUID+195 , 187668, 571, 1, 1, 3205.08, -679.9858, 170.4128, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4232)
+(@OGUID+196 , 187668, 571, 1, 1, 3635.864, -710.7761, 215.8188, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+197 , 187668, 571, 1, 1, 3640.115, -711.2604, 215.9585, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+198 , 187668, 571, 1, 1, 3651.599, -711.7225, 216.8413, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4177)
+(@OGUID+199 , 187668, 571, 1, 1, 3666.347, -703.8602, 217.6456, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4177)
+(@OGUID+200 , 187668, 571, 1, 1, 3665.587, -710.9298, 217.4738, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4177)
+(@OGUID+201 , 187668, 571, 1, 1, 3480.165, 1977.29, 70.61582, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4158)
+(@OGUID+202 , 187668, 571, 1, 1, 3472.212, 1983.86, 69.00069, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4158)
+(@OGUID+203 , 187668, 571, 1, 1, 3476.039, 2008.531, 68.95277, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4158)
+(@OGUID+204 , 187668, 571, 1, 1, 3484.333, 2013.51, 68.88947, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4158)
+(@OGUID+205 , 187668, 571, 1, 1, 2770.71, 934.493, 25.70063, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4152)
+(@OGUID+206 , 187668, 571, 1, 1, 2777.521, 938.1545, 25.58711, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4152)
+(@OGUID+207 , 187668, 571, 1, 1, 2271.331, 5194.442, 14.39653, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+208 , 187668, 571, 1, 1, 2299.134, 5198.044, 13.93274, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+209 , 187668, 571, 1, 1, 2280.926, 5198.394, 14.63274, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+210 , 187668, 571, 1, 1, 2281.226, 5199.101, 14.57226, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+211 , 187668, 571, 1, 1, 2272.831, 5198.149, 14.36126, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+212 , 187668, 571, 1, 1, 2824.468, 6139.032, 88.58996, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4129)
+(@OGUID+213 , 187668, 571, 1, 1, 2792.786, 6176.63, 88.45963, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4129)
+(@OGUID+214 , 187668, 571, 1, 1, 2824.102, 6142.47, 88.44103, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4129)
+(@OGUID+215 , 187668, 571, 1, 1, 2789.38, 6177.33, 88.61863, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4129)
+(@OGUID+216 , 187668, 571, 1, 1, 4176.385, 5285.042, 28.29611, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4108)
+(@OGUID+217 , 187668, 571, 1, 1, 4176.302, 5277.055, 28.09965, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4108)
+(@OGUID+218 , 187668, 571, 1, 1, 4171.795, 5282.206, 41.54663, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4108)
+(@OGUID+219 , 187668, 571, 1, 1, 4178.876, 5273.907, 40.73148, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 4108)
+(@OGUID+220 , 187668, 530, 1, 1, -2961.582, 2546.881, 79.93132, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3744)
+(@OGUID+221 , 187668, 530, 1, 1, -2963.262, 2557.669, 96.95348, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3744)
+(@OGUID+222 , 187668, 530, 1, 1, -2954.958, 2567.078, 81.00614, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3744)
+(@OGUID+223 , 187668, 530, 1, 1, -2961.015, 2557.951, 93.87666, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3744)
+(@OGUID+224 , 187668, 530, 1, 1, -4074.347, 2162.13, 111.4437, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3745)
+(@OGUID+225 , 187668, 530, 1, 1, -4072.622, 2162.176, 111.4297, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3745)
+(@OGUID+226 , 187668, 530, 1, 1, -4076.15, 2162.084, 111.4253, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3745)
+(@OGUID+227 , 187668, 530, 1, 1, -2979.535, 851.0223, -5.23692, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3754)
+(@OGUID+228 , 187668, 530, 1, 1, -2974.166, 852.9896, -5.184109, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3754)
+(@OGUID+229 , 187668, 530, 1, 1, 289.163, 6085.788, 135.125, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3644)
+(@OGUID+230 , 187668, 530, 1, 1, 276.0255, 6085.296, 135.0984, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3644)
+(@OGUID+231 , 187668, 530, 1, 1, 270.995, 6092.489, 133.5649, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3644)
+(@OGUID+232 , 187668, 530, 1, 1, 261.8294, 6096.237, 133.3653, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3644)
+(@OGUID+233 , 187668, 530, 1, 1, 266.4354, 6094.357, 133.5182, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3644)
+(@OGUID+234 , 187668, 530, 1, 1, 239.3766, 7930.089, 27.83519, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3645)
+(@OGUID+235 , 187668, 530, 1, 1, 223.9831, 7923.57, 27.90063, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3645)
+(@OGUID+236 , 187668, 530, 1, 1, 228.6397, 7945.422, 29.25893, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3645)
+(@OGUID+237 , 187668, 530, 1, 1, 3057.197, 3694.741, 145.4213, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3712)
+(@OGUID+238 , 187668, 530, 1, 1, 3060.614, 3691.763, 144.8515, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3712)
+(@OGUID+239 , 187668, 530, 1, 1, 3058.398, 3696.026, 144.8155, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3712)
+(@OGUID+240 , 187668, 530, 1, 1, 3058.831, 3691.601, 145.45, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3712)
+(@OGUID+241 , 187668, 530, 1, 1, -4207.088, -12473.58, 46.58454, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+242 , 187668, 530, 1, 1, -4192.907, -12467.66, 46.6215, 5.794494, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+243 , 187668, 530, 1, 1, -4216.924, -12483.89, 48.3932, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+244 , 187668, 530, 1, 1, -4216.502, -12480.64, 48.98628, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+245 , 187668, 530, 1, 1, -4212.281, -12515.08, 50.44548, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+246 , 187668, 530, 1, 1, -4212.782, -12506.34, 46.88014, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+247 , 187668, 530, 1, 1, -4208.398, -12519.56, 47.62306, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 0)
+(@OGUID+248 , 187668, 530, 1, 1, -4149.234, -12485.86, 50.90091, 3.859896, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3576)
+(@OGUID+249 , 187668, 530, 1, 1, -4164.37, -12536.8, 48.27224, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3576)
+(@OGUID+250 , 187668, 530, 1, 1, -4160.896, -12457.07, 47.62824, 4.153885, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3576)
+(@OGUID+251 , 187668, 530, 1, 1, -4167.781, -12537.14, 48.95461, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3576)
+(@OGUID+252 , 187668, 530, 1, 1, -4144.596, -12490.33, 45.72705, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3576)
+(@OGUID+253 , 187668, 530, 1, 1, -4152.799, -12480.7, 45.96771, 2.844883, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3576)
+(@OGUID+254 , 187668, 530, 1, 1, -4163.363, -12455.46, 47.14916, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3576)
+(@OGUID+255 , 187668, 530, 1, 1, -4153.813, -12532.33, 49.37784, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3576)
+(@OGUID+256 , 187668, 530, 1, 1, -4150.61, -12525.97, 49.39287, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3576)
+(@OGUID+257 , 187668, 530, 1, 1, -4173.694, -13729.01, 76.77699, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3526)
+(@OGUID+258 , 187668, 530, 1, 1, -4050.141, -13778.29, 76.35183, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3527)
+(@OGUID+259 , 187668, 530, 1, 1, -4047.493, -13771.29, 76.13934, 6.19592, 0, 0, 0, 1, 120, 255, 1), -- 187668 (Area: 3527)
+(@OGUID+260 , 201940, 530, 1, 1, 9611.64, -7183.144, 14.28471, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 201940 (Area: 3487)
+(@OGUID+261 , 201940, 0, 1, 1, -4918.394, -983.5625, 501.4531, 2.268925, 0, 0, 0, 1, 120, 255, 1), -- 201940 (Area: 5342)
+(@OGUID+262 , 201940, 0, 1, 1, -8868.988, 637.1007, 95.78714, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 201940 (Area: 5148) Valentine Arch (x2.00)
+(@OGUID+263 , 201940, 1, 1, 1, 9870.75, 2493.63, 1315.87, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 201940 (Area: 0)
+(@OGUID+264 , 201940, 530, 1, 1, -4005.649, -11844.58, 0.186079, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 201940 (Area: 0)
+(@OGUID+265 , 181027, 571, 1, 1, 5768.591, 693.1081, 612.2136, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4739)
+(@OGUID+266 , 181027, 571, 1, 1, 5740.348, 662.5662, 612.2136, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4739)
+(@OGUID+267 , 181027, 571, 1, 1, 5734.721, 656.9608, 612.2136, 5.166176, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4739)
+(@OGUID+268 , 181027, 571, 1, 1, 5718.801, 654.3483, 612.2136, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4739)
+(@OGUID+269 , 181027, 571, 1, 1, 5753.042, 707.0385, 612.2136, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4739)
+(@OGUID+270 , 181027, 571, 1, 1, 5787.936, 719.6158, 612.2136, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4739)
+(@OGUID+271 , 181027, 571, 1, 1, 5792.599, 725.4569, 612.2136, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4739)
+(@OGUID+272 , 181027, 571, 1, 1, 5720.552, 681.9709, 612.2136, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4739)
+(@OGUID+273 , 181027, 571, 1, 1, 2620.68, -2024.098, 0, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+274 , 181027, 571, 1, 1, 2558.805, -1994.658, 0, 5.078908, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+275 , 181027, 571, 1, 1, 2530.056, -2001.654, 0, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+276 , 181027, 571, 1, 1, 2571.232, -1981.536, 0, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+277 , 181027, 571, 1, 1, 2564.62, -1902.94, 0, 1.204277, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+278 , 181027, 571, 1, 1, 2578.922, -1926.984, 0, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+279 , 181027, 571, 1, 1, 2604.255, -1901.251, 0, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+280 , 181027, 571, 1, 1, 2600.202, -1864.442, 0, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+281 , 181027, 571, 1, 1, 2600.614, -1814.094, 0, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+282 , 181027, 571, 1, 1, 2604.877, -1833.523, 0, 1.099556, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+283 , 181027, 571, 1, 1, 2415.667, -1854.533, 0, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+284 , 181027, 571, 1, 1, 2407.166, -1845.278, 0, 2.268925, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+285 , 181027, 571, 1, 1, 2404.097, -1864.177, 0, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+286 , 181027, 571, 1, 1, 2414.991, -1875.148, 0, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4242)
+(@OGUID+287 , 181027, 571, 1, 1, 754.5249, -2854.845, 0, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3988)
+(@OGUID+288 , 181027, 571, 1, 1, 767.0814, -2846.513, 0, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3988)
+(@OGUID+289 , 181027, 571, 1, 1, 793.7769, -2840.536, 0, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3988)
+(@OGUID+290 , 181027, 571, 1, 1, 794.0623, -2848.875, 0, 1.378809, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3988)
+(@OGUID+291 , 181027, 571, 1, 1, 796.1247, -2842.772, 0, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3988)
+(@OGUID+292 , 181027, 571, 1, 1, 765.928, -2820.402, 0, 5.794494, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3988)
+(@OGUID+293 , 181027, 571, 1, 1, 2455.453, -5133.994, 275.5138, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4003)
+(@OGUID+294 , 181027, 571, 1, 1, 2459.948, -5130.551, 275.5138, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4003)
+(@OGUID+295 , 181027, 571, 1, 1, 2455.139, -5131.472, 275.5138, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4003)
+(@OGUID+296 , 181027, 571, 1, 1, 2380.471, -5088.479, 248.5613, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4003)
+(@OGUID+297 , 181027, 571, 1, 1, 2502.854, -5015.77, 275.4288, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4003)
+(@OGUID+298 , 181027, 571, 1, 1, 2485.411, -5004.169, 274.5456, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4003)
+(@OGUID+299 , 181027, 571, 1, 1, 2485.646, -5000.984, 274.5577, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4003)
+(@OGUID+300 , 181027, 571, 1, 1, 2369.498, -5004.655, 248.5613, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4003)
+(@OGUID+301 , 181027, 571, 1, 1, 2375.392, -5002.363, 248.5613, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4003)
+(@OGUID+302 , 181027, 571, 1, 1, 3496.388, 1977.59, 65.96105, 5.969027, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4158)
+(@OGUID+303 , 181027, 571, 1, 1, 3495.364, 1981.665, 66.03764, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4158)
+(@OGUID+304 , 181027, 571, 1, 1, 3490.632, 1980.51, 65.99807, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4158)
+(@OGUID+305 , 181027, 571, 1, 1, 2702.725, 934.8021, 0, 1.780234, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+306 , 181027, 571, 1, 1, 2700.923, 919.1116, 0, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+307 , 181027, 571, 1, 1, 2717.166, 869.525, 0, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+308 , 181027, 571, 1, 1, 2717.919, 866.1157, 0, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+309 , 181027, 571, 1, 1, 2658.5, 918.8054, 0, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+310 , 181027, 571, 1, 1, 2670.15, 871.2205, 0, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+311 , 181027, 571, 1, 1, 2668.09, 872.3976, 0, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+312 , 181027, 571, 1, 1, 2666.374, 918.7291, 0, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+313 , 181027, 571, 1, 1, 2627.73, 887.0659, 0, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+314 , 181027, 571, 1, 1, 2626.058, 889.1933, 0, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+315 , 181027, 571, 1, 1, 2627.751, 895.2178, 0, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4152)
+(@OGUID+316 , 181027, 571, 1, 1, 5500.563, 5787.042, -82.11499, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4285)
+(@OGUID+317 , 181027, 571, 1, 1, 5509.842, 5766.954, -84.06371, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4285)
+(@OGUID+318 , 181027, 571, 1, 1, 5513.78, 5795.364, -80.6015, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4285)
+(@OGUID+319 , 181027, 571, 1, 1, 5510.346, 5761.825, -84.18658, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4285)
+(@OGUID+320 , 181027, 571, 1, 1, 5501.959, 5802.074, -79.23232, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4285)
+(@OGUID+321 , 181027, 571, 1, 1, 5513.074, 5766.733, -84.07557, 1.099556, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4285)
+(@OGUID+322 , 181027, 571, 1, 1, 5567.791, 5826.353, -73.64291, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4285)
+(@OGUID+323 , 181027, 571, 1, 1, 5562.381, 5829.076, -73.01419, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4285)
+(@OGUID+324 , 181027, 571, 1, 1, 5469.105, 4760.201, -198.9201, 0.2443456, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4290)
+(@OGUID+325 , 181027, 571, 1, 1, 5469.406, 4742.04, -198.9063, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4290)
+(@OGUID+326 , 181027, 571, 1, 1, 5478.349, 4771.299, -198.9465, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4290)
+(@OGUID+327 , 181027, 571, 1, 1, 5467.913, 4754.535, -198.9201, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4290)
+(@OGUID+328 , 181027, 571, 1, 1, 5450.431, 4755.577, -198.9201, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4290)
+(@OGUID+329 , 181027, 571, 1, 1, 5445.94, 4761.356, -199.0263, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 4290)
+(@OGUID+330 , 181027, 530, 1, 1, 1961.764, 6885.375, 162.7591, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3771)
+(@OGUID+331 , 181027, 530, 1, 1, 1965.24, 6884.419, 162.7591, 4.206246, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3772)
+(@OGUID+332 , 181027, 530, 1, 1, 1964.663, 6887.743, 162.7591, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3772)
+(@OGUID+333 , 181027, 530, 1, 1, 2097.025, 6825.342, 174.8524, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3772)
+(@OGUID+334 , 181027, 530, 1, 1, 2095.012, 6821.211, 174.8731, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3772)
+(@OGUID+335 , 181027, 530, 1, 1, 2092.416, 6825.399, 174.8686, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3772)
+(@OGUID+336 , 181027, 530, 1, 1, 2089.096, 6768.958, 164.8599, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3772)
+(@OGUID+337 , 181027, 530, 1, 1, 2092.187, 6765.44, 164.8475, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3772)
+(@OGUID+338 , 181027, 530, 1, 1, 2093.987, 6769.731, 164.8697, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3772)
+(@OGUID+339 , 181027, 530, 1, 1, 2991.37, 5483.188, 144.6114, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3951)
+(@OGUID+340 , 181027, 530, 1, 1, 2986.906, 5481.471, 144.5909, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3951)
+(@OGUID+341 , 181027, 530, 1, 1, 2991.238, 5478.47, 144.5909, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3951)
+(@OGUID+342 , 181027, 530, 1, 1, 3030.463, 5492.013, 147.1473, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3951)
+(@OGUID+343 , 181027, 530, 1, 1, 3034.872, 5490.722, 147.1473, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3951)
+(@OGUID+344 , 181027, 530, 1, 1, 3011.45, 5435.751, 147.5007, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3951)
+(@OGUID+345 , 181027, 530, 1, 1, 3008.707, 5438.396, 147.5007, 6.0912, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3951)
+(@OGUID+346 , 181027, 530, 1, 1, 3012.275, 5442.078, 147.5007, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 3951)
+(@OGUID+347 , 181027, 1, 1, 1, 9880.624, 2653.088, 1313.663, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 0)
+(@OGUID+348 , 181027, 1, 1, 1, 10019.46, 2649.182, 1313.663, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 0)
+(@OGUID+349 , 181027, 1, 1, 1, 10017.74, 2611.615, 1313.663, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 0)
+(@OGUID+350 , 181027, 1, 1, 1, 9854.155, 2651.854, 1313.663, 1.343901, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 0)
+(@OGUID+351 , 181027, 1, 1, 1, 10020.17, 2520.957, 1313.663, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 0)
+(@OGUID+352 , 181027, 1, 1, 1, 9810.941, 2549.63, 1313.663, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 1661)
+(@OGUID+353 , 181027, 1, 1, 1, 9849.217, 2418.983, 1313.663, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 1661)
+(@OGUID+354 , 181027, 1, 1, 1, 9825.401, 2650.506, 1313.663, 4.590216, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 1661)
+(@OGUID+355 , 181027, 1, 1, 1, 9784.707, 2649.149, 1313.663, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 1661)
+(@OGUID+356 , 181027, 1, 1, 1, 9715.958, 2650.025, 1313.663, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 1661)
+(@OGUID+357 , 181027, 1, 1, 1, 9891.688, 2416.095, 1313.663, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 1661)
+(@OGUID+358 , 181027, 1, 1, 1, 9819.463, 2391.367, 1313.663, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 1662)
+(@OGUID+359 , 181027, 1, 1, 1, 9928.718, 2391.573, 1313.663, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 0)
+(@OGUID+360 , 181027, 1, 1, 1, 9949.143, 2370.309, 1313.663, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 0)
+(@OGUID+361 , 181027, 1, 1, 1, 10056.48, 2424.052, 1313.663, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181027 (Area: 1660)
+(@OGUID+362 , 181025, 571, 1, 1, 5422.828, -2574.388, 314.5182, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4275)
+(@OGUID+363 , 181025, 571, 1, 1, 5490.349, -2575.417, 313.0533, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4275)
+(@OGUID+364 , 181025, 571, 1, 1, 4524.684, -4252.019, 177.0246, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4159)
+(@OGUID+365 , 181025, 571, 1, 1, 4532.347, -4148.53, 182.7989, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4159)
+(@OGUID+366 , 181025, 571, 1, 1, 3881.886, -4516.897, 223.7292, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4205)
+(@OGUID+367 , 181025, 571, 1, 1, 3431.319, -2776.561, 215.7577, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 0)
+(@OGUID+368 , 181025, 571, 1, 1, 3300.602, -2378.899, 117.8947, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 0)
+(@OGUID+369 , 181025, 571, 1, 1, 3282.833, -2368.123, 117.8988, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 0)
+(@OGUID+370 , 181025, 571, 1, 1, 3293.471, -2350.238, 117.6907, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 0)
+(@OGUID+371 , 181025, 571, 1, 1, 3311.093, -2361.425, 117.9167, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 0)
+(@OGUID+372 , 181025, 571, 1, 1, 3346.118, -2225.082, 119.375, 2.042035, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4206)
+(@OGUID+373 , 181025, 571, 1, 1, 3336.534, -2207.365, 120.0341, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4206)
+(@OGUID+374 , 181025, 571, 1, 1, 3193.161, -2253.913, 117.8538, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4206)
+(@OGUID+375 , 181025, 571, 1, 1, 3191.496, -2233.637, 117.8115, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4206)
+(@OGUID+376 , 181025, 571, 1, 1, 3187.294, -2198.184, 141.9457, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4206)
+(@OGUID+377 , 181025, 571, 1, 1, 3207.165, -2204.585, 142.3003, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4206)
+(@OGUID+378 , 181025, 571, 1, 1, 3193.716, -2178.347, 141.7413, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4206)
+(@OGUID+379 , 181025, 571, 1, 1, 1390.88, -3366.663, 194.8545, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 3998)
+(@OGUID+380 , 181025, 571, 1, 1, 1350.993, -3356.948, 196.8577, 1.343901, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 3998)
+(@OGUID+381 , 181025, 571, 1, 1, 3232.417, -718.9236, 167.9964, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4232)
+(@OGUID+382 , 181025, 571, 1, 1, 3557.501, -768.2603, 203.7256, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 0)
+(@OGUID+383 , 181025, 571, 1, 1, 3599.903, -757.4666, 199.1967, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 0)
+(@OGUID+384 , 181025, 571, 1, 1, 3628.027, -668.0167, 244.9439, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 0)
+(@OGUID+385 , 181025, 571, 1, 1, 3647.813, -648.9062, 243.9453, 0.7679439, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+386 , 181025, 571, 1, 1, 3634.617, -644.8275, 244.1315, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+387 , 181025, 571, 1, 1, 3641.374, -671.6805, 245.1112, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+388 , 181025, 571, 1, 1, 3650.591, -754.5084, 201.8451, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+389 , 181025, 571, 1, 1, 3695.235, -765.3697, 202.1208, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+390 , 181025, 571, 1, 1, 3767.403, -747.8274, 211.6567, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+391 , 181025, 571, 1, 1, 3779.269, -809.5614, 209.6387, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+392 , 181025, 571, 1, 1, 3815.78, -754.2736, 213.8814, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+393 , 181025, 571, 1, 1, 3800.189, -817.2236, 208.8302, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+394 , 181025, 571, 1, 1, 3816.917, -800.0577, 208.6812, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+395 , 181025, 571, 1, 1, 3826.977, -809.4998, 208.5766, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+396 , 181025, 571, 1, 1, 3809.892, -826.8338, 208.5438, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+397 , 181025, 571, 1, 1, 3893.759, -696.3032, 261.979, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+398 , 181025, 571, 1, 1, 3928.128, -732.9033, 262.2497, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+399 , 181025, 571, 1, 1, 3905.213, -659.3301, 257.8033, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+400 , 181025, 571, 1, 1, 3966.297, -733.6108, 257.4371, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+401 , 181025, 571, 1, 1, 3893.384, -829.6746, 205.0926, 5.218536, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+402 , 181025, 571, 1, 1, 3847.43, -835.5692, 200.8211, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+403 , 181025, 571, 1, 1, 3807.228, -855.2426, 203.9786, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+404 , 181025, 571, 1, 1, 3797.328, -852.065, 204.1598, 3.630291, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4177)
+(@OGUID+405 , 181025, 571, 1, 1, 3465.233, 228.1736, 59.31886, 3.263772, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4161)
+(@OGUID+406 , 181025, 571, 1, 1, 3635.294, 245.6354, 58.86659, 0.06981169, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4161)
+(@OGUID+407 , 181025, 571, 1, 1, 3628.324, 318.184, 59.31886, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4161)
+(@OGUID+408 , 181025, 571, 1, 1, 3457.301, 300.75, 59.31886, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4161)
+(@OGUID+409 , 181025, 571, 1, 1, 3665.188, 265.6042, -109.3723, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4161)
+(@OGUID+410 , 181025, 571, 1, 1, 3661.484, 303.9514, -109.4306, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181025 (Area: 4161)
+(@OGUID+411 , 181022, 530, 1, 1, -1982.277, 5110.882, 7.504348, 4.590216, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+412 , 181022, 530, 1, 1, -1964.9, 5104.314, 7.514653, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+413 , 181022, 530, 1, 1, -1873.795, 4977.795, -22.33295, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+414 , 181022, 530, 1, 1, -1857.198, 4976.8, -22.56705, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+415 , 181022, 530, 1, 1, -1546.829, 5108.851, -20.84263, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+416 , 181022, 0, 1, 1, -8430.985, 596.3506, 94.62032, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 5150)
+(@OGUID+417 , 181022, 0, 1, 1, -8538.67, 470.2, 104.521, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 5150)
+(@OGUID+418 , 181022, 0, 1, 1, -8554.11, 459.615, 104.693, 1.762782, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 5150)
+(@OGUID+419 , 181022, 0, 1, 1, -8732.06, 393.212, 98.2072, 1.343901, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 5149)
+(@OGUID+420 , 181022, 0, 1, 1, -8434.75, 987.1312, 96.96603, 2.303831, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+421 , 181022, 0, 1, 1, -8509.754, 1041.872, 59.36489, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+422 , 181022, 0, 1, 1, -8402.518, 1059.08, 31.63022, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+423 , 181022, 0, 1, 1, -8424.703, 1075.745, 19.67526, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+424 , 181022, 0, 1, 1, -8533.77, 1066.152, 18.98668, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+425 , 181022, 0, 1, 1, -8616.668, 1038.597, 97.02485, 5.724681, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+426 , 181022, 0, 1, 1, -8519.527, 1122.33, 18.91462, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+427 , 181022, 0, 1, 1, -8466.509, 1156.274, 18.6443, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 0)
+(@OGUID+428 , 181022, 0, 1, 1, -8307.936, 1071.653, 57.26217, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+429 , 181022, 0, 1, 1, -8408.185, 1193.769, 5.698709, 1.780234, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+430 , 181022, 0, 1, 1, -8373.63, 1192.8, 5.891318, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+431 , 181022, 0, 1, 1, -8468.239, 1192.766, 6.125231, 1.640607, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+432 , 181022, 0, 1, 1, -8518.73, 1207.85, 5.42902, 1.239183, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+433 , 181022, 0, 1, 1, -8535.98, 1207.91, 5.46386, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+434 , 181022, 0, 1, 1, -8562.929, 1194.916, 5.592021, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+435 , 181022, 0, 1, 1, -8550.538, 1159.076, 18.65301, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+436 , 181022, 0, 1, 1, -8605.79, 1213.77, 5.11101, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+437 , 181022, 0, 1, 1, -8614.11, 1303.04, 5.750293, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+438 , 181022, 0, 1, 1, -8641.774, 1288.231, 5.232253, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+439 , 181022, 0, 1, 1, -8281.283, 1156.497, 18.09047, 2.042035, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+440 , 181022, 0, 1, 1, -8306.66, 1301.68, 8.51337, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+441 , 181022, 0, 1, 1, -8219.573, 1191.089, 5.684546, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+442 , 181022, 0, 1, 1, -8274.7, 1300.65, 8.51445, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181022 (Area: 4411)
+(@OGUID+443 , 181021, 1, 1, 1, 7889.62, -2516.01, 494.46, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181021 (Area: 656)
+(@OGUID+444 , 181020, 1, 1, 1, 7889.29, -2513.85, 492.001, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 656)
+(@OGUID+445 , 181020, 1, 1, 1, 7902.82, -2485, 492.101, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 2361)
+(@OGUID+446 , 181020, 1, 1, 1, 7870.19, -2488.41, 492.335, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 2361)
+(@OGUID+447 , 181020, 571, 1, 1, 3281.508, -2289.553, 109.7592, 1.06465, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 4248)
+(@OGUID+448 , 181020, 571, 1, 1, 3264.85, -2273.001, 109.3768, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 4248)
+(@OGUID+449 , 181020, 571, 1, 1, 3194.855, -2292.016, 108.0624, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 4248)
+(@OGUID+450 , 181020, 571, 1, 1, 3272.445, -2284.55, 109.6323, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 4248)
+(@OGUID+451 , 181020, 571, 1, 1, 2309.714, 5207.694, 20.94551, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 0)
+(@OGUID+452 , 181020, 571, 1, 1, 2282.703, 5218.596, 20.9829, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 0)
+(@OGUID+453 , 181020, 571, 1, 1, 2264.359, 5199.473, 21.16698, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 0)
+(@OGUID+454 , 181020, 571, 1, 1, 2296.557, 5212.993, 20.75707, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 0)
+(@OGUID+455 , 181020, 530, 1, 1, -4063.597, 2172.937, 112.3214, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 3745)
+(@OGUID+456 , 181020, 530, 1, 1, -3006.309, 859.5955, -5.977011, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 3754)
+(@OGUID+457 , 181020, 530, 1, 1, 244.1061, 7939.502, 31.13577, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 3645)
+(@OGUID+458 , 181020, 530, 1, 1, 237.0487, 7913.604, 30.74815, 1.97222, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 3645)
+(@OGUID+459 , 181020, 530, 1, 1, 213.9386, 7927.577, 30.98103, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 3645)
+(@OGUID+460 , 181020, 0, 1, 1, -8408.65, 635.033, 101.409, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 5150)
+(@OGUID+461 , 181020, 0, 1, 1, -8511.38, 527.79, 109.868, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 5150)
+(@OGUID+462 , 181020, 0, 1, 1, -8612.712, 504.6371, 115.3036, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 5150)
+(@OGUID+463 , 181020, 0, 1, 1, -8633.32, 421.481, 104.761, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 5390)
+(@OGUID+464 , 181020, 0, 1, 1, -8640.89, 415.503, 104.791, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 5390)
+(@OGUID+465 , 181020, 0, 1, 1, -8680.8, 461.089, 105.228, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 5390)
+(@OGUID+466 , 181020, 0, 1, 1, -8719.567, 507.9125, 107.5373, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 5390)
+(@OGUID+467 , 181020, 0, 1, 1, -8588.407, 706.8125, 108.9887, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 5390)
+(@OGUID+468 , 181020, 0, 1, 1, -8665.82, 741.175, 108.709, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 181020 (Area: 5390)
+(@OGUID+469 , 181019, 571, 1, 1, 5177.153, -2180.084, 236.5424, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+470 , 181019, 571, 1, 1, 5192.435, -2209.911, 239.3982, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+471 , 181019, 571, 1, 1, 5157.259, -2201.744, 237.5309, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+472 , 181019, 571, 1, 1, 5137.096, -2201.546, 237.8019, 4.485497, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+473 , 181019, 571, 1, 1, 5157.712, -2215.265, 238.4418, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+474 , 181019, 571, 1, 1, 5141.539, -2211.604, 238.1585, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+475 , 181019, 571, 1, 1, 3877.073, -4546.678, 210.972, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+476 , 181019, 571, 1, 1, 3874.093, -4541.467, 210.1389, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+477 , 181019, 571, 1, 1, 3838.456, -4544.684, 209.2909, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+478 , 181019, 571, 1, 1, 3407.589, -2786.686, 202.9973, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+479 , 181019, 571, 1, 1, 3412.483, -2783.082, 202.9972, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+480 , 181019, 571, 1, 1, 3424.167, -2769.674, 201.4191, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+481 , 181019, 571, 1, 1, 1432.413, -3253.822, 166.571, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3998)
+(@OGUID+482 , 181019, 571, 1, 1, 1425.667, -3261.837, 165.5927, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3998)
+(@OGUID+483 , 181019, 571, 1, 1, 1422.948, -3265.153, 165.6199, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3998)
+(@OGUID+484 , 181019, 571, 1, 1, 701.3621, -2933.383, -3.068485, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3987)
+(@OGUID+485 , 181019, 571, 1, 1, 701.6729, -2935.085, -3.068489, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3987)
+(@OGUID+486 , 181019, 571, 1, 1, 3630.212, -709.9004, 215.4509, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+487 , 181019, 571, 1, 1, 3630.091, -711.7509, 215.451, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+488 , 181019, 571, 1, 1, 3629.777, -714.9827, 215.4509, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+489 , 181019, 571, 1, 1, 3629.591, -716.7711, 215.4509, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+490 , 181019, 571, 1, 1, 3658.893, -693.3231, 223.6275, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4177)
+(@OGUID+491 , 181019, 571, 1, 1, 3660.452, -698.0406, 223.6275, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4177)
+(@OGUID+492 , 181019, 571, 1, 1, 3653.071, -692.7104, 223.6275, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4177)
+(@OGUID+493 , 181019, 571, 1, 1, 3655.911, -710.7966, 227.4318, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4177)
+(@OGUID+494 , 181019, 571, 1, 1, 3650.309, -697.8465, 223.6275, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4177)
+(@OGUID+495 , 181019, 571, 1, 1, 3658.077, -721.1656, 216.2393, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4177)
+(@OGUID+496 , 181019, 571, 1, 1, 3653.49, -720.2332, 216.2393, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4177)
+(@OGUID+497 , 181019, 571, 1, 1, 3655.506, -720.5035, 216.2393, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4177)
+(@OGUID+498 , 181019, 571, 1, 1, 3652.148, -720.3037, 216.2393, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4177)
+(@OGUID+499 , 181019, 571, 1, 1, 3560.058, 249.0957, 45.70548, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4161)
+(@OGUID+500 , 181019, 571, 1, 1, 3529.886, 252.3539, 45.7051, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4161)
+(@OGUID+501 , 181019, 571, 1, 1, 3573.747, 275.6775, 45.70752, 5.061456, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4161)
+(@OGUID+502 , 181019, 571, 1, 1, 3521.046, 280.9596, 45.70491, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4161)
+(@OGUID+503 , 181019, 571, 1, 1, 3555.038, 299.0926, 45.70468, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4161)
+(@OGUID+504 , 181019, 571, 1, 1, 3497.954, 1962.59, 67.00489, 5.148723, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4158)
+(@OGUID+505 , 181019, 571, 1, 1, 3489.518, 1973.308, 66.71261, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4158)
+(@OGUID+506 , 181019, 571, 1, 1, 3515.049, 1995.76, 66.57986, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4158)
+(@OGUID+507 , 181019, 571, 1, 1, 3498.045, 1985.921, 66.4942, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4158)
+(@OGUID+508 , 181019, 571, 1, 1, 3472.785, 1978.688, 66.46651, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4158)
+(@OGUID+509 , 181019, 571, 1, 1, 2292.771, 5195.491, 16.54581, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+510 , 181019, 571, 1, 1, 2295.146, 5194.604, 16.54581, 3.752462, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+511 , 181019, 571, 1, 1, 4502.473, 5716.374, 83.2963, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 0)
+(@OGUID+512 , 181019, 571, 1, 1, 5546.444, 5741.974, -75.40535, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4285)
+(@OGUID+513 , 181019, 571, 1, 1, 5565.401, 5770.03, -74.08703, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4285)
+(@OGUID+514 , 181019, 571, 1, 1, 5558.145, 5760.761, -76.66797, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4285)
+(@OGUID+515 , 181019, 571, 1, 1, 5543.533, 5732.819, -75.00607, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4285)
+(@OGUID+516 , 181019, 571, 1, 1, 5564.951, 5763.742, -74.10497, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4285)
+(@OGUID+517 , 181019, 571, 1, 1, 5592.455, 5748.157, -70.19862, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 4284)
+(@OGUID+518 , 181019, 530, 1, 1, -1746.561, 5164.543, -35.90803, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+519 , 181019, 530, 1, 1, -1722.684, 5148.509, -34.71685, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+520 , 181019, 530, 1, 1, -1719.891, 5141.935, -34.7064, 4.363324, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+521 , 181019, 530, 1, 1, -1720.093, 5141.122, -34.81209, 5.166176, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+522 , 181019, 530, 1, 1, -1721.997, 5148.342, -34.72364, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+523 , 181019, 530, 1, 1, -1742.537, 5152.636, -35.90804, 2.164206, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+524 , 181019, 530, 1, 1, -1750.601, 5150.047, -36.30908, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+525 , 181019, 530, 1, 1, -1753.868, 5159.522, -36.26046, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+526 , 181019, 530, 1, 1, -1759.773, 5151.993, -36.28824, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+527 , 181019, 530, 1, 1, -1778.798, 5125.128, -34.73267, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+528 , 181019, 530, 1, 1, -1779.195, 5124.315, -34.74682, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+529 , 181019, 530, 1, 1, -1780.604, 5132.849, -34.73998, 1.832595, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+530 , 181019, 530, 1, 1, -1781.082, 5132.91, -34.72391, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 181019 (Area: 3899)
+(@OGUID+531 , 181018, 571, 1, 1, 5815.427, 553.2634, 653.1058, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+532 , 181018, 571, 1, 1, 5823.227, 554.9146, 653.1237, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+533 , 181018, 571, 1, 1, 5812.321, 551.391, 653.0699, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+534 , 181018, 571, 1, 1, 5819.637, 554.3771, 653.1036, 3.438303, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+535 , 181018, 571, 1, 1, 5827.601, 553.8232, 653.1969, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+536 , 181018, 571, 1, 1, 5808.787, 548.7609, 653.1042, 1.029743, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+537 , 181018, 571, 1, 1, 5855.679, 631.2502, 649.3745, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+538 , 181018, 571, 1, 1, 5853.158, 644.6632, 660.192, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+539 , 181018, 571, 1, 1, 5861.551, 637.7972, 649.4493, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+540 , 181018, 571, 1, 1, 5852.249, 653.2101, 660.2052, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+541 , 181018, 571, 1, 1, 5834.877, 510.3333, 659.3004, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+542 , 181018, 571, 1, 1, 5828.073, 508.0534, 659.3159, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+543 , 181018, 571, 1, 1, 5852.142, 667.3889, 649.5994, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+544 , 181018, 571, 1, 1, 5859.842, 660.3542, 649.3377, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+545 , 181018, 571, 1, 1, 5879.179, 527.6025, 643.5471, 1.780234, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4395)
+(@OGUID+546 , 181018, 571, 1, 1, 5733.871, 670.8108, 646.9722, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4739)
+(@OGUID+547 , 181018, 571, 1, 1, 5739.494, 677.6687, 646.9604, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4739)
+(@OGUID+548 , 181018, 571, 1, 1, 5761.328, 717.7375, 642.4337, 4.206246, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4739)
+(@OGUID+549 , 181018, 571, 1, 1, 5756.841, 712.12, 642.4337, 0.7853968, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4739)
+(@OGUID+550 , 181018, 571, 1, 1, 5888.802, 529.829, 643.4706, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4613)
+(@OGUID+551 , 181018, 571, 1, 1, 5910.6, 572.0917, 642.006, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4613)
+(@OGUID+552 , 181018, 571, 1, 1, 5920.077, 557.5112, 641.9263, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4613)
+(@OGUID+553 , 181018, 571, 1, 1, 5668.451, 683.9045, 655.4852, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4568)
+(@OGUID+554 , 181018, 571, 1, 1, 5662.25, 669.692, 655.4854, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4568)
+(@OGUID+555 , 181018, 571, 1, 1, 5944.854, 630.399, 654.0372, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4613)
+(@OGUID+556 , 181018, 571, 1, 1, 5939.464, 615.9524, 654.1125, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4613)
+(@OGUID+557 , 181018, 571, 1, 1, 6127.377, -1046.22, 405.7823, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4419)
+(@OGUID+558 , 181018, 571, 1, 1, 6113.523, -1046.297, 406.5891, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4419)
+(@OGUID+559 , 181018, 571, 1, 1, 5745.579, -3534.724, 396.685, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 0)
+(@OGUID+560 , 181018, 571, 1, 1, 5769.655, -3530.542, 396.8302, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4324)
+(@OGUID+561 , 181018, 571, 1, 1, 3854.253, -4497.099, 208.4463, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4205)
+(@OGUID+562 , 181018, 571, 1, 1, 3845.263, -4506.483, 208.0879, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 0)
+(@OGUID+563 , 181018, 571, 1, 1, 3865.145, -4556.175, 211.0864, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 0)
+(@OGUID+564 , 181018, 571, 1, 1, 3876.38, -4541.031, 209.7021, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 0)
+(@OGUID+565 , 181018, 571, 1, 1, 3858.301, -4564.549, 210.1741, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 0)
+(@OGUID+566 , 181018, 571, 1, 1, 1421.958, -3261.318, 175.9854, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 3998)
+(@OGUID+567 , 181018, 571, 1, 1, 724.0819, -2929.729, 7.998729, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 3987)
+(@OGUID+568 , 181018, 571, 1, 1, 437.3842, -4539.971, 252.3735, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 3991)
+(@OGUID+569 , 181018, 571, 1, 1, 438.4343, -4546.447, 249.3452, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 3991)
+(@OGUID+570 , 181018, 571, 1, 1, 442.4383, -4552.802, 249.542, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 3991)
+(@OGUID+571 , 181018, 571, 1, 1, 447.4662, -4556.945, 252.1781, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 3991)
+(@OGUID+572 , 181018, 571, 1, 1, 481.2321, -4523.523, 260.9968, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 3991)
+(@OGUID+573 , 181018, 571, 1, 1, 572.9479, -4943.799, 27.1676, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 3981)
+(@OGUID+574 , 181018, 571, 1, 1, 585.9739, -4954.365, 22.9537, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 3981)
+(@OGUID+575 , 181018, 571, 1, 1, 592.2986, -4952.793, 23.01477, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 3981)
+(@OGUID+576 , 181018, 571, 1, 1, 1896.369, -6177.458, 28.25126, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4000)
+(@OGUID+577 , 181018, 571, 1, 1, 1886.857, -6181.003, 26.00835, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4000)
+(@OGUID+578 , 181018, 571, 1, 1, 1883.005, -6173.481, 30.73777, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4000)
+(@OGUID+579 , 181018, 571, 1, 1, 1889.537, -6174.26, 27.78375, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181018 (Area: 4000)
+(@OGUID+580 , 181017, 571, 1, 1, 5809.249, 576.0026, 657.8462, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+581 , 181017, 571, 1, 1, 5783.142, 561.5955, 655.6302, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+582 , 181017, 571, 1, 1, 5843.796, 569.7678, 656.4412, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+583 , 181017, 571, 1, 1, 5753.474, 616.6545, 656.3826, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+584 , 181017, 571, 1, 1, 5755.206, 632.1685, 667.4127, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+585 , 181017, 571, 1, 1, 5859.036, 634.3795, 653.5594, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+586 , 181017, 571, 1, 1, 5730.578, 607.2695, 652.4564, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+587 , 181017, 571, 1, 1, 5881.26, 611.1509, 654.602, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+588 , 181017, 571, 1, 1, 5750.088, 646.9669, 655.8947, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+589 , 181017, 571, 1, 1, 5886.485, 624.7205, 653.5937, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+590 , 181017, 571, 1, 1, 5855.724, 664.5695, 653.6199, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+591 , 181017, 571, 1, 1, 5802.563, 689.8659, 664.4053, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4395)
+(@OGUID+592 , 181017, 571, 1, 1, 5786.861, 691.6611, 652.8747, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+593 , 181017, 571, 1, 1, 5817.452, 694.9246, 652.8608, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+594 , 181017, 571, 1, 1, 5733.013, 677.092, 652.2612, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+595 , 181017, 571, 1, 1, 5872.592, 687.6406, 650.2322, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+596 , 181017, 571, 1, 1, 5858.502, 699.9028, 647.2755, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+597 , 181017, 571, 1, 1, 5768.054, 709.3629, 623.4171, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+598 , 181017, 571, 1, 1, 5835.142, 720.0156, 646.1909, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4613)
+(@OGUID+599 , 181017, 571, 1, 1, 5760.299, 713.8768, 652.3187, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+600 , 181017, 571, 1, 1, 5901.187, 684.3663, 647.5936, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+601 , 181017, 571, 1, 1, 5873.009, 725.3192, 647.5492, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+602 , 181017, 571, 1, 1, 5768.548, 732.4496, 646.0042, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+603 , 181017, 571, 1, 1, 5893.215, 706.2971, 646.8101, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+604 , 181017, 571, 1, 1, 5864.956, 738.7273, 644.807, 5.078908, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+605 , 181017, 571, 1, 1, 5909.327, 661.7327, 649.2336, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+606 , 181017, 571, 1, 1, 5883.444, 741.7843, 644.4044, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4739)
+(@OGUID+607 , 181017, 571, 1, 1, 5885.01, 524.2327, 648.1631, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4613)
+(@OGUID+608 , 181017, 571, 1, 1, 5687.88, 620.0889, 652.0167, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4613)
+(@OGUID+609 , 181017, 571, 1, 1, 5675.364, 631.4016, 652.0096, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4567)
+(@OGUID+610 , 181017, 571, 1, 1, 5671.868, 646.4288, 651.8803, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4613)
+(@OGUID+611 , 181017, 571, 1, 1, 5668.864, 712.5075, 647.7338, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4568)
+(@OGUID+612 , 181017, 571, 1, 1, 5679.624, 720.0261, 647.5791, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4568)
+(@OGUID+613 , 181017, 571, 1, 1, 5679.613, 720.0153, 659.1891, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4568)
+(@OGUID+614 , 181017, 571, 1, 1, 5665.726, 718.7106, 647.9514, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4568)
+(@OGUID+615 , 181017, 571, 1, 1, 5670.651, 730.9137, 647.9866, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4568)
+(@OGUID+616 , 181017, 571, 1, 1, 5677.255, 732.9352, 647.86, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4568)
+(@OGUID+617 , 181017, 571, 1, 1, 5666.311, 725.6754, 647.9023, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4568)
+(@OGUID+618 , 181017, 571, 1, 1, 5915.079, 710.2083, 646.6064, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4613)
+(@OGUID+619 , 181017, 571, 1, 1, 5915.948, 728.4288, 646.2543, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4613)
+(@OGUID+620 , 181017, 571, 1, 1, 5901.741, 746.0184, 645.2678, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4613)
+(@OGUID+621 , 181017, 571, 1, 1, 6654.499, -190.9763, 956.8075, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4428)
+(@OGUID+622 , 181017, 571, 1, 1, 6676.616, -199.1265, 954.8306, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4428)
+(@OGUID+623 , 181017, 571, 1, 1, 6653.604, -203.6228, 954.6893, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4428)
+(@OGUID+624 , 181017, 571, 1, 1, 6663.807, -184.6699, 958.2155, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4428)
+(@OGUID+625 , 181017, 571, 1, 1, 6685.919, -206.6383, 953.6956, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4428)
+(@OGUID+626 , 181017, 571, 1, 1, 6122.517, -1074.911, 407.3852, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4419)
+(@OGUID+627 , 181017, 571, 1, 1, 4596.626, -4237.616, 181.8922, 2.303831, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4159)
+(@OGUID+628 , 181017, 571, 1, 1, 4551.28, -4238.457, 173.6895, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4159)
+(@OGUID+629 , 181017, 571, 1, 1, 3403.195, -2797.129, 217.5549, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+630 , 181017, 571, 1, 1, 3407.778, -2803.883, 205.8443, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+631 , 181017, 571, 1, 1, 3388.071, -2808.053, 207.0942, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+632 , 181017, 571, 1, 1, 3389.364, -2800.435, 207.4506, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+633 , 181017, 571, 1, 1, 3396.49, -2809.565, 207.4137, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+634 , 181017, 571, 1, 1, 3422.459, -2783.034, 207.0113, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+635 , 181017, 571, 1, 1, 3431.648, -2776.44, 207.109, 0.6108634, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+636 , 181017, 571, 1, 1, 3270.23, -2299.017, 105.3505, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+637 , 181017, 571, 1, 1, 3280.345, -2211.232, 127.4082, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4206)
+(@OGUID+638 , 181017, 571, 1, 1, 3272.255, -2192.748, 127.4287, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4206)
+(@OGUID+639 , 181017, 571, 1, 1, 3253.434, -2199.932, 127.3124, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4206)
+(@OGUID+640 , 181017, 571, 1, 1, 2129.331, -2957.729, 155.2842, 0.3665176, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4070)
+(@OGUID+641 , 181017, 571, 1, 1, 2122.887, -2959.943, 155.2807, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4070)
+(@OGUID+642 , 181017, 571, 1, 1, 2127.25, -2962.019, 155.3076, 4.991644, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4070)
+(@OGUID+643 , 181017, 571, 1, 1, 2124.927, -2955.563, 154.9684, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4070)
+(@OGUID+644 , 181017, 571, 1, 1, 2128.509, -2993.269, 155.7663, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+645 , 181017, 571, 1, 1, 2129.307, -3000.026, 155.8247, 4.852017, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+646 , 181017, 571, 1, 1, 2125.529, -2997.12, 155.7463, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+647 , 181017, 571, 1, 1, 2132.394, -2996.245, 155.8432, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+648 , 181017, 571, 1, 1, 1474.518, -3279.563, 178.9401, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4071)
+(@OGUID+649 , 181017, 571, 1, 1, 1465.599, -3290.57, 178.7285, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4071)
+(@OGUID+650 , 181017, 571, 1, 1, 1425.031, -3316.349, 173.5113, 2.094393, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4071)
+(@OGUID+651 , 181017, 571, 1, 1, 1461.297, -3264.238, 183.4601, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4071)
+(@OGUID+652 , 181017, 571, 1, 1, 1428.773, -3274.498, 181.0417, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3998)
+(@OGUID+653 , 181017, 571, 1, 1, 1426.495, -3265.443, 172.1592, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3998)
+(@OGUID+654 , 181017, 571, 1, 1, 1431.548, -3252.894, 183.7873, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3998)
+(@OGUID+655 , 181017, 571, 1, 1, 1449.89, -3254.639, 183.1299, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3998)
+(@OGUID+656 , 181017, 571, 1, 1, 713.499, -2931.399, 2.876178, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3987)
+(@OGUID+657 , 181017, 571, 1, 1, 454.9619, -4528.652, 251.8441, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3991)
+(@OGUID+658 , 181017, 571, 1, 1, 463.7049, -4534.563, 254.9479, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3991)
+(@OGUID+659 , 181017, 571, 1, 1, 465.882, -4545.663, 251.8806, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3991)
+(@OGUID+660 , 181017, 571, 1, 1, 445.4201, -4640.561, 253.3178, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3991)
+(@OGUID+661 , 181017, 571, 1, 1, 486.4948, -4520.141, 239.7659, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3991)
+(@OGUID+662 , 181017, 571, 1, 1, 587.5087, -4945.893, 32.49911, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3981)
+(@OGUID+663 , 181017, 571, 1, 1, 578.7986, -4942.297, 23.31465, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3981)
+(@OGUID+664 , 181017, 571, 1, 1, 597.412, -5011.138, 9.712256, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3981)
+(@OGUID+665 , 181017, 571, 1, 1, 548.7562, -5021.973, 17.47475, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3981)
+(@OGUID+666 , 181017, 571, 1, 1, 639.2745, -5012.341, 11.1266, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3981)
+(@OGUID+667 , 181017, 571, 1, 1, 1881.401, -6201.038, 33.84504, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4000)
+(@OGUID+668 , 181017, 571, 1, 1, 1872.579, -6219.774, 42.40208, 1.099556, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4000)
+(@OGUID+669 , 181017, 571, 1, 1, 1949.33, -6147.306, 31.00299, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4000)
+(@OGUID+670 , 181017, 571, 1, 1, 1933.835, -6188.439, 30.40494, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4000)
+(@OGUID+671 , 181017, 571, 1, 1, 1966.471, -6119.723, 41.52581, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4000)
+(@OGUID+672 , 181017, 571, 1, 1, 1955.997, -6111.83, 41.53107, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4000)
+(@OGUID+673 , 181017, 571, 1, 1, 1960.26, -6117.287, 41.52031, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4000)
+(@OGUID+674 , 181017, 571, 1, 1, 1971.802, -6102.198, 73.7106, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4000)
+(@OGUID+675 , 181017, 571, 1, 1, 2469.7, -5056.41, 296.0691, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4003)
+(@OGUID+676 , 181017, 571, 1, 1, 2496.864, -5066.933, 302.6931, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4003)
+(@OGUID+677 , 181017, 571, 1, 1, 2477.306, -5073.561, 291.6375, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4003)
+(@OGUID+678 , 181017, 571, 1, 1, 2475.982, -5063.151, 289.1608, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4003)
+(@OGUID+679 , 181017, 571, 1, 1, 2483.536, -5065.366, 301.6975, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4003)
+(@OGUID+680 , 181017, 571, 1, 1, 2501.505, -5059.525, 285.9003, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4003)
+(@OGUID+681 , 181017, 571, 1, 1, 2485.302, -5048.401, 296.4124, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4003)
+(@OGUID+682 , 181017, 571, 1, 1, 2673.549, -4383.29, 290.4919, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+683 , 181017, 571, 1, 1, 3243.007, -716.868, 174.0614, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4232)
+(@OGUID+684 , 181017, 571, 1, 1, 3230.017, -756.3438, 174.0186, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4232)
+(@OGUID+685 , 181017, 571, 1, 1, 3215.221, -748.2292, 173.9813, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4232)
+(@OGUID+686 , 181017, 571, 1, 1, 3226.663, -687.4913, 176.1088, 5.794494, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4232)
+(@OGUID+687 , 181017, 571, 1, 1, 3221.048, -666.5087, 175.2865, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4232)
+(@OGUID+688 , 181017, 571, 1, 1, 3212.471, -667.382, 175.2803, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4232)
+(@OGUID+689 , 181017, 571, 1, 1, 3203.728, -675.9549, 175.5281, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4186)
+(@OGUID+690 , 181017, 571, 1, 1, 3654.854, -700.4598, 228.6396, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4177)
+(@OGUID+691 , 181017, 571, 1, 1, 3663.722, -720.0434, 224.0076, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4177)
+(@OGUID+692 , 181017, 571, 1, 1, 3668.486, -717.066, 218.9095, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4177)
+(@OGUID+693 , 181017, 571, 1, 1, 3667.354, -727.1337, 218.3601, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4177)
+(@OGUID+694 , 181017, 571, 1, 1, 3668.153, -722.3611, 218.7, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4177)
+(@OGUID+695 , 181017, 571, 1, 1, 3665.362, -707.243, 221.1085, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4177)
+(@OGUID+696 , 181017, 571, 1, 1, 3521.09, 240.6755, 53.60065, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4161)
+(@OGUID+697 , 181017, 571, 1, 1, 3577.127, 249.5916, 53.55267, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4161)
+(@OGUID+698 , 181017, 571, 1, 1, 3515.238, 299.4315, 53.53123, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4161)
+(@OGUID+699 , 181017, 571, 1, 1, 3570.422, 301.9106, 53.45552, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4161)
+(@OGUID+700 , 181017, 571, 1, 1, 4986.635, 1237.804, 232.5177, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4170)
+(@OGUID+701 , 181017, 571, 1, 1, 5013.381, 1244.962, 238.3039, 5.969027, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4170)
+(@OGUID+702 , 181017, 571, 1, 1, 5006.911, 1195.97, 235.5182, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4170)
+(@OGUID+703 , 181017, 571, 1, 1, 5027.013, 1209.431, 233.9405, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4170)
+(@OGUID+704 , 181017, 571, 1, 1, 5027.053, 1209.406, 240.235, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4170)
+(@OGUID+705 , 181017, 571, 1, 1, 3464.886, 4177.207, 24.38719, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4037)
+(@OGUID+706 , 181017, 571, 1, 1, 2314.894, 5185.276, 23.48018, 4.363324, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+707 , 181017, 571, 1, 1, 2274.934, 5189.169, 26.13615, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+708 , 181017, 571, 1, 1, 2303.014, 5208.549, 27.68204, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+709 , 181017, 571, 1, 1, 2320.047, 5198.47, 23.71446, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+710 , 181017, 571, 1, 1, 2270.002, 5197.174, 17.32868, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+711 , 181017, 571, 1, 1, 2288.641, 5214.336, 27.50825, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+712 , 181017, 571, 1, 1, 2270.879, 5210.542, 28.94806, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+713 , 181017, 571, 1, 1, 2769.89, 6123.314, 96.68723, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4020)
+(@OGUID+714 , 181017, 571, 1, 1, 2815.303, 6165.526, 90.96311, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4129)
+(@OGUID+715 , 181017, 571, 1, 1, 3624.583, 5913.436, 144.8049, 2.094393, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4023)
+(@OGUID+716 , 181017, 571, 1, 1, 4172.988, 5271.836, 40.90479, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4108)
+(@OGUID+717 , 181017, 571, 1, 1, 4173.983, 5280.55, 30.62882, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4108)
+(@OGUID+718 , 181017, 571, 1, 1, 4165.883, 5280.938, 31.36931, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4108)
+(@OGUID+719 , 181017, 571, 1, 1, 4174.368, 5270.975, 41.0957, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4108)
+(@OGUID+720 , 181017, 571, 1, 1, 5543.419, 5736.716, -72.88883, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4285)
+(@OGUID+721 , 181017, 571, 1, 1, 5562.838, 5767.768, -69.31071, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4285)
+(@OGUID+722 , 181017, 571, 1, 1, 5549.516, 5738.056, -72.93507, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4285)
+(@OGUID+723 , 181017, 571, 1, 1, 5577.761, 5766.71, -69.34008, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4285)
+(@OGUID+724 , 181017, 571, 1, 1, 5544.886, 5730.654, -72.89562, 4.153885, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4285)
+(@OGUID+725 , 181017, 571, 1, 1, 5550.921, 5732.03, -72.89473, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4285)
+(@OGUID+726 , 181017, 571, 1, 1, 5569.917, 5759.858, -69.32285, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4285)
+(@OGUID+727 , 181017, 571, 1, 1, 5570.901, 5774.635, -69.3968, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4285)
+(@OGUID+728 , 181017, 571, 1, 1, 5584.953, 5748.914, -68.31659, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4284)
+(@OGUID+729 , 181017, 530, 1, 1, -2176.667, 5405.86, 58.44925, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3898)
+(@OGUID+730 , 181017, 530, 1, 1, -1905.432, 5771.346, 137.7419, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+731 , 181017, 530, 1, 1, -1892.362, 5766.126, 137.6966, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 0)
+(@OGUID+732 , 181017, 530, 1, 1, -2659.457, 4386.914, 39.52228, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3683)
+(@OGUID+733 , 181017, 530, 1, 1, -2587.3, 4469.175, 40.08729, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3683)
+(@OGUID+734 , 181017, 530, 1, 1, -2671.876, 4457.92, 42.83185, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3683)
+(@OGUID+735 , 181017, 530, 1, 1, -2648.931, 4478.227, 39.93041, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3683)
+(@OGUID+736 , 181017, 530, 1, 1, -2967.964, 4020.805, 7.264894, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3684)
+(@OGUID+737 , 181017, 530, 1, 1, -2987.704, 4030.75, 7.28573, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3684)
+(@OGUID+738 , 181017, 530, 1, 1, -2923.89, 4017.942, 8.344274, 3.665196, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3684)
+(@OGUID+739 , 181017, 530, 1, 1, -2982.132, 3981.363, 8.745137, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3684)
+(@OGUID+740 , 181017, 530, 1, 1, -2931.291, 3931.274, 8.816035, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3684)
+(@OGUID+741 , 181017, 530, 1, 1, -3022.694, 2624.565, 85.78185, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3744)
+(@OGUID+742 , 181017, 530, 1, 1, -2972.565, 2562.675, 83.66947, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3744)
+(@OGUID+743 , 181017, 530, 1, 1, -2955.605, 2554.495, 110.3285, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3744)
+(@OGUID+744 , 181017, 530, 1, 1, -2927.35, 2650.861, 100.1286, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3744)
+(@OGUID+745 , 181017, 530, 1, 1, -4010.367, 2155.552, 109.9921, 1.06465, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3745)
+(@OGUID+746 , 181017, 530, 1, 1, -4058.762, 2175.685, 117.8552, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3745)
+(@OGUID+747 , 181017, 530, 1, 1, -709.4097, 2704.609, 99.62894, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3538)
+(@OGUID+748 , 181017, 530, 1, 1, -717.0001, 2714.823, 100.4722, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3538)
+(@OGUID+749 , 181017, 530, 1, 1, -716.9244, 2718.473, 100.4844, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3538)
+(@OGUID+750 , 181017, 530, 1, 1, -716.8802, 2742.702, 100.7903, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3538)
+(@OGUID+751 , 181017, 530, 1, 1, -690.7932, 2724.943, 100.9289, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3538)
+(@OGUID+752 , 181017, 530, 1, 1, 181.4262, 2624.335, 98.51126, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3536)
+(@OGUID+753 , 181017, 530, 1, 1, -249.9205, 5495.466, 36.7147, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3565)
+(@OGUID+754 , 181017, 530, 1, 1, 282.6363, 6085.975, 137.649, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3644)
+(@OGUID+755 , 181017, 530, 1, 1, 237.8501, 7911.491, 30.4785, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3645)
+(@OGUID+756 , 181017, 530, 1, 1, 236.9491, 7913.625, 30.50175, 1.97222, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3645)
+(@OGUID+757 , 181017, 530, 1, 1, 223.4775, 7943.311, 30.76142, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3645)
+(@OGUID+758 , 181017, 530, 1, 1, 244.0695, 7939.386, 30.92426, 3.438303, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3645)
+(@OGUID+759 , 181017, 530, 1, 1, 214.1629, 7927.679, 30.72031, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3645)
+(@OGUID+760 , 181017, 530, 1, 1, 195.0323, 8490.546, 35.5514, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3656)
+(@OGUID+761 , 181017, 530, 1, 1, 264.8356, 8492.754, 34.60779, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3656)
+(@OGUID+762 , 181017, 530, 1, 1, 272.1655, 8509.436, 32.72204, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3656)
+(@OGUID+763 , 181017, 530, 1, 1, 219.5999, 8569.107, 33.13798, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3649)
+(@OGUID+764 , 181017, 530, 1, 1, -2713.36, 7298.445, 51.91501, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3626)
+(@OGUID+765 , 181017, 530, 1, 1, -2698.241, 7291.552, 49.91637, 5.969027, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3626)
+(@OGUID+766 , 181017, 530, 1, 1, -2730.689, 7306.021, 51.7765, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3626)
+(@OGUID+767 , 181017, 530, 1, 1, -2677.658, 7203.919, 32.99669, 1.204277, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3626)
+(@OGUID+768 , 181017, 530, 1, 1, -2775.226, 7326.033, 51.77103, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3626)
+(@OGUID+769 , 181017, 530, 1, 1, 1955.625, 6885.821, 167.1296, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3771)
+(@OGUID+770 , 181017, 530, 1, 1, 2009.813, 6871.413, 188.1808, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+771 , 181017, 530, 1, 1, 2032.214, 6819.37, 181.5125, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+772 , 181017, 530, 1, 1, 2031.963, 6825.553, 181.5333, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+773 , 181017, 530, 1, 1, 2038.027, 6826.094, 181.4816, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+774 , 181017, 530, 1, 1, 2038.565, 6819.838, 181.4885, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+775 , 181017, 530, 1, 1, 2062.016, 6825.854, 184.7832, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+776 , 181017, 530, 1, 1, 2063.305, 6759.898, 173.2681, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+777 , 181017, 530, 1, 1, 2163.694, 6745.077, 172.4085, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+778 , 181017, 530, 1, 1, 2162.737, 6751.214, 172.4385, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+779 , 181017, 530, 1, 1, 2168.956, 6752.182, 172.4387, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+780 , 181017, 530, 1, 1, 2169.925, 6745.97, 172.4366, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3772)
+(@OGUID+781 , 181017, 530, 1, 1, 3026.51, 5497.439, 151.5307, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3951)
+(@OGUID+782 , 181017, 530, 1, 1, 3016.612, 5445.069, 151.877, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3951)
+(@OGUID+783 , 181017, 530, 1, 1, 2155.25, 4720.381, 160.9449, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3844)
+(@OGUID+784 , 181017, 530, 1, 1, 2154.756, 4716.656, 160.9547, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3844)
+(@OGUID+785 , 181017, 530, 1, 1, 2035.05, 4693.116, 154.7217, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3844)
+(@OGUID+786 , 181017, 530, 1, 1, 2031.468, 4692.11, 154.7591, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3844)
+(@OGUID+787 , 181017, 530, 1, 1, 2962.525, 3697.009, 150.2677, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3712)
+(@OGUID+788 , 181017, 530, 1, 1, 3061.875, 3647.259, 149.6342, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3712)
+(@OGUID+789 , 181017, 530, 1, 1, 4103.79, 3058.691, 345.6179, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3738)
+(@OGUID+790 , 181017, 530, 1, 1, 4125.446, 3068.064, 345.6248, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 3738)
+(@OGUID+791 , 181016, 1, 1, 1, 7867.43, -2562.63, 486.946, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 656)
+(@OGUID+792 , 181016, 1, 1, 1, 7942.2, -2640.05, 492.378, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 656)
+(@OGUID+793 , 181016, 1, 1, 1, 7925.89, -2636.76, 492.584, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 656)
+(@OGUID+794 , 181016, 1, 1, 1, 7942.56, -2571.39, 488.843, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 656)
+(@OGUID+795 , 181016, 1, 1, 1, 7938.42, -2585.05, 488.907, 0.5934101, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 656)
+(@OGUID+796 , 181016, 1, 1, 1, 7910.97, -2575.69, 488.582, 1.989672, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 656)
+(@OGUID+797 , 181016, 1, 1, 1, 7915.88, -2561.99, 488.201, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 656)
+(@OGUID+798 , 181016, 1, 1, 1, 7912.61, -2504.64, 489.276, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 656)
+(@OGUID+799 , 181016, 1, 1, 1, 7862.59, -2495.27, 489.275, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 2361)
+(@OGUID+800 , 181016, 1, 1, 1, 7910.7, -2488.95, 489.272, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 2361)
+(@OGUID+801 , 181016, 1, 1, 1, 7864, -2510.33, 489.275, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 2361)
+(@OGUID+802 , 181016, 1, 1, 1, 7821.1, -2479.85, 486.84, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 2361)
+(@OGUID+803 , 181016, 1, 1, 1, 7790.67, -2422.31, 488.341, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 2361)
+(@OGUID+804 , 181016, 1, 1, 1, 7477.78, -2130.38, 492.102, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+805 , 181016, 571, 1, 1, 5843.04, 581.1298, 651.76, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+806 , 181016, 571, 1, 1, 5797.108, 551.8475, 661.095, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+807 , 181016, 571, 1, 1, 5763.885, 572.2188, 649.8002, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+808 , 181016, 571, 1, 1, 5803.461, 547.2244, 660.9998, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+809 , 181016, 571, 1, 1, 5789.479, 641.6511, 647.4436, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+810 , 181016, 571, 1, 1, 5864.823, 610.4653, 650.7043, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+811 , 181016, 571, 1, 1, 5745.615, 586.7101, 649.3102, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+812 , 181016, 571, 1, 1, 5839.251, 641.2769, 647.5121, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+813 , 181016, 571, 1, 1, 5761.894, 592.8934, 613.7905, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+814 , 181016, 571, 1, 1, 5776.402, 530.3011, 641.5594, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+815 , 181016, 571, 1, 1, 5807.717, 654.8577, 647.4246, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+816 , 181016, 571, 1, 1, 5846.925, 644.6152, 658.404, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+817 , 181016, 571, 1, 1, 5748.025, 626.0618, 660.9924, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+818 , 181016, 571, 1, 1, 5825.186, 655.9732, 647.5557, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+819 , 181016, 571, 1, 1, 5735.165, 606.0434, 647.9391, 1.518436, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+820 , 181016, 571, 1, 1, 5743.978, 624.6772, 648.4809, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+821 , 181016, 571, 1, 1, 5845.924, 652.1758, 658.404, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+822 , 181016, 571, 1, 1, 5746.787, 636.5056, 660.9924, 5.916668, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+823 , 181016, 571, 1, 1, 5833.373, 645.4617, 609.1575, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+824 , 181016, 571, 1, 1, 5822.227, 502.8376, 657.378, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+825 , 181016, 571, 1, 1, 5840.909, 508.295, 657.4862, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+826 , 181016, 571, 1, 1, 5898.554, 629.4965, 646.7423, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4395)
+(@OGUID+827 , 181016, 571, 1, 1, 5796.696, 707.4605, 641.7041, 1.762782, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+828 , 181016, 571, 1, 1, 5805.41, 708.4702, 641.4802, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+829 , 181016, 571, 1, 1, 5751.683, 681.7147, 613.2468, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+830 , 181016, 571, 1, 1, 5750.272, 691.2866, 618.5539, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+831 , 181016, 571, 1, 1, 5845.667, 696.0077, 610.6929, 4.153885, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+832 , 181016, 571, 1, 1, 5867.476, 689.2825, 643.1117, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+833 , 181016, 571, 1, 1, 5734.079, 690.025, 646.5366, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+834 , 181016, 571, 1, 1, 5826.764, 723.2586, 641.2166, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+835 , 181016, 571, 1, 1, 5904.524, 663.1807, 643.8438, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+836 , 181016, 571, 1, 1, 5773.907, 718.0335, 618.5657, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+837 , 181016, 571, 1, 1, 5756.162, 712.4989, 618.5643, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+838 , 181016, 571, 1, 1, 5771.891, 737.5848, 641.4211, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+839 , 181016, 571, 1, 1, 5914.837, 700.7205, 641.8951, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+840 , 181016, 571, 1, 1, 5823.329, 760.0555, 640.327, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4739)
+(@OGUID+841 , 181016, 571, 1, 1, 5882.65, 517.4098, 641.9064, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+842 , 181016, 571, 1, 1, 5886.956, 526.6721, 642.1017, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+843 , 181016, 571, 1, 1, 5921.778, 619.2034, 645.9958, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+844 , 181016, 571, 1, 1, 5890.065, 519.4915, 641.9147, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+845 , 181016, 571, 1, 1, 5694.438, 614.2162, 646.6755, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+846 , 181016, 571, 1, 1, 5676.881, 659.645, 647.1504, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+847 , 181016, 571, 1, 1, 5648.303, 675.3729, 651.9927, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+848 , 181016, 571, 1, 1, 5663.514, 682.673, 651.9452, 4.991644, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+849 , 181016, 571, 1, 1, 5663.002, 663.5723, 654.331, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+850 , 181016, 571, 1, 1, 5673.695, 687.83, 654.3299, 4.834563, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+851 , 181016, 571, 1, 1, 5685.707, 679.8306, 646.3728, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+852 , 181016, 571, 1, 1, 5659.298, 673.91, 651.942, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+853 , 181016, 571, 1, 1, 5654.433, 690.0082, 651.9927, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+854 , 181016, 571, 1, 1, 5668.66, 718.72, 653.374, 0.3665176, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+855 , 181016, 571, 1, 1, 5677.676, 730.4684, 653.3763, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+856 , 181016, 571, 1, 1, 5630.848, 705.8953, 651.9803, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+857 , 181016, 571, 1, 1, 5620.479, 681.7556, 651.9917, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+858 , 181016, 571, 1, 1, 5704.065, 734.105, 641.7964, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+859 , 181016, 571, 1, 1, 5716.991, 723.6447, 641.6827, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+860 , 181016, 571, 1, 1, 5710.433, 728.6938, 641.7766, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+861 , 181016, 571, 1, 1, 5739.42, 737.81, 656.8243, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+862 , 181016, 571, 1, 1, 5642.215, 754.7111, 641.5667, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+863 , 181016, 571, 1, 1, 5740.807, 738.6092, 641.7399, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+864 , 181016, 571, 1, 1, 5726.913, 764.369, 644.1921, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4568)
+(@OGUID+865 , 181016, 571, 1, 1, 5787.012, 774.6193, 661.2783, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4740)
+(@OGUID+866 , 181016, 571, 1, 1, 5803.736, 772.4315, 661.2783, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4740)
+(@OGUID+867 , 181016, 571, 1, 1, 5808.237, 791.7759, 632.587, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4740)
+(@OGUID+868 , 181016, 571, 1, 1, 5892.815, 743.408, 639.8414, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+869 , 181016, 571, 1, 1, 5929.599, 639.7736, 645.5601, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+870 , 181016, 571, 1, 1, 5943.547, 636.654, 652.9702, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+871 , 181016, 571, 1, 1, 5947.679, 626.1014, 650.5775, 3.438303, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+872 , 181016, 571, 1, 1, 5934.438, 611.9415, 652.9656, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+873 , 181016, 571, 1, 1, 5944.347, 617.7059, 650.5828, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+874 , 181016, 571, 1, 1, 5958.763, 626.1614, 650.6269, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+875 , 181016, 571, 1, 1, 5953.268, 610.4814, 650.6269, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4613)
+(@OGUID+876 , 181016, 571, 1, 1, 5978.208, 595.1833, 650.6149, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4618)
+(@OGUID+877 , 181016, 571, 1, 1, 5988.101, 621.1797, 650.6269, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4618)
+(@OGUID+878 , 181016, 571, 1, 1, 5845.724, 435.9962, 657.6264, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4616)
+(@OGUID+879 , 181016, 571, 1, 1, 5788.177, 425.141, 657.5775, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4564)
+(@OGUID+880 , 181016, 571, 1, 1, 6675.403, -194.668, 951.2613, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4428)
+(@OGUID+881 , 181016, 571, 1, 1, 6677.512, -203.657, 951.2575, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4428)
+(@OGUID+882 , 181016, 571, 1, 1, 6664.053, -252.1919, 962.2114, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4428)
+(@OGUID+883 , 181016, 571, 1, 1, 6195.851, -1050.231, 410.5798, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4419)
+(@OGUID+884 , 181016, 571, 1, 1, 6128.463, -1071.167, 402.915, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4419)
+(@OGUID+885 , 181016, 571, 1, 1, 6143.565, -1062.889, 402.4637, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4419)
+(@OGUID+886 , 181016, 571, 1, 1, 6181.414, -1060.371, 410.6938, 1.343901, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4419)
+(@OGUID+887 , 181016, 571, 1, 1, 6132.971, -1080.292, 402.5479, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4419)
+(@OGUID+888 , 181016, 571, 1, 1, 6105.885, -1064.441, 403.3065, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4419)
+(@OGUID+889 , 181016, 571, 1, 1, 6104.259, -1076.63, 403.506, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4419)
+(@OGUID+890 , 181016, 571, 1, 1, 5221.921, -1337.251, 241.8586, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+891 , 181016, 571, 1, 1, 5235.554, -1320.319, 242.1471, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+892 , 181016, 571, 1, 1, 5233.944, -1309.333, 242.7248, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+893 , 181016, 571, 1, 1, 5209.904, -1336.67, 242.6071, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+894 , 181016, 571, 1, 1, 5228.022, -1298.785, 242.8026, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+895 , 181016, 571, 1, 1, 5197.744, -1301.545, 244.1698, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+896 , 181016, 571, 1, 1, 5170.655, -2175.094, 236.524, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+897 , 181016, 571, 1, 1, 5174.28, -2190.904, 236.5399, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+898 , 181016, 571, 1, 1, 5196.799, -2208.144, 239.3988, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+899 , 181016, 571, 1, 1, 5135.955, -2183.239, 236.8366, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+900 , 181016, 571, 1, 1, 5135.756, -2204.338, 236.5436, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+901 , 181016, 571, 1, 1, 5153.606, -2216.569, 236.805, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+902 , 181016, 571, 1, 1, 5190.787, -2215.081, 239.3982, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+903 , 181016, 571, 1, 1, 5382.32, -2632.782, 303.9539, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+904 , 181016, 571, 1, 1, 5408.356, -2679.761, 303.9539, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+905 , 181016, 571, 1, 1, 5406.375, -2612.042, 303.9539, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+906 , 181016, 571, 1, 1, 5436.389, -2618.382, 306.5511, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+907 , 181016, 571, 1, 1, 5464.559, -2619.046, 306.5511, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4275)
+(@OGUID+908 , 181016, 571, 1, 1, 5500.086, -2657.195, 303.9539, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4275)
+(@OGUID+909 , 181016, 571, 1, 1, 5526.226, -2674.84, 303.9539, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4275)
+(@OGUID+910 , 181016, 571, 1, 1, 5528.214, -2651.125, 303.9539, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4275)
+(@OGUID+911 , 181016, 571, 1, 1, 5527.774, -2637.863, 303.9539, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4275)
+(@OGUID+912 , 181016, 571, 1, 1, 5750.8, -3535.454, 389.0267, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4324)
+(@OGUID+913 , 181016, 571, 1, 1, 5764.8, -3532.155, 388.3556, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4324)
+(@OGUID+914 , 181016, 571, 1, 1, 5789.338, -3595.79, 388.8241, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4324)
+(@OGUID+915 , 181016, 571, 1, 1, 5783.694, -3600.81, 387.7156, 2.35619, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4324)
+(@OGUID+916 , 181016, 571, 1, 1, 5758.551, -3620.203, 385.8352, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4324)
+(@OGUID+917 , 181016, 571, 1, 1, 5774.17, -3614.33, 387.6901, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4324)
+(@OGUID+918 , 181016, 571, 1, 1, 5794.01, -3586.305, 388.6537, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4324)
+(@OGUID+919 , 181016, 571, 1, 1, 5790.555, -3548.062, 387.1112, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4323)
+(@OGUID+920 , 181016, 571, 1, 1, 4604.299, -4216.11, 178.7165, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+921 , 181016, 571, 1, 1, 4578.913, -4263.682, 182.0264, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4159)
+(@OGUID+922 , 181016, 571, 1, 1, 4585.377, -4225.431, 178.0588, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4159)
+(@OGUID+923 , 181016, 571, 1, 1, 4574.175, -4252.902, 182.2079, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4159)
+(@OGUID+924 , 181016, 571, 1, 1, 4544.073, -4208.386, 170.6733, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4159)
+(@OGUID+925 , 181016, 571, 1, 1, 4554.03, -4232.887, 170.6884, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4159)
+(@OGUID+926 , 181016, 571, 1, 1, 4550.191, -4182.836, 173.4989, 1.518436, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4159)
+(@OGUID+927 , 181016, 571, 1, 1, 4549.178, -4253.708, 170.7494, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4159)
+(@OGUID+928 , 181016, 571, 1, 1, 4531.979, -4176.561, 173.4836, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4159)
+(@OGUID+929 , 181016, 571, 1, 1, 3854.53, -4499.983, 208.0386, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4205)
+(@OGUID+930 , 181016, 571, 1, 1, 3883.566, -4522.057, 217.378, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4205)
+(@OGUID+931 , 181016, 571, 1, 1, 3848.002, -4506.846, 207.7856, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+932 , 181016, 571, 1, 1, 3844.868, -4517.594, 210.5048, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+933 , 181016, 571, 1, 1, 3866.024, -4531.325, 209.7259, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+934 , 181016, 571, 1, 1, 3835.15, -4527.149, 210.6371, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+935 , 181016, 571, 1, 1, 3871.145, -4567.245, 207.5447, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+936 , 181016, 571, 1, 1, 3847.246, -4556.365, 210.1268, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+937 , 181016, 571, 1, 1, 3413.37, -2812.231, 200.4576, 5.078908, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+938 , 181016, 571, 1, 1, 3432.563, -2829.036, 201.7036, 1.97222, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+939 , 181016, 571, 1, 1, 3414.616, -2778.184, 201.5204, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+940 , 181016, 571, 1, 1, 3428.656, -2766.984, 200.3678, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+941 , 181016, 571, 1, 1, 3457.128, -2785.357, 201.2523, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+942 , 181016, 571, 1, 1, 3452.198, -2755.466, 199.3946, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4204)
+(@OGUID+943 , 181016, 571, 1, 1, 3441.72, -2747.261, 199.3887, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4204)
+(@OGUID+944 , 181016, 571, 1, 1, 3302.054, -2350.771, 108.8892, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+945 , 181016, 571, 1, 1, 3316.353, -2328.825, 111.0914, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+946 , 181016, 571, 1, 1, 3225.829, -2298.399, 107.2934, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+947 , 181016, 571, 1, 1, 3267.523, -2271.925, 114.2197, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4248)
+(@OGUID+948 , 181016, 571, 1, 1, 3237.112, -2271.502, 113.9172, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4248)
+(@OGUID+949 , 181016, 571, 1, 1, 3344.212, -2203.41, 119.4523, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4206)
+(@OGUID+950 , 181016, 571, 1, 1, 3294.673, -2261.47, 111.9283, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4206)
+(@OGUID+951 , 181016, 571, 1, 1, 3323.304, -2296.872, 110.1093, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4206)
+(@OGUID+952 , 181016, 571, 1, 1, 3308.395, -2221.642, 115.808, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4206)
+(@OGUID+953 , 181016, 571, 1, 1, 3352.523, -2221.079, 119.4523, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4206)
+(@OGUID+954 , 181016, 571, 1, 1, 3268.585, -2230.661, 116.8297, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4206)
+(@OGUID+955 , 181016, 571, 1, 1, 3286.429, -2201.523, 117.3726, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4206)
+(@OGUID+956 , 181016, 571, 1, 1, 3248.892, -2223.04, 116.8297, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4206)
+(@OGUID+957 , 181016, 571, 1, 1, 3184.458, -2253.973, 114.8628, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4206)
+(@OGUID+958 , 181016, 571, 1, 1, 3183.712, -2235.236, 114.8628, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4206)
+(@OGUID+959 , 181016, 571, 1, 1, 3093.765, -2252.836, 97.05368, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+960 , 181016, 571, 1, 1, 2549.787, -1992.145, 8.439572, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+961 , 181016, 571, 1, 1, 2538.165, -1999.59, 8.439572, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+962 , 181016, 571, 1, 1, 2554.446, -1931.769, 3.000129, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+963 , 181016, 571, 1, 1, 2493.727, -1921.882, 10.72953, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+964 , 181016, 571, 1, 1, 2503.962, -1936.449, 10.39561, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+965 , 181016, 571, 1, 1, 2553.7, -1912.366, 2.313859, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+966 , 181016, 571, 1, 1, 2485.413, -1882.31, 9.955285, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+967 , 181016, 571, 1, 1, 2485.737, -1895.543, 10.02251, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+968 , 181016, 571, 1, 1, 2559.23, -1828.403, 10.51216, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+969 , 181016, 571, 1, 1, 2546.487, -1837.444, 10.57294, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+970 , 181016, 571, 1, 1, 2600.053, -1802.445, 10.64246, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+971 , 181016, 571, 1, 1, 2595.78, -1789.134, 10.64246, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+972 , 181016, 571, 1, 1, 2491.829, -1845.16, 10.7064, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+973 , 181016, 571, 1, 1, 2497.92, -1838.303, 10.55219, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+974 , 181016, 571, 1, 1, 2438.875, -1853.441, 1.204814, 0.2443456, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+975 , 181016, 571, 1, 1, 2444.651, -1838.691, 1.022343, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4242)
+(@OGUID+976 , 181016, 571, 1, 1, 2117.118, -2965.382, 148.6169, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4070)
+(@OGUID+977 , 181016, 571, 1, 1, 2109.816, -2988.45, 148.3804, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4070)
+(@OGUID+978 , 181016, 571, 1, 1, 2140.401, -2968.399, 148.3356, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+979 , 181016, 571, 1, 1, 2142.096, -2984.892, 148.9165, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+980 , 181016, 571, 1, 1, 1435.889, -3265.063, 178.2813, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+981 , 181016, 571, 1, 1, 1394.399, -3307.07, 166.7923, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+982 , 181016, 571, 1, 1, 1428.256, -3256.8, 165.615, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+983 , 181016, 571, 1, 1, 1408.13, -3251.247, 162.0143, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+984 , 181016, 571, 1, 1, 1401.351, -3262.329, 163.0069, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+985 , 181016, 571, 1, 1, 1370.036, -3334.958, 173.685, 4.852017, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+986 , 181016, 571, 1, 1, 1458.753, -3200.1, 165.5917, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4380)
+(@OGUID+987 , 181016, 571, 1, 1, 1341.442, -3276.221, 174.6177, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4380)
+(@OGUID+988 , 181016, 571, 1, 1, 1352.596, -3284.401, 174.7101, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4380)
+(@OGUID+989 , 181016, 571, 1, 1, 1349.468, -3297.907, 174.7129, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4380)
+(@OGUID+990 , 181016, 571, 1, 1, 1371.299, -3185.653, 162.8225, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4380)
+(@OGUID+991 , 181016, 571, 1, 1, 1355.771, -3193.905, 162.8225, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+992 , 181016, 571, 1, 1, 1400.156, -3458.59, 174.5718, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+993 , 181016, 571, 1, 1, 1351.665, -3457.366, 175.9246, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+994 , 181016, 571, 1, 1, 1431.132, -3152.292, 164.8159, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4071)
+(@OGUID+995 , 181016, 571, 1, 1, 1429.037, -3131.07, 167.7346, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+996 , 181016, 571, 1, 1, 1416.06, -3120.286, 167.5702, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+997 , 181016, 571, 1, 1, 1389.093, -3096.109, 167.4995, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3998)
+(@OGUID+998 , 181016, 571, 1, 1, 765.1684, -2962.793, 9.955372, 6.021387, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+999 , 181016, 571, 1, 1, 784.9827, -2956.3, 8.627842, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1000, 181016, 571, 1, 1, 731.5729, -2945.844, 9.658432, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1001, 181016, 571, 1, 1, 807.6268, -2945.674, 6.90544, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1002, 181016, 571, 1, 1, 728.2534, -2936.78, 8.08532, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1003, 181016, 571, 1, 1, 726.3077, -2921.696, 7.548036, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1004, 181016, 571, 1, 1, 811.6979, -2925.72, 7.491168, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1005, 181016, 571, 1, 1, 738.8159, -2917.706, 7.83575, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1006, 181016, 571, 1, 1, 708.9809, -2939.207, -3.255977, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1007, 181016, 571, 1, 1, 733.0174, -2896.646, 7.161568, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1008, 181016, 571, 1, 1, 786.5696, -2895.316, 7.331877, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1009, 181016, 571, 1, 1, 706.6024, -2924.741, -3.165701, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3987)
+(@OGUID+1010, 181016, 571, 1, 1, 785.3965, -2856.019, 4.484005, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3988)
+(@OGUID+1011, 181016, 571, 1, 1, 775.6638, -2854.298, 4.683801, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3988)
+(@OGUID+1012, 181016, 571, 1, 1, 785.8663, -2882.146, 4.527083, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3988)
+(@OGUID+1013, 181016, 571, 1, 1, 400.0066, -4535.086, 246.1532, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3991)
+(@OGUID+1014, 181016, 571, 1, 1, 404.2422, -4538.7, 245.8211, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3991)
+(@OGUID+1015, 181016, 571, 1, 1, 434.1599, -4539.468, 245.8032, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3991)
+(@OGUID+1016, 181016, 571, 1, 1, 446.3067, -4559.884, 245.5032, 4.363324, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3991)
+(@OGUID+1017, 181016, 571, 1, 1, 403.795, -4652.395, 243.9677, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3991)
+(@OGUID+1018, 181016, 571, 1, 1, 412.7631, -4658.49, 246.6353, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3991)
+(@OGUID+1019, 181016, 571, 1, 1, 493.6993, -4605.006, 243.6478, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3991)
+(@OGUID+1020, 181016, 571, 1, 1, 584.0461, -4934.744, 29.65519, 1.029743, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3981)
+(@OGUID+1021, 181016, 571, 1, 1, 577.2066, -4954.415, 18.2157, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3981)
+(@OGUID+1022, 181016, 571, 1, 1, 569.7136, -4931.643, 17.79272, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3981)
+(@OGUID+1023, 181016, 571, 1, 1, 569.194, -5003.27, 11.0998, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3981)
+(@OGUID+1024, 181016, 571, 1, 1, 540.1192, -4999.92, 10.53384, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4379)
+(@OGUID+1025, 181016, 571, 1, 1, 563.828, -5017.783, 11.59005, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4379)
+(@OGUID+1026, 181016, 571, 1, 1, 575.377, -5101.069, 5.191134, 0.6981314, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3981)
+(@OGUID+1027, 181016, 571, 1, 1, 641.0491, -5019.355, 4.459393, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3981)
+(@OGUID+1028, 181016, 571, 1, 1, 604.1622, -5108.14, 4.842274, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3981)
+(@OGUID+1029, 181016, 571, 1, 1, 1882.581, -6170.531, 23.82956, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4000)
+(@OGUID+1030, 181016, 571, 1, 1, 1899.31, -6178.332, 24.02914, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4000)
+(@OGUID+1031, 181016, 571, 1, 1, 1919.915, -6182.599, 24.47692, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4000)
+(@OGUID+1032, 181016, 571, 1, 1, 1927.329, -6186.836, 24.11248, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4000)
+(@OGUID+1033, 181016, 571, 1, 1, 2021.995, -6214.678, 7.750907, 2.094393, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4000)
+(@OGUID+1034, 181016, 571, 1, 1, 2429.847, -5168.776, 277.1109, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4003)
+(@OGUID+1035, 181016, 571, 1, 1, 2429.503, -5159.25, 277.0016, 5.061456, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4003)
+(@OGUID+1036, 181016, 571, 1, 1, 2417.962, -5122.142, 276.594, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4003)
+(@OGUID+1037, 181016, 571, 1, 1, 2438.945, -5120.976, 275.9086, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4003)
+(@OGUID+1038, 181016, 571, 1, 1, 2476.26, -5072.812, 283.0372, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4003)
+(@OGUID+1039, 181016, 571, 1, 1, 2422.845, -5074.851, 272.2427, 0, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4003)
+(@OGUID+1040, 181016, 571, 1, 1, 2462.827, -5023.975, 283.7139, 5.410522, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4003)
+(@OGUID+1041, 181016, 571, 1, 1, 2464.117, -5036.913, 283.7561, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4003)
+(@OGUID+1042, 181016, 571, 1, 1, 2657.285, -4403.338, 283.9217, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1043, 181016, 571, 1, 1, 2681.398, -4378.912, 282.9612, 1.989672, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1044, 181016, 571, 1, 1, 2642.45, -4384.394, 283.2693, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1045, 181016, 571, 1, 1, 2654.31, -4365.038, 277.5075, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1046, 181016, 571, 1, 1, 2681.611, -4385.324, 284.4337, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1047, 181016, 571, 1, 1, 2675.206, -4331.749, 289.7764, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1048, 181016, 571, 1, 1, 2620.654, -4361.461, 276.4902, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1049, 181016, 571, 1, 1, 3296.599, -736.467, 176.1194, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1050, 181016, 571, 1, 1, 3260.281, -749.4948, 168.42, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1051, 181016, 571, 1, 1, 3309.448, -746.7072, 179.006, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1052, 181016, 571, 1, 1, 3274.188, -755.2222, 168.0432, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1053, 181016, 571, 1, 1, 3261.053, -755.9268, 174.2897, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1054, 181016, 571, 1, 1, 3266.31, -712.2863, 172.5281, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1055, 181016, 571, 1, 1, 3270.005, -719.1215, 168.8549, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1056, 181016, 571, 1, 1, 3281.076, -720.5919, 175.8908, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1057, 181016, 571, 1, 1, 3257.232, -695.9045, 167.3684, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1058, 181016, 571, 1, 1, 3216.764, -730.0927, 173.64, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1059, 181016, 571, 1, 1, 3267.798, -689.1566, 173.7582, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1060, 181016, 571, 1, 1, 3254.467, -668.7876, 174.1768, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1061, 181016, 571, 1, 1, 3235.794, -713.0104, 167.6716, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1062, 181016, 571, 1, 1, 3249.678, -674.059, 167.3249, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1063, 181016, 571, 1, 1, 3209.856, -708.0291, 173.0501, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1064, 181016, 571, 1, 1, 3215.154, -685.1657, 174.8388, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1065, 181016, 571, 1, 1, 3216.414, -654.4945, 173.1659, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4232)
+(@OGUID+1066, 181016, 571, 1, 1, 3201.649, -673.1436, 172.2877, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4186)
+(@OGUID+1067, 181016, 571, 1, 1, 3202.44, -689.5214, 171.9362, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4186)
+(@OGUID+1068, 181016, 571, 1, 1, 3632.087, -711.0179, 214.2405, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1069, 181016, 571, 1, 1, 3658.59, -706.5002, 224.446, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1070, 181016, 571, 1, 1, 3674.527, -739.8177, 213.8958, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1071, 181016, 571, 1, 1, 3649.295, -702.2972, 215.0318, 6.19592, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1072, 181016, 571, 1, 1, 3676.882, -702.1511, 214.3667, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1073, 181016, 571, 1, 1, 3704.834, -687.1371, 215.5728, 5.148723, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1074, 181016, 571, 1, 1, 3698.531, -714.2257, 214.151, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1075, 181016, 571, 1, 1, 3697.376, -742.7101, 213.797, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1076, 181016, 571, 1, 1, 3716.316, -708.1945, 215.473, 2.268925, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1077, 181016, 571, 1, 1, 3749.342, -769.8768, 197.4349, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1078, 181016, 571, 1, 1, 3781.028, -803.4545, 197.2077, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1079, 181016, 571, 1, 1, 3794.07, -804.0314, 197.3381, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1080, 181016, 571, 1, 1, 3826.776, -685.0971, 223.0013, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1081, 181016, 571, 1, 1, 3803.82, -793.8429, 197.2356, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1082, 181016, 571, 1, 1, 3843.911, -763.369, 219.3806, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1083, 181016, 571, 1, 1, 3822.775, -695.2535, 223.0013, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1084, 181016, 571, 1, 1, 3858.99, -724.03, 221.2304, 3.752462, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1085, 181016, 571, 1, 1, 3862.428, -745.8948, 221.1198, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1086, 181016, 571, 1, 1, 3866.354, -771.1376, 220.3779, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1087, 181016, 571, 1, 1, 3951.355, -780.9128, 244.63, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4177)
+(@OGUID+1088, 181016, 571, 1, 1, 3548.806, 191.4957, 52.29362, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1089, 181016, 571, 1, 1, 3562.132, 193.3676, 52.28502, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1090, 181016, 571, 1, 1, 3563.86, 208.5335, 52.2564, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1091, 181016, 571, 1, 1, 3604.824, 221.3126, -120.0548, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1092, 181016, 571, 1, 1, 3543.596, 229.0154, 116.7898, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1093, 181016, 571, 1, 1, 3539.345, 210.2894, 116.8406, 4.834563, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1094, 181016, 571, 1, 1, 3576.012, 201.1324, -120.133, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1095, 181016, 571, 1, 1, 3542.329, 206.0333, 52.2564, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1096, 181016, 571, 1, 1, 3532.222, 198.4992, -120.1445, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1097, 181016, 571, 1, 1, 3565.379, 213.0888, 116.8406, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1098, 181016, 571, 1, 1, 3557.755, 230.3309, 116.7897, 3.228859, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1099, 181016, 571, 1, 1, 3501.747, 212.1927, -120.1452, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4254)
+(@OGUID+1100, 181016, 571, 1, 1, 3579.191, 264.8907, 117.1309, 2.897245, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1101, 181016, 571, 1, 1, 3520.52, 258.9779, 47.3175, 0.4886912, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1102, 181016, 571, 1, 1, 3535.776, 241.7472, 117.1205, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1103, 181016, 571, 1, 1, 3538.464, 244.5366, 47.31742, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1104, 181016, 571, 1, 1, 3575.862, 264.2621, 47.31741, 2.844883, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1105, 181016, 571, 1, 1, 3565.646, 245.8031, 117.1294, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1106, 181016, 571, 1, 1, 3561.06, 247.0676, 47.31746, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1107, 181016, 571, 1, 1, 3517.434, 257.0187, 117.1313, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1108, 181016, 571, 1, 1, 3597.307, 271.0546, -120.1526, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1109, 181016, 571, 1, 1, 3573.319, 287.2054, 47.31745, 3.630291, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1110, 181016, 571, 1, 1, 3477.063, 249.0635, -120.1415, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1111, 181016, 571, 1, 1, 3613.162, 267.1122, 52.27297, 1.815142, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1112, 181016, 571, 1, 1, 3518.373, 281.8263, 47.31754, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1113, 181016, 571, 1, 1, 3483.588, 254.1247, 52.26856, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1114, 181016, 571, 1, 1, 3480.771, 279.4473, 52.26998, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1115, 181016, 571, 1, 1, 3463.682, 274.7737, 52.29326, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1116, 181016, 571, 1, 1, 3559.003, 305.3416, 117.1257, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1117, 181016, 571, 1, 1, 3576.934, 290.0081, 117.1281, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1118, 181016, 571, 1, 1, 3610.144, 292.3628, 52.27081, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1119, 181016, 571, 1, 1, 3532.95, 299.9154, 47.31733, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1120, 181016, 571, 1, 1, 3514.207, 282.3757, 117.1297, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1121, 181016, 571, 1, 1, 3527.995, 301.947, 117.1261, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1122, 181016, 571, 1, 1, 3628.7, 289.4008, 52.28633, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1123, 181016, 571, 1, 1, 3555.46, 301.8236, 47.3174, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1124, 181016, 571, 1, 1, 3466.395, 254.6163, 52.29464, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1125, 181016, 571, 1, 1, 3630.185, 272.4107, 52.28997, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1126, 181016, 571, 1, 1, 3595.918, 285.1813, -120.1526, 5.916668, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1127, 181016, 571, 1, 1, 3535.763, 316.0141, 116.7898, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1128, 181016, 571, 1, 1, 3646.115, 260.8871, 52.25636, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1129, 181016, 571, 1, 1, 3471.14, 281.1834, -120.1448, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1130, 181016, 571, 1, 1, 3549.406, 317.3907, 116.7898, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1131, 181016, 571, 1, 1, 3592.655, 332.8689, -120.1448, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1132, 181016, 571, 1, 1, 3546.336, 351.4997, 52.27733, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1133, 181016, 571, 1, 1, 3551.697, 340.1284, 52.2564, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1134, 181016, 571, 1, 1, 3562.234, 345.9385, -120.1445, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1135, 181016, 571, 1, 1, 3515.109, 342.4366, -120.1445, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1136, 181016, 571, 1, 1, 3527.488, 332.789, 116.7998, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1137, 181016, 571, 1, 1, 3531.985, 349.9049, 52.27657, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1138, 181016, 571, 1, 1, 3492.134, 322.4423, -120.1445, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1139, 181016, 571, 1, 1, 3530.838, 337.9557, 52.25639, 6.19592, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1140, 181016, 571, 1, 1, 3553.869, 335.9773, 116.7962, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1141, 181016, 571, 1, 1, 3656.756, 292.7126, -120.1445, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1142, 181016, 571, 1, 1, 3639.994, 308.4146, 52.25637, 5.724681, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1143, 181016, 571, 1, 1, 3658.891, 275.3087, -120.1445, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1144, 181016, 571, 1, 1, 3675.714, 259.1941, 52.25635, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4161)
+(@OGUID+1145, 181016, 571, 1, 1, 3833.705, 1420.332, 90.87871, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1146, 181016, 571, 1, 1, 3838.928, 1434.694, 90.64106, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1147, 181016, 571, 1, 1, 3847.046, 1434.552, 90.64103, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1148, 181016, 571, 1, 1, 3852.562, 1420.469, 90.91337, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1149, 181016, 571, 1, 1, 3826.221, 1467.968, 91.71698, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1150, 181016, 571, 1, 1, 3847.981, 1459.16, 91.84016, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1151, 181016, 571, 1, 1, 3856.728, 1468.202, 92.05556, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1152, 181016, 571, 1, 1, 3837.253, 1460.372, 91.84299, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1153, 181016, 571, 1, 1, 3827.208, 1483.951, 92.06059, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1154, 181016, 571, 1, 1, 3772.201, 1518.562, 87.60015, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1155, 181016, 571, 1, 1, 3826.889, 1531.865, 95.81321, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1156, 181016, 571, 1, 1, 3805.442, 1540.334, 89.73431, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1157, 181016, 571, 1, 1, 3842.612, 1551.831, 89.72446, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1158, 181016, 571, 1, 1, 3869.433, 1563.036, 89.7524, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1159, 181016, 571, 1, 1, 3828.599, 1550.87, 89.65501, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1160, 181016, 571, 1, 1, 3857.379, 1532.047, 95.73104, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1161, 181016, 571, 1, 1, 3856.719, 1587.243, 89.60239, 0.5934101, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1162, 181016, 571, 1, 1, 3799.489, 1569.15, 89.72446, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1163, 181016, 571, 1, 1, 3763.406, 1539.296, 87.04375, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1164, 181016, 571, 1, 1, 3807.621, 1601.288, 89.72446, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1165, 181016, 571, 1, 1, 3825.676, 1611.223, 89.72446, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1166, 181016, 571, 1, 1, 3873.578, 1603.196, 90.13206, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1167, 181016, 571, 1, 1, 3853.099, 1601.293, 89.72446, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1168, 181016, 571, 1, 1, 3804.344, 1618.123, 89.31889, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1169, 181016, 571, 1, 1, 3781.226, 1617.937, 87.15925, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4165)
+(@OGUID+1170, 181016, 571, 1, 1, 3515.828, 1981.839, 64.86245, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4158)
+(@OGUID+1171, 181016, 571, 1, 1, 3533.275, 2028.212, 67.83712, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4158)
+(@OGUID+1172, 181016, 571, 1, 1, 3487.095, 1996.391, 64.86275, 3.228859, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4158)
+(@OGUID+1173, 181016, 571, 1, 1, 3503.747, 2013.127, 64.86234, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4158)
+(@OGUID+1174, 181016, 571, 1, 1, 3463.338, 1991.168, 64.61589, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4158)
+(@OGUID+1175, 181016, 571, 1, 1, 2795.232, 971.2288, 22.84727, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4154)
+(@OGUID+1176, 181016, 571, 1, 1, 2784.236, 959.4688, 22.49838, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4154)
+(@OGUID+1177, 181016, 571, 1, 1, 2793.773, 931.6573, 22.35705, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1178, 181016, 571, 1, 1, 2772.131, 928.7278, 22.78977, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1179, 181016, 571, 1, 1, 2781.197, 933.6979, 22.78251, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1180, 181016, 571, 1, 1, 2731.755, 930.2222, 0.360353, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1181, 181016, 571, 1, 1, 2815.472, 918.7995, 20.88776, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1182, 181016, 571, 1, 1, 2801.712, 908.5086, 22.29059, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1183, 181016, 571, 1, 1, 2754.224, 894.7058, 5.906912, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1184, 181016, 571, 1, 1, 2771.326, 914.0045, 22.36399, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1185, 181016, 571, 1, 1, 2787.118, 905.9583, 22.15631, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1186, 181016, 571, 1, 1, 2802.756, 890.1584, 12.88576, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1187, 181016, 571, 1, 1, 2837.893, 884.1483, 15.9367, 2.164206, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1188, 181016, 571, 1, 1, 2720.492, 904.6319, 5.697, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1189, 181016, 571, 1, 1, 2763.372, 862.8993, 6.277842, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1190, 181016, 571, 1, 1, 2722.365, 888.5219, 5.181851, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1191, 181016, 571, 1, 1, 2743.732, 851.4514, 6.691175, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1192, 181016, 571, 1, 1, 2645.363, 884.6476, 4.748452, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1193, 181016, 571, 1, 1, 2659.202, 906.3993, 4.293646, 4.852017, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1194, 181016, 571, 1, 1, 2643.082, 897.5799, 4.501051, 6.021387, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1195, 181016, 571, 1, 1, 2663.845, 880.2552, 4.281791, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4152)
+(@OGUID+1196, 181016, 571, 1, 1, 4462.361, 1266.483, 142.2847, 5.009095, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1197, 181016, 571, 1, 1, 4469.088, 1267.642, 141.8956, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1198, 181016, 571, 1, 1, 4528.026, 1252.006, 139.5977, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1199, 181016, 571, 1, 1, 4515.189, 1271.205, 137.7116, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1200, 181016, 571, 1, 1, 4866.249, 1289.011, 222.6894, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4171)
+(@OGUID+1201, 181016, 571, 1, 1, 4908.99, 1241.123, 226.8822, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4171)
+(@OGUID+1202, 181016, 571, 1, 1, 4896.076, 1252.84, 227.6416, 0.2443456, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4171)
+(@OGUID+1203, 181016, 571, 1, 1, 4925.459, 1257.523, 226.8904, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4171)
+(@OGUID+1204, 181016, 571, 1, 1, 4919.086, 1318.598, 229.563, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4171)
+(@OGUID+1205, 181016, 571, 1, 1, 4950.565, 1309.806, 235.062, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1206, 181016, 571, 1, 1, 4948.565, 1174.379, 239.7921, 4.485497, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1207, 181016, 571, 1, 1, 4956.751, 1164.542, 239.6501, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1208, 181016, 571, 1, 1, 4967.222, 1205.661, 227.3895, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1209, 181016, 571, 1, 1, 4958.919, 1196.348, 226.8051, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1210, 181016, 571, 1, 1, 4978.83, 1243.004, 227.4904, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1211, 181016, 571, 1, 1, 4980.446, 1205.421, 227.7068, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1212, 181016, 571, 1, 1, 4986.674, 1189.043, 227.4761, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1213, 181016, 571, 1, 1, 5003.663, 1190.19, 227.3823, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1214, 181016, 571, 1, 1, 4985.378, 1269.712, 229.3461, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1215, 181016, 571, 1, 1, 5019.801, 1236.83, 230.0975, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4170)
+(@OGUID+1216, 181016, 571, 1, 1, 4692.931, 1529.158, 261.0022, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4171)
+(@OGUID+1217, 181016, 571, 1, 1, 4690.823, 1517.44, 261.1075, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4171)
+(@OGUID+1218, 181016, 571, 1, 1, 3437.819, 4086.14, 17.09811, 1.518436, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4042)
+(@OGUID+1219, 181016, 571, 1, 1, 3426.033, 4071.888, 18.0825, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4042)
+(@OGUID+1220, 181016, 571, 1, 1, 3409.352, 4091.084, 18.57693, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4042)
+(@OGUID+1221, 181016, 571, 1, 1, 3473.787, 4089.247, 17.13011, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4042)
+(@OGUID+1222, 181016, 571, 1, 1, 3458.691, 4082.395, 17.32234, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4042)
+(@OGUID+1223, 181016, 571, 1, 1, 3469.884, 4115.7, 16.70656, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4043)
+(@OGUID+1224, 181016, 571, 1, 1, 3429.658, 4124.901, 16.82856, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4043)
+(@OGUID+1225, 181016, 571, 1, 1, 3419, 4110.042, 17.55773, 6.021387, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4043)
+(@OGUID+1226, 181016, 571, 1, 1, 3455.853, 4140.363, 15.27709, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4037)
+(@OGUID+1227, 181016, 571, 1, 1, 3468.707, 4138.945, 15.28419, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4037)
+(@OGUID+1228, 181016, 571, 1, 1, 3484.245, 4164.788, 17.17531, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4037)
+(@OGUID+1229, 181016, 571, 1, 1, 3472.248, 4185.592, 18.24646, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4037)
+(@OGUID+1230, 181016, 571, 1, 1, 3460.45, 4186.23, 18.21275, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4037)
+(@OGUID+1231, 181016, 571, 1, 1, 3484.917, 4176.376, 17.19302, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4037)
+(@OGUID+1232, 181016, 571, 1, 1, 3445, 4178.582, 17.15816, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4037)
+(@OGUID+1233, 181016, 571, 1, 1, 3444.581, 4167.645, 17.16287, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4037)
+(@OGUID+1234, 181016, 571, 1, 1, 2998.711, 4070.604, 26.91523, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4113)
+(@OGUID+1235, 181016, 571, 1, 1, 2997.857, 4049.579, 26.61824, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4113)
+(@OGUID+1236, 181016, 571, 1, 1, 3008.427, 4048.363, 26.36823, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4113)
+(@OGUID+1237, 181016, 571, 1, 1, 3017.189, 4065.652, 26.77533, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4113)
+(@OGUID+1238, 181016, 571, 1, 1, 2910.194, 4046.256, 1.670829, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4113)
+(@OGUID+1239, 181016, 571, 1, 1, 2899.832, 4067.156, 1.7923, 6.0912, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4113)
+(@OGUID+1240, 181016, 571, 1, 1, 2922.883, 4037.388, 1.768461, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4113)
+(@OGUID+1241, 181016, 571, 1, 1, 2904.64, 4073.7, 1.964231, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4113)
+(@OGUID+1242, 181016, 571, 1, 1, 2927.117, 4077.872, 2.141783, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4113)
+(@OGUID+1243, 181016, 571, 1, 1, 2238.36, 5132.744, 5.344914, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1244, 181016, 571, 1, 1, 2226.791, 5136.915, 5.344575, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1245, 181016, 571, 1, 1, 2352.742, 5196.42, 7.632045, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1246, 181016, 571, 1, 1, 2248.404, 5206.861, 14.71353, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1247, 181016, 571, 1, 1, 2238.517, 5180.176, 14.71353, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1248, 181016, 571, 1, 1, 2207.053, 5222.542, 14.10005, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1249, 181016, 571, 1, 1, 2255.31, 5225.856, 14.71353, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1250, 181016, 571, 1, 1, 2302.698, 5237.8, 11.3397, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1251, 181016, 571, 1, 1, 2366.833, 5211.396, 7.632044, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1252, 181016, 571, 1, 1, 2214.695, 5241.333, 14.10005, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1253, 181016, 571, 1, 1, 2276.32, 5282.166, 15.66975, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1254, 181016, 571, 1, 1, 2234.987, 5298.379, 15.05626, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1255, 181016, 571, 1, 1, 2187.269, 5257.097, 23.37515, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1256, 181016, 571, 1, 1, 2192.255, 5270.982, 24.45937, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1257, 181016, 571, 1, 1, 2288.013, 5313.147, 14.71353, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1258, 181016, 571, 1, 1, 2213.95, 5333.778, 23.37515, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1259, 181016, 571, 1, 1, 2197.986, 5288.558, 24.45936, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1260, 181016, 571, 1, 1, 2202.939, 5302.733, 23.37515, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1261, 181016, 571, 1, 1, 2208.51, 5319.641, 23.37515, 2.897245, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1262, 181016, 571, 1, 1, 2151.343, 5284.071, 24.66521, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1263, 181016, 571, 1, 1, 2157.476, 5301.414, 24.66485, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1264, 181016, 571, 1, 1, 2122.561, 5320.263, 32.77589, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1265, 181016, 571, 1, 1, 2112.85, 5291.524, 32.77574, 1.239183, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4032)
+(@OGUID+1266, 181016, 571, 1, 1, 2805.134, 6135.274, 84.65132, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1267, 181016, 571, 1, 1, 2788.66, 6162.68, 84.8553, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1268, 181016, 571, 1, 1, 2823.609, 6165.092, 121.9373, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1269, 181016, 571, 1, 1, 2815.305, 6174.101, 121.9518, 5.497789, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1270, 181016, 571, 1, 1, 2799.835, 6186.328, 84.08407, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1271, 181016, 571, 1, 1, 2876.308, 6204.336, 208.7393, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1272, 181016, 571, 1, 1, 2860.569, 6221.081, 208.7375, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1273, 181016, 571, 1, 1, 2861.186, 6199.252, 208.7366, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1274, 181016, 571, 1, 1, 2853.404, 6207.334, 208.7359, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1275, 181016, 571, 1, 1, 2888.891, 6247.602, 208.8507, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1276, 181016, 571, 1, 1, 2902.97, 6231.561, 208.8656, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1277, 181016, 571, 1, 1, 2899.378, 6242.913, 208.8885, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1278, 181016, 571, 1, 1, 2892.682, 6263.139, 209.0361, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1279, 181016, 571, 1, 1, 2922.968, 6238.53, 208.9055, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4129)
+(@OGUID+1280, 181016, 571, 1, 1, 3521.802, 5957.627, 134.0744, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4023)
+(@OGUID+1281, 181016, 571, 1, 1, 3519.409, 5943.527, 134.4016, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4023)
+(@OGUID+1282, 181016, 571, 1, 1, 3584.385, 5975.644, 136.2158, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4023)
+(@OGUID+1283, 181016, 571, 1, 1, 3624.637, 5926.569, 136.2162, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4023)
+(@OGUID+1284, 181016, 571, 1, 1, 3623.188, 5947.213, 136.2162, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4023)
+(@OGUID+1285, 181016, 571, 1, 1, 3612.38, 5919.877, 136.0995, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4023)
+(@OGUID+1286, 181016, 571, 1, 1, 3605.886, 5989.136, 136.2162, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4023)
+(@OGUID+1287, 181016, 571, 1, 1, 3633.385, 5887.483, 140.0765, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4023)
+(@OGUID+1288, 181016, 571, 1, 1, 3647.803, 5882.226, 174.4943, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4023)
+(@OGUID+1289, 181016, 571, 1, 1, 4047.685, 5298.593, 24.65438, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1290, 181016, 571, 1, 1, 4079.892, 5272.371, 27.84729, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1291, 181016, 571, 1, 1, 4174.55, 5310.481, 25.4746, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1292, 181016, 571, 1, 1, 4124.854, 5302.798, 29.50037, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1293, 181016, 571, 1, 1, 4166.071, 5288.284, 26.37672, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1294, 181016, 571, 1, 1, 4064.177, 5287.178, 28.33383, 0.4886912, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1295, 181016, 571, 1, 1, 4038.373, 5295.928, 24.80445, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1296, 181016, 571, 1, 1, 4133.651, 5261.081, 25.0436, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4108)
+(@OGUID+1297, 181016, 571, 1, 1, 4116.859, 5260.454, 24.72842, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4108)
+(@OGUID+1298, 181016, 571, 1, 1, 4188.307, 5253.252, 26.37672, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4108)
+(@OGUID+1299, 181016, 571, 1, 1, 4203.514, 5258.505, 32.30191, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4108)
+(@OGUID+1300, 181016, 571, 1, 1, 4245.934, 5261.749, 70.84612, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4108)
+(@OGUID+1301, 181016, 571, 1, 1, 4464.801, 5710.149, 81.19541, 0.4886912, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1302, 181016, 571, 1, 1, 4474.953, 5701.296, 81.26831, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1303, 181016, 571, 1, 1, 4504.061, 5681.631, 81.48656, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1304, 181016, 571, 1, 1, 4496.206, 5716.174, 81.43398, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1305, 181016, 571, 1, 1, 4503.089, 5725.708, 81.28325, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1306, 181016, 571, 1, 1, 4518.926, 5710.135, 81.47955, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1307, 181016, 571, 1, 1, 4509.733, 5758.892, 81.67448, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4122)
+(@OGUID+1308, 181016, 571, 1, 1, 5533.617, 5764.573, -78.64155, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4285)
+(@OGUID+1309, 181016, 571, 1, 1, 5538.608, 5734.042, -76.70612, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4285)
+(@OGUID+1310, 181016, 571, 1, 1, 5581.773, 5765.792, -74.64859, 5.061456, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4285)
+(@OGUID+1311, 181016, 571, 1, 1, 5565.491, 5758.583, -75.22591, 5.794494, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4285)
+(@OGUID+1312, 181016, 571, 1, 1, 5590.33, 5779.955, -71.88873, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4285)
+(@OGUID+1313, 181016, 571, 1, 1, 5591.747, 5812.308, -69.85215, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4285)
+(@OGUID+1314, 181016, 571, 1, 1, 5547.863, 5726.392, -76.03914, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4285)
+(@OGUID+1315, 181016, 571, 1, 1, 5594.934, 5715.648, -72.77393, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4284)
+(@OGUID+1316, 181016, 571, 1, 1, 5575.626, 5710.971, -76.69463, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4284)
+(@OGUID+1317, 181016, 571, 1, 1, 5584.725, 5752.109, -72.06274, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4284)
+(@OGUID+1318, 181016, 571, 1, 1, 5609.327, 5807.859, -70.49896, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4284)
+(@OGUID+1319, 181016, 571, 1, 1, 5623.018, 5797.692, -71.15307, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4284)
+(@OGUID+1320, 181016, 571, 1, 1, 5480.522, 4749.844, -197.1695, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4290)
+(@OGUID+1321, 181016, 571, 1, 1, 5499.655, 4733.096, -194.545, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4290)
+(@OGUID+1322, 181016, 571, 1, 1, 5480.355, 4744.158, -196.4283, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4290)
+(@OGUID+1323, 181016, 571, 1, 1, 5489.249, 4730.626, -194.7575, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4290)
+(@OGUID+1324, 181016, 571, 1, 1, 5478.019, 4730.707, -195.1084, 0.7853968, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4290)
+(@OGUID+1325, 181016, 571, 1, 1, 8436.615, -338.5281, 906.6075, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4436)
+(@OGUID+1326, 181016, 571, 1, 1, 8477.151, -325.8229, 905.8746, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4436)
+(@OGUID+1327, 181016, 571, 1, 1, 8442.052, -343.1962, 906.6075, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4436)
+(@OGUID+1328, 181016, 571, 1, 1, 8471.394, -348.3333, 906.9317, 1.815142, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4436)
+(@OGUID+1329, 181016, 571, 1, 1, 7856.442, -742.1389, 1177.688, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1330, 181016, 571, 1, 1, 7879.499, -759.5701, 1175.366, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1331, 181016, 571, 1, 1, 7850.471, -793.3299, 1183.955, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1332, 181016, 530, 1, 1, -1907.199, 5450.696, -12.42813, 5.480334, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1333, 181016, 530, 1, 1, -1917.352, 5455.052, -12.55365, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1334, 181016, 530, 1, 1, -1911.368, 5439.292, -12.42818, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1335, 181016, 530, 1, 1, -1885.166, 5386.202, -12.42817, 0.7679439, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1336, 181016, 530, 1, 1, -1873.54, 5382.65, -12.42811, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1337, 181016, 530, 1, 1, -1815.917, 5420.624, -12.42818, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1338, 181016, 530, 1, 1, -1819.924, 5409.16, -12.42813, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1339, 181016, 530, 1, 1, -1727.312, 5487.572, -8.355326, 0.9599299, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1340, 181016, 530, 1, 1, -1735.256, 5502.995, -8.428672, 6.19592, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1341, 181016, 530, 1, 1, -1695.612, 5498.583, -9.799444, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1342, 181016, 530, 1, 1, -1706.805, 5522.744, -9.799464, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3703)
+(@OGUID+1343, 181016, 530, 1, 1, -1745.647, 5142.983, -37.22771, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3899)
+(@OGUID+1344, 181016, 530, 1, 1, -1758.525, 5138.586, -37.21199, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3899)
+(@OGUID+1345, 181016, 530, 1, 1, -1775.782, 5170.78, -40.20916, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3899)
+(@OGUID+1346, 181016, 530, 1, 1, -2042.056, 5233.834, -38.8555, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1347, 181016, 530, 1, 1, -2050.452, 5241.551, -38.85723, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1348, 181016, 530, 1, 1, -2061.054, 5250.36, -38.46526, 6.056293, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1349, 181016, 530, 1, 1, -2021.757, 5336.417, -9.350949, 0.9599299, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1350, 181016, 530, 1, 1, -2034.004, 5359.76, -9.350951, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1351, 181016, 530, 1, 1, -2001.405, 5370.284, -8.034398, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1352, 181016, 530, 1, 1, -2171.618, 5399.994, 50.22791, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1353, 181016, 530, 1, 1, -1994.435, 5356.163, -8.067644, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1354, 181016, 530, 1, 1, -2024.566, 5470.972, 3.928363, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1355, 181016, 530, 1, 1, -2032.695, 5481.466, 54.53995, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1356, 181016, 530, 1, 1, -2029.916, 5490.481, 54.53994, 4.363324, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1357, 181016, 530, 1, 1, -2016.837, 5494.008, 3.808645, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1358, 181016, 530, 1, 1, -2145.284, 5497.773, 51.2669, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1359, 181016, 530, 1, 1, -2176.784, 5413.221, 50.22791, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3898)
+(@OGUID+1360, 181016, 530, 1, 1, -2167.578, 5441.844, 51.2669, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3898)
+(@OGUID+1361, 181016, 530, 1, 1, -2185.163, 5454.922, 51.2669, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1362, 181016, 530, 1, 1, -1802.705, 5597.75, 130.8119, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1363, 181016, 530, 1, 1, -1811.717, 5600.768, 130.8119, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1364, 181016, 530, 1, 1, -1798.486, 5585.74, 3.878141, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1365, 181016, 530, 1, 1, -1822.766, 5593.826, 3.894919, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1366, 181016, 530, 1, 1, -1791.788, 5726.31, 129.1411, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1367, 181016, 530, 1, 1, -1780.283, 5739.229, 128.7909, 5.061456, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1368, 181016, 530, 1, 1, -1745.379, 5726.958, 128.7801, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1369, 181016, 530, 1, 1, -1743.729, 5710.51, 129.1411, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1370, 181016, 530, 1, 1, -1864.92, 5715.607, 132.2513, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1371, 181016, 530, 1, 1, -1844.504, 5746.667, 130.7976, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1372, 181016, 530, 1, 1, -1886.932, 5771.139, 129.5579, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1373, 181016, 530, 1, 1, -1846.261, 5773.022, 131.2068, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1374, 181016, 530, 1, 1, -1917.616, 5746.094, 131.1787, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1375, 181016, 530, 1, 1, -1893.715, 5757.046, 129.482, 0.3665176, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1376, 181016, 530, 1, 1, -1888.447, 5716.592, 132.1732, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1377, 181016, 530, 1, 1, -1904.28, 5729.601, 131.1909, 1.029743, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1378, 181016, 530, 1, 1, -1993.964, 5686.367, 117.6628, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1379, 181016, 530, 1, 1, -1990.117, 5678.112, 117.6628, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1380, 181016, 530, 1, 1, -2545.219, 4312.679, 20.62585, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1381, 181016, 530, 1, 1, -2558.318, 4305.626, 20.76239, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1382, 181016, 530, 1, 1, -2623.644, 4378.721, 35.27359, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1383, 181016, 530, 1, 1, -2611.685, 4383.334, 32.93204, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1384, 181016, 530, 1, 1, -2569.438, 4420.438, 39.15441, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3683)
+(@OGUID+1385, 181016, 530, 1, 1, -2617.922, 4427.623, 36.09334, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3683)
+(@OGUID+1386, 181016, 530, 1, 1, -2631.962, 4428.709, 36.10242, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3683)
+(@OGUID+1387, 181016, 530, 1, 1, -2614.487, 4456.502, 36.09352, 5.009095, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3683)
+(@OGUID+1388, 181016, 530, 1, 1, -2624.518, 4467.333, 36.14123, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3683)
+(@OGUID+1389, 181016, 530, 1, 1, -2666.818, 4443.57, 36.34382, 5.166176, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3683)
+(@OGUID+1390, 181016, 530, 1, 1, -2667.306, 4424.93, 37.06041, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3683)
+(@OGUID+1391, 181016, 530, 1, 1, -2966.667, 4073.203, 2.960989, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3684)
+(@OGUID+1392, 181016, 530, 1, 1, -2924.175, 4014.802, 0.424108, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3684)
+(@OGUID+1393, 181016, 530, 1, 1, -2904.558, 4017.979, 0.378337, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3684)
+(@OGUID+1394, 181016, 530, 1, 1, -2926.811, 4019.083, 0.413682, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3684)
+(@OGUID+1395, 181016, 530, 1, 1, -2942.975, 3949.947, 0.906697, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3684)
+(@OGUID+1396, 181016, 530, 1, 1, -2987.699, 3860.738, 8.660349, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3684)
+(@OGUID+1397, 181016, 530, 1, 1, -2956.34, 3907.056, 3.423482, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3684)
+(@OGUID+1398, 181016, 530, 1, 1, -2943.432, 3903.176, 3.423485, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3684)
+(@OGUID+1399, 181016, 530, 1, 1, -2975.988, 3877.033, 9.545059, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3684)
+(@OGUID+1400, 181016, 530, 1, 1, -3031.269, 2631.006, 76.54335, 4.485497, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1401, 181016, 530, 1, 1, -3081.042, 2598.579, 61.74963, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1402, 181016, 530, 1, 1, -2932.842, 2657.233, 94.24632, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1403, 181016, 530, 1, 1, -3065.579, 2555.547, 65.75816, 3.752462, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1404, 181016, 530, 1, 1, -3104.677, 2582.695, 61.977, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1405, 181016, 530, 1, 1, -3107.003, 2545.114, 62.05597, 1.029743, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1406, 181016, 530, 1, 1, -3006.598, 2549.313, 78.11643, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1407, 181016, 530, 1, 1, -3052.811, 2481.651, 66.65688, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1408, 181016, 530, 1, 1, -2979.335, 2554.049, 76.54335, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1409, 181016, 530, 1, 1, -2986.574, 2565.178, 76.54335, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1410, 181016, 530, 1, 1, -2956.544, 2554.592, 126.6191, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1411, 181016, 530, 1, 1, -2970.731, 2573.003, 76.54335, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1412, 181016, 530, 1, 1, -2921.617, 2644.625, 94.40192, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3744)
+(@OGUID+1413, 181016, 530, 1, 1, -3930.809, 2115.148, 96.81004, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3745)
+(@OGUID+1414, 181016, 530, 1, 1, -3984.704, 2162.162, 105.4418, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3745)
+(@OGUID+1415, 181016, 530, 1, 1, -3948.719, 2165.375, 100.8409, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3745)
+(@OGUID+1416, 181016, 530, 1, 1, -3981.395, 2150.587, 105.0282, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3745)
+(@OGUID+1417, 181016, 530, 1, 1, -3966.465, 2185.426, 101.8951, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3745)
+(@OGUID+1418, 181016, 530, 1, 1, -4008.345, 2172.325, 105.0965, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3745)
+(@OGUID+1419, 181016, 530, 1, 1, -4026.63, 2188.58, 109.1173, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3745)
+(@OGUID+1420, 181016, 530, 1, 1, -4035.944, 2238.973, 112.2723, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3745)
+(@OGUID+1421, 181016, 530, 1, 1, -4047.156, 2228.053, 112.0462, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3745)
+(@OGUID+1422, 181016, 530, 1, 1, -4062.359, 2190.83, 109.8543, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3745)
+(@OGUID+1423, 181016, 530, 1, 1, -4130.572, 1173.389, 49.58154, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3929)
+(@OGUID+1424, 181016, 530, 1, 1, -4084.195, 1138.926, 44.43298, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3929)
+(@OGUID+1425, 181016, 530, 1, 1, -4065.08, 1138.295, 43.1756, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3929)
+(@OGUID+1426, 181016, 530, 1, 1, -4088.488, 1139.846, 44.42666, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3929)
+(@OGUID+1427, 181016, 530, 1, 1, -4135.374, 1128.675, 54.58289, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3929)
+(@OGUID+1428, 181016, 530, 1, 1, -4112.096, 1121.578, 44.54679, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3929)
+(@OGUID+1429, 181016, 530, 1, 1, -4062.444, 1135.474, 43.18277, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3929)
+(@OGUID+1430, 181016, 530, 1, 1, -4114.819, 1116.677, 44.53127, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3929)
+(@OGUID+1431, 181016, 530, 1, 1, -3080.772, 825.7006, -11.35703, 1.029743, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1432, 181016, 530, 1, 1, -3055.614, 812.4755, -9.506436, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1433, 181016, 530, 1, 1, -3075.424, 858.7751, -20.02081, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1434, 181016, 530, 1, 1, -3079.415, 748.1234, -10.33996, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1435, 181016, 530, 1, 1, -3089.802, 837.7723, -19.92381, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1436, 181016, 530, 1, 1, -3061.827, 853.1981, -11.37245, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1437, 181016, 530, 1, 1, -3040.775, 806.6836, -9.706291, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3754)
+(@OGUID+1438, 181016, 530, 1, 1, -3012.275, 861.4301, -10.48986, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3754)
+(@OGUID+1439, 181016, 530, 1, 1, -3007.626, 853.5888, -10.48604, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3754)
+(@OGUID+1440, 181016, 530, 1, 1, -3016.658, 795.0476, -9.916844, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3754)
+(@OGUID+1441, 181016, 530, 1, 1, -3028.215, 823.3273, -9.546359, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3754)
+(@OGUID+1442, 181016, 530, 1, 1, -3009.987, 803.8392, -10.3957, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3754)
+(@OGUID+1443, 181016, 530, 1, 1, -3041.075, 832.1203, -9.484895, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3754)
+(@OGUID+1444, 181016, 530, 1, 1, -2983.705, 809.1548, -6.9079, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3754)
+(@OGUID+1445, 181016, 530, 1, 1, -3010.563, 770.086, -6.933084, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3754)
+(@OGUID+1446, 181016, 530, 1, 1, -2983.507, 869.4686, -7.479865, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3754)
+(@OGUID+1447, 181016, 530, 1, 1, -717.8087, 2647.749, 93.05632, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1448, 181016, 530, 1, 1, -720.9301, 2658.757, 93.7806, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1449, 181016, 530, 1, 1, -695.8323, 2638.751, 90.97626, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1450, 181016, 530, 1, 1, -708.6624, 2640.041, 91.84985, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1451, 181016, 530, 1, 1, -702.0106, 2676.552, 93.48396, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1452, 181016, 530, 1, 1, -714.3968, 2671.541, 93.92791, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1453, 181016, 530, 1, 1, -690.535, 2673.585, 92.20389, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1454, 181016, 530, 1, 1, -684.1902, 2664.04, 90.97864, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1455, 181016, 530, 1, 1, -685.2488, 2644.338, 90.4667, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1456, 181016, 530, 1, 1, -681.7703, 2653.848, 90.5937, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1457, 181016, 530, 1, 1, -699.3879, 2717.673, 94.73693, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3538)
+(@OGUID+1458, 181016, 530, 1, 1, 41.7532, 2675.019, 78.98357, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1459, 181016, 530, 1, 1, 49.26655, 2658.362, 78.4103, 0.4712385, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1460, 181016, 530, 1, 1, 168.2221, 2632.726, 86.68047, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1461, 181016, 530, 1, 1, 177.3938, 2641.12, 87.18604, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1462, 181016, 530, 1, 1, 184.4233, 2683.703, 88.28799, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1463, 181016, 530, 1, 1, 182.2488, 2695.313, 88.79645, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1464, 181016, 530, 1, 1, 202.2809, 2606.497, 87.28353, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1465, 181016, 530, 1, 1, 193.15, 2600.053, 87.28353, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1466, 181016, 530, 1, 1, 293.5556, 2757.308, 85.24716, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1467, 181016, 530, 1, 1, 277.2957, 2769.554, 84.67036, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1468, 181016, 530, 1, 1, 123.4488, 2766.59, 102.234, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1469, 181016, 530, 1, 1, 211.9928, 2818.017, 129.8682, 2.91469, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1470, 181016, 530, 1, 1, 215.5181, 2828.05, 130.0014, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1471, 181016, 530, 1, 1, 223.0891, 2810.249, 129.6152, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3536)
+(@OGUID+1472, 181016, 530, 1, 1, 140.73, 4269.448, 107.4208, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1473, 181016, 530, 1, 1, 82.60951, 4318.784, 102.0311, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1474, 181016, 530, 1, 1, 147.9486, 4275.235, 107.2797, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1475, 181016, 530, 1, 1, 136.032, 4345.664, 106.6182, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3552)
+(@OGUID+1476, 181016, 530, 1, 1, 152.2135, 4318.471, 106.2541, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3552)
+(@OGUID+1477, 181016, 530, 1, 1, 80.49339, 4347.601, 102.071, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3552)
+(@OGUID+1478, 181016, 530, 1, 1, 134.9947, 4319.371, 106.7541, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3552)
+(@OGUID+1479, 181016, 530, 1, 1, 151.8665, 4348.405, 107.2158, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3552)
+(@OGUID+1480, 181016, 530, 1, 1, 181.2025, 4317.459, 119.9638, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3552)
+(@OGUID+1481, 181016, 530, 1, 1, 181.4662, 4350.056, 119.962, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3552)
+(@OGUID+1482, 181016, 530, 1, 1, 196.4538, 4339.529, 116.9748, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3552)
+(@OGUID+1483, 181016, 530, 1, 1, 196.2876, 4328.141, 116.8841, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3552)
+(@OGUID+1484, 181016, 530, 1, 1, -208.6328, 5388.645, 22.92735, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3521)
+(@OGUID+1485, 181016, 530, 1, 1, -236.2242, 5387.014, 24.6395, 5.410522, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3521)
+(@OGUID+1486, 181016, 530, 1, 1, -210.9873, 5433.489, 21.37882, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3521)
+(@OGUID+1487, 181016, 530, 1, 1, -212.93, 5473.045, 22.87997, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1488, 181016, 530, 1, 1, -324.4565, 5466.785, 22.66969, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1489, 181016, 530, 1, 1, -306.1548, 5479.317, 22.28877, 2.35619, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1490, 181016, 530, 1, 1, -253.026, 5481.032, 24.94352, 5.480334, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1491, 181016, 530, 1, 1, -344.9888, 5492.374, 22.00702, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1492, 181016, 530, 1, 1, -196.088, 5525.092, 22.81344, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1493, 181016, 530, 1, 1, -213.9051, 5547.442, 24.07233, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1494, 181016, 530, 1, 1, -192.6228, 5531.502, 29.45192, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1495, 181016, 530, 1, 1, -184.6291, 5506.406, 29.47097, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1496, 181016, 530, 1, 1, -192.4105, 5510.174, 22.67085, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1497, 181016, 530, 1, 1, -87.59586, 5535.549, 22.80703, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1498, 181016, 530, 1, 1, -87.05946, 5555.918, 22.68842, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1499, 181016, 530, 1, 1, -149.7903, 5567.248, 23.00511, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1500, 181016, 530, 1, 1, -145.6747, 5545.872, 22.66767, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3565)
+(@OGUID+1501, 181016, 530, 1, 1, 278.5881, 5966.778, 150.1677, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1502, 181016, 530, 1, 1, 272.3167, 5944.75, 26.52184, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1503, 181016, 530, 1, 1, 298.2953, 5957.52, 26.42815, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1504, 181016, 530, 1, 1, 269.9623, 5956.735, 26.43292, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1505, 181016, 530, 1, 1, 296.5285, 5941.624, 26.55748, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1506, 181016, 530, 1, 1, 280.785, 6008.137, 144.7295, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1507, 181016, 530, 1, 1, 261.4174, 5980.111, 132.9563, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1508, 181016, 530, 1, 1, 301.7136, 5979.073, 132.4598, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1509, 181016, 530, 1, 1, 222.1361, 6049.518, 148.3132, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3644)
+(@OGUID+1510, 181016, 530, 1, 1, 307.1656, 6055.835, 131.5718, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3644)
+(@OGUID+1511, 181016, 530, 1, 1, 208.3886, 6049.729, 148.32, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3644)
+(@OGUID+1512, 181016, 530, 1, 1, 290.4184, 6083.181, 131.5468, 4.590216, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3644)
+(@OGUID+1513, 181016, 530, 1, 1, 227.5588, 6070.599, 148.3118, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3644)
+(@OGUID+1514, 181016, 530, 1, 1, 275.337, 6082.517, 131.545, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3644)
+(@OGUID+1515, 181016, 530, 1, 1, 217.2829, 6078.526, 148.3125, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3644)
+(@OGUID+1516, 181016, 530, 1, 1, 276.2028, 6122.649, 142.509, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1517, 181016, 530, 1, 1, 210.443, 7810.77, 23.8272, 1.099556, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1518, 181016, 530, 1, 1, 229.981, 7821.426, 21.9932, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1519, 181016, 530, 1, 1, 253.7596, 7836.7, 22.96672, 5.078908, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1520, 181016, 530, 1, 1, 293.3064, 7831.16, 24.93296, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1521, 181016, 530, 1, 1, 287.7669, 7842.643, 22.58914, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1522, 181016, 530, 1, 1, 238.5979, 7893.07, 21.80824, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3645)
+(@OGUID+1523, 181016, 530, 1, 1, 334.9908, 7839.56, 22.29418, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3645)
+(@OGUID+1524, 181016, 530, 1, 1, 250.3989, 7896.925, 21.68546, 4.590216, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3645)
+(@OGUID+1525, 181016, 530, 1, 1, 261.7739, 7872.234, 23.73318, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3645)
+(@OGUID+1526, 181016, 530, 1, 1, 210.8226, 7926.406, 25.6933, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3645)
+(@OGUID+1527, 181016, 530, 1, 1, 247.4571, 7941.143, 25.69258, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3645)
+(@OGUID+1528, 181016, 530, 1, 1, 285.1593, 7952.144, 21.52511, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3645)
+(@OGUID+1529, 181016, 530, 1, 1, 276.1272, 7957.609, 21.57661, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3645)
+(@OGUID+1530, 181016, 530, 1, 1, 201.9845, 8489.734, 24.44587, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3656)
+(@OGUID+1531, 181016, 530, 1, 1, 253.3038, 8489.067, 23.37944, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3656)
+(@OGUID+1532, 181016, 530, 1, 1, 265.287, 8514.346, 23.52993, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3656)
+(@OGUID+1533, 181016, 530, 1, 1, 223.5183, 8562.453, 23.26412, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3649)
+(@OGUID+1534, 181016, 530, 1, 1, -1207.967, 7386.663, 31.42567, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1535, 181016, 530, 1, 1, -1220.264, 7388.16, 30.78928, 0.6108634, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1536, 181016, 530, 1, 1, -1265.508, 7313.129, 34.21532, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1537, 181016, 530, 1, 1, -1184.679, 7246.92, 35.14313, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1538, 181016, 530, 1, 1, -1198.807, 7250.11, 35.15434, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1539, 181016, 530, 1, 1, -1273.831, 7316.673, 33.7791, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1540, 181016, 530, 1, 1, -1221.305, 7222.463, 59.25886, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1541, 181016, 530, 1, 1, -1176.216, 7200.084, 58.21382, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1542, 181016, 530, 1, 1, -1184.833, 7207.807, 57.92133, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1543, 181016, 530, 1, 1, -1201.722, 7206.649, 58.55188, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1544, 181016, 530, 1, 1, -1296.44, 7267.444, 34.61653, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1545, 181016, 530, 1, 1, -1302.753, 7271.99, 34.41439, 4.101525, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1546, 181016, 530, 1, 1, -1271.883, 7197.997, 57.89819, 2.35619, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1547, 181016, 530, 1, 1, -1282.837, 7187.43, 58.00641, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1548, 181016, 530, 1, 1, -1249.806, 7217.763, 58.32962, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1549, 181016, 530, 1, 1, -1454.16, 7165.046, 44.56573, 5.166176, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1550, 181016, 530, 1, 1, -1387.221, 7134.828, 34.03579, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1551, 181016, 530, 1, 1, -1392.476, 7140.168, 33.73893, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1552, 181016, 530, 1, 1, -1371.671, 7162.804, 33.254, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1553, 181016, 530, 1, 1, -1364.813, 7156.565, 34.00505, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1554, 181016, 530, 1, 1, -1283.426, 7130.822, 59.73568, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1555, 181016, 530, 1, 1, -1254.381, 7007.266, 36.623, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1556, 181016, 530, 1, 1, -1296.558, 6953.973, 33.24513, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1557, 181016, 530, 1, 1, -1307.797, 6960.474, 32.26982, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1558, 181016, 530, 1, 1, -1241.754, 7003.594, 36.79386, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1559, 181016, 530, 1, 1, -1262.076, 7107.592, 58.88747, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1560, 181016, 530, 1, 1, -1209.608, 7103.708, 57.44921, 5.410522, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1561, 181016, 530, 1, 1, -1194.752, 7110.279, 58.0645, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1562, 181016, 530, 1, 1, -1247.801, 7101.981, 58.06834, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1563, 181016, 530, 1, 1, -1173.556, 7134.231, 58.11499, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3613)
+(@OGUID+1564, 181016, 530, 1, 1, -2571.461, 7378.03, 11.05957, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1565, 181016, 530, 1, 1, -2561.666, 7378.96, 10.5709, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1566, 181016, 530, 1, 1, -2573.72, 7300.305, 13.90452, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1567, 181016, 530, 1, 1, -2602.271, 7282.346, 19.39945, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1568, 181016, 530, 1, 1, -2528.435, 7266.286, 16.27025, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1569, 181016, 530, 1, 1, -2611.334, 7343.457, 23.60636, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1570, 181016, 530, 1, 1, -2605.266, 7291.263, 19.8158, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1571, 181016, 530, 1, 1, -2624.408, 7331.686, 24.46344, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1572, 181016, 530, 1, 1, -2534.468, 7256.75, 16.26636, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1573, 181016, 530, 1, 1, -2614.572, 7330.876, 24.21089, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1574, 181016, 530, 1, 1, -2570.705, 7291.29, 14.81433, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1575, 181016, 530, 1, 1, -2618.061, 7338.908, 23.65936, 4.956738, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1576, 181016, 530, 1, 1, -2614.92, 7297.726, 20.7448, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1577, 181016, 530, 1, 1, -2625.71, 7298.209, 21.14083, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1578, 181016, 530, 1, 1, -2720.994, 7355.896, 39.75894, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1579, 181016, 530, 1, 1, -2596.802, 7228.939, 13.47051, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1580, 181016, 530, 1, 1, -2697.95, 7284.061, 42.72089, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1581, 181016, 530, 1, 1, -2692.656, 7296.979, 42.78501, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1582, 181016, 530, 1, 1, -2600.806, 7237.711, 12.91722, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1583, 181016, 530, 1, 1, -2630.099, 7224.425, 19.74051, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1584, 181016, 530, 1, 1, -2702.841, 7293.721, 88.63655, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1585, 181016, 530, 1, 1, -2626.202, 7216.55, 20.35766, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1586, 181016, 530, 1, 1, -2670.031, 7211.863, 23.66941, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1587, 181016, 530, 1, 1, -2678.989, 7214.03, 23.95701, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1588, 181016, 530, 1, 1, -2721.762, 7343.454, 39.44633, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1589, 181016, 530, 1, 1, -2755.534, 7275.691, 40.27126, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1590, 181016, 530, 1, 1, -2752.121, 7315.08, 43.48479, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1591, 181016, 530, 1, 1, -2762.166, 7267.401, 40.26734, 5.724681, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1592, 181016, 530, 1, 1, -2755.324, 7317.081, 56.35859, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3626)
+(@OGUID+1593, 181016, 530, 1, 1, 937.6202, 7360.125, 26.74729, 1.378809, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1594, 181016, 530, 1, 1, 1006.334, 7322.549, 41.04741, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1595, 181016, 530, 1, 1, 957.7293, 7355.671, 29.15186, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1596, 181016, 530, 1, 1, 993.2974, 7345.906, 35.77085, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1597, 181016, 530, 1, 1, 964.8279, 7387.548, 28.52687, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1598, 181016, 530, 1, 1, 945.5008, 7392.224, 26.72158, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1599, 181016, 530, 1, 1, 1033.736, 7322.608, 40.50263, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1600, 181016, 530, 1, 1, 971.3665, 7408.698, 29.54321, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3766)
+(@OGUID+1601, 181016, 530, 1, 1, 1003.335, 7429.998, 28.07676, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3766)
+(@OGUID+1602, 181016, 530, 1, 1, 1052.856, 7384.014, 39.65503, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3766)
+(@OGUID+1603, 181016, 530, 1, 1, 1058.58, 7386.76, 39.58334, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3766)
+(@OGUID+1604, 181016, 530, 1, 1, 1036.931, 7385.866, 40.72616, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3766)
+(@OGUID+1605, 181016, 530, 1, 1, 1021.34, 7392.521, 36.32355, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3766)
+(@OGUID+1606, 181016, 530, 1, 1, 1072.741, 7372.522, 39.58335, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3766)
+(@OGUID+1607, 181016, 530, 1, 1, 1069.436, 7366.63, 39.64074, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3766)
+(@OGUID+1608, 181016, 530, 1, 1, 1042.453, 7348.262, 36.65906, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3766)
+(@OGUID+1609, 181016, 530, 1, 1, 1068.558, 7349.528, 40.72983, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3766)
+(@OGUID+1610, 181016, 530, 1, 1, 2007.013, 6878.822, 178.9834, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3772)
+(@OGUID+1611, 181016, 530, 1, 1, 2017.319, 6873.481, 178.983, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3772)
+(@OGUID+1612, 181016, 530, 1, 1, 2161.682, 6783.048, 183.4536, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3772)
+(@OGUID+1613, 181016, 530, 1, 1, 2950.829, 5486.531, 144.1427, 5.497789, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3951)
+(@OGUID+1614, 181016, 530, 1, 1, 2969.01, 5459.725, 144.6972, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3951)
+(@OGUID+1615, 181016, 530, 1, 1, 3011.185, 5493.75, 145.0009, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3951)
+(@OGUID+1616, 181016, 530, 1, 1, 2087.611, 4782.989, 157.7814, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3827)
+(@OGUID+1617, 181016, 530, 1, 1, 2019.061, 4700.482, 150.2378, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3844)
+(@OGUID+1618, 181016, 530, 1, 1, 2945.531, 3714.857, 143.1773, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1619, 181016, 530, 1, 1, 3014.989, 3753.323, 144.3842, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1620, 181016, 530, 1, 1, 2984.193, 3711.066, 142.8784, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1621, 181016, 530, 1, 1, 3025.728, 3750.257, 144.7281, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1622, 181016, 530, 1, 1, 2946.058, 3725.089, 143.1839, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1623, 181016, 530, 1, 1, 3004.393, 3656.724, 143.8046, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1624, 181016, 530, 1, 1, 3058.527, 3663.685, 143.0369, 2.042035, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1625, 181016, 530, 1, 1, 2972.385, 3659.229, 144.8418, 0, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1626, 181016, 530, 1, 1, 2972.166, 3648.618, 144.8469, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1627, 181016, 530, 1, 1, 2947.035, 3659.529, 132.5782, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1628, 181016, 530, 1, 1, 2947.682, 3649.331, 132.5782, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1629, 181016, 530, 1, 1, 3003.333, 3637.782, 143.8042, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1630, 181016, 530, 1, 1, 3037.129, 3606.581, 144.4336, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1631, 181016, 530, 1, 1, 3115.857, 3694.574, 144.0382, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1632, 181016, 530, 1, 1, 3120.857, 3684.906, 143.2626, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3712)
+(@OGUID+1633, 181016, 530, 1, 1, 4083.412, 3091.455, 339.3883, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1634, 181016, 530, 1, 1, 4082.152, 3077.441, 339.3883, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1635, 181016, 530, 1, 1, 4122.787, 2967.157, 352.2287, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1636, 181016, 530, 1, 1, 4092.646, 3104.921, 339.3883, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1637, 181016, 530, 1, 1, 4087.922, 3100.24, 339.3883, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1638, 181016, 530, 1, 1, 4099.208, 3107.681, 339.3884, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1639, 181016, 530, 1, 1, 4114.772, 2967.272, 352.1837, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1640, 181016, 530, 1, 1, 4113.936, 3050.741, 339.3003, 5.899214, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1641, 181016, 530, 1, 1, 4123.493, 3055.268, 339.3098, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1642, 181016, 530, 1, 1, 4105.933, 3108.072, 339.3884, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1643, 181016, 530, 1, 1, 4114.827, 3105.379, 339.3884, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1644, 181016, 530, 1, 1, 4126.727, 3096.481, 339.3884, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1645, 181016, 530, 1, 1, 4177.695, 3093.462, 335.8202, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1646, 181016, 530, 1, 1, 4200.194, 3075.751, 335.8202, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1647, 181016, 530, 1, 1, 4177.452, 3004.381, 339.1197, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1648, 181016, 530, 1, 1, 4178.088, 3015.381, 339.1293, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3738)
+(@OGUID+1649, 181016, 530, 1, 1, 9987.122, -7093.597, 47.70498, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3487)
+(@OGUID+1650, 181016, 530, 1, 1, 9982.972, -7098.827, 47.70499, 6.056293, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3487)
+(@OGUID+1651, 181016, 0, 1, 1, -4618.024, -925.1197, 501.0621, 0.7853968, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5344)
+(@OGUID+1652, 181016, 0, 1, 1, -4623.986, -917.6334, 501.063, 0.6981314, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5344)
+(@OGUID+1653, 181016, 0, 1, 1, -8657.15, 500.306, 101.605, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5390)
+(@OGUID+1654, 181016, 0, 1, 1, -8673.01, 442.396, 100.031, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5390)
+(@OGUID+1655, 181016, 0, 1, 1, -8711.88, 463.47, 97.4507, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5390)
+(@OGUID+1656, 181016, 0, 1, 1, -8746.15, 410.78, 98.2072, 6.056293, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5149)
+(@OGUID+1657, 181016, 0, 1, 1, -9021.94, 883.635, 29.6565, 5.864307, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5154)
+(@OGUID+1658, 181016, 0, 1, 1, -9013.6, 889.642, 29.6736, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5154)
+(@OGUID+1659, 181016, 0, 1, 1, -9010.44, 847.085, 105.864, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5154)
+(@OGUID+1660, 181016, 0, 1, 1, -9004.8, 854.139, 105.594, 5.218536, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5154)
+(@OGUID+1661, 181016, 0, 1, 1, -8984.32, 852.349, 29.6207, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5154)
+(@OGUID+1662, 181016, 0, 1, 1, -8992.8, 846.523, 29.6207, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5154)
+(@OGUID+1663, 181016, 0, 1, 1, -8611.958, 774.5919, 97.13689, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5390)
+(@OGUID+1664, 181016, 0, 1, 1, -8621.187, 786.2004, 97.13911, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5390)
+(@OGUID+1665, 181016, 0, 1, 1, -8586.704, 962.4266, 98.45146, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5151)
+(@OGUID+1666, 181016, 0, 1, 1, -8605.82, 983.8307, 98.57872, 4.834563, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5151)
+(@OGUID+1667, 181016, 0, 1, 1, -8548.039, 997.2659, 89.73065, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5151)
+(@OGUID+1668, 181016, 0, 1, 1, -8412.685, 1042.276, 68.38379, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 5346)
+(@OGUID+1669, 181016, 0, 1, 1, -8562.563, 1016.086, 89.73065, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1670, 181016, 0, 1, 1, -8350.607, 1093.494, 57.26217, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1671, 181016, 0, 1, 1, -8336.738, 1109.575, 57.26216, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1672, 181016, 0, 1, 1, -8451.66, 1220.867, 5.646727, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4411)
+(@OGUID+1673, 181016, 0, 1, 1, -8439.422, 1221.072, 5.661162, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4411)
+(@OGUID+1674, 181016, 0, 1, 1, -8328.427, 1192.425, 5.818892, 1.832595, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4411)
+(@OGUID+1675, 181016, 0, 1, 1, -8396.861, 1314.031, 5.981066, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4411)
+(@OGUID+1676, 181016, 0, 1, 1, -8367.763, 1314.994, 6.094531, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4411)
+(@OGUID+1677, 181016, 0, 1, 1, -8232.368, 1236.465, 5.230234, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4411)
+(@OGUID+1678, 181016, 0, 1, 1, -8489.128, 1323.822, 5.894643, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4411)
+(@OGUID+1679, 181016, 0, 1, 1, -8459.286, 1323.448, 5.861743, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 4411)
+(@OGUID+1680, 181016, 530, 1, 1, -4025.329, -11590.4, -138.3277, 1.762782, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1681, 181016, 530, 1, 1, -4040.372, -11581.41, -138.4519, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1682, 181016, 530, 1, 1, -4006.567, -11572.73, -138.0419, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1683, 181016, 530, 1, 1, -4214.633, -12476, 45.07409, 5.497789, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1684, 181016, 530, 1, 1, -4212.527, -12510.34, 45.44406, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1685, 181016, 530, 1, 1, -4209.379, -12517.65, 45.81722, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 0)
+(@OGUID+1686, 181016, 530, 1, 1, -4185.712, -12504.83, 44.36132, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3576)
+(@OGUID+1687, 181016, 530, 1, 1, -4176.958, -12493.97, 44.361, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3576)
+(@OGUID+1688, 181016, 530, 1, 1, -4171.624, -12506.62, 44.36132, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3576)
+(@OGUID+1689, 181016, 530, 1, 1, -4158.644, -12533.33, 45.45204, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3576)
+(@OGUID+1690, 181016, 530, 1, 1, -4158.139, -12463.08, 45.08138, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3576)
+(@OGUID+1691, 181016, 530, 1, 1, -4153.742, -12484.6, 44.51342, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3576)
+(@OGUID+1692, 181016, 530, 1, 1, -4048.503, -13778.93, 75.01585, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181016 (Area: 3527)
+(@OGUID+1693, 181015, 530, 1, 1, -1742.215, 5135.275, -36.2613, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 3899)
+(@OGUID+1694, 181015, 530, 1, 1, -1757.831, 5131.28, -36.26131, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 3899)
+(@OGUID+1695, 181015, 530, 1, 1, -2037.28, 5275.622, -39.58699, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1696, 181015, 530, 1, 1, -2059.588, 5316.215, -37.32355, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 3899)
+(@OGUID+1697, 181015, 530, 1, 1, 9612.646, -7184.878, 14.28442, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 3487)
+(@OGUID+1698, 181015, 530, 1, 1, 9611.202, -7185.08, 14.28158, 0, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 3487)
+(@OGUID+1699, 181015, 530, 1, 1, 9610.517, -7182.689, 14.28269, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 3487)
+(@OGUID+1700, 181015, 530, 1, 1, 9612.523, -7182.323, 14.28678, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 3487)
+(@OGUID+1701, 181015, 530, 1, 1, 9611.927, -7184.979, 15.52289, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 3487)
+(@OGUID+1702, 181015, 0, 1, 1, -4916.252, -984.5313, 501.4471, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5342)
+(@OGUID+1703, 181015, 0, 1, 1, -4917.014, -984.7448, 502.6873, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5342)
+(@OGUID+1704, 181015, 0, 1, 1, -4918.153, -982.1979, 501.4553, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5342)
+(@OGUID+1705, 181015, 0, 1, 1, -4917.79, -985.2344, 501.4486, 0, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5342)
+(@OGUID+1706, 181015, 0, 1, 1, -4919.722, -983.6129, 501.4555, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5342)
+(@OGUID+1707, 181015, 0, 1, 1, -8867.429, 637.0868, 95.78714, 0.6981314, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5148)
+(@OGUID+1708, 181015, 0, 1, 1, -8868.944, 638.5764, 95.78714, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5148)
+(@OGUID+1709, 181015, 0, 1, 1, -8870.591, 636.8524, 95.78714, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5148)
+(@OGUID+1710, 181015, 0, 1, 1, -8869.873, 636.4618, 97.00977, 0, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5148)
+(@OGUID+1711, 181015, 0, 1, 1, -8869.328, 635.8524, 95.78714, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5148)
+(@OGUID+1712, 181015, 0, 1, 1, -8973.23, 491.104, 97.0423, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5148)
+(@OGUID+1713, 181015, 0, 1, 1, -8987.81, 509.179, 97.0711, 5.480334, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 5148)
+(@OGUID+1714, 181015, 1, 1, 1, 9871.61, 2494.44, 1315.87, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1715, 181015, 1, 1, 1, 9868.24, 2493.52, 1315.87, 0, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1716, 181015, 1, 1, 1, 9868.4, 2494.36, 1317.11, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1717, 181015, 1, 1, 1, 9868.74, 2495.04, 1315.87, 5.916668, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1718, 181015, 1, 1, 1, 9870.92, 2492.5, 1315.87, 5.916668, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1719, 181015, 530, 1, 1, -4004.693, -11842.24, 0.201654, 0, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1720, 181015, 530, 1, 1, -4004.752, -11845.42, 0.192709, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1721, 181015, 530, 1, 1, -4006.262, -11842.13, 0.18635, 4.153885, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1722, 181015, 530, 1, 1, -4005.507, -11842.26, 1.427111, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1723, 181015, 530, 1, 1, -4006.776, -11844.98, 0.173841, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181015 (Area: 0)
+(@OGUID+1724, 181014, 571, 1, 1, 5353.096, -2653.161, 310.5197, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 181014 (Area: 0)
+(@OGUID+1725, 181014, 571, 1, 1, 5391.959, -2692.568, 310.2863, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181014 (Area: 0)
+(@OGUID+1726, 181014, 571, 1, 1, 3802.911, 1477.594, 94.39955, 3.263772, 0, 0, 0, 1, 120, 255, 1), -- 181014 (Area: 4165)
+(@OGUID+1727, 181014, 571, 1, 1, 3771.654, 1596.684, 107.9985, 5.009095, 0, 0, 0, 1, 120, 255, 1), -- 181014 (Area: 4165)
+(@OGUID+1728, 181014, 571, 1, 1, 3787.579, 1624.979, 107.0998, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181014 (Area: 4165)
+(@OGUID+1729, 181014, 571, 1, 1, 2754.732, 6279.374, 181.2734, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181014 (Area: 4129)
+(@OGUID+1730, 181014, 530, 1, 1, -2054.687, 5229.547, -21.3585, 0.7679439, 0, 0, 0, 1, 120, 255, 1), -- 181014 (Area: 0)
+(@OGUID+1731, 181014, 530, 1, 1, 9698.271, -7053.018, 22.76448, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181014 (Area: 3487)
+(@OGUID+1732, 181060, 571, 1, 1, 6676.038, -197.873, 951.159, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4428)
+(@OGUID+1733, 181060, 571, 1, 1, 6676.64, -200.5191, 951.2183, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4428)
+(@OGUID+1734, 181060, 571, 1, 1, 6692.196, -262.1433, 956.036, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4428)
+(@OGUID+1735, 181060, 571, 1, 1, 6693.974, -261.8266, 956.4064, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4428)
+(@OGUID+1736, 181060, 571, 1, 1, 5173.95, -2179.033, 236.5379, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1737, 181060, 571, 1, 1, 5148.001, -2198.408, 237.614, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1738, 181060, 571, 1, 1, 5190.736, -2212.201, 239.3978, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1739, 181060, 571, 1, 1, 5134.635, -2201.145, 238.8165, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1740, 181060, 571, 1, 1, 5143.447, -2210.877, 237.8243, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1741, 181060, 571, 1, 1, 5380.456, -2636.633, 304.966, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1742, 181060, 571, 1, 1, 5407.522, -2646.742, 305.2902, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1743, 181060, 571, 1, 1, 5407.927, -2617.18, 305.2808, 2.984498, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1744, 181060, 571, 1, 1, 5410.432, -2652.655, 306.231, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1745, 181060, 571, 1, 1, 5465.895, -2590.533, 304.9167, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4275)
+(@OGUID+1746, 181060, 571, 1, 1, 5435.949, -2590.28, 304.9167, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4275)
+(@OGUID+1747, 181060, 571, 1, 1, 5492.635, -2649.156, 305.2701, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4275)
+(@OGUID+1748, 181060, 571, 1, 1, 5492.885, -2617.632, 305.2991, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4275)
+(@OGUID+1749, 181060, 571, 1, 1, 5500.449, -2662.013, 304.9659, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4275)
+(@OGUID+1750, 181060, 571, 1, 1, 5524.156, -2679.053, 305.1702, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4275)
+(@OGUID+1751, 181060, 571, 1, 1, 5759.467, -3565.396, 388.2509, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4324)
+(@OGUID+1752, 181060, 571, 1, 1, 5767.891, -3581.12, 388.5618, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4324)
+(@OGUID+1753, 181060, 571, 1, 1, 5771.673, -3602.202, 388.4206, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4324)
+(@OGUID+1754, 181060, 571, 1, 1, 5768.993, -3564.651, 388.132, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4324)
+(@OGUID+1755, 181060, 571, 1, 1, 5760.941, -3580.523, 388.6815, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4324)
+(@OGUID+1756, 181060, 571, 1, 1, 5800.075, -3557.563, 389.7701, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4323)
+(@OGUID+1757, 181060, 571, 1, 1, 5796.288, -3573.157, 388.1471, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4323)
+(@OGUID+1758, 181060, 571, 1, 1, 5794.419, -3557.554, 388.8964, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4323)
+(@OGUID+1759, 181060, 571, 1, 1, 5801.048, -3572.997, 389.0887, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4323)
+(@OGUID+1760, 181060, 571, 1, 1, 3873.443, -4541.185, 210.1433, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1761, 181060, 571, 1, 1, 3876.738, -4547.531, 210.9673, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1762, 181060, 571, 1, 1, 3862.321, -4549.055, 211.5898, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1763, 181060, 571, 1, 1, 3408.684, -2785.898, 202.9841, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1764, 181060, 571, 1, 1, 3411.444, -2783.841, 202.9332, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1765, 181060, 571, 1, 1, 3421.057, -2770.74, 201.4035, 5.340709, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1766, 181060, 571, 1, 1, 3313.647, -2337.281, 112.4452, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1767, 181060, 571, 1, 1, 3201.634, -2297.767, 109.0517, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4248)
+(@OGUID+1768, 181060, 571, 1, 1, 3240.247, -2236.566, 117.1561, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4206)
+(@OGUID+1769, 181060, 571, 1, 1, 1456.939, -3279.144, 173.5854, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4071)
+(@OGUID+1770, 181060, 571, 1, 1, 1454.438, -3273.762, 173.5819, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4071)
+(@OGUID+1771, 181060, 571, 1, 1, 1458.552, -3277.082, 173.5854, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4071)
+(@OGUID+1772, 181060, 571, 1, 1, 1457.29, -3270.155, 173.5816, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4071)
+(@OGUID+1773, 181060, 571, 1, 1, 1445.745, -3269.811, 179.7056, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4071)
+(@OGUID+1774, 181060, 571, 1, 1, 1447.377, -3267.913, 179.7009, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 4071)
+(@OGUID+1775, 181060, 571, 1, 1, 1445.814, -3264.554, 168.441, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 3998)
+(@OGUID+1776, 181060, 571, 1, 1, 1447.826, -3262.189, 168.441, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 3998)
+(@OGUID+1777, 181060, 571, 1, 1, 606.9359, -4923.435, 24.95922, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1778, 181060, 571, 1, 1, 601.9346, -4924.686, 24.95571, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1779, 181060, 571, 1, 1, 600.7967, -4920.292, 24.95571, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1780, 181060, 571, 1, 1, 607.8849, -4925.905, 24.95922, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181060 (Area: 0)
+(@OGUID+1781, 181055, 1, 1, 1, 7862.05, -2568.29, 499.327, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 656)
+(@OGUID+1782, 181055, 1, 1, 1, 7958.75, -2575.71, 501.371, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 656)
+(@OGUID+1783, 181055, 1, 1, 1, 8013.66, -2637.12, 523.791, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 656)
+(@OGUID+1784, 181055, 1, 1, 1, 7917.81, -2496.79, 496.893, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 656)
+(@OGUID+1785, 181055, 1, 1, 1, 7918.85, -2507.95, 496.78, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 656)
+(@OGUID+1786, 181055, 1, 1, 1, 7916.47, -2485.73, 496.947, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 2361)
+(@OGUID+1787, 181055, 1, 1, 1, 7856.99, -2491.97, 497.065, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 2361)
+(@OGUID+1788, 181055, 1, 1, 1, 7859.37, -2514.28, 496.969, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 2361)
+(@OGUID+1789, 181055, 1, 1, 1, 7857.99, -2503.12, 496.981, 3.228859, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 2361)
+(@OGUID+1790, 181055, 1, 1, 1, 7883.59, -2461.34, 503.191, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 2361)
+(@OGUID+1791, 181055, 1, 1, 1, 7831.7, -2476.79, 502.888, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 2361)
+(@OGUID+1792, 181055, 1, 1, 1, 7830.23, -2446.4, 503.081, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 2361)
+(@OGUID+1793, 181055, 571, 1, 1, 5762.126, 588.5176, 618.8284, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4395)
+(@OGUID+1794, 181055, 571, 1, 1, 5659.443, 679.3284, 661.8507, 5.864307, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4568)
+(@OGUID+1795, 181055, 571, 1, 1, 5948.385, 621.1386, 660.8089, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4613)
+(@OGUID+1796, 181055, 571, 1, 1, 5418.945, -2609.535, 310.7752, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1797, 181055, 571, 1, 1, 5418.217, -2654.892, 310.6752, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1798, 181055, 571, 1, 1, 5427.37, -2617.239, 310.7862, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1799, 181055, 571, 1, 1, 5427.162, -2601.81, 310.7791, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1800, 181055, 571, 1, 1, 5426.538, -2647.546, 310.7589, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1801, 181055, 571, 1, 1, 5435.416, -2610.136, 310.76, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1802, 181055, 571, 1, 1, 5465.976, -2609.939, 310.7266, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4275)
+(@OGUID+1803, 181055, 571, 1, 1, 5472.982, -2649.109, 310.3139, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4275)
+(@OGUID+1804, 181055, 571, 1, 1, 5473.117, -2618.065, 310.7838, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4275)
+(@OGUID+1805, 181055, 571, 1, 1, 5474.365, -2602.701, 310.6908, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4275)
+(@OGUID+1806, 181055, 571, 1, 1, 5482.347, -2610.531, 310.6789, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4275)
+(@OGUID+1807, 181055, 571, 1, 1, 5481.421, -2655.851, 310.4912, 0, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4275)
+(@OGUID+1808, 181055, 571, 1, 1, 5779.607, -3647.157, 397.0788, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4324)
+(@OGUID+1809, 181055, 571, 1, 1, 3415.612, -2804.818, 207.8745, 5.340709, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1810, 181055, 571, 1, 1, 3426.07, -2797.111, 207.806, 5.340709, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1811, 181055, 571, 1, 1, 3404.855, -2779.617, 207.3744, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1812, 181055, 571, 1, 1, 3272.992, -2376.118, 126.1801, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1813, 181055, 571, 1, 1, 3248.334, -2376.13, 125.8163, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1814, 181055, 571, 1, 1, 3220.808, -2360.816, 129.0979, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1815, 181055, 571, 1, 1, 3194.915, -2304.803, 131.4482, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1816, 181055, 571, 1, 1, 3207.483, -2339.074, 129.0386, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1817, 181055, 571, 1, 1, 3313.64, -2339.259, 135.3806, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1818, 181055, 571, 1, 1, 3191.102, -2279.254, 131.5012, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4248)
+(@OGUID+1819, 181055, 571, 1, 1, 3351.668, -2245.885, 137.426, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4206)
+(@OGUID+1820, 181055, 571, 1, 1, 3331.027, -2305.595, 137.5376, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4206)
+(@OGUID+1821, 181055, 571, 1, 1, 3342.094, -2281.307, 137.6798, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4206)
+(@OGUID+1822, 181055, 571, 1, 1, 3325.675, -2187.142, 134.1245, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4206)
+(@OGUID+1823, 181055, 571, 1, 1, 2495.748, -1930.493, 18.89087, 0.5934101, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4242)
+(@OGUID+1824, 181055, 571, 1, 1, 2510.754, -1823.163, 18.16746, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4242)
+(@OGUID+1825, 181055, 571, 1, 1, 2508.891, -1811.156, 18.57204, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4242)
+(@OGUID+1826, 181055, 571, 1, 1, 2502.159, -1831.973, 18.18279, 5.480334, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4242)
+(@OGUID+1827, 181055, 571, 1, 1, 2493.719, -1840.646, 18.18876, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4242)
+(@OGUID+1828, 181055, 571, 1, 1, 2482.121, -1838.097, 19.10611, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4242)
+(@OGUID+1829, 181055, 571, 1, 1, 4502.594, 5701.009, 86.9327, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1830, 181055, 571, 1, 1, 4520.103, 5699.374, 86.98763, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1831, 181055, 571, 1, 1, 4505.328, 5718.376, 87.04783, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1832, 181055, 571, 1, 1, 4522.387, 5716.762, 86.95365, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 4122)
+(@OGUID+1833, 181055, 530, 1, 1, -1730.328, 5649.338, 136.299, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3899)
+(@OGUID+1834, 181055, 530, 1, 1, -1645.066, 5192.24, -27.42542, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3899)
+(@OGUID+1835, 181055, 530, 1, 1, -1759.38, 5167.662, -28.72669, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3899)
+(@OGUID+1836, 181055, 530, 1, 1, -2056.806, 5228.367, -27.39764, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1837, 181055, 530, 1, 1, -2138.824, 5148.72, -8.640973, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1838, 181055, 530, 1, 1, -1864.128, 4999.87, -8.724302, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1839, 181055, 530, 1, 1, -1552.944, 5125.714, -8.696525, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 0)
+(@OGUID+1840, 181055, 530, 1, 1, -2625.937, 4419.99, 42.99473, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3683)
+(@OGUID+1841, 181055, 530, 1, 1, -3080.017, 2519.666, 75.95196, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1842, 181055, 530, 1, 1, -3097.624, 2522.847, 75.95374, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1843, 181055, 530, 1, 1, -3088.047, 2526.28, 75.9549, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1844, 181055, 530, 1, 1, -3092.005, 2502.068, 76.35168, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1845, 181055, 530, 1, 1, -3099.529, 2512.387, 75.96468, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1846, 181055, 530, 1, 1, -3081.95, 2509.127, 75.9601, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1847, 181055, 530, 1, 1, -2980.738, 2565.908, 97.9761, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1848, 181055, 530, 1, 1, -2978.653, 2545.87, 97.51945, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1849, 181055, 530, 1, 1, -2960.054, 2536.851, 96.74974, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1850, 181055, 530, 1, 1, -2944.712, 2569.651, 97.11517, 0.6108634, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1851, 181055, 530, 1, 1, -2963.106, 2578.467, 97.77729, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1852, 181055, 530, 1, 1, -2943.146, 2549.089, 96.68553, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3744)
+(@OGUID+1853, 181055, 530, 1, 1, -3956.793, 2241.567, 107.9687, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3745)
+(@OGUID+1854, 181055, 530, 1, 1, -4044.765, 2237.184, 118.0772, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3745)
+(@OGUID+1855, 181055, 530, 1, 1, -4063.29, 2183.958, 117.962, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3745)
+(@OGUID+1856, 181055, 530, 1, 1, -4053.135, 2167.243, 117.8958, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3745)
+(@OGUID+1857, 181055, 530, 1, 1, -4063.405, 2159.092, 117.9386, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3745)
+(@OGUID+1858, 181055, 530, 1, 1, -4114.495, 1119.618, 52.38124, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3929)
+(@OGUID+1859, 181055, 530, 1, 1, -3006.023, 795.2581, -1.891022, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3754)
+(@OGUID+1860, 181055, 530, 1, 1, -716.8414, 2735.047, 100.798, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3538)
+(@OGUID+1861, 181055, 530, 1, 1, -717.3152, 2750.212, 100.8153, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3538)
+(@OGUID+1862, 181055, 530, 1, 1, -699.2603, 2709.337, 101.0987, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3538)
+(@OGUID+1863, 181055, 530, 1, 1, -690.6761, 2732.448, 100.9171, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3538)
+(@OGUID+1864, 181055, 530, 1, 1, -690.3901, 2717.364, 101.012, 0, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3538)
+(@OGUID+1865, 181055, 530, 1, 1, 175.2291, 2619.424, 98.45457, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3536)
+(@OGUID+1866, 181055, 530, 1, 1, 187.7007, 2628.467, 98.74133, 2.164206, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3536)
+(@OGUID+1867, 181055, 530, 1, 1, 203.049, 4333.749, 125.1613, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3552)
+(@OGUID+1868, 181055, 530, 1, 1, -223.1397, 5396.124, 40.32872, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3521)
+(@OGUID+1869, 181055, 530, 1, 1, -222.4095, 5391.945, 40.32674, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3521)
+(@OGUID+1870, 181055, 530, 1, 1, -341.6888, 5481.863, 37.94325, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3565)
+(@OGUID+1871, 181055, 530, 1, 1, -337.4103, 5481.802, 37.91649, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3565)
+(@OGUID+1872, 181055, 530, 1, 1, -186.2492, 5519.735, 33.73346, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3565)
+(@OGUID+1873, 181055, 530, 1, 1, -181.5449, 5532.257, 33.22929, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3565)
+(@OGUID+1874, 181055, 530, 1, 1, -175.3683, 5512.138, 33.37462, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3565)
+(@OGUID+1875, 181055, 530, 1, 1, -166.1566, 5537.293, 33.22692, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3565)
+(@OGUID+1876, 181055, 530, 1, 1, -96.04215, 5545.813, 45.60166, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3565)
+(@OGUID+1877, 181055, 530, 1, 1, -91.70524, 5545.659, 45.61694, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3565)
+(@OGUID+1878, 181055, 530, 1, 1, -159.9268, 5517.314, 33.24236, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3565)
+(@OGUID+1879, 181055, 530, 1, 1, -155.342, 5529.741, 33.96249, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3565)
+(@OGUID+1880, 181055, 530, 1, 1, -1260.943, 7180.634, 63.39374, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3613)
+(@OGUID+1881, 181055, 530, 1, 1, 1044.882, 7361.025, 45.56539, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3766)
+(@OGUID+1882, 181055, 530, 1, 1, 1941.395, 6838.657, 177.4772, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3771)
+(@OGUID+1883, 181055, 530, 1, 1, 1937.434, 6838.64, 177.4422, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3771)
+(@OGUID+1884, 181055, 530, 1, 1, 2085.431, 6890.104, 190.4657, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3772)
+(@OGUID+1885, 181055, 530, 1, 1, 2095.052, 6899.62, 190.4382, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3772)
+(@OGUID+1886, 181055, 530, 1, 1, 2070.803, 6759.671, 173.2742, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3772)
+(@OGUID+1887, 181055, 530, 1, 1, 2055.827, 6759.792, 173.2742, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3772)
+(@OGUID+1888, 181055, 530, 1, 1, 2066.258, 6730.639, 181.5167, 1.518436, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3772)
+(@OGUID+1889, 181055, 530, 1, 1, 2066.148, 6726.275, 181.5531, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3772)
+(@OGUID+1890, 181055, 530, 1, 1, 2944.296, 5533.428, 163.821, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3828)
+(@OGUID+1891, 181055, 530, 1, 1, 3085.633, 5473.628, 162.5824, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3951)
+(@OGUID+1892, 181055, 530, 1, 1, 2940.299, 5415.802, 165.9382, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3951)
+(@OGUID+1893, 181055, 530, 1, 1, 2090.407, 4769.771, 175.6497, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3827)
+(@OGUID+1894, 181055, 530, 1, 1, 2092.127, 4792.164, 175.6362, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3827)
+(@OGUID+1895, 181055, 530, 1, 1, 2098.946, 4779.432, 175.5325, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3827)
+(@OGUID+1896, 181055, 530, 1, 1, 2078.747, 4789.831, 175.6968, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3827)
+(@OGUID+1897, 181055, 530, 1, 1, 3018.137, 3748.76, 151.2779, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3712)
+(@OGUID+1898, 181055, 530, 1, 1, 2948.536, 3719.698, 150.2694, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3712)
+(@OGUID+1899, 181055, 530, 1, 1, 3044.282, 3608.729, 150.461, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3712)
+(@OGUID+1900, 181055, 530, 1, 1, 3116.458, 3688.845, 150.6044, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3712)
+(@OGUID+1901, 181055, 530, 1, 1, 4116.873, 3058.359, 349.9748, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3738)
+(@OGUID+1902, 181055, 530, 1, 1, 4184.254, 3009.556, 349.8448, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3738)
+(@OGUID+1903, 181055, 530, 1, 1, 4118.572, 2954.05, 360.3641, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3738)
+(@OGUID+1904, 181055, 530, 1, 1, 2984.813, 1803.785, 146.0861, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3728)
+(@OGUID+1905, 181055, 530, 1, 1, 2969.402, 1791.448, 145.6347, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3724)
+(@OGUID+1906, 181055, 530, 1, 1, 9954.997, -7098.571, 59.86189, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3487)
+(@OGUID+1907, 181055, 530, 1, 1, 9992.33, -7205.063, 44.06255, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3487)
+(@OGUID+1908, 181055, 530, 1, 1, 10002.23, -7202.467, 44.06782, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3487)
+(@OGUID+1909, 181055, 530, 1, 1, 10007.34, -7030.903, 57.97285, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3487)
+(@OGUID+1910, 181055, 530, 1, 1, 10010.68, -7199.167, 44.22095, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3487)
+(@OGUID+1911, 181055, 530, 1, 1, 9952.419, -7232.268, 43.9028, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3487)
+(@OGUID+1912, 181055, 530, 1, 1, 9945.498, -7242.049, 43.90578, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 3487)
+(@OGUID+1913, 181055, 0, 1, 1, -8341.17, 615.349, 104.273, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5150)
+(@OGUID+1914, 181055, 0, 1, 1, -8605.4, 391.313, 114.686, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5390)
+(@OGUID+1915, 181055, 0, 1, 1, -8610.86, 398.378, 114.794, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5390)
+(@OGUID+1916, 181055, 0, 1, 1, -8616.79, 405.722, 114.684, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5390)
+(@OGUID+1917, 181055, 0, 1, 1, -8845.916, 468.9219, 122.3519, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5148)
+(@OGUID+1918, 181055, 0, 1, 1, -8892.52, 867.236, 109.002, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5390)
+(@OGUID+1919, 181055, 0, 1, 1, -8937.31, 861.234, 119.3, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5390)
+(@OGUID+1920, 181055, 0, 1, 1, -8914.21, 995.188, 129.577, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5390)
+(@OGUID+1921, 181055, 0, 1, 1, -8948.17, 861.865, 119.265, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5390)
+(@OGUID+1922, 181055, 0, 1, 1, -8630.926, 945.2589, 136.5359, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5151)
+(@OGUID+1923, 181055, 0, 1, 1, -8578.42, 986.8, 133.948, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5151)
+(@OGUID+1924, 181055, 0, 1, 1, -8523.936, 930.3209, 108.977, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 5151)
+(@OGUID+1925, 181055, 1, 1, 1, 10144.4, 2233.66, 1352.2, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 1659)
+(@OGUID+1926, 181055, 1, 1, 1, 10130.9, 2224.82, 1352.22, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 1659)
+(@OGUID+1927, 181055, 1, 1, 1, 10119.3, 2216.15, 1351.82, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181055 (Area: 1659)
+(@OGUID+1928, 181017, 0, 1, 1, -8624.95, 933.507, 125.42, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 5151)
+(@OGUID+1929, 181017, 0, 1, 1, -8641.03, 953.563, 125.408, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 5151)
+(@OGUID+1930, 181017, 0, 1, 1, -8568.147, 978.654, 122.7587, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 5151)
+(@OGUID+1931, 181017, 0, 1, 1, -8584.17, 998.563, 122.819, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 5151)
+(@OGUID+1932, 181017, 0, 1, 1, -8504.936, 1192.633, 16.33525, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4411)
+(@OGUID+1933, 181017, 0, 1, 1, -8512.316, 1200.338, 16.39689, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4411)
+(@OGUID+1934, 181017, 0, 1, 1, -8520.524, 1204.205, 16.42972, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4411)
+(@OGUID+1935, 181017, 0, 1, 1, -8542.321, 1200.581, 16.43208, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4411)
+(@OGUID+1936, 181017, 0, 1, 1, -8534.486, 1204.204, 16.40989, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4411)
+(@OGUID+1937, 181017, 0, 1, 1, -8276.106, 1193.003, 16.38176, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4411)
+(@OGUID+1938, 181017, 0, 1, 1, -8268.55, 1200.73, 16.45654, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4411)
+(@OGUID+1939, 181017, 0, 1, 1, -8238.383, 1200.478, 16.38265, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4411)
+(@OGUID+1940, 181017, 0, 1, 1, -8246.669, 1204.407, 16.31734, 1.378809, 0, 0, 0, 1, 120, 255, 1), -- 181017 (Area: 4411)
+(@OGUID+1941, 181017, 0, 1, 1, -8260.668, 1204.398, 16.41504, 1.710422, 0, 0, 0, 1, 120, 255, 1); -- 181017 (Area: 4411)
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+1941 AND `eventEntry`=@Event;
+INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+1941;
+
+DELETE FROM `gameobject` WHERE `guid` IN (24399, 24400, 24401, 24402, 24405);
+
+UPDATE `creature` SET `position_x`=9616.942, `position_y`=-7181.332, `position_z`=14.3793, `orientation`=2.303835 WHERE `guid`=208827;
+UPDATE `creature` SET `position_x`=9612.548, `position_y`=-7182.34, `position_z`=15.55145, `orientation`=1.762783 WHERE `guid`=208800;
+UPDATE `creature` SET `position_x`=-4918.147, `position_y`=-982.1111, `position_z`=502.7113, `orientation`=2.234021 WHERE `guid`=208797;
+UPDATE `creature` SET `position_x`=-8867.42, `position_y`=637.047, `position_z`=97.03574, `orientation`=0.8203048 WHERE `guid`=208798;
+UPDATE `creature` SET `position_x`=9870.95, `position_y`=2492.47, `position_z`=1317.113, `orientation`=5.969026 WHERE `guid`=208799;
+UPDATE `creature` SET `position_x`=-4006.774, `position_y`=-11844.94, `position_z`=1.430115, `orientation`=4.468043 WHERE `guid`=208796;
+UPDATE `creature` SET `position_x`=9610.493, `position_y`=-7182.677, `position_z`=15.53905, `orientation`=1.850049 WHERE `guid`=208808;
+UPDATE `creature` SET `position_x`=-4919.688, `position_y`=-983.6163, `position_z`=502.6961, `orientation`=2.949606 WHERE `guid`=208810;
+UPDATE `creature` SET `position_x`=-8868.953, `position_y`=638.5087, `position_z`=97.03911, `orientation`=1.466077 WHERE `guid`=208806;
+UPDATE `creature` SET `position_x`=9871.64, `position_y`=2494.43, `position_z`=1317.123, `orientation`=6.021386 WHERE `guid`=208807;
+UPDATE `creature` SET `position_x`=-4004.755, `position_y`=-11845.5, `position_z`=1.443716, `orientation`=4.782202 WHERE `guid`=208811;
+UPDATE `creature` SET `position_x`=9586.303, `position_y`=-7181.014, `position_z`=14.32427, `orientation`=0 WHERE `guid`=208833;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_00_world.sql
new file mode 100644
index 00000000000..346c77bee43
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_00_world.sql
@@ -0,0 +1,5 @@
+-- Create gossip_menu_option 7731,7732 for NPC 18588 Floon in Terokkar Forest
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7731,7732) AND `id` = 0;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(7731,0,0,'He wants his "golds." Pay up or die... again...',15564,1,1,0,0,0,0,'',0),
+(7732,0,0,"I have been sent by Sal'salabim to collect a debt that you owe. Pay up or I'm going to have to hurt you.",15560,1,1,0,0,0,0,'',0);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_01_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_01_world_335.sql
new file mode 100644
index 00000000000..473cbd506ce
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_01_world_335.sql
@@ -0,0 +1,25 @@
+-- new gossip_menus for Quest 5742 Redemption (Tirion's Tale)
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (3502,3681,3682,3683) AND `id` = 0;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(3502, 0,0, 'I am ready to hear your tale, Tirion.', 7219, 1,1, 3681, 0,0,0,'',0),
+(3681, 0,0, 'Thank you, Tirion. What of your identity?', 7221, 1,1, 3682, 0,0,0,'',0),
+(3682, 0,0, 'That is terrible.', 7223, 1,1, 3683, 0,0,0,'',0),
+(3683, 0,0, 'I will, Tirion.', 7225, 1,1, 0, 0,0,0,'',0);
+
+-- update creature entry 1855 Tirion Fordring
+UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = 1855;
+
+-- SmartAI script actions for Quest 5742 Redemption (Tirion's Tale)
+DELETE FROM `smart_scripts` WHERE `entryorguid`= 1855 AND `source_type`= 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(1855,0, 0,0, 62, 0,100,0, 3502, 0,0,0, 98, 3681, 4493, 0,0,0,0, 7,0,0,0,0,0,0,0, 'Tirion Fordring - on gossip_menu 3502 selected - Send Gossip text 4493 with menu option 3681'),
+(1855,0, 1,0, 62, 0,100,0, 3681, 0,0,0, 98, 3682, 4494, 0,0,0,0, 7,0,0,0,0,0,0,0, 'Tirion Fordring - on gossip_menu 3681 selected - Send Gossip text 4494 with menu option 3682'),
+(1855,0, 2,0, 62, 0,100,0, 3682, 0,0,0, 98, 3683, 4495, 0,0,0,0, 7,0,0,0,0,0,0,0, 'Tirion Fordring - on gossip_menu 3682 selected - Send Gossip text 4495 with menu option 3683'),
+(1855,0, 3,4, 62, 0,100,0, 3683, 0,0,0, 15, 5742, 0, 0,0,0,0, 7,0,0,0,0,0,0,0, 'Tirion Fordring - on gossip_menu 3683 selected - Give credit for Quest 5742 Redemption'),
+(1855,0, 4,0, 61, 0,100,0, 0, 0,0,0, 72, 0, 0, 0,0,0,0, 7,0,0,0,0,0,0,0, 'Tirion Fordring - on gossip_menu 3683 selected - Close Gossip');
+
+-- conditions for Quest 5742 Redemption (Tirion's Tale)
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup`= 3502;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15, 3502,0, 0,1, 9,0, 5742, 0,0,0,0,0, '', 'Show gossip menu option 3502 only if Quest 5742 is taken (active)'),
+(15, 3502,0, 0,1, 41,0, 1, 1,0,0,0,0, '', 'Show gossip menu option 3502 only if player is sitting (any type)');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_02_world.sql
new file mode 100644
index 00000000000..c5355b13c29
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_25_02_world.sql
@@ -0,0 +1,109 @@
+SET @CGUID := 86984;
+
+DELETE FROM `creature` WHERE `id`=24110 AND `guid` BETWEEN @CGUID+0 AND @CGUID+31;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(@CGUID+0, 24110, 571, 1, 1, 2480.52, -405.0309, 31.25292, 1.954769, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+1, 24110, 571, 1, 1, 2485.832, -406.4011, 38.64569, 1.937315, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+2, 24110, 571, 1, 1, 2483.247, -405.9387, 35.05476, 4.991642, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+3, 24110, 571, 1, 1, 2477.307, -404.4191, 27.71297, 2.530727, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+4, 24110, 571, 1, 1, 2490.05, -404.6198, 27.34736, 0, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+5, 24110, 571, 1, 1, 2486.804, -396.4983, 37.61678, 6.248279, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+6, 24110, 571, 1, 1, 2473.764, -403.68, 23.80915, 3.246312, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+7, 24110, 571, 1, 1, 2489.167, -395.6806, 28.83605, 0.01745329, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+8, 24110, 571, 1, 1, 2488.105, -403.3663, 35.30573, 2.80998, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+9, 24110, 571, 1, 1, 2457.642, -389.6918, 23.55255, 6.143559, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+10, 24110, 571, 1, 1, 2469.61, -402.5246, 21.45798, 4.08407, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+11, 24110, 571, 1, 1, 2454.252, -397.5855, 51.25713, 0.03490658, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+12, 24110, 571, 1, 1, 2457.418, -405.3847, 30.72205, 6.213372, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+13, 24110, 571, 1, 1, 2483.101, -393.8391, 43.72463, 2.897247, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+14, 24110, 571, 1, 1, 2455.441, -395.9613, 42.66463, 0.05235988, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+15, 24110, 571, 1, 1, 2454.66, -404.776, 48.54633, 6.143559, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+16, 24110, 571, 1, 1, 2458.783, -404.1076, 23.79817, 6.265732, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+17, 24110, 571, 1, 1, 2458.11, -410.4796, 22.85155, 6.195919, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+18, 24110, 571, 1, 1, 2481.292, -393.944, 40.58387, 4.171337, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+19, 24110, 571, 1, 1, 2457.773, -397.1545, 31.50192, 6.195919, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+20, 24110, 571, 1, 1, 2469.01, -396.4393, 25.475, 0.2792527, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+21, 24110, 571, 1, 1, 2478.411, -394.4479, 36.02073, 4.223697, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+22, 24110, 571, 1, 1, 2456.78, -389.8281, 32.9614, 0, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+23, 24110, 571, 1, 1, 2460.665, -399.6276, 19.7543, 3.089233, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+24, 24110, 571, 1, 1, 2476.166, -394.8342, 31.92243, 1.27409, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+25, 24110, 571, 1, 1, 2455.731, -404.8611, 40.88202, 6.213372, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+26, 24110, 571, 1, 1, 2460.889, -401.5321, 19.4641, 5.131268, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+27, 24110, 571, 1, 1, 2464.679, -397.7112, 21.8534, 5.113815, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+28, 24110, 571, 1, 1, 2464.713, -401.7634, 19.7663, 0.06981317, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+29, 24110, 571, 1, 1, 2456.293, -412.3963, 29.24669, 6.073746, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+30, 24110, 571, 1, 1, 2472.812, -395.45, 28.40558, 3.368485, 120, 0, 0), -- 24110 (Area: 4181)
+(@CGUID+31, 24110, 571, 1, 1, 2458.6, -396.5036, 23.42054, 6.248279, 120, 0, 0); -- 24110 (Area: 4181)
+
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=28013;
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=28013;
+DELETE FROM `creature` WHERE `id`=28013;
+
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` BETWEEN -@CGUID-31 AND -@CGUID-0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(-@CGUID-0, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-0, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-1, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-1, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-2, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-2, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-3, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-3, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-4, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-4, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-5, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-5, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-6, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-6, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-7, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-7, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-8, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-8, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-9, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-9, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-10, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-10, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-11, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-11, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-12, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-12, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-13, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-13, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-14, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-14, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-15, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-15, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-16, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-16, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-17, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-17, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-18, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-18, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-19, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-19, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-20, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-20, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-21, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-21, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-22, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-22, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-23, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-23, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-24, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-24, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-25, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-25, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-26, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-26, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-27, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-27, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-28, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-28, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-29, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-29, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-30, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-30, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\''),
+(-@CGUID-31, 0, 0, 1, 8, 0, 100, 0, 48455, 0, 0, 0, 11, 50290, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Fire Upon the Waters: Sail Burning Kill Credit\''),
+(-@CGUID-31, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48522, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny Large - On Spellhit \'Apothecary\'s Burning Water\' - Cast \'Sinner''s Folly Fire Bunny: Periodic Fire Aura\'');
+
+UPDATE `conditions` SET `ConditionValue2`=24110, `Comment`='Fire Upon the Waters - spell to ELM General Purpose Bunny Large' WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=48455 AND `SourceId`=0 AND `ElseGroup`=0 AND `ConditionTypeOrReference`=31 AND `ConditionTarget`=0 AND `ConditionValue1`=3 AND `ConditionValue2`=28013 AND `ConditionValue3`=0;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_26_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_26_00_world.sql
new file mode 100644
index 00000000000..d08d5055089
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_26_00_world.sql
@@ -0,0 +1,17 @@
+UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=48351, `comment`='Bombard the Ballistae Kill Credit Bunny - On Spellhit \'Siegesmith Bombs\' - Cast Bombard the Ballistae: Ballista Bow' WHERE `entryorguid`=27331 AND `source_type`=0 AND `id`=1 AND `link`=0;
+UPDATE `smart_scripts` SET `event_param3`=120000, `event_param4`=120000 WHERE `entryorguid`=27331 AND `source_type`=0 AND `id`=0 AND `link`=1;
+
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=27331 AND `id`>1;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(27331, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48352, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bombard the Ballistae Kill Credit Bunny - On Spellhit \'Siegesmith Bombs\' - Cast Bombard the Ballistae: Ballista Frame'),
+(27331, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48353, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bombard the Ballistae Kill Credit Bunny - On Spellhit \'Siegesmith Bombs\' - Cast Bombard the Ballistae: Ballista Missile'),
+(27331, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48354, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bombard the Ballistae Kill Credit Bunny - On Spellhit \'Siegesmith Bombs\' - Cast Bombard the Ballistae: Ballista Wheel'),
+(27331, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bombard the Ballistae Kill Credit Bunny - On Spellhit \'Siegesmith Bombs\' - Cast Bombard the Ballistae: FX Master'),
+(27331, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 11, 52687, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Bombard the Ballistae Kill Credit Bunny - On Spellhit \'Siegesmith Bombs\' - Cast Bombard the Ballistae: Knockback'),
+(27331, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 120, 0, 0, 0, 0, 0, 20, 188673, 0, 0, 0, 0, 0, 0, 'Bombard the Ballistae Kill Credit Bunny - On Spellhit \'Siegesmith Bombs\' - Despawn GO');
+
+UPDATE `smart_scripts` SET `link`=2 WHERE `entryorguid`=27331 AND `source_type`=0 AND `id`=1 AND `link`=0;
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=48347;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 2, 48347, 0, 0, 31, 0, 5, 188673, 0, 0, 0, 0, '', 'Bombard the Ballistae: FX Master effect #2 targets go 188673');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_26_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_26_01_world.sql
new file mode 100644
index 00000000000..b30b3cba35f
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_26_01_world.sql
@@ -0,0 +1 @@
+DELETE FROM `event_scripts` WHERE `id` = 16547;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_27_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_27_00_world.sql
new file mode 100644
index 00000000000..b9288b2ddfb
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_27_00_world.sql
@@ -0,0 +1,4 @@
+-- fix "Val'anyr, Hammer of Ancient Kings" to properly provide shields from Earth Shield charges and Glyph of Holy Light heals (as well as others)
+DELETE FROM `spell_proc_event` WHERE `entry`=64411;
+INSERT INTO `spell_proc_event` (`entry`,`procFlags`) VALUES
+(64411,0x00044400);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_28_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_28_00_world.sql
new file mode 100644
index 00000000000..5a5694e0320
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_28_00_world.sql
@@ -0,0 +1,2 @@
+-- remove script from core requires removing ScriptName from creature_template
+UPDATE `creature_template` SET `ScriptName`= '' WHERE `entry`IN (1749,2708);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_29_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_29_00_world.sql
new file mode 100644
index 00000000000..280f2f901ef
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_29_00_world.sql
@@ -0,0 +1,27 @@
+-- creature text 23576 Nalorakk + sound ID + broadcast_text ID
+DELETE FROM `creature_text` WHERE `entry` = 23576 AND `type` = 14;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(23576, 0,0, "Get da move on, guards! It be killin' time!", 14,0,100,0,0, 12066, 22144, 1, 'Nalorakk - YELL_NALORAKK_WAVE1'),
+(23576, 1,0, "Guards, go already! Who you more afraid of, dem... or me?", 14,0,100,0,0, 12067, 22146, 1, 'Nalorakk - YELL_NALORAKK_WAVE2'),
+(23576, 2,0, "Ride now! Ride out dere and bring me back some heads!", 14,0,100,0,0, 12068, 22151, 1, 'Nalorakk - YELL_NALORAKK_WAVE3'),
+(23576, 3,0, "I be losin' me patience! Go on: make dem wish dey was never born!", 14,0,100,0,0, 12069, 22155, 1, 'Nalorakk - YELL_NALORAKK_WAVE4'),
+(23576, 4,0, "You be dead soon enough!", 14,0,100,0,0, 12070, 23166, 1, 'Nalorakk - YELL_AGGRO'),
+(23576, 5,0, "I bring da pain!", 14,0,100,0,0, 12071, 23167, 1, 'Nalorakk - YELL_SURGE'),
+(23576, 6,0, "You call on da beast, you gonna get more dan you bargain for!", 14,0,100,0,0, 12072, 23168, 1, 'Nalorakk - YELL_SHIFTEDTOBEAR '),
+(23576, 7,0, "Make way for da Nalorakk!", 14,0,100,0,0, 12073, 23169, 1, 'Nalorakk - YELL_SHIFTEDTOTROLL'),
+(23576, 8,0, "You had your chance; now it be too late!", 14,0,100,0,0, 12074, 23170, 1, 'Nalorakk - YELL_BERSERK'),
+(23576, 9,0, "Now whatchoo got to say?", 14,0,100,0,0, 12075, 23171, 1, 'Nalorakk - YELL_KILL_ONE'),
+(23576, 10,0, "Da Amani gonna rule again!", 14,0,100,0,0, 12076, 23172, 1, 'Nalorakk - YELL_KILL_TWO'),
+(23576, 11,0, "I... be waitin' on da udda side....", 14,0,100,0,0, 12077, 23173, 1, 'Nalorakk - YELL_DEATH'),
+(23576, 12,0, "What could be better than servin' da bear spirit for eternity? Come closer now. Bring your souls to me!", 14,0,100,0,0, 12078, 23305, 1, 'Nalorakk - YELL_NALORAKK_EVENT1'),
+(23576, 13,0, "I smell you, strangers. Don't be delayin' your fate. Come to me now. I make your sacrifice quick.", 14,0,100,0,0, 12079, 23306, 1, 'Nalorakk - YELL_NALORAKK_EVENT1');
+
+-- creature text 24239 Hex Lord Malacrass + sound ID + broadcast_text ID
+DELETE FROM `creature_text` WHERE `entry` = 24239 AND `type` = 14;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(24239, 0,0, "Da shadow gonna fall on you....", 14,0,100,0,0, 12041, 23591, 1, 'Hex Lord Malacrass - YELL_AGGRO'),
+(24239, 1,0, "Dis a nightmare ya don' wake up from!", 14,0,100,0,0, 12043, 23593, 1, 'Hex Lord Malacrass - YELL_KILL_ONE'),
+(24239, 2,0, "Azzaga choogo zinn!", 14,0,100,0,0, 12044, 23594, 1, 'Hex Lord Malacrass - YELL_KILL_TWO'),
+(24239, 3,0, "Darkness comin' for you....", 14,0,100,0,0, 12046, 23596, 1, 'Hex Lord Malacrass - YELL_DRAIN_POWER'),
+(24239, 4,0, "Your soul gonna bleed!", 14,0,100,0,0, 12047, 23597, 1, 'Hex Lord Malacrass - YELL_SPIRIT_BOLTS'),
+(24239, 5,0, "Dis not... da end for me!", 14,0,100,0,0, 12051, 23601, 1, 'Hex Lord Malacrass - YELL_DEATH');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_02_29_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_29_01_world.sql
new file mode 100644
index 00000000000..40343440d9a
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_02_29_01_world.sql
@@ -0,0 +1 @@
+DELETE FROM `game_event_gameobject` WHERE `guid` IN (24399, 24400, 24401, 24402, 24405);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_01_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_01_00_world_335.sql
new file mode 100644
index 00000000000..36c48379190
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_01_00_world_335.sql
@@ -0,0 +1,75 @@
+SET @Pool := 370;
+
+UPDATE `quest_template_addon` SET `PrevQuestID`=0 WHERE `ID` IN(12604,12541,12502,12509,12519,12502,12509,12519,12588,12591,12594,12557,12597,12598,12599,12564,12568,12585);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN(19,20) AND`SourceEntry` IN(12541,12604,12502,12509,12519,12502,12509,12519,12588,12591,12594,12557,12597,12598,12599,12564,12568,12585);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(19, 0, 12604, 0, 0, 1, 0, 51573, 0, 0, 0, 0, 0, '', "Show quest mark 12604 'Congratulations!' if player has aura 51573 'On Patrol'."),
+(20, 0, 12604, 0, 0, 1, 0, 51573, 0, 0, 0, 0, 0, '', "Show quest mark 12604 'Congratulations!' if player has aura 51573 'On Patrol'."),
+(19, 0, 12604, 0, 0, 1, 0, 53707, 0, 0, 1, 0, 0, '', "Show quest mark 12604 'Congratulations!' if player has no aura 51573 'On Patrol Heartbeat Script'."),
+(20, 0, 12604, 0, 0, 1, 0, 53707, 0, 0, 1, 0, 0, '', "Show quest mark 12604 'Congratulations!' if player has no aura 51573 'On Patrol Heartbeat Script'."),
+(19, 0, 12541, 0, 0, 9, 0, 12501, 0, 0, 0, 0, 0, '', "Show quest mark 12604 'Troll Patrol: The Alchemists Apprentice' if player has quest Troll patrol'."),
+(20, 0, 12541, 0, 0, 9, 0, 12501, 0, 0, 0, 0, 0, '', "Show quest mark 12604 'Troll Patrol: The Alchemists Apprentice' if player has quest Troll patrol'."),
+(19, 0, 12541, 0, 1, 9, 0, 12563, 0, 0, 0, 0, 0, '', "Show quest mark 12604 'Troll Patrol: The Alchemists Apprentice' if player has quest Troll patrol'."),
+(20, 0, 12541, 0, 1, 9, 0, 12563, 0, 0, 0, 0, 0, '', "Show quest mark 12604 'Troll Patrol: The Alchemists Apprentice' if player has quest Troll patrol'."),
+(19, 0, 12541, 0, 2, 9, 0, 12587, 0, 0, 0, 0, 0, '', "Show quest mark 12604 'Troll Patrol: The Alchemists Apprentice' if player has quest Troll patrol'."),
+(20, 0, 12541, 0, 2, 9, 0, 12587, 0, 0, 0, 0, 0, '', "Show quest mark 12604 'Troll Patrol: The Alchemists Apprentice' if player has quest Troll patrol'."),
+(19, 0, 12509, 0, 0, 9, 0, 12501, 0, 0, 0, 0, 0, '', "Show quest mark 12509 'Troll Patrol: Intestinal Fortitude' if player has quest Troll patrol'."),
+(20, 0, 12509, 0, 0, 9, 0, 12501, 0, 0, 0, 0, 0, '', "Show quest mark 12509 'Troll Patrol: Intestinal Fortitude' if player has quest Troll patrol'."),
+(19, 0, 12519, 0, 0, 9, 0, 12501, 0, 0, 0, 0, 0, '', "Show quest mark 12604 'Troll Patrol: Whatdya Want, a Medal?' if player has quest Troll patrol'."),
+(20, 0, 12519, 0, 0, 9, 0, 12501, 0, 0, 0, 0, 0, '', "Show quest mark 12604 'Troll Patrol: Whatdya Want, a Medal?' if player has quest Troll patrol'."),
+(19, 0, 12502, 0, 0, 9, 0, 12501, 0, 0, 0, 0, 0, '', "Show quest mark 12502 'Troll Patrol: High Standards' if player has quest Troll patrol'."),
+(20, 0, 12502, 0, 0, 9, 0, 12501, 0, 0, 0, 0, 0, '', "Show quest mark 12502 'Troll Patrol: High Standards' if player has quest Troll patrol'."),
+(19, 0, 12564, 0, 0, 9, 0, 12563, 0, 0, 0, 0, 0, '', "Show quest mark 12564 'Troll Patrol: Something for the Pain' if player has quest Troll patrol'."),
+(20, 0, 12564, 0, 0, 9, 0, 12563, 0, 0, 0, 0, 0, '', "Show quest mark 12564 'Troll Patrol: Something for the Pain' if player has quest Troll patrol'."),
+(19, 0, 12568, 0, 0, 9, 0, 12563, 0, 0, 0, 0, 0, '', "Show quest mark 12568 'Troll Patrol: Done to Death' if player has quest Troll patrol'."),
+(20, 0, 12568, 0, 0, 9, 0, 12563, 0, 0, 0, 0, 0, '', "Show quest mark 12558 'Troll Patrol: Done to Death' if player has quest Troll patrol'."),
+(19, 0, 12585, 0, 0, 9, 0, 12563, 0, 0, 0, 0, 0, '', "Show quest mark 12585 'Troll Patrol: Creature Comforts' if player has quest Troll patrol'."),
+(20, 0, 12585, 0, 0, 9, 0, 12563, 0, 0, 0, 0, 0, '', "Show quest mark 12585 'Troll Patrol: Creature Comforts' if player has quest Troll patrol'."),
+(19, 0, 12588, 0, 0, 9, 0, 12587, 0, 0, 0, 0, 0, '', "Show quest mark 12588 'Troll Patrol: Can You Dig It?' if player has quest Troll patrol'."),
+(20, 0, 12588, 0, 0, 9, 0, 12587, 0, 0, 0, 0, 0, '', "Show quest mark 12588 'Troll Patrol: Can You Dig It?' if player has quest Troll patrol'."),
+(19, 0, 12591, 0, 0, 9, 0, 12587, 0, 0, 0, 0, 0, '', "Show quest mark 12591 'Troll Patrol: Throwing Down' if player has quest Troll patrol'."),
+(20, 0, 12591, 0, 0, 9, 0, 12587, 0, 0, 0, 0, 0, '', "Show quest mark 12591 'Troll Patrol: Throwing Down' if player has quest Troll patrol'."),
+(19, 0, 12594, 0, 0, 9, 0, 12587, 0, 0, 0, 0, 0, '', "Show quest mark 12594 'Troll Patrol: Couldn't Care Less' if player has quest Troll patrol'."),
+(20, 0, 12594, 0, 0, 9, 0, 12587, 0, 0, 0, 0, 0, '', "Show quest mark 12594 'Troll Patrol: Couldn't Care Less' if player has quest Troll patrol'."),
+(19, 0, 12557, 0, 0, 9, 0, 12596, 0, 0, 0, 0, 0, '', "Show quest mark 12557 'Lab Work' if player has quest Pa'Troll'."),
+(20, 0, 12557, 0, 0, 9, 0, 12596, 0, 0, 0, 0, 0, '', "Show quest mark 12557 'Lab Work' if player has quest Pa'Troll'."),
+(19, 0, 12597, 0, 0, 9, 0, 12596, 0, 0, 0, 0, 0, '', "Show quest mark 12597 'Something for the Pain' if player has quest Pa'Troll'."),
+(20, 0, 12597, 0, 0, 9, 0, 12596, 0, 0, 0, 0, 0, '', "Show quest mark 12597 'Something for the Pain' if player has quest Pa'Troll'."),
+(19, 0, 12598, 0, 0, 9, 0, 12596, 0, 0, 0, 0, 0, '', "Show quest mark 12598 'Throwing Down' if player has quest Pa'Troll'."),
+(20, 0, 12598, 0, 0, 9, 0, 12596, 0, 0, 0, 0, 0, '', "Show quest mark 12598 'Throwing Down' if player has quest Pa'Troll'."),
+(19, 0, 12599, 0, 0, 9, 0, 12596, 0, 0, 0, 0, 0, '', "Show quest mark 12599 'Creature Comforts' if player has quest Pa'Troll'."),
+(20, 0, 12599, 0, 0, 9, 0, 12596, 0, 0, 0, 0, 0, '', "Show quest mark 12599 'Creature Comforts' if player has quest Pa'Troll'.");
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` =28039;
+DELETE FROM `smart_scripts` WHERE `entryorguid` =28039 AND `source_type`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(28039, 0, 0, 1, 19, 0, 100, 0, 12596, 0, 0, 0, 85, 51506, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Accept Pa''Troll - Invoker Cast Clear Patrol Quests'),
+(28039, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 85, 51509, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Accept Pa''Troll - Invoker Cast Clear Patrol Quests II'),
+(28039, 0, 2, 5, 19, 0, 100, 0, 12587, 0, 0, 0, 85, 51573, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Accept Troll Patrol - Invoker Cast On Patrol'),
+(28039, 0, 3, 5, 19, 0, 100, 0, 12501, 0, 0, 0, 85, 51573, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Accept Troll Patrol - Invoker Cast On Patrol'),
+(28039, 0, 4, 5, 19, 0, 100, 0, 12563, 0, 0, 0, 85, 51573, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Accept Troll Patrol - Invoker Cast On Patrol'),
+(28039, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 85, 53712, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Accept Troll Patrol - Invoker Cast Clear DAILY Patrol SUBQuests 00'),
+(28039, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 85, 53713, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Accept Troll Patrol - Invoker Cast Clear DAILY Patrol SUBQuests 01'),
+(28039, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 85, 53715, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Accept Troll Patrol - Invoker Cast Clear DAILY Patrol SUBQuests 02'),
+(28039, 0, 8, 9, 61, 0, 100, 0, 0, 0, 0, 0, 85, 53716, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Accept Troll Patrol - Invoker Cast Clear DAILY Patrol SUBQuests 03'),
+(28039, 0, 9, 0, 61, 0, 100, 0, 0, 0, 0, 0, 85, 53707, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Accept Troll Patrol - Invoker Cast On Patrol Heartbeat Script'),
+(28039, 0, 10, 0, 20, 0, 100, 0, 12587, 0, 0, 0, 28, 51573, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Reward Congratulations - Remove Aura On Patrol'),
+(28039, 0, 11, 0, 20, 0, 100, 0, 12563, 0, 0, 0, 28, 53707, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Reward Troll Patrol - Remove Aura On Patrol Heartbeat Script'),
+(28039, 0, 12, 0, 20, 0, 100, 0, 12501, 0, 0, 0, 28, 53707, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Reward Troll Patrol - Remove Aura On Patrol Heartbeat Script'),
+(28039, 0, 13, 0, 20, 0, 100, 0, 12604, 0, 0, 0, 28, 53707, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Commander Kunz - On Quest Reward Troll Patrol - Remove Aura On Patrol Heartbeat Script');
+
+UPDATE `quest_template_addon` SET `ExclusiveGroup`=12587 WHERE `ID` IN(12501,12563,12587);
+
+DELETE FROM `pool_quest` WHERE `pool_entry` IN (@Pool);
+
+INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES
+(12587, @Pool, 'Troll Patrol'),
+(12501, @Pool, 'Troll Patrol'),
+(12563, @Pool, 'Troll Patrol');
+
+DELETE FROM `pool_template` WHERE `entry` IN (@Pool);
+
+INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES
+(@Pool, 1, 'Troll Patrol Daily Quests');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_02_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_02_00_world_335.sql
new file mode 100644
index 00000000000..e7a9f60e790
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_02_00_world_335.sql
@@ -0,0 +1,3 @@
+--
+-- Only for 3.3.5!
+UPDATE `conditions` SET `ConditionTypeOrReference`=42 WHERE `ConditionTypeOrReference`=41;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_03_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_03_00_world.sql
new file mode 100644
index 00000000000..473bac4708a
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_03_00_world.sql
@@ -0,0 +1,93 @@
+SET @CGUID := 91749;
+SET @OGUID := 62179;
+
+UPDATE `creature_template` SET `npcflag`=16777216 WHERE `entry`=28162;
+
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=28162;
+INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES
+(28162, 51026, 1, 0);
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(28162,28330,28156) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(2833000,2833001,2833002) AND `source_type`=9;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(28162, 0, 0, 1, 8, 0, 100, 1, 51026, 0, 0, 0, 11, 61286, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Drakkari Corpse - On Spellhit Create Drakkari Medallion Cover - Cast World Generic Dismount/Cancel Shapeshift'),
+(28162, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 50737, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Drakkari Corpse - On Spellhit Create Drakkari Medallion Cover - Cast Create Drakkari Medallion'),
+(28162, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Drakkari Corpse - On Spellhit Create Drakkari Medallion Cover - Cast Create Drakkari Medallion'),
+(28162, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 3000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Drakkari Corpse - On Spellhit Create Drakkari Medallion Cover - Despawn'),
+(28162, 0, 4, 0, 25, 0, 100, 0, 0, 0, 0, 0, 81, 16777216, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Drakkari Corpse - On Respawn - Set NPC Flags'),
+(28330, 0, 0, 1, 8, 0, 100, 0, 51333, 0, 120000, 120000, 33, 28330, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ancient Dirt KC Bunny - On Spell Hit - Give Quest Credit'),
+(28330, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 70, 120, 0, 0, 0, 0, 0, 20, 190550, 0, 0, 0, 0, 0, 0, 'Ancient Dirt KC Bunny - On Spell Hit - Despawn GO'),
+(28330, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 87, 2833000, 2833001, 2833002, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ancient Dirt KC Bunny - On Spell Hit - Run Random Script'),
+(28156, 0, 0, 1, 8, 0, 100, 1, 51276, 0, 0, 0, 11, 59216, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Defeated Argent Footman - On Spellhit \'Incinerate Corpse\' - Cast \'Burning Corpse\''),
+(28156, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 51279, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Defeated Argent Footman - On Spellhit - Cast \'Defeated Argent Footman KC\''),
+(28156, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 10000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Defeated Argent Footman - On Spellhit - Despawn'),
+(2833000, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 51345, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ancient Dirt KC Bunny - Script 1 - Cast Summon Ancient Drakkari Chest'),
+(2833001, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 51357, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ancient Dirt KC Bunny - Script 2 - Cast Summon Spider'),
+(2833002, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 51370, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ancient Dirt KC Bunny - Script 3 - Cast Summon Drakkari Spectre');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup`=28162;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(18, 28162, 51026, 0, 0, 9, 0, 12519, 0, 0, 0, 0, 0, '', 'Required quest active for spellclick');
+
+DELETE FROM `gameobject_template` WHERE `entry`=190552;
+INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `Data0`, `Data1`, `Data2`, `Data3`, `Data4`, `Data5`, `Data6`, `Data7`, `Data8`, `Data9`, `Data10`, `Data11`, `Data12`, `Data13`, `Data14`, `Data15`, `Data16`, `Data17`, `Data18`, `Data19`, `Data20`, `Data21`, `Data22`, `Data23`, `AIName`, `ScriptName`, `VerifiedBuild`) VALUES
+(190552, 3, 2450, 'Ancient Drakkari Chest', '', '', '', 94, 0, 1, 1691, 27240, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 14007);
+
+DELETE FROM `gameobject_loot_template` WHERE `Entry`=27240;
+INSERT INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
+(27240, 46369, 0, 52, 0, 1, 1, 1, 1, NULL),
+(27240, 46368, 0, 47, 0, 1, 1, 1, 1, NULL),
+(27240, 43851, 0, 15, 0, 1, 2, 1, 1, NULL),
+(27240, 43852, 0, 14, 0, 1, 2, 1, 1, NULL),
+(27240, 33470, 0, 14, 0, 1, 3, 1, 4, NULL);
+
+DELETE FROM `creature` WHERE `id`=28330;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(@CGUID+0, 28330, 571, 1, 1, 4994.237, -2934.52, 289.698, 4.502949, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+1, 28330, 571, 1, 1, 4928.283, -2954.844, 289.4258, 0.3665192, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+2, 28330, 571, 1, 1, 4971.499, -2967.053, 290.4032, 6.021386, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+3, 28330, 571, 1, 1, 4934.217, -2988.888, 290.1517, 3.316126, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+4, 28330, 571, 1, 1, 4901.642, -3020.357, 290.4903, 3.577925, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+5, 28330, 571, 1, 1, 4936.192, -2911.305, 289.9935, 3.804818, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+6, 28330, 571, 1, 1, 4904.635, -2938.013, 290.041, 2.792527, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+7, 28330, 571, 1, 1, 4959.712, -2882.519, 290.1794, 2.495821, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+8, 28330, 571, 1, 1, 4903.988, -2988.983, 289.8607, 6.073746, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+9, 28330, 571, 1, 1, 4884.578, -2949.397, 291.4635, 6.248279, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+10, 28330, 571, 1, 1, 4867.053, -3032.317, 290.2768, 0.01745329, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+11, 28330, 571, 1, 1, 4875.137, -2981.573, 289.6624, 3.769911, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+12, 28330, 571, 1, 1, 4948.37, -2845.009, 289.9186, 0.2094395, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+13, 28330, 571, 1, 1, 4900.262, -2870.288, 290.5846, 2.879793, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+14, 28330, 571, 1, 1, 4889.488, -2826.498, 291.2368, 6.213372, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+15, 28330, 571, 1, 1, 4865.896, -2879.65, 291.2252, 3.124139, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+16, 28330, 571, 1, 1, 4847.792, -2933.366, 290.7986, 1.954769, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+17, 28330, 571, 1, 1, 4838.494, -2962.302, 290.7893, 5.096361, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+18, 28330, 571, 1, 1, 4834.676, -3024.518, 290.9732, 5.77704, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+19, 28330, 571, 1, 1, 4834.516, -3055.432, 292.7168, 4.223697, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+20, 28330, 571, 1, 1, 4833.344, -3086.806, 290.7325, 5.183628, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+21, 28330, 571, 1, 1, 4811.373, -3122.263, 290.908, 3.787364, 120, 0, 0), -- 28330 (Area: 66)
+(@CGUID+22, 28330, 571, 1, 1, 4774.604, -3146.782, 293.9535, 4.886922, 120, 0, 0); -- 28330 (Area: 66)
+
+DELETE FROM `gameobject` WHERE `id`=190550;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0, 190550, 571, 1, 1, 4947.931, -2845.012, 289.6788, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 4278)
+(@OGUID+1, 190550, 571, 1, 1, 4994.241, -2934.715, 289.4844, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+2, 190550, 571, 1, 1, 4959.522, -2882.375, 289.9583, -0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+3, 190550, 571, 1, 1, 4935.69, -2910.847, 289.8739, 0.4712385, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+4, 190550, 571, 1, 1, 4904.143, -2988.849, 289.7597, -2.879789, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+5, 190550, 571, 1, 1, 4901.818, -3020.541, 290.4142, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+6, 190550, 571, 1, 1, 4847.445, -2933.018, 290.703, 2.91469, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+7, 190550, 571, 1, 1, 4889.123, -2826.122, 291.1009, -2.670348, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+8, 190550, 571, 1, 1, 4959.522, -2882.375, 289.9583, -0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+9, 190550, 571, 1, 1, 4904.084, -2937.728, 289.9795, -0.9250239, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+10, 190550, 571, 1, 1, 4865.544, -2879.292, 291.0988, 0.8377574, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+11, 190550, 571, 1, 1, 4935.69, -2910.847, 289.8739, 0.4712385, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+12, 190550, 571, 1, 1, 4934.223, -2988.802, 290.0577, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+13, 190550, 571, 1, 1, 4874.853, -2981.499, 289.5772, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+14, 190550, 571, 1, 1, 4837.822, -2961.738, 290.6022, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+15, 190550, 571, 1, 1, 4834.372, -3055.432, 292.4856, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+16, 190550, 571, 1, 1, 4928.226, -2954.833, 289.3405, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 4279)
+(@OGUID+17, 190550, 571, 1, 1, 4900.326, -2870.361, 290.4038, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 0)
+(@OGUID+18, 190550, 571, 1, 1, 4971.439, -2966.859, 290.2518, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 190550 (Area: 4278)
+(@OGUID+19, 190550, 571, 1, 1, 4928.226, -2954.833, 289.3405, 2.129301, 0, 0, 0, 1, 120, 255, 1); -- 190550 (Area: 0)
+
+DELETE FROM `event_scripts` WHERE `id`=4845 AND `delay`=0 AND `command`=9 AND `datalong`=21207 AND `datalong2`=66 AND `dataint`=0 AND `x`=0 AND `y`=0 AND `z`=0 AND `o`=0 LIMIT 1;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_03_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_03_01_world.sql
new file mode 100644
index 00000000000..a242d26efe1
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_03_01_world.sql
@@ -0,0 +1,57 @@
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=28330;
+
+-- Ghostwing needs spell 59091 in relation to Crusader Olakin Sainrith in phase 64
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`= 31432 AND `spell_id`= 59091;
+
+INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES
+(31432, 59091, 1, 0);
+
+DELETE FROM `vehicle_template_accessory` WHERE `entry`=31432 AND `seat_id`=0;
+
+DELETE FROM `creature` WHERE `guid`=145119;
+
+DELETE FROM `spell_area` WHERE `spell`=58139 AND `area`IN(4588);
+INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES
+(58139, 4588, 13144, 0, 0, 0, 2, 1, 64, 11); -- Blackwatch after Killing two scourge with one skeleton
+UPDATE `creature` SET `phaseMask`=65 WHERE `guid`=123657;
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`IN(30631,31432);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(30631,31432) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(31428) AND `source_type`=0 AND `id`>4;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(30631, 0, 0, 1, 20, 0, 100, 0, 13144, 0, 0, 0, 12, 31432, 1, 90000, 0, 0, 0, 8, 0, 0, 0, 6588.43, 3278.2, 818.203, 5.044, 'Darkrider Arly - On Quest Reward - Summon Ghostwing'),
+(30631, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 12, 31428, 1, 90000, 0, 0, 0, 8, 0, 0, 0, 6648.77, 3217.7, 810.501, 1.55334, 'Darkrider Arly - On Quest Reward - Summon Crusader Olakin Sainrith'),
+(31428, 0, 5, 6, 54, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 40598, 42543, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Crusader Olakin Sainrith - On Just Summoned - Equip Items'),
+(31428, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 44, 64, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Crusader Olakin Sainrith - On Just Summoned - Set Ingame Phase 64'),
+(31428, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Crusader Olakin Sainrith - On Just Summoned - Dismount'),
+(31428, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Crusader Olakin Sainrith - On Just Summoned - Say Line 1'),
+(31428, 0, 9, 0, 38, 0, 100, 0, 2, 2, 0, 0, 11, 59091, 2, 0, 0, 0, 0, 19, 31432, 0, 0, 0, 0, 0, 0, 'Crusader Olakin Sainrith - On Data Set - Cast Ride Ghostwing'),
+(31432, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 44, 64, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ghostwing - On Just Summoned - Set Ingame Phase 64'),
+(31432, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ghostwing - On Just Summoned - Start WP'),
+(31432, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 1, 31432, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ghostwing - On Just Summoned - Set Active'),
+(31432, 0, 3, 4, 40, 0, 100, 0, 1, 31432, 0, 0, 54, 3000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ghostwing - On Reached WP1 - Pause WP'),
+(31432, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, 31428, 0, 0, 0, 0, 0, 0, 'Ghostwing - On Reached WP1 - Set Data on Crusader Olakin Sainrith'),
+(31432, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ghostwing - On Reached WP1 - Say Line 0'),
+(31432, 0, 6, 7, 40, 0, 100, 0, 2, 31432, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 30631, 0, 0, 0, 0, 0, 0, 'Ghostwing - On Reached WP2 - Say Line 0 on Darkrider Arly'),
+(31432, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 19, 31432, 0, 0, 0, 0, 0, 0, 'Ghostwing - On Reached WP2 - Despawn Crusader Olakin Sainrith'),
+(31432, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ghostwing - On Reached WP2 - Despawn ');
+
+DELETE FROM `creature_text` WHERE `entry` IN(30631,31432);
+DELETE FROM `creature_text` WHERE `entry` IN(31428) AND `groupid`=1;
+
+
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES
+(30631, 0, 0, 'Damn it, Olakin, get your arse back here! There''s work to be done!', 12, 0, 100, 5, 0, 0, 32195, 'Darkrider Arly to Crusader Olakin Sainrith'),
+(31428, 1, 0, 'Look! What''s a frostwyrm doing here? It''s coming straight for us.', 12, 0, 100, 25, 0, 0, 32173, 'Crusader Olakin Sainrith to Player'),
+(31432, 0, 0, 'Destroy our raw materials, will you? Well, the master has a special plan in mind for you... ', 12, 0, 100, 460, 0, 0, 32171, 'Ghostwing to Player');
+
+DELETE FROM `waypoints` WHERE `entry`=31432;
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(31432, 1, 6644.43, 3222.912, 823.0705, 'Ghostwing'),
+(31432, 2, 6690.65, 3177.279, 860.5705, 'Ghostwing');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=59091;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 59091, 0, 0, 31, 0, 3, 31432, 0, 0, 0, 0, '', 'Ride Ghostwing');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_00_world.sql
new file mode 100644
index 00000000000..f338d6d0043
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_00_world.sql
@@ -0,0 +1,32 @@
+/* Sunken Temple - Support for quest 3447: Secret of the Circle */
+SET @GO_GUID := 5521;
+SET @ALTAR := 148836;
+SET @LIGHT := 148883;
+SET @ATAL_ALARION := 8580;
+SET @ATALAI_IDOL := 148838;
+
+-- Altar of Hakkar
+UPDATE `gossip_menu_option` SET `action_menu_id`=1302 WHERE `menu_id`=1288;
+-- SAI: Add Pattern of lights
+UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@ALTAR;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ALTAR AND `source_type`=1 AND `id`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ALTAR*100 AND `source_type`=9 AND `id` BETWEEN 0 AND 5;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ALTAR,1,0,0,62,0,100,0,1288,0,0,0,80,@ALTAR*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On gossip option select run script'),
+(@ALTAR*100,9,0,0,1,0,100,0,0,0,0,0,50,@LIGHT,3,0,0,0,0,8,0,0,0,-515.553,95.25821,-148.7401,-1.500983, 'Script - Summon Temp GO'),
+(@ALTAR*100,9,1,0,1,0,100,0,3000,3000,0,0,50,@LIGHT,3,0,0,0,0,8,0,0,0,-419.8487,94.48368,-148.7401,-1.500983, 'Script - Summon Temp GO'),
+(@ALTAR*100,9,2,0,1,0,100,0,3000,3000,0,0,50,@LIGHT,3,0,0,0,0,8,0,0,0,-491.4003,135.9698,-148.7401,-1.500983, 'Script - Summon Temp GO'),
+(@ALTAR*100,9,3,0,1,0,100,0,3000,3000,0,0,50,@LIGHT,3,0,0,0,0,8,0,0,0,-491.4909,53.48179,-148.7401,-1.500983, 'Script - Summon Temp GO'),
+(@ALTAR*100,9,4,0,1,0,100,0,3000,3000,0,0,50,@LIGHT,3,0,0,0,0,8,0,0,0,-443.8549,136.1007,-148.7401,-1.500983, 'Script - Summon Temp GO'),
+(@ALTAR*100,9,5,0,1,0,100,0,3000,3000,0,0,50,@LIGHT,3,0,0,0,0,8,0,0,0,-443.4171,53.83124,-148.7401,-1.500983, 'Script - Summon Temp GO');
+
+-- Mini-boss Atal'alarion <Guardian of the Idol> and GameObject Idol of Hakkar
+DELETE FROM `creature` WHERE `guid`=34521 AND `id`=@ATAL_ALARION; -- spawned by script
+
+DELETE FROM `gameobject` WHERE `guid`=@GO_GUID AND `id`=@ATALAI_IDOL; -- spawned but hidden until creature die
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`zoneid`,`areaid`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`,`VerifiedBuild`) VALUES
+(@GO_GUID,@ATALAI_IDOL,109,0,0,3,1,-476.2693,94.41199,-189.7297,1.588249,0,0,0,1,-1,255,1,12340);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ATAL_ALARION AND `source_type`=0 AND `id`=7;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ATAL_ALARION,0,7,0,6,0,100,0,0,0,0,0,70,7200,0,0,0,0,0,14,@GO_GUID,@ATALAI_IDOL,0,0,0,0,0, 'Atal''alarion - On Just Died - Respawn Idol of Hakkar');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_01_world.sql
new file mode 100644
index 00000000000..b02c2eb4e79
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_01_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `gameobject` SET `spawnMask`=1 WHERE `guid`=5521;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_02_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_02_world_335.sql
new file mode 100644
index 00000000000..db8ca3a9178
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_02_world_335.sql
@@ -0,0 +1,20 @@
+-- new gossip_menu_option entries for Quest 6566 What The Wind Carries
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (3664,3665,3666,3667,3668,3669,3670);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(3664,0,0,'Please share your wisdom with me, Warchief.',8308,1,1,3665,0,0,0,'',0),
+(3665,0,0,'What discoveries?',8310,1,1,3666,0,0,0,'',0),
+(3666,0,0,'Usurper?',8312,1,1,3667,0,0,0,'',0),
+(3667,0,0,'With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?',8314,1,1,3668,0,0,0,'',0),
+(3668,0,0,'I... I did not think of it that way, Warchief.',8316,1,1,3669,0,0,0,'',0),
+(3669,0,0,'I live only to serve, Warchief! My life is empty and meaningless without your guidance.',8318,1,1,3670,0,0,0,'',0),
+(3670,0,0,'Of course, Warchief!',8320,1,1,3664,0,0,0,'',0);
+
+-- link gossip_menu_option menu_id to npc_text ID via gossip_menu (3664,4477 already exists)
+DELETE FROM `gossip_menu` WHERE `entry` IN (3665,3666,3667,3668,3669,3670);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(3665,5733),
+(3666,5734),
+(3667,5735),
+(3668,5736),
+(3669,5737),
+(3670,5738);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_03_world.sql
new file mode 100644
index 00000000000..4d148adde55
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_04_03_world.sql
@@ -0,0 +1,4 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceEntry` IN (63989,63997,63998);
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=34072;
+INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES
+(34072, 51347, 3, 0);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_05_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_05_00_world.sql
new file mode 100644
index 00000000000..8dde060140d
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_05_00_world.sql
@@ -0,0 +1,34 @@
+UPDATE `creature_template` SET `AIName`='SmartAI',`InhabitType`=4,`VehicleId`=113 WHERE `entry`=32292;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(32236,32292) AND `source_type`=0 ;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(3229200) AND `source_type`=9 ;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(32292, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Aldur''thar Sentry - On Just Summoned - Store target'),
+(32292, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 19, 32236, 0, 0, 0, 0, 0, 0, 'Aldur''thar Sentry - On Just Summoned - Move to Target'),
+(32292, 0, 2, 0, 1, 0, 100, 1, 1500, 1500, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 32236, 0, 0, 0, 0, 0, 0, 'Aldur''thar Sentry - OOC - Set Data on target'),
+(32292, 0, 3, 0, 8, 0, 100, 1, 46598, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 19, 23837, 0, 0, 0, 0, 0, 0, 'Aldur''thar Sentry - On Spellhit - Move to Target'),
+(32292, 0, 4, 0, 75, 0, 100, 1, 0, 23837, 2, 15000, 80, 3229200, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Aldur''thar Sentry - On Creature in Range - Run Script'),
+(32236, 0, 0, 0, 0, 0, 100, 0, 0, 0, 3000, 5000, 11, 32000, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - IC - Cast Mind Seer'),
+(32236, 0, 1, 0, 0, 0, 100, 0, 0, 3000, 5000, 6000, 11, 32026, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - IC - Cast Pain Spike'),
+(32236, 0, 2, 3, 8, 0, 100, 0, 5513, 0, 60000, 60000, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - On Spellhit Orb of Illusion - Store Targetlist'),
+(32236, 0, 3, 4,61, 0, 100, 0, 0, 0, 0, 0, 11, 4329, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - On Spellhit Orb of Illusion - Cast Drag and Drop: Dark Subjugator Transform'),
+(32236, 0, 4, 5,61, 0, 100, 0, 0, 0, 0, 0, 4, 15131, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - Linked with Previous Event - Play Sound'),
+(32236, 0, 5, 6,61, 0, 100, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - Linked with Previous Event - Turn random movement off'),
+(32236, 0, 6, 7,61, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - Linked with Previous Event - Set immune'),
+(32236, 0, 7, 8,61, 0, 100, 0, 0, 0, 0, 0, 11, 4328, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - Linked with Previous Event - Cast Drag and Drop: Summon Aldur''thar Sentry'),
+(32236, 0, 8, 9,61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 3000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - On Spellhit - Say'),
+(32236, 0, 9, 10,61, 0, 100, 0, 0, 0, 0, 0, 33, 32229, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - Linked with Previous Event - Kill Credit'),
+(32236, 0, 10, 0,61, 0, 100, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - Linked with Previous Event - Evade'),
+(32236, 0, 11, 0,8, 0, 100, 0, 46598, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - On Spellhit - Say'),
+(32236, 0, 12, 13,38, 0, 100, 0, 2, 2, 0, 0, 4, 15128, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - On Data Set - Play Sound'),
+(32236, 0, 13, 0,61, 0, 100, 0, 2, 2, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - On Data Set - Despawn After 5 seconds'),
+(32236, 0, 14, 0,38, 0, 100, 0, 1, 1, 0, 0, 11, 46598, 0, 0, 0, 0, 0, 19, 32292, 0, 0, 0, 0, 0, 0, 'Dark Subjugator - On Data Set - Cast Ride Vehicle Hardcoded'),
+(3229200, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 46, 20, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Aldur''thar Sentry - Script - Move forward'),
+(3229200, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 11, 50630, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Aldur''thar Sentry - On reached WP2 - Cast Eject All Passengers'),
+(3229200, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, 32236, 0, 0, 0, 0, 0, 0, 'Aldur''thar Sentry - On reached WP2 - Set Data'),
+(3229200, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 2000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Aldur''thar Sentry - On reached WP2 - Despawn After 5 seconds');
+
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`= 32292;
+INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES
+(32292, 46598, 1, 0);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_06_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_06_00_world.sql
new file mode 100644
index 00000000000..e991023e514
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_06_00_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `gameobject` WHERE `guid` IN(62187,62190,62198);
+UPDATE `smart_scripts` SET `target_type`=7 WHERE `entryorguid`=11448 AND `source_type`=0 AND `id`=2 AND `link`=0;
+UPDATE `gameobject` SET `phaseMask`=64 WHERE `guid`IN(16974,16976,99723);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_06_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_06_01_world.sql
new file mode 100644
index 00000000000..183121d6735
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_06_01_world.sql
@@ -0,0 +1,7 @@
+UPDATE `smart_scripts` SET `link`=1 WHERE `entryorguid`IN (28064,28304,28305) AND `source_type`=0 AND `id`=0 AND `link`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN (28064,28304,28305) AND `source_type`=0 AND `id`=1;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(28064, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 51249, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Drakkari Pedestal 01 - On Spellhit \'Place Banner\' - Cast Summon Agent Crusade Banner'),
+(28304, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 51249, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Drakkari Pedestal 02 - On Spellhit \'Place Banner\' - Cast Summon Agent Crusade Banner'),
+(28305, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 51249, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Drakkari Pedestal 02 - On Spellhit \'Place Banner\' - Cast Summon Agent Crusade Banner');
+UPDATE `creature` SET `spawndist`=0, `MovementType`=0 WHERE `guid` IN(109153,109501,110958);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_07_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_07_00_world.sql
new file mode 100644
index 00000000000..b9df4d07bb9
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_07_00_world.sql
@@ -0,0 +1,10 @@
+--
+UPDATE `gameobject` SET `spawntimesecs`= 2 WHERE `guid` IN
+(9175, -- Deserter Propaganda
+40667, -- The Book of Ur
+40774, -- Tool Kit
+40775, -- Damaged Diving Gear
+66308, -- New Avalon Patrol Schedule
+66377, -- Empty Cauldron
+66378, -- Iron Chain
+66384); -- New Avalon Registry
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_07_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_07_01_world.sql
new file mode 100644
index 00000000000..d74f4296903
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_07_01_world.sql
@@ -0,0 +1,112 @@
+--
+-- Spelling, grammar and typo corrections, `trinity_string`, branch 3.3.5:
+--
+UPDATE `trinity_string` SET `content_default`= "The command %s uses the following subcommands:%s" WHERE `entry`= 8;
+UPDATE `trinity_string` SET `content_default`= "The following GMs are active on this server:" WHERE `entry`= 16;
+UPDATE `trinity_string` SET `content_default`= "%s's flying command failed." WHERE `entry`= 21;
+UPDATE `trinity_string` SET `content_default`= "Up to %u expansions are allowed now." WHERE `entry`= 61;
+UPDATE `trinity_string` SET `content_default`= "One or more parameters contain incorrect values." WHERE `entry`= 62;
+UPDATE `trinity_string` SET `content_default`= "Wrong parameter, id: %u does not exist." WHERE `entry`= 63;
+UPDATE `trinity_string` SET `content_default`= "%s is appearing at your location." WHERE `entry`= 114;
+UPDATE `trinity_string` SET `content_default`= "GUID %i, faction is %i, flags is %i, npcflag is %i, dynflag is %i." WHERE `entry`= 128;
+UPDATE `trinity_string` SET `content_default`= "You changed GUID=%i's Faction to %i, flags to %i, npcflag to %i, dynflag to %i." WHERE `entry`= 130;
+UPDATE `trinity_string` SET `content_default`= "You set all speeds of %s from normal to %2.2f." WHERE `entry`= 137;
+UPDATE `trinity_string` SET `content_default`= "%s set all your speeds from normal to %2.2f." WHERE `entry`= 138;
+UPDATE `trinity_string` SET `content_default`= "You set the speed of %s from normal to %2.2f." WHERE `entry`= 139;
+UPDATE `trinity_string` SET `content_default`= "%s set your speed from normal to %2.2f." WHERE `entry`= 140;
+UPDATE `trinity_string` SET `content_default`= "You set the swim speed of %s from normal to %2.2f." WHERE `entry`= 141;
+UPDATE `trinity_string` SET `content_default`= "%s set your swim speed from normal to %2.2f." WHERE `entry`= 142;
+UPDATE `trinity_string` SET `content_default`= "You set the backwards run speed of %s from normal to %2.2f." WHERE `entry`= 143;
+UPDATE `trinity_string` SET `content_default`= "%s set your backwards run speed from normal to %2.2f." WHERE `entry`= 144;
+UPDATE `trinity_string` SET `content_default`= "You set the fly speed of %s from normal to %2.2f." WHERE `entry`= 145;
+UPDATE `trinity_string` SET `content_default`= "%s set your fly speed from normal to %2.2f." WHERE `entry`= 146;
+UPDATE `trinity_string` SET `content_default`= "You set the size of %s to %2.2f." WHERE `entry`= 147;
+UPDATE `trinity_string` SET `content_default`= "You take all the copper from %s." WHERE `entry`= 153;
+UPDATE `trinity_string` SET `content_default`= "You play the sound %u." WHERE `entry`= 159;
+UPDATE `trinity_string` SET `content_default`= "The following locations were found:\n%s" WHERE `entry`= 168;
+UPDATE `trinity_string` SET `content_default`= "You tried to play the sound %u, but it does not exist." WHERE `entry`= 170;
+UPDATE `trinity_string` SET `content_default`= "You can't teleport yourself to yourself!" WHERE `entry`= 171;
+UPDATE `trinity_string` SET `content_default`= "You changed the runic power of %s to %i/%i." WHERE `entry`= 173;
+UPDATE `trinity_string` SET `content_default`= "Error, a name can only contain the characters A-Z and a-z." WHERE `entry`= 203;
+UPDATE `trinity_string` SET `content_default`= "Item '%u' (with extended cost %u) is already in the vendor list." WHERE `entry`= 210;
+UPDATE `trinity_string` SET `content_default`= "Spells will be reset for all players at login. Relogging is strongly recommended!" WHERE `entry`= 218;
+UPDATE `trinity_string` SET `content_default`= "Talents will be reset for all players at login. Relogging is strongly recommended!" WHERE `entry`= 219;
+UPDATE `trinity_string` SET `content_default`= "No waypoints found in the database." WHERE `entry`= 239;
+UPDATE `trinity_string` SET `content_default`= "Warning: Could not delete WP with ID: %d from the world" WHERE `entry`= 242;
+UPDATE `trinity_string` SET `content_default`= "Invalid target map or coordinates (X: %f Y: %f MapId: %u)" WHERE `entry`= 263;
+UPDATE `trinity_string` SET `content_default`= "Invalid zone coordinates (X: %f Y: %f AreaId: %u)" WHERE `entry`= 264;
+UPDATE `trinity_string` SET `content_default`= "Game Object (GUID: %u) is referenced by nonexistent creature %u in GO list, can't be deleted." WHERE `entry`= 274;
+UPDATE `trinity_string` SET `content_default`= "You can't kick yourself, log out instead." WHERE `entry`= 281;
+UPDATE `trinity_string` SET `content_default`= "Show new ticket: ON" WHERE `entry`= 291;
+UPDATE `trinity_string` SET `content_default`= "Show new ticket: OFF" WHERE `entry`= 292;
+UPDATE `trinity_string` SET `content_default`= "%s's honor points were set to %u." WHERE `entry`= 299;
+UPDATE `trinity_string` SET `content_default`= "Extended item cost %u does not exist." WHERE `entry`= 331;
+UPDATE `trinity_string` SET `content_default`= "You repair all of %s's items." WHERE `entry`= 336;
+UPDATE `trinity_string` SET `content_default`= "All your items were repaired by %s." WHERE `entry`= 337;
+UPDATE `trinity_string` SET `content_default`= "Game Object (Entry: %u) contains invalid data and can't be spawned." WHERE `entry`= 348;
+UPDATE `trinity_string` SET `content_default`= "Title %u (%s) set as current selected title for player %s." WHERE `entry`= 355;
+UPDATE `trinity_string` SET `content_default`= "Current selected title for player %s is now reset to not known." WHERE `entry`= 356;
+UPDATE `trinity_string` SET `content_default`= "Security level of account %s changed to %i." WHERE `entry`= 401;
+UPDATE `trinity_string` SET `content_default`= "Your security level is too low for this action." WHERE `entry`= 403;
+UPDATE `trinity_string` SET `content_default`= "Account %s does not exist." WHERE `entry`= 413;
+UPDATE `trinity_string` SET `content_default`= "Account %s has never been banned." WHERE `entry`= 416;
+UPDATE `trinity_string` SET `content_default`= "You learned all crafts, skills and recipes." WHERE `entry`= 433;
+UPDATE `trinity_string` SET `content_default`= "Graveyard #%u is already linked to zone #%u (current)." WHERE `entry`= 450;
+UPDATE `trinity_string` SET `content_default`= "Graveyard #%u can not be linked to subzone or nonexistent zone #%u (internal error)." WHERE `entry`= 452;
+UPDATE `trinity_string` SET `content_default`= "No faction found in Graveyard with id= #%u, please update your database." WHERE `entry`= 454;
+UPDATE `trinity_string` SET `content_default`= "Invalid team, please update your database." WHERE `entry`= 455;
+UPDATE `trinity_string` SET `content_default`= "Quest %u is started from an item. Add the item to your inventory and start the quest normally: .additem %u" WHERE `entry`= 472;
+UPDATE `trinity_string` SET `content_default`= "Player %s must have the skill %u (%s) before using this command." WHERE `entry`= 485;
+UPDATE `trinity_string` SET `content_default`= "Target(%s) already knows that spell." WHERE `entry`= 489;
+UPDATE `trinity_string` SET `content_default`= "You have already unlearnt that spell." WHERE `entry`= 491;
+UPDATE `trinity_string` SET `content_default`= "That player is already in a guild." WHERE `entry`= 500;
+UPDATE `trinity_string` SET `content_default`= "The guild was NOT created. Check if that guild already exists." WHERE `entry`= 501;
+UPDATE `trinity_string` SET `content_default`= "No items from the itemset '%u' were found." WHERE `entry`= 502;
+UPDATE `trinity_string` SET `content_default`= "Item '%i' '%s' added to slot %i." WHERE `entry`= 506;
+UPDATE `trinity_string` SET `content_default`= "NPC currently selected by player:\nDB GUID: %u, current GUID: %u.\nFaction: %u.\nnpcFlags: %u.\nEntry: %u.\nDisplayID: %u (Native: %u)." WHERE `entry`= 539;
+UPDATE `trinity_string` SET `content_default`= "%s no longer has any explored zones." WHERE `entry`= 552;
+UPDATE `trinity_string` SET `content_default`= "Found nearby creatures (distance %f): %u" WHERE `entry`= 556;
+UPDATE `trinity_string` SET `content_default`= "%s leveled you up to (%i)." WHERE `entry`= 557;
+UPDATE `trinity_string` SET `content_default`= "%s leveled you down to (%i)." WHERE `entry`= 558;
+UPDATE `trinity_string` SET `content_default`= "%s has reset your level progress." WHERE `entry`= 559;
+UPDATE `trinity_string` SET `content_default`= "The value index %u is too big for %u (count: %u)." WHERE `entry`= 564;
+UPDATE `trinity_string` SET `content_default`= "The selected player or creature does not have a victim." WHERE `entry`= 579;
+UPDATE `trinity_string` SET `content_default`= "Player %s has learned all default spells for race/class and spell rewards from completed quests." WHERE `entry`= 580;
+UPDATE `trinity_string` SET `content_default`= "Found nearby gameobjects (distance %f): %u" WHERE `entry`= 581;
+UPDATE `trinity_string` SET `content_default`= "SpawnTime: Full:%s Remaining:%s" WHERE `entry`= 582;
+UPDATE `trinity_string` SET `content_default`= "No event found." WHERE `entry`= 584;
+UPDATE `trinity_string` SET `content_default`= "The event does not exist." WHERE `entry`= 585;
+UPDATE `trinity_string` SET `content_default`= "The event %u is already active." WHERE `entry`= 587;
+UPDATE `trinity_string` SET `content_default`= "The event %u is not active." WHERE `entry`= 588;
+UPDATE `trinity_string` SET `content_default`= "You have learned all spells from the craft: %s" WHERE `entry`= 592;
+UPDATE `trinity_string` SET `content_default`= "Item(s) can not be equipped or stored in the inventory due to a problem." WHERE `entry`= 706;
+UPDATE `trinity_string` SET `content_default`= "An email address is required to change your password." WHERE `entry`= 881;
+UPDATE `trinity_string` SET `content_default`= "The account %s was NOT deleted (the SQL file format was probably updated)." WHERE `entry`= 1002;
+UPDATE `trinity_string` SET `content_default`= "The account %s was NOT deleted (unknown error)." WHERE `entry`= 1003;
+UPDATE `trinity_string` SET `content_default`= "An account name can NOT be longer than 16 characters (client limit). The account was NOT created." WHERE `entry`= 1005;
+UPDATE `trinity_string` SET `content_default`= "An account with this name already exists!" WHERE `entry`= 1006;
+UPDATE `trinity_string` SET `content_default`= "The account %s was NOT created (the SQL file format was probably updated)." WHERE `entry`= 1007;
+UPDATE `trinity_string` SET `content_default`= "The account %s was NOT created (unknown error)." WHERE `entry`= 1008;
+UPDATE `trinity_string` SET `content_default`= "The character '%s' (GUID: %u Account %u) can NOT be restored: The account does not exist!" WHERE `entry`= 1023;
+UPDATE `trinity_string` SET `content_default`= "The character '%s' (GUID: %u Account %u) can NOT be restored: The account character list is full!" WHERE `entry`= 1024;
+UPDATE `trinity_string` SET `content_default`= "The character '%s' (GUID: %u Account %u) can NOT be restored: The name is already in use!" WHERE `entry`= 1025;
+UPDATE `trinity_string` SET `content_default`= "The account %s (Id: %u) is allowed to use up to %u expansion(s) now." WHERE `entry`= 1100;
+UPDATE `trinity_string` SET `content_default`= "The account %s (%u) has reached maximum amount of allowed characters (client limitation)." WHERE `entry`= 1113;
+UPDATE `trinity_string` SET `content_default`= "The dump file contains damaged data!" WHERE `entry`= 1114;
+UPDATE `trinity_string` SET `content_default`= "The character guid %u is already in use!" WHERE `entry`= 1117;
+UPDATE `trinity_string` SET `content_default`= "You changed the gender of %s to %s." WHERE `entry`= 1120;
+UPDATE `trinity_string` SET `content_default`= "Your gender was changed to %s by %s." WHERE `entry`= 1121;
+UPDATE `trinity_string` SET `content_default`= "No pet found." WHERE `entry`= 1123;
+UPDATE `trinity_string` SET `content_default`= "Wrong pet type." WHERE `entry`= 1124;
+UPDATE `trinity_string` SET `content_default`= "Your pet has learned all talents." WHERE `entry`= 1125;
+UPDATE `trinity_string` SET `content_default`= "The talents of %s's pet were reset." WHERE `entry`= 1127;
+UPDATE `trinity_string` SET `content_default`= "Unable to dump deleted characters, aborting." WHERE `entry`= 1130;
+UPDATE `trinity_string` SET `content_default`= "All configs are reloaded from the configuration file(s)." WHERE `entry`= 1157;
+UPDATE `trinity_string` SET `content_default`= "Invalid name specified. The name must be a name of an online Game Master." WHERE `entry`= 2012;
+UPDATE `trinity_string` SET `content_default`= "You cannot unassign tickets from staff members with a higher security level than yourself." WHERE `entry`= 2015;
+UPDATE `trinity_string` SET `content_default`= "It might be amusing, but no... you cant freeze yourself." WHERE `entry`= 5001;
+UPDATE `trinity_string` SET `content_default`= "Invalid input, check the name of the target." WHERE `entry`= 5002;
+UPDATE `trinity_string` SET `content_default`= "You can't teleport yourself to yourself!" WHERE `entry`= 5011;
+UPDATE `trinity_string` SET `content_default`= "No reason given." WHERE `entry`= 5035;
+UPDATE `trinity_string` SET `content_default`= "You are outdoors." WHERE `entry`= 5042;
+UPDATE `trinity_string` SET `content_default`= "You are indoors." WHERE `entry`= 5043;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_09_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_09_00_world.sql
new file mode 100644
index 00000000000..d3ebf1af0ff
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_09_00_world.sql
@@ -0,0 +1,38 @@
+UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(4968,23704);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(4968,23704) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(2370400) AND `source_type`=9;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(4968, 0, 0, 1, 62, 0, 100, 0, 2465, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Gossip Select - Close Gossip'),
+(4968, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 1, 6, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Gossip Select - Say Line 6'),
+(4968, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 23122, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Gossip Select - Cast Jaina''s Autograph'),
+(4968, 0, 3, 4, 20, 0, 100, 0, 11142, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Quest Reward (Survey Alcaz Island - Face player'),
+(4968, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 5000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Quest Reward (Survey Alcaz Island - Say Line 0'), -- 04:20:13.000
+(4968, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Quest Reward (Survey Alcaz Island - Set NPC Flags'),
+(4968, 0, 6, 0, 52, 0, 100, 0, 0, 4968, 0, 0, 1, 1, 7000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Text Over Line 0 - Say Line 1'), -- 04:20:18.000
+(4968, 0, 7, 0, 52, 0, 100, 0, 1, 4968, 0, 0, 1, 2, 6000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Text Over Line 1 - Say Line 2'), -- 04:20:25.000
+(4968, 0, 8, 0, 52, 0, 100, 0, 2, 4968, 0, 0, 1, 3, 7000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Text Over Line 2 - Say Line 3'), -- 04:20:31.000
+(4968, 0, 9, 0, 52, 0, 100, 0, 3, 4968, 0, 0, 1, 4, 6000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Text Over Line 3 - Say Line 4'), -- 04:20:38.000
+(4968, 0, 10, 0, 52, 0, 100, 0, 4, 4968, 0, 0, 1, 5, 5000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Text Over Line 4 - Say Line 5'), -- 04:20:44.000
+(4968, 0, 11, 12, 52, 0, 100, 0, 5, 4968, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Text Over Line 5 - Set Npc Flag'),
+(4968, 0, 12, 0, 61, 0, 100, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Text Over Line 5 - Evade'),
+(23704, 0, 0, 1, 62, 0, 100, 0, 8782, 0, 0, 0, 11, 42295, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Cassa Crimsonwing - On Gossip Option 0 Selected - Cast Spell 42295'),
+(23704, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Cassa Crimsonwing - On Linked Actions - Close Gossip');
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=2465;
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES
+(2465, 0, 0, 'Lady Jaina, this may sound like an odd request... but I have a young ward who is quite shy. You are a hero to him, and he asked me to get your autograph.', 9663, 1, 1, 0, 0, 0, 0, '', 0);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=2465;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(15, 2465, 0, 0, 0, 9, 0, 558, 0, 0, 0, 0, 0, '', 'Lady Jaina Proudmoore Shows gossip option 2465 if player has quest Jaina''s Autograph');
+
+DELETE FROM `creature_text` WHERE `entry`=4968;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `comment`) VALUES
+(4968, 0, 0, 'Perhaps I should explain...', 12, 0, 100, 1, 0, 0, 33092, 'Lady Jaina Proudmoore to Player'),
+(4968, 1, 0, 'I had arranged for a secret summit between Warchief Thrall and King Wrynn, here in Theramore.', 12, 0, 100, 1, 0, 0, 33093, 'Lady Jaina Proudmoore to Player'),
+(4968, 2, 0, 'The king was to travel here by ship, in secret. But the ship never arrived, and King Wrynn disappeared.', 12, 0, 100, 1, 0, 0, 33094, 'Lady Jaina Proudmoore to Player'),
+(4968, 3, 0, 'Your help enabled us to connect the Defias to the mastermind behind the abduction, Onyxia, who was posing as a member of the royal court.', 12, 0, 100, 1, 0, 0, 33095, 'Lady Jaina Proudmoore to Player'),
+(4968, 4, 0, 'Meanwhile, the king managed to escape his captors, and returned to Stormwind to deal with Onyxia.', 12, 0, 100, 1, 0, 0, 33096, 'Lady Jaina Proudmoore to Player'),
+(4968, 5, 0, 'I will send word that you have discovered the link to the Defias. I was a fool to think them broken with the defeat of Edwin Van Cleef, and King Wrynn will want to make an example of all who remain.', 12, 0, 100, 1, 0, 0, 33097, 'Lady Jaina Proudmoore to Player'),
+(4968, 6, 0, 'Why... that is very sweet of you. I gather that you are volunteering time for Children''s Week, yes $c? Well, you are to be commended. It is imperative that we remember those less fortunate - especially the children.$B$BI''d be happy to sign an autograph. Here you go.', 12, 0, 100, 1, 0, 0, 9665, 'Lady Jaina Proudmoore to Player');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_10_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_10_00_world.sql
new file mode 100644
index 00000000000..e3170b27499
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_10_00_world.sql
@@ -0,0 +1,4 @@
+DELETE FROM `creature_text` WHERE `entry`=4968 AND `groupid`=6 AND `id`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=4968 AND `source_type`=0 AND `id` IN(1,2);
+UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=4968 AND `source_type`=0 AND `id`=0 AND `link`=1;
+UPDATE `gossip_menu_option` SET `action_menu_id`=5850 WHERE `menu_id`=2465 AND `id`=0;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_10_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_10_01_world.sql
new file mode 100644
index 00000000000..80b23be82c2
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_10_01_world.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_area` WHERE `spell`=42316 AND `area`=2079 AND `quest_start`=11142 AND `aura_spell`=0 AND `racemask`=1101 AND `gender`=2;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = -42385;
+INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
+(-42385, 42316, 0, 'On remove Alcaz Survey Aura - cast Alcaz Survey Credit');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_12_2015_11_14_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_12_2015_11_14_00_world.sql
new file mode 100644
index 00000000000..b3e49eb1114
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_12_2015_11_14_00_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `trinity_string` WHERE `entry`=186;
+INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
+(186, 'TransMapID: %u TransOffsetX: %f TransOffsetY: %f TransOffsetZ: %f TransOffsetO: %f (Transport ID: %u %s)');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_13_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_13_00_world.sql
new file mode 100644
index 00000000000..0c45636d945
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_13_00_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sindragosa_ice_tomb_target';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(69712, 'spell_sindragosa_ice_tomb_target');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_13_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_13_01_world.sql
new file mode 100644
index 00000000000..12bc205f125
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_13_01_world.sql
@@ -0,0 +1,106 @@
+-- Fix quests Incense for the Festival Scorchlings and Incense for the Summer Scorchlings
+DELETE FROM `creature_queststarter` WHERE `quest`=11964;
+-- SAI for Festival Talespinner
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=16818;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=16818;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(16818,0,0,0,19,0,100,0,11966,0,0,0,11,46826,0,0,0,0,0,7,0,0,0,0,0,0,0,'Festival Talespinner - On target quest accepted - Cast Flame Keeper Breadcrumb');
+-- SAI for Festival Loremaster
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=16817;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=16817;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(16817,0,0,0,19,0,100,0,11964,0,0,0,11,46825,0,0,0,0,0,7,0,0,0,0,0,0,0,'Festival Loremaster - On target quest accepted - Cast Flame Warden Breadcrumb');
+-- Whisp of Ragnaros flag not selectable
+UPDATE `creature_template` SET `unit_flags`=33554432 WHERE `entry`=26502;
+-- SAI for Festival Schorchling
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=26520;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=26520;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=2652000;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(26520,0,0,0,8,0,100,0,47104,0,0,0,80,2652000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - On spell hit - Run script '),
+(2652000,9,1,0,0,0,100,0,0,0,0,0,1,0,2000,0,0,0,0,21,3,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 0'),
+(2652000,9,2,0,0,0,100,0,1000,1000,0,0,1,1,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 1'),
+(2652000,9,3,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,4,0,0,0,100,0,0,0,0,0,1,2,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 2'),
+(2652000,9,5,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,6,0,0,0,100,0,0,0,0,0,1,3,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 3'),
+(2652000,9,7,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,8,0,0,0,100,0,0,0,0,0,1,4,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 4'),
+(2652000,9,9,0,0,0,100,0,1000,1000,0,0,1,5,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 5'),
+(2652000,9,10,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,11,0,0,0,100,0,0,0,0,0,1,6,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 6'),
+(2652000,9,12,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,13,0,0,0,100,0,0,0,0,0,1,7,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 7'),
+(2652000,9,14,0,0,0,100,0,0,0,0,0,11,47120,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Summon Whisp of Ragnaros'),
+(2652000,9,15,0,0,0,100,0,0,0,0,0,75,45889,0,0,0,0,0,11,26502,10,0,0,0,0,0,'Festival Scorchling - Action list - Aura Scorchling Blast'),
+(2652000,9,16,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,17,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,11,26502,10,0,0,0,0,0,'Festival Scorchling - Action list - Despawn Whisp of Ragnaros '),
+(2652000,9,18,0,0,0,100,0,0,0,0,0,1,8,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 8'),
+(2652000,9,19,0,0,0,100,0,0,0,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,20,0,0,0,100,0,0,0,0,0,1,9,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 9'),
+(2652000,9,21,0,0,0,100,0,1000,1000,0,0,11,46660,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast Extinguished'),
+(2652000,9,22,0,0,0,100,0,0,0,0,0,28,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Remove aura from grow'),
+(2652000,9,23,0,0,0,100,0,3000,3000,0,0,1,10,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 10');
+-- Festival Scorchling texts
+DELETE FROM `creature_text` WHERE `entry`= 26520;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES
+(26520,0,0,'Thank you again, $n, for this delectable incense.',12,0,100,1,1000,0,'Festival Scorchling',25699),
+(26520,1,0,'%s devours the incense. It\'s ravenous!',16,0,100,1,1000,0,'Festival Scorchling',25717),
+(26520,2,0,'So good! So packed with energy!',12,0,100,1,1000,0,'Festival Scorchling',25718),
+(26520,3,0,'It has everything a growing scorchling needs!',12,0,100,1,1000,0,'Festival Scorchling',25719),
+(26520,4,0,'I can feel the power SURGING within me!',12,0,100,1,1000,0,'Festival Scorchling',25730),
+(26520,5,0,'%s bellows with laughter!',16,0,100,1,1000,0,'Festival Scorchling',25720),
+(26520,6,0,'Now! Finally! Our plans can take effect!',12,0,100,1,1000,0,'Festival Scorchling',25721),
+(26520,7,0,'KNEEL, LITTLE MORTAL! KNEEL BEFORE THE MIGHT OF THE HERALD OF RAGNAROS!',12,0,100,1,1000,0,'Festival Scorchling',25722),
+(26520,8,0,'YOU WILL ALL PERISH IN FLAMES!',12,0,100,1,1000,0,'Festival Scorchling',25723),
+(26520,9,0,'%s blinks...',16,0,100,1,1000,0,'Festival Scorchling',25724),
+(26520,10,0,'Ah. I was merely jesting...',12,0,100,1,1000,0,'Festival Scorchling',25725);
+-- SAI for Summer Schorchling
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=26401;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=26401;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=2640100;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(26401,0,0,0,8,0,100,0,47104,0,0,0,80,2640100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - On spell hit - Start script'),
+(2640100,9,1,0,0,0,100,0,0,0,0,0,1,0,2000,0,0,0,0,21,3,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 0'),
+(2640100,9,2,0,0,0,100,0,1000,1000,0,0,1,1,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 1'),
+(2640100,9,3,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,4,0,0,0,100,0,0,0,0,0,1,2,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 2'),
+(2640100,9,5,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 5 - Cast grow'),
+(2640100,9,6,0,0,0,100,0,0,0,0,0,1,3,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 3'),
+(2640100,9,7,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,8,0,0,0,100,0,0,0,0,0,1,4,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 4'),
+(2640100,9,9,0,0,0,100,0,1000,1000,0,0,1,5,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 5'),
+(2640100,9,10,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,11,0,0,0,100,0,0,0,0,0,1,6,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 6'),
+(2640100,9,12,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,13,0,0,0,100,0,0,0,0,0,1,7,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 7'),
+(2640100,9,14,0,0,0,100,0,0,0,0,0,11,47120,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Summon Whisp of Ragnaros'),
+(2640100,9,15,0,0,0,100,0,0,0,0,0,75,45889,0,0,0,0,0,11,26502,10,0,0,0,0,0,'Summer Scorchling - Action list - Aura Scorchling Blast'),
+(2640100,9,16,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,17,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,11,26502,10,0,0,0,0,0,'Summer Scorchling - Action list - Despawn Whisp of Ragnaros '),
+(2640100,9,18,0,0,0,100,0,0,0,0,0,1,8,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 8'),
+(2640100,9,19,0,0,0,100,0,0,0,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,20,0,0,0,100,0,0,0,0,0,1,9,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 9'),
+(2640100,9,21,0,0,0,100,0,1000,1000,0,0,11,46660,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast Extinguished'),
+(2640100,9,22,0,0,0,100,0,0,0,0,0,28,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Remove aura from grow'),
+(2640100,9,23,0,0,0,100,0,3000,3000,0,0,1,10,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 10');
+-- Summer Scorchling texts
+DELETE FROM `creature_text` WHERE `entry`= 26401;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES
+(26401,0,0,'Thank you again, $n, for this delectable incense.',12,0,100,1,1000,0,'Summer Scorchling',25699),
+(26401,1,0,'%s devours the incense. It\'s ravenous!',16,0,100,1,1000,0,'Summer Scorchling',25717),
+(26401,2,0,'So good! So packed with energy!',12,0,100,1,1000,0,'Summer Scorchling',25718),
+(26401,3,0,'It has everything a growing scorchling needs!',12,0,100,1,1000,0,'Summer Scorchling',25719),
+(26401,4,0,'I can feel the power SURGING within me!',12,0,100,1,1000,0,'Summer Scorchling',25730),
+(26401,5,0,'%s bellows with laughter!',16,0,100,1,1000,0,'Summer Scorchling',25720),
+(26401,6,0,'Now! Finally! Our plans can take effect!',12,0,100,1,1000,0,'Summer Scorchling',25721),
+(26401,7,0,'KNEEL, LITTLE MORTAL! KNEEL BEFORE THE MIGHT OF THE HERALD OF RAGNAROS!',12,0,100,1,1000,0,'Summer Scorchling',25722),
+(26401,8,0,'YOU WILL ALL PERISH IN FLAMES!',12,0,100,1,1000,0,'Summer Scorchling',25723),
+(26401,9,0,'%s blinks...',16,0,100,1,1000,0,'Summer Scorchling',25724),
+(26401,10,0,'Ah. I was merely jesting...',12,0,100,1,1000,0,'Summer Scorchling',25725);
+
+-- Add conditions for spell Scorchling Gets Incense
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=47104;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition` ,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,47104,0,1,31,0,3,26520,0,0,0,'','Scorchling gets incense can hit Festival Scorchling'),
+(13,1,47104,0,2,31,0,3,26401,0,0,0,'','Scorchling gets incense can hit Summer Scorchling');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_15_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_15_00_world.sql
new file mode 100644
index 00000000000..69e2e3a873b
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_15_00_world.sql
@@ -0,0 +1,4 @@
+SET @ENTRY := 62266;
+DELETE FROM `disables` WHERE `sourceType`=0 AND `entry` = @ENTRY;
+INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES
+(0,@ENTRY,64,0,0,'Disable LOS for Spell Trigger 3 adds');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_00_world.sql
new file mode 100644
index 00000000000..ce96286d585
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_00_world.sql
@@ -0,0 +1,66 @@
+UPDATE `smart_scripts` SET `target_type`=7 WHERE `entryorguid`=19227 AND `source_type`=0 AND `id`=1 AND `link`=0;
+
+UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(20232);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(20232,20206) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(2020600,2020601,2020602) AND `source_type`=9;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(20232, 0, 0, 0, 20, 0, 100, 0, 10344, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Wing Commander Gryphongar - On quest reward (Wing Commander Gryphongar) - Say'),
+(20206, 0, 0, 1, 20, 0, 100, 0, 10919, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On Quest \'Fei Fei\'s Treat\' Finished - Set Active'),
+(20206, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On Quest \'Fei Fei\'s Treat\' Finished - Set NPC Flags'),
+(20206, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 20206, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On Quest \'Fei Fei\'s Treat\' Finished - Start Waypoints'),
+(20206, 0, 3, 4, 40, 0, 100, 0, 1, 20206, 0, 0, 54, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On reached WP1 - Pause WP'),
+(20206, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2020600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On reached WP1 - Run Script 1'),
+(20206, 0, 5, 6, 40, 0, 100, 0, 12, 20206, 0, 0, 54, 1000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On reached WP12 - Pause WP'),
+(20206, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On reached WP12 - Say Line 3'),
+(20206, 0, 7, 8, 40, 0, 100, 0, 8, 20206, 0, 0, 54, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On reached WP8 - Pause WP'),
+(20206, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2020600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On reached WP8 - Run Script 2'),
+(20206, 0, 9, 10, 40, 0, 100, 0, 14, 20206, 0, 0, 54, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On reached WP14 - Pause WP'),
+(20206, 0, 10, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2020601, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On reached WP14 - Run Script 3'),
+(20206, 0, 11, 12, 40, 0, 100, 0, 16, 20206, 0, 0, 81, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On reached WP16 - Set NPC Flags'),
+(20206, 0, 12, 13, 61, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 2.22254, 'Fei Fei - On reached WP16 - Set Orientation'),
+(20206, 0, 13, 0, 61, 0, 100, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - On reached WP16 - Set Active Off'),
+
+
+(2020600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - Script 1 - Say Line 1'), -- 22:32:01.531
+(2020600, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - Script 1 - Play Emote 35'), -- 22:32:02.625
+(2020600, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 11, 39216, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - Script 1 - Cast Create Fei Fei Stash'), -- 22:32:03.812
+(2020600, 9, 3, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - Script 1 - Say Line 2'), -- 22:32:05.156
+
+(2020601, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - Script 3 - Say Line 1'), -- 22:32:43.656
+(2020601, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - Script 3 - Play Emote 35'), -- 22:32:45.062
+(2020601, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fei Fei - Script 3 - Say Line 4'); -- 22:32:46.484
+
+DELETE FROM `creature_text` WHERE `entry` IN(20232,20206);
+DELETE FROM `creature_text` WHERE `entry` IN(19308) AND `groupid`=0 AND `id`=3;
+
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(20232, 0, 0, 'Welcome to Shatter Point, $n! I hope you survive the experience!', 12, 0, 100, 1, 0, 0, 18272, 0, 'Wing Commander Gryphongar'),
+(19308, 0, 3, 'I regret to inform you all that we sent home another ten soldiers today - in body bags.', 12, 7, 100, 1, 0, 0, 16455, 0, 'Marshal Isildor'),
+(20206, 0, 0, '%s digs in the dirt...', 16, 0, 100, 35, 0, 0, 20312, 0, 'Fei Fei to Fei Fei Stash Bunny'),
+(20206, 1, 0, '%s sniffs around, unsatisfied with this hiding spot.', 16, 0, 100, 0, 0, 0, 20315, 0,'Fei Fei to Fei Fei Stash Bunny'),
+(20206, 2, 0, '%s looks for a hiding spot...', 16, 0, 100, 0, 0, 0, 20316, 0,'Fei Fei to Fei Fei Stash Bunny'),
+(20206, 3, 0, '%s buries his treat!', 16, 0, 100, 0, 0, 0, 20313, 0,'Fei Fei to Fei Fei Stash Bunny');
+
+DELETE FROM `waypoints` WHERE `entry`=20206;
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(20206, 1, -689.1158, 2630.12, 89.82688, 'Fei Fei'),
+(20206, 2,-690.6677 ,2634.433 ,90.20647, 'Fei Fei'),
+(20206, 3,-689.6677 ,2656.183 ,92.45647, 'Fei Fei'),
+(20206, 4,-686.1677 ,2679.433 ,92.20647, 'Fei Fei'),
+(20206, 5,-678.6677 ,2699.683 ,94.95647, 'Fei Fei'),
+(20206, 6,-671.6677 ,2710.683 ,94.70647, 'Fei Fei'),
+(20206, 7,-667.1677 ,2725.933 ,94.20647, 'Fei Fei'),
+(20206, 8,-666.6677 ,2729.433 ,93.95647, 'Fei Fei'),
+(20206, 9,-671.9177 ,2732.183 ,93.95647, 'Fei Fei'),
+(20206, 10,-680.6677 ,2732.683 ,93.95647, 'Fei Fei'),
+(20206, 11,-685.9177 ,2734.933 ,94.20647, 'Fei Fei'),
+(20206, 12,-686.4177 ,2742.183 ,93.95647, 'Fei Fei'),
+(20206, 13,-690.9177 ,2746.683 ,93.95647, 'Fei Fei'),
+(20206, 14,-698.7195, 2743.245, 94.08604, 'Fei Fei'),
+(20206, 15,-669.3355, 2727.604, 94.01691, 'Fei Fei'),
+(20206, 16,-684.603, 2626.44, 89.1955, 'Fei Fei');
+
+DELETE FROM `gameobject` WHERE `id` =185302;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(28524, 185302, 530, 1, 1, -699.4442, 2742.403, 94.18588, -0.5759573, 0, 0, 0, 1, 120, 255, 1); -- 185302 (Area: 0)
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_01_world.sql
new file mode 100644
index 00000000000..79452fdf43c
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_01_world.sql
@@ -0,0 +1,64 @@
+UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI', scriptname='' WHERE `entry` IN (177243, 177365, 177366, 177367, 177368, 177369, 177397, 177398, 177399, 177400);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (177243, 177365, 177366, 177367, 177368, 177369, 177397, 177398, 177399, 177400) AND `source_type`=1;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (17724300, 17736500, 17736600, 17736700, 17736800, 17736900, 17739700, 17739800, 17739900, 17740000) AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+
+(177243,1,0,0,70,0,100,0,2,0,0,0,80,17724300,2,0,0,0,0,1,0,0,0,0,0,0,0,'demon portal - on state change - Call Timed ActionList'),
+(17724300, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 11937, 3, 60000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - summon'),
+(17724300, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17724300, 9, 2, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17724300, 9, 3, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 99, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - Reset'),
+
+(177365,1,0,0,70,0,100,0,2,0,0,0,80,17736500,2,0,0,0,0,1,0,0,0,0,0,0,0,'demon portal - on state change - Call Timed ActionList'),
+(17736500, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 11937, 3, 60000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - summon'),
+(17736500, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17736500, 9, 2, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17736500, 9, 3, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 99, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - Reset'),
+
+(177366,1,0,0,70,0,100,0,2,0,0,0,80,17736600,2,0,0,0,0,1,0,0,0,0,0,0,0,'demon portal - on state change - Call Timed ActionList'),
+(17736600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 11937, 3, 60000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - summon'),
+(17736600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17736600, 9, 2, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17736600, 9, 3, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 99, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - Reset'),
+
+(177367,1,0,0,70,0,100,0,2,0,0,0,80,17736700,2,0,0,0,0,1,0,0,0,0,0,0,0,'demon portal - on state change - Call Timed ActionList'),
+(17736700, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 11937, 3, 60000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - summon'),
+(17736700, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17736700, 9, 2, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17736700, 9, 3, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 99, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - Reset'),
+
+(177368,1,0,0,70,0,100,0,2,0,0,0,80,17736800,2,0,0,0,0,1,0,0,0,0,0,0,0,'demon portal - on state change - Call Timed ActionList'),
+(17736800, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 11937, 3, 60000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - summon'),
+(17736800, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17736800, 9, 2, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17736800, 9, 3, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 99, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - Reset'),
+
+(177369,1,0,0,70,0,100,0,2,0,0,0,80,17736900,2,0,0,0,0,1,0,0,0,0,0,0,0,'demon portal - on state change - Call Timed ActionList'),
+(17736900, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 11937, 3, 60000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - summon'),
+(17736900, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17736900, 9, 2, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17736900, 9, 3, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 99, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - Reset'),
+
+(177397,1,0,0,70,0,100,0,2,0,0,0,80,17739700,2,0,0,0,0,1,0,0,0,0,0,0,0,'demon portal - on state change - Call Timed ActionList'),
+(17739700, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 11937, 3, 60000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - summon'),
+(17739700, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17739700, 9, 2, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17739700, 9, 3, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 99, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - Reset'),
+
+(177398,1,0,0,70,0,100,0,2,0,0,0,80,17739800,2,0,0,0,0,1,0,0,0,0,0,0,0,'demon portal - on state change - Call Timed ActionList'),
+(17739800, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 11937, 3, 60000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - summon'),
+(17739800, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17739800, 9, 2, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17739800, 9, 3, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 99, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - Reset'),
+
+(177399,1,0,0,70,0,100,0,2,0,0,0,80,17739900,2,0,0,0,0,1,0,0,0,0,0,0,0,'demon portal - on state change - Call Timed ActionList'),
+(17739900, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 11937, 3, 60000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - summon'),
+(17739900, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17739900, 9, 2, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17739900, 9, 3, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 99, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - Reset'),
+
+(177400,1,0,0,70,0,100,0,2,0,0,0,80,17740000,2,0,0,0,0,1,0,0,0,0,0,0,0,'demon portal - on state change - Call Timed ActionList'),
+(17740000, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 11937, 3, 60000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - summon'),
+(17740000, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17740000, 9, 2, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 70, 300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - despawn'),
+(17740000, 9, 3, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 99, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'demon portal - ActionList - Reset');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_02_world.sql
new file mode 100644
index 00000000000..a0a6ff3619c
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_19_02_world.sql
@@ -0,0 +1,16 @@
+UPDATE `smart_scripts` SET `event_type`=75, `event_param1`=0, `event_param2`=16878, `event_param3`=4000, `event_param4`=4000, `action_param2`=1, `target_type`=1, `target_param1`=0, `target_param2`=0, `comment`='Anchorite Relic Bunny - On Shattered Hand Berserker in range - Cast \'Anchorite Contrition\' (No Repeat)' WHERE `entryorguid`=22444 AND `source_type`=0 AND `id`=1 AND `link`=0;
+UPDATE `gameobject_template` SET `AIName`='' WHERE `entry`=185298;
+
+UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(22454);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(22454) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=185298 AND `source_type`=1;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(22454, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 30, 0, 0, 0, 0, 0, 0, 'Fel Spirit - On Just Summoned - Attack'),
+(22454, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Fel Spirit - On Agro - Attack');
+
+DELETE FROM `creature_text` WHERE `entry`=22454;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES
+(22454, 0, 0, 'Vengeance will not be yours, $n!', 12, 0, 100, 15, 0, 0, 20301, 'Fel Spirit to Player');
+
+UPDATE `gameobject_template` SET `flags` = 16 WHERE `entry` = 185298;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_00_world.sql
new file mode 100644
index 00000000000..8120f1be86f
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_00_world.sql
@@ -0,0 +1,13 @@
+--
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `Entry` IN (33377, 33779);
+UPDATE `creature` SET `MovementType`=0, `spawndist`=0 WHERE `id`=33377;
+DELETE FROM `creature` WHERE `id`=33167;
+DELETE FROM `creature` WHERE `guid` IN (136266,136265);
+UPDATE `creature` SET `position_x`=-733.608, `position_y`=-131.445, `position_z`=429.842, `orientation`= 4.15265 WHERE `guid`=136271;
+
+SET @ENTRY1 := -136528;
+SET @ENTRY2 := -136525;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@ENTRY1, @ENTRY2);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY1,0,0,0,1,0,100,0,2000,2000,0,0,11,48310,0,0,0,0,0,10,137508,33779,0,0,0,0,0,'Kirin Tor Battle-Mage - OOC - cast Transitus Shield Beam'),
+(@ENTRY2,0,0,0,1,0,100,0,2000,2000,0,0,11,48310,0,0,0,0,0,10,137507,33779,0,0,0,0,0,'Kirin Tor Battle-Mage - OOC - cast Transitus Shield Beam');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_01_world.sql
new file mode 100644
index 00000000000..f59710f1e32
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_01_world.sql
@@ -0,0 +1,62 @@
+UPDATE `spell_dbc` SET `Effect1`=28, `EffectMiscValueB1`=64 WHERE `Id`=33903;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=19188 AND `source_type`=0 AND `id`>3;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=21504 AND `source_type`=0 AND `id`>0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=19305 AND `source_type`=0 AND `id`>5;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=19419 AND `source_type`=0 AND `id`>1;
+
+UPDATE `smart_scripts` SET `event_param2`=1,`target_type`=21, `target_param1`=100 WHERE `entryorguid`=19294 AND `source_type`=0 AND `id`=0 AND `link`=0;
+UPDATE `smart_scripts` SET `event_param2`=2 WHERE `entryorguid`=19294 AND `source_type`=0 AND `id`=3 AND `link`=0;
+UPDATE `smart_scripts` SET `action_param2`=1 WHERE `entryorguid`=19293 AND `source_type`=0 AND `id`=0 AND `link`=0;
+UPDATE `smart_scripts` SET `action_param2`=2 WHERE `entryorguid`=20599 AND `source_type`=0 AND `id`=0 AND `link`=0;
+
+UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(20781,20617);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(20781,20617) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(2078100,2150400) AND `source_type`=9;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=1929400 AND `source_type`=9 AND `id`>8;
+DELETE FROM `event_scripts` WHERE `id`=13256;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(19188, 0, 4, 0, 2, 0, 100, 1, 0, 75, 0, 0, 11, 33903, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Raging Colossus - At 75% HP - Cast Summon Crystalhide Rageling (No Repeat)'),
+(19188, 0, 5, 0, 2, 0, 100, 1, 0, 50, 0, 0, 11, 33903, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Raging Colossus - At 50% HP - Cast Summon Crystalhide Rageling (No Repeat)'),
+(1929400, 9, 9, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 11, 31401, 2, 0, 0, 0, 0, 19, 20599, 0, 0, 0, 0, 0, 0, 'Earthbinder Galandria Nightbreeze - On Script - Cast Moonfire'),
+(1929400, 9, 10, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 11, 33844, 2, 0, 0, 0, 0, 19, 20599, 0, 0, 0, 0, 0, 0, 'Earthbinder Galandria Nightbreeze - On Script - Cast Entangling Roots'),
+(20781, 0, 0, 0, 8, 0, 100, 0, 35413, 0, 180000, 180000, 80, 2078100, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Seed of Revitalization Target Trigger - On Spellhit (Seed of Revitalization) - Run Script'), -- 15:12:53.391
+(20617, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Red Crystal Trigger - On Data Set - Set Phase 1'),
+(20617, 0, 1, 0, 38, 0, 100, 0, 2, 2, 0, 0, 11, 35468, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Red Crystal Trigger - On Data Set - Cast Seed of Revitalization Entangling Roots Visual'),
+(20617, 0, 2, 0, 38, 0, 100, 0, 3, 3, 0, 0, 28, 35468, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Red Crystal Trigger - On Data Set - Remove Seed of Revitalization Entangling Roots Visual'),
+(20617, 0, 3, 0, 38, 0, 100, 0, 4, 4, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Red Crystal Trigger - On Data Set - Set Phase 0'),
+(20617, 0, 4, 0, 1, 1, 100, 0, 0, 0, 3000, 3000, 11, 35487, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Red Crystal Trigger - OOC (Phase 1) - Cast Seed of Revitalization Lightning Cloud Visual'),
+(20617, 0, 5, 0, 1, 2, 100, 1, 0, 0, 0, 0, 11, 35471, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Red Crystal Trigger - OOC (Phase 2) - Cast Seed of Revitalization Giant Insect Swarm Visual'),
+(20617, 0, 6, 0, 38, 0, 100, 0, 5, 5, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Red Crystal Trigger - On Data Set - Set Phase 2'),
+(20617, 0, 7, 8, 38, 0, 100, 0, 6, 6, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Red Crystal Trigger - On Data Set - Set Phase 0'),
+(20617, 0, 8, 9, 61, 0, 100, 0, 0, 0, 0, 0, 28, 35468, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Red Crystal Trigger - On Data Set - Set Phase 0'),
+(20617, 0, 9, 0, 61, 0, 100, 0, 0, 0, 0, 0, 28, 35471, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Red Crystal Trigger - On Data Set - Set Phase 0'),
+(19305, 0, 6, 7, 54, 0, 100, 0, 0, 0, 0, 0, 11, 7741, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Goliathon - On Just Summoned - Cast Summoned Demon'),
+(19305, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Goliathon - On Just Summoned - Start Combat'),
+(21504, 0, 1, 0, 38, 0, 100, 0, 2, 2, 0, 0, 80, 2150400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Pathaleon the Calculator\'s Image - On Data Set 2 2 - Run Script'),
+(19419, 0, 2, 3, 54, 0, 100, 0, 0, 0, 0, 0, 11, 24240, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Raging Shardling - On Just Summoned - Cast Spawn - Red Lightning'),
+(19419, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 50, 0, 0, 0, 0, 0, 0, 'Raging Shardling - On Just Summoned - Attack'),
+(2150400, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 34427, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Pathaleon the Calculator\'s Image - Script - Cast Ethereal Teleport'), -- 15:13:04.266
+(2150400, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33900, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Pathaleon the Calculator\'s Image - Script - Cast Shroud of Death'), -- 15:13:04.266
+(2150400, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 9, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Pathaleon the Calculator\'s Image - Script - Say Line 9'), -- 15:13:06.453
+(2150400, 9, 3, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 1, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Pathaleon the Calculator\'s Image - Script - Say Line 10'), -- 15:13:18.578
+(2150400, 9, 4, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 11, 23017, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Pathaleon the Calculator\'s Image - Cast Arcane Channeling'), -- 15:13:30.547
+(2150400, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 11, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Pathaleon the Calculator\'s Image - Script - Say Line 11'), -- 15:13:30.687
+(2150400, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 19305, 6, 60000, 0, 0, 0, 8, 0, 0, 0, 107.4091, 4839.756, 78.9819, 6.118358, 'Pathaleon the Calculator\'s Image - Script - Summon Goliathon'), -- 15:13:30.687
+(2150400, 9, 7, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 1, 12, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Pathaleon the Calculator\'s Image - Script - Say Line 12'), -- 15:13:42.828
+(2150400, 9, 8, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Pathaleon the Calculator\'s Image - Script - Despawn'), -- 15:13:42.828
+(2078100, 9, 0, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 9, 20617, 0, 100, 0, 0, 0, 0, 'Seed of Revitalization Target Trigger - Script - Set Data on Red Crystal Trigger'), -- 15:12:56.781
+(2078100, 9, 1, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 10, 72893, 20617, 0, 0, 0, 0, 0, 'Seed of Revitalization Target Trigger - Script - Set Data on Red Crystal Trigger'), -- 15:13:04.266
+(2078100, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 21504, 1, 60000, 0, 0, 0, 8, 0, 0, 0, 129.1348, 4834.785, 76.19424, 0.06981317, 'Seed of Revitalization Target Trigger - Script - Summon Pathaleon the Calculators Image'), -- 15:13:04.266
+(2078100, 9, 3, 0, 0, 0, 100, 0, 250, 250, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, 21504, 0, 0, 0, 0, 0, 0, 'Seed of Revitalization Target Trigger - Script - Set Data on Pathaleon the Calculators Image'),
+(2078100, 9, 4, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 45, 5, 5, 0, 0, 0, 0, 9, 20617, 0, 100, 0, 0, 0, 0, 'Seed of Revitalization Target Trigger - Script - Set Data on Red Crystal Trigger'), -- 15:12:56.781
+(2078100, 9, 5, 0, 0, 0, 100, 0, 26000, 26000, 0, 0, 45, 6, 6, 0, 0, 0, 0, 9, 20617, 0, 100, 0, 0, 0, 0, 'Seed of Revitalization Target Trigger - Script - Set Data on Red Crystal Trigger'); -- 15:12:56.781
+
+DELETE FROM `creature_text` WHERE `entry`=21504 AND `groupid`>8;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(21504, 9, 0, 'And just what do you think you are doing? You dare to interfere with my master''s experiment?', 12, 0, 100, 25, 0, 0, 18369, 0, 'Pathaleon the Calculators Image'),
+(21504, 10, 0, 'Do you like what we''ve done here? Perhaps we will drop these crystals from the sky all over Outland.', 12, 0, 100, 6, 0, 0, 18370, 0, 'Pathaleon the Calculators Image'),
+(21504, 11, 0, 'I grow bored with your attempt to heal the land and quell the energies summoning and driving the colossi mad. Goliathon, King of the Colossi, Prince Kael''thas and I demand that you defend the crystal!', 12, 0, 100, 0, 0, 0, 18371, 0, 'Pathaleon the Calculators Image'),
+(21504, 12, 0, 'We will meet again soon.', 12, 0, 100, 1, 0, 0, 18372, 0, 'Pathaleon the Calculators Image');
+
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_02_world.sql
new file mode 100644
index 00000000000..9b03a9cdea3
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_20_02_world.sql
@@ -0,0 +1,40 @@
+-- Charscale Invoker SAI
+SET @ENTRY := 40417;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,0,0,100,0,6000,6000,8000,8000,11,75419,0,0,0,0,0,2,0,0,0,0,0,0,0,"Charscale Invoker - In Combat - Cast 'Scorch'"),
+(@ENTRY,0,1,0,0,0,100,0,10000,10000,20000,20000,11,75413,0,0,0,0,0,1,0,0,0,0,0,0,0,"Charscale Invoker - In Combat - Cast 'Flame Wave'");
+
+-- Charscale Assaulter SAI
+SET @ENTRY := 40419;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,0,0,100,0,6000,6000,7000,7000,11,15284,0,0,0,0,0,2,0,0,0,0,0,0,0,"Charscale Assaulter - In Combat - Cast 'Cleave'"),
+(@ENTRY,0,1,0,0,0,100,0,14000,14000,14000,14000,11,75418,0,0,0,0,0,1,0,0,0,0,0,0,0,"Charscale Assaulter - In Combat - Cast 'Shockwave'");
+
+-- Charscale Commander SAI
+SET @ENTRY := 40423;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,1,0,0,100,0,8000,8000,40000,40000,11,75414,0,0,0,0,0,1,0,0,0,0,0,0,0,"Charscale Commander - In Combat - Cast 'Rallying Shout'"),
+(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Charscale Commander - In Combat - Say Line 0"),
+(@ENTRY,0,2,0,0,0,100,0,15000,15000,14000,14000,11,13737,0,0,0,0,0,2,0,0,0,0,0,0,0,"Charscale Commander - In Combat - Cast 'Mortal Strike'");
+
+-- Charscale Commander Text
+DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES
+(@ENTRY, 0, 0, '%s rallies the other combatants with a battle roar!', 41, 0, 100, 0, 0, 0, 40420, 'Charscale Commander');
+
+-- Charscale Elite SAI
+SET @ENTRY := 40421;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,0,0,100,0,12000,12000,11000,11000,11,15621,0,0,0,0,0,2,0,0,0,0,0,0,0,"Charscale Elite - In Combat - Cast 'Skull Crack'");
+
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_ruby_sanctum_rallying_shout';
+INSERT INTO `spell_script_names` VALUE
+(75415, 'spell_ruby_sanctum_rallying_shout');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_21_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_21_00_world.sql
new file mode 100644
index 00000000000..55f6cceaed8
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_21_00_world.sql
@@ -0,0 +1,80 @@
+SET @OGUID := 63491;
+
+UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(16834,16833,19766,19763,19764,16915,18827,18828,19408);
+UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`IN(183941,183936,183940);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(16834,16833,19766,19763,19764,16915,18827,18828,19408) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(1976600,1976300,1976400) AND `source_type`=9;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(183941,183936,183940) AND `source_type`=1;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(18828, 0, 0, 0, 1, 0, 100, 0, 30000, 60000, 30000, 60000, 11, 33016, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Camera Shaker - OOC - Cast Internal Shake Camera'),
+(19408, 0, 0, 0, 14, 0, 100, 0, 1000, 30, 45000, 60000, 11, 34086, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Maiden of Grief - On Friendly Heath Deficit - Whipped Frenzy'),
+(19408, 0, 1, 0, 9, 0, 100, 0, 0, 5, 10000, 15000, 11, 15968, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Maiden of Grief - On Range - Cast Lash of Pain'),
+(18827, 0, 0, 1, 2, 0, 100, 1, 0, 15, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gan''arg Sapper - On 15% - Say Line 0'),
+(18827, 0, 1, 0, 61, 0, 100, 1, 0, 0, 0, 0, 11, 33974, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Gan''arg Sapper - On 15% - Cast Power Burn'),
+(18827, 0, 2, 0, 0, 0, 100, 0, 0, 2000, 45000, 60000, 11, 33895, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Gan''arg Sapper - IC - Cast Set Charge'),
+(16915, 0, 0, 0, 1, 0, 100, 0, 30000, 60000, 30000, 60000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Foreman Razelcraz - OOC - Say Line 0'),
+(16915, 0, 1, 0, 1, 0, 100, 0, 45000, 90000, 45000, 90000, 11, 34396, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Foreman Razelcraz - OOC - Cast Zap'),
+(16915, 0, 2, 0, 1, 0, 100, 0, 20000, 40000, 20000, 40000, 5, 60, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Foreman Razelcraz - OOC - Play emote oneshotkick'),
+(16834, 0, 0, 0, 20, 0, 100, 0, 9423, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Anchorite Obadei - On Quest Reward (Return to Obadei) - Say Line 0'),
+(16833, 0, 0, 1, 20, 0, 100, 0, 9424, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, 16834, 11000, 0, 0, 0, 0, 0, 'Makuru - On Quest Reward (Makurus Vengeance) - Say Line 1 on Anchorite Obadei'),
+(16833, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 0, 19, 16834, 0, 0, 0, 0, 0, 0, 'Makuru - On Quest Reward (Makurus Vengeance) - Face Anchorite Obadei'),
+(16833, 0, 2, 3, 52, 0, 100, 0, 1, 16834, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Makuru - On Text Over (Line 1 on Anchorite Obadei) - Say Line 0'),
+(16833, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, 16834, 0, 0, 0, 0, 0, 0, 'Makuru - On Text Over Line 0 - Say Line 2 on Anchorite Obadei'),
+(183941, 1, 0, 0, 70, 0, 100, 0, 2, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 19, 19766, 0, 0, 0, 0, 0, 0, 'Jakks Cage - On Gameobject State Changed - Set Data 0 1'),
+(19766, 0, 1, 0, 38, 0, 100, 0, 0, 1, 0, 0, 80, 1976600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Jakk - On Data Set 0 1 - Run Script (Phase 1)'),
+(1976600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Jakk - On Script - Set Data 0 0'),
+(1976600, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 46, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Jakk - On Script - Move Forward 10 Yards'),
+(1976600, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Jakk - On Script - Say Line 0'),
+(1976600, 9, 3, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 32, 0, 0, 0, 0, 0, 0, 20, 183941, 0, 0, 0, 0, 0, 0, 'Jakk - On Script - Reset GO'),
+(1976600, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Jakk - On Script - Despawn Instant'),
+(183936, 1, 0, 0, 70, 0, 100, 0, 2, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 19, 19763, 0, 0, 0, 0, 0, 0, 'Mannis Cage - On Gameobject State Changed - Set Data 0 1'),
+(19763, 0, 1, 0, 38, 0, 100, 0, 0, 1, 0, 0, 80, 1976300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Manni - On Data Set 0 1 - Run Script (Phase 1)'),
+(1976300, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Manni - On Script - Set Data 0 0'),
+(1976300, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 46, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Manni - On Script - Move Forward 10 Yards'),
+(1976300, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Manni - On Script - Say Line 0'),
+(1976300, 9, 3, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 32, 0, 0, 0, 0, 0, 0, 20, 183936, 0, 0, 0, 0, 0, 0, 'Manni - On Script - Reset GO'),
+(1976300, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Manni - On Script - Despawn Instant'),
+(183940, 1, 0, 0, 70, 0, 100, 0, 2, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 19, 19764, 0, 0, 0, 0, 0, 0, 'Mohs Cage - On Gameobject State Changed - Set Data 0 1'),
+(19764, 0, 1, 0, 38, 0, 100, 0, 0, 1, 0, 0, 80, 1976400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Moh - On Data Set 0 1 - Run Script (Phase 1)'),
+(1976400, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Moh - On Script - Set Data 0 0'),
+(1976400, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 46, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Moh - On Script - Move Forward 10 Yards'),
+(1976400, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Moh - On Script - Say Line 0'),
+(1976400, 9, 3, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 32, 0, 0, 0, 0, 0, 0, 20, 183940, 0, 0, 0, 0, 0, 0, 'Moh - On Script - Reset GO'),
+(1976400, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Moh - On Script - Despawn Instant');
+
+DELETE FROM `creature_text` WHERE `entry`in(16834,16833,19766,19763,19764,16915,18827);
+
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(16915, 0, 0, 'I''ll get you working yet, you bucket of junk.', 12, 0, 100, 1, 0, 0, 17798, 0, 'Foreman Razelcraz'),
+(16915, 0, 1, 'What?! You don''t think I can do it? I''ll show you...once I get my parts, that is.', 12, 0, 100, 1, 0, 0, 17802, 0, 'Foreman Razelcraz'),
+(16915, 0, 2, 'It moved! I swear, I saw it move!', 12, 0, 100, 0, 0, 0, 17804, 0, 'Foreman Razelcraz'),
+(16915, 0, 3, 'Ouch! That''s not right.', 12, 0, 100, 0, 0, 0, 17805, 0, 'Foreman Razelcraz'),
+(16915, 0, 4, 'Oh yeah, it''s real funny isn''t it?', 12, 0, 100, 1, 0, 0, 17803, 0, 'Foreman Razelcraz'),
+(16834, 0, 0, 'No! Not... Sedai! The orcs must pay!', 12, 0, 100, 1, 0, 0, 13997, 0, 'Anchorite Obadei'),
+(16834, 1, 0, 'What have you done, Makuru?! These are not our ways!', 12, 0, 100, 0, 0, 0, 13991, 0, 'Anchorite Obadei'),
+(16834, 2, 0, 'I understand how you feel Makuru. Sedai was my brother after all. Yet we can''t disgrace his memory by going against his very ideals.', 12, 0, 100, 0, 0, 0, 13992, 0, 'Makuru'),
+(16833, 1, 0, 'The orcs hate us, Obadei! They''ve killed many of us before! They deserve death and worse.', 12, 0, 100, 0, 0, 0, 13996, 0, 'Makuru'),
+(19766, 0, 0, 'I don''t know which is worse, getting eaten by fel orcs or working for that slave master Razelcraz! Oh well, thanks anyways!', 12, 0, 100, 66, 0, 0, 17410, 0, 'Jakk'),
+(19763, 0, 0, 'Thank goodness you got here, it was almost dinner time!', 12, 0, 100, 3, 0, 0, 17407, 0, 'Manni'),
+(19764, 0, 0, 'I thought I was a goner for sure.', 12, 0, 100, 4, 0, 0, 17409, 0, 'Moh'),
+(18827, 0, 0, '%s''s eyes glow red as he begins to cackle madly!.', 16, 7, 100, 0, 0, 0, 16771, 0, 'Gan''arg Sapper');
+
+
+DELETE FROM gameobject WHERE `id` =183934;
+INSERT INTO gameobject (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
+(@OGUID+0, 183934, 530, 0, 0, 1, 1, 9.587782, 3181.049, 9.555613, 2.111848, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+1, 183934, 530, 0, 0, 1, 1, -15.59028, 3096.009, 0.048549, 2.862335, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+2, 183934, 530, 0, 0, 1, 1, 74.26378, 3039.501, -0.616187, 4.415683, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+3, 183934, 530, 0, 0, 1, 1, 185.5247, 3007.743, -0.824237, 2.652894, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+4, 183934, 530, 0, 0, 1, 1, 193.6588, 3062.065, -0.588734, 2.042035, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+5, 183934, 530, 0, 0, 1, 1, 263.3892, 3016.845, -0.839023, 6.003934, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+6, 183934, 530, 0, 0, 1, 1, 44.87815, 3077.427, -1.222514, 0.05235888, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+7, 183934, 530, 0, 0, 1, 1, 22.71669, 3097.806, -0.868156, 5.567601, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+8, 183934, 530, 0, 0, 1, 1, 20.05642, 3070.531, -0.681531, 5.969027, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+9, 183934, 530, 0, 0, 1, 1, 26.94727, 3130.273, -0.856446, 4.76475, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+10, 183934, 530, 0, 0, 1, 1, 101.7286, 3043.015, -1.222528, 5.480334, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+11, 183934, 530, 0, 0, 1, 1, 174.7734, 3039.325, -0.794917, 0.6806767, 0, 0, 0, 1, 120, 255, 1, 20886), -- 183934 (Area: 0)
+(@OGUID+12, 183934, 530, 0, 0, 1, 1, 263.3892, 3016.845, -0.839023, 6.003934, 0, 0, 0, 1, 120, 255, 1, 20886); -- 183934 (Area: 0)
+
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_23_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_23_00_world.sql
new file mode 100644
index 00000000000..9195b652288
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_23_00_world.sql
@@ -0,0 +1,164 @@
+-- Naxxramas instance cleanup
+SET @OGUID = 5517; -- gameobject GUID (1 object) used for everything except heigan
+
+-- ======== --
+-- Faerlina --
+-- ======== --
+-- Move probability of SAY_SLAY to DB
+UPDATE `creature_text` SET `probability`=16 WHERE `entry`=15953 and `groupid`=2;
+
+-- ================== --
+-- Heigan the Unclean --
+-- ================== --
+-- Completely re-do eruption fissure spawns
+SET @OGUID2 = 84980; -- gameobject GUID (76 objects); needs to match the constant in boss_heigan.cpp
+DELETE FROM `gameobject` WHERE `id` between 181510 and 181552;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`,`VerifiedBuild`) VALUES
+ (@OGUID2+0,181510,533,3,1,2787.255000,-3654.130000,274.316700,3.534301,0.000000,0.000000,-0.980784,0.195095,0,0,1,15354),
+ (@OGUID2+1,181526,533,3,1,2781.556000,-3670.999000,274.351800,3.153633,0.000000,0.000000,-0.999982,0.006020,0,0,1,15354),
+ (@OGUID2+2,181511,533,3,1,2782.403000,-3660.402000,274.314800,2.110888,0.000000,0.000000,0.870119,0.492841,0,0,1,15354),
+ (@OGUID2+3,181517,533,3,1,2793.238000,-3664.132000,274.316700,0.635802,0.000000,0.000000,0.312573,0.949894,0,0,1,15354),
+ (@OGUID2+4,181518,533,3,1,2802.508000,-3664.726000,274.316700,0.635802,0.000000,0.000000,0.312573,0.949894,0,0,1,15354),
+ (@OGUID2+5,181523,533,3,1,2795.809000,-3677.562000,274.072800,2.853153,0.000000,0.000000,0.989618,0.143721,0,0,1,15354),
+ (@OGUID2+6,181519,533,3,1,2811.998000,-3671.979000,274.072800,5.809874,0.000000,0.000000,-0.234453,0.972127,0,0,1,15354),
+ (@OGUID2+7,181524,533,3,1,2792.327000,-3684.134000,274.316700,4.976158,0.000000,0.000000,-0.607980,0.793952,0,0,1,15354),
+ (@OGUID2+8,181520,533,3,1,2810.557000,-3680.581000,274.316700,3.186728,0.000000,0.000000,-0.999745,0.022566,0,0,1,15354),
+ (@OGUID2+9,181521,533,3,1,2800.146000,-3682.706000,274.351800,1.038823,0.000000,0.000000,0.496369,0.868111,0,0,1,15354),
+ (@OGUID2+10,181523,533,3,1,2795.809000,-3677.562000,274.072800,2.853153,0.000000,0.000000,0.989618,0.143721,0,0,1,15354),
+ (@OGUID2+11,181524,533,3,1,2792.327000,-3684.134000,274.316700,4.976158,0.000000,0.000000,-0.607980,0.793952,0,0,1,15354),
+ (@OGUID2+12,181520,533,3,1,2810.557000,-3680.581000,274.316700,3.186728,0.000000,0.000000,-0.999745,0.022566,0,0,1,15354),
+ (@OGUID2+13,181521,533,3,1,2800.146000,-3682.706000,274.351800,1.038823,0.000000,0.000000,0.496369,0.868111,0,0,1,15354),
+ (@OGUID2+14,181522,533,3,1,2805.961000,-3691.666000,274.316700,4.434372,0.000000,0.000000,-0.798264,0.602308,0,0,1,15354),
+
+ (@OGUID2+15,181515,533,3,1,2755.239000,-3649.898000,274.316700,3.396841,0.000000,0.000000,-0.991867,0.127278,0,0,1,15354),
+ (@OGUID2+16,181516,533,3,1,2763.548000,-3654.044000,274.316700,3.399228,0.000000,0.000000,-0.991715,0.128462,0,0,1,15354),
+ (@OGUID2+17,181531,533,3,1,2749.335000,-3662.211000,274.351800,3.636871,0.000000,0.000000,-0.969494,0.245116,0,0,1,15354),
+ (@OGUID2+18,181514,533,3,1,2757.844000,-3659.562000,274.316700,1.971156,0.000000,0.000000,0.833592,0.552381,0,0,1,15354),
+ (@OGUID2+19,181512,533,3,1,2778.426000,-3651.314000,274.316700,3.540596,0.000000,0.000000,-0.980166,0.198181,0,0,1,15354),
+ (@OGUID2+20,181516,533,3,1,2763.548000,-3654.044000,274.316700,3.399228,0.000000,0.000000,-0.991715,0.128462,0,0,1,15354),
+ (@OGUID2+21,181530,533,3,1,2758.163000,-3667.129000,274.351800,3.138830,0.000000,0.000000,0.999999,0.001381,0,0,1,15354),
+ (@OGUID2+22,181514,533,3,1,2757.844000,-3659.562000,274.316700,1.971156,0.000000,0.000000,0.833592,0.552381,0,0,1,15354),
+ (@OGUID2+23,181512,533,3,1,2778.426000,-3651.314000,274.316700,3.540596,0.000000,0.000000,-0.980166,0.198181,0,0,1,15354),
+ (@OGUID2+24,181529,533,3,1,2763.326000,-3680.528000,274.351800,3.146377,0.000000,0.000000,-0.999997,0.002392,0,0,1,15354),
+ (@OGUID2+25,181513,533,3,1,2774.297000,-3660.655000,274.316700,6.099252,0.000000,0.000000,-0.091837,0.995774,0,0,1,15354),
+ (@OGUID2+26,181528,533,3,1,2769.250000,-3671.420000,274.422200,5.859179,0.000000,0.000000,-0.210419,0.977611,0,0,1,15354),
+ (@OGUID2+27,181527,533,3,1,2777.413000,-3677.635000,274.387000,0.791340,0.000000,0.000000,0.385427,0.922739,0,0,1,15354),
+ (@OGUID2+28,181527,533,3,1,2777.413000,-3677.635000,274.387000,0.791340,0.000000,0.000000,0.385427,0.922739,0,0,1,15354),
+ (@OGUID2+29,181529,533,3,1,2763.326000,-3680.528000,274.351800,3.146377,0.000000,0.000000,-0.999997,0.002392,0,0,1,15354),
+ (@OGUID2+30,181525,533,3,1,2783.359000,-3688.357000,274.385100,3.161319,0.000000,0.000000,-0.999951,0.009863,0,0,1,15354),
+ (@OGUID2+31,181528,533,3,1,2769.250000,-3671.420000,274.422200,5.859179,0.000000,0.000000,-0.210419,0.977611,0,0,1,15354),
+ (@OGUID2+32,181528,533,3,1,2769.250000,-3671.420000,274.422200,5.859179,0.000000,0.000000,-0.210419,0.977611,0,0,1,15354),
+ (@OGUID2+33,181529,533,3,1,2763.326000,-3680.528000,274.351800,3.146377,0.000000,0.000000,-0.999997,0.002392,0,0,1,15354),
+ (@OGUID2+34,181516,533,3,1,2763.548000,-3654.044000,274.316700,3.399228,0.000000,0.000000,-0.991715,0.128462,0,0,1,15354),
+ (@OGUID2+35,181530,533,3,1,2758.163000,-3667.129000,274.351800,3.138830,0.000000,0.000000,0.999999,0.001381,0,0,1,15354),
+ (@OGUID2+36,181514,533,3,1,2757.844000,-3659.562000,274.316700,1.971156,0.000000,0.000000,0.833592,0.552381,0,0,1,15354),
+ (@OGUID2+37,181515,533,3,1,2755.239000,-3649.898000,274.316700,3.396841,0.000000,0.000000,-0.991867,0.127278,0,0,1,15354),
+ (@OGUID2+38,181531,533,3,1,2749.335000,-3662.211000,274.351800,3.636871,0.000000,0.000000,-0.969494,0.245116,0,0,1,15354),
+ (@OGUID2+39,181512,533,3,1,2778.426000,-3651.314000,274.316700,3.540596,0.000000,0.000000,-0.980166,0.198181,0,0,1,15354),
+
+ (@OGUID2+40,181532,533,3,1,2743.089000,-3671.320000,274.316700,2.464252,0.000000,0.000000,0.943197,0.332233,0,0,1,15354),
+ (@OGUID2+41,181534,533,3,1,2737.166000,-3675.165000,274.316700,4.369651,0.000000,0.000000,-0.817333,0.576165,0,0,1,15354),
+ (@OGUID2+42,181532,533,3,1,2743.089000,-3671.320000,274.316700,2.464252,0.000000,0.000000,0.943197,0.332233,0,0,1,15354),
+ (@OGUID2+43,181533,533,3,1,2754.007000,-3673.770000,274.387000,0.791340,0.000000,0.000000,0.385427,0.922739,0,0,1,15354),
+ (@OGUID2+44,181534,533,3,1,2737.166000,-3675.165000,274.316700,4.369651,0.000000,0.000000,-0.817333,0.576165,0,0,1,15354),
+ (@OGUID2+45,181536,533,3,1,2740.491000,-3692.128000,274.387000,0.792787,0.000000,0.000000,0.386094,0.922459,0,0,1,15354),
+ (@OGUID2+46,181533,533,3,1,2754.007000,-3673.770000,274.387000,0.791340,0.000000,0.000000,0.385427,0.922739,0,0,1,15354),
+ (@OGUID2+47,181535,533,3,1,2747.132000,-3684.353000,274.351800,3.132432,0.000000,0.000000,0.999989,0.004580,0,0,1,15354),
+ (@OGUID2+48,181541,533,3,1,2760.581000,-3688.306000,274.387000,0.412781,0.000000,0.000000,0.204928,0.978777,0,0,1,15354),
+ (@OGUID2+49,181533,533,3,1,2754.007000,-3673.770000,274.387000,0.791340,0.000000,0.000000,0.385427,0.922739,0,0,1,15354),
+ (@OGUID2+50,181532,533,3,1,2743.089000,-3671.320000,274.316700,2.464252,0.000000,0.000000,0.943197,0.332233,0,0,1,15354),
+ (@OGUID2+51,181544,533,3,1,2774.958000,-3701.132000,274.316700,0.523547,0.000000,0.000000,0.258794,0.965933,0,0,1,15354),
+ (@OGUID2+52,181543,533,3,1,2772.080000,-3692.152000,274.351800,5.018846,0.000000,0.000000,-0.590897,0.806747,0,0,1,15354),
+ (@OGUID2+53,181543,533,3,1,2772.080000,-3692.152000,274.351800,5.018846,0.000000,0.000000,-0.590897,0.806747,0,0,1,15354),
+ (@OGUID2+54,181544,533,3,1,2774.958000,-3701.132000,274.316700,0.523547,0.000000,0.000000,0.258794,0.965933,0,0,1,15354),
+ (@OGUID2+55,181542,533,3,1,2764.288000,-3698.094000,274.422200,5.490798,0.000000,0.000000,-0.385910,0.922536,0,0,1,15354),
+ (@OGUID2+56,181541,533,3,1,2760.581000,-3688.306000,274.387000,0.412781,0.000000,0.000000,0.204928,0.978777,0,0,1,15354),
+ (@OGUID2+57,181533,533,3,1,2754.007000,-3673.770000,274.387000,0.791340,0.000000,0.000000,0.385427,0.922739,0,0,1,15354),
+ (@OGUID2+58,181540,533,3,1,2752.924000,-3693.020000,274.316700,4.099892,0.000000,0.000000,-0.887387,0.461025,0,0,1,15354),
+ (@OGUID2+59,181536,533,3,1,2740.491000,-3692.128000,274.387000,0.792787,0.000000,0.000000,0.386094,0.922459,0,0,1,15354),
+ (@OGUID2+60,181532,533,3,1,2743.089000,-3671.320000,274.316700,2.464252,0.000000,0.000000,0.943197,0.332233,0,0,1,15354),
+ (@OGUID2+61,181534,533,3,1,2737.166000,-3675.165000,274.316700,4.369651,0.000000,0.000000,-0.817333,0.576165,0,0,1,15354),
+ (@OGUID2+62,181535,533,3,1,2747.132000,-3684.353000,274.351800,3.132432,0.000000,0.000000,0.999989,0.004580,0,0,1,15354),
+
+ (@OGUID2+63,181552,533,3,1,2784.168000,-3724.730000,274.385100,1.050844,0.000000,0.000000,0.501578,0.865112,0,0,1,15354),
+ (@OGUID2+64,181552,533,3,1,2784.168000,-3724.730000,274.385100,1.050844,0.000000,0.000000,0.501578,0.865112,0,0,1,15354),
+ (@OGUID2+65,181545,533,3,1,2772.289000,-3711.435000,274.422200,6.022432,0.000000,0.000000,-0.130008,0.991513,0,0,1,15354),
+ (@OGUID2+66,181549,533,3,1,2776.160000,-3721.793000,274.387000,3.937367,0.000000,0.000000,-0.921882,0.387472,0,0,1,15354),
+ (@OGUID2+67,181551,533,3,1,2774.989000,-3731.793000,274.387000,3.927917,0.000000,0.000000,-0.923702,0.383111,0,0,1,15354),
+ (@OGUID2+68,181548,533,3,1,2765.765000,-3718.734000,274.316700,4.807982,0.000000,0.000000,-0.672515,0.740084,0,0,1,15354),
+ (@OGUID2+69,181546,533,3,1,2761.821000,-3711.915000,274.314800,3.961473,0.000000,0.000000,-0.917145,0.398554,0,0,1,15354),
+ (@OGUID2+70,181550,533,3,1,2765.327000,-3728.606000,274.314800,6.217947,0.000000,0.000000,-0.032614,0.999468,0,0,1,15354),
+ (@OGUID2+71,181547,533,3,1,2754.189000,-3718.121000,274.316700,5.370356,0.000000,0.000000,-0.440733,0.897638,0,0,1,15354),
+ (@OGUID2+72,181538,533,3,1,2752.927000,-3706.516000,274.316700,1.047839,0.000000,0.000000,0.500278,0.865865,0,0,1,15354),
+ (@OGUID2+73,181537,533,3,1,2738.396000,-3703.130000,274.385100,5.746106,0.000000,0.000000,-0.265324,0.964159,0,0,1,15354),
+ (@OGUID2+74,181539,533,3,1,2746.133000,-3700.192000,274.316700,5.493282,0.000000,0.000000,-0.384764,0.923015,0,0,1,15354),
+ (@OGUID2+75,181549,533,3,1,2776.160000,-3721.793000,274.387000,3.937367,0.000000,0.000000,-0.921882,0.387472,0,0,1,15354);
+
+
+
+-- ======= --
+-- Loatheb --
+-- ======= --
+-- Get rid of the superfluous aurascript for a dummy that's just there to make him talk
+DELETE FROM `spell_script_names` WHERE `scriptname`="spell_loatheb_necrotic_aura_warning";
+
+-- ======== --
+-- Thaddius --
+-- ======== --
+-- Move UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE (thaddius' base state) to creature_template instead of applying it in script
+UPDATE `creature_template` SET `unit_flags`=33554688 WHERE `entry`=15928;
+-- Move inactive aura to creature_template_addon
+DELETE FROM `creature_template_addon` WHERE entry = 15928;
+INSERT INTO `creature_template_addon` (`entry`,`auras`) VALUES (15928,"28160");
+
+-- ==================== --
+-- Instructor Razuvious --
+-- ==================== --
+-- Razuvious has been informed that Rubik's Cubes become noticably easier to solve if you buy six-colored ones.
+-- Thus, he will no longer take out his frustration on raid groups by throwing unsolved two-colored variants at them.
+UPDATE `creature_equip_template` SET `itemid3`=29010 WHERE `creatureid`=16061;
+DELETE FROM `spell_custom_attr` WHERE `entry`=55550;
+INSERT INTO `spell_custom_attr` (`entry`,`attributes`) VALUES
+(55550,524288);
+-- Also, give his understudies actual weaponry. The poor sods.
+DELETE FROM `creature_equip_template` WHERE `CreatureID`=16803;
+INSERT INTO `creature_equip_template` (`CreatureID`,`ItemID1`,`ItemID2`,`VerifiedBuild`) VALUES
+(16803,2180,23356,"15354");
+
+-- ================= --
+-- The Four Horsemen --
+-- ================= --
+-- Wanna hear something fun?
+-- On the current core, you can shackle, daze, stun (and some others) Baron Rivendare.
+-- Yes, only Baron Rivendare. The other Horsemen are fine. Why? I have no idea.
+-- Fixing that.
+UPDATE `creature_template` SET `mechanic_immune_mask`=617299803 WHERE `entry` in (16063,16064,16065,30549);
+
+-- ========= --
+-- Sapphiron --
+-- ========= --
+DELETE FROM `spell_script_names` WHERE `spell_id` in (24780,28522,28524,28560);
+INSERT INTO `spell_script_names` (`spell_id`,`scriptname`) VALUES
+(24780,"spell_sapphiron_change_blizzard_target"), -- Periodic aura on the Blizzard npc that handles target switches
+(28522,"spell_sapphiron_icebolt"), -- AuraScript for spawning ice block GO once the player has stopped moving
+(28524,"spell_sapphiron_frost_breath"), -- We can't get rid of the LoS emulation "hack" on frost breath targeting (yet!), but at least moving it to a spellscript...
+(28560,"spell_sapphiron_summon_blizzard"); -- Blizzard is now properly summoned! Yay!
+-- DB target position for the anti-cheese frost explosion
+DELETE FROM `spell_target_position` WHERE `ID`=29318;
+INSERT INTO `spell_target_position` (`ID`,`EffectIndex`,`MapID`,`PositionX`,`PositionY`,`PositionZ`,`VerifiedBuild`) VALUES
+(29318,0,533,3493.45,-5375.38,138.168,"15595");
+-- Wing Buffet trigger NPC
+UPDATE `creature_template` SET `unit_flags`=33554944,`unit_flags2`=2048,`flags_extra`=128,`spell1`=29328,`BaseAttackTime`=1000,`ScriptName`="trigger_periodic" WHERE `entry`=17025;
+-- Blizzard bunny NPC
+UPDATE `creature_template` SET `speed_run`=0.42857142,`BaseAttackTime`=3000,`InhabitType`=1 WHERE `entry`=16474;
+DELETE FROM `creature_template_addon` WHERE `entry`=16474;
+INSERT INTO `creature_template_addon` (`entry`,`auras`) VALUES (16474,"24780");
+-- Spawn GO is now spawned by DB
+DELETE FROM `gameobject` WHERE `guid` between @OGUID+0 and @OGUID+0;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`VerifiedBuild`) VALUES
+(@OGUID+0, 181356, 533, 3, 1, 3522.565, -5236.76, 137.6257, 4.485497, 0, 0, -0.782608, 0.6225148,0,0);
+UPDATE `gameobject_template` SET `ScriptName`="go_sapphiron_birth" WHERE `entry`=181356;
+-- Turn off interactivity on ice blocks
+UPDATE `gameobject_template` SET `type`=5,`data2`=0 WHERE `entry`=181247;
+-- Text cleanup
+UPDATE `creature_text` SET `language`=0, `emote`=0, `textrange`=3 WHERE `entry`=15989;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_00_world_335.sql
new file mode 100644
index 00000000000..4d69d8fd3f2
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_00_world_335.sql
@@ -0,0 +1,9 @@
+--
+UPDATE `creature` SET `MovementType`=0 WHERE `guid` IN (46414, 46416);
+UPDATE `creature_addon` SET `path_id`=0 WHERE `guid` IN (46414, 46416);
+DELETE FROM `waypoint_data` WHERE `id` IN (464140, 464160);
+DELETE FROM `creature_formations` WHERE `leaderGUID`=46394;
+INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
+(46394, 46394, 0, 0, 2, 0, 0),
+(46394, 46414, 4, 260, 2, 1, 5),
+(46394, 46416, 4, 100, 2, 1, 5);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_01_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_01_world_335.sql
new file mode 100644
index 00000000000..01d7857519e
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_01_world_335.sql
@@ -0,0 +1,9 @@
+--
+UPDATE `quest_template_addon` SET `AllowableClasses`=1 WHERE `id`=8316;
+UPDATE `quest_template_addon` SET `AllowableClasses`=2 WHERE `id`=8376;
+UPDATE `quest_template_addon` SET `AllowableClasses`=4 WHERE `id`=8377;
+UPDATE `quest_template_addon` SET `AllowableClasses`=8 WHERE `id`=8378;
+UPDATE `quest_template_addon` SET `AllowableClasses`=16 WHERE `id`=8379;
+UPDATE `quest_template_addon` SET `AllowableClasses`=64 WHERE `id`=8380;
+UPDATE `quest_template_addon` SET `AllowableClasses`=384 WHERE `id`=8381;
+UPDATE `quest_template_addon` SET `AllowableClasses`=1024 WHERE `id`=8382;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_02_world.sql
new file mode 100644
index 00000000000..199582eb4a0
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_24_02_world.sql
@@ -0,0 +1,4 @@
+UPDATE `creature` SET `unit_flags`=832 WHERE `guid`IN(57890,57891) AND `id`=16831;
+UPDATE `creature` SET `unit_flags`=33536 WHERE `guid`IN(57492) AND `id`=16580;
+UPDATE `creature` SET `unit_flags`=768 WHERE `guid`IN(57542,57543) AND `id`=16582;
+UPDATE `creature` SET `unit_flags`=768 WHERE `guid`IN(58137) AND `id`=16864;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_26_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_26_00_world.sql
new file mode 100644
index 00000000000..58a42dc214d
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_26_00_world.sql
@@ -0,0 +1,516 @@
+-- Fix moving phantom guest who should be sitting.
+UPDATE `creature` SET `MovementType`=0 AND `spawndist`=0, `position_x`=-10997.400391, `position_y`=-1893.040039, `orientation`=3.572645 WHERE `guid`=135230;
+UPDATE `creature_addon` SET `bytes1`=1, `bytes2`=5 WHERE `guid`=135230;
+
+SET @NPC := 135151;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-10988.13,`position_y`=-2019.135,`position_z`=80.22357 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-10988.13,-2019.135,80.22357,0,0,0,0,100,0),
+(@PATH,2,-10987.89,-2011.348,80.22346,0,0,0,0,100,0),
+(@PATH,3,-10984.39,-2008.848,80.22346,0,0,0,0,100,0),
+(@PATH,4,-10981.26,-2006.71,80.22307,0,0,0,0,100,0),
+(@PATH,5,-10972.16,-2002.439,80.22302,0,0,0,0,100,0),
+(@PATH,6,-10979.17,-1997.218,80.22329,0,0,0,0,100,0),
+(@PATH,7,-10980.42,-1997.218,80.22329,0,0,0,0,100,0),
+(@PATH,8,-10981.42,-1997.218,80.22329,0,0,0,0,100,0),
+(@PATH,9,-10985.26,-1997.161,80.22356,0,0,0,0,100,0),
+(@PATH,10,-10984.12,-1987.489,80.22325,0,0,0,0,100,0),
+(@PATH,11,-10979.12,-1986.239,80.22325,0,0,0,0,100,0),
+(@PATH,12,-10973.73,-1984.487,80.22291,0,0,0,0,100,0),
+(@PATH,13,-10967.48,-1974.487,80.22291,0,0,0,0,100,0),
+(@PATH,14,-10966.55,-1973.238,80.22318,0,0,0,0,100,0),
+(@PATH,15,-10962.55,-1970.488,80.22318,0,0,0,0,100,0),
+(@PATH,16,-10957.55,-1966.988,80.22318,0,0,0,0,100,0),
+(@PATH,17,-10955.99,-1967.212,80.2233,0,0,0,0,100,0),
+(@PATH,18,-10952.45,-1968.359,80.22365,0,0,0,0,100,0),
+(@PATH,19,-10951.29,-1984.542,80.22362,0,0,0,0,100,0),
+(@PATH,20,-10953.64,-1990.575,80.22345,0,0,0,0,100,0),
+(@PATH,21,-10954.39,-1991.575,80.22345,0,0,0,0,100,0),
+(@PATH,22,-10956.89,-1995.075,80.22345,0,0,0,0,100,0),
+(@PATH,23,-10961.48,-2000.67,80.2235,0,0,0,0,100,0),
+(@PATH,24,-10961.23,-2004.42,80.2235,0,0,0,0,100,0),
+(@PATH,25,-10961.32,-2013.403,80.22313,0,0,0,0,100,0),
+(@PATH,26,-10964.57,-2015.653,80.22313,0,0,0,0,100,0),
+(@PATH,27,-10972.57,-2021.653,80.22313,0,0,0,0,100,0),
+(@PATH,28,-10974.32,-2022.653,80.22313,0,0,0,0,100,0),
+(@PATH,29,-10976.85,-2024.267,80.22278,0,0,0,0,100,0),
+(@PATH,30,-10984.28,-2022.546,80.22318,0,0,0,0,100,0),
+(@PATH,31,-10986.03,-2021.296,80.22318,0,0,0,0,100,0);
+-- 0x1C310842801005C00053CE00021939B3 .go -10988.13 -2019.135 80.22357
+
+SET @NPC := 135153;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-11067.45,`position_y`=-1954.224,`position_z`=77.52905 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-11067.45,-1954.224,77.52905,0,0,0,0,100,0),
+(@PATH,2,-11066.2,-1960.974,77.52905,0,0,0,0,100,0),
+(@PATH,3,-11065.75,-1963.135,77.51662,0,0,0,0,100,0),
+(@PATH,4,-11065.75,-1967.135,77.51662,0,0,0,0,100,0),
+(@PATH,5,-11065.79,-1972.166,77.51814,0,0,0,0,100,0),
+(@PATH,6,-11066.38,-1980.533,77.51814,0,0,0,0,100,0),
+(@PATH,7,-11066.62,-1984.77,77.51814,0,0,0,0,100,0),
+(@PATH,8,-11069.65,-1987.687,77.51814,0,0,0,0,100,0),
+(@PATH,9,-11070.65,-1989.187,77.51814,0,0,0,0,100,0),
+(@PATH,10,-11071.15,-1989.937,77.51814,0,0,0,0,100,0),
+(@PATH,11,-11070.94,-1998.072,77.51814,0,0,0,0,100,0),
+(@PATH,12,-11070.44,-1998.822,77.51814,0,0,0,0,100,0),
+(@PATH,13,-11068.2,-2002.879,77.51814,0,0,0,0,100,0),
+(@PATH,14,-11065.7,-2003.629,77.51814,0,0,0,0,100,0),
+(@PATH,15,-11063.57,-2004.327,77.51814,0,0,0,0,100,0),
+(@PATH,16,-11061.32,-2005.077,77.51814,0,0,0,0,100,0),
+(@PATH,17,-11055.32,-2003.327,77.51814,0,0,0,0,100,0),
+(@PATH,18,-11054.66,-2002.821,77.55538,0,0,0,0,100,0),
+(@PATH,19,-11054.31,-1995.887,77.51814,0,0,0,0,100,0),
+(@PATH,20,-11055.06,-1993.137,77.51814,0,0,0,0,100,0),
+(@PATH,21,-11055.91,-1986.87,77.51814,0,0,0,0,100,0),
+(@PATH,22,-11054.91,-1981.87,77.51814,0,0,0,0,100,0),
+(@PATH,23,-11054.66,-1978.87,77.51814,0,0,0,0,100,0),
+(@PATH,24,-11054.28,-1978.515,77.51814,0,0,0,0,100,0),
+(@PATH,25,-11054.03,-1977.265,77.51814,0,0,0,0,100,0),
+(@PATH,26,-11053.78,-1974.765,77.51814,0,0,0,0,100,0),
+(@PATH,27,-11051.89,-1965.272,77.51814,0,0,0,0,100,0),
+(@PATH,28,-11048.71,-1950.098,77.51814,0,0,0,0,100,0),
+(@PATH,29,-11048.46,-1946.348,77.51814,0,0,0,0,100,0),
+(@PATH,30,-11047.88,-1941.905,77.51763,0,0,0,0,100,0),
+(@PATH,31,-11047.38,-1933.655,77.51763,0,0,0,0,100,0),
+(@PATH,32,-11047.21,-1931.985,77.51714,0,0,0,0,100,0),
+(@PATH,33,-11047.59,-1921.692,77.51558,0,0,0,0,100,0),
+(@PATH,34,-11057.2,-1924.383,77.51465,0,0,0,0,100,0),
+(@PATH,35,-11058.45,-1924.383,77.51465,0,0,0,0,100,0),
+(@PATH,36,-11063.45,-1924.133,77.51465,0,0,0,0,100,0),
+(@PATH,37,-11068.15,-1924.406,77.51405,0,0,0,0,100,0),
+(@PATH,38,-11067.4,-1927.406,77.51405,0,0,0,0,100,0),
+(@PATH,39,-11067.21,-1928.737,77.51527,0,0,0,0,100,0),
+(@PATH,40,-11066.71,-1930.737,77.51527,0,0,0,0,100,0),
+(@PATH,41,-11067.95,-1936.832,77.515,0,0,0,0,100,0),
+(@PATH,42,-11068.2,-1939.332,77.515,0,0,0,0,100,0),
+(@PATH,43,-11068.68,-1942.693,77.51746,0,0,0,0,100,0),
+(@PATH,44,-11068.93,-1945.193,77.51746,0,0,0,0,100,0),
+(@PATH,45,-11068.48,-1949.942,77.51735,0,0,0,0,100,0);
+-- 0x1C310842801005C00053CE00029939B3 .go -11067.45 -1954.224 77.52905
+
+SET @NPC := 135160;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-10901.4,`position_y`=-1937.891,`position_z`=92.465 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-10901.4,-1937.891,92.465,0,0,0,0,100,0),
+(@PATH,2,-10900.29,-1929.272,92.4336,0,0,0,0,100,0),
+(@PATH,3,-10901.91,-1923.966,92.44674,0,0,0,0,100,0),
+(@PATH,4,-10929.68,-1920.51,94.00494,0,0,0,0,100,0),
+(@PATH,5,-10931.06,-1919.155,94.07338,0,0,0,0,100,0),
+(@PATH,6,-10943.3,-1903.568,94.07179,0,0,0,0,100,0),
+(@PATH,7,-10944.89,-1920.322,94.07281,0,0,0,0,100,0),
+(@PATH,8,-10942.7,-1925.781,94.07328,0,0,0,0,100,0),
+(@PATH,9,-10938.01,-1929.625,94.00285,0,0,0,0,100,0),
+(@PATH,10,-10916.58,-1931.924,92.45416,0,0,0,0,100,0),
+(@PATH,11,-10913.29,-1936.26,92.45316,0,0,0,0,100,0),
+(@PATH,12,-10914.17,-1940.8,92.45174,0,0,0,0,100,0),
+(@PATH,13,-10916.33,-1945.966,92.44943,0,0,0,0,100,0),
+(@PATH,14,-10918.42,-1951.383,92.44786,0,0,0,0,100,0),
+(@PATH,15,-10915.9,-1954.492,92.43726,0,0,0,0,100,0),
+(@PATH,16,-10918.41,-1959.593,92.43956,0,0,0,0,100,0),
+(@PATH,17,-10925.46,-1968.512,92.43243,0,0,0,0,100,0),
+(@PATH,18,-10929.36,-1971.48,92.43213,0,0,0,0,100,0),
+(@PATH,19,-10930.33,-1974.389,92.43208,0,0,0,0,100,0),
+(@PATH,20,-10921.77,-1991.525,92.43311,0,0,0,0,100,0),
+(@PATH,21,-10917.44,-1995.525,92.43374,0,0,0,0,100,0),
+(@PATH,22,-10909.94,-1997.982,92.43427,0,0,0,0,100,0);
+-- 0x1C310842801005C00053CE00031939B3 .go -10901.4 -1937.891 92.465
+
+SET @NPC := 135165;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-10939.02,`position_y`=-1978.883,`position_z`=93.82455 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-10939.02,-1978.883,93.82455,0,0,0,0,100,0),
+(@PATH,2,-10937.05,-1980.987,94.02183,0,0,0,0,100,0),
+(@PATH,3,-10936.1,-1981.984,93.75357,0,0,0,0,100,0),
+(@PATH,4,-10935.1,-1982.984,93.00357,0,0,0,0,100,0),
+(@PATH,5,-10933.3,-1984.661,92.40492,0,0,0,0,100,0),
+(@PATH,6,-10931.4,-1988.728,92.43253,0,0,0,0,100,0),
+(@PATH,7,-10929.84,-1993.005,92.43249,0,0,0,0,100,0),
+(@PATH,8,-10929.33,-1998.021,92.43246,0,0,0,0,100,0),
+(@PATH,9,-10927.59,-1998.024,92.4326,0,0,0,0,100,0),
+(@PATH,10,-10926.84,-1997.024,92.4326,0,0,0,0,100,0),
+(@PATH,11,-10923.82,-1993.655,92.43284,0,0,0,0,100,0),
+(@PATH,12,-10920.28,-1992.615,92.43314,0,0,0,0,100,0),
+(@PATH,13,-10916.69,-1991.384,92.43354,0,0,0,0,100,0),
+(@PATH,14,-10912.31,-1989.809,92.43417,0,0,0,0,100,0),
+(@PATH,15,-10907.22,-1987.487,92.43446,0,0,0,0,100,0),
+(@PATH,16,-10907.61,-1983.417,92.43436,0,0,0,0,100,0),
+(@PATH,17,-10911.33,-1980.017,92.43408,0,0,0,0,100,0),
+(@PATH,18,-10913.89,-1977.515,92.43388,0,0,0,0,100,0),
+(@PATH,19,-10915.35,-1974.443,92.43365,0,0,0,0,100,0),
+(@PATH,20,-10917.08,-1969.858,92.43343,0,0,0,0,100,0),
+(@PATH,21,-10918.56,-1962.168,92.43033,0,0,0,0,100,0),
+(@PATH,22,-10917.81,-1960.168,92.43033,0,0,0,0,100,0),
+(@PATH,23,-10917.31,-1957.168,92.43033,0,0,0,0,100,0),
+(@PATH,24,-10916.8,-1956.043,92.44185,0,0,0,0,100,0),
+(@PATH,25,-10913.85,-1945.233,92.44743,0,0,0,0,100,0),
+(@PATH,26,-10913.63,-1940.582,92.45272,0,0,0,0,100,0),
+(@PATH,27,-10913.35,-1935.01,92.45383,0,0,0,0,100,0),
+(@PATH,28,-10917.51,-1933.436,92.45338,0,0,0,0,100,0),
+(@PATH,29,-10922.4,-1936.293,92.4428,0,0,0,0,100,0),
+(@PATH,30,-10925.65,-1937.793,92.4428,0,0,0,0,100,0),
+(@PATH,31,-10926.53,-1938.423,92.52744,0,0,0,0,100,0),
+(@PATH,32,-10929.78,-1939.673,92.52744,0,0,0,0,100,0),
+(@PATH,33,-10930.73,-1940.091,93.50311,0,0,0,0,100,0),
+(@PATH,34,-10930.98,-1938.091,93.75311,0,0,0,0,100,0),
+(@PATH,35,-10930.98,-1935.091,94.00311,0,0,0,0,100,0),
+(@PATH,36,-10932.33,-1925.829,94.07312,0,0,0,0,100,0),
+(@PATH,37,-10934.22,-1919.477,94.07236,0,0,0,0,100,0),
+(@PATH,38,-10936.83,-1914.139,94.07259,0,0,0,0,100,0),
+(@PATH,39,-10940.94,-1913.56,94.07243,0,0,0,0,100,0),
+(@PATH,40,-10943.83,-1916.909,94.07263,0,0,0,0,100,0),
+(@PATH,41,-10945.09,-1924.069,94.07304,0,0,0,0,100,0),
+(@PATH,42,-10945.81,-1929.354,94.07185,0,0,0,0,100,0),
+(@PATH,43,-10946.08,-1934.29,94.07332,0,0,0,0,100,0),
+(@PATH,44,-10945.36,-1938.052,94.06967,0,0,0,0,100,0),
+(@PATH,45,-10944.86,-1940.302,94.06967,0,0,0,0,100,0),
+(@PATH,46,-10943.61,-1941.302,94.06967,0,0,0,0,100,0),
+(@PATH,47,-10942.36,-1942.552,94.06967,0,0,0,0,100,0),
+(@PATH,48,-10941.18,-1943.745,94.07132,0,0,0,0,100,0),
+(@PATH,49,-10938.37,-1950.035,94.06915,0,0,0,0,100,0),
+(@PATH,50,-10938.62,-1951.785,94.06915,0,0,0,0,100,0),
+(@PATH,51,-10938.97,-1960.17,94.07024,0,0,0,0,100,0),
+(@PATH,52,-10939.53,-1967.704,94.07249,0,0,0,0,100,0),
+(@PATH,53,-10939.97,-1974.155,94.07382,0,0,0,0,100,0);
+-- 0x1C310842801005C00053CE00039939B3 .go -10939.02 -1978.883 93.82455
+
+SET @NPC := 135162;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-10946.03,`position_y`=-2018.407,`position_z`=80.01561 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-10946.03,-2018.407,80.01561,0,0,0,0,100,0),
+(@PATH,2,-10938.18,-2019.209,80.42243,0,0,0,0,100,0),
+(@PATH,3,-10936.18,-2020.459,80.42243,0,0,0,0,100,0),
+(@PATH,4,-10937.69,-2035.067,86.25978,0,0,0,0,100,0),
+(@PATH,5,-10937,-2040.216,86.32371,0,0,0,0,100,0),
+(@PATH,6,-10933.3,-2043.247,86.32394,0,0,0,0,100,0),
+(@PATH,7,-10928.26,-2043.84,86.32447,0,0,0,0,100,0),
+(@PATH,8,-10923.09,-2042.638,86.32227,0,0,0,0,100,0),
+(@PATH,9,-10920.8,-2037.279,86.56629,0,0,0,0,100,0),
+(@PATH,10,-10916.75,-2002.508,92.43436,0,0,0,0,100,0),
+(@PATH,11,-10911.1,-2000.068,92.43423,0,0,0,0,100,0),
+(@PATH,12,-10907.79,-1994.801,92.43451,0,0,0,0,100,0),
+(@PATH,13,-10903.67,-1963.204,92.42834,0,0,0,0,100,0),
+(@PATH,14,-10888.27,-1964.728,92.42189,0,0,0,0,100,0),
+(@PATH,15,-10903.75,-1963.212,92.4287,0,0,0,0,100,0),
+(@PATH,16,-10907.83,-1994.959,92.43437,0,0,0,0,100,0),
+(@PATH,17,-10911.13,-1999.935,92.43394,0,0,0,0,100,0),
+(@PATH,18,-10916.75,-2002.692,92.43467,0,0,0,0,100,0),
+(@PATH,19,-10920.86,-2037.652,86.46838,0,0,0,0,100,0),
+(@PATH,20,-10923.34,-2042.72,86.32289,0,0,0,0,100,0),
+(@PATH,21,-10927.59,-2043.72,86.32289,0,0,0,0,100,0),
+(@PATH,22,-10933.56,-2043.322,86.32355,0,0,0,0,100,0),
+(@PATH,23,-10937.03,-2040.081,86.32348,0,0,0,0,100,0),
+(@PATH,24,-10937.61,-2035.351,86.17421,0,0,0,0,100,0),
+(@PATH,25,-10935.98,-2020.486,80.32269,0,0,0,0,100,0),
+(@PATH,26,-10938.22,-2019.048,80.224,0,0,0,0,100,0);
+-- 0x1C310842801005C00053CE00041939B3 .go -10946.03 -2018.407 80.01561
+
+SET @NPC := 135163;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-10955.42,`position_y`=-1963.914,`position_z`=80.2235 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-10955.42,-1963.914,80.2235,0,0,0,0,100,0),
+(@PATH,2,-10954.92,-1963.914,80.2235,0,0,0,0,100,0),
+(@PATH,3,-10953.17,-1964.164,80.2235,0,0,0,0,100,0),
+(@PATH,4,-10951.67,-1964.164,80.2235,0,0,0,0,100,0),
+(@PATH,5,-10948.86,-1964.864,80.22345,0,0,0,0,100,0),
+(@PATH,6,-10950.26,-1979.561,80.22365,0,0,0,0,100,0),
+(@PATH,7,-10951.19,-1990.361,80.22372,0,0,0,0,100,0),
+(@PATH,8,-10951.69,-1996.111,80.22372,0,0,0,0,100,0),
+(@PATH,9,-10952.35,-2001.243,80.22384,0,0,0,0,100,0),
+(@PATH,10,-10952.85,-2007.493,80.22384,0,0,0,0,100,0),
+(@PATH,11,-10953.4,-2011.886,80.22395,0,0,0,0,100,0),
+(@PATH,12,-10954.68,-2022.679,80.224,0,0,0,0,100,0),
+(@PATH,13,-10954.93,-2024.179,80.224,0,0,0,0,100,0),
+(@PATH,14,-10955.48,-2028.294,80.22382,0,0,0,0,100,0),
+(@PATH,15,-10957.73,-2030.747,80.22321,0,0,0,0,100,0),
+(@PATH,16,-10962.98,-2030.497,80.22321,0,0,0,0,100,0),
+(@PATH,17,-10972.18,-2030.008,80.22282,0,0,0,0,100,0),
+(@PATH,18,-10983.17,-2027.766,80.22281,0,0,0,0,100,0),
+(@PATH,19,-10988.94,-2024.042,80.22321,0,0,0,0,100,0),
+(@PATH,20,-10988.37,-2013.056,80.22353,0,0,0,0,100,0),
+(@PATH,21,-10988.54,-2013.409,79.97359,0,0,0,0,100,0),
+(@PATH,22,-10988.46,-2013.481,80.22325,0,0,0,0,100,0),
+(@PATH,23,-10988.71,-2023.731,80.22325,0,0,0,0,100,0),
+(@PATH,24,-10988.75,-2023.836,80.22316,0,0,0,0,100,0),
+(@PATH,25,-10988.75,-2024.336,80.22316,0,0,0,0,100,0),
+(@PATH,26,-10982.8,-2028.037,80.22272,0,0,0,0,100,0),
+(@PATH,27,-10971.73,-2030.244,80.22316,0,0,0,0,100,0),
+(@PATH,28,-10962.98,-2030.494,80.22316,0,0,0,0,100,0),
+(@PATH,29,-10957.72,-2030.729,80.22354,0,0,0,0,100,0),
+(@PATH,30,-10955.97,-2028.979,80.22354,0,0,0,0,100,0),
+(@PATH,31,-10955.48,-2028.02,80.22393,0,0,0,0,100,0),
+(@PATH,32,-10954.98,-2024.27,80.22393,0,0,0,0,100,0),
+(@PATH,33,-10954.72,-2023.956,80.22394,0,0,0,0,100,0),
+(@PATH,34,-10954.47,-2022.456,80.22394,0,0,0,0,100,0),
+(@PATH,35,-10953.16,-2011.596,80.22389,0,0,0,0,100,0),
+(@PATH,36,-10953.16,-2007.846,80.22389,0,0,0,0,100,0),
+(@PATH,37,-10952.21,-2001.05,80.22374,0,0,0,0,100,0),
+(@PATH,38,-10951.96,-1996.3,80.22374,0,0,0,0,100,0),
+(@PATH,39,-10951.04,-1990.129,80.22367,0,0,0,0,100,0),
+(@PATH,40,-10949.86,-1979.275,80.22361,0,0,0,0,100,0),
+(@PATH,41,-10948.86,-1965.775,80.22361,0,0,0,0,100,0),
+(@PATH,42,-10948.85,-1965.412,80.22345,0,0,0,0,100,0),
+(@PATH,43,-10951.85,-1964.412,80.22345,0,0,0,0,100,0),
+(@PATH,44,-10953.1,-1964.162,80.22345,0,0,0,0,100,0),
+(@PATH,45,-10955.14,-1963.792,80.22339,0,0,0,0,100,0),
+(@PATH,46,-10960.14,-1963.292,80.22339,0,0,0,0,100,0),
+(@PATH,47,-10965.23,-1962.463,80.2235,0,0,0,0,100,0),
+(@PATH,48,-10965.14,-1962.785,79.97355,0,0,0,0,100,0),
+(@PATH,49,-10960.49,-1963.204,80.22346,0,0,0,0,100,0),
+(@PATH,50,-10955.74,-1963.704,80.22346,0,0,0,0,100,0);
+-- 0x1C310842801005C00053CE00049939B3 .go -10955.42 -1963.914 80.2235
+
+SET @NPC := 135164;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-10966.42,`position_y`=-1982.83,`position_z`=80.22289 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-10966.42,-1982.83,80.22289,0,0,0,0,100,0),
+(@PATH,2,-10966.24,-1994.689,80.22308,0,0,0,0,100,0),
+(@PATH,3,-10964.49,-1996.189,80.22308,0,0,0,0,100,0),
+(@PATH,4,-10960.91,-2000.212,80.22343,0,0,0,0,100,0),
+(@PATH,5,-10960.91,-2004.462,80.22343,0,0,0,0,100,0),
+(@PATH,6,-10960.92,-2011.736,80.22325,0,0,0,0,100,0),
+(@PATH,7,-10964.42,-2015.986,80.22325,0,0,0,0,100,0),
+(@PATH,8,-10970.53,-2022.625,80.22308,0,0,0,0,100,0),
+(@PATH,9,-10972.53,-2020.375,80.22308,0,0,0,0,100,0),
+(@PATH,10,-10972.61,-2018.252,80.22304,0,0,0,0,100,0),
+(@PATH,11,-10977.02,-2015.768,80.22273,0,0,0,0,100,0),
+(@PATH,12,-10973.18,-2002.99,80.22287,0,0,0,0,100,0),
+(@PATH,13,-10975.69,-1994.738,80.22289,0,0,0,0,100,0),
+(@PATH,14,-10973.55,-1987.507,80.22292,0,0,0,0,100,0),
+(@PATH,15,-10973.07,-1975.399,80.22276,0,0,0,0,100,0),
+(@PATH,16,-10967.98,-1974.459,80.22279,0,0,0,0,100,0),
+(@PATH,17,-10967.48,-1973.709,80.22279,0,0,0,0,100,0),
+(@PATH,18,-10964.03,-1970.752,80.22292,0,0,0,0,100,0),
+(@PATH,19,-10959.04,-1970.99,80.22316,0,0,0,0,100,0),
+(@PATH,20,-10957.93,-1975.517,80.22319,0,0,0,0,100,0),
+(@PATH,21,-10959.64,-1979.725,80.22298,0,0,0,0,100,0);
+-- 0x1C310842801005C00053CE00051939B3 .go -10966.42 -1982.83 80.22289
+
+SET @NPC := 135152;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-10993.07,`position_y`=-2027.777,`position_z`=79.97364 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-10993.07,-2027.777,79.97364,0,0,0,0,100,0),
+(@PATH,2,-10954.54,-2031.941,80.22369,0,0,0,0,100,0),
+(@PATH,3,-10945.95,-1963.57,80.2234,0,0,0,0,100,0),
+(@PATH,4,-10964.31,-1961.222,80.22327,0,0,0,0,100,0),
+(@PATH,5,-10945.95,-1963.57,80.2234,0,0,0,0,100,0),
+(@PATH,6,-10954.54,-2031.941,80.22369,0,0,0,0,100,0),
+(@PATH,7,-10993.07,-2027.777,79.97364,0,0,0,0,100,0),
+(@PATH,8,-10990.63,-2007.031,80.22373,0,0,0,0,100,0);
+-- 0x1C310842801005C00053CE00059939B3 .go -10993.07 -2027.777 79.97364
+
+SET @NPC := 135161;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-10940.92,`position_y`=-1998.817,`position_z`=93.95387 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-10936.96,-1999.992,92.54521,0,0,0,0,100,0),
+(@PATH,2,-10940.92,-1998.817,93.95387,0,0,0,0,100,0),
+(@PATH,3,-10946.22,-2042.642,94.07538,0,0,0,0,100,0),
+(@PATH,4,-11002.46,-2037.389,94.07399,0,0,0,0,100,0),
+(@PATH,5,-10997.76,-1988.969,94.08043,0,0,0,0,100,0),
+(@PATH,6,-11001.04,-1986.668,94.07949,0,0,0,0,100,0),
+(@PATH,7,-11019.84,-1984.078,94.08058,0,0,0,0,100,0),
+(@PATH,8,-11021.94,-1979.799,94.07922,0,0,0,0,100,0),
+(@PATH,9,-11021.18,-1971.51,94.07477,0,0,0,0,100,0),
+(@PATH,10,-11021.94,-1979.799,94.07922,0,0,0,0,100,0),
+(@PATH,11,-11019.84,-1984.078,94.08058,0,0,0,0,100,0),
+(@PATH,12,-11001.04,-1986.668,94.07949,0,0,0,0,100,0),
+(@PATH,13,-10997.76,-1988.969,94.08043,0,0,0,0,100,0),
+(@PATH,14,-11002.46,-2037.389,94.07399,0,0,0,0,100,0),
+(@PATH,15,-10946.22,-2042.642,94.07538,0,0,0,0,100,0),
+(@PATH,16,-10940.92,-1998.817,93.95387,0,0,0,0,100,0);
+-- 0x1C310842801005C00053CE00061939B3 .go -10936.96 -1999.992 92.54521
+
+SET @NPC := 135166;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-11018.67,`position_y`=-1948.95,`position_z`=94.11409 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-11018.67,-1948.95,94.11409,0,0,0,0,100,0),
+(@PATH,2,-11019.33,-1955.598,94.06949,0,0,0,0,100,0),
+(@PATH,3,-11017.58,-1958.348,94.06949,0,0,0,0,100,0),
+(@PATH,4,-11015.82,-1960.591,94.07437,0,0,0,0,100,0),
+(@PATH,5,-11010.95,-1961.954,94.07813,0,0,0,0,100,0),
+(@PATH,6,-11005.31,-1962.993,94.07982,0,0,0,0,100,0),
+(@PATH,7,-11000.51,-1962.511,94.08182,0,0,0,0,100,0),
+(@PATH,8,-10997.26,-1960.511,94.08182,0,0,0,0,100,0),
+(@PATH,9,-10997.06,-1960.231,94.07545,0,0,0,0,100,0),
+(@PATH,10,-10993.45,-1956.026,94.0743,0,0,0,0,100,0),
+(@PATH,11,-10992.71,-1952.289,94.06744,0,0,0,0,100,0),
+(@PATH,12,-10992.46,-1951.039,94.06744,0,0,0,0,100,0),
+(@PATH,13,-10989.33,-1951.245,94.06941,0,0,0,0,100,0),
+(@PATH,14,-10989.58,-1952.745,94.06941,0,0,0,0,100,0),
+(@PATH,15,-10990.44,-1956.788,94.07174,0,0,0,0,100,0),
+(@PATH,16,-10992.64,-1960.311,94.07793,0,0,0,0,100,0),
+(@PATH,17,-10999.8,-1964.796,94.08316,0,0,0,0,100,0),
+(@PATH,18,-11003.42,-1967.318,94.08348,0,0,0,0,100,0),
+(@PATH,19,-11005.92,-1969.318,94.08348,0,0,0,0,100,0),
+(@PATH,20,-11009.72,-1972.45,94.08435,0,0,0,0,100,0),
+(@PATH,21,-11006.94,-1976.569,94.08415,0,0,0,0,100,0),
+(@PATH,22,-11005.19,-1978.569,94.08415,0,0,0,0,100,0),
+(@PATH,23,-11002.7,-1981.706,94.08524,0,0,0,0,100,0),
+(@PATH,24,-10996.71,-1985.477,94.08297,0,0,0,0,100,0),
+(@PATH,25,-10993.34,-1986.766,94.08041,0,0,0,0,100,0),
+(@PATH,26,-10998.21,-2033.577,94.07561,0,0,0,0,100,0),
+(@PATH,27,-10949.22,-2039.019,94.07603,0,0,0,0,100,0),
+(@PATH,28,-10941.91,-1976.454,94.07447,0,0,0,0,100,0),
+(@PATH,29,-10941.03,-1973.073,94.07249,0,0,0,0,100,0),
+(@PATH,30,-10941.03,-1970.573,94.07249,0,0,0,0,100,0),
+(@PATH,31,-10938.04,-1944.34,94.0692,0,0,0,0,100,0),
+(@PATH,32,-10944.45,-1938.374,94.06937,0,0,0,0,100,0),
+(@PATH,33,-10945.51,-1937.203,94.07327,0,0,0,0,100,0),
+(@PATH,34,-10942.28,-1905.302,93.82167,0,0,0,0,100,0),
+(@PATH,35,-10945.63,-1937.244,94.0717,0,0,0,0,100,0),
+(@PATH,36,-10944.63,-1938.244,94.0717,0,0,0,0,100,0),
+(@PATH,37,-10938.18,-1944.174,94.06793,0,0,0,0,100,0),
+(@PATH,38,-10940.76,-1970.675,94.07205,0,0,0,0,100,0),
+(@PATH,39,-10941.05,-1973.169,94.07341,0,0,0,0,100,0),
+(@PATH,40,-10942.1,-1976.591,94.07454,0,0,0,0,100,0),
+(@PATH,41,-10949.38,-2038.871,94.07526,0,0,0,0,100,0),
+(@PATH,42,-10998.12,-2033.78,94.07454,0,0,0,0,100,0),
+(@PATH,43,-10993.17,-1986.922,94.08283,0,0,0,0,100,0),
+(@PATH,44,-10996.42,-1985.672,94.08283,0,0,0,0,100,0),
+(@PATH,45,-11002.46,-1981.708,94.08536,0,0,0,0,100,0),
+(@PATH,46,-11005.32,-1978.522,94.08371,0,0,0,0,100,0),
+(@PATH,47,-11007.07,-1976.272,94.08371,0,0,0,0,100,0),
+(@PATH,48,-11009.86,-1972.258,94.08409,0,0,0,0,100,0),
+(@PATH,49,-11006.01,-1968.957,94.08367,0,0,0,0,100,0),
+(@PATH,50,-11003.51,-1967.457,94.08367,0,0,0,0,100,0),
+(@PATH,51,-10999.68,-1964.603,94.08018,0,0,0,0,100,0),
+(@PATH,52,-10992.57,-1960.071,94.07755,0,0,0,0,100,0),
+(@PATH,53,-10990.57,-1957.071,94.07755,0,0,0,0,100,0),
+(@PATH,54,-10989.64,-1952.785,94.06929,0,0,0,0,100,0),
+(@PATH,55,-10989.41,-1951.198,94.06895,0,0,0,0,100,0),
+(@PATH,56,-10992.41,-1950.948,94.06895,0,0,0,0,100,0),
+(@PATH,57,-10992.66,-1952.448,94.06895,0,0,0,0,100,0),
+(@PATH,58,-10993.41,-1956.079,94.07048,0,0,0,0,100,0),
+(@PATH,59,-10997.04,-1960.266,94.07538,0,0,0,0,100,0),
+(@PATH,60,-11000.84,-1962.545,94.08139,0,0,0,0,100,0),
+(@PATH,61,-11005.54,-1962.94,94.07911,0,0,0,0,100,0),
+(@PATH,62,-11011.18,-1961.785,94.07573,0,0,0,0,100,0),
+(@PATH,63,-11015.9,-1960.729,94.07407,0,0,0,0,100,0),
+(@PATH,64,-11017.4,-1958.479,94.07407,0,0,0,0,100,0),
+(@PATH,65,-11019.35,-1955.508,94.06929,0,0,0,0,100,0);
+-- 0x1C310842801005C00053CE00069939B3 .go -11018.67 -1948.95 94.11409
+
+SET @NPC := 135308;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-10979.41,`position_y`=-1917.581,`position_z`=79.1259 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-10979.41,-1917.581,79.1259,0,0,0,0,100,0),
+(@PATH,2,-10998.85,-1915.525,79.12059,0,0,0,0,100,0),
+(@PATH,3,-11004.85,-1917.525,79.12059,0,0,0,0,100,0),
+(@PATH,4,-11006.42,-1919.255,79.13147,0,0,0,0,100,0),
+(@PATH,5,-11009.31,-1923.276,79.13788,0,0,0,0,100,0),
+(@PATH,6,-11014.77,-1924.695,79.11803,0,0,0,0,100,0),
+(@PATH,7,-11025.74,-1923.575,79.06779,0,0,0,0,100,0),
+(@PATH,8,-11039.73,-1922.107,77.51696,0,0,0,0,100,0),
+(@PATH,9,-11050.26,-1923.549,77.51479,0,0,0,0,100,0),
+(@PATH,10,-11062.01,-1926.049,77.51479,0,0,0,0,100,0),
+(@PATH,11,-11068.23,-1927.658,77.51482,0,0,0,0,100,0),
+(@PATH,12,-11050.19,-1925.471,77.51665,0,0,0,0,100,0),
+(@PATH,13,-11039.85,-1924.404,77.56751,0,0,0,0,100,0),
+(@PATH,14,-11025.49,-1925.841,79.11525,0,0,0,0,100,0),
+(@PATH,15,-11014.73,-1927.159,79.11803,0,0,0,0,100,0),
+(@PATH,16,-11010.48,-1927.909,79.11803,0,0,0,0,100,0),
+(@PATH,17,-11008.93,-1928.397,79.11803,0,0,0,0,100,0),
+(@PATH,18,-11007.43,-1929.897,79.11803,0,0,0,0,100,0),
+(@PATH,19,-11004.79,-1932.291,79.11801,0,0,0,0,100,0),
+(@PATH,20,-10995.54,-1934.041,79.11801,0,0,0,0,100,0),
+(@PATH,21,-10970.88,-1936.847,79.11803,0,0,0,0,100,0),
+(@PATH,22,-10965.63,-1935.597,79.11803,0,0,0,0,100,0),
+(@PATH,23,-10963.02,-1932.276,79.11803,0,0,0,0,100,0),
+(@PATH,24,-10960.78,-1928.736,79.11803,0,0,0,0,100,0),
+(@PATH,25,-10962.28,-1925.236,79.11803,0,0,0,0,100,0),
+(@PATH,26,-10963.28,-1922.127,79.1109,0,0,0,0,100,0),
+(@PATH,27,-10968.51,-1919.033,79.11447,0,0,0,0,100,0);
+-- 0x1C310842801007C00053CE00001939B3 .go -10979.41 -1917.581 79.1259
+
+SET @NPC := 135311;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-10967.35,`position_y`=-1910.074,`position_z`=79.13056 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-10967.35,-1910.074,79.13056,0,0,0,0,100,0),
+(@PATH,2,-10973.81,-1909.259,79.13441,0,0,0,0,100,0),
+(@PATH,3,-10978.96,-1902.012,79.11913,0,0,0,0,100,0),
+(@PATH,4,-10993.51,-1900.544,79.10841,0,0,0,0,100,0),
+(@PATH,5,-10998.31,-1904.632,79.0873,0,0,0,0,100,0),
+(@PATH,6,-11008.63,-1904.277,79.12164,0,0,0,0,100,0),
+(@PATH,7,-11016.06,-1902.035,79.11803,0,0,0,0,100,0),
+(@PATH,8,-11018.93,-1894.202,79.11803,0,0,0,0,100,0),
+(@PATH,9,-11013.55,-1888.369,79.11407,0,0,0,0,100,0),
+(@PATH,10,-11005.47,-1887.72,79.09593,0,0,0,0,100,0),
+(@PATH,11,-10997.97,-1889.47,79.09593,0,0,0,0,100,0),
+(@PATH,12,-10993.66,-1894.292,79.0679,0,0,0,0,100,0),
+(@PATH,13,-10993.11,-1896.752,79.08858,0,0,0,0,100,0),
+(@PATH,14,-10978.52,-1899.429,79.14062,0,0,0,0,100,0),
+(@PATH,15,-10971.52,-1891.436,79.14864,0,0,0,0,100,0),
+(@PATH,16,-10968.58,-1890.591,79.14295,0,0,0,0,100,0),
+(@PATH,17,-10964.36,-1890.848,79.12196,0,0,0,0,100,0),
+(@PATH,18,-10958.21,-1891.544,78.85779,0,0,0,0,100,0),
+(@PATH,19,-10953.68,-1895.616,79.11803,0,0,0,0,100,0),
+(@PATH,20,-10951.67,-1902.097,79.12449,0,0,0,0,100,0),
+(@PATH,21,-10954.11,-1907.472,79.1279,0,0,0,0,100,0),
+(@PATH,22,-10957.36,-1910.472,79.1279,0,0,0,0,100,0);
+-- 0x1C310842801007C00053CE00009939B3 .go -10967.35 -1910.074 79.13056
+
+SET @NPC := 135307;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-11097.81,`position_y`=-1933.661,`position_z`=50.14211 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-11097.81,-1933.661,50.14211,0,0,0,0,100,0),
+(@PATH,2,-11102.14,-1941.538,50.13525,0,0,0,0,100,0),
+(@PATH,3,-11110.07,-1946.739,50.13507,0,0,0,0,100,0),
+(@PATH,4,-11116.22,-1949.221,50.13885,0,0,0,0,100,0),
+(@PATH,5,-11127.4,-1949.477,50.13752,0,0,0,0,100,0),
+(@PATH,6,-11137.96,-1945.1,50.13647,0,0,0,0,100,0),
+(@PATH,7,-11127.29,-1949.459,50.13817,0,0,0,0,100,0),
+(@PATH,8,-11116.23,-1949.254,50.13683,0,0,0,0,100,0),
+(@PATH,9,-11110.07,-1946.739,50.13507,0,0,0,0,100,0),
+(@PATH,10,-11102.14,-1941.538,50.13525,0,0,0,0,100,0);
+-- 0x1C310842800FC7C00053CE00001939B3 .go -11097.81 -1933.661 50.14211
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_27_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_27_00_world.sql
new file mode 100644
index 00000000000..9421881c88a
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_27_00_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_clear_debuffs';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(34098, 'spell_gen_clear_debuffs');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_28_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_28_00_world.sql
new file mode 100644
index 00000000000..b4a7e2d5a36
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_28_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature` SET `spawndist`=0 WHERE `guid`=135230;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_28_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_28_01_world.sql
new file mode 100644
index 00000000000..b4a24b011b3
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_28_01_world.sql
@@ -0,0 +1 @@
+UPDATE creature_template SET ScriptName = "npc_pet_gen_baby_blizzard_bear" WHERE entry = 32841;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_03_29_00_world_335.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_29_00_world_335.sql
new file mode 100644
index 00000000000..e3851e59c8e
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_03_29_00_world_335.sql
@@ -0,0 +1,11 @@
+--
+UPDATE `game_event` SET `start_time`='2016-06-21 00:01:00' WHERE `eventEntry`=1;
+UPDATE `game_event` SET `start_time`='2016-12-15 06:00:00' WHERE `eventEntry`=2;
+UPDATE `game_event` SET `start_time`='2016-03-27 00:01:00' WHERE `eventEntry`=9;
+UPDATE `game_event` SET `start_time`='2016-05-02 00:01:00' WHERE `eventEntry`=10;
+UPDATE `game_event` SET `start_time`='2016-09-09 00:01:00' WHERE `eventEntry`=11;
+UPDATE `game_event` SET `start_time`='2016-10-18 01:00:00' WHERE `eventEntry`=12;
+UPDATE `game_event` SET `start_time`='2016-09-20 00:01:00' WHERE `eventEntry`=24;
+UPDATE `game_event` SET `start_time`='2016-11-21 01:00:00' WHERE `eventEntry`=26;
+UPDATE `game_event` SET `start_time`='2016-09-19 00:01:00' WHERE `eventEntry`=50;
+UPDATE `game_event` SET `start_time`='2016-11-01 01:00:00' WHERE `eventEntry`=51;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_01_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_01_00_world.sql
new file mode 100644
index 00000000000..024bbb6fa5a
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_01_00_world.sql
@@ -0,0 +1,89 @@
+DELETE FROM `creature_text` WHERE `entry` in(25317,25220,25222);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES
+(25317, 0, 0, 'What''s the matter, $c? Think you''re too good to stand in line with the rest of us?', 12, 0, 100, 0, 0, 0, 24758, 'Civilian Recruit to Player'),
+(25220, 0, 0, 'Miner.', 12, 7, 100, 66, 0, 0, 24377, 'Civilian Recruit to Generic Quest Trigger - LAB'),
+(25220, 0, 1, 'Farmhand, sir.', 12, 7, 100, 66, 0, 0, 24373, 'Civilian Recruit to Generic Quest Trigger - LAB'),
+(25220, 0, 2, 'Tailor.', 12, 7, 100, 66, 0, 0, 24374, 'Civilian Recruit to Generic Quest Trigger - LAB'),
+(25220, 0, 3, 'Blacksmith.', 12, 7, 100, 66, 0, 0, 24375, 'Civilian Recruit to Generic Quest Trigger - LAB'),
+(25220, 0, 4, 'Carpenter.', 12, 7, 100, 66, 0, 0, 24371, 'Civilian Recruit to Generic Quest Trigger - LAB'),
+(25220, 0, 5, 'Shipwright.', 12, 7, 100, 66, 0, 0, 24372, 'Civilian Recruit to Generic Quest Trigger - LAB'),
+(25220, 0, 6, 'Mason, sir.', 12, 7, 100, 66, 0, 0, 24376, 'Civilian Recruit to Generic Quest Trigger - LAB'),
+(25220, 0, 7, 'Cook.', 12, 7, 100, 66, 0, 0, 24378, 'Civilian Recruit to Generic Quest Trigger - LAB'),
+(25222, 0, 0, 'What did you do before you came to Northrend, then?', 12, 7, 100, 0, 0, 0, 24386, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 0, 1, 'State your profession.', 12, 7, 100, 0, 0, 0, 24382, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 0, 2, 'Yes, then. What is your trade?', 12, 7, 100, 0, 0, 0, 24383, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 0, 3, 'Your previous line of work, recruit?', 12, 7, 100, 0, 0, 0, 24385, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 0, 4, 'Your profession?', 12, 7, 100, 0, 0, 0, 24384, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 1, 0, 'Yes, you''re well seasoned in your field of work. Report to the civilian liaison at once, we need more like you!', 12, 7, 100, 273, 0, 0, 24361, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 1, 1, 'I thought we had enough in your line of work, but it looks like we have some openings. Report to the civilian liaison.', 12, 7, 100, 273, 0, 0, 24360, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 1, 2, 'I do have some openings in your line of work. Report to the civilian liaison.', 12, 7, 100, 273, 0, 0, 24359, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 1, 3, 'Yeah. We could use some more of you. Report to the civilian liaison for work assignment.', 12, 7, 100, 273, 0, 0, 24358, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 2, 0, 'Not anymore! Here''s your sword. Report to the barracks for duty!', 12, 7, 100, 397, 0, 0, 24363, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 2, 1, 'Afraid not, friend. Here''s your sword and shield. Report to the barracks for duty.', 12, 7, 100, 397, 0, 0, 24365, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 2, 2, 'You''re breaking my heart - I''ve quotas to fill, you know? Can you wield a sword? Off to the barracks.', 12, 7, 100, 397, 0, 0, 24367, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 2, 3, 'With a sword arm like that? I''m afraid we need you in the front lines, my friend. Report to the barracks.', 12, 7, 100, 397, 0, 0, 24366, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 2, 4, 'Looks like we have room for one more... no, my mistake. That''s a seven not a one. Hope you''re good with a sword - report to the barracks.', 12, 7, 100, 397, 0, 0, 24368, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 3, 0, 'Next, please!', 12, 7, 100, 22, 0, 0, 24370, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 3, 1, 'Keep it moving, people.', 12, 7, 100, 22, 0, 0, 24369, 'Recruitment Officer Carven to Generic Quest Trigger - LAB'),
+(25222, 3, 2, 'Next!', 12, 7, 100, 22, 0, 0, 24357, 'Recruitment Officer Carven to Generic Quest Trigger - LAB');
+
+DELETE FROM `waypoints` WHERE `entry`=25220;
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(25220, 1, 2253.644, 5195.469, 11.40062, 'Civilian Recruit'),
+(25220, 2, 2254.098, 5196.36, 11.40062, 'Civilian Recruit'),
+(25220, 3, 2277.823, 5238.724, 11.45096, 'Civilian Recruit'),
+(25220, 4, 2279.217, 5241.407, 11.45096, 'Civilian Recruit'),
+(25220, 5, 2280.84, 5244.218, 11.45719, 'Civilian Recruit'),
+(25220, 6, 2282.603, 5245.736, 11.36353, 'Civilian Recruit'),
+(25220, 7, 2284.867, 5246.299, 11.45096, 'Civilian Recruit'),
+(25220, 8, 2287.469, 5245.929, 11.45096, 'Civilian Recruit'),
+(25220, 9, 2289.469, 5244.898, 11.45096, 'Civilian Recruit'),
+(25220, 10, 2291.772, 5243.933, 11.45096, 'Civilian Recruit'),
+(25220, 11, 2294.129, 5242.708, 11.45096, 'Civilian Recruit'),
+(25220, 12, 2298.062, 5241.932, 12.3176, 'Civilian Recruit'),
+(25220, 13, 2303.019, 5253.306, 11.50584, 'Civilian Recruit'),
+(25220, 14, 2308.73, 5256.926, 11.50584, 'Civilian Recruit'),
+(25220, 15, 2320.826, 5259.258, 11.25584, 'Civilian Recruit');
+
+DELETE FROM `creature` WHERE `guid` IN(108008,108007,108006,108005,108004,108003,108002,108001,108000);
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`IN(24959,25220,25307);
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`IN(-107575,-107574);
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`IN(25220,25307);
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`IN(2522000,2522001);
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(-107575, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Generic Quest Trigger - LAB - On Spawn - Set Active'),
+(-107575, 0, 1, 0, 1, 0, 100, 0, 0, 0, 22000, 23000, 12, 25220, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Generic Quest Trigger - LAB - OOC - Cast Borean Tundra - Valiance Keep Flavor - Summon Recruit'),
+(-107574, 0, 1, 0, 1, 0, 100, 0, 0, 0, 22000, 23000, 11, 45307, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Generic Quest Trigger - LAB - OOC - Cast Borean Tundra - Valiance Keep Flavor - Queue Global Ping'),
+(25307, 0, 0, 0, 19, 0, 100, 0, 11672, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 25317, 0, 0, 0, 0, 0, 0, 'Recruitment Officer Blythe - On Quest Accepted (Enlistment Day) - Say'),
+(25220, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Just Summoned - Set Active'),
+(25220, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 25220, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Just Summoned - Start WP'),
+(25220, 0, 2, 0, 8, 0, 100, 0, 45313, 0, 0, 0, 54, 22000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Spellhit - Anchor Here - Pause WP'),
+(25220, 0, 3, 0, 8, 0, 100, 0, 45307, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Spellhit - Borean Tundra - Valiance Keep Flavor - Queue Global Ping - Resume WP'),
+(25220, 0, 4, 0, 40, 0, 100, 0, 3, 25220, 0, 0, 11, 45313, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP3 - Cast Anchor Here'),
+(25220, 0, 5, 0, 40, 0, 100, 0, 4, 25220, 0, 0, 11, 45313, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP4 - Cast Anchor Here'),
+(25220, 0, 6, 0, 40, 0, 100, 0, 5, 25220, 0, 0, 11, 45313, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP5 - Cast Anchor Here'),
+(25220, 0, 7, 0, 40, 0, 100, 0, 6, 25220, 0, 0, 11, 45313, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP6 - Cast Anchor Here'),
+(25220, 0, 8, 0, 40, 0, 100, 0, 7, 25220, 0, 0, 11, 45313, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP7 - Cast Anchor Here'),
+(25220, 0, 9, 0, 40, 0, 100, 0, 8, 25220, 0, 0, 11, 45313, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP8 - Cast Anchor Here'),
+(25220, 0, 10, 0, 40, 0, 100, 0, 9, 25220, 0, 0, 11, 45313, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP9 - Cast Anchor Here'),
+(25220, 0, 11, 0, 40, 0, 100, 0, 10, 25220, 0, 0, 11, 45313, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP10 - Cast Anchor Here'),
+(25220, 0, 12, 0, 40, 0, 100, 0, 11, 25220, 0, 0, 11, 45313, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP11 - Cast Anchor Here'),
+(25220, 0, 13, 14, 40, 0, 100, 0, 12, 25220, 0, 0, 54, 18000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP11 - Cast Anchor Here'),
+(25220, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 87, 2522000, 2522001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP11 - Run Script'),
+(25220, 0, 15, 0, 40, 0, 100, 0, 15, 25220, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - On Reached WP15 - Despawn'),
+(2522000, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 25222, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Script 1 - Say'),
+(2522000, 9, 1, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Scrip 2 - Say'),
+(2522000, 9, 2, 0, 0, 0, 100, 0, 6000, 7000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, 25222, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Script 2 - Say'),
+(2522000, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Script 2 - Equip Items'),
+(2522000, 9, 4, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 65, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Script 2 - Resume WP'),
+(2522000, 9, 5, 0, 0, 0, 100, 0, 4000, 5000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 19, 25222, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Script 2 - Say'),
+(2522001, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 25222, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Script 1 - Say'),
+(2522001, 9, 1, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Scrip 2 - Say'),
+(2522001, 9, 2, 0, 0, 0, 100, 0, 6000, 7000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, 25222, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Script 3 - Say'),
+(2522001, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 2178, 143, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Script 3 - Equip Items'),
+(2522001, 9, 4, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 65, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Script 3 - Resume WP'),
+(2522001, 9, 5, 0, 0, 0, 100, 0, 4000, 5000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 19, 25222, 0, 0, 0, 0, 0, 0, 'Civilian Recruit - Script 2 - Say');
+
+
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_01_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_01_01_world.sql
new file mode 100644
index 00000000000..38a13f0ea84
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_01_01_world.sql
@@ -0,0 +1,67 @@
+UPDATE `smart_scripts` SET `event_chance`=100 WHERE `entryorguid`=26417 AND `source_type`=0 AND `id`=2 AND `link`=3;
+UPDATE `smart_scripts` SET `event_chance`=100, `action_type`=87, `action_param2`=2641701, `action_param3`=2641701, `action_param4`=2641701 WHERE `entryorguid`=26417 AND `source_type`=0 AND `id`=3 AND `link`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=2641701 AND `source_type`=9 AND `id`=0 AND `link`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=26417 AND `source_type`=0 AND `id`>3;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=26261 AND `source_type`=0 AND `id`=3 AND `link`=0;
+UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`IN(188264,188288,188289);
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`IN(188264,188288,188289);
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`IN(26445);
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`IN(26445);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(-109925,-109919,-109926,-109911,-109912,-109910,-109908,-109920,-109913,-109921,-109923,-109909,-109922);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=46820;
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=47320;
+
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 46820, 0, 1, 31, 0, 3, 26264, 0, 0, 0, 0,'', 'Toss Tree - only targets Dummy'),
+(13, 1, 47320, 0, 1, 31, 0, 3, 26261, 0, 0, 0, 0,'', 'Toss Boulder 2 - only targets Runed Giant');
+
+UPDATE`smart_scripts` SET `action_param1`=47320,`comment`='Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder 2\'' WHERE `entryorguid`=26261 AND `source_type`=0 AND `id`=2 AND `link`=0;
+UPDATE `smart_scripts` SET `event_param3`=12000, `event_param4`=21000 WHERE `entryorguid`=26261 AND `source_type`=0 AND `id`=2 AND `link`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(2641701, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 36, 26872, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Runed Giant - On Script 2 - Change entry to Weakened Giant'),
+(26417, 0, 4, 0, 75, 0, 100, 0, 0, 26261, 30, 0, 49, 0, 0, 0, 0, 0, 0, 19, 26261, 0, 0, 0, 0, 0, 0, 'Runed Giant - On Grizzly Hills Giant within 20 yards - Attack Grizzly Hills Giant'),
+(26261, 0, 3, 0, 75, 0, 100, 0, 0, 26417, 30, 0, 49, 0, 0, 0, 0, 0, 0, 19, 26417, 0, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - On Runed Giant in Range - Attack Runed Giant'),
+(188264, 1, 0, 1, 70, 0, 100, 0, 2, 0, 0, 0, 12, 26445, 1, 1000, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'First Rune Plate - On Gossip Hello - Summon Rune Plate'),
+(188264, 1, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 26445, 0, 0, 0, 0, 0, 0, 'First Rune Plate - On Gossip Hello - Set Data on Rune Plate'),
+(188288, 1, 0, 1, 70, 0, 100, 0, 2, 0, 0, 0, 12, 26445, 1, 1000, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Second Rune Plate - On Gossip Hello - Summon Rune Plate'),
+(188288, 1, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, 26445, 0, 0, 0, 0, 0, 0, 'Second Rune Plate - On Gossip Hello - Set Data on Rune Plate'),
+(188289, 1, 0, 1, 70, 0, 100, 0, 2, 0, 0, 0, 12, 26445, 1, 1000, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Third Rune Plate - On Gossip Hello - Summon Rune Plate'),
+(188289, 1, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 3, 3, 0, 0, 0, 0, 19, 26445, 0, 0, 0, 0, 0, 0, 'Third Rune Plate - On Gossip Hello - Set Data on Rune Plate'),
+(26445, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 84, 0, 0, 0, 0, 0, 0, 21, 10, 0, 0, 0, 0, 0, 0, 'Rune Plate - On Data Set - Simple Talk Group 0'),
+(26445, 0, 1, 0, 38, 0, 100, 0, 2, 2, 0, 0, 84, 1, 0, 0, 0, 0, 0, 21, 10, 0, 0, 0, 0, 0, 0, 'Rune Plate - On Data Set - Simple Talk Group 1'),
+(26445, 0, 2, 0, 38, 0, 100, 0, 3, 3, 0, 0, 84, 2, 0, 0, 0, 0, 0, 21, 10, 0, 0, 0, 0, 0, 0, 'Rune Plate - On Data Set - Simple Talk Group 2'),
+(-109925, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109925, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109919, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109919, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109926, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109926, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109911, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109911, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109912, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109912, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109910, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109910, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109908, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109908, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109920, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109920, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109913, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109913, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109921, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109921, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109923, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109923, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109909, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109909, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\''),
+(-109922, 0, 0, 0, 1, 0, 100, 0, 2000, 5000, 5000, 8000, 11, 46815, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Boulder\''),
+(-109922, 0, 1, 0, 1, 0, 100, 0, 8000, 20000, 10000, 28000, 11, 46820, 0, 0, 0, 0, 0, 19, 26264, 85, 0, 0, 0, 0, 0, 'Grizzly Hills Giant - Out of Combat - Cast \'Toss Tree\'');
+
+DELETE FROM `creature_text` WHERE `entry` in(26445);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES
+(26445, 0, 0, 'Shall return to the cradle of iron and stone.', 12, 0, 100, 0, 0, 0, 25686, 'Rune Plate'),
+(26445, 1, 0, 'Return to Ulduar, nestled in the embrace of the storm.', 12, 0, 100, 0, 0, 0, 25688, 'Rune Plate'),
+(26445, 2, 0, 'Greatest of the Maker''s children, arise and claim your birthright.', 12, 0, 100, 0, 0, 0, 25690, 'Rune Plate');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_00_world.sql
new file mode 100644
index 00000000000..dc8f4375da0
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_00_world.sql
@@ -0,0 +1,14 @@
+DELETE FROM `creature_addon` WHERE `guid` IN(106613,106612,106611,106879,106509);
+INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(106613, 0, 0, 0, 4097, 0, '29266'),
+(106612, 0, 0, 0, 4097, 0, '29266'),
+(106611, 0, 0, 0, 4097, 0, '29266'),
+(106879, 0, 0, 0, 4097, 0, '29266'),
+(106509, 0, 0, 0, 4097, 0, '29266');
+
+
+UPDATE `creature` SET `unit_flags`=570721024 WHERE `guid` IN(106613,106612,106611,106879,106509);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=23666;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(22, 4, 23666, 0, 0, 1, 1, 29266, 0, 0, 1, 0, 0, '', 'Winterskorn Berserker only run SAI if Winterskorn Berserker does not have aura Permanent Feign Death');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_01_world.sql
new file mode 100644
index 00000000000..4bcca1d6250
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_01_world.sql
@@ -0,0 +1,17 @@
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(9297,9521,9526,9527) AND `source_type`=0 AND `id`=1;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(9297, 0, 1, 0, 0, 0, 100, 0, 15000, 15000, 12000, 15000, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Enraged Wyvern - OOC - Despawn'),
+(9521, 0, 1, 0, 0, 0, 100, 0, 15000, 15000, 12000, 15000, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Enraged Felbat - OOC - Despawn'),
+(9526, 0, 1, 0, 0, 0, 100, 0, 15000, 15000, 15000, 15000, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Enraged Gryphon - OOC - Despawn'),
+(9527, 0, 1, 0, 0, 0, 100, 0, 15000, 15000, 12000, 15000, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Enraged Hippogryph - OOC - Despawn');
+
+-- Demon Portal Guardian SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=11937;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=11937 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(11937, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 30, 0, 0, 0, 0, 0, 0, 'Demon Portal Guardian - On Just Summoned - Attack'),
+(11937, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Demon Portal Guardian - On Agro - Attack'),
+(11937, 0, 2, 0, 1, 0, 100, 1, 30000, 30000, 30000, 30000, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Demon Portal Guardian - Out of Combat - Despawn');
+
+-- set correct broadcast_text ID for Vim'gol the Vile's aggro text in creature_text
+UPDATE `creature_text` SET `BroadcastTextId`= 20773 WHERE `BroadcastTextId`= 20733 AND `entry`= 22911;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_02_world.sql
new file mode 100644
index 00000000000..89b8032be10
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_02_02_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=63277;
+INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
+(63277,65269,2,'General Vezax - Shadow Crash - Haste and reduced mana cost');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_00_world.sql
new file mode 100644
index 00000000000..8344df664f2
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_00_world.sql
@@ -0,0 +1,2 @@
+-- Remove duplicate spawn of "Big Roy" (24785)
+DELETE FROM `creature` WHERE `guid`=203496 AND `id`=24785;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_01_world.sql
new file mode 100644
index 00000000000..a150fe2d69e
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_01_world.sql
@@ -0,0 +1,36 @@
+DELETE FROM `smart_scripts` WHERE `entryorguid`=24713 AND `source_type`=0 AND `id`>1;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(24713, 0, 2, 3, 62, 0, 100, 0, 9335, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, '"Crowleg" Dan - On Gossip Option Select - Close Gossip'),
+(24713, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, '"Crowleg" Dan - On Gossip Option Select - Start Attack');
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=9335;
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES
+(9335, 0, 0, 'Ummm... the frog says you''re a traitor, "matey."', 25738, 1, 1, 0, 0, 0, 0, NULL, 0);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9335;
+
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(15, 9335, 0, 0, 0, 9, 0, 11479, 0, 0, 0, 0, 0, '', 'Crowleg" Dan - Only show Gossip if player is on quest');
+
+UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI', scriptname='' WHERE `entry` =186944;
+DELETE FROM `smart_scripts` WHERE `entryorguid` =186944 AND `source_type`=1;
+
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(186944, 1, 0, 1, 70, 0, 100, 0, 2, 0, 0, 0, 105, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dirt Mound - On State Changed - Add Go Flag '),
+(186944, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 12, 24790, 1, 120000, 1, 0, 0, 8, 0, 0, 0, 688.9122, -3377.737, 67.87585, 1.291544, 'Dirt Mound - On State Changed - Summon Black Conrads Ghost'),
+(186944, 1, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 12, 24796, 1, 120000, 1, 0, 0, 8, 0, 0, 0, 691.5706, -3375.863, 68.09953, 1.308997, 'Dirt Mound - On State Changed - Summon Spectral Sailor'),
+(186944, 1, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 12, 24796, 1, 120000, 1, 0, 0, 8, 0, 0, 0, 687.27, -3374.881, 67.92136, 1.047198, 'Dirt Mound - On State Changed - Summon Spectral Sailor');
+
+DELETE FROM `creature` WHERE `guid`=116177;
+UPDATE `gameobject` SET `spawntimesecs`=120 WHERE `guid`=5842;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=23777 AND `source_type`=0 AND `id`IN(6,7);
+
+UPDATE `smart_scripts` SET `link`=6 WHERE `entryorguid`=23777 AND `source_type`=0 AND `id`=1 AND `link`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(23777, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Proto-Drake Egg - On Reset - Set Passive'),
+(23777, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 94, 24, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Proto-Drake Egg - On Reset - Set Dynamic Flags');
+
+
+UPDATE `creature_template` SET `unit_flags`=0 WHERE `entry`=23777;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_02_world.sql
new file mode 100644
index 00000000000..1a408d3ec6a
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_03_02_world.sql
@@ -0,0 +1,2 @@
+-- Fix respawn time for quest loot GO "Daggerfen Poison Manual"
+UPDATE `gameobject` SET `spawntimesecs`=2 WHERE `guid`=22662;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_04_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_04_00_world.sql
new file mode 100644
index 00000000000..69da8a7d699
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_04_00_world.sql
@@ -0,0 +1,149 @@
+UPDATE `quest_template_addon` SET `RequiredMinRepValue`=9000 WHERE `ID`=9729;
+
+DELETE FROM `creature_text` WHERE `entry`=17877;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(17877, 0, 0, 'Fhwoor go now, $n. Get ark, come back.', 12, 0, 100, 0, 0, 0, 16439, 0, 'Fhwoor'),
+(17877, 1, 0, 'Take moment... get ready.', 12, 0, 100, 0, 0, 0, 16440, 0, 'Fhwoor'),
+(17877, 2, 0, 'We go!', 12, 0, 100, 0, 0, 0, 16441, 0, 'Fhwoor'),
+(17877, 3, 0, '%s lifts the Ark of Ssslith with ease.', 16, 0, 100, 0, 0, 0, 16442, 0, 'Fhwoor'),
+(17877, 4, 0, 'Uh oh...', 12, 0, 100, 0, 0, 0, 16443, 0, 'Fhwoor'),
+(17877, 5, 0, 'Ha ha, squishy naga!', 12, 0, 100, 0, 0, 0, 16444, 0, 'Fhwoor'),
+(17877, 6, 0, '%s places the Ark of Ssslith on the ground.', 16, 0, 100, 0, 0, 0, 16445, 0, 'Fhwoor'),
+(17877, 7, 0, 'Fhwoor do good!', 16, 0, 100, 0, 0, 0, 16446, 0, 'Fhwoor');
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`IN(18154,17877);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(17877,18154) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(1787700,1787701) AND `source_type`=9;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=18089 AND `source_type`=0 AND `id`>0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=18088 AND `source_type`=0 AND `id`>1;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(18154, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 53, 0, 18154, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Ssslith - On Just Summoned - Start WP'),
+(18088, 0, 2, 0, 54, 0, 100, 0, 0, 0, 0, 0, 53, 0, 18088, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodscale Enchantress - On Just Summoned - Start WP'),
+(18089, 0, 1, 0, 54, 0, 100, 0, 0, 0, 0, 0, 53, 0, 18089, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Bloodscale Slavedriver - On Just Summoned - Start WP'),
+(18154, 0, 1, 0, 40, 0, 100, 0, 12, 18154, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 17877, 0, 0, 0, 0, 0, 0, 'Ssslith - On Reached WP12 - Face Fhwoor'),
+(18088, 0, 3, 0, 40, 0, 100, 0, 6, 18088, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 17877, 0, 0, 0, 0, 0, 0, 'Bloodscale Enchantress - On Reached WP12 - Face Fhwoor'),
+(18089, 0, 2, 0, 40, 0, 100, 0, 8, 18089, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 17877, 0, 0, 0, 0, 0, 0, 'Bloodscale Slavedriver - On Reached WP12 - Face Fhwoor'),
+(17877, 0, 0, 1, 19, 0, 100, 0, 9729, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Quest Accept (Fhwoor Smash) - Store Targetlist'),
+(17877, 0, 1, 18, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Quest Accept (Fhwoor Smash) - Say Line 0'),
+(17877, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 6, 9729, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Death - Fail Quest Fhwoor Smash'),
+(17877, 0, 3, 4, 40, 0, 100, 0, 11, 17877, 0, 0, 1, 1, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP11 - Say Line 1'),
+(17877, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 54, 20000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP11 - Pause WP (20 seconds)'),
+(17877, 0, 5, 0, 40, 0, 100, 0, 12, 17877, 0, 0, 1, 2, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP12 - Say Line 2'),
+(17877, 0, 6, 7, 40, 0, 100, 0, 27, 17877, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP27 - Say Line 3'),
+(17877, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 54, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP27 - Pause WP (5 seconds)'),
+(17877, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 120, 0, 0, 0, 0, 0, 20, 182082, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP27 - Despawn The Ark of Ssslith'),
+(17877, 0, 9, 10, 40, 0, 100, 0, 43, 17877, 0, 0, 1, 4, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP43 - Say Line 4'),
+(17877, 0, 10, 11, 61, 0, 100, 0, 0, 0, 0, 0, 54, 20000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP43 - Pause WP (20 seconds)'),
+(17877, 0, 11, 12, 61, 0, 100, 0, 0, 0, 0, 0, 12, 18154, 1, 300000, 0, 0, 0, 8, 0, 0, 0, 168.5472, 8207.521, 22.9772, 4.467648, 'Fhwoor - On Reached WP43 - Summon Ssslith'),
+(17877, 0, 12, 13, 61, 0, 100, 0, 0, 0, 0, 0, 12, 18088, 1, 300000, 0, 0, 0, 8, 0, 0, 0, 172.8663, 8214.886, 22.31137, 4.198237, 'Fhwoor - On Reached WP43 - Summon Bloodscale Enchantress'),
+(17877, 0, 13, 0, 61, 0, 100, 0, 0, 0, 0, 0, 12, 18089, 1, 300000, 0, 0, 0, 8, 0, 0, 0, 166.7656, 8215.018, 22.63307, 4.604752, 'Fhwoor - On Reached WP43 - Summon Bloodscale Slavedriver'),
+(17877, 0, 14, 0, 11, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Spawn Set Active'),
+(17877, 0, 15, 0, 40, 0, 100, 0, 44, 17877, 0, 0, 1, 5, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP44 - Say Line 5'),
+(17877, 0, 16, 0, 40, 0, 100, 0, 45, 17877, 0, 0, 59, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP45 - Set Run On'),
+(17877, 0, 17, 0, 40, 0, 100, 0, 60, 17877, 0, 0, 80, 1787701, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP60 - Run Script 2'),
+(17877, 0, 18, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 1787700, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Quest Accept - Run Script 1'),
+(17877, 0, 19, 20, 40, 0, 100, 0, 61, 17877, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 2.042035, 'Fhwoor - On Reached WP61 - Set Orientation'),
+(17877, 0, 20, 21, 61, 0, 100, 0, 0, 0, 0, 0, 81, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP61 - Set Npc Flags'),
+(17877, 0, 21, 22, 61, 0, 100, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP61 - Turn Run Off'),
+(17877, 0, 22, 23, 61, 0, 100, 0, 0, 0, 0, 0, 1, 7, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP61 - Say Line 7'),
+(17877, 0, 23, 24, 61, 0, 100, 0, 0, 0, 0, 0, 2, 1709, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP61 - Set Faction'),
+(17877, 0, 24, 0, 61, 0, 100, 0, 0, 0, 0, 0, 15, 9729, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Reached WP61 - Complete Quest'),
+(17877, 0, 25, 0, 9, 0, 100, 0, 0, 10, 20000, 30000, 11, 31277, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - On Range - Cast Stomp'),
+(1787700, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - Script - Set NPC Flags'),
+(1787700, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 250, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - Script - Set Faction'),
+(1787700, 9, 2, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 53, 0, 17877, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - Script - Start WP'),
+(1787701, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 54, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - Script 2 - Pause WP (5 Seconds)'),
+(1787701, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Fhwoor - Script 2 - Say Line 6'),
+(1787701, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 50, 182082, 180, 0, 0, 0, 0, 8, 0, 0, 0, 249.717, 8482.185, 22.96521, 3.159062, 'Fhwoor - Script 2 - Summon The Ark of Ssslith');
+
+DELETE FROM `waypoints` WHERE `entry`IN(17877,18154,18088,18089);
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(17877, 1, 213.6417, 8469.281, 23.52778, 'Fhwoor'),
+(17877, 2, 194.8211, 8448.552, 24.48719, 'Fhwoor'),
+(17877, 3, 181.9171, 8416.949, 23.39253, 'Fhwoor'),
+(17877, 4, 162.9771, 8387.255, 22.28007, 'Fhwoor'),
+(17877, 5, 169.1168, 8353.966, 21.07829, 'Fhwoor'),
+(17877, 6, 179.16, 8325.873, 20.83087, 'Fhwoor'),
+(17877, 7, 170.3557, 8302.857, 21.0235, 'Fhwoor'),
+(17877, 8, 182.7192, 8270.847, 18.91084, 'Fhwoor'),
+(17877, 9, 220.4595, 8241.914, 20.72861, 'Fhwoor'),
+(17877, 10, 248.3627, 8210.217, 19.54621, 'Fhwoor'),
+(17877, 11, 283.827, 8203.188, 22.15056, 'Fhwoor'),
+(17877, 12, 299.8667, 8188.261, 21.42571, 'Fhwoor'),
+(17877, 13, 318.4961, 8184.514, 18.0551, 'Fhwoor'),
+(17877, 14, 333.9666, 8178.852, 17.66307, 'Fhwoor'),
+(17877, 15, 349.5377, 8179.188, 18.45091, 'Fhwoor'),
+(17877, 16, 366.4365, 8187.577, 21.90989, 'Fhwoor'),
+(17877, 17, 378.7538, 8190.383, 23.30309, 'Fhwoor'),
+(17877, 18, 396.7187, 8184.856, 19.38158, 'Fhwoor'),
+(17877, 19, 416.5232, 8164.166, 18.35449, 'Fhwoor'),
+(17877, 20, 436.7097, 8153.245, 21.59639, 'Fhwoor'),
+(17877, 21, 451.9413, 8151.88, 23.76729, 'Fhwoor'),
+(17877, 22, 467.4153, 8152.104, 22.10491, 'Fhwoor'),
+(17877, 23, 485.0933, 8148.362, 20.20708, 'Fhwoor'),
+(17877, 24, 500.4597, 8146.723, 20.18372, 'Fhwoor'),
+(17877, 25, 517.5106, 8156.078, 22.14917, 'Fhwoor'),
+(17877, 26, 536.4334, 8157.974, 23.6155, 'Fhwoor'),
+(17877, 27, 558.9749, 8159.831, 23.83816, 'Fhwoor'),
+(17877, 28, 522.1965, 8135.454, 21.15369, 'Fhwoor'),
+(17877, 29, 498.0764, 8136.04, 20.90411, 'Fhwoor'),
+(17877, 30, 477.8418, 8127.26, 22.5633, 'Fhwoor'),
+(17877, 31, 450.433, 8131.167, 21.50137, 'Fhwoor'),
+(17877, 32, 431.7549, 8121.7, 18.242, 'Fhwoor'),
+(17877, 33, 416.2102, 8120.498, 17.59649, 'Fhwoor'),
+(17877, 34, 394.6256, 8120.143, 17.94713, 'Fhwoor'),
+(17877, 35, 379.7412, 8113.295, 17.7740, 'Fhwoor'),
+(17877, 36, 364.4443, 8105.485, 18.17426, 'Fhwoor'),
+(17877, 37, 350.215, 8106.762, 17.74799, 'Fhwoor'),
+(17877, 38, 335.0946, 8119.199, 17.49909, 'Fhwoor'),
+(17877, 39, 328.1111, 8135.518, 18.31635, 'Fhwoor'),
+(17877, 40, 305.7509, 8149.812, 20.04914, 'Fhwoor'),
+(17877, 41, 275.4078, 8161.027, 17.7491, 'Fhwoor'),
+(17877, 42, 247.4046, 8177.393, 17.72273, 'Fhwoor'),
+(17877, 43, 220.5886, 8180.784, 19.78761, 'Fhwoor'),
+(17877, 44, 205.7915, 8183.323, 23.08216, 'Fhwoor'),
+(17877, 45, 203.9108, 8206.521, 22.37668, 'Fhwoor'),
+(17877, 46, 200.2505, 8229.313, 24.96921, 'Fhwoor'),
+(17877, 47, 201.1895, 8251.09, 21.10947, 'Fhwoor'),
+(17877, 48, 190.4957, 8267.601, 18.47761, 'Fhwoor'),
+(17877, 49, 175.0741, 8288.405, 18.58564, 'Fhwoor'),
+(17877, 50, 182.4148, 8311.77, 21.29364, 'Fhwoor'),
+(17877, 51, 182.5205, 8333.074, 19.87689, 'Fhwoor'),
+(17877, 52, 175.5308, 8357.185, 18.46842, 'Fhwoor'),
+(17877, 53, 183.5543, 8381.03, 16.24468, 'Fhwoor'),
+(17877, 54, 195.2988, 8399.357, 16.50945, 'Fhwoor'),
+(17877, 55, 208.5941, 8413.654, 18.89419, 'Fhwoor'),
+(17877, 56, 221.3398, 8432.104, 20.17568, 'Fhwoor'),
+(17877, 57, 230.968, 8446.415, 21.99157, 'Fhwoor'),
+(17877, 58, 227.1291, 8465.446, 19.64525, 'Fhwoor'),
+(17877, 59, 231.5279, 8479.356, 17.87813, 'Fhwoor'),
+(17877, 60, 246.9482, 8481.803, 22.1418, 'Fhwoor'),
+(17877, 61, 231.4028, 8479.942, 18.03377, 'Fhwoor'),
+(18154, 1, 169.4304, 8210.07, 22.51478, 'Ssslith'),
+(18154, 2, 169.5868, 8209.083, 22.51478, 'Ssslith'),
+(18154, 3, 168.75, 8208.333, 22.80278, 'Ssslith'),
+(18154, 4, 168.0234, 8205.424, 23.42778, 'Ssslith'),
+(18154, 5, 167.709, 8204.166, 23.80278, 'Ssslith'),
+(18154, 6, 167.709, 8202.083, 23.80278, 'Ssslith'),
+(18154, 7, 167.709, 8200, 23.60022, 'Ssslith'),
+(18154, 8, 170.3105, 8196.961, 22.97522, 'Ssslith'),
+(18154, 9, 170.834, 8196.354, 22.85022, 'Ssslith'),
+(18154, 10, 171.2306, 8194.351, 22.48486, 'Ssslith'),
+(18154, 11, 182.8383, 8183.431, 23.90405, 'Ssslith'),
+(18154, 12, 188.6353, 8182.512, 23.86377, 'Ssslith'),
+(18088, 1, 172.8497, 8215.886, 22.30278, 'Bloodscale Enchantress'),
+(18088, 2, 172.8672, 8214.886, 22.30278, 'Bloodscale Enchantress'),
+(18088, 3, 172.0461, 8213.434, 22.35161, 'Bloodscale Enchantress'),
+(18088, 4, 176.9391, 8193.834, 23.09314, 'Bloodscale Enchantress'),
+(18088, 5, 181.4677, 8187.228, 23.00415, 'Bloodscale Enchantress'),
+(18088, 6, 185.6965, 8186.558, 23.32629, 'Bloodscale Enchantress'),
+(18089, 1, 166.6959, 8216.016, 22.55278, 'Bloodscale Slavedriver'),
+(18089, 2, 166.7656, 8215.018, 22.55278, 'Bloodscale Slavedriver'),
+(18089, 3, 165.9063, 8207.064, 23.10177, 'Bloodscale Slavedriver'),
+(18089, 4, 165.6914, 8205.076, 23.72677, 'Bloodscale Slavedriver'),
+(18089, 5, 164.922, 8197.819, 23.50668, 'Bloodscale Slavedriver'),
+(18089, 6, 172.0933, 8188.685, 22.47522, 'Bloodscale Slavedriver'),
+(18089, 7, 180.3612, 8180.244, 24.05603, 'Bloodscale Slavedriver'),
+(18089, 8, 184.59, 8179.574, 24.47522, 'Bloodscale Slavedriver');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_05_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_05_00_world.sql
new file mode 100644
index 00000000000..f59e70ddb34
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_05_00_world.sql
@@ -0,0 +1,2 @@
+UPDATE `quest_template_addon` SET `RequiredMinRepValue`=42000 WHERE `ID`=9729;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=11937 AND `source_type`=0 AND `id`=1 AND `link`=0;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_05_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_05_01_world.sql
new file mode 100644
index 00000000000..eb2609af74d
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_05_01_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=47320;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_08_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_08_00_world.sql
new file mode 100644
index 00000000000..930e599396f
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_08_00_world.sql
@@ -0,0 +1,133 @@
+SET @CGUID := 78642;
+
+DELETE FROM `creature` WHERE `id` IN(17417,17418,17404,17405);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(@CGUID+0, 17417, 530, 1, 1, 214.6568, 4122.551, 79.8511, 2.251475, 120, 0, 0), -- 17417 (Area: 0) (possible waypoints or random movement)
+(@CGUID+1, 17417, 530, 1, 1, 216.0346, 4125.61, 80.22345, 2.251475, 120, 0, 0), -- 17417 (Area: 0) (possible waypoints or random movement)
+(@CGUID+2, 17404, 530, 1, 1, 211.6765, 4126.361, 79.04578, 2.391101, 120, 0, 0), -- 17404 (Area: 0) (possible waypoints or random movement)
+(@CGUID+3, 17418, 530, 1, 1, 261.5179, 4106.813, 93.315, 2.663978, 120, 0, 0), -- 17418 (Area: 0)
+(@CGUID+4, 17418, 530, 1, 1, 260.6302, 4103.529, 93.33371, 2.60972, 120, 0, 0), -- 17418 (Area: 0)
+(@CGUID+5, 17405, 530, 1, 1, 230.5075, 4118.714, 83.56195, 2.949606, 120, 0, 0); -- 17405 (Area: 0) (possible waypoints or random movement)
+
+UPDATE `creature` SET `equipment_id`=1 WHERE `id` IN(17417,17418,17404,17405);
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`IN(17413,17417,17404,17418,17405);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(17413,17417,17404,17418,17405) AND `source_type`=0;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(1740400,1740500) AND `source_type`=9;
+
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(-@CGUID-0,-@CGUID-1,-@CGUID-2,-@CGUID-3,-@CGUID-4,-@CGUID-5) AND `source_type`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(-@CGUID-0, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 18, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (1) - On Respawn - Set Immune'),
+(-@CGUID-0, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (1) - On Respawn - Set Invisible'),
+(-@CGUID-0, 0, 1, 2, 38, 0, 100, 1, 1, 1, 0, 0, 19, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (1) - On Data Set - Set Immune'),
+(-@CGUID-0, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (1) - On Data Set - Set visible'),
+(-@CGUID-0, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 1741700, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (1) - On Respawn - Start WP'),
+(-@CGUID-0, 0, 4, 5, 40, 0, 100, 0, 2, 1741700, 0, 0, 54, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (1) - On Reached WP3 - Pause WP'),
+(-@CGUID-0, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 11, 30460, 2, 0, 0, 0, 0, 19, 17404, 0, 0, 0, 0, 0, 0, 'Mag har Escort (1) - On Reached WP3 - Cast Kick'),
+(-@CGUID-0, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, 17404, 0, 0, 0, 0, 0, 0, 'Mag har Escort (1) - On Reached WP3 - Set Data on Sedei'),
+(-@CGUID-0, 0, 7, 8, 40, 0, 100, 0, 5, 1741700, 0, 0, 45, 3, 3, 0, 0, 0, 0, 10, @CGUID+3, 17418, 0, 0, 0, 0, 0, 'Mag har Escort (1) - On Reached WP6 - Start Attack'),
+(-@CGUID-0, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 10, @CGUID+3, 17418, 0, 0, 0, 0, 0, 'Mag har Escort (2) - On Reached WP12 - Start Attack'),
+(-@CGUID-0, 0, 9, 0, 0, 0, 100, 1, 3000, 3000, 0, 0, 45, 4, 4, 0, 0, 0, 0, 10, @CGUID+3, 17418, 0, 0, 0, 0, 0, 'Mag har Escort (2) - IC - Set Data'),
+
+(-@CGUID-1, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 18, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (2) - On Respawn - Set Immune'),
+(-@CGUID-1, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (2) - On Respawn - Set Invisible'),
+(-@CGUID-1, 0, 1, 2, 38, 0, 100, 1, 1, 1, 0, 0, 19, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (2) - On Data Set - Set Immune'),
+(-@CGUID-1, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (2) - On Data Set - Set visible'),
+(-@CGUID-1, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 1741701, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (2) - On Respawn - Start WP'),
+(-@CGUID-1, 0, 4, 5, 40, 0, 100, 0, 3, 1741701, 0, 0, 54, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (2) - On Reached WP9 - Pause WP'),
+(-@CGUID-1, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mag har Escort (2) - On Reached WP9 - Say'),
+(-@CGUID-1, 0, 6, 7, 40, 0, 100, 0, 10, 1741701, 0, 0, 45, 3, 3, 0, 0, 0, 0, 10, @CGUID+4, 17418, 0, 0, 0, 0, 0, 'Mag har Escort (2) - On Reached WP12 - Start Attack'),
+(-@CGUID-1, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 10, @CGUID+4, 17418, 0, 0, 0, 0, 0, 'Mag har Escort (2) - On Reached WP12 - Start Attack'),
+(-@CGUID-1, 0, 8, 0, 0, 0, 100, 1, 3000, 3000, 0, 0, 45, 4, 4, 0, 0, 0, 0, 10, @CGUID+4, 17418, 0, 0, 0, 0, 0, 'Mag har Escort (2) - IC - Set Data'),
+
+(-@CGUID-2, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 18, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - On Respawn - Set Immune'),
+(-@CGUID-2, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - On Respawn - Set Invisible'),
+(-@CGUID-2, 0, 1, 2, 38, 0, 100, 1, 1, 1, 0, 0, 19, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - On Data Set - Set Immune'),
+(-@CGUID-2, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - On Data Set - Set visible'),
+(-@CGUID-2, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 17404, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - On Respawn - Start WP'),
+(-@CGUID-2, 0, 4, 0, 38, 0, 100, 0, 2, 2, 0, 0, 80, 1740400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - On Data Set - Run Script'),
+(-@CGUID-2, 0, 5, 0, 40, 0, 100, 0, 3, 17404, 0, 0, 54, 21000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - On Reached WP3 - Pause WP'),
+(-@CGUID-2, 0, 6, 0, 40, 0, 100, 0, 5, 17404, 0, 0, 54, 18000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - On Reached WP5 - Pause WP'),
+
+(-@CGUID-3, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 18, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Laughing Skull Ambusher (1) - On Respawn - Set Immune'),
+(-@CGUID-3, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Laughing Skull Ambusher (1) - On Respawn - Set Invisible'),
+(-@CGUID-3, 0, 2, 3, 38, 0, 100, 1, 1, 1, 0, 0, 19, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Laughing Skull Ambusher (1) - On Data Set - Set Immune'),
+(-@CGUID-3, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Laughing Skull Ambusher (1) - On Data Set - Set visible'),
+(-@CGUID-3, 0, 5, 0, 38, 0, 100, 0, 3, 3, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 17417, 0, 0, 0, 0, 0, 0, 'Laughing Skull Ambusher (1) - On Data Set - Start Attack'),
+
+(-@CGUID-4, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 18, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Laughing Skull Ambusher (2) - On Respawn - Set Immune'),
+(-@CGUID-4, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Laughing Skull Ambusher (2) - On Respawn - Set Invisible'),
+(-@CGUID-4, 0, 2, 3, 38, 0, 100, 1, 1, 1, 0, 0, 19, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Laughing Skull Ambusher (2) - On Data Set - Set Immune'),
+(-@CGUID-4, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Laughing Skull Ambusher (2) - On Data Set - Set visible'),
+(-@CGUID-4, 0, 5, 0, 38, 0, 100, 0, 3, 3, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 17417, 0, 0, 0, 0, 0, 0, 'Laughing Skull Ambusher (2) - On Data Set - Start Attack'),
+
+(-@CGUID-5, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 18, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Krun Spinebreaker - On Respawn - Set Immune'),
+(-@CGUID-5, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Krun Spinebreaker - On Respawn - Set Invisible'),
+(-@CGUID-5, 0, 1, 2, 38, 0, 100, 1, 1, 1, 0, 0, 19, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Krun Spinebreaker - On Data Set - Set Immune'),
+(-@CGUID-5, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Krun Spinebreaker - On Data Set - Set visible'),
+(-@CGUID-5, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 1, 17405, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Krun Spinebreaker - On Respawn - Start WP'),
+(-@CGUID-5, 0, 4, 0, 40, 0, 100, 0, 3, 17405, 0, 0, 80, 1740500, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Krun Spinebreaker - On Reached WP3 - Run Script'),
+
+(1740400, 9, 0, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @CGUID+3, 17418, 0, 0, 0, 0, 0, 'Vindicator Sedai - Script - Set Data'),
+(1740400, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @CGUID+4, 17418, 0, 0, 0, 0, 0, 'Vindicator Sedai - Script - Say'),
+(1740400, 9, 2, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - Script - Say'),
+(1740400, 9, 3, 0, 0, 0, 100, 0, 15000, 15000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - Script - Say'),
+(1740400, 9, 4, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - Script - Say'),
+(1740400, 9, 5, 0, 0, 0, 100, 0, 18000, 18000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Sedai - Script - Say'),
+(1740400, 9, 6, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @CGUID+5, 17405, 0, 0, 0, 0, 0, 'Vindicator Sedai - Script - Say'),
+
+(1740500, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 30462, 2, 0, 0, 0, 0, 19, 17404, 0, 0, 0, 0, 0, 0, 'Krun Spinebreaker - Script - Cast Execute Sedei'),
+(1740500, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Krun Spinebreaker - Script - Say'),
+(1740500, 9, 2, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 10, @CGUID+0, 17417, 0, 0, 0, 0, 0, 'Krun Spinebreaker - Script - Despawn Mag har Escort'),
+(1740500, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 10, @CGUID+1, 17417, 0, 0, 0, 0, 0, 'Krun Spinebreaker - Script - Despawn Mag har Escort'),
+(1740500, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 10, @CGUID+2, 17404, 0, 0, 0, 0, 0, 'Krun Spinebreaker - Script - Despawn Vindicator Sedai'),
+(1740500, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 10, @CGUID+3, 17418, 0, 0, 0, 0, 0, 'Krun Spinebreaker - Script - Despawn Laughing Skull Ambusher'),
+(1740500, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 10, @CGUID+4, 17418, 0, 0, 0, 0, 0, 'Krun Spinebreaker - Script - Despawn'),
+(1740500, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Krun Spinebreaker - Script - Despawn'),
+
+(17413, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @CGUID+0, 17417, 0, 0, 0, 0, 0, 'Sedai Quest Credit Marker - On Just Summoned - Set Data on Mag har Escort'),
+(17413, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @CGUID+1, 17417, 0, 0, 0, 0, 0, 'Sedai Quest Credit Marker - On Just Summoned - Set Data on Mag har Escort'),
+(17413, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @CGUID+2, 17404, 0, 0, 0, 0, 0, 'Sedai Quest Credit Marker - On Just Summoned - Set Data on Vindicator Sedei');
+
+
+DELETE FROM `waypoints` WHERE `entry`IN(17404,17405,1741700,1741701,1741800,1741801);
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(1741700, 1, 206.7916, 4132.612, 77.49819, 'Mag har Escort (1)'),
+(1741700, 2, 199.061, 4142.329, 75.17587, 'Mag har Escort (1)'), -- Kick
+(1741700, 3, 203.75, 4134.571, 76.52649, 'Mag har Escort (1)'),
+(1741700, 4, 211.582, 4128.351, 79.12319, 'Mag har Escort (1)'),
+(1741700, 5, 219.5054, 4125.231, 80.99819, 'Mag har Escort (1)'),
+(1741701, 1, 206.2685, 4128.42, 77.62319, 'Mag har Escort (2)'),
+(1741701, 2, 200.5664, 4136.248, 75.65149, 'Mag har Escort (2)'),
+(1741701, 3, 196.179, 4141.198, 74.30087, 'Mag har Escort (2)'), -- say
+(1741701, 4, 203.9766, 4138.813, 76.40149, 'Mag har Escort (2)'),
+(1741701, 5, 206.5171, 4135.979, 77.40149, 'Mag har Escort (2)'),
+(1741701, 6, 209.2334, 4134.047, 78.15149, 'Mag har Escort (2)'),
+(1741701, 7, 209.2334, 4134.047, 78.15149, 'Mag har Escort (2)'),
+(1741701, 8, 211.4904, 4132.254, 79.12319, 'Mag har Escort (2)'),
+(1741701, 9, 214.5568, 4129.819, 79.74819, 'Mag har Escort (2)'),
+(1741701, 10, 219.3728, 4128.506, 81.12319, 'Mag har Escort (2)'),
+(17404, 1, 204.9158, 4134.23, 76.90149, 'Vindicator Sedai'),
+(17404, 2, 200.7516, 4138.94, 75.52649, 'Vindicator Sedai'),
+(17404, 3, 196.6698, 4143.903, 74.30087, 'Vindicator Sedai'), -- Event
+(17404, 4, 201.4514, 4139.023, 75.90149, 'Vindicator Sedai'),
+(17404, 5, 202.2026, 4138.024, 76.15149, 'Vindicator Sedai'),
+(17404, 6, 198.0219, 4143.623, 74.92587, 'Vindicator Sedai'),
+(17404, 7, 192.3438, 4150.61, 73.67587, 'Vindicator Sedai'),
+(17405, 1, 213.5774, 4129.949, 79.74819, 'Krun Spinebreaker'),
+(17405, 2, 203.9323, 4137.877, 76.40149, 'Krun Spinebreaker'),
+(17405, 3, 193.1504, 4149.705, 73.80087, 'Krun Spinebreaker'); -- Assasinate
+
+
+DELETE FROM `creature_text` WHERE `entry`IN(17417,17404,17405);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(17417, 0, 0, 'Do not return, draenei scum. Next time we won''t spare your life, unarmed or not!', 12, 0, 100, 0, 0, 0, 13986, 0, 'Mag har Escort'), -- 21:04:49.000
+(17404, 0, 0, 'I''ve failed... peace is impossible.', 12, 0, 100, 0, 0, 0, 13982, 0, 'Vindicator Sedai'), -- 21:04:58.000
+(17404, 1, 0, 'What in the Light''s name...?', 12, 0, 100, 0, 0, 0, 13983, 0, 'Vindicator Sedai'), -- 21:05:13.000
+(17404, 2, 0, 'Fel orcs!', 12, 0, 100, 0, 0, 0, 13984, 0, 'Vindicator Sedai'), -- 21:05:18.000
+(17404, 3, 0, 'The cycle of bloodshed is unending... Is there nothing I can do?', 12, 0, 100, 0, 0, 0, 13985, 0, 'Vindicator Sedai'), -- 21:05:36.000
+(17405, 0, 0, 'You can die!', 12, 0, 100, 0, 0, 0, 13988, 0, 'Krun Spinebreaer'); -- 21:05:48.000
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_00_world_2016_03_28_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_00_world_2016_03_28_00_world.sql
new file mode 100644
index 00000000000..0fc505965a3
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_00_world_2016_03_28_00_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `trinity_string` WHERE `entry`=1030;
+INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES
+(1030,'Account name cannot contain ''@'' character.');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_01_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_01_world.sql
new file mode 100644
index 00000000000..0c01492d746
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_01_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `creature_addon` WHERE `guid`=203496;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_02_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_02_world.sql
new file mode 100644
index 00000000000..60ae64d1715
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_02_world.sql
@@ -0,0 +1,44 @@
+--
+/* Spell Bonus Data */
+-- Enchants
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (6297,13897,13907,20004,20006,20007,28005,44525,44578,46579,64442,64569);
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+( 6297, 0, 0, -1, -1, 'Fiery Blaze'),
+(13897, 0, 0, -1, -1, 'Fiery Weapon - Fiery Weapon'),
+(13907, 0, 0, -1, -1, 'Demonslaying - Smite Demon'),
+(20004, 0, 0, -1, -1, 'Lifestealing - Life Steal'),
+(20006, 0, 0, -1, -1, 'Unholy Weapon - Unholy Curse'),
+(20007, 0, 0, -1, -1, 'Crusader - Holy Strength'),
+(28005, 0, 0, -1, -1, 'Battlemaster - Battlemaster'),
+(44525, 0, 0, -1, -1, 'Icebreaker - Icebreaker'),
+(44578, 0, 0, -1, -1, 'Lifeward - Lifeward'),
+(46579, 0, 0, -1, -1, 'Deathfrost - Deathfrost'),
+(64442, 0, 0, -1, -1, 'Blade Warding - Blade Warding'),
+(64569, 0, 0, -1, -1, 'Blood Draining - Blood Reserve');
+
+-- Items
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (7712,7714,10577,16614,17484,18798,21992,27655,28788,38395,40972,55756,60526,67714,67760);
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+( 7712, 0, 0, -1, -1, 'Blazefury Medallion & Fiery Retributer (Fire Strike)'),
+( 7714, 0, 0, -1, -1, 'Fiery Plate Gauntlets (Fire Strike)'),
+(10577, 0, 0, -1, -1, 'Gauntlets of the Sea (Heal)'),
+(16614, 0, 0, -1, -1, 'Storm Gauntlets (Lightning Strike)'),
+(17484, 0, 0, -1, -1, 'Skullforge Reaver - Skullforge Brand'),
+(18798, 0, 0, -1, -1, 'Freezing Band (Freeze)'),
+(21992, 0, 0, -1, -1, 'Thunderfury'),
+(27655, 0, 0, -1, -1, 'Heart of Wyrmthalak (Flame Lash)'),
+(28788, 0, 0, -1, -1, 'Paladin T3 (8)'),
+(38395, 0, 0, -1, -1, 'Warlock - Siphon Essence - T6 2P proc'),
+(40972, 0, 0, -1, -1, 'Crystal Spire of Karabor - heal effect'),
+(55756, 0, 0, -1, -1, 'Brunnhildar weapons (Chilling Blow)'),
+(60526, 0, 0, -1, -1, 'Living Ice Crystals - heal effect'),
+(67714, 0, 0, -1, -1, 'Pillar of Flame (Normal)'),
+(67760, 0, 0, -1, -1, 'Pillar of Flame (Heroic)');
+
+-- Consumables
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (28715,38616,43731,43733);
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+(28715, 0, 0, -1, -1, 'Consumable - Flamecap (Flamecap Fire)'),
+(38616, 0, 0, -1, -1, 'Poison - Bloodboil Poison'),
+(43731, 0, 0, -1, -1, 'Consumable - Stormchops (Lightning Zap)'),
+(43733, 0, 0, -1, -1, 'Consumable - Stormchops (Lightning Zap)');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_03_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_03_world.sql
new file mode 100644
index 00000000000..732e3d83ee5
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_03_world.sql
@@ -0,0 +1,5 @@
+--
+DELETE FROM `player_factionchange_reputations` WHERE `alliance_id`= 589;
+INSERT INTO `player_factionchange_reputations` (`alliance_id`, `horde_id`) VALUES
+(589, 1137);
+UPDATE `creature` SET `equipment_id`=0 WHERE `id` IN(17404);
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_04_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_04_world.sql
new file mode 100644
index 00000000000..01154d2070a
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_04_world.sql
@@ -0,0 +1,9 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (44550, 44610, 44609);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(17, 0, 44550, 0, 0, 29, 0, 24820, 5, 0, 0, 0, 0, '', 'Allow spell Collect Data only on Iron Dwarf Relic 24820'),
+(17, 0, 44610, 0, 0, 29, 0, 24824, 5, 0, 0, 0, 0, '', 'Allow spell Collect Data only on Iron Dwarf Relics'),
+(17, 0, 44609, 0, 0, 29, 0, 24271, 10, 0, 0, 0, 0, '', 'Allow spell Bluff only on Iron Dwarf'),
+(17, 0, 44609, 0, 1, 29, 0, 23673, 10, 0, 0, 0, 0, '', 'Allow spell Bluff only on Iron Dwarf'),
+(17, 0, 44609, 0, 2, 29, 0, 23672, 10, 0, 0, 0, 0, '', 'Allow spell Bluff only on Iron Dwarf'),
+(17, 0, 44609, 0, 3, 29, 0, 23675, 10, 0, 0, 0, 0, '', 'Allow spell Bluff only on Iron Dwarf');
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_05_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_05_world.sql
new file mode 100644
index 00000000000..815540ecef1
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_09_05_world.sql
@@ -0,0 +1,41 @@
+--
+SET @Oguid:=65714;
+
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+29;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0, 195256, 530, 1, 1, 1021.34, 7392.52, 36.3235, -2.79252, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+1, 195256, 530, 1, 1, 971.367, 7408.7, 29.5432, -1.25664, 0, 0, 0, 1, 180, 255, 1 ),
+(@OGUID+2, 195256, 530, 1, 1, 957.729, 7355.67, 29.1519, 0.436332, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+3, 195256, 530, 1, 1, 1006.33, 7322.55, 41.0474, -1.15192, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+4, 195256, 530, 1, 1, 1003.33, 7430, 28.0768, -0.925024, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+5, 195256, 530, 1, 1, 201.985, 8489.73, 24.4459, 0.645772, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+6, 195256, 530, 1, 1, 265.287, 8514.35, 23.5299, -2.60053, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+7, 195256, 530, 1, 1, 258.263, 8495.36, 23.4081, 2.16421, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+8, 195256, 530, 1, 1, 276.203, 6122.65, 142.509, -0.95993, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+9, 195256, 530, 1, 1, -208.633, 5388.65, 22.9273, -1.72787, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+10,195256, 530, 1, 1, -87.5959, 5535.55, 22.807, 0.575957, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+11,195256, 530, 1, 1, -192.623, 5531.5, 29.4519, -2.51327, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+12,195256, 530, 1, 1, -702.011, 2676.55, 93.484, 1.72787, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+13,195256, 530, 1, 1, -684.19, 2664.04, 90.9786, 0.506145, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+14,195256, 530, 1, 1, -708.662, 2640.04, 91.8499, -2.14675, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+15,195256, 530, 1, 1, -714.397, 2671.54, 93.9279, 2.23402, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+16,195256, 530, 1, 1, -696.738, 4172.8, 58.3883, 1.90241, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+17,195256, 530, 1, 1, -646.139, 4161.18, 66.1437, -2.58308, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+18,195256, 530, 1, 1, -597.076, 4097.25, 91.2013, 2.40855, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+19,195256, 530, 1, 1, -594.825, 4161.75, 65.7298, 2.47837, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+20,195256, 530, 1, 1, -661.823, 4157.85, 66.0003, -0.506145, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+21,195256, 530, 1, 1, -614.866, 4105.14, 90.6122, -0.453785, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+22,195256, 530, 1, 1, -685.76, 4176.18, 57.4531, 1.93731, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+23,195256, 530, 1, 1, -597.71, 4154.32, 65.3473, 2.65289, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+24,195256, 530, 1, 1, -2024.57, 5470.97, 3.92836, -0.296705, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+25,195256, 530, 1, 1, -1809.99, 5404.19, -12.5532, 1.95477, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+26,195256, 530, 1, 1, -2001.4, 5370.28, -8.0344, -2.32129, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+27,195256, 530, 1, 1, -1994.43, 5356.16, -8.06764, -2.93214, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+28,195256, 530, 1, 1, -1896.71, 5355.26, -12.4279, 1.01229, 0, 0, 0, 1, 180, 255, 1),
+(@OGUID+29,195256, 530, 1, 1, -1942.76, 5448.9, -12.428, 0.034906, 0, 0, 0, 1, 180, 255, 1);
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN 80000 AND 80029 AND `eventEntry`=24;
+
+SET @Event:=24;
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+29 AND `eventEntry`=24;
+INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+29;
diff --git a/sql/old/3.3.5a/world/60_2016_04_11/2016_04_10_00_world.sql b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_10_00_world.sql
new file mode 100644
index 00000000000..d5c24c4a65d
--- /dev/null
+++ b/sql/old/3.3.5a/world/60_2016_04_11/2016_04_10_00_world.sql
@@ -0,0 +1,20 @@
+UPDATE `creature` SET `unit_flags`=33587968 WHERE `guid`IN(53208,53209,53210,53617,53586,53229,53711,53230,53710);
+
+DELETE FROM `creature_addon` WHERE `guid` IN(53208,53209,53210,53210,53617,53586,53229,53711,53230,53710);
+INSERT INTO `creature_addon` (`guid`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(53208, 0, 0x7, 0x1, ''), -- 23232 - 41290 - 41290
+(53209, 0, 0x7, 0x1, ''), -- 23232 - 41290 - 41290
+(53210, 0, 0x7, 0x1, ''), -- 23232 - 41290 - 41290
+(53617, 0, 0x7, 0x1, ''), -- 23236
+(53586, 0, 0x7, 0x1, ''), -- 23236
+(53229, 0, 0x7, 0x1, ''), -- 23235
+(53711, 0, 0x7, 0x1, ''), -- 23237
+(53230, 0, 0x7, 0x1, ''), -- 23235
+(53710, 0, 0x7, 0x1, ''); -- 23237
+
+UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(23232);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(23232) AND `source_type`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(23232, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 11, 41290, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mutant War Hound - On Reset - Cast Disease Cloud'),
+(23232, 0, 1, 0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 41193, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Mutant War Hound - On Death - Cast Cloud of Disease');
diff --git a/sql/updates/auth/3.3.5/2016_04_11_00_auth.sql b/sql/updates/auth/3.3.5/2016_04_11_00_auth.sql
new file mode 100644
index 00000000000..be8a4d21b66
--- /dev/null
+++ b/sql/updates/auth/3.3.5/2016_04_11_00_auth.sql
@@ -0,0 +1 @@
+UPDATE `updates` SET `state`='ARCHIVED';
diff --git a/sql/updates/auth/3.3.5/2016_05_11_00_auth.sql b/sql/updates/auth/3.3.5/2016_05_11_00_auth.sql
new file mode 100644
index 00000000000..254f3d801d6
--- /dev/null
+++ b/sql/updates/auth/3.3.5/2016_05_11_00_auth.sql
@@ -0,0 +1,6 @@
+--
+DELETE FROM `rbac_permissions` WHERE `id` IN (837,838,839,840);
+INSERT INTO `rbac_permissions` (`id`,`name`) VALUES (837,"Command: .npc evade"), (838,"Command: .pet level"), (839,"Command: .server shutdown force"), (840,"Command: .server restart force");
+
+DELETE FROM `rbac_linked_permissions` WHERE `linkedId` IN (837,838,839,840);
+INSERT INTO `rbac_linked_permissions` (`id`,`linkedId`) VALUES (196,837),(196,838),(196,839),(196,840);
diff --git a/sql/updates/auth/3.3.5/2016_06_06_00_auth.sql b/sql/updates/auth/3.3.5/2016_06_06_00_auth.sql
new file mode 100644
index 00000000000..0e203d847ae
--- /dev/null
+++ b/sql/updates/auth/3.3.5/2016_06_06_00_auth.sql
@@ -0,0 +1,5 @@
+DELETE FROM `rbac_permissions` WHERE `id` = 841;
+INSERT INTO `rbac_permissions` (`id`, `name`) VALUES (841, 'Command: .debug neargraveyard');
+
+DELETE FROM `rbac_linked_permissions` WHERE `id` = 196 AND `linkedId` = 841;
+INSERT INTO `rbac_linked_permissions` (`id`, `linkedId`) VALUES (196, 841);
diff --git a/sql/updates/auth/dummy b/sql/updates/auth/3.3.5/dummy
index e69de29bb2d..e69de29bb2d 100644
--- a/sql/updates/auth/dummy
+++ b/sql/updates/auth/3.3.5/dummy
diff --git a/sql/updates/characters/3.3.5/2016_04_11_00_characters.sql b/sql/updates/characters/3.3.5/2016_04_11_00_characters.sql
new file mode 100644
index 00000000000..be8a4d21b66
--- /dev/null
+++ b/sql/updates/characters/3.3.5/2016_04_11_00_characters.sql
@@ -0,0 +1 @@
+UPDATE `updates` SET `state`='ARCHIVED';
diff --git a/sql/updates/characters/dummy b/sql/updates/characters/3.3.5/dummy
index e69de29bb2d..e69de29bb2d 100644
--- a/sql/updates/characters/dummy
+++ b/sql/updates/characters/3.3.5/dummy
diff --git a/sql/updates/world/3.3.5/2016_04_11_00_world.sql b/sql/updates/world/3.3.5/2016_04_11_00_world.sql
new file mode 100644
index 00000000000..2f8d539fe43
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_11_00_world.sql
@@ -0,0 +1,3 @@
+UPDATE `version` SET `db_version`='TDB 335.61', `cache_id`=61 LIMIT 1;
+
+UPDATE `updates` SET `state`='ARCHIVED';
diff --git a/sql/updates/world/3.3.5/2016_04_11_01_world_335.sql b/sql/updates/world/3.3.5/2016_04_11_01_world_335.sql
new file mode 100644
index 00000000000..a432307d0b1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_11_01_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `gameobject` SET `spawntimesecs` = 5 WHERE `guid` IN (45719, 45720, 45721);
diff --git a/sql/updates/world/3.3.5/2016_04_11_02_world_335.sql b/sql/updates/world/3.3.5/2016_04_11_02_world_335.sql
new file mode 100644
index 00000000000..93b6000554c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_11_02_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `spell_group` SET `spell_id`=56112 WHERE `id`=1061 and`spell_id`=46910;
diff --git a/sql/updates/world/3.3.5/2016_04_15_03_world_335.sql b/sql/updates/world/3.3.5/2016_04_15_03_world_335.sql
new file mode 100644
index 00000000000..afbe3b3ab63
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_15_03_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `smart_scripts` SET `action_type`=51, `action_param1`=0 WHERE `entryorguid`=193100 AND `source_type`=9 AND `id`=7;
diff --git a/sql/updates/world/3.3.5/2016_04_16_00_world.sql b/sql/updates/world/3.3.5/2016_04_16_00_world.sql
new file mode 100644
index 00000000000..9219a4ef316
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_16_00_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_baron_geddon_inferno';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(19695, 'spell_baron_geddon_inferno');
diff --git a/sql/updates/world/3.3.5/2016_04_16_01_world.sql b/sql/updates/world/3.3.5/2016_04_16_01_world.sql
new file mode 100644
index 00000000000..95a8f0934ad
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_16_01_world.sql
@@ -0,0 +1,307 @@
+SET @OGUID := 78735; -- 20 free guids required
+SET @CGUID := 84148; -- 9 free guids required
+
+SET @NPC := @CGUID+1;
+SET @PATH := @NPC * 10;
+
+UPDATE `creature_template` SET `difficulty_entry_1`=0 WHERE `entry` IN (25740,25755,25756,25865);
+UPDATE `creature_template` SET `minlevel`=82,`maxlevel`=82, `mechanic_immune_mask`=617299839, `ScriptName`='boss_ahune' WHERE `entry`=25740; -- Ahune
+UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80, `AIName`='SmartAI' WHERE `entry`=25755; -- Ahunite Hailstone
+UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80, `AIName`='SmartAI' WHERE `entry`=25756; -- Ahunite Coldwave
+UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80, `AIName`='SmartAI' WHERE `entry`=25757; -- Ahunite Frostwind
+UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80, `flags_extra`=`flags_extra`|0x40000000, `mechanic_immune_mask`=617299839, `ScriptName`='npc_frozen_core' WHERE `entry`=25865; -- Frozen Core
+UPDATE `creature_template` SET `ScriptName`='npc_ahune_bunny' WHERE `entry`=25745;
+UPDATE `creature_template` SET `ScriptName`='npc_earthen_ring_flamecaller' WHERE `entry`=25754;
+UPDATE `creature_template` SET `unit_flags`=33554432, `MovementType`=2 WHERE `entry` IN (25964,25965,25966); -- Shaman beam bunny
+UPDATE `creature_template` SET `unit_flags`=33554432 WHERE `entry`=26239; -- Ghost of Ahune
+UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry`=25985; -- Ahune Ice Spear Bunny
+UPDATE `gameobject_template` SET `ScriptName`='go_ahune_ice_stone' WHERE `entry`=187882;
+UPDATE `creature` SET `orientation`=2.408554 WHERE `guid`=202734; -- Luma
+UPDATE `creature` SET `orientation`=3.804818 WHERE `guid`=202737; -- Flamecaller
+UPDATE `creature_template` SET `HealthModifier`=94.5, `unit_flags`=33554688 WHERE `entry`=25865;
+UPDATE `creature_template` SET `HealthModifier`=18.8 WHERE `entry`=25755;
+UPDATE `creature_template` SET `HealthModifier`=3.538 WHERE `entry`=25756;
+UPDATE `creature_template` SET `HealthModifier`=1.5 WHERE `entry`=25757;
+UPDATE `creature_template` SET `HealthModifier`=4 WHERE `entry`=40446;
+UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry` IN (25964,25965,25966,26190);
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN
+('spell_ahune_synch_health',
+'spell_ice_spear_control_aura',
+'spell_slippery_floor_periodic',
+'spell_summon_ice_spear_delayer',
+'spell_summoning_rhyme_aura',
+'spell_ahune_spanky_hands',
+'spell_ahune_minion_despawner',
+'spell_ice_spear_target_picker',
+'spell_ice_bombardment_dest_picker');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(46430, 'spell_ahune_synch_health'),
+(46371, 'spell_ice_spear_control_aura'),
+(46320, 'spell_slippery_floor_periodic'),
+(46878, 'spell_summon_ice_spear_delayer'),
+(45926, 'spell_summoning_rhyme_aura'),
+(46146, 'spell_ahune_spanky_hands'),
+(46843, 'spell_ahune_minion_despawner'),
+(46372, 'spell_ice_spear_target_picker'),
+(46398, 'spell_ice_bombardment_dest_picker');
+
+DELETE FROM `creature_text` WHERE `entry` IN (25745,25754,25697,40446);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(25745,0,0,'The Earthen Ring\'s Assault Begins.',41,0,100,0,0,0,24930,1,'Ahune Bunny- EMOTE_EARTHEN_ASSAULT'),
+(25754,0,0,'Ahune Retreats. His defenses diminish.',41,0,100,0,0,0,24931,1,'Earthen Ring Flamecaller - EMOTE_RETREAT'),
+(25754,1,0,'Ahune will soon resurface.',41,0,100,0,0,0,24932,1,'Earthen Ring Flamecaller - EMOTE_RESURFACE'),
+(40446,0,0,'How DARE you! You will not stop the coming of Lord Ahune!',14,0,100,0,0,0,40437,0,'Skar\'this the Summoner'),
+(25697,0,0,'The Ice Stone has melted!',14,0,100,0,0,0,24895,0,'Luma Skymother - SAY_PLAYER_1'),
+(25697,1,0,'Ahune, your strength grows no more!',14,0,100,0,0,0,24893,0,'Luma Skymother - SAY_PLAYER_2'),
+(25697,2,0,'Your frozen reign will not come to pass!',14,0,100,0,0,0,24894,0,'Luma Skymother - SAY_PLAYER_3');
+
+DELETE FROM `gossip_menu` WHERE `entry`=11389;
+INSERT INTO `gossip_menu` VALUES
+(11389,15864);
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=11389;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(11389,1,0,'Disturb the stone and summon Lord Ahune.',40443,1,1,0,0,0,0,NULL,0);
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN (25740,25755,25865,25985,25952);
+INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(25740, 0, 0, 9, 1, 61976),
+(25755, 0, 0, 0, 0, 46542),
+(25865, 0, 0, 0, 0, '46810 61976'),
+(25985, 0, 0, 0, 0, '75498 46878'),
+(25952, 0, 0, 0, 0, 46314);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (46603,46593,46735,45930,45941,46809,46843,46396,46398,46236);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13,1,46603,0,0,31,0,3,26121,0,0,0,0,'',"Spell 'Force Wisp Flight Missile' can hit 'Wisp Source Bunny'"),
+(13,1,46593,0,0,31,0,3,26120,0,0,0,0,'',"Spell 'Wisp Flight Missile and Beam' can hit 'Wisp Dest Bunny'"),
+(13,1,46735,0,0,31,0,3,26190,0,0,0,0,'',"Spell 'Spank - Force Bunny To Knock You To' can hit '[PH] Spank Target Bunny'"),
+(13,1,45930,0,1,31,0,3,25971,0,0,0,0,'',"Spell 'Ahune - Summoning Rhyme Spell, make bonfire' can hit 'Shaman Bonfire Bunny 000'"),
+(13,1,45930,0,2,31,0,3,25972,0,0,0,0,'',"Spell 'Ahune - Summoning Rhyme Spell, make bonfire' can hit 'Shaman Bonfire Bunny 001'"),
+(13,1,45930,0,3,31,0,3,25973,0,0,0,0,'',"Spell 'Ahune - Summoning Rhyme Spell, make bonfire' can hit 'Shaman Bonfire Bunny 002'"),
+(13,1,45941,0,0,31,0,3,25746,0,0,0,0,'',"Spell 'Summon Ahune's Loot Missile' can hit '[PH] Ahune Loot Loc Bunny'"),
+(13,1,46809,0,0,31,0,3,26239,0,0,0,0,'',"Spell 'Make Ahune's Ghost Burst' can hit 'Ghost of Ahune"),
+(13,1,46843,0,1,31,0,3,25756,0,0,0,0,'',"Spell 'Minion Despawner' can hit 'Ahunite Coldwave'"),
+(13,1,46843,0,2,31,0,3,25757,0,0,0,0,'',"Spell 'Minion Despawner' can hit 'Ahunite Frostwind'"),
+(13,1,46843,0,3,31,0,3,25755,0,0,0,0,'',"Spell 'Minion Despawner' can hit 'Ahunite Hailstone'"),
+(13,1,46398,0,0,31,0,3,25972,0,0,0,0,'',"Spell 'Ice Bombardment Dest Picker' can hit 'Shaman Bonfire Bunny'"),
+(13,1,46396,0,0,31,0,3,25972,0,0,0,0,'',"Spell 'Ice Bombardment' can hit 'Shaman Bonfire Bunny'"),
+(13,1,46236,0,1,31,0,3,25971,0,0,0,0,'',"Spell 'Close opening Visual' can hit 'Shaman Bonfire Bunny 000'"),
+(13,1,46236,0,2,31,0,3,25972,0,0,0,0,'',"Spell 'Close opening Visual' can hit 'Shaman Bonfire Bunny 001'"),
+(13,1,46236,0,3,31,0,3,25973,0,0,0,0,'',"Spell 'Close opening Visual' can hit 'Shaman Bonfire Bunny 002'");
+
+DELETE FROM `disables` WHERE `sourceType`=0 AND `entry` IN (46314,46603,46593,46422);
+INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES
+(0,46314,64,0,0,'Disable LOS for spell Ahune - Slippery Floor Ambient'),
+(0,46603,64,0,0,'Disable LOS for spell Force Whisp to Flight'),
+(0,46593,64,0,0,'Disable LOS for spell Whisp Flight Missile and Beam'),
+(0,46422,64,0,0,'Disable LOS for spell Shamans Look for Opening');
+
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (45947,-45964,45964);
+INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
+(45947,45946,2,''),
+(-45964,-46333,0,''),
+(45964,46333,0,'');
+
+-- Skar'this the Summoner
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=40446;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=40446 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(40446,0,0,0,1,0,100,1,0,0,0,0,11,75427,0,0,0,0,0,1,0,0,0,0,0,0,0,'Skar\'this the Summoner - OOC - Cast \'Frost Channelling\''),
+(40446,0,1,0,4,0,100,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Skar\'this the Summoner - On agro - say'),
+(40446,0,2,0,0,0,100,0,5000,5000,15000,15000,11,55909,1,0,0,0,0,2,0,0,0,0,0,0,0,'Skar\'this the Summoner - IC - Cast Crashing Wave'),
+(40446,0,3,0,0,0,100,0,10000,10000,20000,20000,11,11831,1,0,0,0,0,2,0,0,0,0,0,0,0,'Skar\'this the Summoner - IC - Cast Frost Nova'),
+(40446,0,4,0,0,0,100,0,7000,7000,9000,9000,11,15043,0,0,0,0,0,2,0,0,0,0,0,0,0,'Skar\'this the Summoner - IC - Cast Frostbolt');
+
+-- Summon Loot Bunny SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=25746;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=25746 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25746,0,0,0,8,0,100,0,45941,0,0,0,11,46891,0,0,0,0,0,1,0,0,0,0,0,0,0,'[PH] Ahune Loot Loc Bunny - On SpellHit - Cast \'Summon Loot\'');
+
+-- [PH] Spank Target Bunny SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=26190;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=26190 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(26190,0,0,0,8,0,100,0,46735,0,0,0,11,46734,0,0,0,0,0,7,0,0,0,0,0,0,0,'[PH] Spank Target Bunny - On SpellHit \'Spank - Force Bunny To Knock You To\' - Cast \'Knock To\'');
+
+-- Ghost of Ahune
+UPDATE `creature_template` SET `AIName`='SmartAI', `flags_extra`='2' WHERE `entry`=26239;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=26239 AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=2623900 AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(26239,0,0,0,25,0,100,0,0,0,0,0,3,0,11686,0,0,0,0,1,0,0,0,0,0,0,0,'Ghost of Ahune - On Reset - Morph to Model 11686'),
+(26239,0,1,0,8,0,100,0,46809,0,4000,4000,80,2623900,2,0,0,0,0,1,0,0,0,0,0,0,0,'Ghost of Ahune - On SpellHit \'Make Ahune\'s Ghost Burst\' - Call Timed ActionList'),
+(2623900,9,0,0,0,0,100,0,0,0,0,0,3,0,23707,0,0,0,0,1,0,0,0,0,0,0,0,'Ghost of Ahune - Timed ActionList - Morph to Model 23707'),
+(2623900,9,1,0,0,0,100,0,0,0,0,0,11,46786,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ghost of Ahune - Timed ActionList - Cast \'Ahune\'s Ghost Disguise\''),
+(2623900,9,2,0,0,0,100,0,2400,2400,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ghost of Ahune - Timed ActionList - Set Visibility Off'),
+(2623900,9,3,0,0,0,100,0,500,500,0,0,3,0,11686,0,0,0,0,1,0,0,0,0,0,0,0,'Ghost of Ahune - Timed ActionList - Morph to Model 11686'),
+(2623900,9,4,0,0,0,100,0,0,0,0,0,47,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ghost of Ahune - Timed ActionList - Set Visibility On');
+
+-- Wisp Source Bunny SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=26121;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=26121 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(26121,0,0,1,8,0,100,0,46603,0,0,0,11,46593,0,0,0,0,0,11,26120,100,0,0,0,0,0,'Wisp Source Bunny - On SpellHit \'Force Wisp Flight Missile\' - Cast \'Wisp Flight Missile and Beam\''),
+(26121,0,1,0,61,0,100,0,0,0,0,0,41,9000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Wisp Source Bunny - On SpellHit \'Force Wisp Flight Missile\' - Despawn in 9s');
+
+-- Wisp Dest Bunny SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=26120;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=26120 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(26120,0,0,0,8,0,100,0,46593,0,0,0,41,9000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Wisp Dest Bunny - On SpellHit \'Wisp Flight Missile and Beam\' - Despawn in 9s');
+
+-- Shaman Beam Bunny SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (25971,25972,25973);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (25971,25972,25973) AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25971,0,0,0,8,0,100,0,45930,0,0,0,11,46339,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shaman Beam Bunny 000 - On SpellHit - Cast \'Bonfire Disguise\''),
+(25972,0,0,0,8,0,100,0,45930,0,0,0,11,46339,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shaman Beam Bunny 001 - On SpellHit - Cast \'Bonfire Disguise\''),
+(25973,0,0,0,8,0,100,0,45930,0,0,0,11,46339,0,0,0,0,0,1,0,0,0,0,0,0,0,'Shaman Beam Bunny 002 - On SpellHit - Cast \'Bonfire Disguise\'');
+
+-- Ahunite Hailstone SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=25755;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=25755 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25755,0,0,0,0,0,100,0,6000,8000,6000,8000,11,2676,0,0,0,0,0,2,0,0,0,0,0,0,0,'Ahunite Hailstone - In Combat - Cast \'Pulverize\'');
+
+-- Ahunite Coldwave SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=25756;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=25756 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25756,0,0,0,0,0,100,0,5000,7000,6000,8000,11,46406,0,0,0,0,0,2,0,0,0,0,0,0,0,'Ahunite Coldwave - In Combat - Cast \'Bitter Blast\'');
+
+-- Ahunite Frostwind SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=25757;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=25757 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25757,0,0,0,54,0,100,0,0,0,0,0,11,12550,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ahunite Frostwind - On Just Summoned - Cast \'Lightning Shield\''),
+(25757,0,1,0,0,0,100,0,2000,2000,5000,7000,11,46568,0,0,0,0,0,18,120,0,0,0,0,0,0,'Ahunite Frostwind - In Combat - Cast \'Wind Buffet\'');
+
+DELETE FROM `item_loot_template` WHERE `entry`=35512;
+INSERT INTO `item_loot_template` (`Entry`,`Item`,`Reference`,`Chance`,`QuestRequired`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`,`Comment`) VALUES
+(35512,17202,0,100,0,1,0,2,5,NULL);
+
+DELETE FROM `item_loot_template` WHERE `Entry`=54536;
+INSERT INTO `item_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`) VALUES
+(54536, 54806, 0, 3, 0, 1, 0, 1, 1),
+(54536, 23247, 0, 100, 0, 1, 1, 5, 10),
+(54536, 53641, 0, 3, 0, 1, 0, 1, 1);
+
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID AND @CGUID+8;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
+(@CGUID,25745,547,1,1,0,0,-96.64146,-230.8864,4.780959,1.413717,300,0,0,1,1,0,0,0,0), -- [PH] Ahune Summon Loc Bunny
+(@CGUID+1,25964,547,1,1,0,0,-90.00211,-224.9285,-1.378754,2.956095,300,0,0,1,1,2,0,0,0), -- Shaman Beam Bunny 000
+(@CGUID+2,25965,547,1,1,0,0,-97.39627,-223.761,-1.494899,0.9130945,300,0,0,1,1,2,0,0,0), -- Shaman Beam Bunny 001
+(@CGUID+3,25966,547,1,1,0,0,-103.3054,-224.0149,0.5259815,5.676991,300,0,0,1,1,2,0,0,0), -- Shaman Beam Bunny 002
+(@CGUID+4,26190,547,1,1,0,0,-95.33572,-207.4834,16.28742,4.904375,300,0,0,1,1,0,0,0,0), -- [PH] Spank Target Bunny
+(@CGUID+5,25952,547,1,1,0,0,-96.64146,-230.8864,4.780959,1.413717,300,0,0,1,1,0,0,0,0), -- Slippery Floor Bunny
+(@CGUID+6,25952,547,1,1,0,0,-69.83901,-162.474,-2.303646,2.513274,300,0,0,1,1,0,0,0,0), -- Slippery Floor Bunny
+(@CGUID+7,26239,547,1,1,0,0,-99.10214,-233.1872,-1.22297,1.466077,300,0,0,1,1,0,0,0,0), -- Ghost of Ahune
+(@CGUID+8,25746,547,1,1,0,0,-96.8723,-212.8425,-1.149142,4.153883,300,0,0,1,1,0,0,0,0); -- [PH] Ahune Loot Loc Bunny
+
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID AND @OGUID+19;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
+(@OGUID+0, 187882, 547, 0, 0, 1, 1, -69.90455, -162.2449, -2.366563, 2.426008, 0, 0, 0.9366722, 0.3502074, 120, 255, 1,0), -- Icestone
+(@OGUID+1, 188067, 547, 0, 0, 1, 1,-79.397, -219.7025, -4.042892, -2.199115, 0, 0, -0.8910065, 0.4539906, 120, 255, 1, 0), -- Ice Block
+(@OGUID+2, 188067, 547, 0, 0, 1, 1, -115.5985, -162.7724, -1.924025, -0.5585039, 0, 0, -0.2756367, 0.9612619, 120, 255, 1, 0), -- Ice Block
+(@OGUID+3, 188067, 547, 0, 0, 1, 1, -71.89625, -145.4974, -1.551813, -1.954766, 0, 0, -0.8290367, 0.5591941, 120, 255, 1, 0), -- Ice Block
+(@OGUID+4, 188067, 547, 0, 0, 1, 1, -49.27251, -168.9859, -1.898811, 2.007128, 0, 0, 0.8433914, 0.5372996, 120, 255, 1, 0), -- Ice Block
+(@OGUID+5, 188067, 547, 0, 0, 1, 1, -75.95139, -182.771, -4.882017, -1.151916, 0, 0, -0.5446386, 0.8386708, 120, 255, 1, 0), -- Ice Block
+(@OGUID+6, 188067, 547, 0, 0, 1, 1, -83.52528, -172.1806, -3.816522, 0.01745246, 0, 0, 0.00872612, 0.9999619, 120, 255, 1, 0), -- Ice Block
+(@OGUID+7, 188067, 547, 0, 0, 1, 1, -83.52528, -217.3293, -3.0728, -0.4886912, 0, 0, -0.2419214, 0.9702958, 120, 255, 1, 0), -- Ice Block
+(@OGUID+8, 188072, 547, 0, 0, 1, 1, -71.48915, -160.7316, -4.18569, -0.4188786, 0, 0, -0.2079115, 0.9781476, 120, 255, 1, 0), -- Ice Stone Mount
+(@OGUID+9, 188072, 547, 0, 0, 1, 1, -69.21773, -163.491, -2.044773, 2.967041, 0, 0, 0.9961939, 0.08716504, 120, 255, 1, 0), -- Ice Stone Mount
+(@OGUID+10, 188072, 547, 0, 0, 1, 1, -71.82486, -164.475, -3.962982, -0.9250239, 0, 0, -0.4461975, 0.8949345, 120, 255, 1, 0), -- Ice Stone Mount
+(@OGUID+11, 188072, 547, 0, 0, 1, 1, -69.20837, -160.345, -4.25643, 1.850049, 0, 0, 0.7986355, 0.601815, 120, 255, 1, 0), -- Ice Stone Mount
+(@OGUID+12, 188073, 547, 0, 0, 1, 1, -89.75205, -113.5002, -2.709442, 0.453785, 0, 0, 0.2249508, 0.9743701, 120, 255, 1, 0), -- Ahune Bonfire
+(@OGUID+13, 188073, 547, 0, 0, 1, 1,-114.9574, -117.3017, -2.71, 2.007128, 0, 0, 0.8433914, 0.5372996, 120, 255, 1, 0), -- Ahune Bonfire
+(@OGUID+14, 188142, 547, 0, 0, 1, 1, -74.65959, -243.8125, -2.735999, 2.216565, 0, 0, 0.8949337, 0.4461992, 120, 255, 1, 0), -- Ice Block, Big
+(@OGUID+15, 188142, 547, 0, 0, 1, 1, -72.75314, -185.1547, -4.930593, 0.157079, 0, 0, 0.07845879, 0.9969174, 120, 255, 1, 0), -- Ice Block, Big
+(@OGUID+16, 188142, 547, 0, 0, 1, 1, -103.7134, -245.5041, -1.377881, -1.291542, 0, 0, -0.6018143, 0.7986361, 120, 255, 1, 0), -- Ice Block, Big
+(@OGUID+17, 188142, 547, 0, 0, 1, 1, -118.9196, -204.8023, -1.504161, 1.919862, 0, 0, 0.8191519, 0.5735767, 120, 255, 1, 0), -- Ice Block, Big
+(@OGUID+18, 188142, 547, 0, 0, 1, 1, -117.3857, -165.9649, -2.018646, 0.5585039, 0, 0, 0.2756367, 0.9612619, 120, 255, 1, 0), -- Ice Block, Big
+(@OGUID+19, 188142, 547, 0, 0, 1, 1, -75.42784, -221.16, -2.882941, 0.4886912, 0, 0, 0.2419214, 0.9702958, 120, 255, 1, 0); -- Ice Block, Big
+
+DELETE FROM `creature_addon` WHERE `guid` IN (@NPC,@NPC+1,@NPC+2);
+INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES
+(@NPC,@PATH),
+(@NPC+1,@PATH+10),
+(@NPC+2,@PATH+20);
+
+DELETE FROM `waypoint_data` WHERE `id` IN (@PATH,@PATH+10,@PATH+20);
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-107.1537,-233.7247,27.1834,0,0,0,100,0),
+(@PATH,2,-109.4618,-232.0907,25.12787,0,0,0,100,0),
+(@PATH,3,-109.4792,-229.4328,20.98899,0,0,0,100,0),
+(@PATH,4,-105.9522,-226.8887,17.26674,0,0,0,100,0),
+(@PATH,5,-101.0044,-224.8914,16.04452,0,0,0,100,0),
+(@PATH,6,-96.82773,-225.9608,15.73896,0,0,0,100,0),
+(@PATH,7,-92.59879,-227.0505,15.54452,0,0,0,100,0),
+(@PATH,8,-90.07465,-229.0938,16.58224,0,0,0,100,0),
+(@PATH,9,-88.24558,-231.7715,22.47455,0,0,0,100,0),
+(@PATH,10,-91.0969,-232.6422,24.65563,0,0,0,100,0),
+(@PATH,11,-97.20647,-234.4709,28.46118,0,0,0,100,0),
+(@PATH,12,-101.5825,-234.9054,29.35008,0,0,0,100,0),
+
+(@PATH+10,1,-109.4618,-232.0907,25.12787,0,0,0,100,0),
+(@PATH+10,2,-109.4792,-229.4328,20.98899,0,0,0,100,0),
+(@PATH+10,3,-105.9522,-226.8887,17.26674,0,0,0,100,0),
+(@PATH+10,4,-101.0044,-224.8914,16.04452,0,0,0,100,0),
+(@PATH+10,5,-96.82773,-225.9608,15.73896,0,0,0,100,0),
+(@PATH+10,6,-92.59879,-227.0505,15.54452,0,0,0,100,0),
+(@PATH+10,7,-90.07465,-229.0938,16.58224,0,0,0,100,0),
+(@PATH+10,8,-88.24558,-231.7715,22.47455,0,0,0,100,0),
+(@PATH+10,9,-91.0969,-232.6422,24.65563,0,0,0,100,0),
+(@PATH+10,10,-97.20647,-234.4709,28.46118,0,0,0,100,0),
+(@PATH+10,11,-101.5825,-234.9054,29.35008,0,0,0,100,0),
+(@PATH+10,12,-107.1537,-233.7247,27.1834,0,0,0,100,0),
+
+(@PATH+20,1,-97.20647,-234.4709,28.46118,0,0,0,100,0),
+(@PATH+20,2,-101.5825,-234.9054,29.35008,0,0,0,100,0),
+(@PATH+20,3,-107.1537,-233.7247,27.1834,0,0,0,100,0),
+(@PATH+20,4,-109.4618,-232.0907,25.12787,0,0,0,100,0),
+(@PATH+20,5,-109.4792,-229.4328,20.98899,0,0,0,100,0),
+(@PATH+20,6,-105.9522,-226.8887,17.26674,0,0,0,100,0),
+(@PATH+20,7,-101.0044,-224.8914,16.04452,0,0,0,100,0),
+(@PATH+20,8,-96.82773,-225.9608,15.73896,0,0,0,100,0),
+(@PATH+20,9,-92.59879,-227.0505,15.54452,0,0,0,100,0),
+(@PATH+20,10,-90.07465,-229.0938,16.58224,0,0,0,100,0),
+(@PATH+20,11,-88.24558,-231.7715,22.47455,0,0,0,100,0),
+(@PATH+20,12,-91.0969,-232.6422,24.65563,0,0,0,100,0);
+
+DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID AND @CGUID+8 AND `eventEntry`=1;
+INSERT INTO `game_event_creature` (`eventEntry`,`guid`) VALUES
+(1,@CGUID),
+(1,@CGUID+1),
+(1,@CGUID+2),
+(1,@CGUID+3),
+(1,@CGUID+4),
+(1,@CGUID+5),
+(1,@CGUID+6),
+(1,@CGUID+7),
+(1,@CGUID+8);
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID AND @OGUID+19 AND `eventEntry`=1;
+INSERT INTO `game_event_gameobject` (`eventEntry`,`guid`) VALUES
+(1,@OGUID),
+(1,@OGUID+1),
+(1,@OGUID+2),
+(1,@OGUID+3),
+(1,@OGUID+4),
+(1,@OGUID+5),
+(1,@OGUID+6),
+(1,@OGUID+7),
+(1,@OGUID+8),
+(1,@OGUID+9),
+(1,@OGUID+10),
+(1,@OGUID+11),
+(1,@OGUID+12),
+(1,@OGUID+13),
+(1,@OGUID+14),
+(1,@OGUID+15),
+(1,@OGUID+16),
+(1,@OGUID+17),
+(1,@OGUID+18),
+(1,@OGUID+19);
diff --git a/sql/updates/world/3.3.5/2016_04_16_02_world.sql b/sql/updates/world/3.3.5/2016_04_16_02_world.sql
new file mode 100644
index 00000000000..82982753067
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_16_02_world.sql
@@ -0,0 +1,39 @@
+-- The column `spell1` was misused for this NPC. This NPC is undead. He cannot be MCed. The spell 29307 should be cast using SmartAI or by Script.
+-- Also, link the zombies chows to the custom ScriptedAI defined in boss_gluth.cpp.
+UPDATE `creature_template` SET `spell1`=0, `ScriptName`='npc_zombie_chow' WHERE `entry`=16360;
+UPDATE `creature_template` SET `spell1`=0 WHERE `entry`=30303;
+
+-- connect the decimate spell (effect 0) used by Gluth (in both 10 man & 25) to the spell script defined in boss_gluth.cpp.
+-- and connect the 2 zombie chow's search spells to a unique spell script used by both.
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gluth_decimate', 'spell_gluth_zombiechow_search');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(28374, 'spell_gluth_decimate'),
+(54426, 'spell_gluth_decimate'),
+(28239, 'spell_gluth_zombiechow_search'),
+(28404, 'spell_gluth_zombiechow_search');
+
+-- add the condition to the multi-target insta-kill spell 28404 which is that only zombies are eligible targets to the spell.
+-- add a condition to the decimate spell (28374/54426). It's damage component should only affect players and zombies.
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 13 AND `SourceEntry` IN (28374, 28404, 54426);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 28404, 0, 0, 31, 0, 3, 16360, 0, 0, 0, 0, '', 'Zombie Chow Search targets zombies only'),
+(13, 1, 28374, 0, 0, 31, 0, 3, 16360, 0, 0, 0, 0, '', 'Decimate damage should only hit zombie or player'),
+(13, 1, 28374, 0, 1, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Decimate damage should only hit zombie or player'),
+(13, 1, 54426, 0, 0, 31, 0, 3, 16360, 0, 0, 0, 0, '', 'Decimate damage should only hit zombie or player'),
+(13, 1, 54426, 0, 1, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Decimate damage should only hit zombie or player');
+
+-- adds Gluth's 5 emotes into the DB.
+DELETE FROM `creature_text` WHERE `entry`=15932 AND `groupid` IN(0,1,2,3,4) AND `id`=0;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(15932, 0, 0, '%s spots a zombie to devour!', 16, 0, 100, 0, 0, 0, 12242, 2/3, 'Gluth - spots one'),
+(15932, 1, 0, '%s decimates all nearby flesh!', 41, 0, 100, 0, 0, 0, 32321, 2/3, 'Gluth - decimate'),
+(15932, 2, 0, '%s becomes enraged!', 41, 0, 100, 0, 0, 0, 24144, 2/3, 'Gluth - enrage'),
+(15932, 3, 0, '%s devours all nearby zombies!', 16, 0, 100, 0, 0, 0, 12348, 2/3, 'Gluth - devours all'),
+(15932, 4, 0, '%s goes into a berserker rage!', 41, 0, 100, 0, 0, 0, 34057, 2/3, 'Gluth - berserker');
+
+-- move zombie chows to summon groups (gets rid of hardcoded spawn coords)
+DELETE FROM `creature_summon_groups` WHERE `summonerId`=15932;
+INSERT INTO `creature_summon_groups` (`summonerId`,`summonerType`,`groupId`,`entry`,`position_x`,`position_y`,`position_z`,`orientation`,`summonType`,`summonTime`) VALUES
+(15932,0,1,16360,3270.132,-3169.948,297.5891,5.88176,6,10000),
+(15932,0,2,16360,3307.298,-3183.449,297.5891,5.74213,6,10000),
+(15932,0,2,16360,3255.708,-3135.677,297.5891,1.86750,6,10000);
diff --git a/sql/updates/world/3.3.5/2016_04_16_03_world.sql b/sql/updates/world/3.3.5/2016_04_16_03_world.sql
new file mode 100644
index 00000000000..c6a6e1b07de
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_16_03_world.sql
@@ -0,0 +1,2 @@
+UPDATE `npc_spellclick_spells` SET `spell_id`=46598 WHERE `npc_entry`=31583 and`spell_id`=59319;
+UPDATE `smart_scripts` SET `action_param2`=2 WHERE `entryorguid`=31578 and`source_type`=0 and`id`=3;
diff --git a/sql/updates/world/3.3.5/2016_04_16_04_world.sql b/sql/updates/world/3.3.5/2016_04_16_04_world.sql
new file mode 100644
index 00000000000..75d241b62f4
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_16_04_world.sql
@@ -0,0 +1,33 @@
+-- new gossip_menu_option and creature text entries for:
+-- NPC ID 18538 Ishanah, High Priestess of the Aldor
+-- NPC ID 18584 Sal'salabim, quest giver
+-- NPC ID 18585 Raliq the Drunk, target
+-- NPC ID 25967 Zephyr, portal provider
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7725,7729,7735,9205);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(7725,0,0,'Altruis sent me. He said that you could help me.', 15552,1,1, 0,0,0,0,'',0),
+(7729,0,0,"I have been sent by Sal'salabim to collect a debt that you owe. Pay up or I'm going to have to hurt you.",15560,1,1,0,0,0,0,'',0),
+(7735,0,0,"Who are the Sha'tar?", 15642,1,1,7736,0,0,0,'',0),
+(7735,1,0,"Isn't Shattrath a draenei city? Why do you allow others here?",15644,1,1,7737,0,0,0,'',0),
+(9205,0,0,'Take me to the Caverns of Time.', 25111,1,1, 0,0,0,0,'',0);
+
+-- conditions for the gossip menu options as a preparation for future SAI scripts
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup` IN (7725,7729);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15, 7725,0, 0,0, 9,0, 10004,0,0,0,0,0,'', 'Show gossip menu option 7725 only if Quest 10004 is taken (active)'),
+(15, 7729,0, 0,0, 9,0, 10009,0,0,0,0,0,'', 'Show gossip menu option 7729 only if Quest 10009 is taken (active)');
+
+-- insert missing creature text (say lines) for Sal'salabim and Raliq the Drunk
+DELETE FROM `creature_text` WHERE `entry` IN (18584,18585) AND `groupid`= 0;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(18584,0,0,'[Demonic] Ka kalix!', 12,0,100,0,0,0,15551,0,"Sal'salabim SAY_DEMONIC_AGGRO"),
+(18585,0,0,'Raliq teach you lesson now!',12,0,100,0,0,0,15567,0,'Raliq the Drunk SAY_RALIQ_ATTACK');
+
+-- insert missing quest Progress gossip, quest 10004
+DELETE FROM `quest_request_items` WHERE `ID` = 10004;
+INSERT INTO `quest_request_items` (`ID`,`EmoteOnComplete`,`EmoteOnIncomplete`,`CompletionText`,`VerifiedBuild`) VALUES
+(10004,0,0,"<Sal'salabim rubs his head.>$B$B[Demonic] Ik il romath sardon.",0);
+
+-- remove core script for Ishanah, High Priestess of the Aldor
+UPDATE `creature_template` SET `ScriptName`= '' WHERE `entry`= 18538;
diff --git a/sql/updates/world/3.3.5/2016_04_17_00_world.sql b/sql/updates/world/3.3.5/2016_04_17_00_world.sql
new file mode 100644
index 00000000000..ebfbdb1d008
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_17_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `exp`=0 WHERE `entry` IN (33432, 34106);
diff --git a/sql/updates/world/3.3.5/2016_04_17_01_world.sql b/sql/updates/world/3.3.5/2016_04_17_01_world.sql
new file mode 100644
index 00000000000..f57f73c925d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_17_01_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `gameobject` SET `spawntimesecs` = 10 WHERE `id` IN (148499, 178084, 178085, 176785);
+UPDATE `gameobject` SET `spawntimesecs` = 2 WHERE `id` IN (190447, 759);
diff --git a/sql/updates/world/3.3.5/2016_04_17_02_world.sql b/sql/updates/world/3.3.5/2016_04_17_02_world.sql
new file mode 100644
index 00000000000..e63928925df
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_17_02_world.sql
@@ -0,0 +1,7 @@
+--
+-- Rework Scourge Deathspeaker SAI
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27615 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(27615, 0, 0, 0, 1, 0, 100, 0, 1000, 1000, 0, 0, 11, 49119, 2, 0, 0, 0, 0, 10, 101497, 27452, 0, 0, 0, 0, 0, 'Scourge Deathspeaker - Out of Combat - Cast \'Fire Beam\' (Triggered)'),
+(27615, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 11, 52281, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Scourge Deathspeaker - On Aggro - Cast \'Flame of the Seer\' (No Repeat)'),
+(27615, 0, 2, 0, 0, 0, 100, 0, 1000, 2000, 5000, 6000, 11, 52282, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Scourge Deathspeaker - In Combat - Cast \'Fireball\'');
diff --git a/sql/updates/world/3.3.5/2016_04_17_03_world.sql b/sql/updates/world/3.3.5/2016_04_17_03_world.sql
new file mode 100644
index 00000000000..3dc63f55637
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_17_03_world.sql
@@ -0,0 +1,6 @@
+--
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=27547;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27547 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(27547, 0, 0, 1, 2, 0, 100, 0, 0, 40, 9000, 9000, 11, 32714, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vladek - In HPCT - Cast \'Enrage\''),
+(27547, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 47457, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vladek - In HPCT - Cast Worgen Transform - Male');
diff --git a/sql/updates/world/3.3.5/2016_04_17_04_world.sql b/sql/updates/world/3.3.5/2016_04_17_04_world.sql
new file mode 100644
index 00000000000..b284dca323e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_17_04_world.sql
@@ -0,0 +1,27 @@
+--
+-- Quest Bring 'Em Back Alive
+UPDATE `creature_template_addon` SET `auras`=45771 WHERE `entry`=25596;
+UPDATE `creature_template` SET `spell1`=45876, `spell2`=45877 WHERE `entry`=25596;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=25607;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (25596, 25607) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (2560700) AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(25596, 0, 0, 0, 0, 0, 100, 0, 10000, 12000, 20000, 22000, 11, 45876, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Infected Kodo Beast - In Combat - Cast \'Stampede\''),
+(25596, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 91, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Infected Kodo Beast - On Aggro - Remove Flag Standstate Dead'),
+(25596, 0, 2, 3, 27, 0, 100, 0, 0, 0, 0, 0, 91, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Infected Kodo Beast - On Passenger Boarded - Remove Flag Standstate Dead'),
+(25596, 0, 3, 4, 61, 0, 100, 1, 0, 0, 0, 0, 28, 45771, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Infected Kodo Beast - On Link - Remove Aura \'Scourge Infection\' (No Repeat)'),
+(25596, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Infected Kodo Beast - On Link - Remove Aura \'Scourge Infection\' (No Repeat)'),
+(25596, 0, 5, 6, 31, 0, 100, 0, 45877, 0, 0, 0, 11, 50630, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Infected Kodo Beast - On Target Spell Hit \'Deliver Kodo\' - Eject passenger'),
+(25596, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 19, 25607, 20, 0, 0, 0, 0, 0, 'Infected Kodo Beast - On Target Spell Hit \'Deliver Kodo\' - Set data'),
+(25596, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Infected Kodo Beast - On Target Spell Hit \'Deliver Kodo\' - Despawn Instant'),
+(25607, 0, 0, 0, 38, 0, 100, 0, 0, 1, 3000, 3000, 80, 2560700, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Farmer Torp - In Data set - Action list'),
+(2560700, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 21, 20, 0, 0, 0, 0, 0, 0, 'Farmer Torp - Action list - Player talk'),
+(2560700, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Farmer Torp - Action list - Say text');
+
+DELETE FROM `creature_text` WHERE `entry` IN (25607, 25596);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`probability`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(25607,0,0,"Here's your kodo, Torp!",12,100,24881,0,"Farmer Torp"),
+(25607,0,1,"Door-to-door kodo delivery!",12,100,24882,0,"Farmer Torp"),
+(25607,1,0,"YES! It worked!",12,100,24883,0,"Farmer Torp"),
+(25607,1,1,"Great job!",12,100,24884,0,"Farmer Torp"),
+(25596,0,0,"%s is cured!",16,100,24885,0,"Infected Kodo Beast");
diff --git a/sql/updates/world/3.3.5/2016_04_20_00_world.sql b/sql/updates/world/3.3.5/2016_04_20_00_world.sql
new file mode 100644
index 00000000000..776254b8fb9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_20_00_world.sql
@@ -0,0 +1,7 @@
+--
+-- Add missing Gnomeregan Conjuror/Silvermoon Magister SAI (Cosmetic)
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (19006, 19007);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (19006, 19007) AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(19006, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 11, 32783, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Silvermoon Magister - On Reset - Cast \'Arcane Channeling\''),
+(19007, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 11, 32783, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gnomeregan Conjuror - On Reset - Cast \'Arcane Channeling\'');
diff --git a/sql/updates/world/3.3.5/2016_04_20_01_world.sql b/sql/updates/world/3.3.5/2016_04_20_01_world.sql
new file mode 100644
index 00000000000..19bd02a91f5
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_20_01_world.sql
@@ -0,0 +1,5 @@
+--
+-- Hairy Herring Heads, Withered Batwings, Wasp's Wings, Muddy Mire Maggots, Knotroot, Spekled Guano, Seasoned Slider Cider, Pickled Eagle Egg, Prismatic Mojo, Raptor Claw
+-- Pulverized Gargoyle Teeth, Icerown Bottled Water, Putrid Pirate Perspiration, Spiky Spider Eggs, Abomination Guts, Amberseed, Shrunken Dragom's Claw, Crystallized Hogsnot
+-- Ancient Ectoplasm, Chrushed Basilisk Crystals, Blight Crystal, Frozen Spider Ichor, Trollbane, Ghoul Drool,
+UPDATE `gameobject` SET `spawntimesecs` = 0 WHERE `id` IN (190459,190461,190462,190463,190464,190465,190466,190467,190468,190469,190470,190471,190472,190473,190474,190476,190477,190478,190479,190480,190481,190482,191180,191181,191182);
diff --git a/sql/updates/world/3.3.5/2016_04_20_02_world.sql b/sql/updates/world/3.3.5/2016_04_20_02_world.sql
new file mode 100644
index 00000000000..743f1fdab50
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_20_02_world.sql
@@ -0,0 +1,89 @@
+--
+DELETE FROM `creature_addon` WHERE `guid` IN (202936, 202878, 202950, 202931, 202875, 202884, 202914, 202925, 202934, 202944, 202879, 202945, 202898, 202910, 202912, 202909, 202870, 202949, 202903, 202920, 202922, 202924, 202926, 202939, 202888, 202940, 202882, 202947, 202897, 202937, 202915, 202929, 202935, 202872, 202887, 202942, 202948, 202896, 202900, 202916, 202886, 202923, 202894, 202927, 202913, 202906, 202876, 202941, 202881, 202890, 202907, 202904, 202874, 202880, 202877, 202905, 202873, 202908, 202946, 202917, 202928, 202932, 202943, 202883, 202895, 202951, 202901, 202911, 202885, 202899, 202933, 202868, 202938, 202919, 202921, 202918, 202893, 202891, 202889, 202866, 202871, 202892, 202930, 202902, 202869, 202867);
+INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(202936, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202878, 0, 0, 0, 1, 0, '66321 55944 66370'), -- Tauren Coliseum Spectator
+(202950, 0, 0, 0, 1, 0, '66321 55944 66361'), -- Argent Crusade Spectator, 66361 - Argent Crusade Pennant
+(202931, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Draenei
+(202875, 0, 0, 0, 1, 0, '66321 55944'), -- Troll Coliseum Spectator
+(202884, 0, 0, 0, 1, 0, '66321 55944 66369'), -- Orcish Coliseum Spectator
+(202914, 0, 0, 0, 1, 0, '66321 55944'), -- Human Coliseum Spectator
+(202925, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Orc
+(202934, 0, 0, 0, 1, 0, '66321 55944 66361'), -- Argent Crusade Spectator
+(202944, 0, 0, 0, 1, 0, '66321 55944 66361'), -- Argent Crusade Spectator
+(202879, 0, 0, 0, 1, 0, '66321 55944 66370'), -- Tauren Coliseum Spectator
+(202945, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202898, 0, 0, 0, 1, 0, '66321 55944'), -- Blood Elf Coliseum Spectator
+(202910, 0, 0, 0, 1, 0, '66321 55944 66366'), -- Gnomish Coliseum Spectator
+(202912, 0, 0, 0, 1, 0, '66321 55944'), -- Human Coliseum Spectator
+(202909, 0, 0, 0, 1, 0, '66321 55944'), -- Gnomish Coliseum Spectator
+(202870, 0, 0, 0, 1, 0, '66321 55944'), -- Dwarven Coliseum Spectator
+(202949, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202903, 0, 0, 0, 1, 0, '66321 55944 66362'), -- Draenei Coliseum Spectator
+(202920, 0, 0, 0, 1, 0, '66321 55944'), -- Night Elf Coliseum Spectator
+(202922, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Horde
+(202924, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Human
+(202926, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Troll
+(202939, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202888, 0, 0, 0, 1, 0, '66321 55944'), -- Orcish Coliseum Spectator
+(202940, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202882, 0, 0, 0, 1, 0, '66321 55944'), -- Tauren Coliseum Spectator
+(202947, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202897, 0, 0, 0, 1, 0, '66321 55944 66360'), -- Blood Elf Coliseum Spectator, 66360 - Silvermoon Pennant
+(202937, 0, 0, 0, 1, 0, '66321 55944 66361'), -- Argent Crusade Spectator
+(202915, 0, 0, 0, 1, 0, '66321 55944 66367'), -- Human Coliseum Spectator
+(202929, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Undead
+(202935, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202872, 0, 0, 0, 1, 0, '66321 55944 66371'), -- Troll Coliseum Spectator
+(202887, 0, 0, 0, 1, 0, '66321 55944'), -- Orcish Coliseum Spectator
+(202942, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202948, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202896, 0, 0, 0, 1, 0, '66321 55944'), -- Blood Elf Coliseum Spectator
+(202900, 0, 0, 0, 1, 0, '66321 55944'), -- Draenei Coliseum Spectator
+(202916, 0, 0, 0, 1, 0, '66321 55944 66367'), -- Human Coliseum Spectator
+(202886, 0, 0, 0, 1, 0, '66321 55944'), -- Orcish Coliseum Spectator
+(202923, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Alliance
+(202894, 0, 0, 0, 1, 0, '66321 55944 66360'), -- Blood Elf Coliseum Spectator
+(202927, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Tauren
+(202913, 0, 0, 0, 1, 0, '66321 55944'), -- Human Coliseum Spectator
+(202906, 0, 0, 0, 1, 0, '66321 55944'), -- Gnomish Coliseum Spectator
+(202876, 0, 0, 0, 1, 0, '66321 55944'), -- Troll Coliseum Spectator
+(202941, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202881, 0, 0, 0, 1, 0, '66321 55944'), -- Tauren Coliseum Spectator
+(202890, 0, 0, 0, 1, 0, '66321 55944 66365'), -- Forsaken Coliseum Spectator
+(202907, 0, 0, 0, 1, 0, '66321 55944 66366'), -- Gnomish Coliseum Spectator
+(202904, 0, 0, 0, 1, 0, '66321 55944 66362'), -- Draenei Coliseum Spectator
+(202874, 0, 0, 0, 1, 0, '66321 55944'), -- Troll Coliseum Spectator
+(202880, 0, 0, 0, 1, 0, '66321 55944'), -- Tauren Coliseum Spectator
+(202877, 0, 0, 0, 1, 0, '66321 55944 66371'), -- Troll Coliseum Spectator, 66371 - Sen'jin Pennant
+(202905, 0, 0, 0, 1, 0, '66321 55944'), -- Gnomish Coliseum Spectator
+(202873, 0, 0, 0, 1, 0, '66321 55944 66371'), -- Troll Coliseum Spectator
+(202908, 0, 0, 0, 1, 0, '66321 55944 66366'), -- Gnomish Coliseum Spectator
+(202946, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202917, 0, 0, 0, 1, 0, '66321 55944'), -- Night Elf Coliseum Spectator
+(202928, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Blood Elf
+(202932, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Night Elf
+(202943, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202883, 0, 0, 0, 1, 0, '66321 55944 66369'), -- Orcish Coliseum Spectator
+(202895, 0, 0, 0, 1, 0, '66321 55944 66360'), -- Blood Elf Coliseum Spectator
+(202951, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202901, 0, 0, 0, 1, 0, '66321 55944 66362'), -- Draenei Coliseum Spectator
+(202911, 0, 0, 0, 1, 0, '66321 55944'), -- Human Coliseum Spectator
+(202885, 0, 0, 0, 1, 0, '66321 55944'), -- Orcish Coliseum Spectator
+(202899, 0, 0, 0, 1, 0, '66321 55944'), -- Blood Elf Coliseum Spectator
+(202933, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Gnome
+(202868, 0, 0, 0, 1, 0, '66321 55944 66363'), -- Dwarven Coliseum Spectator, 66363 - Ironforge Pennant
+(202938, 0, 0, 0, 1, 0, '66321 55944'), -- Argent Crusade Spectator
+(202919, 0, 0, 0, 1, 0, '66321 55944 66368'), -- Night Elf Coliseum Spectator, 66368 - Darnassus Pennant
+(202921, 0, 0, 0, 1, 0, '66321 55944 66368'), -- Night Elf Coliseum Spectator
+(202918, 0, 0, 0, 1, 0, '66321 55944'), -- Night Elf Coliseum Spectator
+(202893, 0, 0, 0, 1, 0, '66321 55944'), -- Forsaken Coliseum Spectator
+(202891, 0, 0, 0, 1, 0, '66321 55944'), -- Forsaken Coliseum Spectator
+(202889, 0, 0, 0, 1, 0, '66321 55944 66365'), -- Forsaken Coliseum Spectator
+(202866, 0, 0, 0, 1, 0, '66321 55944 66363'), -- Dwarven Coliseum Spectator, 66363 - Ironforge Pennant
+(202871, 0, 0, 0, 1, 0, '66321 55944 66363'), -- Dwarven Coliseum Spectator
+(202892, 0, 0, 0, 1, 0, '66321 55944 66365'), -- Forsaken Coliseum Spectator, 66365 - Undercity Pennant
+(202930, 0, 0, 0, 1, 0, '66321 55944'), -- [ph] Argent Raid Spectator - FX - Dwarf
+(202902, 0, 0, 0, 1, 0, '66321 55944'), -- Draenei Coliseum Spectator
+(202869, 0, 0, 0, 1, 0, '66321 55944'), -- Dwarven Coliseum Spectator
+(202867, 0, 0, 0, 1, 0, '66321 55944'); -- Dwarven Coliseum Spectator
diff --git a/sql/updates/world/3.3.5/2016_04_20_03_world.sql b/sql/updates/world/3.3.5/2016_04_20_03_world.sql
new file mode 100644
index 00000000000..11fc8de7329
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_20_03_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (27435) AND `source_type`=0 AND `id`=2;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(27435, 0, 2, 0, 63, 0, 100, 0, 0, 0, 0, 0, 18, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wintergarde Mine Bomb - Just created - Set immune to NPC');
diff --git a/sql/updates/world/3.3.5/2016_04_22_00_world.sql b/sql/updates/world/3.3.5/2016_04_22_00_world.sql
new file mode 100644
index 00000000000..e98ef9cf7e6
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_22_00_world.sql
@@ -0,0 +1,20 @@
+DELETE FROM `smart_scripts` WHERE `entryorguid`=2964700 AND `source_type`=9;
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(29647,29884) AND `source_type`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(29647, 0, 0, 1, 62, 0, 100, 0, 9852, 2, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Gossip Option 2 Selected - Close Gossip'), -- 21:50:33.764
+(29647, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 55568, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Gossip Option 2 Selected - Cast Summon Gymer (Force)'), -- 21:50:33.967
+(29647, 0, 4, 0, 1, 0, 100, 0, 10000, 20000, 30000, 40000, 1, 1, 5000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gymer - Out of Combat - Say Line 1'),
+(29647, 0, 5, 0, 20, 0, 100, 0, 12916, 0, 0, 0, 1, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Quest reward - Say Line 7'),
+(29884, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 86, 55430, 2, 7, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Just Summoned - Cast Gymers Buddy'), -- 21:50:35.090
+(29884, 0, 1, 0, 61, 0, 100, 1, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Just Summoned - Set Passive'),
+(29884, 0, 2, 3, 27, 0, 100, 1, 0, 0, 0, 0, 44, 256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Passenger Boarded - Set Phase 256'),
+(29884, 0, 3, 0, 61, 0, 100, 1, 0, 0, 0, 0, 1, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Passenger Boarded - Say Line 8 (No Repeat)'),
+(29884, 0, 4, 0, 61, 0, 100, 1, 0, 0, 0, 0, 11, 55461, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Passenger Boarded - Cast Storms Fury'),
+(29884, 0, 5, 6, 28, 0, 100, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Passenger Removed - Set Phase 1'),
+(29884, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 1, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Passenger Removed - Say Line 10'),
+(29884, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gymer - On Passenger Removed - Despawn after 5 seconds');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=29884;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(22, 6, 29884, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Gymer only despawns if player leaves vehicle (not if mob thrown)');
diff --git a/sql/updates/world/3.3.5/2016_04_23_00_world.sql b/sql/updates/world/3.3.5/2016_04_23_00_world.sql
new file mode 100644
index 00000000000..fe5d5c7ccb6
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_23_00_world.sql
@@ -0,0 +1,7 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND (`SourceEntry`=11586 OR `SourceEntry`=11585);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`Comment`) VALUES
+(19, 11585, 14, 10172, "Accept quest 11585 - Quest 10172 needs to be incomplete"),
+(19, 11586, 8, 10172, "Accept quest 11586 - Quest 10172 needs to be rewarded");
+
+UPDATE `quest_template_addon` SET `ExclusiveGroup`=11585 WHERE `ID`IN(11585,11586);
diff --git a/sql/updates/world/3.3.5/2016_04_23_01_world.sql b/sql/updates/world/3.3.5/2016_04_23_01_world.sql
new file mode 100644
index 00000000000..d1be7adacfc
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_23_01_world.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_item_decahedral_dwarven_dice', 'spell_item_worn_troll_dice');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(47770, 'spell_item_decahedral_dwarven_dice'),
+(47776, 'spell_item_worn_troll_dice');
diff --git a/sql/updates/world/3.3.5/2016_04_23_02_world.sql b/sql/updates/world/3.3.5/2016_04_23_02_world.sql
new file mode 100644
index 00000000000..e3806947c9c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_23_02_world.sql
@@ -0,0 +1,19 @@
+--
+UPDATE `creature_template` SET `npcflag`=4096 WHERE `entry`=2404;
+UPDATE `creature_template` SET `npcflag`=2 WHERE `entry`=2910;
+UPDATE `creature_template` SET `npcflag`=81 WHERE `entry`=7231;
+UPDATE `creature_template` SET `npcflag`=128 WHERE `entry`=8121;
+UPDATE `creature_template` SET `npcflag`=2 WHERE `entry`=15309;
+
+DELETE FROM `npc_vendor` WHERE `entry`=8121;
+INSERT INTO `npc_vendor` (`entry`, `slot`, `item`) VALUES
+(8121, 0, 5740),
+(8121, 0, 8624),
+(8121, 0, 8625),
+(8121, 0, 8626),
+(8121, 0, 9312),
+(8121, 0, 9313),
+(8121, 0, 9314),
+(8121, 0, 9315),
+(8121, 0, 9317),
+(8121, 0, 9318);
diff --git a/sql/updates/world/3.3.5/2016_04_24_00_world_335.sql b/sql/updates/world/3.3.5/2016_04_24_00_world_335.sql
new file mode 100644
index 00000000000..b6b42fb0846
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_24_00_world_335.sql
@@ -0,0 +1,4 @@
+--
+-- spell aura effect 53055 from Hand of Salvation should not break invisibility
+DELETE FROM `spell_custom_attr` WHERE `entry`=53055 AND `attributes`=64;
+INSERT INTO `spell_custom_attr` (`entry`,`attributes`) VALUES (53055, 64);
diff --git a/sql/updates/world/3.3.5/2016_04_24_01_world.sql b/sql/updates/world/3.3.5/2016_04_24_01_world.sql
new file mode 100644
index 00000000000..0d9f3aa6bd7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_24_01_world.sql
@@ -0,0 +1,22 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (17998,17999,18000,18002) AND `id`=1;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(17998,0,1,0,8,0,100,0,31736,0,0,0,12,18340,4,30000,0,0,0,8,0,0,0,-752.349, 5940.811, 18.261, 4.444397,"Umbrafen Steam Pump Credit Marker - On Spellhit 'Ironvine Seeds' - Summon Creature 'Steam Pump Overseer'"),
+(17999,0,1,0,8,0,100,0,31736,0,0,0,12,18340,4,30000,0,0,0,8,0,0,0,-227.935, 6307.861, 21.967, 5.719622,"Lagoon Steam Pump Credit Marker - On Spellhit 'Ironvine Seeds' - Summon Creature 'Steam Pump Overseer'"),
+(18000,0,1,0,8,0,100,0,31736,0,0,0,12,18340,4,30000,0,0,0,8,0,0,0,579.913, 6342.902, 23.849, 2.159061,"Serpent Steam Pump Credit Marker - On Spellhit 'Ironvine Seeds' - Summon Creature 'Steam Pump Overseer'"),
+(18002,0,1,0,8,0,100,0,31736,0,0,0,12,18340,4,30000,0,0,0,8,0,0,0,477.12, 8189.803, 21.985, 0.486592,"Marshlight Steam Pump Credit Marker - On Spellhit 'Ironvine Seeds' - Summon Creature 'Steam Pump Overseer'");
+
+SET @ENTRY := 18340;
+
+UPDATE `creature_template_addon` SET `auras`="6961 33962" WHERE `entry`=@ENTRY;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,1,54,0,100,0,0,0,0,0,1,0,0,0,0,0,0,21,40,0,0,0,0,0,0,'Steam Pump Overseer - Just summoned - Say text'),
+(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,49,0,0,0,0,0,0,21,40,0,0,0,0,0,0,'Steam Pump Overseer - Just summoned - Start attack');
+
+DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`, `BroadcastTextId`) VALUES
+(@ENTRY,0,0, 'I will show you not to cross us again!',12,0,100,0,0,0, 'Steam Pump Overseer', 15202),
+(@ENTRY,0,1, 'Warlord Kalithresh will hear of this insolence!',12,0,100,0,0,0, 'Steam Pump Overseer', 15201),
+(@ENTRY,0,2, 'I''ll make you pay for that!',12,0,100,0,0,0, 'Steam Pump Overseer', 15199);
diff --git a/sql/updates/world/3.3.5/2016_04_25_00_world.sql b/sql/updates/world/3.3.5/2016_04_25_00_world.sql
new file mode 100644
index 00000000000..2c603dc5d64
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_25_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature` SET `modelid`=11686 WHERE `id`=39010;
diff --git a/sql/updates/world/3.3.5/2016_04_25_01_world.sql b/sql/updates/world/3.3.5/2016_04_25_01_world.sql
new file mode 100644
index 00000000000..f83b99f1710
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_25_01_world.sql
@@ -0,0 +1,42 @@
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(24161) AND `source_type`=0 AND `id`>4;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(24162,24016) AND `source_type`=0 AND `id`>3;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(24015) AND `source_type`=0 AND `id`>2;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(24161, 0, 5, 6, 11, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Oric the Baleful - On Spawn - Set Immune to combat'),
+(24161, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Oric the Baleful - On Spawn - Set Invisible'),
+(24161, 0, 7, 8, 38, 0, 100, 1, 1, 1, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Oric the Baleful - On Data Set - Enable combat Immune to combat'),
+(24161, 0, 8, 9, 61, 0, 100, 1, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Oric the Baleful - On Data Set - Set visible'),
+(24161, 0, 9, 0, 61, 0, 100, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Oric the Baleful - On Data Set - Say'),
+(24162, 0, 4, 5, 11, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gunnar Thorvardsson - On Spawn - Set Immune to combat'),
+(24162, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gunnar Thorvardsson - On Spawn - Set Invisible'),
+(24162, 0, 6, 7, 38, 0, 100, 1, 1, 1, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gunnar Thorvardsson - On Data Set - Enable combat Immune to combat'),
+(24162, 0, 7, 8, 61, 0, 100, 1, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gunnar Thorvardsson - On Data Set - Set visible'),
+(24162, 0, 8, 0, 61, 0, 100, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gunnar Thorvardsson - On Data Set - Say'),
+(24016, 0, 4, 5, 11, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ulf the Bloodletter - On Spawn - Set Immune to combat'),
+(24016, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ulf the Bloodletter - On Spawn - Set Invisible'),
+(24016, 0, 6, 7, 38, 0, 100, 1, 1, 1, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ulf the Bloodletter - On Data Set - Enable combat Immune to combat'),
+(24016, 0, 7, 8, 61, 0, 100, 1, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ulf the Bloodletter - On Data Set - Set visible'),
+(24016, 0, 8, 0, 61, 0, 100, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ulf the Bloodletter - On Data Set - Say'),
+(24015, 0, 3, 0, 6, 0, 15, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 24161, 0, 0, 0, 0, 0, 0, 'Winterskorn Defender - On Death - Set Data on Oric the Baleful'),
+(24015, 0, 4, 0, 6, 0, 15, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 24162, 0, 0, 0, 0, 0, 0, 'Winterskorn Defender - On Death - Set Data on Gunnar Thorvardsson'),
+(24015, 0, 5, 0, 6, 0, 15, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 24016, 0, 0, 0, 0, 0, 0, 'Winterskorn Defender - On Death - Set Data on Ulf the Bloodletter');
+
+DELETE FROM `creature_text` WHERE `entry` IN(24161,24162,24016);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(24161, 0, 0, 'Enemies of the Winterskorn, you will be torn limb from limb!', 14, 0, 100, 0, 0, 0, 22867, 0, 'Oric the Baleful'),
+(24016, 0, 0, 'Drive this scum from the Vrykul homeland!', 14, 0, 100, 0, 0, 0, 22868, 0, 'Ulf the Bloodletter'),
+(24162, 0, 0, 'Gunnar, son of Thorvard, has arrived! Prepare to meet your demise!', 14, 0, 100, 0, 0, 0, 22863, 0, 'Gunnar Thorvardsson');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN(24161,24162,24016,24015);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(22, 6, 24161, 0, 0, 36, 1, 0, 0, 0, 0, 0, 0, '', 'Only execute SAI if Oric the Baleful alive'),
+(22, 5, 24016, 0, 0, 36, 1, 0, 0, 0, 0, 0, 0, '', 'Only execute SAI if Ulf the Bloodletter alive'),
+(22, 5, 24162, 0, 0, 36, 1, 0, 0, 0, 0, 0, 0, '', 'Only execute SAI if Gunnar Thorvardsson alive'),
+(22, 4, 24015, 0, 0, 9, 0, 11282, 0, 0, 0, 0, 0, '', 'Only execute SAI if player has A Lesson in Fear taken'),
+(22, 5, 24015, 0, 0, 9, 0, 11282, 0, 0, 0, 0, 0, '', 'Only execute SAI if player has A Lesson in Fear taken'),
+(22, 6, 24015, 0, 0, 9, 0, 11282, 0, 0, 0, 0, 0, '', 'Only execute SAI if player has A Lesson in Fear taken');
+
+UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=29647 AND `source_type`=0 AND `id`=1 AND `link`=2;
+UPDATE `smart_scripts` SET `link`=4 WHERE `entryorguid`=29884 AND `source_type`=0 AND `id`=3 AND `link`=0;
+
diff --git a/sql/updates/world/3.3.5/2016_04_25_02_world.sql b/sql/updates/world/3.3.5/2016_04_25_02_world.sql
new file mode 100644
index 00000000000..31d98dd616c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_25_02_world.sql
@@ -0,0 +1,48 @@
+--
+SET @Aura1:=44880;
+SET @Flare:=24916;
+SET @Grow:=44944;
+SET @Visual:=44877;
+SET @MiniExplosion:=44943;
+SET @Unstable:=24958;
+SET @Aura2:=46196;
+SET @Explosion:=46225;
+SET @credit:=44947;
+SET @Flame:=22323;
+
+UPDATE `creature_template` SET `unit_flags`=776, `faction`=1629, `InhabitType`=4, `AIName`='SmartAI' WHERE `entry`in (@Flare, @Unstable);
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`in (@Flame);
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@Flare;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (@Flare,1,@Aura1);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` = @Flame AND `source_type` = 0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = @Flare AND `source_type` = 0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = @Flare*100 AND `source_type` = 9;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = @Flare*100+1 AND `source_type` = 9;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@Flare, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flare - Just summoned - React passif'),
+(@Flare, 0, 1, 0, 23, 0, 100, 1, @Grow, 8, 0, 0, 80, @Flare*100, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flare - has aura x 8 - Action list'),
+(@Flare*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, @MiniExplosion, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flare - Action list - cast'),
+(@Flare*100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 3, @Unstable, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flare - Action list - morph'),
+(@Flare*100, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 28, @Aura1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flare - Action list - Remove aura'),
+(@Flare*100, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, @Aura2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flare - Action list - Add aura'),
+(@Flare*100, 9, 4, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 53, 1, @Flare, 0, 0, 500, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flare - Action list - Start way point'),
+(@Flare, 0, 2, 0, 58, 0, 100, 0, 0, 0, 0, 0, 80, @Flare*100+1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Unstable - On way point Ended - Action list'),
+(@Flare*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, @Explosion, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flare - Action list - Cast'),
+(@Flare*100+1, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, @credit, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 'Unstable - Action list - Cast'),
+(@Flare*100+1, 9, 2, 0, 0, 0, 100, 0, 500, 500, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flare - Action list - despawn'),
+(@Flare, 0, 3, 0, 38, 0, 100, 0, 1, 1, 0, 0, 11, @Visual, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flare - On data set- cast'),
+(@Flame, 0, 0, 0, 0, 0, 100, 0, 3000, 3000, 5000, 5000, 11, 36247, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Flare - IC - Cast'),
+(@Flame, 0, 1, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @Flare, 40, 0, 0, 0, 0, 0, 'Flare - On death - Set Data');
+
+DELETE FROM `waypoints` WHERE `entry`=@Flare;
+INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
+(@Flare,1, 828.737000, 2509.100098, 300.700012,'Flare');
+
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = @Visual;
+INSERT INTO `spell_linked_spell` VALUES (@Visual, @Grow, 0, 'Flare Aura');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@Visual;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,@Visual,0,0,31,0,3,@Flare,0,0,0,0,'','Only the Flare is a target for the spell.');
diff --git a/sql/updates/world/3.3.5/2016_04_25_03_world.sql b/sql/updates/world/3.3.5/2016_04_25_03_world.sql
new file mode 100644
index 00000000000..7bbd279e943
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_25_03_world.sql
@@ -0,0 +1,47 @@
+SET @CGUID := 145119;
+
+DELETE FROM `creature` WHERE `id`=21788;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@CGUID+0, 21788, 530, 0, 0, 1, 1, 0, 0, -3090.62, 2402.483, 63.14528, 4.310963, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 0) (Auras: 37509 - 37509)
+(@CGUID+1, 21788, 530, 0, 0, 1, 1, 0, 0, -3115.362, 2440.234, 64.67137, 1.902409, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 0) (Auras: 37509 - 37509)
+(@CGUID+2, 21788, 530, 0, 0, 1, 1, 0, 0, -3138.009, 2452.761, 63.82878, 4.153883, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 0) (Auras: 37509 - 37509)
+(@CGUID+3, 21788, 530, 0, 0, 1, 1, 0, 0, -3068.807, 2447.557, 64.62611, 1.380292, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 0) (Auras: 37509 - 37509)
+(@CGUID+4, 21788, 530, 0, 0, 1, 1, 0, 0, -3125.387, 2489.521, 62.06233, 5.113815, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 0) (Auras: 37509 - 37509)
+(@CGUID+5, 21788, 530, 0, 0, 1, 1, 0, 0, -3061.514, 2459.645, 65.18143, 4.520403, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 0) (Auras: 37509 - 37509)
+(@CGUID+6, 21788, 530, 0, 0, 1, 1, 0, 0, -3122.754, 2501.015, 62.70392, 5.51524, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 0) (Auras: 37509 - 37509)
+(@CGUID+7, 21788, 530, 0, 0, 1, 1, 0, 0, -3034.208, 2499.923, 63.14324, 1.48353, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 0) (Auras: 37509 - 37509)
+(@CGUID+8, 21788, 530, 0, 0, 1, 1, 0, 0, -3079.527, 2527.942, 62.65857, 0.1570796, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 0) (Auras: 37509 - 37509)
+(@CGUID+9, 21788, 530, 0, 0, 1, 1, 0, 0, -3067.415, 2495.909, 64.73977, 1.570796, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 0) (Auras: 37509 - 37509)
+(@CGUID+10, 21788, 530, 0, 0, 1, 1, 0, 0, -3130.252, 2537.187, 61.81245, 0.9250245, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+11, 21788, 530, 0, 0, 1, 1, 0, 0, -3036.085, 2528.19, 63.41149, 5.166174, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+12, 21788, 530, 0, 0, 1, 1, 0, 0, -3001.511, 2507.445, 61.33947, 1.553343, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+13, 21788, 530, 0, 0, 1, 1, 0, 0, -3020.436, 2502.759, 62.7676, 0.296706, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+14, 21788, 530, 0, 0, 1, 1, 0, 0, -3061.437, 2541.203, 62.35847, 4.361612, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+15, 21788, 530, 0, 0, 1, 1, 0, 0, -3022.704, 2512.111, 68.65653, 0.3839724, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+16, 21788, 530, 0, 0, 1, 1, 0, 0, -3016.363, 2549.719, 79.11957, 1.291544, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+17, 21788, 530, 0, 0, 1, 1, 0, 0, -3104.333, 2552.007, 61.75181, 5.380099, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+18, 21788, 530, 0, 0, 1, 1, 0, 0, -3115.356, 2556.791, 61.91945, 0.3141593, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+19, 21788, 530, 0, 0, 1, 1, 0, 0, -3133.627, 2548.74, 62.05401, 6.195919, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+20, 21788, 530, 0, 0, 1, 1, 0, 0, -2985.531, 2556.819, 76.62669, 3.961897, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+21, 21788, 530, 0, 0, 1, 1, 0, 0, -2987.325, 2568.416, 76.62669, 5.846853, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+22, 21788, 530, 0, 0, 1, 1, 0, 0, -3116.468, 2572.71, 61.88921, 0.1047198, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+23, 21788, 530, 0, 0, 1, 1, 0, 0, -3090.439, 2579.877, 61.85312, 4.817109, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+24, 21788, 530, 0, 0, 1, 1, 0, 0, -3147.669, 2577.585, 62.38097, 1.867502, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+25, 21788, 530, 0, 0, 1, 1, 0, 0, -3133.15, 2585.913, 61.80721, 2.86234, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+26, 21788, 530, 0, 0, 1, 1, 0, 0, -3073.789, 2609.983, 61.81239, 1.117011, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+27, 21788, 530, 0, 0, 1, 1, 0, 0, -3163.902, 2579.588, 62.70355, 0.4886922, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+28, 21788, 530, 0, 0, 1, 1, 0, 0, -3144.146, 2617.151, 61.85558, 3.752458, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+29, 21788, 530, 0, 0, 1, 1, 0, 0, -2963.017, 2518.091, 78.19579, 0.1047198, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+30, 21788, 530, 0, 0, 1, 1, 0, 0, -2965.681, 2540.958, 76.62669, 4.45059, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+31, 21788, 530, 0, 0, 1, 1, 0, 0, -2977.325, 2574.976, 76.62669, 1.413717, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+32, 21788, 530, 0, 0, 1, 1, 0, 0, -2999.423, 2619.978, 76.7438, 1.658063, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+33, 21788, 530, 0, 0, 1, 1, 0, 0, -3046.553, 2641.27, 76.62669, 5.916666, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+34, 21788, 530, 0, 0, 1, 1, 0, 0, -3028.977, 2656.449, 77.04675, 4.206244, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+35, 21788, 530, 0, 0, 1, 1, 0, 0, -2945.421, 2632.53, 91.97811, 3.910418, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+36, 21788, 530, 0, 0, 1, 1, 0, 0, -2907.585, 2603.013, 93.76357, 2.426008, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+37, 21788, 530, 0, 0, 1, 1, 0, 0, -2903.634, 2615.304, 93.76357, 3.071779, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+38, 21788, 530, 0, 0, 1, 1, 0, 0, -2926.175, 2646.125, 93.73645, 3.682645, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+39, 21788, 530, 0, 0, 1, 1, 0, 0, -2932.268, 2652.535, 93.76186, 3.961897, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+(@CGUID+40, 21788, 530, 0, 0, 1, 1, 0, 0, -2939.042, 2675.208, 93.76357, 4.433136, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463); -- 21788 (Area: 3744) (Auras: 37509 - 37509)
+
+UPDATE `creature_template_addon` SET `bytes1`=65536, `bytes2`=1 WHERE `entry`=21788;
diff --git a/sql/updates/world/3.3.5/2016_04_26_00_world.sql b/sql/updates/world/3.3.5/2016_04_26_00_world.sql
new file mode 100644
index 00000000000..72201221944
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_26_00_world.sql
@@ -0,0 +1,9 @@
+--
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry` IN (33395,14031,22586,22585,14030,22584,14027,22583,14028,14029,22581,14026,33402,31878,33691,33942,34189,31462,37634,34153,39011,39012,39013,20654,31461,31670,33907,33906,33353,33352,34228,31875,30757,21584,34131,26337);
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|2 WHERE `entry`=30777;
+
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|130 WHERE `entry` IN (21625,31874);
+
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|256 WHERE `entry` IN (20596,20745);
+
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`&~1 WHERE `entry` IN (27309,27308,27307,27303);
diff --git a/sql/updates/world/3.3.5/2016_04_26_01_world.sql b/sql/updates/world/3.3.5/2016_04_26_01_world.sql
new file mode 100644
index 00000000000..2021a40a9e7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_26_01_world.sql
@@ -0,0 +1,57 @@
+SET @CGUID := 145160;
+
+DELETE FROM `creature` WHERE `id`=21795;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@CGUID+0, 21795, 530, 0, 0, 1, 1, 0, 0, -3942.646, 2125.487, 96.96626, 5.357957, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+1, 21795, 530, 0, 0, 1, 1, 0, 0, -3943.109, 2193.898, 102.1291, 3.368572, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+2, 21795, 530, 0, 0, 1, 1, 0, 0, -4037.24, 2260.579, 113.4364, 3.5118, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+3, 21795, 530, 0, 0, 1, 1, 0, 0, -4023.835, 2206.558, 109.6129, 4.895111, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+4, 21795, 530, 0, 0, 1, 1, 0, 0, -4030.965, 2168.763, 107.4985, 2.480213, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+5, 21795, 530, 0, 0, 1, 1, 0, 0, -3951.485, 2265.172, 99.24145, 2.606144, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+6, 21795, 530, 0, 0, 1, 1, 0, 0, -4042.551, 2183.728, 109.3237, 3.009561, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+7, 21795, 530, 0, 0, 1, 1, 0, 0, -3984.742, 2197.148, 102.0214, 4.5442, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+8, 21795, 530, 0, 0, 1, 1, 0, 0, -3956.684, 2233.825, 101.9551, 1.479018, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+9, 21795, 530, 0, 0, 1, 1, 0, 0, -4019.452, 2140.292, 104.274, 0.1288698, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+10, 21795, 530, 0, 0, 1, 1, 0, 0, -4006.475, 2120.42, 115.6417, 1.27439, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+11, 21795, 530, 0, 0, 1, 1, 0, 0, -3940.616, 2152.896, 100.4848, 2.463561, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+12, 21795, 530, 0, 0, 1, 1, 0, 0, -4053.673, 2245.217, 112.0474, 0.036458, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+13, 21795, 530, 0, 0, 1, 1, 0, 0, -3939.613, 2223.242, 101.9156, 3.891035, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+14, 21795, 530, 0, 0, 1, 1, 0, 0, -3973.463, 2119.737, 103.7858, 2.866639, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+15, 21795, 530, 0, 0, 1, 1, 0, 0, -3988.523, 2153.718, 104.368, 6.001884, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+16, 21795, 530, 0, 0, 1, 1, 0, 0, -4070.058, 2227.373, 113.4363, 3.759574, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+17, 21795, 530, 0, 0, 1, 1, 0, 0, -4075.326, 2180.252, 107.5067, 3.183229, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+18, 21795, 530, 0, 0, 1, 1, 0, 0, -4054.947, 2124.536, 137.2578, 2.750937, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+19, 21795, 530, 0, 0, 1, 1, 0, 0, -4087.524, 2167.491, 111.391, 5.241858, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+20, 21795, 530, 0, 0, 1, 1, 0, 0, -4089.124, 2203.606, 97.22453, 5.805306, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+21, 21795, 530, 0, 0, 1, 1, 0, 0, -4080.437, 2179.819, 100.2801, 5.450742, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+22, 21795, 530, 0, 0, 1, 1, 0, 0, -4092.307, 2185.567, 100.2807, 0.1027414, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+23, 21795, 530, 0, 0, 1, 1, 0, 0, -4092.907, 2184.13, 106.9471, 5.606272, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+24, 21795, 530, 0, 0, 1, 1, 0, 0, -3918.483, 2046.919, 95.28484, 6.051655, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+25, 21795, 530, 0, 0, 1, 1, 0, 0, -3913.848, 2107.107, 96.72884, 4.46708, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+26, 21795, 530, 0, 0, 1, 1, 0, 0, -3947.833, 2040.741, 95.10477, 1.199215, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+27, 21795, 530, 0, 0, 1, 1, 0, 0, -3915.87, 2102.719, 96.12863, 1.258105, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+28, 21795, 530, 0, 0, 1, 1, 0, 0, -3839.461, 2121.8, 94.53188, 4.859396, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+29, 21795, 530, 0, 0, 1, 1, 0, 0, -3862.718, 2217.159, 95.1391, 3.999115, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+30, 21795, 530, 0, 0, 1, 1, 0, 0, -3849.665, 2175.306, 95.58624, 3.913765, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+31, 21795, 530, 0, 0, 1, 1, 0, 0, -4053.544, 2279.983, 112.0487, 4.612492, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+32, 21795, 530, 0, 0, 1, 1, 0, 0, -4066.031, 2258.548, 94.8257, 1.571143, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+33, 21795, 530, 0, 0, 1, 1, 0, 0, -4054.627, 2277.048, 121.7723, 4.634171, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+34, 21795, 530, 0, 0, 1, 1, 0, 0, -4070.104, 2263.355, 112.0474, 5.739568, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+35, 21795, 530, 0, 0, 1, 1, 0, 0, -4084.999, 2245.3, 121.7718, 5.480127, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+36, 21795, 530, 0, 0, 1, 1, 0, 0, -4087.486, 2244.981, 112.0474, 2.109367, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+37, 21795, 530, 0, 0, 1, 1, 0, 0, -4073.188, 2267.943, 94.82581, 1.50432, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+38, 21795, 530, 0, 0, 1, 1, 0, 0, -4071.124, 2294.895, 110.6591, 0.204018, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+39, 21795, 530, 0, 0, 1, 1, 0, 0, -4101.815, 2259.789, 110.659, 4.624498, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+40, 21795, 530, 0, 0, 1, 1, 0, 0, -4075.109, 2296.344, 121.7728, 2.60921, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+41, 21795, 530, 0, 0, 1, 1, 0, 0, -4094.75, 2260.984, 103.9927, 0.0229529, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+42, 21795, 530, 0, 0, 1, 1, 0, 0, -4088.135, 2265.592, 103.9921, 3.303511, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+43, 21795, 530, 0, 0, 1, 1, 0, 0, -4087.79, 2283.696, 103.9927, 1.226644, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+44, 21795, 530, 0, 0, 1, 1, 0, 0, -4094.398, 2277.201, 112.0475, 1.09602, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+45, 21795, 530, 0, 0, 1, 1, 0, 0, -4071.222, 2290.098, 103.9934, 0.974121, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+46, 21795, 530, 0, 0, 1, 1, 0, 0, -3823.303, 2124.582, 93.3121, 5.473604, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+47, 21795, 530, 0, 0, 1, 1, 0, 0, -3982.052, 1996.922, 95.26698, 6.067729, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+48, 21795, 530, 0, 0, 1, 1, 0, 0, -3830.084, 2177.76, 93.64696, 5.581445, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+49, 21795, 530, 0, 0, 1, 1, 0, 0, -3821.952, 2218.491, 92.7454, 2.951487, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463), -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+(@CGUID+50, 21795, 530, 0, 0, 1, 1, 0, 0, -3856.967, 2241.917, 97.24121, 0.3141558, 120, 5, 0, 0, 0, 1, 0, 0, 0, 21463); -- 21795 (Area: 3745) (Auras: 37509 - 37509)
+
+UPDATE `creature_template_addon` SET `bytes1`=65536, `bytes2`=1 WHERE `entry`=21795;
diff --git a/sql/updates/world/3.3.5/2016_04_26_02_world.sql b/sql/updates/world/3.3.5/2016_04_26_02_world.sql
new file mode 100644
index 00000000000..4df837e0d8f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_26_02_world.sql
@@ -0,0 +1,16 @@
+--
+SET @ENTRY := 8035;
+-- Apply taunt sound effect instead of the Avatar of Hakkar's aggro sound
+UPDATE `creature_text` SET `sound`=3216 WHERE `entry` = @ENTRY AND `groupid` = 1 AND `id` = 0;
+-- Apply UNIT_FLAG_DISABLE_MOVE, UNIT_FLAG_PACIFIED, and UNIT_FLAG_DISARMED
+-- Extra OR's are for at-a-glance convenience
+UPDATE `creature_template` SET `unit_flags`= `unit_flags` | 4 | 131072 | 2097152 WHERE `Entry`= @ENTRY;
+-- Inserting an SAI event to make Dark Iron Land Mines not detonate prematurely.
+DELETE FROM `smart_scripts` WHERE `entryorguid` = @ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,1,0,100,3,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dark Iron Land Mine - Out of Combat - Say Line 0'),
+(@ENTRY,0,1,0,1,0,100,3,5000,5000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dark Iron Land Mine - Out of Combat - Say Line 1'),
+(@ENTRY,0,2,0,1,0,100,3,10000,10000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dark Iron Land Mine - Out of Combat - Say Line 2'),
+(@ENTRY,0,3,0,1,0,100,3,10000,10000,0,0,19,131072,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dark Iron Land Mine - Out of Combat - Remove Pacified Flag after 10s'),
+(@ENTRY,0,4,0,9,0,100,3,0,8,0,0,11,4043,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dark Iron Land Mine - Within 0-8 Range - Cast \'Detonation\''),
+(@ENTRY,0,5,0,9,0,100,3,0,8,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dark Iron Land Mine - Within 0-8 Range - Despawn Instant');
diff --git a/sql/updates/world/3.3.5/2016_04_26_03_world.sql b/sql/updates/world/3.3.5/2016_04_26_03_world.sql
new file mode 100644
index 00000000000..659006afcef
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_26_03_world.sql
@@ -0,0 +1,99 @@
+
+DELETE FROM creature WHERE `id` IN(24277,24516,24517);
+INSERT INTO creature (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(45211, 24277, 571, 0, 0, 1, 1, 0, 0, 2578.047, -3028.564, 115.3411, 0, 120, 0, 0, 0, 0, 2, 0, 0, 0, 21463), -- 24277 (Area: 4054) (Auras: )
+(114439, 24516, 571, 0, 0, 1, 1, 0, 0, 2245.904, -3021.815, 135.1308, 1.318242, 120, 0, 0, 0, 0, 2, 0, 0, 0, 21463), -- 24516 (Area: 0)
+(114637, 24517, 571, 0, 0, 1, 1, 0, 0, 1886.899, -3555.015, 147.7859, 2.676408, 120, 0, 0, 0, 0, 2, 0, 0, 0, 21463); -- 24517 (Area: 3999) (Auras: 52071 - 52071)
+
+DELETE FROM `waypoint_data` WHERE `id` IN(452110,1144390,1146370);
+
+INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
+(452110, 1, 2603.876, -3028.025, 117.0937, 0, 0, 0, 0, 100, 0),
+(452110, 2, 2643.243, -3014.203, 104.8926, 0, 0, 0, 0, 100, 0),
+(452110, 3, 2667.486, -3001.944, 99.91364, 0, 0, 0, 0, 100, 0),
+(452110, 4, 2686.615, -2995.257, 94.60037, 0, 0, 0, 0, 100, 0),
+(452110, 5, 2708.851, -2996.379, 92.56187, 0, 0, 0, 0, 100, 0),
+(452110, 6, 2731.851, -2997.098, 91.55309, 0, 0, 0, 0, 100, 0),
+(452110, 7, 2751.252, -3001.074, 89.84369, 0, 0, 0, 0, 100, 0),
+(452110, 8, 2779.356, -3012.149, 91.26218, 0, 0, 0, 0, 100, 0),
+(452110, 9, 2790.117, -3024.486, 94.64268, 0, 0, 0, 0, 100, 0),
+(452110, 10, 2793.189, -3046.271, 97.1767, 0, 0, 0, 0, 100, 0),
+(452110, 11, 2787.66, -3063.327, 99.79316, 0, 0, 0, 0, 100, 0),
+(452110, 12, 2768.723, -3078.092, 104.6359, 0, 0, 0, 0, 100, 0),
+(452110, 13, 2744.823, -3091.001, 111.5423, 0, 0, 0, 0, 100, 0),
+(452110, 14, 2725.268, -3106.576, 111.8766, 0, 0, 0, 0, 100, 0),
+(452110, 15, 2697.289, -3117.357, 110.0175, 0, 0, 0, 0, 100, 0),
+(452110, 16, 2671.67, -3121.725, 118.3925, 0, 0, 0, 0, 100, 0),
+(452110, 17, 2647.262, -3119.072, 123.8932, 0, 0, 0, 0, 100, 0),
+(452110, 18, 2621.482, -3114.164, 127.1552, 0, 0, 0, 0, 100, 0),
+(452110, 19, 2597.5, -3107.631, 127.1276, 0, 0, 0, 0, 100, 0),
+(452110, 20, 2562.354, -3115.057, 123.5328, 0, 0, 0, 0, 100, 0),
+(452110, 21, 2547.443, -3131.256, 128.2941, 0, 0, 0, 0, 100, 0),
+(452110, 22, 2537.48, -3152.528, 130.5185, 0, 0, 0, 0, 100, 0),
+(452110, 23, 2523.183, -3170.009, 137.3546, 0, 0, 0, 0, 100, 0),
+(452110, 24, 2499.98, -3176.15, 146.2999, 0, 0, 0, 0, 100, 0),
+(452110, 25, 2477.218, -3173.943, 146.8427, 0, 0, 0, 0, 100, 0),
+(452110, 26, 2466.798, -3181.938, 148.4451, 0, 0, 0, 0, 100, 0),
+(452110, 27, 2449.986, -3186.217, 148.8962, 0, 0, 0, 0, 100, 0),
+(452110, 28, 2435.967, -3212.301, 150.5083, 0, 0, 0, 0, 100, 0),
+(452110, 29, 2430.812, -3224.802, 150.1544, 0, 0, 0, 0, 100, 0),
+(452110, 30, 2427.15, -3236.885, 149.6805, 0, 0, 0, 0, 100, 0),
+(452110, 31, 2420.321, -3249.048, 148.5472, 0, 0, 0, 0, 100, 0),
+(452110, 32, 2403.638, -3257.211, 150.8997, 0, 0, 0, 0, 100, 0),
+(452110, 33, 2386.398, -3251.84, 150.9332, 0, 0, 0, 0, 100, 0),
+(452110, 34, 2376.512, -3235.288, 151.3786, 0, 0, 0, 0, 100, 0),
+(452110, 35, 2375.435, -3213.906, 154.4518, 0, 0, 0, 0, 100, 0),
+(452110, 36, 2368.87, -3195.879, 154.6864, 0, 0, 0, 0, 100, 0),
+(452110, 37, 2383.123, -3178.886, 155.935, 0, 0, 0, 0, 100, 0),
+(452110, 38, 2398.307, -3176.602, 155.8448, 0, 0, 0, 0, 100, 0),
+(452110, 39, 2412.706, -3183.355, 153.6713, 0, 0, 0, 0, 100, 0),
+(452110, 40, 2436.154, -3172.414, 148.4366, 0, 0, 0, 0, 100, 0),
+(452110, 41, 2439.1, -3152.812, 145.9067, 0, 0, 0, 0, 100, 0),
+(452110, 42, 2423.416, -3137.387, 147.4658, 0, 0, 0, 0, 100, 0),
+(452110, 43, 2420.221, -3122.801, 146.8984, 0, 0, 0, 0, 100, 0),
+(452110, 44, 2432.173, -3109.894, 147.6966, 0, 0, 0, 0, 100, 0),
+(452110, 45, 2443.513, -3098.615, 147.4875, 0, 0, 0, 0, 100, 0),
+(452110, 46, 2458.256, -3078.243, 142.1544, 0, 0, 0, 0, 100, 0),
+(452110, 47, 2475.883, -3064.164, 139.0425, 0, 0, 0, 0, 100, 0),
+(452110, 48, 2507.794, -3040.304, 124.8166, 0, 0, 0, 0, 100, 0),
+(452110, 49, 2531.649, -3026.078, 119.3878, 0, 0, 0, 0, 100, 0),
+(452110, 50, 2560.749, -3028.565, 114.5343, 0, 0, 0, 0, 100, 0),
+(452110, 51, 2582.748, -3028.564, 115.9288, 0, 0, 0, 0, 100, 0),
+(1144390, 1, 2261.844 , -2975.589 , 137.7219, 0, 0, 0, 0, 100, 0),
+(1144390, 2, 2288.57 , -2967.957 , 134.1304, 0, 0, 0, 0, 100, 0),
+(1144390, 3, 2312.078 , -2973.851 , 131.6859, 0, 0, 0, 0, 100, 0),
+(1144390, 4, 2327.24 , -2996.011 , 135.0435, 0, 0, 0, 0, 100, 0),
+(1144390, 5, 2319.611 , -3020.818 , 136.6337, 0, 0, 0, 0, 100, 0),
+(1144390, 6, 2293.551 , -3033.061 , 136.8072, 0, 0, 0, 0, 100, 0),
+(1144390, 7, 2270.958 , -3049.189 , 136.8092, 0, 0, 0, 0, 100, 0),
+(1144390, 8, 2261.982 , -3069.591 , 137.1458, 0, 0, 0, 0, 100, 0),
+(1144390, 9, 2244.48 , -3111.4 , 136.8513, 0, 0, 0, 0, 100, 0),
+(1144390, 10, 2234.337 , -3129.741 , 138.2859, 0, 0, 0, 0, 100, 0),
+(1144390, 11, 2205.15 , -3149.454 , 140.4617, 0, 0, 0, 0, 100, 0),
+(1144390, 12, 2178.708 , -3143.635 , 139.101, 0, 0, 0, 0, 100, 0),
+(1144390, 13, 2159.131 , -3118.843 , 139.0326, 0, 0, 0, 0, 100, 0),
+(1144390, 14, 2157.424 , -3090.945 , 138.6674, 0, 0, 0, 0, 100, 0),
+(1144390, 15, 2184.693 , -3076.778 , 137.7539, 0, 0, 0, 0, 100, 0),
+(1144390, 16, 2205.282 , -3067.448 , 138.6362, 0, 0, 0, 0, 100, 0),
+(1144390, 17, 2241.108 , -3040.399 , 136.0237, 0, 0, 0, 0, 100, 0),
+(1144390, 18, 2251.254 , -3001.044 , 135.3165, 0, 0, 0, 0, 100, 0),
+(1146370, 1, 1851.814 , -3531.93 , 143.9488, 0, 0, 0, 0, 100, 0),
+(1146370, 2, 1845.242 , -3513.312 , 143.5822, 0, 0, 0, 0, 100, 0),
+(1146370, 3, 1850.21 , -3485.009 , 141.7585, 0, 0, 0, 0, 100, 0),
+(1146370, 4, 1876.234 , -3453.859 , 139.5074, 0, 0, 0, 0, 100, 0),
+(1146370, 5, 1914.745 , -3432.741 , 140.1635, 0, 0, 0, 0, 100, 0),
+(1146370, 6, 1944.544 , -3444.092 , 139.0286, 0, 0, 0, 0, 100, 0),
+(1146370, 7, 1957.72 , -3473.06 , 139.4977, 0, 0, 0, 0, 100, 0),
+(1146370, 8, 1961.842 , -3512.568 , 142.8533, 0, 0, 0, 0, 100, 0),
+(1146370, 9, 1954.096 , -3543.72 , 147.4886, 0, 0, 0, 0, 100, 0),
+(1146370, 10, 1939.206 , -3558.753 , 147.6136, 0, 0, 0, 0, 100, 0),
+(1146370, 11, 1923.051 , -3563.351 , 147.5182, 0, 0, 0, 0, 100, 0),
+(1146370, 12, 1899.894 , -3561.537 , 147.5989, 0, 0, 0, 0, 100, 0),
+(1146370, 13, 1876.972 , -3550.032 , 147.9288, 0, 0, 0, 0, 100, 0);
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN(24516,24517);
+INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(24516, 1144390, 0, 0, 4097, 0, NULL),
+(24517, 1146370, 0, 0, 4097, 0, NULL);
+
+
diff --git a/sql/updates/world/3.3.5/2016_04_28_00_world.sql b/sql/updates/world/3.3.5/2016_04_28_00_world.sql
new file mode 100644
index 00000000000..377f019f899
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_28_00_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `creature_template` SET `ScriptName`="" WHERE `entry`=28033;
+UPDATE `creature_template` SET `ScriptName`="npc_the_etymidian" WHERE `entry`=28092;
diff --git a/sql/updates/world/3.3.5/2016_04_29_00_world.sql b/sql/updates/world/3.3.5/2016_04_29_00_world.sql
new file mode 100644
index 00000000000..14c700c0795
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_29_00_world.sql
@@ -0,0 +1,55 @@
+--
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=29796;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=29796 AND `source_type` = 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(29796,0,0,0,19,0,100,0,12886,0,0,0,85,55253,0,0,0,0,0,7,0,0,0,0,0,0,0,'Gretta the Arbiter - On quest accept - cast Spell');
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=29694 AND `source_type` = 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(29694, 0, 0, 0, 0, 0, 100, 0, 2000, 5000, 10000, 15000, 11, 32736, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Hyldsmeet Drakerider - In Combat - Cast 'Mortal Strike'"),
+(29694, 0, 1, 0, 6, 0, 100, 0, 0, 0, 0, 0, 33, 29800, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Hyldsmeet Drakerider - On Death - Kill credit Spell");
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `InhabitType`=4, `speed_run`=3.2 WHERE `entry` IN (29679);
+DELETE FROM `smart_scripts` WHERE `entryorguid`=29679 AND `source_type` = 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(29679, 0, 0, 0, 27, 0, 100, 0, 0, 0, 0, 0, 53, 1, 29679, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hyldsmeet Proto-Drake - ON PASSENGER_BOARDED - Start waypoint');
+
+DELETE FROM `creature_template_addon` WHERE `entry`=29679;
+INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(29679, 0, 0, 33554432, 0, 0, '55971');
+
+DELETE FROM `waypoints` WHERE `entry`=29679;
+INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
+(29679,1,6985.165039, -1662.842163, 868.941956, 'Hyldsmeet Proto-Drake'),
+(29679,2,6935.585449, -1516.853760, 968.493896, 'Hyldsmeet Proto-Drake'),
+(29679,3,6926.762207, -1282.424927, 1127.864380, 'Hyldsmeet Proto-Drake'),
+(29679,4,7365.684082, -644.429688, 1928.750610, 'Hyldsmeet Proto-Drake'),
+(29679,5,7388.145508, -652.783569, 1909.863647, 'Hyldsmeet Proto-Drake'),
+(29679,6,7439.698730, -661.380981, 1887.756714, 'Hyldsmeet Proto-Drake'),
+(29679,7,7494.946777, -650.403015, 1883.039795, 'Hyldsmeet Proto-Drake'),
+(29679,8,7548.416992, -601.006348, 1882.505737, 'Hyldsmeet Proto-Drake'),
+(29679,9,7575.110352, -541.134949, 1881.668701, 'Hyldsmeet Proto-Drake'),
+(29679,10,7550.558594, -458.574036, 1877.870972, 'Hyldsmeet Proto-Drake'),
+(29679,11,7482.576172, -404.054077, 1878.095581, 'Hyldsmeet Proto-Drake'),
+(29679,12,7390.999023, -404.312683, 1882.240234, 'Hyldsmeet Proto-Drake'),
+(29679,13,7324.988770, -455.605713, 1874.051270, 'Hyldsmeet Proto-Drake'),
+(29679,14,7289.477051, -552.180786, 1879.989258, 'Hyldsmeet Proto-Drake'),
+(29679,15,7332.199707, -623.493713, 1887.427734, 'Hyldsmeet Proto-Drake'),
+(29679,16,7367.857910, -647.534546, 1895.689453, 'Hyldsmeet Proto-Drake'),
+(29679,17,7388.145508, -652.783569, 1909.863647, 'Hyldsmeet Proto-Drake'),
+(29679,18,7439.698730, -661.380981, 1887.756714, 'Hyldsmeet Proto-Drake'),
+(29679,19,7494.946777, -650.403015, 1883.039795, 'Hyldsmeet Proto-Drake'),
+(29679,20,7548.416992, -601.006348, 1882.505737, 'Hyldsmeet Proto-Drake'),
+(29679,21,7575.110352, -541.134949, 1881.668701, 'Hyldsmeet Proto-Drake'),
+(29679,22,7550.558594, -458.574036, 1877.870972, 'Hyldsmeet Proto-Drake'),
+(29679,23,7482.576172, -404.054077, 1878.095581, 'Hyldsmeet Proto-Drake'),
+(29679,24,7390.999023, -404.312683, 1882.240234, 'Hyldsmeet Proto-Drake'),
+(29679,25,7324.988770, -455.605713, 1874.051270, 'Hyldsmeet Proto-Drake'),
+(29679,26,7289.477051, -552.180786, 1879.989258, 'Hyldsmeet Proto-Drake'),
+(29679,27,7332.199707, -623.493713, 1887.427734, 'Hyldsmeet Proto-Drake'),
+(29679,28,6926.762207, -1282.424927, 1127.864380, 'Hyldsmeet Proto-Drake'),
+(29679,29,6935.585449, -1516.853760, 968.493896, 'Hyldsmeet Proto-Drake'),
+(29679,30,6985.165039, -1662.842163, 868.941956, 'Hyldsmeet Proto-Drake'),
+(29679,31,6998.042969, -1664.234253, 867.953247, 'Hyldsmeet Proto-Drake'),
+(29679,32,7037.400879, -1725.409302, 838.695618, 'Hyldsmeet Proto-Drake'),
+(29679,33,7076.637695, -1770.263184, 825.775391, 'Hyldsmeet Proto-Drake');
diff --git a/sql/updates/world/3.3.5/2016_04_29_01_world.sql b/sql/updates/world/3.3.5/2016_04_29_01_world.sql
new file mode 100644
index 00000000000..c5b0311e1bc
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_04_29_01_world.sql
@@ -0,0 +1,5 @@
+DELETE FROM `vehicle_template_accessory` WHERE `entry`=29460;
+INSERT INTO `vehicle_template_accessory` (`entry`, `accessory_entry`, `seat_id`, `minion`, `description`, `summontype`, `summontimer`) VALUES
+(29460, 29458, 0, 1, "Brunnhildar Drakerider", 8, 0);
+
+UPDATE `npc_spellclick_spells` SET `spell_id`=46598 WHERE `npc_entry`=29460;
diff --git a/sql/updates/world/3.3.5/2016_05_01_00_world.sql b/sql/updates/world/3.3.5/2016_05_01_00_world.sql
new file mode 100644
index 00000000000..5a4d6c3197e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_01_00_world.sql
@@ -0,0 +1 @@
+DELETE FROM `trinity_string` WHERE `entry`=5007;
diff --git a/sql/updates/world/3.3.5/2016_05_01_01_world.sql b/sql/updates/world/3.3.5/2016_05_01_01_world.sql
new file mode 100644
index 00000000000..30096e55335
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_01_01_world.sql
@@ -0,0 +1,68 @@
+DELETE FROM `waypoints` WHERE `entry`=28308;
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(28308, 1, 5268.226 ,4425.439 ,-95.55899, 'Captive Crocolisk'),
+(28308, 2, 5249.557 ,4405.892 ,-96.04365, 'Captive Crocolisk'),
+(28308, 3, 5266.678 ,4365.464 ,-98.19455, 'Captive Crocolisk'),
+(28308, 4, 5289.138 ,4366.553 ,-102.234, 'Captive Crocolisk'),
+(28308, 5, 5330.018 ,4363.27 ,-121.0311, 'Captive Crocolisk'),
+(28308, 6, 5349.229 ,4341.059 ,-134.0126, 'Captive Crocolisk'),
+(28308, 7, 5365.038 ,4333.716 ,-141.5817, 'Captive Crocolisk'),
+(28308, 8, 5405.443 ,4307.841 ,-142.03, 'Captive Crocolisk'),
+(28308, 9, 5434.999 ,4305.659 ,-136.4706, 'Captive Crocolisk'),
+(28308, 10, 5464.708 ,4302.066 ,-133.1981, 'Captive Crocolisk'),
+(28308, 11, 5490.555 ,4294.395 ,-127.5203, 'Captive Crocolisk'),
+(28308, 12, 5503.808 ,4269.717 ,-110.3168, 'Captive Crocolisk'),
+(28308, 13, 5518.324 ,4255.308 ,-103.0638, 'Captive Crocolisk'),
+(28308, 14, 5540.53 ,4259.77 ,-102.3979, 'Captive Crocolisk'),
+(28308, 15, 5564.194 ,4263.45 ,-102.7574, 'Captive Crocolisk'),
+(28308, 16, 5585.45 ,4261.137 ,-99.54807, 'Captive Crocolisk'),
+(28308, 17, 5609.614 ,4259.657 ,-98.87333, 'Captive Crocolisk'),
+(28308, 18, 5633.434 ,4259.228 ,-98.53442, 'Captive Crocolisk'),
+(28308, 19, 5660.568 ,4260.985 ,-98.63537, 'Captive Crocolisk'),
+(28308, 20, 5681.639 ,4266.31 ,-99.26748, 'Captive Crocolisk'),
+(28308, 21, 5708.126 ,4273.348 ,-102.9183, 'Captive Crocolisk'),
+(28308, 22, 5748.732 ,4284.135 ,-112.0557, 'Captive Crocolisk'),
+(28308, 23, 5839.82 ,4368.61 ,-112.0805, 'Captive Crocolisk'),
+(28308, 24, 5897.276 ,4408.44 ,-95.25065, 'Captive Crocolisk'),
+(28308, 25, 5925.311 ,4440.624 ,-94.77592, 'Captive Crocolisk'),
+(28308, 26, 5953.005 ,4476.29 ,-94.3763, 'Captive Crocolisk'),
+(28308, 27, 5964.229 ,4503.729 ,-92.81553, 'Captive Crocolisk'),
+(28308, 28, 5960.583 ,4546.558 ,-95.65462, 'Captive Crocolisk'),
+(28308, 29, 5965.167 ,4579.141 ,-97.39779, 'Captive Crocolisk'),
+(28308, 30, 5969.295 ,4613.739 ,-98.05751, 'Captive Crocolisk'),
+(28308, 31, 5975.809 ,4659.289 ,-99.27143, 'Captive Crocolisk'),
+(28308, 32, 5992.961 ,4699.554 ,-99.30317, 'Captive Crocolisk'),
+(28308, 33, 6015.139 ,4743.752 ,-97.52377, 'Captive Crocolisk'),
+(28308, 34, 6035.183 ,4788.787 ,-94.66938, 'Captive Crocolisk'),
+(28308, 35, 6064.951 ,4827.502 ,-94.54885, 'Captive Crocolisk'),
+(28308, 36, 6065.57 ,4870.553 ,-94.47726, 'Captive Crocolisk'),
+(28308, 37, 6096.612 ,4885.741 ,-94.44479, 'Captive Crocolisk'),
+(28308, 38, 6120.387 ,4902.048 ,-95.06882, 'Captive Crocolisk'),
+(28308, 39, 6139.616 ,4913.349 ,-94.8635, 'Captive Crocolisk'),
+(28308, 40, 6141.208, 4914.293, -92.7175, 'Captive Crocolisk');
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `InhabitType`=4 WHERE `entry`=28307;
+UPDATE `smart_scripts` SET `link`=1 WHERE `entryorguid`=28298 AND `source_type`=0 AND `id`=0 AND `link`=0;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(28307,28308) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(28216) AND `source_type`=0 AND `id`>17;
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(28298) AND `source_type`=0 AND `id`=1;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(28216, 0, 18, 19, 38, 0, 100, 0, 1, 3, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Zepik the Gorloc Hunter - On Data Set 1 3 - Say Line 6'),
+(28216, 0, 19, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 3000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Zepik the Gorloc Hunter - On Data Set 1 3 - Despawn'),
+(28298, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 3, 0, 0, 0, 0, 19, 28216, 0, 0, 0, 0, 0, 0, 'Captive Crocolisk - On Gossip Option 0 Selected - Set Data on Zepik'),
+(28307, 0, 0, 0, 1, 0, 100, 0, 0, 0, 3000, 3000, 11, 51256, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Croclisk Chain Bunny - OOC - Cast Captive Crocolisk Chains'),
+(28308, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, 2830800, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Captive Crocolisk - On Just Summoned - Run Script (Phase 1) (No Repeat)'),
+(28308, 0, 1, 2, 40, 0, 100, 0, 39, 0, 0, 0, 11, 50630, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Captive Crocolisk - On reached WP42 - Cast Eject All Passengers'),
+(28308, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 15, 12536, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Captive Crocolisk - On reached WP42 - Quest Credit \'A Rough Ride\''),
+(28308, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 85, 52545, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Captive Crocolisk - On reached WP42 - Cast Forceitem Zepik'),
+(28308, 0, 4, 0, 40, 0, 100, 0, 40, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Captive Crocolisk - On reached WP43 - Despawn');
+
+DELETE FROM `creature_text` WHERE `entry`=28216 AND `groupid`=6;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(28216, 6, 0, 'Enjoy ride! Call me when you get there.', 12, 0, 100, 0, 0, 0, 28881, 0, 'Zepik');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=51256;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 51256, 0, 0, 31, 0, 3, 28298, 0, 0, 0, 0, '', 'Captive Crocolisk Chains targets captive crocolisk');
diff --git a/sql/updates/world/3.3.5/2016_05_02_00_world.sql b/sql/updates/world/3.3.5/2016_05_02_00_world.sql
new file mode 100644
index 00000000000..2063baf1ad7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_02_00_world.sql
@@ -0,0 +1,14 @@
+UPDATE `smart_scripts` SET `link`=5 WHERE `entryorguid`=28082 AND `source_type`=0 AND `id` IN(0,1) AND `link`=0;
+UPDATE `smart_scripts` SET `link`=6 WHERE `entryorguid`=28082 AND `source_type`=0 AND `id` IN(2,3) AND `link`=0;
+UPDATE `smart_scripts` SET `link`=7 WHERE `entryorguid`=28082 AND `source_type`=0 AND `id` IN(4) AND `link`=0;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=28082 AND `source_type`=0 AND `id` IN(5,6,7);
+DELETE FROM `smart_scripts` WHERE `entryorguid`=28027 AND `source_type`=0 AND `id` IN(9,10,11);
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(28082, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 85, 51186, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'High-Shaman Rakjak - Link - Cast Summon Goregek the Bristlepine Hunter'),
+(28082, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 85, 51188, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'High-Shaman Rakjak - Link - Cast Summon Dajik the Wasp Hunter'),
+(28082, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 85, 51189, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'High-Shaman Rakjak - Link - Cast Summon Zepik the Gorloc Hunter'),
+(28027, 0, 9, 0, 19, 0, 100, 0, 12571, 0, 0, 0, 85, 51190, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'High-Oracle Soo-say - On Quest Accept - Cast Summon Lafoo'),
+(28027, 0, 10, 0, 19, 0, 100, 0, 12574, 0, 0, 0, 85, 51191, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'High-Oracle Soo-say - On Quest Accept - Cast Summon Jaloot'),
+(28027, 0, 11, 0, 19, 0, 100, 0, 12578, 0, 0, 0, 85, 51192, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'High-Oracle Soo-say - On Quest Accept - Cast Summon Moodle');
diff --git a/sql/updates/world/3.3.5/2016_05_02_01_world.sql b/sql/updates/world/3.3.5/2016_05_02_01_world.sql
new file mode 100644
index 00000000000..1671abee38f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_02_01_world.sql
@@ -0,0 +1,18 @@
+-- Beaten Corpse (Mankrik's wife) in quest 4921 "Lost in Battle":
+UPDATE `creature_template` SET `gossip_menu_id`= 2871 WHERE `entry`= 10668;
+
+-- new gossip_menu.entry for creature 10668 (Beaten Corpse):
+DELETE FROM `gossip_menu` WHERE `entry` IN (2871,2872) AND `text_id` IN (3557,3558);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(2871, 3557),
+(2872, 3558);
+
+-- new gossip_menu_option for creature 10668 (Beaten Corpse):
+DELETE FROM `gossip_menu_option` WHERE `menu_id`= 2871 AND `OptionBroadcastTextID`= 5964;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(2871, 0, 0, 'I inspect the body further.', 5964, 1, 1, 2872, 0, 0, 0, '', 0);
+
+-- condition for gossip_menu_option 2871 in Quest ID 4921 "Lost in Battle":
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup`= 2871;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15, 2871,0, 0,0, 9,0, 4921, 0,0,0,0,0, '', 'Show gossip menu option 2871 only if Quest 4921 is taken (active)');
diff --git a/sql/updates/world/3.3.5/2016_05_04_00_world.sql b/sql/updates/world/3.3.5/2016_05_04_00_world.sql
new file mode 100644
index 00000000000..e4043768774
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_04_00_world.sql
@@ -0,0 +1 @@
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=70157 AND `spell_effect`=69700 AND `type`=2;
diff --git a/sql/updates/world/3.3.5/2016_05_04_01_world.sql b/sql/updates/world/3.3.5/2016_05_04_01_world.sql
new file mode 100644
index 00000000000..8a40bd66b2a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_04_01_world.sql
@@ -0,0 +1,69 @@
+SET @CGUID := 84723;
+
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`in(29066);
+
+DELETE FROM creature WHERE `id` IN(28069,28840);
+INSERT INTO creature (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@CGUID+0, 28069, 571, 0, 0, 1, 1, 0, 0, 5734.697, 3308.838, 299.8264, 1.867502, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: 0)
+(@CGUID+1, 28069, 571, 0, 0, 1, 1, 0, 0, 5728.474, 3438.191, 300.8422, 0.1060605, 120, 0, 0, 0, 0, 2, 0, 0, 0, 21463), -- 28069 (Area: 0)
+(@CGUID+2, 28069, 571, 0, 0, 1, 1, 0, 0, 5717.042, 3428.265, 300.9259, 1.797689, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: 0)
+(@CGUID+3, 28069, 571, 0, 0, 1, 1, 0, 0, 5697.737, 3426.803, 300.9259, 1.570796, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: 0)
+(@CGUID+4, 28069, 571, 0, 0, 1, 1, 0, 0, 5738.866, 3156.665, 293.8326, 4.814398, 120, 0, 0, 0, 0, 2, 0, 0, 0, 21463), -- 28069 (Area: -1) (Auras: )
+(@CGUID+5, 28069, 571, 0, 0, 1, 1, 0, 0, 5706.989, 3306.817, 299.718, 1.518436, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: 4412)
+(@CGUID+6, 28840, 571, 0, 0, 1, 1, 0, 0, 5737.756, 3273.594, 299.117, 2.794445, 120, 0, 0, 0, 0, 2, 0, 0, 0, 21463), -- 28840 (Area: 4412) (Auras: 55030 - 55030)
+(@CGUID+7, 28069, 571, 0, 0, 1, 1, 0, 0, 5752.529, 3141.505, 294.1674, 3.351032, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: 4412)
+(@CGUID+8, 28069, 571, 0, 0, 1, 1, 0, 0, 5728.323, 3137.707, 294.1627, 0.715585, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: 4412)
+(@CGUID+9, 28069, 571, 0, 0, 1, 1, 0, 0, 5737.385, 3051.348, 288.0696, 1.239184, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: -1)
+(@CGUID+10, 28069, 571, 0, 0, 1, 1, 0, 0, 5781.281, 3081.078, 288.0696, 3.089233, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: 4412)
+(@CGUID+11, 28069, 571, 0, 0, 1, 1, 0, 0, 5717.863, 3074.304, 288.0696, 0.4014257, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: 4412)
+(@CGUID+12, 28069, 571, 0, 0, 1, 1, 0, 0, 5767.666, 3052.907, 288.0696, 2.181662, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: 4412)
+(@CGUID+13, 28069, 571, 0, 0, 1, 1, 0, 0, 5704.075, 3429.402, 300.8421, 1.239184, 120, 0, 0, 0, 0, 2, 0, 0, 0, 21463); -- 28069 (Area: 4412)
+
+DELETE FROM `waypoint_data` WHERE `id` =(@CGUID*10)+1;
+DELETE FROM `waypoint_data` WHERE `id` =(@CGUID*10)+4;
+DELETE FROM `waypoint_data` WHERE `id` =(@CGUID*10)+6;
+DELETE FROM `waypoint_data` WHERE `id` =(@CGUID*10)+13;
+
+
+INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
+((@CGUID*10)+6, 1, 5712.777, 3273.745, 299.1278, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+6, 2, 5705.582, 3264.395, 299.1169, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+6, 3, 5704.035, 3252.411, 299.1169, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+6, 4, 5711.498, 3241.038, 299.117, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+6, 5, 5725.473, 3233.009, 299.1144, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+6, 6, 5738.392, 3238.95, 299.1152, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+6, 7, 5744.125, 3248.184, 299.1169, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+6, 8, 5747.937, 3262.18, 299.1169, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+6, 9, 5737.756, 3273.594, 299.117, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+6, 10, 5723.768, 3278.654, 299.138, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 1, 5737.638, 3168.66, 293.8326, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 2, 5734.833, 3190.47, 294.0836, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 3, 5733.381, 3205.572, 295.6976, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 4, 5734.833, 3190.47, 294.0836, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 5, 5737.638, 3168.66, 293.8326, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 6, 5739.323, 3152.199, 293.8326, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 7, 5742.777, 3128.636, 294.0135, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 8, 5744.988, 3100.412, 287.9503, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 9, 5746.909, 3085.88, 287.758, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 10, 5744.988, 3100.412, 287.9503, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 11, 5742.777, 3128.636, 294.0135, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+4, 12, 5739.323, 3152.199, 293.8326, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+1, 1, 5754.452, 3440.957, 300.8421, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+1, 2, 5721.435, 3437.441, 300.8421, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+1, 3, 5690.508, 3433.794, 300.8422, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+1, 4, 5655.392, 3430.241, 300.8421, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+1, 5, 5690.508, 3433.794, 300.8422, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+1, 6, 5721.435, 3437.441, 300.8421, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+13, 1, 5709.812, 3394.623, 300.8422, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+13, 2, 5713.209, 3367.164, 300.2528, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+13, 3, 5715.425, 3346.877, 300.0398, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+13, 4, 5718.081, 3324.582, 299.8054, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+13, 5, 5715.425, 3346.877, 300.0398, 0, 0, 0, 0, 100, 0),
+((@CGUID*10)+13, 6, 5713.209, 3367.164, 300.2528, 0, 0, 0, 0, 100, 0);
+
+DELETE FROM `creature_addon` WHERE `guid` IN(@CGUID+1,@CGUID+4,@CGUID+6,@CGUID+13);
+INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(@CGUID+1, (@CGUID*10)+1, 0, 0, 4097, 0, NULL),
+(@CGUID+4, (@CGUID*10)+4, 0, 0, 4097, 0, NULL),
+(@CGUID+6, (@CGUID*10)+6, 0, 0, 4097, 0, NULL),
+(@CGUID+13, (@CGUID*10)+13, 0, 0, 4097, 0, NULL);
diff --git a/sql/updates/world/3.3.5/2016_05_04_02_world.sql b/sql/updates/world/3.3.5/2016_05_04_02_world.sql
new file mode 100644
index 00000000000..4bb7870a4ea
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_04_02_world.sql
@@ -0,0 +1,2 @@
+UPDATE `quest_template_addon` SET `RewardMailTemplateID`=184, `RewardMailDelay`=900 WHERE `ID`=10966;
+UPDATE `quest_template_addon` SET `RewardMailTemplateID`=185, `RewardMailDelay`=900 WHERE `ID`=10967;
diff --git a/sql/updates/world/3.3.5/2016_05_05_00_world.sql b/sql/updates/world/3.3.5/2016_05_05_00_world.sql
new file mode 100644
index 00000000000..ba99f5df1a6
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_05_00_world.sql
@@ -0,0 +1,13 @@
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27292 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(27292, 0, 0, 1, 62, 0, 100, 0, 9512, 0, 0, 0, 11, 48606, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Flamebringer - On gossip select - Cast Summon Flamebringer Cue'),
+(27292, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Flamebringer - On gossip select - Close gossip'),
+(27292, 0, 2, 3, 54, 0, 100, 0, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flamebringer - On summon - Remove npcflag'),
+(27292, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48598, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Flamebringer - On Just Summoned -Cast Ride Flamebringer Cue'),
+(27292, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flamebringer - Linked with previous Event -Set Passive'),
+(27292, 0, 5, 6, 27, 0, 100, 0, 0, 0, 0, 0, 11, 48602, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flamebringer - On passenger Boarded - Cast Flight'),
+(27292, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flamebringer - On passenger Boarded - Enable Combat'),
+(27292, 0, 7, 8, 28, 0, 100, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flamebringer - On passenger removed - Evade'),
+(27292, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Flamebringer - On passenger removed - Despawn');
+
+UPDATE `creature_template_addon` SET `auras`='' WHERE `entry`=27292;
diff --git a/sql/updates/world/3.3.5/2016_05_05_01_world.sql b/sql/updates/world/3.3.5/2016_05_05_01_world.sql
new file mode 100644
index 00000000000..d1e0ebcadb0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_05_01_world.sql
@@ -0,0 +1,71 @@
+SET @CGUID := 10998;
+
+DELETE FROM creature WHERE `guid` IN(@CGUID,@CGUID+1);
+INSERT INTO creature (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@CGUID+0, 28139, 571, 0, 0, 1, 1, 0, 0, 5268.422, 4522.266, -83.79454, 4.956735, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463), -- 28069 (Area: 0)
+(@CGUID+1, 28139, 571, 0, 0, 1, 1, 0, 0, 5257.281, 4501.662, -85.16033, 0.296706, 120, 0, 0, 0, 0, 0, 0, 0, 0, 21463); -- 28069 (Area: 0)
+
+UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(29043,28139,29116);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(29043,28139,29116) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(-@CGUID,-@CGUID-1) AND `source_type`=0;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` =2904300 AND `source_type`=9;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(29043, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - On Spawn - Set Phase 1'),
+(29043, 0, 1, 0, 20, 1, 100, 0, 12758, 0, 0, 0, 80, 2904300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - On Quest Reward 12758 (Phase 1) - Run Script'),
+(29116, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 53170, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwatcher Head - On Just Summoned - Cast Ride Rejek'),
+(29116, 0, 1, 0, 38, 0, 100, 0, 1, 1, 0, 0, 28, 53170, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwatcher Head - On Data Set - Remove Aura Ride Rejek'),
+(-@CGUID-0, 0, 0, 1, 38, 0, 100, 0, 1, 1, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Data set - Set Visible'),
+(-@CGUID-1, 0, 0, 1, 38, 0, 100, 0, 1, 1, 0, 0, 47, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Data set - Set Visible'),
+(-@CGUID-0, 0, 1, 0, 61, 0, 100, 0, 1, 1, 0, 0, 53, 1, (@CGUID*10)+0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Data set - start WP'),
+(-@CGUID-1, 0, 1, 0, 61, 0, 100, 0, 1, 1, 0, 0, 53, 1, (@CGUID*10)+1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Data set - start WP'),
+(-@CGUID-0, 0, 3, 0, 40, 0, 100, 0, 2, (@CGUID*10)+0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Reached WP - Set Invisible'),
+(-@CGUID-1, 0, 3, 0, 40, 0, 100, 0, 2, (@CGUID*10)+1, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Reached WP - Set Invisible'),
+(-@CGUID-0, 0, 3, 4, 40, 0, 100, 0, 1, (@CGUID*10)+0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 5.585053, 'Frenzyheart Pup - On Reached WP - Set Orientation'),
+(-@CGUID-1, 0, 3, 4, 40, 0, 100, 0, 1, (@CGUID*10)+1, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 5.986479, 'Frenzyheart Pup - On Reached WP - Set Orientation'),
+(-@CGUID-0, 0, 4, 6, 61, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Reached WP - Say'),
+(-@CGUID-1, 0, 4, 6, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Reached WP - Say'),
+(-@CGUID-0, 0, 5, 0, 38, 0, 100, 0, 3, 3, 0, 0, 11, 42963, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Data set - Cast Cosmetic - Combat Knockdown Self'),
+(-@CGUID-1, 0, 5, 0, 38, 0, 100, 0, 3, 3, 0, 0, 11, 42963, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Data set - Cast Cosmetic - Combat Knockdown Self'),
+(-@CGUID-0, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 54, 22500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Reached WP - Pause WP'),
+(-@CGUID-1, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 54, 22500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Reached WP - Pause WP'),
+(-@CGUID-0, 0, 7, 0, 11, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Spawn - Set Invisible'),
+(-@CGUID-1, 0, 7, 0, 11, 0, 100, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frenzyheart Pup - On Spawn - Set Invisible'),
+(2904300, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script - Set Phase 2'), -- 16:44:29.469
+(2904300, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script - Say Line 0'), -- 16:44:31.812
+(2904300, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @CGUID+0, 28139, 0, 0, 0, 0, 0, 'Rejek - Script - Set Data'),
+(2904300, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, @CGUID+1, 28139, 0, 0, 0, 0, 0, 'Rejek - Script - Set Data'),
+(2904300, 9, 4, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script - Say Line 1'), -- 16:44:41.562
+(2904300, 9, 5, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 5.410521, 'Rejek - Script - Set Orientation'), -- 16:44:45.109
+(2904300, 9, 6, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script - Play emote OneShotAttackUnarmed'), -- 16:44:46.344
+(2904300, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 53171, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script - Cast Summon Stormwatcher Head'), -- 16:44:46.344
+(2904300, 9, 8, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 2.460914, 'Rejek - Script - Set Orientation'), -- 16:44:47.531
+(2904300, 9, 9, 0, 0, 0, 100, 0, 1500, 1500, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script - Say Line 2'), -- 16:44:48.844
+(2904300, 9, 10, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 45, 3, 3, 0, 0, 0, 0, 10, @CGUID+0, 28139, 0, 0, 0, 0, 0, 'Rejek - Script - Set Data'), -- 16:44:51.359
+(2904300, 9, 11, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 3, 3, 0, 0, 0, 0, 10, @CGUID+1, 28139, 0, 0, 0, 0, 0, 'Rejek - Script - Set Data'), -- 16:44:51.359
+(2904300, 9, 12, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, 28139, 0, 0, 0, 0, 0, 0, 'Rejek - Script - Say Line 2 on Frenzyheart Pup'), -- 16:44:51.359
+(2904300, 9, 13, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script - Say Line 3'), -- 16:44:57.312
+(2904300, 9, 14, 0, 0, 0, 100, 0, 9000, 9000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 29116, 0, 0, 0, 0, 0, 0, 'Rejek - Script - Say Line 3'), -- 16:45:06.937
+(2904300, 9, 15, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script - Set Phase 1');
+
+DELETE FROM `creature_text` WHERE `entry` IN(29043,28139);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(29043, 0, 0, 'Who wants to see Rejek''s new helmet?', 12, 0, 100, 1, 0, 0, 29460, 0, 'Rejek'),
+(29043, 1, 0, 'Ok, Rejek show!', 12, 0, 100, 1, 0, 0, 29463, 0, 'Rejek'),
+(29043, 2, 0, 'What you think?', 12, 0, 100, 1, 0, 0, 29464, 0, 'Rejek'),
+(29043, 3, 0, 'Rejek like! If helmet scares pups, Rejek can''t wait to see what it does to big-tongue cowards!', 12, 0, 100, 35, 0, 0, 29466, 0, 'Rejek'),
+(28139, 0, 0, 'I wanna see!', 12, 0, 100, 396, 0, 0, 29461, 0, 'Frenzyheart Pup'),
+(28139, 1, 0, 'Show me too!', 12, 0, 100, 1, 0, 0, 29462, 0, 'Frenzyheart Pup'),
+(28139, 2, 0, 'Metalhead ate Rejek! Run!', 12, 0, 100, 1, 0, 0, 29465, 0, 'Frenzyheart Pup');
+
+DELETE FROM `waypoints` WHERE `entry` IN((@CGUID*10)+0,(@CGUID*10)+1);
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+((@CGUID*10)+0, 1, 5267.188, 4506.771, -84.47479, 'Frenzyheart Pup'),
+((@CGUID*10)+0, 2, 5267.754, 4522.471, -83.85757, 'Frenzyheart Pup'),
+((@CGUID*10)+1, 1, 5264.369, 4503.333, -84.65268, 'Frenzyheart Pup'),
+((@CGUID*10)+1, 2, 5243.813, 4501.6, -84.7424, 'Frenzyheart Pup');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=53170;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 53170, 0, 0, 31, 0, 3, 29043, 0, 0, 0, 0, '', 'Ride Rejek');
diff --git a/sql/updates/world/3.3.5/2016_05_07_00_world.sql b/sql/updates/world/3.3.5/2016_05_07_00_world.sql
new file mode 100644
index 00000000000..41a35083921
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_07_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `smart_scripts` SET `action_param3`=1 WHERE `entryorguid`=3296 AND `source_type`=0 AND `id`=1;
diff --git a/sql/updates/world/3.3.5/2016_05_07_01_world.sql b/sql/updates/world/3.3.5/2016_05_07_01_world.sql
new file mode 100644
index 00000000000..1479c1bfba2
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_07_01_world.sql
@@ -0,0 +1,31 @@
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(29043) AND `source_type`=0 AND `id`>1;
+DELETE FROM `smart_scripts` WHERE `entryorguid` =2904301 AND `source_type`=9;
+DELETE FROM `creature_text` WHERE `entry` IN(29043) AND `groupid`>3;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(29043, 0, 2, 3, 20, 1, 100, 0, 12732, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Rejek - On Quest Reward 12732 (Phase 1) - Store Target'),
+(29043, 0, 3, 0, 61, 1, 100, 0, 0, 0, 0, 0, 80, 2904301, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - On Quest Reward 12732 (Phase 1) - Run Script 2'),
+(2904301, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script 2 - Set Phase 2'), -- 09:55:57.422
+(2904301, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script 2 - Say Line 4'), -- 09:56:00.703
+(2904301, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 5, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script 2 - Play Emote OneShotEat'), -- 09:56:05.469
+(2904301, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 52968, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script 2 - Cast Heartblood Rage'), -- 09:56:05.469
+(2904301, 9, 4, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script 2 - Say Line 5'), -- 09:56:07.891
+(2904301, 9, 5, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 5, 36, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script 2 - Play Emote OneShotAttack1H'), -- 09:56:11.578
+(2904301, 9, 6, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script 2 - Play Emote OneShotAttackUnarmed'), -- 09:56:13.984
+(2904301, 9, 7, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Rejek - Script 2 - Say Line 6'), -- 09:56:16.500
+(2904301, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Rejek - Script 2 - Set Phase 1');
+
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(29043, 4, 0, 'Still warm, just the way Rejek likes it.', 12, 0, 100, 1, 0, 0, 0, 0, 'Rejek'),
+(29043, 5, 0, 'Rejek feel strong! Rejek crush big-tongue skulls between his hands!', 12, 0, 100, 34, 0, 0, 0, 0, 'Rejek'),
+(29043, 6, 0, 'Rejek and $n will teach the enemies of the Frenzyheart to fear us!', 12, 0, 100, 53, 0, 0, 0, 0, 'Rejek');
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=2816100 AND `source_type`=9 AND `id`=0 AND `link`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=28161 AND `source_type`=0 AND `id`=4 AND `link`=0;
+UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=28161 AND `source_type`=0 AND `id`=0 AND `link`=4;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(4968) AND `source_type`=0 AND `id`=1;
+UPDATE `smart_scripts` SET `link`=1 WHERE `entryorguid`=4968 AND `source_type`=0 AND `id`=0 AND `link`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(4968, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 23122, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Lady Jaina Proudmoore - On Gossip Select - Cast Jaina''s Autograph');
diff --git a/sql/updates/world/3.3.5/2016_05_08_00_world.sql b/sql/updates/world/3.3.5/2016_05_08_00_world.sql
new file mode 100644
index 00000000000..cfbe1f6b9ad
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_08_00_world.sql
@@ -0,0 +1,11 @@
+SET @CGUID:=84737;
+
+-- Add missing Caravan Mule & Guard Didier <Brotherhood of the Light> spawns
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+5;
+INSERT INTO `creature` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `curhealth`) VALUES
+(@CGUID+0, 16232, 0, 2308.195, -5297.163, 82.0796, 1.780236, 120, 0), -- [65] Caravan Mule
+(@CGUID+1, 16232, 0, 2309.498, -5294.246, 82.07687, 1.727876, 120, 0), -- [66] Caravan Mule
+(@CGUID+2, 16232, 0, 2306.324, -5294.137, 82.07687, 1.815142, 120, 0), -- [67] Caravan Mule
+(@CGUID+3, 16232, 0, 2308.93, -5290.619, 82.10618, 1.797689, 120, 0), -- [68] Caravan Mule
+(@CGUID+4, 16232, 0, 2305.878, -5290.338, 82.33588, 1.832596, 120, 0), -- [69] Caravan Mule
+(@CGUID+5, 16226, 0, 2305.295, -5286.124, 82.02069, 4.834562, 120, 0); -- [70] Guard Didier <Brotherhood of the Light>
diff --git a/sql/updates/world/3.3.5/2016_05_09_00_world.sql b/sql/updates/world/3.3.5/2016_05_09_00_world.sql
new file mode 100644
index 00000000000..3c21ed52350
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_09_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature` SET `unit_flags` = 4104 WHERE `id` = 12430;
diff --git a/sql/updates/world/3.3.5/2016_05_09_01_world.sql b/sql/updates/world/3.3.5/2016_05_09_01_world.sql
new file mode 100644
index 00000000000..b75eb63dd2b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_09_01_world.sql
@@ -0,0 +1,21 @@
+DELETE FROM creature_text WHERE `entry` in(28116,28115);
+INSERT INTO creature_text (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES
+(28115, 0, 0, 'You feel a massive jolt of energy as your body binds with that of Soo-holu.', 42, 0, 100, 0, 0, 0, 29003, 'Soo-holu to Player'),
+(28116, 0, 0, 'You feel rage rise within you as your body binds with Kartak.', 42, 0, 100, 0, 0, 0, 29005, 'Kartak the Abominable to Player');
+
+UPDATE `creature_template` SET `spell1`=52316, `spell2`=52271, `spell3`=52311, `spell4`=52272, `spell5`=52274, `VehicleId`=257 WHERE `entry`=28116;
+UPDATE `creature_template` SET `spell1`=52331, `spell2`=52358, `spell3`=53032, `spell4`=52321, `spell5`=0, `VehicleId`=257 WHERE `entry`=28115;
+
+UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(28115,28116);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(28115,28116) AND `source_type`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(28115, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Soo-holu <Will of the Titans> - On Just Summoned - Set Passive'),
+(28115, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Soo-holu <Will of the Titans> - On Just Summoned - Say'),
+(28116, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kartak the Abominable - On Just Summoned - Set Passive'),
+(28116, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kartak the Abominable - On Just Summoned - Say');
+
+UPDATE `gameobject` SET `position_x`=5110.322754, `position_y`=5466.666504, `position_z`=-91.836319 WHERE `guid`=99745;
+UPDATE `creature_text` SET `BroadcastTextId`=29247 WHERE `entry`=29043 AND `groupid`=4 AND `id`=0;
+UPDATE `creature_text` SET `BroadcastTextId`=29248 WHERE `entry`=29043 AND `groupid`=5 AND `id`=0;
+UPDATE `creature_text` SET `BroadcastTextId`=29249 WHERE `entry`=29043 AND `groupid`=6 AND `id`=0;
diff --git a/sql/updates/world/3.3.5/2016_05_09_02_world.sql b/sql/updates/world/3.3.5/2016_05_09_02_world.sql
new file mode 100644
index 00000000000..968ac92561e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_09_02_world.sql
@@ -0,0 +1,41 @@
+UPDATE `creature_template` SET `ScriptName`='npc_rocket_propelled_warhead' WHERE `entry`=27593;
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_z_check', 'spell_vehicle_warhead_fuse', 'spell_warhead_detonate','spell_warhead_fuse');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(61678, 'spell_z_check'),
+(49107, 'spell_vehicle_warhead_fuse'),
+(49250, 'spell_warhead_detonate'),
+(49181, 'spell_warhead_fuse');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=49332;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13,1,49332,0,1,31,0,3,27702,0,0,0,0,'',"Spell 'Warhead Seeking Mine' can hit 'Horde Lumberboat'"),
+(13,1,49332,0,2,31,0,3,27688,0,0,0,0,'',"Spell 'Warhead Seeking Mine' can hit 'Alliance Lumberboat'");
+
+-- Warhead Explosion Bunny SAI
+UPDATE `creature_template` SET `InhabitType`=4, `AIName`='SmartAI' WHERE `entry`=27663;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27663 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(27663,0,0,0,54,0,100,0,0,0,0,0,11,49290,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warhead Explosion Bunny - Just Summoned - Cast \'Torpedo Explosion\'');
+
+-- Alliance Lumberboat Explosions SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=27689;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27689 AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=2768900 AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(27689,0,0,0,8,0,100,0,49290,0,0,0,80,2768900,0,0,0,0,0,1,0,0,0,0,0,0,0,'Alliance Lumberboat Explosions - On SpellHit \'Warhead Seeking Mine\' - Cast \'Horde Boat to Torpedo\''),
+(2768900,9,0,0,0,0,100,0,0,0,0,0,11,42344,0,0,0,0,0,1,0,0,0,0,0,0,0,'Alliance Lumberboat Explosions - ActionList - Cast \'Cosmetic - Flame Patch 0.5\''),
+(2768900,9,1,0,0,0,50,0,11000,11000,0,0,11,42345,0,0,0,0,0,1,0,0,0,0,0,0,0,'Alliance Lumberboat Explosions - ActionList - Cast \'Cosmetic - Flame Patch\''),
+(2768900,9,2,0,0,0,50,0,11000,11000,0,0,11,42346,0,0,0,0,0,1,0,0,0,0,0,0,0,'Alliance Lumberboat Explosions - ActionList - Cast \'Cosmetic - Flame Patch 2.0\'');
+
+-- Horde Lumberboat SAI
+UPDATE `creature_template` SET `InhabitType`=4, `AIName`='SmartAI' WHERE `entry`=27702;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27702 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(27702,0,0,0,8,0,100,0,49332,0,0,0,11,49372,0,0,0,0,0,9,27593,0,100,0,0,0,0,'Horde Lumberboat - On SpellHit \'Warhead Seeking Mine\' - Cast \'Horde Boat to Torpedo\'');
+
+-- Alliance Lumberboat SAI
+UPDATE `creature_template` SET `InhabitType`=4, `AIName`='SmartAI' WHERE `entry`=27688;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27688 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(27688,0,0,0,8,0,100,0,49332,0,0,0,11,49257,0,0,0,0,0,9,27593,0,100,0,0,0,0,'Alliance Lumberboat - On SpellHit \'Warhead Seeking Mine\' - Cast \'Alliance Boat to Torpedo\'');
diff --git a/sql/updates/world/3.3.5/2016_05_09_03_world.sql b/sql/updates/world/3.3.5/2016_05_09_03_world.sql
new file mode 100644
index 00000000000..149d829c9f7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_09_03_world.sql
@@ -0,0 +1,3 @@
+SET @MODIFIER := 50;
+UPDATE `creature_template` SET `mechanic_immune_mask`=617299839, `DamageModifier`=@MODIFIER WHERE `entry` IN (35403,35405);
+UPDATE `creature_template` SET `mechanic_immune_mask`=617299839, `ScriptName`='boss_ioc_horde_alliance' WHERE `entry` IN (34922,34924);
diff --git a/sql/updates/world/3.3.5/2016_05_09_04_world.sql b/sql/updates/world/3.3.5/2016_05_09_04_world.sql
new file mode 100644
index 00000000000..111b000efeb
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_09_04_world.sql
@@ -0,0 +1,41 @@
+UPDATE `creature_template` SET `unit_flags`=33554432, `flags_extra`=0 WHERE `entry`=25744;
+DELETE FROM `creature_summon_groups` WHERE `summonerId`=25741;
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN
+('spell_summon_blood_elves_script',
+'spell_muru_darkness',
+'spell_dark_fiend_skin',
+'spell_transform_visual_missile_periodic',
+'spell_summon_blood_elves_periodic');
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(46050,'spell_summon_blood_elves_script'),
+(45996,'spell_muru_darkness'),
+(45934,'spell_dark_fiend_skin'),
+(46205,'spell_transform_visual_missile_periodic'),
+(46041,'spell_summon_blood_elves_periodic');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (46208,46178);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition` ,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,46208,0,0,31,0,3,25741,0,0,0,'','Spell \'Transform Visual Missile\' targets M\'uru'),
+(13,1,46178,0,0,31,0,3,25741,0,0,0,'','Spell \'Transform Visual Missile\' targets M\'uru');
+
+UPDATE `creature_model_info` SET `BoundingRadius`=1, `CombatReach`=2 WHERE `DisplayID`=23842;
+UPDATE `creature_model_info` SET `BoundingRadius`=6, `CombatReach`=6 WHERE `DisplayID`=23428;
+UPDATE `creature_model_info` SET `BoundingRadius`=1, `CombatReach`=1.5 WHERE `DisplayID`=22471;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.48, `CombatReach`=11.2 WHERE `DisplayID`=22838;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.8893, `CombatReach`=2.5 WHERE `DisplayID`=23177;
+UPDATE `creature_model_info` SET `BoundingRadius`=6, `CombatReach`=15 WHERE `DisplayID`=23200;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.8893, `CombatReach`=2.5 WHERE `DisplayID`=23334;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.612, `CombatReach`=3 WHERE `DisplayID`=23350;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.75, `CombatReach`=3.75 WHERE `DisplayID`=23473;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.6, `CombatReach`=3 WHERE `DisplayID`=23474;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.6, `CombatReach`=3 WHERE `DisplayID`=23476;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.6, `CombatReach`=3 WHERE `DisplayID`=23477;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.6, `CombatReach`=3 WHERE `DisplayID`=23478;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.754676, `CombatReach`=3 WHERE `DisplayID`=23479;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.51705, `CombatReach`=2.025 WHERE `DisplayID`=23531;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.51705, `CombatReach`=2.025 WHERE `DisplayID`=23533;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.51705, `CombatReach`=2.025 WHERE `DisplayID`=23537;
+UPDATE `creature_model_info` SET `BoundingRadius`=1, `CombatReach`=1.5 WHERE `DisplayID`=23717;
+UPDATE `creature_model_info` SET `BoundingRadius`=3, `CombatReach`=4.5 WHERE `DisplayID`=26628;
+UPDATE `creature_model_info` SET `BoundingRadius`=0.25, `CombatReach`=0.375 WHERE `DisplayID`=29280;
diff --git a/sql/updates/world/3.3.5/2016_05_11_00_world.sql b/sql/updates/world/3.3.5/2016_05_11_00_world.sql
new file mode 100644
index 00000000000..9be7c8d3a0d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_11_00_world.sql
@@ -0,0 +1,33 @@
+--
+DELETE FROM `command` WHERE `name` IN ('server shutdown force','server restart force');
+INSERT INTO `command` (`name`,`permission`) VALUES ('server shutdown force', 839),('server restart force', 840);
+UPDATE `command` SET `help`="Syntax: .server shutdown [force] #delay [#exit_code] [reason]
+
+Shut the server down after #delay seconds. Use #exit_code or 0 as program exit code. Specify 'force' to allow short-term shutdown despite other players being connected." WHERE `name` IN ('server shutdown','server shutdown force');
+UPDATE `command` SET `help`="Syntax: .server restart [force] #delay [#exit_code] [reason]
+
+Restart the server after #delay seconds. Use #exit_code or 2 as program exit code. Specify 'force' to allow short-term shutdown despite other players being connected." WHERE `name` IN ('server restart','server restart force');
+
+
+DELETE FROM `command` WHERE `permission` IN (571,575);
+INSERT INTO `command` (`name`,`permission`,`help`) VALUES
+("npc add", 571, "Syntax: .npc add #entry
+ Spawn a creature using template #entry and save it to the database.
+ If you want a temporary spawn that is not saved to the database, use .npc add temp instead."),
+("npc add temp", 575, "Syntax: .npc add temp [loot/noloot] #entry
+Adds temporary NPC, not saved to database.
+ Specify 'loot' to have the NPC's corpse stick around for some time after death, allowing it to be looted.
+ Specify 'noloot' to have the corpse disappear immediately.");
+
+DELETE FROM `command` WHERE `permission`=837;
+INSERT INTO `command` (`name`,`permission`,`help`) VALUES ("npc evade",837,"Syntax: .npc evade [reason] [force]
+Makes the targeted NPC enter evade mode.\nDefaults to specifying EVADE_REASON_OTHER, override this by providing the reason string (ex.: .npc evade EVADE_REASON_BOUNDARY).\nSpecify 'force' to clear any pre-existing evade state before evading - this may cause weirdness, use at your own risk.");
+
+DELETE FROM `command` WHERE `permission`=838;
+INSERT INTO `command` (`name`,`permission`,`help`) VALUES ("pet level",838,"Syntax: .pet level #dLevel
+Increases/decreases the pet's level by #dLevel. Pet's level cannot exceed the owner's level.");
+
+DELETE FROM `trinity_string` WHERE `entry` IN (11015,11016);
+INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES
+(11015,"This creature does not have an active CreatureAI assigned to it."),
+(11016,"Select a player or player pet.");
diff --git a/sql/updates/world/3.3.5/2016_05_11_01_world.sql b/sql/updates/world/3.3.5/2016_05_11_01_world.sql
new file mode 100644
index 00000000000..95fa08ab742
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_11_01_world.sql
@@ -0,0 +1,16 @@
+ALTER TABLE `spell_proc`
+ CHANGE `spellId` `SpellId` int(11) NOT NULL DEFAULT 0 FIRST,
+ CHANGE `schoolMask` `SchoolMask` tinyint(3) unsigned NOT NULL DEFAULT 0 AFTER `SpellId`,
+ CHANGE `spellFamilyName` `SpellFamilyName` smallint(5) unsigned NOT NULL DEFAULT 0 AFTER `SchoolMask`,
+ CHANGE `spellFamilyMask0` `SpellFamilyMask0` int(10) unsigned NOT NULL DEFAULT 0 AFTER `SpellFamilyName`,
+ CHANGE `spellFamilyMask1` `SpellFamilyMask1` int(10) unsigned NOT NULL DEFAULT 0 AFTER `SpellFamilyMask0`,
+ CHANGE `spellFamilyMask2` `SpellFamilyMask2` int(10) unsigned NOT NULL DEFAULT 0 AFTER `SpellFamilyMask1`,
+ CHANGE `typeMask` `ProcFlags` int(10) unsigned NOT NULL DEFAULT 0 AFTER `SpellFamilyMask2`,
+ CHANGE `spellTypeMask` `SpellTypeMask` int(10) unsigned NOT NULL DEFAULT 0 AFTER `ProcFlags`,
+ CHANGE `spellPhaseMask` `SpellPhaseMask` int(10) unsigned NOT NULL DEFAULT 0 AFTER `SpellTypeMask`,
+ CHANGE `hitMask` `HitMask` int(10) unsigned NOT NULL DEFAULT 0 AFTER `SpellPhaseMask`,
+ CHANGE `attributesMask` `AttributesMask` int(10) unsigned NOT NULL DEFAULT 0 AFTER `HitMask`,
+ CHANGE `ratePerMinute` `ProcsPerMinute` float NOT NULL DEFAULT 0 AFTER `AttributesMask`,
+ CHANGE `chance` `Chance` float NOT NULL DEFAULT 0 AFTER `ProcsPerMinute`,
+ CHANGE `cooldown` `Cooldown` int(10) unsigned NOT NULL DEFAULT 0 AFTER `Chance`,
+ CHANGE `charges` `Charges` tinyint(3) unsigned NOT NULL DEFAULT 0 AFTER `Cooldown`;
diff --git a/sql/updates/world/3.3.5/2016_05_20_00_world.sql b/sql/updates/world/3.3.5/2016_05_20_00_world.sql
new file mode 100644
index 00000000000..67fc3e7a5d7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_20_00_world.sql
@@ -0,0 +1,37 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN
+('spell_mage_blazing_speed','spell_pri_blessed_recovery','spell_dru_forms_trinket','spell_dru_t9_feral_relic',
+'spell_sha_nature_guardian','spell_warl_nether_protection','spell_hun_piercing_shots','spell_hun_t9_4p_bonus',
+'spell_sha_lightning_shield','spell_dk_acclimation','spell_dk_advantage_t10_4p','spell_dk_improved_blood_presence_triggered',
+'spell_rog_t10_2p_bonus','spell_pal_illumination','spell_item_soul_preserver','spell_item_death_choice',
+'spell_item_lightning_capacitor','spell_item_thunder_capacitor','spell_item_toc25_normal_caster_trinket','spell_item_toc25_heroic_caster_trinket',
+'spell_igb_battle_experience_check','spell_gen_blood_reserve','spell_item_darkmoon_card_greatness',
+'spell_item_charm_witch_doctor','spell_item_mana_drain');
+
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(-49200, 'spell_dk_acclimation'), -- DK Acclimation
+(70656, 'spell_dk_advantage_t10_4p'), -- DK Advantage t10 4p melee
+(63611, 'spell_dk_improved_blood_presence_triggered'), -- DK Improved blood Presence Triggered
+(37336, 'spell_dru_forms_trinket'), -- Druid Forms Trinket
+(67353, 'spell_dru_t9_feral_relic'), -- Druid T9 Feral Relic (Idol of Mutilation)
+(64568, 'spell_gen_blood_reserve'), -- Blood Reserve (weapon enchant proc)
+(-53234, 'spell_hun_piercing_shots'), -- Hunter Piercing Shots
+(-67151, 'spell_hun_t9_4p_bonus'), -- Hunter T9 Bonus
+(71201, 'spell_igb_battle_experience_check'), -- Battle Experience (Gunship - ICC)
+(60510, 'spell_item_soul_preserver'), -- Soul Preserver
+(67702, 'spell_item_death_choice'), -- Death Choice Trinket
+(67771, 'spell_item_death_choice'), -- Death Choice Trinket
+(37657, 'spell_item_lightning_capacitor'), -- Lightning Capcitor
+(54841, 'spell_item_thunder_capacitor'), -- Thunder Capacitor
+(67712, 'spell_item_toc25_normal_caster_trinket'), -- Item - Coliseum 25 Normal Caster Trinket
+(67758, 'spell_item_toc25_heroic_caster_trinket'), -- Item - Coliseum 25 Heroic Caster Trinket
+(57345, 'spell_item_darkmoon_card_greatness'), -- Darkmoon Card: Greatness
+(43820, 'spell_item_charm_witch_doctor'), -- Charm of the Witch Doctor
+(27522, 'spell_item_mana_drain'), -- Mana Drain
+(40336, 'spell_item_mana_drain'), -- Mana Drain
+(-31641, 'spell_mage_blazing_speed'), -- Mage Blazing Speed
+(-20210, 'spell_pal_illumination'), -- Paladin Illumination (for Holy Shock)
+(-27811, 'spell_pri_blessed_recovery'), -- Priest Blessed Recovery
+(70805, 'spell_rog_t10_2p_bonus'), -- Rogue T10 2P bonus
+(-30881, 'spell_sha_nature_guardian'), -- Shaman Nature's Guardian
+(-324, 'spell_sha_lightning_shield'), -- Shaman Lightning Shield
+(-30299, 'spell_warl_nether_protection'); -- Warlock Nether protection
diff --git a/sql/updates/world/3.3.5/2016_05_23_00_world.sql b/sql/updates/world/3.3.5/2016_05_23_00_world.sql
new file mode 100644
index 00000000000..b2b9b9b0b34
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_23_00_world.sql
@@ -0,0 +1,225 @@
+SET @CGUID:=145211;
+
+-- Add missing creature spawns in Ghostlands & Eversong Woods
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+215;
+INSERT INTO `creature` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `curhealth`) VALUES
+(@CGUID+0 , 1420, 530, 6785.898, -7607.692, 128.1121, 3.815103, 120, 0), -- Toad
+(@CGUID+1 , 1420, 530, 6753.482, -7647.198, 128.3187, 3.793595, 120, 0), -- 1420 (Area: -1)
+(@CGUID+2 , 2914, 530, 6830.517, -7396.761, 46.36444, 2.204267, 120, 0), -- Snake
+(@CGUID+3 , 2914, 530, 6967.708, -7464.932, 47.05861, 1.433785, 120, 0), -- 2914 (Area: 3508)
+(@CGUID+4 , 2914, 530, 6764.093, -7363.276, 50.46708, 2.048597, 120, 0), -- 2914 (Area: 3517)
+(@CGUID+5 , 2914, 530, 6703.647, -7402.308, 51.60884, 5.743487, 120, 0), -- 2914 (Area: 3517)
+(@CGUID+6 , 2914, 530, 9898.549, -6844.095, 21.79119, 5.635744, 120, 0), -- 2914 (Area: 0)
+(@CGUID+7 , 2914, 530, 9200.372, -7787.419, 114.7875, 3.199877, 120, 0), -- 2914 (Area: 3480)
+(@CGUID+8 , 2914, 530, 9155.745, -7848.188, 106.3085, 5.677832, 120, 0), -- 2914 (Area: 3480) (possible waypoints or random movement)
+(@CGUID+9 , 2914, 530, 8850.941, -7711.045, 142.8265, 0.9482585, 120, 0), -- 2914 (Area: 0)
+(@CGUID+10 , 2914, 530, 8728.21, -7871.131, 167.5767, 3.596344, 120, 0), -- 2914 (Area: 3476)
+(@CGUID+11 , 2914, 530, 8637.07, -8030.312, 172.4991, 0.7605414, 120, 0), -- 2914 (Area: 3476) (possible waypoints or random movement)
+(@CGUID+12 , 2914, 530, 8105.803, -7868.944, 182.6229, 3.106677, 120, 0), -- 2914 (Area: 3476)
+(@CGUID+13 , 13321, 530, 6804.864, -7692.796, 123.9494, 1.613627, 120, 0), -- Frog
+(@CGUID+14 , 13321, 530, 7139.874, -6836.952, 42.78193, 3.004393, 120, 0), -- 13321 (Area: 0)
+(@CGUID+15 , 13321, 530, 6874.098, -6292.956, 28.83097, 2.986305, 120, 0), -- 13321 (Area: 0)
+(@CGUID+16 , 13321, 530, 6896.695, -6237.083, 27.97087, 3.193066, 120, 0), -- 13321 (Area: 0)
+(@CGUID+17 , 16355, 530, 6590.018, -6665.895, 47.47748, 3.028023, 120, 0), -- Lesser Scourgebat
+(@CGUID+18 , 16355, 530, 6615.374, -6649.544, 47.67059, 2.618959, 120, 0), -- 16355 (Area: 3861)
+(@CGUID+19 , 16355, 530, 6678.834, -6669.411, 46.41251, 2.527587, 120, 0), -- 16355 (Area: 3861)
+(@CGUID+20 , 16355, 530, 6751.53, -6650.502, 40.92892, 3.361847, 120, 0), -- 16355 (Area: 3861)
+(@CGUID+21 , 16355, 530, 6694.581, -6614.153, 42.82938, 1.788726, 120, 0), -- 16355 (Area: 3861)
+(@CGUID+22 , 16355, 530, 6746.584, -6637.266, 40.26681, 1.167443, 120, 0), -- 16355 (Area: 3861)
+(@CGUID+23 , 16355, 530, 6613.917, -6613.427, 45.56771, 1.741399, 120, 0), -- 16355 (Area: 0)
+(@CGUID+24 , 16355, 530, 6709.029, -6582.425, 38.43601, 3.079052, 120, 0), -- 16355 (Area: 0)
+(@CGUID+25 , 16355, 530, 6655.542, -6584.168, 47.69909, 1.860139, 120, 0), -- 16355 (Area: 0)
+(@CGUID+26 , 16355, 530, 6777.141, -6576.169, 22.53009, 2.004029, 120, 0), -- 16355 (Area: 5779)
+(@CGUID+27 , 16355, 530, 6820.745, -6629.127, 29.34797, 4.576158, 120, 0), -- 16355 (Area: 0)
+(@CGUID+28 , 16355, 530, 6913.5, -6392.067, 32.9911, 1.252754, 120, 0), -- 16355 (Area: 3514)
+(@CGUID+29 , 16355, 530, 6786.887, -6389.533, 33.69895, 1.401155, 120, 0), -- 16355 (Area: 3514)
+(@CGUID+30 , 16355, 530, 6834.158, -6266.923, 28.88157, 0.7696482, 120, 0), -- 16355 (Area: 0)
+(@CGUID+31 , 16355, 530, 6811.086, -6309.688, 32.27558, 6.07257, 120, 0), -- 16355 (Area: 0)
+(@CGUID+32 , 16355, 530, 6746.925, -6374.906, 38.59792, 0.9527051, 120, 0), -- 16355 (Area: 0)
+(@CGUID+33 , 16355, 530, 6743.388, -6254.041, 35.68666, 0.4505479, 120, 0), -- 16355 (Area: 0)
+(@CGUID+34 , 16352, 530, 6607.711, -7228.053, 47.55958, 2.182768, 120, 0), -- Greater Spindleweb
+(@CGUID+35 , 16352, 530, 6840.333, -6911.398, 80.30796, 5.87111, 120, 0), -- 16352 (Area: 0)
+(@CGUID+36 , 16352, 530, 6950.854, -6882.652, 51.16842, 4.52, 120, 0), -- 16352 (Area: 3506)
+(@CGUID+37 , 16352, 530, 6768.055, -6851.429, 87.48727, 5.528165, 120, 0), -- 16352 (Area: 0)
+(@CGUID+38 , 16352, 530, 6770.479, -6850.35, 87.49597, 3.62482, 120, 0), -- 16352 (Area: 0)
+(@CGUID+39 , 16352, 530, 6559.612, -6826.08, 105.455, 4.570914, 120, 0), -- 16352 (Area: 0)
+(@CGUID+40 , 16352, 530, 6601.431, -6767.694, 109.1149, 4.307267, 120, 0), -- 16352 (Area: 0)
+(@CGUID+41 , 16352, 530, 6599.975, -6751.242, 116.5198, 3.551486, 120, 0), -- 16352 (Area: 0)
+(@CGUID+42 , 16352, 530, 7008.281, -6705.673, 28.26144, 4.884287, 120, 0), -- 16352 (Area: 0)
+(@CGUID+43 , 16352, 530, 6871.393, -6317.614, 32.46682, 3.043771, 120, 0), -- 16352 (Area: 3514)
+(@CGUID+44 , 16352, 530, 6878.775, -6305.776, 31.08891, 5.672717, 120, 0), -- 16352 (Area: 3514)
+(@CGUID+45 , 16352, 530, 6843.483, -6281.33, 26.38034, 3.213944, 120, 0), -- 16352 (Area: 0)
+(@CGUID+46 , 16352, 530, 6876.344, -6120.826, 27.65071, 0.7722683, 120, 0), -- 16352 (Area: 0)
+(@CGUID+47 , 16352, 530, 6918.788, -6012.118, 16.0651, 0.2698549, 120, 0), -- 16352 (Area: 0)
+(@CGUID+48 , 16352, 530, 6780.824, -5914.694, 55.04383, 4.475933, 120, 0), -- 16352 (Area: 0)
+(@CGUID+49 , 16352, 530, 6833.493, -5866.168, 14.88271, 0.9358938, 120, 0), -- 16352 (Area: 0)
+(@CGUID+50 , 16352, 530, 6840.229, -5885.817, 18.84746, 0.9175394, 120, 0), -- 16352 (Area: 0)
+(@CGUID+51 , 16352, 530, 6880.296, -5831.833, 12.60031, 4.379216, 120, 0), -- 16352 (Area: 0)
+(@CGUID+52 , 16352, 530, 6921.029, -5888.282, 11.06036, 3.010598, 120, 0), -- 16352 (Area: 0)
+(@CGUID+53 , 16349, 530, 6889.151, -7353.237, 48.22483, 4.51504, 120, 0), -- Ghostclaw Ravager
+(@CGUID+54 , 16349, 530, 6842.837, -7303.427, 54.16766, 1.288876, 120, 0), -- 16349 (Area: 3517)
+(@CGUID+55 , 16349, 530, 6546.021, -7284.988, 56.26369, 1.260878, 120, 0), -- 16349 (Area: 3517)
+(@CGUID+56 , 16349, 530, 6679.54, -7225.896, 45.35223, 4.113977, 120, 0), -- 16349 (Area: 3517)
+(@CGUID+57 , 16349, 530, 6643.776, -7193.75, 54.53874, 0, 120, 0), -- 16349 (Area: 3517)
+(@CGUID+58 , 16349, 530, 6814.677, -6882.684, 88.09016, 2.293302, 120, 0), -- 16349 (Area: 0)
+(@CGUID+59 , 16349, 530, 6721.141, -6838.881, 103.265, 6.057627, 120, 0), -- 16349 (Area: 0)
+(@CGUID+60 , 16349, 530, 6697.734, -6834.776, 102.7457, 6.008372, 120, 0), -- 16349 (Area: 0)
+(@CGUID+61 , 16349, 530, 6650.794, -6857.804, 114.3118, 2.645206, 120, 0), -- 16349 (Area: 0)
+(@CGUID+62 , 16349, 530, 6848.059, -6343.108, 31.09843, 4.492753, 120, 0), -- 16349 (Area: 3514)
+(@CGUID+63 , 16349, 530, 6946.989, -6384.78, 39.4313, 4.954051, 120, 0), -- 16349 (Area: 3514)
+(@CGUID+64 , 16349, 530, 6912.969, -6363.86, 34.72787, 3.331182, 120, 0), -- 16349 (Area: 3514)
+(@CGUID+65 , 16349, 530, 6766.795, -6363.485, 39.13235, 0.5625338, 120, 0), -- 16349 (Area: 0)
+(@CGUID+66 , 16349, 530, 6946.226, -6247.874, 32.41405, 5.925901, 120, 0), -- 16349 (Area: 0)
+(@CGUID+67 , 16349, 530, 6788.563, -6065.623, 76.42849, 3.921466, 120, 0), -- 16349 (Area: 0)
+(@CGUID+68 , 16349, 530, 6792.339, -6061.395, 74.22968, 3.969122, 120, 0), -- 16349 (Area: 0)
+(@CGUID+69 , 16349, 530, 6810.644, -5954.92, 53.78344, 3.796812, 120, 0), -- 16349 (Area: 0)
+(@CGUID+70 , 16348, 530, 7063.472, -7130.528, 46.0153, 6.204991, 120, 0), -- Ghostclaw Lynx
+(@CGUID+71 , 16348, 530, 7284.161, -6991.957, 49.69464, 1.443535, 120, 0), -- 16348 (Area: 0)
+(@CGUID+72 , 16348, 530, 7213.42, -6959.183, 48.15844, 1.778343, 120, 0), -- 16348 (Area: 0)
+(@CGUID+73 , 16348, 530, 7250.096, -6969.17, 47.61874, 1.986341, 120, 0), -- 16348 (Area: 0)
+(@CGUID+74 , 16348, 530, 7050.619, -6915.433, 49.37156, 2.73385, 120, 0), -- 16348 (Area: 0)
+(@CGUID+75 , 16348, 530, 7451.216, -7814.882, 147.9057, 3.899374, 120, 0), -- 16348 (Area: 3516)
+(@CGUID+76 , 16348, 530, 7396.958, -7735.421, 126.7814, 2.59045, 120, 0), -- 16348 (Area: 3516)
+(@CGUID+77 , 16348, 530, 7340.802, -7687.29, 114.7227, 0.2125256, 120, 0), -- 16348 (Area: 3516)
+(@CGUID+78 , 16348, 530, 7183.236, -7268.509, 46.15837, 4.739726, 120, 0), -- 16348 (Area: -1)
+(@CGUID+79 , 16348, 530, 7229.547, -7256.011, 50.49553, 3.413854, 120, 0), -- 16348 (Area: -1)
+(@CGUID+80 , 16348, 530, 7087.505, -7228.648, 47.83735, 2.820592, 120, 0), -- 16348 (Area: -1)
+(@CGUID+81 , 16348, 530, 7216.22, -6980.535, 45.21544, 2.602345, 120, 0), -- 16348 (Area: -1)
+(@CGUID+82 , 16348, 530, 7314.215, -6966.182, 50.0986, 1.607889, 120, 0), -- 16348 (Area: 0)
+(@CGUID+83 , 16348, 530, 7330.698, -6964.013, 48.61691, 2.429726, 120, 0), -- 16348 (Area: 0)
+(@CGUID+84 , 16348, 530, 7381.186, -6840.756, 49.09549, 5.203093, 120, 0), -- 16348 (Area: 0)
+(@CGUID+85 , 16348, 530, 7338.635, -6880.206, 47.74126, 3.243301, 120, 0), -- 16348 (Area: 0)
+(@CGUID+86 , 16348, 530, 7245.959, -6846.432, 44.47991, 3.107588, 120, 0), -- 16348 (Area: 0)
+(@CGUID+87 , 16348, 530, 7271.94, -6770.036, 41.23086, 3.766337, 120, 0), -- 16348 (Area: 0)
+(@CGUID+88 , 16348, 530, 7214.612, -6826.908, 47.06087, 1.656858, 120, 0), -- 16348 (Area: 0)
+(@CGUID+89 , 16354, 530, 7076.276, -6972.893, 46.59879, 5.554435, 120, 0), -- Vampiric Mistbat
+(@CGUID+90 , 16354, 530, 7017.884, -6890.591, 51.47795, 0.1461384, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+91 , 16354, 530, 7113.623, -6924.28, 47.51407, 1.275599, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+92 , 16354, 530, 7120.204, -6986.206, 46.46815, 3.014331, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+93 , 16354, 530, 7042.884, -7063.796, 47.43617, 0.2345574, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+94 , 16354, 530, 7126.826, -6958.08, 46.08292, 1.337121, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+95 , 16354, 530, 7014.953, -7154.451, 44.05517, 4.580289, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+96 , 16354, 530, 7049.035, -7179.571, 44.51942, 2.854439, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+97 , 16354, 530, 7192.258, -6990.721, 45.789, 6.118358, 120, 0), -- 16354 (Area: 3493) (Auras: 29363 - 29363)
+(@CGUID+98 , 16354, 530, 7297.3, -6952.889, 48.22968, 0.04103268, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+99 , 16354, 530, 7256.268, -6915.919, 49.01978, 6.275373, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+100, 16354, 530, 7100.769, -6852.027, 48.50787, 3.594324, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+101, 16354, 530, 7115.031, -6797.596, 43.95771, 4.893901, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+102, 16354, 530, 7046.083, -6001.001, 5.373741, 1.707996, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+103, 16354, 530, 7657.632, -7820.115, 155.0192, 0.007812341, 120, 0), -- 16354 (Area: 5780) (Auras: 29363 - 29363)
+(@CGUID+104, 16354, 530, 7625.615, -7846.144, 163.4028, 4.013608, 120, 0), -- 16354 (Area: 5780) (Auras: 29363 - 29363)
+(@CGUID+105, 16354, 530, 7122.203, -7253.339, 46.5706, 5.714052, 120, 0), -- 16354 (Area: -1) (Auras: 29363 - 29363)
+(@CGUID+106, 16354, 530, 7217.567, -6982.356, 45.42596, 2.619296, 120, 0), -- 16354 (Area: -1) (Auras: 29363 - 29363)
+(@CGUID+107, 16354, 530, 7117.631, -7009.641, 45.96103, 1.385088, 120, 0), -- 16354 (Area: -1) (Auras: 29363 - 29363)
+(@CGUID+108, 16354, 530, 7166.285, -6976.54, 44.8732, 4.951204, 120, 0), -- 16354 (Area: -1) (Auras: 29363 - 29363)
+(@CGUID+109, 16354, 530, 7312.727, -6912.875, 50.63189, 4.525721, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+110, 16354, 530, 7320.769, -6873.548, 46.65247, 4.479732, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+111, 16354, 530, 7280.374, -6883.919, 46.72137, 2.94094, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+112, 16354, 530, 7311.557, -6785.887, 42.1341, 3.170881, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+113, 16354, 530, 7346.644, -6818.584, 45.92062, 3.949025, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+114, 16354, 530, 7288.737, -6849.499, 44.25882, 4.882647, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+115, 16354, 530, 7377.227, -6753.976, 31.68961, 0.03127035, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+116, 16354, 530, 7416.598, -6716.583, 28.30837, 0.7370265, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+117, 16354, 530, 7353.333, -6720.048, 30.60197, 2.399705, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+118, 16354, 530, 7259.75, -6787.555, 40.84682, 6.201098, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+119, 16354, 530, 7108.942, -6779.335, 39.96529, 5.709267, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+120, 16354, 530, 7133.71, -6917.99, 50.83417, 2.893063, 120, 0), -- 16354 (Area: 0) (Auras: 29363 - 29363)
+(@CGUID+121, 16405, 530, 6988.21, -5644.906, -3.24633, 3.193715, 120, 0), -- Whitetail Frenzy (fishy!)
+(@CGUID+122, 16405, 530, 7185.634, -5581.585, -7.89854, 1.237991, 120, 0), -- 16405 (Area: 3455) (possible waypoints or random movement)
+(@CGUID+123, 16405, 530, 7125.062, -5516.672, -5.845787, 0.05448707, 120, 0), -- 16405 (Area: 3455)
+(@CGUID+124, 16405, 530, 7250.163, -5645.383, -4.686822, 1.609466, 120, 0), -- 16405 (Area: 3455) (possible waypoints or random movement)
+(@CGUID+125, 16405, 530, 7251.583, -5518.657, -14.82046, 5.090523, 120, 0), -- 16405 (Area: 3455)
+(@CGUID+126, 16405, 530, 7319, -5583.684, -5.345567, 4.631339, 120, 0), -- 16405 (Area: 3455)
+(@CGUID+127, 16405, 530, 7385.255, -5514.504, -23.83957, 4.482534, 120, 0), -- 16405 (Area: 3455)
+(@CGUID+128, 16404, 530, 7453.585, -5582.35, -4.679311, 1.291544, 120, 0), -- Yellowgill Frenzy (fishy!)
+(@CGUID+129, 16404, 530, 7650.671, -5514.592, -49.15406, 0.4712389, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+130, 16404, 530, 7584.502, -5583.413, -24.85344, 3.455752, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+131, 16404, 530, 7583.759, -5452.181, -46.03991, 2.70526, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+132, 16404, 530, 7714.01, -5449.991, -64.69885, 5.61996, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+133, 16404, 530, 7646.778, -5386.804, -65.33501, 3.752458, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+134, 16404, 530, 7782.522, -5520.318, -25.0596, 2.251475, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+135, 16404, 530, 7851.458, -5451.522, -47.55369, 0.6981317, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+136, 16404, 530, 7916.752, -5518.634, -40.62648, 0.08726646, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+137, 16404, 530, 7981.461, -5584.885, -4.679321, 2.984513, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+138, 16404, 530, 7981.47, -5453.279, -45.36422, 2.443461, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+139, 16404, 530, 8049.632, -5517.96, -25.7112, 5.201081, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+140, 16404, 530, 8116.961, -5448.617, -46.06174, 0.6981317, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+141, 16404, 530, 8115.655, -5582.934, -4.67935, 3.071779, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+142, 16404, 530, 8181.515, -5517.779, -21.47383, 3.996804, 120, 0), -- 16404 (Area: 3455)
+(@CGUID+143, 33712, 530, 8581.657, -5615.35, -1.142317, 1.903857, 120, 0), -- Golden Crawler
+(@CGUID+144, 33712, 530, 8504.382, -5543.861, -1.478864, 3.13378, 120, 0), -- 33712 (Area: 3460)
+(@CGUID+145, 33712, 530, 8514.937, -5619.518, -0.04902005, 2.168977, 120, 0), -- 33712 (Area: 3460)
+(@CGUID+146, 33712, 530, 8415.799, -5584.587, -1.309665, 0, 120, 0), -- 33712 (Area: 3460)
+(@CGUID+147, 33712, 530, 8332.279, -5641.95, -1.466211, 2.25529, 120, 0), -- 33712 (Area: 3460)
+(@CGUID+148, 33712, 530, 8283.341, -5648.665, -1.085784, 0, 120, 0), -- 33712 (Area: 3460)
+(@CGUID+149, 33712, 530, 8282.833, -5682.408, 1.912665, 1.05757, 120, 0), -- 33712 (Area: 3460)
+(@CGUID+150, 33712, 530, 8293.516, -5772.522, 0.8719814, 5.366834, 120, 0), -- 33712 (Area: 3460)
+(@CGUID+151, 33712, 530, 8308.861, -5862.752, 0.241255, 6.083331, 120, 0), -- 33712 (Area: 3460)
+(@CGUID+152, 33712, 530, 9197.843, -5831.596, -1.436119, 3.801267, 120, 0), -- 33712 (Area: 3911)
+(@CGUID+153, 33712, 530, 9354.067, -5992.446, 0.5006291, 4.806949, 120, 0), -- 33712 (Area: 3911)
+(@CGUID+154, 33712, 530, 9355.795, -6054.746, -10.57742, 5.58345, 120, 0), -- 33712 (Area: 3911)
+(@CGUID+155, 15372, 530, 10655.46, -6208.573, 44.35903, 3.352107, 120, 0), -- 15372 (Area: 3431)
+(@CGUID+156, 15372, 530, 10664.23, -6132.04, 28.6685, 2.430012, 120, 0), -- 15372 (Area: 3431)
+(@CGUID+157, 15372, 530, 10680.05, -6169.8, 39.0421, 1.041597, 120, 0), -- 15372 (Area: 3431)
+(@CGUID+158, 721, 530, 8518.23, -5731.495, 13.00602, 3.633779, 120, 0), -- Rabbit
+(@CGUID+159, 721, 530, 8639.186, -5761.18, 11.46758, 3.938846, 120, 0), -- 721 (Area: 3460)
+(@CGUID+160, 721, 530, 8778.733, -5847.375, 7.75886, 4.726789, 120, 0), -- 721 (Area: 3460)
+(@CGUID+161, 721, 530, 8984.896, -5983.854, 19.71628, 4.000124, 120, 0), -- 721 (Area: 3911)
+(@CGUID+162, 721, 530, 9145.909, -5946.4, 28.77039, 2.019282, 120, 0), -- 721 (Area: 3911)
+(@CGUID+163, 721, 530, 9231.008, -6160.386, 25.5099, 0.5819958, 120, 0), -- 721 (Area: 3911)
+(@CGUID+164, 721, 530, 9452.181, -7939.893, 11.60837, 3.357151, 120, 0), -- 721 (Area: 3472)
+(@CGUID+165, 721, 530, 9438.168, -7889.708, 21.39819, 2.464021, 120, 0), -- 721 (Area: 3472)
+(@CGUID+166, 721, 530, 9396.646, -7802.477, 55.43135, 0.6543702, 120, 0), -- 721 (Area: 3480)
+(@CGUID+167, 4075, 530, 6658.765, -6295.493, 29.20658, 2.160989, 120, 0), -- Rat
+(@CGUID+168, 4075, 530, 7113.27, -5958.493, 12.98514, 1.957865, 120, 0), -- 4075 (Area: 0)
+(@CGUID+169, 4075, 530, 7308.667, -5989.029, 16.2368, 2.572109, 120, 0), -- 4075 (Area: 3491)
+(@CGUID+170, 15649, 530, 10060.82, -6872.714, 24.29431, 4.285359, 120, 0), -- Feral Dragonhawk Hatchling
+(@CGUID+171, 15651, 530, 8653.924, -5784.069, 18.15051, 3.120111, 120, 0), -- Springpaw Stalker
+(@CGUID+172, 15651, 530, 10048.03, -6717.27, 31.03372, 4.651473, 120, 0), -- 15651 (Area: 3533)
+(@CGUID+173, 15651, 530, 10116.2, -7079.959, 11.65078, 5.202464, 120, 0), -- 15651 (Area: 0)
+(@CGUID+174, 15651, 530, 10119.57, -7117.229, 11.13619, 5.610377, 120, 0), -- 15651 (Area: 0)
+(@CGUID+175, 15651, 530, 10245.07, -7154.263, 5.379348, 3.824573, 120, 0), -- 15651 (Area: 0)
+(@CGUID+176, 15651, 530, 10312.5, -7285.686, 10.4436, 3.958998, 120, 0), -- 15651 (Area: 0)
+(@CGUID+177, 15651, 530, 0155.74, -7315.172, 46.89272, 1.747505, 120, 0), -- 15651 (Area: 0)
+(@CGUID+178, 15651, 530, 10212.78, -7312.304, 43.83004, 2.297004, 120, 0), -- 15651 (Area: 0)
+(@CGUID+179, 15651, 530, 10120.49, -7380.654, 41.25549, 3.739351, 120, 0), -- 15651 (Area: 0)
+(@CGUID+180, 15651, 530, 10222.12, -7377.514, 42.6799, 6.21672, 120, 0), -- 15651 (Area: 0)
+(@CGUID+181, 15651, 530, 10287.61, -7510.908, 45.47846, 4.328416, 120, 0), -- 15651 (Area: 0)
+(@CGUID+182, 15651, 530, 10307.25, -7600.326, 27.67019, 1.3225, 120, 0), -- 15651 (Area: 0)
+(@CGUID+183, 15651, 530, 10261.34, -7483.148, 64.01847, 4.310963, 120, 0), -- 15651 (Area: 0)
+(@CGUID+184, 15651, 530, 10222.87, -7613.924, 61.70162, 2.482553, 120, 0), -- 15651 (Area: 0)
+(@CGUID+185, 15650, 530, 10279.31, -7324.253, 33.49329, 4.19599, 120, 0), -- Crazed Dragonhawk
+(@CGUID+186, 15650, 530, 10192.26, -7320.828, 45.92649, 5.882011, 120, 0), -- 15650 (Area: 0) (Auras: 29119 - 29119)
+(@CGUID+187, 15650, 530, 10171.51, -7404.468, 48.17466, 5.125631, 120, 0), -- 15650 (Area: 0) (Auras: 29119 - 29119)
+(@CGUID+188, 15650, 530, 10225.49, -7453.733, 75.07253, 4.820997, 120, 0), -- 15650 (Area: 0) (Auras: 29119 - 29119)
+(@CGUID+189, 15650, 530, 10095.22, -7399.66, 33.8582, 1.982334, 120, 0), -- 15650 (Area: 0) (Auras: 29119 - 29119)
+(@CGUID+190, 15650, 530, 10089.92, -7352.991, 24.48084, 3.473843, 120, 0), -- 15650 (Area: 0) (Auras: 29119 - 29119)
+(@CGUID+191, 15650, 530, 10304.47, -7592.876, 23.93329, 4.038411, 120, 0), -- 15650 (Area: 0) (Auras: 29119 - 29119)
+(@CGUID+192, 15650, 530, 9840.896, -7878.327, 39.42878, 0.1114382, 120, 0), -- 15650 (Area: 3472) (Auras: 29119 - 29119)
+(@CGUID+193, 15650, 530, 9008.495, -8056.905, 185.9688, 1.125495, 120, 0), -- 15650 (Area: 0) (Auras: 29119 - 29119)
+(@CGUID+194, 15650, 530, 9009.816, -7833.289, 159.5567, 4.887175, 120, 0), -- 15650 (Area: 0) (Auras: 29119 - 29119)
+(@CGUID+195, 15650, 530, 9015.15, -7667.337, 140.8466, 4.705554, 120, 0), -- 15650 (Area: 0) (Auras: 29119 - 29119)
+(@CGUID+196, 15650, 530, 8824.381, -7819.187, 175.3332, 3.444827, 120, 0), -- 15650 (Area: 0) (Auras: 29119 - 29119)
+(@CGUID+197, 15650, 530, 8785.419, -7913.549, 175.9667, 0.7577809, 120, 0), -- 15650 (Area: 3476) (Auras: 29119 - 29119)
+(@CGUID+198, 15650, 530, 8848.306, -7942.777, 220.488, 5.064994, 120, 0), -- 15650 (Area: 3476) (Auras: 29119 - 29119)
+(@CGUID+199, 15650, 530, 8333.768, -8008.462, 206.4037, 2.313344, 120, 0), -- 15650 (Area: 3476) (Auras: 29119 - 29119)
+(@CGUID+200, 15650, 530, 8269.027, -8019.356, 224.7379, 5.511599, 120, 0), -- 15650 (Area: 3476) (Auras: 29119 - 29119)
+(@CGUID+201, 15650, 530, 8213.844, -7896.639, 190.6529, 2.801, 120, 0), -- 15650 (Area: 3476) (Auras: 29119 - 29119)
+(@CGUID+202, 15650, 530, 8216.283, -7952.173, 209.498, 1.65485, 120, 0), -- 15650 (Area: 3476) (Auras: 29119 - 29119)
+(@CGUID+203, 16541, 530, 7244.089, -7125.762, 61.12453, 0.4067548, 120, 0), -- Ghostlands Guardian
+(@CGUID+204, 16541, 530, 7182.639, -7079.073, 56.25724, 2.565634, 120, 0), -- 16541 (Area: 0)
+(@CGUID+205, 16541, 530, 7168.553, -7095.772, 56.25724, 2.426008, 120, 0), -- 16541 (Area: 0)
+(@CGUID+206, 14881, 530, 6908.589, -7112.601, 45.76462, 0.250855, 120, 0), -- Spider
+(@CGUID+207, 14881, 530, 7087.832, -7109.549, 46.94461, 3.255385, 120, 0), -- 14881 (Area: 0)
+(@CGUID+208, 14881, 530, 6913.161, -6316.999, 33.59887, 5.188184, 120, 0), -- 14881 (Area: 3514)
+(@CGUID+209, 14881, 530, 7177.549, -7263.504, 45.25873, 4.996254, 120, 0), -- 14881 (Area: -1) (possible waypoints or random movement)
+(@CGUID+210, 14881, 530, 7295.609, -7026.236, 48.24609, 0.2017749, 120, 0), -- 14881 (Area: -1) (possible waypoints or random movement)
+(@CGUID+211, 14881, 530, 7120.973, -6668.307, 45.87799, 1.187052, 120, 0), -- 14881 (Area: 0)
+(@CGUID+212, 33713, 530, 6896.669, -5765.082, -2.75388, 1.12993, 120, 0), -- 33713 (Area: 0)
+(@CGUID+213, 33713, 530, 6853.869, -5738.312, -9.519895, 1.390244, 120, 0), -- 33713 (Area: 0)
+(@CGUID+214, 33713, 530, 7173.716, -5696.389, -4.92298, 4.901935, 120, 0), -- 33713 (Area: 3491)
+(@CGUID+215, 33713, 530, 7336.688, -5723.884, 0.3463151, 6.180531, 120, 0); -- 33713 (Area: 3491)
+
+-- Update movement
+UPDATE `creature` SET `spawndist`=15, `MovementType`=1 WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+215;
+UPDATE `creature` SET `spawndist`=0, `MovementType`=0 WHERE `guid` IN (@CGUID+203, @CGUID+204, @CGUID+205, @CGUID+206);
diff --git a/sql/updates/world/3.3.5/2016_05_24_00_world.sql b/sql/updates/world/3.3.5/2016_05_24_00_world.sql
new file mode 100644
index 00000000000..b07a3288642
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_24_00_world.sql
@@ -0,0 +1,14 @@
+SET @OGUID:=85056;
+
+-- Add missing objects spawns in Ghostlands & Eversong Woods
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+8;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0, 191460, 530, 1, 1, 6947.801, -7648.626, 131.9498, 0.2191041, 0, 0, 0.1093339, 0.9940051, 120, 255, 1), -- 191460 (Area: -1) -- Bonfire
+(@OGUID+1, 181326, 530, 1, 1, 6772.437, -7350.587, 48.96166, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181326 (Area: 3517) -- Bonfire
+(@OGUID+2, 191460, 530, 1, 1, 6663.345, -7398.321, 57.63737, 2.111147, 0, 0, 0.8701838, 0.4927272, 120, 255, 1), -- 191460 (Area: 3517) -- Bonfire
+(@OGUID+3, 181327, 530, 1, 1, 6610.271, -7352.757, 54.1082, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181327 (Area: 3517) -- Cauldron
+(@OGUID+4, 181362, 530, 1, 1, 6773.446, -7150.986, 48.90046, 3.141534, 0, 0, 0, 1, 120, 255, 1), -- 181362 (Area: 0) -- Campfire
+(@OGUID+5, 181352, 530, 1, 1, 6785.604, -7192.486, 25.77958, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181352 (Area: 0) -- Campfire
+(@OGUID+6, 181319, 530, 1, 1, 7150.752, -6823.163, 43.91896, 3.141326, 0, 0, 0, 1, 120, 255, 1), -- 181319 (Area: 0) -- Campfire
+(@OGUID+7, 191460, 530, 1, 1, 7410.167, -7966.508, 161.3317, 2.984498, 0, 0, 0.9969173, 0.07845911, 120, 255, 1), -- 191460 (Area: 3516) -- Bonfire
+(@OGUID+8, 191460, 530, 1, 1, 7274.042, -7768.146, 150.1007, 0.7679439, 0, 0, 0.3746067, 0.9271838, 120, 255, 1); -- 191460 (Area: 3516) -- Bonfire
diff --git a/sql/updates/world/3.3.5/2016_05_24_01_world.sql b/sql/updates/world/3.3.5/2016_05_24_01_world.sql
new file mode 100644
index 00000000000..58ac4b0a40e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_24_01_world.sql
@@ -0,0 +1,5 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dru_eclipse';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(-48516, 'spell_dru_eclipse');
+
+UPDATE `spell_proc_event` SET `Cooldown`=0 WHERE `entry`=-48516; -- set cooldown to 0, handled by a script
diff --git a/sql/updates/world/3.3.5/2016_05_25_00_world.sql b/sql/updates/world/3.3.5/2016_05_25_00_world.sql
new file mode 100644
index 00000000000..401f374d81a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_25_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `spell_script_names` SET `spell_id`=67151 WHERE (`ScriptName`='spell_hun_t9_4p_bonus');
diff --git a/sql/updates/world/3.3.5/2016_05_25_01_world_335.sql b/sql/updates/world/3.3.5/2016_05_25_01_world_335.sql
new file mode 100644
index 00000000000..603e8921a69
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_25_01_world_335.sql
@@ -0,0 +1,592 @@
+RENAME TABLE `game_graveyard_zone` TO `graveyard_zone`;
+ALTER TABLE `graveyard_zone` CHANGE `id` `ID` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
+ALTER TABLE `graveyard_zone` CHANGE `ghost_zone` `GhostZone` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0';
+ALTER TABLE `graveyard_zone` CHANGE `faction` `Faction` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0';
+ALTER TABLE `graveyard_zone` ADD COLUMN `Comment` TEXT AFTER `Faction`;
+
+UPDATE `command` SET `help`='Syntax: .reload all area\n\nReload areatrigger_teleport, areatrigger_tavern, graveyard_zone tables.' WHERE `permission`=613;
+UPDATE `command` SET `name`='reload graveyard_zone', `help`='Syntax: .reload graveyard_zone\nReload graveyard_zone table.' WHERE `permission`=645;
+
+UPDATE `graveyard_zone` SET `Comment`='Redridge Mountains - Redridge Mountains' WHERE `ID`=2;
+UPDATE `graveyard_zone` SET `Comment`='Duskwood, Darkshire - Duskwood' WHERE `ID`=3;
+UPDATE `graveyard_zone` SET `Comment`='Westfall, Sentinel Hill GY - Westfall' WHERE `ID`=4;
+UPDATE `graveyard_zone` SET `Comment`='Loch Modan, Thelsamar - Loch Modan' WHERE `ID`=6;
+UPDATE `graveyard_zone` SET `Comment`='Wetlands, Crossroads GY' WHERE `ID`=7;
+UPDATE `graveyard_zone` SET `Comment`='Badlands, Graveyard NE' WHERE `ID`=8;
+UPDATE `graveyard_zone` SET `Comment`='The Barrens, The Crossroads - Northern Barrens' WHERE `ID`=10;
+UPDATE `graveyard_zone` SET `Comment`='Desolace, Ethel Rethor GY' WHERE `ID`=31;
+UPDATE `graveyard_zone` SET `Comment`='Durotar, Razor Hill GY' WHERE `ID`=32;
+UPDATE `graveyard_zone` SET `Comment`='Mulgore, Red Cloud Mesa GY - Mulgore' WHERE `ID`=34;
+UPDATE `graveyard_zone` SET `Comment`='Darkshore, New Auberdine GY - Darkshore' WHERE `ID`=35;
+UPDATE `graveyard_zone` SET `Comment`='Deadwind Pass, Morgan''s Plot' WHERE `ID`=36;
+UPDATE `graveyard_zone` SET `Comment`='Silithus, Valor''s Rest - Silithus' WHERE `ID`=70;
+UPDATE `graveyard_zone` SET `Comment`='Mulgore, Bloodhoof Village GY - Mulgore' WHERE `ID`=89;
+UPDATE `graveyard_zone` SET `Comment`='Teldrassil, Darnassus GY' WHERE `ID`=90;
+UPDATE `graveyard_zone` SET `Comment`='Teldrassil, Dolanaar GY - Teldrassil' WHERE `ID`=91;
+UPDATE `graveyard_zone` SET `Comment`='Ashenvale, Astranaar GY - Ashenvale' WHERE `ID`=92;
+UPDATE `graveyard_zone` SET `Comment`='Teldrassil, Aldrassil GY - Teldrassil' WHERE `ID`=93;
+UPDATE `graveyard_zone` SET `Comment`='Tirisfal Glades, Deathknell - Tirisfal Glades' WHERE `ID`=94;
+UPDATE `graveyard_zone` SET `Comment`='Tirisfal Glades, Undercity' WHERE `ID`=96;
+UPDATE `graveyard_zone` SET `Comment`='Silverpine Forest, The Sepulcher - Silverpine Forest' WHERE `ID`=97;
+UPDATE `graveyard_zone` SET `Comment`='Hillsbrad Foothills, Tarren Mill - Hillsbrad Foothills' WHERE `ID`=98;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Highlands, Eastern Road - Arathi Highlands' WHERE `ID`=99;
+UPDATE `graveyard_zone` SET `Comment`='Dun Morogh, Anvilmar - Dun Morogh' WHERE `ID`=100;
+UPDATE `graveyard_zone` SET `Comment`='Dun Morogh, Kharanos' WHERE `ID`=101;
+UPDATE `graveyard_zone` SET `Comment`='Badlands, Kargath - Badlands' WHERE `ID`=103;
+UPDATE `graveyard_zone` SET `Comment`='Redridge Mountains, Lakeshire' WHERE `ID`=104;
+UPDATE `graveyard_zone` SET `Comment`='Elwynn Forest, Northshire - Elwynn Forest' WHERE `ID`=105;
+UPDATE `graveyard_zone` SET `Comment`='Elwynn Forest, Goldshire - Elwynn Forest' WHERE `ID`=106;
+UPDATE `graveyard_zone` SET `Comment`='Elwynn Forest, Stormwind' WHERE `ID`=107;
+UPDATE `graveyard_zone` SET `Comment`='Swamp of Sorrows, Stonard GY' WHERE `ID`=108;
+UPDATE `graveyard_zone` SET `Comment`='Stranglethorn Vale, Booty Bay GY - Stranglethorn Vale' WHERE `ID`=109;
+UPDATE `graveyard_zone` SET `Comment`='Teldrassil, Rut''theran Village GY - Teldrassil' WHERE `ID`=129;
+UPDATE `graveyard_zone` SET `Comment`='Hillsbrad Foothills, Southshore' WHERE `ID`=149;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Valley, Snowfall Graveyard (Mid) - Alterac Valley' WHERE `ID`=169;
+UPDATE `graveyard_zone` SET `Comment`='Dustwallow Marsh, Theramore Isle GY - Dustwallow Marsh' WHERE `ID`=189;
+UPDATE `graveyard_zone` SET `Comment`='Tanaris, Gadgetzan GY' WHERE `ID`=209;
+UPDATE `graveyard_zone` SET `Comment`='The Barrens, Camp Taurajo GY - Southern Barrens' WHERE `ID`=229;
+UPDATE `graveyard_zone` SET `Comment`='The Barrens, Ratchet' WHERE `ID`=249;
+UPDATE `graveyard_zone` SET `Comment`='Tirisfal Glades, Brill - Tirisfal Glades' WHERE `ID`=289;
+UPDATE `graveyard_zone` SET `Comment`='Feralas, New Feathermoon Stronghold GY (A) - Feralas' WHERE `ID`=309;
+UPDATE `graveyard_zone` SET `Comment`='Feralas, Camp Mojache GY (H) - Feralas' WHERE `ID`=310;
+UPDATE `graveyard_zone` SET `Comment`='Thousand Needles, Splithoof Heights GY (MOVED) - Thousand Needles' WHERE `ID`=329;
+UPDATE `graveyard_zone` SET `Comment`='The Hinterlands, Aerie Peak - The Hinterlands' WHERE `ID`=349;
+UPDATE `graveyard_zone` SET `Comment`='Azshara, Northern Azshara GY - Azshara' WHERE `ID`=369;
+UPDATE `graveyard_zone` SET `Comment`='Blasted Lands, Dreadmaul Hold GY - Blasted Lands' WHERE `ID`=370;
+UPDATE `graveyard_zone` SET `Comment`='Blasted Lands, Dreadmaul Hold GY - Swamp of Sorrows' WHERE `ID`=370;
+UPDATE `graveyard_zone` SET `Comment`='Stranglethorn Vale, Northern Stranglethorn GY - Stranglethorn Vale' WHERE `ID`=389;
+UPDATE `graveyard_zone` SET `Comment`='Stonetalon Mountains, Webwinder Path GY - Stonetalon Mountains' WHERE `ID`=409;
+UPDATE `graveyard_zone` SET `Comment`='Felwood, Morlos''Aran - Felwood' WHERE `ID`=449;
+UPDATE `graveyard_zone` SET `Comment`='Un''Goro Crater, The Marshlands - Un''Goro Crater' WHERE `ID`=450;
+UPDATE `graveyard_zone` SET `Comment`='Darkshore, Twilight Vale GY' WHERE `ID`=469;
+UPDATE `graveyard_zone` SET `Comment`='Wetlands, Baradin Bay GY - Wetlands' WHERE `ID`=489;
+UPDATE `graveyard_zone` SET `Comment`='Western Plaguelands, Chillwind Camp - Western Plaguelands' WHERE `ID`=509;
+UPDATE `graveyard_zone` SET `Comment`='Eastern Plaguelands, Pestilent Scar - Eastern Plaguelands' WHERE `ID`=510;
+UPDATE `graveyard_zone` SET `Comment`='Winterspring, Everlook GY - Winterspring' WHERE `ID`=511;
+UPDATE `graveyard_zone` SET `Comment`='Ashenvale, Kargathia GY' WHERE `ID`=512;
+UPDATE `graveyard_zone` SET `Comment`='Programmer Isle - Programmer Isle' WHERE `ID`=529;
+UPDATE `graveyard_zone` SET `Comment`='Western Plaguelands, Bulwark' WHERE `ID`=569;
+UPDATE `graveyard_zone` SET `Comment`='Azshara, (Overlooks) The Shattered Strand GY - Azshara' WHERE `ID`=609;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Valley, Horde Safe - Alterac Valley' WHERE `ID`=610;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Valley, Alliance Safe - Alterac Valley' WHERE `ID`=611;
+UPDATE `graveyard_zone` SET `Comment`='TEST for GM Client Only - Do Not Bug - Tirisfal Glades' WHERE `ID`=629;
+UPDATE `graveyard_zone` SET `Comment`='Azshara, Bitter Reaches GY - Azshara' WHERE `ID`=630;
+UPDATE `graveyard_zone` SET `Comment`='Dustwallow Marsh, Brackenwall Village GY - Dustwallow Marsh' WHERE `ID`=631;
+UPDATE `graveyard_zone` SET `Comment`='Moonglade GY - Moonglade' WHERE `ID`=633;
+UPDATE `graveyard_zone` SET `Comment`='Eastern Plaguelands, Darrowshire - Eastern Plaguelands' WHERE `ID`=634;
+UPDATE `graveyard_zone` SET `Comment`='Felwood, Irontree Woods - Felwood' WHERE `ID`=635;
+UPDATE `graveyard_zone` SET `Comment`='Searing Gorge, Thorium Point - Searing Gorge' WHERE `ID`=636;
+UPDATE `graveyard_zone` SET `Comment`='Durotar, Sen''jin Village GY - Durotar' WHERE `ID`=649;
+UPDATE `graveyard_zone` SET `Comment`='Programmer Isle, Bucklers Cemetery 2 - Programmer Isle' WHERE `ID`=669;
+UPDATE `graveyard_zone` SET `Comment`='Programmer Isle, Bucklers Cemetery 1 - Programmer Isle' WHERE `ID`=670;
+UPDATE `graveyard_zone` SET `Comment`='Programmer Isle, Bucklers Cemetery 3 - Programmer Isle' WHERE `ID`=671;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Valley, Stormpike Graveyard (Hi) - Alterac Valley' WHERE `ID`=689;
+UPDATE `graveyard_zone` SET `Comment`='Durotar, Valley of Trials GY - Durotar' WHERE `ID`=709;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Valley, PvP Alliance Choke Graveyard (A-choke) - Alterac Valley' WHERE `ID`=729;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Valley, PvP Horde Choke Graveyard (H-choke) - Alterac Valley' WHERE `ID`=749;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Valley, Frostwolf Relief Hut (H-base) - Alterac Valley' WHERE `ID`=750;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Valley, Stormpike Aid Station (A-base) - Alterac Valley' WHERE `ID`=751;
+UPDATE `graveyard_zone` SET `Comment`='Warsong Gulch - Alliance Enter Loc - Warsong Gulch' WHERE `ID`=769;
+UPDATE `graveyard_zone` SET `Comment`='Warsong Gulch - Horde Enter Loc - Warsong Gulch' WHERE `ID`=770;
+UPDATE `graveyard_zone` SET `Comment`='Warsong Gulch - Alliance Rez Loc - Warsong Gulch' WHERE `ID`=771;
+UPDATE `graveyard_zone` SET `Comment`='Warsong Gulch - Horde Rez Loc - Warsong Gulch' WHERE `ID`=772;
+UPDATE `graveyard_zone` SET `Comment`='The Hinterlands, The Overlook Cliffs - The Hinterlands' WHERE `ID`=789;
+UPDATE `graveyard_zone` SET `Comment`='Warsong Gulch - Horde Exit Loc - Warsong Gulch' WHERE `ID`=809;
+UPDATE `graveyard_zone` SET `Comment`='Warsong Gulch - Alliance Exit Loc - Warsong Gulch' WHERE `ID`=810;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Valley, Alliance Exit' WHERE `ID`=829;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Valley, Horde Exit - Alterac Valley' WHERE `ID`=830;
+UPDATE `graveyard_zone` SET `Comment`='Feralas, Dire Maul Stonemaul Hold GY - Feralas' WHERE `ID`=849;
+UPDATE `graveyard_zone` SET `Comment`='Durotar, Northern Durotar GY' WHERE `ID`=850;
+UPDATE `graveyard_zone` SET `Comment`='Mulgore, Thunder Bluff GY' WHERE `ID`=851;
+UPDATE `graveyard_zone` SET `Comment`='Dun Morogh, Gates of Ironforge - Dun Morogh' WHERE `ID`=852;
+UPDATE `graveyard_zone` SET `Comment`='Elwynn Forest, Eastvale Logging Camp' WHERE `ID`=854;
+UPDATE `graveyard_zone` SET `Comment`='Western Plaguelands, Caer Darrow - Western Plaguelands' WHERE `ID`=869;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Horde Entrance - Arathi Basin' WHERE `ID`=889;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Alliance Entrance - Arathi Basin' WHERE `ID`=890;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Horde Exit - Arathi Basin' WHERE `ID`=891;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Alliance Exit - Arathi Basin' WHERE `ID`=892;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Graveyard, H-Mid (Farm) - Arathi Basin' WHERE `ID`=893;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Graveyard, Mid (Blacksmith) - Arathi Basin' WHERE `ID`=894;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Graveyard, A-Mid (Stables) - Arathi Basin' WHERE `ID`=895;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Graveyard, ALT-N (Gold Mine) - Arathi Basin' WHERE `ID`=896;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Graveyard, ALT-S (Lumber Mill) - Arathi Basin' WHERE `ID`=897;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Graveyard, A-Base (Trollbane Hall) - Arathi Basin' WHERE `ID`=898;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Basin - Graveyard, H-Base (Defiler''s Den) - Arathi Basin' WHERE `ID`=899;
+UPDATE `graveyard_zone` SET `Comment`='Eastern Plaguelands, Blackwood Lake - Eastern Plaguelands' WHERE `ID`=909;
+UPDATE `graveyard_zone` SET `Comment`='Eastern Plaguelands, Blackwood Lake - Stratholme' WHERE `ID`=909;
+UPDATE `graveyard_zone` SET `Comment`='Silithus, Cenarion Hold - Ruins of Ahn''Qiraj' WHERE `ID`=910;
+UPDATE `graveyard_zone` SET `Comment`='Silithus, Cenarion Hold - Silithus' WHERE `ID`=910;
+UPDATE `graveyard_zone` SET `Comment`='Duskwood, Ravenhill - Duskwood' WHERE `ID`=911;
+UPDATE `graveyard_zone` SET `Comment`='Eversong Woods, Sunstrider Isle - Eversong Woods' WHERE `ID`=912;
+UPDATE `graveyard_zone` SET `Comment`='Silithus, Scarab Wall (AQ Only)' WHERE `ID`=913;
+UPDATE `graveyard_zone` SET `Comment`='Eversong Woods, Farstrider Lodge GY - Eversong Woods' WHERE `ID`=914;
+UPDATE `graveyard_zone` SET `Comment`='Ghostlands, Tranquillien - Ghostlands' WHERE `ID`=915;
+UPDATE `graveyard_zone` SET `Comment`='Ghostlands, Sanctum - Ghostlands' WHERE `ID`=916;
+UPDATE `graveyard_zone` SET `Comment`='Ghostlands, Amani Pass' WHERE `ID`=917;
+UPDATE `graveyard_zone` SET `Comment`='Azuremyst Isle, Ammen Vale' WHERE `ID`=918;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Thrallmar' WHERE `ID`=919;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Honor Hold' WHERE `ID`=920;
+UPDATE `graveyard_zone` SET `Comment`='Eversong Woods, Silvermoon City' WHERE `ID`=921;
+UPDATE `graveyard_zone` SET `Comment`='Azuremyst, Azure Watch GY - Azuremyst Isle' WHERE `ID`=923;
+UPDATE `graveyard_zone` SET `Comment`='Azuremyst, Stillpine GY' WHERE `ID`=924;
+UPDATE `graveyard_zone` SET `Comment`='Bloodmyst, Blood Watch GY - Bloodmyst Isle' WHERE `ID`=925;
+UPDATE `graveyard_zone` SET `Comment`='Bloodmyst, Wilderness GY' WHERE `ID`=926;
+UPDATE `graveyard_zone` SET `Comment`='Eastern Plaguelands, Graveyard CG Tower - Eastern Plaguelands' WHERE `ID`=927;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Zabra''jin GY' WHERE `ID`=928;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, SE Graveyard - Nagrand' WHERE `ID`=930;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Temple - Hellfire Peninsula' WHERE `ID`=933;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Falcon Watch - Hellfire Peninsula' WHERE `ID`=934;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 001 - Twisting Nether' WHERE `ID`=942;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 002 - Twisting Nether' WHERE `ID`=943;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 003 - Twisting Nether' WHERE `ID`=944;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 005 - Twisting Nether' WHERE `ID`=945;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 006 - Twisting Nether' WHERE `ID`=946;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 007 - Twisting Nether' WHERE `ID`=947;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 008 - Twisting Nether' WHERE `ID`=948;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 009 - Twisting Nether' WHERE `ID`=949;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 010 - Twisting Nether' WHERE `ID`=950;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 011 - Twisting Nether' WHERE `ID`=951;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 012 - Twisting Nether' WHERE `ID`=952;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 013 - Twisting Nether' WHERE `ID`=953;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 014 - Twisting Nether' WHERE `ID`=954;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 015 - Twisting Nether' WHERE `ID`=955;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 016 - Twisting Nether' WHERE `ID`=956;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 017 - Twisting Nether' WHERE `ID`=957;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 018 - Twisting Nether' WHERE `ID`=958;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 019 - Twisting Nether' WHERE `ID`=959;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 020 - Twisting Nether' WHERE `ID`=960;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 021 - Twisting Nether' WHERE `ID`=961;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 022 - Twisting Nether' WHERE `ID`=962;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 023 - Twisting Nether' WHERE `ID`=963;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 024 - Twisting Nether' WHERE `ID`=964;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 025 - Twisting Nether' WHERE `ID`=965;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 026 - Twisting Nether' WHERE `ID`=966;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 027 - Twisting Nether' WHERE `ID`=967;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Corpse Location 028 - Twisting Nether' WHERE `ID`=968;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, PvP GY' WHERE `ID`=969;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Telredor GY' WHERE `ID`=970;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 006 - Twisting Nether' WHERE `ID`=972;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Cenarion GY - Zangarmarsh' WHERE `ID`=973;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 001 - Twisting Nether' WHERE `ID`=974;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 002 - Twisting Nether' WHERE `ID`=975;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 003 - Twisting Nether' WHERE `ID`=976;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 004 - Twisting Nether' WHERE `ID`=977;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 008 - Twisting Nether' WHERE `ID`=978;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 005 - Twisting Nether' WHERE `ID`=979;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 007 - Twisting Nether' WHERE `ID`=980;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 009 - Twisting Nether' WHERE `ID`=981;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 011 - Twisting Nether' WHERE `ID`=982;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 010 - Twisting Nether' WHERE `ID`=983;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 012 - Twisting Nether' WHERE `ID`=984;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 013 - Twisting Nether' WHERE `ID`=985;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 014 - Twisting Nether' WHERE `ID`=986;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 016 - Twisting Nether' WHERE `ID`=987;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 015 - Twisting Nether' WHERE `ID`=988;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 017 - Twisting Nether' WHERE `ID`=989;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 018 - Twisting Nether' WHERE `ID`=990;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Corpse Location 019 - Twisting Nether' WHERE `ID`=991;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Northwind Cleft - Nagrand' WHERE `ID`=992;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Halaa GY - Nagrand' WHERE `ID`=993;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Shattrath GY' WHERE `ID`=994;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Wilderness GY - Terokkar Forest' WHERE `ID`=995;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 001 - Twisting Nether' WHERE `ID`=999;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 002 - Twisting Nether' WHERE `ID`=1000;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 003 - Twisting Nether' WHERE `ID`=1001;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 004 - Twisting Nether' WHERE `ID`=1002;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 005 - Twisting Nether' WHERE `ID`=1003;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 006 - Twisting Nether' WHERE `ID`=1004;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 007 - Twisting Nether' WHERE `ID`=1005;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 008 - Twisting Nether' WHERE `ID`=1006;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 009 - Twisting Nether' WHERE `ID`=1007;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 010 - Twisting Nether' WHERE `ID`=1008;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 011 - Twisting Nether' WHERE `ID`=1009;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 012 - Twisting Nether' WHERE `ID`=1010;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 013 - Twisting Nether' WHERE `ID`=1011;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Corpse Location 014 - Twisting Nether' WHERE `ID`=1012;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 001 - Twisting Nether' WHERE `ID`=1013;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 002 - Twisting Nether' WHERE `ID`=1014;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 003 - Twisting Nether' WHERE `ID`=1015;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 004 - Twisting Nether' WHERE `ID`=1016;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 005 - Twisting Nether' WHERE `ID`=1017;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 006 - Twisting Nether' WHERE `ID`=1018;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 007 - Twisting Nether' WHERE `ID`=1019;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 008 - Twisting Nether' WHERE `ID`=1020;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 009 - Twisting Nether' WHERE `ID`=1021;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 010 - Twisting Nether' WHERE `ID`=1022;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 011 - Twisting Nether' WHERE `ID`=1023;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 001 - Twisting Nether' WHERE `ID`=1024;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 002 - Twisting Nether' WHERE `ID`=1025;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 003 - Twisting Nether' WHERE `ID`=1026;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 004 - Twisting Nether' WHERE `ID`=1027;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 016 - Twisting Nether' WHERE `ID`=1028;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 017 - Twisting Nether' WHERE `ID`=1029;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 018 - Twisting Nether' WHERE `ID`=1030;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 019 - Twisting Nether' WHERE `ID`=1031;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 020 - Twisting Nether' WHERE `ID`=1032;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 021 - Twisting Nether' WHERE `ID`=1033;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 022 - Twisting Nether' WHERE `ID`=1034;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Corpse Location 023 - Twisting Nether' WHERE `ID`=1035;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Portal Plateau - Nagrand' WHERE `ID`=1037;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, Elemental Plateau - Nagrand' WHERE `ID`=1038;
+UPDATE `graveyard_zone` SET `Comment`='Nagrand, SW Graveyard - Nagrand' WHERE `ID`=1039;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Throne of Kil''Jaedan - Hellfire Peninsula' WHERE `ID`=1040;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Dark Portal - Hellfire Peninsula' WHERE `ID`=1041;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Bone Wastes GY' WHERE `ID`=1042;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Harborage GY - Zangarmarsh' WHERE `ID`=1043;
+UPDATE `graveyard_zone` SET `Comment`='Zangarmarsh, Sporeggar GY - Zangarmarsh' WHERE `ID`=1044;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm, Stormspire GY - Netherstorm' WHERE `ID`=1045;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm, Area 52 GY - Netherstorm' WHERE `ID`=1046;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon Valley, Shadowmoon Village GY - Shadowmoon Valley' WHERE `ID`=1047;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon Valley, Wildhammer GY - Shadowmoon Valley' WHERE `ID`=1048;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Sylvanaar GY - Blade''s Edge Mountains' WHERE `ID`=1049;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Thunderlord GY - Blade''s Edge Mountains' WHERE `ID`=1050;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Skettis GY - Terokkar Forest' WHERE `ID`=1051;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 005 - Twisting Nether' WHERE `ID`=1052;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 006 - Twisting Nether' WHERE `ID`=1053;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 007 - Twisting Nether' WHERE `ID`=1054;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 008 - Twisting Nether' WHERE `ID`=1055;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 009 - Twisting Nether' WHERE `ID`=1056;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 010 - Twisting Nether' WHERE `ID`=1057;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 011 - Twisting Nether' WHERE `ID`=1058;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 012 - Twisting Nether' WHERE `ID`=1059;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 013 - Twisting Nether' WHERE `ID`=1060;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 014 - Twisting Nether' WHERE `ID`=1061;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 015 - Twisting Nether' WHERE `ID`=1062;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 016 - Twisting Nether' WHERE `ID`=1063;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 017 - Twisting Nether' WHERE `ID`=1064;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 018 - Twisting Nether' WHERE `ID`=1065;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 019 - Twisting Nether' WHERE `ID`=1066;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 020 - Twisting Nether' WHERE `ID`=1067;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 021 - Twisting Nether' WHERE `ID`=1068;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 022 - Twisting Nether' WHERE `ID`=1069;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon, Corpse Location 023 - Twisting Nether' WHERE `ID`=1070;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 000 - Twisting Nether' WHERE `ID`=1072;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 001 - Twisting Nether' WHERE `ID`=1073;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 002 - Twisting Nether' WHERE `ID`=1074;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 003 - Twisting Nether' WHERE `ID`=1075;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 004 - Twisting Nether' WHERE `ID`=1076;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 005 - Twisting Nether' WHERE `ID`=1077;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 006 - Twisting Nether' WHERE `ID`=1078;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 007 - Twisting Nether' WHERE `ID`=1079;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 008 - Twisting Nether' WHERE `ID`=1080;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 009 - Twisting Nether' WHERE `ID`=1081;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 010 - Twisting Nether' WHERE `ID`=1082;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 011 - Twisting Nether' WHERE `ID`=1083;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 012 - Twisting Nether' WHERE `ID`=1084;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 013 - Twisting Nether' WHERE `ID`=1085;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 014 - Twisting Nether' WHERE `ID`=1086;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 015 - Twisting Nether' WHERE `ID`=1087;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 016 - Twisting Nether' WHERE `ID`=1088;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 017 - Twisting Nether' WHERE `ID`=1089;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 018 - Twisting Nether' WHERE `ID`=1090;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 019 - Twisting Nether' WHERE `ID`=1091;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 020 - Twisting Nether' WHERE `ID`=1092;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 021 - Twisting Nether' WHERE `ID`=1093;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 022 - Twisting Nether' WHERE `ID`=1094;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 023 - Twisting Nether' WHERE `ID`=1095;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 024 - Twisting Nether' WHERE `ID`=1096;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 025 - Twisting Nether' WHERE `ID`=1097;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 026 - Twisting Nether' WHERE `ID`=1098;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 027 - Twisting Nether' WHERE `ID`=1099;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 028 - Twisting Nether' WHERE `ID`=1100;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 029 - Twisting Nether' WHERE `ID`=1101;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Corpse Location 030 - Twisting Nether' WHERE `ID`=1102;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 000 - Twisting Nether' WHERE `ID`=1134;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 001 - Twisting Nether' WHERE `ID`=1135;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 002 - Twisting Nether' WHERE `ID`=1136;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 003 - Twisting Nether' WHERE `ID`=1137;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 004 - Twisting Nether' WHERE `ID`=1138;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 005 - Twisting Nether' WHERE `ID`=1139;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 006 - Twisting Nether' WHERE `ID`=1140;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 007 - Twisting Nether' WHERE `ID`=1141;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 008 - Twisting Nether' WHERE `ID`=1142;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 009 - Twisting Nether' WHERE `ID`=1143;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 010 - Twisting Nether' WHERE `ID`=1144;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 011 - Twisting Nether' WHERE `ID`=1145;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 012 - Twisting Nether' WHERE `ID`=1146;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 013 - Twisting Nether' WHERE `ID`=1147;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 014 - Twisting Nether' WHERE `ID`=1148;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 015 - Twisting Nether' WHERE `ID`=1149;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 016 - Twisting Nether' WHERE `ID`=1150;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 017 - Twisting Nether' WHERE `ID`=1151;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 018 - Twisting Nether' WHERE `ID`=1152;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 019 - Twisting Nether' WHERE `ID`=1153;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 020 - Twisting Nether' WHERE `ID`=1154;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 021 - Twisting Nether' WHERE `ID`=1155;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 022 - Twisting Nether' WHERE `ID`=1156;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 023 - Twisting Nether' WHERE `ID`=1157;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 024 - Twisting Nether' WHERE `ID`=1158;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 025 - Twisting Nether' WHERE `ID`=1159;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 026 - Twisting Nether' WHERE `ID`=1160;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 027 - Twisting Nether' WHERE `ID`=1161;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 028 - Twisting Nether' WHERE `ID`=1162;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 029 - Twisting Nether' WHERE `ID`=1163;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 030 - Twisting Nether' WHERE `ID`=1164;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 031 - Twisting Nether' WHERE `ID`=1165;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 032 - Twisting Nether' WHERE `ID`=1166;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 033 - Twisting Nether' WHERE `ID`=1167;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 034 - Twisting Nether' WHERE `ID`=1168;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 035 - Twisting Nether' WHERE `ID`=1169;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 036 - Twisting Nether' WHERE `ID`=1170;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 037 - Twisting Nether' WHERE `ID`=1171;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 038 - Twisting Nether' WHERE `ID`=1172;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 039 - Twisting Nether' WHERE `ID`=1173;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 040 - Twisting Nether' WHERE `ID`=1174;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 041 - Twisting Nether' WHERE `ID`=1175;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 042 - Twisting Nether' WHERE `ID`=1176;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 043 - Twisting Nether' WHERE `ID`=1177;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 044 - Twisting Nether' WHERE `ID`=1178;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 045 - Twisting Nether' WHERE `ID`=1179;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 046 - Twisting Nether' WHERE `ID`=1180;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 047 - Twisting Nether' WHERE `ID`=1181;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 048 - Twisting Nether' WHERE `ID`=1182;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 049 - Twisting Nether' WHERE `ID`=1183;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 050 - Twisting Nether' WHERE `ID`=1184;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 051 - Twisting Nether' WHERE `ID`=1185;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 052 - Twisting Nether' WHERE `ID`=1186;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 053 - Twisting Nether' WHERE `ID`=1187;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 054 - Twisting Nether' WHERE `ID`=1188;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 055 - Twisting Nether' WHERE `ID`=1189;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 056 - Twisting Nether' WHERE `ID`=1190;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 057 - Twisting Nether' WHERE `ID`=1191;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 058 - Twisting Nether' WHERE `ID`=1192;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 059 - Twisting Nether' WHERE `ID`=1193;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 060 - Twisting Nether' WHERE `ID`=1194;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 061 - Twisting Nether' WHERE `ID`=1195;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 062 - Twisting Nether' WHERE `ID`=1196;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 063 - Twisting Nether' WHERE `ID`=1197;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 064 - Twisting Nether' WHERE `ID`=1198;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 065 - Twisting Nether' WHERE `ID`=1199;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 066 - Twisting Nether' WHERE `ID`=1200;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 067 - Twisting Nether' WHERE `ID`=1201;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 068 - Twisting Nether' WHERE `ID`=1202;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 069 - Twisting Nether' WHERE `ID`=1203;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 070 - Twisting Nether' WHERE `ID`=1204;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 071 - Twisting Nether' WHERE `ID`=1205;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 072 - Twisting Nether' WHERE `ID`=1206;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 073 - Twisting Nether' WHERE `ID`=1207;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 074 - Twisting Nether' WHERE `ID`=1208;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 075 - Twisting Nether' WHERE `ID`=1209;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 076 - Twisting Nether' WHERE `ID`=1210;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 077 - Twisting Nether' WHERE `ID`=1211;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 078 - Twisting Nether' WHERE `ID`=1212;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 079 - Twisting Nether' WHERE `ID`=1213;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 080 - Twisting Nether' WHERE `ID`=1214;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 081 - Twisting Nether' WHERE `ID`=1215;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 082 - Twisting Nether' WHERE `ID`=1216;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 083 - Twisting Nether' WHERE `ID`=1217;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 084 - Twisting Nether' WHERE `ID`=1218;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 085 - Twisting Nether' WHERE `ID`=1219;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 086 - Twisting Nether' WHERE `ID`=1220;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 087 - Twisting Nether' WHERE `ID`=1221;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 088 - Twisting Nether' WHERE `ID`=1222;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 089 - Twisting Nether' WHERE `ID`=1223;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 090 - Twisting Nether' WHERE `ID`=1224;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 091 - Twisting Nether' WHERE `ID`=1225;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 092 - Twisting Nether' WHERE `ID`=1226;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 093 - Twisting Nether' WHERE `ID`=1227;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 094 - Twisting Nether' WHERE `ID`=1228;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 095 - Twisting Nether' WHERE `ID`=1229;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 096 - Twisting Nether' WHERE `ID`=1230;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 097 - Twisting Nether' WHERE `ID`=1231;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 098 - Twisting Nether' WHERE `ID`=1232;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 099 - Twisting Nether' WHERE `ID`=1233;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 100 - Twisting Nether' WHERE `ID`=1234;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 101 - Twisting Nether' WHERE `ID`=1235;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 102 - Twisting Nether' WHERE `ID`=1236;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 103 - Twisting Nether' WHERE `ID`=1237;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 104 - Twisting Nether' WHERE `ID`=1238;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm - Corpse Catcher 105 - Twisting Nether' WHERE `ID`=1239;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Force Camps (Alliance) - Hellfire Peninsula' WHERE `ID`=1240;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Evergrove GY' WHERE `ID`=1241;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, North Ridge GY - Blade''s Edge Mountains' WHERE `ID`=1242;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, West Ridge GY - Blade''s Edge Mountains' WHERE `ID`=1243;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, East Ridge GY - Blade''s Edge Mountains' WHERE `ID`=1244;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm, Cosmowrench GY' WHERE `ID`=1247;
+UPDATE `graveyard_zone` SET `Comment`='Hellfire Peninsula, Spinebreaker GY - Hellfire Peninsula' WHERE `ID`=1248;
+UPDATE `graveyard_zone` SET `Comment`='Tanaris, CoT GY' WHERE `ID`=1249;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon Valley, Altar GY - Shadowmoon Valley' WHERE `ID`=1250;
+UPDATE `graveyard_zone` SET `Comment`='Shadowmoon Valley, Sanctum GY - Shadowmoon Valley' WHERE `ID`=1251;
+UPDATE `graveyard_zone` SET `Comment`='Netherstorm, Kirin''Var GY - Netherstorm' WHERE `ID`=1252;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Toshley GY - Blade''s Edge Mountains' WHERE `ID`=1253;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, Raven Wood GY - Blade''s Edge Mountains' WHERE `ID`=1254;
+UPDATE `graveyard_zone` SET `Comment`='Blade''s Edge, NE Ridge GY - Blade''s Edge Mountains' WHERE `ID`=1255;
+UPDATE `graveyard_zone` SET `Comment`='Silverpine Forest, South GY - Silverpine Forest' WHERE `ID`=1256;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Ogre GY - Terokkar Forest' WHERE `ID`=1257;
+UPDATE `graveyard_zone` SET `Comment`='Black Temple, Alliance GY - Black Temple' WHERE `ID`=1261;
+UPDATE `graveyard_zone` SET `Comment`='Black Temple, Horde GY - Black Temple' WHERE `ID`=1262;
+UPDATE `graveyard_zone` SET `Comment`='Dustwallow Marsh, Tabetha''s GY - Dustwallow Marsh' WHERE `ID`=1264;
+UPDATE `graveyard_zone` SET `Comment`='Dustwallow Marsh, Mudsprocket GY - Onyxia''s Lair' WHERE `ID`=1265;
+UPDATE `graveyard_zone` SET `Comment`='Dustwallow Marsh, Mudsprocket GY - Dustwallow Marsh' WHERE `ID`=1265;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, Northwest GY - Howling Fjord' WHERE `ID`=1266;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, Tuskarr GY - Howling Fjord' WHERE `ID`=1267;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, Island GY - Howling Fjord' WHERE `ID`=1268;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, Central GY - Howling Fjord' WHERE `ID`=1269;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, North GY - Howling Fjord' WHERE `ID`=1270;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, Vengance GY - Howling Fjord' WHERE `ID`=1271;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, Southeast GY - Howling Fjord' WHERE `ID`=1272;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, South Beach GY - Howling Fjord' WHERE `ID`=1273;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, South GY - Howling Fjord' WHERE `ID`=1274;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, Valgarde GY - Howling Fjord' WHERE `ID`=1275;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, Northeast GY - Howling Fjord' WHERE `ID`=1276;
+UPDATE `graveyard_zone` SET `Comment`='Un''Goro Crater, Central GY - Un''Goro Crater' WHERE `ID`=1277;
+UPDATE `graveyard_zone` SET `Comment`='Un''Goro Crater, Marshal''s GY - Un''Goro Crater' WHERE `ID`=1278;
+UPDATE `graveyard_zone` SET `Comment`='Stonetalon Mountains, Charred Vale GY - Stonetalon Mountains' WHERE `ID`=1279;
+UPDATE `graveyard_zone` SET `Comment`='Stonetalon Mountains, Peak GY - Stonetalon Mountains' WHERE `ID`=1280;
+UPDATE `graveyard_zone` SET `Comment`='Tanaris, Pirate GY - Tanaris' WHERE `ID`=1281;
+UPDATE `graveyard_zone` SET `Comment`='Tanaris, Central GY - Tanaris' WHERE `ID`=1282;
+UPDATE `graveyard_zone` SET `Comment`='Winterspring, South GY - Winterspring' WHERE `ID`=1283;
+UPDATE `graveyard_zone` SET `Comment`='Winterspring, West GY - Winterspring' WHERE `ID`=1284;
+UPDATE `graveyard_zone` SET `Comment`='Western Plaguelands, Central GY - Western Plaguelands' WHERE `ID`=1286;
+UPDATE `graveyard_zone` SET `Comment`='Searing Gorge, SE GY - Searing Gorge' WHERE `ID`=1287;
+UPDATE `graveyard_zone` SET `Comment`='Badlands, South GY - Badlands' WHERE `ID`=1288;
+UPDATE `graveyard_zone` SET `Comment`='The Barrens, South GY - Southern Barrens' WHERE `ID`=1289;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Tuskar GY - Borean Tundra' WHERE `ID`=1290;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Razorthorn Rise GY - Terokkar Forest' WHERE `ID`=1291;
+UPDATE `graveyard_zone` SET `Comment`='Isle of Quel''Danas, Staging Area GY - Isle of Quel''Danas' WHERE `ID`=1292;
+UPDATE `graveyard_zone` SET `Comment`='Isle of Quel''Danas, Staging Area GY - Magisters'' Terrace' WHERE `ID`=1293;
+UPDATE `graveyard_zone` SET `Comment`='Isle of Quel''Danas, Staging Area GY - Sunwell Plateau' WHERE `ID`=1293;
+UPDATE `graveyard_zone` SET `Comment`='Terokkar Forest, Lake Jorune GY - Terokkar Forest' WHERE `ID`=1298;
+UPDATE `graveyard_zone` SET `Comment`='Grizzly Hills, Vileprey GY - Grizzly Hills' WHERE `ID`=1300;
+UPDATE `graveyard_zone` SET `Comment`='Grizzly Hills, Amberpine GY - Grizzly Hills' WHERE `ID`=1301;
+UPDATE `graveyard_zone` SET `Comment`='Grizzly Hills, Westfall GY - Grizzly Hills' WHERE `ID`=1302;
+UPDATE `graveyard_zone` SET `Comment`='Grizzly Hills, Eastern GY - Grizzly Hills' WHERE `ID`=1303;
+UPDATE `graveyard_zone` SET `Comment`='Grizzly Hills, Northwestern GY - Grizzly Hills' WHERE `ID`=1304;
+UPDATE `graveyard_zone` SET `Comment`='Grizzly Hills, Southwestern GY - Grizzly Hills' WHERE `ID`=1305;
+UPDATE `graveyard_zone` SET `Comment`='Grizzly Hills, Central GY - Grizzly Hills' WHERE `ID`=1306;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Northeastern GY - Dragonblight' WHERE `ID`=1307;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Wintergarde GY - Naxxramas' WHERE `ID`=1308;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Wintergarde GY - Dragonblight' WHERE `ID`=1308;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Forsaken East GY - Naxxramas' WHERE `ID`=1309;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Agmar''s Hammer GY - Dragonblight' WHERE `ID`=1310;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Star''s Rest GY - Dragonblight' WHERE `ID`=1311;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Moa''ki Harbor GY - Dragonblight' WHERE `ID`=1312;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Borean Border GY - Dragonblight' WHERE `ID`=1313;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Wyrmrest GY - Dragonblight' WHERE `ID`=1314;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Wrathgate Horde GY - Dragonblight' WHERE `ID`=1315;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Wrathgate Alliance GY - Dragonblight' WHERE `ID`=1316;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Warsong Hold GY - Borean Tundra' WHERE `ID`=1317;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Riplash GY - Borean Tundra' WHERE `ID`=1318;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Coldarra GY' WHERE `ID`=1319;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Amber Ledge GY - Borean Tundra' WHERE `ID`=1320;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Fizzcrank GY - Borean Tundra' WHERE `ID`=1321;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Bor''Gorok GY - Borean Tundra' WHERE `ID`=1322;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Death''s Stand GY - Borean Tundra' WHERE `ID`=1323;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Taunka''le GY - Borean Tundra' WHERE `ID`=1324;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Coast of Echoes GY - Borean Tundra' WHERE `ID`=1325;
+UPDATE `graveyard_zone` SET `Comment`='Borean Tundra, Valiance Keep GY - Borean Tundra' WHERE `ID`=1326;
+UPDATE `graveyard_zone` SET `Comment`='Wintergrasp, Fortress (West) - Wintergrasp' WHERE `ID`=1328;
+UPDATE `graveyard_zone` SET `Comment`='Wintergrasp, Siege Factory (Defense NE) - Wintergrasp' WHERE `ID`=1329;
+UPDATE `graveyard_zone` SET `Comment`='Wintergrasp, Siege Factory (Defense NW) - Wintergrasp' WHERE `ID`=1330;
+UPDATE `graveyard_zone` SET `Comment`='Wintergrasp, Horde Starting Area - Wintergrasp' WHERE `ID`=1331;
+UPDATE `graveyard_zone` SET `Comment`='Wintergrasp, Alliance Starting Area - Wintergrasp' WHERE `ID`=1332;
+UPDATE `graveyard_zone` SET `Comment`='Wintergrasp, Siege Factory (SE) - Wintergrasp' WHERE `ID`=1333;
+UPDATE `graveyard_zone` SET `Comment`='Wintergrasp, Siege Factory (SW) - Wintergrasp' WHERE `ID`=1334;
+UPDATE `graveyard_zone` SET `Comment`='Sholazar Basin, South GY - Sholazar Basin' WHERE `ID`=1336;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, Utgarde GY - Utgarde Pinnacle' WHERE `ID`=1337;
+UPDATE `graveyard_zone` SET `Comment`='Sholazar Basin, Nesingwary GY - Sholazar Basin' WHERE `ID`=1341;
+UPDATE `graveyard_zone` SET `Comment`='Sholazar Basin, Central GY - Sholazar Basin' WHERE `ID`=1342;
+UPDATE `graveyard_zone` SET `Comment`='Sholazar Basin, Northwest GY - Sholazar Basin' WHERE `ID`=1343;
+UPDATE `graveyard_zone` SET `Comment`='Sholazar Basin, Northeast GY - Sholazar Basin' WHERE `ID`=1344;
+UPDATE `graveyard_zone` SET `Comment`='Sholazar Basin, East GY - Sholazar Basin' WHERE `ID`=1345;
+UPDATE `graveyard_zone` SET `Comment`='Zul''Drak, Western GY - Zul''Drak' WHERE `ID`=1352;
+UPDATE `graveyard_zone` SET `Comment`='Zul''Drak, Northwestern GY - Zul''Drak' WHERE `ID`=1353;
+UPDATE `graveyard_zone` SET `Comment`='Zul''Drak, Southwestern GY - Zul''Drak' WHERE `ID`=1354;
+UPDATE `graveyard_zone` SET `Comment`='Zul''Drak, Southern GY - Zul''Drak' WHERE `ID`=1355;
+UPDATE `graveyard_zone` SET `Comment`='Zul''Drak, Central GY - Zul''Drak' WHERE `ID`=1356;
+UPDATE `graveyard_zone` SET `Comment`='Zul''Drak, Southeastern GY - Zul''Drak' WHERE `ID`=1357;
+UPDATE `graveyard_zone` SET `Comment`='Zul''Drak, Gun''Drak GY - Zul''Drak' WHERE `ID`=1358;
+UPDATE `graveyard_zone` SET `Comment`='Crystalsong Forest, Dalaran GY' WHERE `ID`=1359;
+UPDATE `graveyard_zone` SET `Comment`='Ebon Hold GY - Chapter I - Plaguelands: The Scarlet Enclave' WHERE `ID`=1360;
+UPDATE `graveyard_zone` SET `Comment`='Eastern Plaguelands, Ebon Hold GY - Eastern Plaguelands' WHERE `ID`=1369;
+UPDATE `graveyard_zone` SET `Comment`='Ebon Hold GY - Chapter II/III - Plaguelands: The Scarlet Enclave' WHERE `ID`=1370;
+UPDATE `graveyard_zone` SET `Comment`='Ebon Hold GY - Chapter IV - Plaguelands: The Scarlet Enclave' WHERE `ID`=1371;
+UPDATE `graveyard_zone` SET `Comment`='Un''Goro Crater, Shaper''s Terrace GY - Un''Goro Crater' WHERE `ID`=1372;
+UPDATE `graveyard_zone` SET `Comment`='Howling Fjord, Utgarde 2 GY - Utgarde Keep' WHERE `ID`=1376;
+UPDATE `graveyard_zone` SET `Comment`='Sholazar Basin, Stormwright GY - Sholazar Basin' WHERE `ID`=1379;
+UPDATE `graveyard_zone` SET `Comment`='Crystalsong Forest, Alliance GY - Crystalsong Forest' WHERE `ID`=1380;
+UPDATE `graveyard_zone` SET `Comment`='Icecrown, Argent Vanguard - Icecrown' WHERE `ID`=1381;
+UPDATE `graveyard_zone` SET `Comment`='Storm Peaks, Valkyrion GY - The Storm Peaks' WHERE `ID`=1383;
+UPDATE `graveyard_zone` SET `Comment`='Storm Peaks, Ulduar GY - The Storm Peaks' WHERE `ID`=1384;
+UPDATE `graveyard_zone` SET `Comment`='Storm Peaks, Temple East GY - The Storm Peaks' WHERE `ID`=1385;
+UPDATE `graveyard_zone` SET `Comment`='Storm Peaks, Temple West GY - The Storm Peaks' WHERE `ID`=1387;
+UPDATE `graveyard_zone` SET `Comment`='Storm Peaks, Frostfield GY - The Storm Peaks' WHERE `ID`=1388;
+UPDATE `graveyard_zone` SET `Comment`='Crystalsong Forest, West GY - Crystalsong Forest' WHERE `ID`=1391;
+UPDATE `graveyard_zone` SET `Comment`='Crystalsong Forest, Horde GY - Crystalsong Forest' WHERE `ID`=1392;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Naxxramas GY - Dragonblight' WHERE `ID`=1393;
+UPDATE `graveyard_zone` SET `Comment`='Dragonblight, Icemist GY - Dragonblight' WHERE `ID`=1394;
+UPDATE `graveyard_zone` SET `Comment`='Icecrown Glacier, Quarry GY - Icecrown' WHERE `ID`=1395;
+UPDATE `graveyard_zone` SET `Comment`='Icecrown Glacier, Vrykul Central GY - Icecrown' WHERE `ID`=1396;
+UPDATE `graveyard_zone` SET `Comment`='Icecrown Glacier, Northeast Ice GY - Icecrown' WHERE `ID`=1397;
+UPDATE `graveyard_zone` SET `Comment`='Grizzly Hills, Drak''tharon GY - Grizzly Hills' WHERE `ID`=1398;
+UPDATE `graveyard_zone` SET `Comment`='Storm Peaks, Temple of the Makers GY - The Storm Peaks' WHERE `ID`=1400;
+UPDATE `graveyard_zone` SET `Comment`='Storm Peaks, Snowdrift GY - The Storm Peaks' WHERE `ID`=1401;
+UPDATE `graveyard_zone` SET `Comment`='Storm Peaks, Temple of Storms GY - The Storm Peaks' WHERE `ID`=1402;
+UPDATE `graveyard_zone` SET `Comment`='Storm Peaks, K3 GY - The Storm Peaks' WHERE `ID`=1403;
+UPDATE `graveyard_zone` SET `Comment`='Sholazar Basin, Frenzyheart GY - Sholazar Basin' WHERE `ID`=1404;
+UPDATE `graveyard_zone` SET `Comment`='Eastern Plaguelands: Acherus - Eastern Plaguelands' WHERE `ID`=1405;
+UPDATE `graveyard_zone` SET `Comment`='Icecrown Glacier, Jotunheim GY - Icecrown' WHERE `ID`=1407;
+UPDATE `graveyard_zone` SET `Comment`='Storm Peaks, Foot Steppes GY - The Storm Peaks' WHERE `ID`=1408;
+UPDATE `graveyard_zone` SET `Comment`='Undercity - Alliance - Wrath Gate - Tirisfal Glades' WHERE `ID`=1409;
+UPDATE `graveyard_zone` SET `Comment`='Alterac Mountains - Central GY - Hillsbrad Foothills' WHERE `ID`=1411;
+UPDATE `graveyard_zone` SET `Comment`='Winterspring, Wintersaber GY - Winterspring' WHERE `ID`=1416;
+UPDATE `graveyard_zone` SET `Comment`='Winterspring, Crossroad GY - Winterspring' WHERE `ID`=1417;
+UPDATE `graveyard_zone` SET `Comment`='Winterspring, Darkwhisper GY - Winterspring' WHERE `ID`=1418;
+UPDATE `graveyard_zone` SET `Comment`='Azshara, Southern Azshara GY - Azshara' WHERE `ID`=1419;
+UPDATE `graveyard_zone` SET `Comment`='Azshara, Bilgewater Harbor GY - Azshara' WHERE `ID`=1420;
+UPDATE `graveyard_zone` SET `Comment`='Desolace, Ghost Walker Post GY - Desolace' WHERE `ID`=1421;
+UPDATE `graveyard_zone` SET `Comment`='Desolace, Sar''theris Strand GY - Desolace' WHERE `ID`=1422;
+UPDATE `graveyard_zone` SET `Comment`='Desolace, Mannoroc Coven GY - Desolace' WHERE `ID`=1423;
+UPDATE `graveyard_zone` SET `Comment`='Desolace, Magram Village GY - Desolace' WHERE `ID`=1424;
+UPDATE `graveyard_zone` SET `Comment`='Desolace, Roadside GY - Desolace' WHERE `ID`=1425;
+UPDATE `graveyard_zone` SET `Comment`='Ashenvale, Shrine of Aessina GY - Ashenvale' WHERE `ID`=1426;
+UPDATE `graveyard_zone` SET `Comment`='Ashenvale, Nightsong GY - Ashenvale' WHERE `ID`=1427;
+UPDATE `graveyard_zone` SET `Comment`='Stonetalon Mountains, Windshear Crag GY - Stonetalon Mountains' WHERE `ID`=1428;
+UPDATE `graveyard_zone` SET `Comment`='Stonetalon Mountains, Mirkfallon GY - Stonetalon Mountains' WHERE `ID`=1429;
+UPDATE `graveyard_zone` SET `Comment`='The Barrens, Forgotten Pools - Northern Barrens' WHERE `ID`=1430;
+UPDATE `graveyard_zone` SET `Comment`='The Barrens, North GY - Northern Barrens' WHERE `ID`=1431;
+UPDATE `graveyard_zone` SET `Comment`='The Barrens, Raptor Grounds - Southern Barrens' WHERE `ID`=1432;
+UPDATE `graveyard_zone` SET `Comment`='The Barrens, Central GY - Southern Barrens' WHERE `ID`=1433;
+UPDATE `graveyard_zone` SET `Comment`='The Barrens, East GY - Northern Barrens' WHERE `ID`=1434;
+UPDATE `graveyard_zone` SET `Comment`='Mulgore, Southeast GY - Mulgore' WHERE `ID`=1435;
+UPDATE `graveyard_zone` SET `Comment`='Mulgore, Red Rocks GY - Mulgore' WHERE `ID`=1436;
+UPDATE `graveyard_zone` SET `Comment`='Thousand Needles, Freewind Post GY (MOVED) - Thousand Needles' WHERE `ID`=1437;
+UPDATE `graveyard_zone` SET `Comment`='Thousand Needles, Speed Barge GY (MOVED) - Thousand Needles' WHERE `ID`=1438;
+UPDATE `graveyard_zone` SET `Comment`='Tanaris, Southwest GY - Tanaris' WHERE `ID`=1439;
+UPDATE `graveyard_zone` SET `Comment`='Tanaris, Abyssal Sands GY - Tanaris' WHERE `ID`=1440;
+UPDATE `graveyard_zone` SET `Comment`='Feralas, Ruins of Isildien GY - Feralas' WHERE `ID`=1441;
+UPDATE `graveyard_zone` SET `Comment`='Feralas, Lower Wilds GY - Feralas' WHERE `ID`=1442;
+UPDATE `graveyard_zone` SET `Comment`='Feralas, Twin Colossals GY - Feralas' WHERE `ID`=1443;
+UPDATE `graveyard_zone` SET `Comment`='Silithus, Hive''Regal - Silithus' WHERE `ID`=1444;
+UPDATE `graveyard_zone` SET `Comment`='Silithus, Twilight Base Camp - Silithus' WHERE `ID`=1445;
+UPDATE `graveyard_zone` SET `Comment`='Arathi Highlands, Stromgarde - Arathi Highlands' WHERE `ID`=1446;
+UPDATE `graveyard_zone` SET `Comment`='Hillsbrad Foothills, Thoradin''s Wall - Hillsbrad Foothills' WHERE `ID`=1447;
+UPDATE `graveyard_zone` SET `Comment`='Eastern Plaguelands, Northdale - Eastern Plaguelands' WHERE `ID`=1448;
+UPDATE `graveyard_zone` SET `Comment`='Eastern Plaguelands, Stratholme - Eastern Plaguelands' WHERE `ID`=1449;
+UPDATE `graveyard_zone` SET `Comment`='Eastern Plaguelands, West GY - Eastern Plaguelands' WHERE `ID`=1450;
+UPDATE `graveyard_zone` SET `Comment`='Western Plaguelands, Hearthglen - Eastern Plaguelands' WHERE `ID`=1451;
+UPDATE `graveyard_zone` SET `Comment`='Hillsbrad Foothills, Hillsbrad Fields GY - Hillsbrad Foothills' WHERE `ID`=1452;
+UPDATE `graveyard_zone` SET `Comment`='The Hinterlands, Seradane - The Hinterlands' WHERE `ID`=1453;
+UPDATE `graveyard_zone` SET `Comment`='The Hinterlands, Shadra''Alor - The Hinterlands' WHERE `ID`=1454;
+UPDATE `graveyard_zone` SET `Comment`='Wetlands, Sundown Marsh GY - Wetlands' WHERE `ID`=1455;
+UPDATE `graveyard_zone` SET `Comment`='Wetlands, South Road GY - Wetlands' WHERE `ID`=1456;
+UPDATE `graveyard_zone` SET `Comment`='Wetlands, Raptor Ridge GY - Wetlands' WHERE `ID`=1457;
+UPDATE `graveyard_zone` SET `Comment`='AAA - Arena (Dev Test) - Stranglethorn Vale' WHERE `ID`=1458;
+UPDATE `graveyard_zone` SET `Comment`='Stranglethorn Vale, Central GY - Stranglethorn Vale' WHERE `ID`=1459;
+UPDATE `graveyard_zone` SET `Comment`='Stranglethorn Vale, Savage Coast GY - Stranglethorn Vale' WHERE `ID`=1460;
+UPDATE `graveyard_zone` SET `Comment`='Duskwood, Central GY - Duskwood' WHERE `ID`=1461;
+UPDATE `graveyard_zone` SET `Comment`='Westfall, Dagger Hills GY - Westfall' WHERE `ID`=1462;
+UPDATE `graveyard_zone` SET `Comment`='Westfall, Longshore - Westfall' WHERE `ID`=1463;
+UPDATE `graveyard_zone` SET `Comment`='Blasted Lands, Dark Portal GY - Blasted Lands' WHERE `ID`=1464;
+UPDATE `graveyard_zone` SET `Comment`='Swamp of Sorrows, Alliance Hub GY - Swamp of Sorrows' WHERE `ID`=1465;
+UPDATE `graveyard_zone` SET `Comment`='Swamp of Sorrows, Splinterspear GY - Swamp of Sorrows' WHERE `ID`=1466;
+UPDATE `graveyard_zone` SET `Comment`='Redridge Mountains, Stonewatch - Redridge Mountains' WHERE `ID`=1467;
+UPDATE `graveyard_zone` SET `Comment`='Elwynn Forest, Tower of Azora - Elwynn Forest' WHERE `ID`=1468;
+UPDATE `graveyard_zone` SET `Comment`='Burning Steppes, Blackrock Mountain - Blackrock Mountain' WHERE `ID`=1469;
+UPDATE `graveyard_zone` SET `Comment`='Burning Steppes, East GY - Burning Steppes' WHERE `ID`=1470;
+UPDATE `graveyard_zone` SET `Comment`='Dun Morogh, Iceflow Lake - Dun Morogh' WHERE `ID`=1471;
+UPDATE `graveyard_zone` SET `Comment`='Dun Morogh, East Road - Dun Morogh' WHERE `ID`=1472;
+UPDATE `graveyard_zone` SET `Comment`='Loch Modan, The Loch - Loch Modan' WHERE `ID`=1473;
+UPDATE `graveyard_zone` SET `Comment`='Wintergrasp, Fortress Graveyard (Indoors) - Vault of Archavon' WHERE `ID`=1474;
+UPDATE `graveyard_zone` SET `Comment`='Icecrown, Argent Tournament GY' WHERE `ID`=1478;
+UPDATE `graveyard_zone` SET `Comment`='Icecrown Glacier, Citadel GY' WHERE `ID`=1682;
diff --git a/sql/updates/world/3.3.5/2016_05_26_00_world.sql b/sql/updates/world/3.3.5/2016_05_26_00_world.sql
new file mode 100644
index 00000000000..39e16aba39e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_26_00_world.sql
@@ -0,0 +1,19 @@
+-- Localized name for gameobject entry 1638 and 2035 (English name "Deathknell")
+DELETE FROM `gameobject_template_locale` WHERE `entry` IN (1638,2035);
+INSERT INTO `gameobject_template_locale` (`entry`,`locale`,`name`,`castBarCaption`,`VerifiedBuild`) VALUES
+(1638,'deDE','Todesend','',0),
+(1638,'esES','Camposanto','',0),
+(1638,'esMX','Camposanto','',0),
+(1638,'frFR','Le Glas','',0),
+(1638,'koKR','죽음의 종소리 마을','',0),
+(1638,'ruRU','Похоронный Звон','',0),
+(1638,'zhCN','丧钟镇','',0),
+(1638,'zhTW','喪鐘鎮','',0),
+(2035,'deDE','Todesend','',0),
+(2035,'esES','Camposanto','',0),
+(2035,'esMX','Camposanto','',0),
+(2035,'frFR','Le Glas','',0),
+(2035,'koKR','죽음의 종소리 마을','',0),
+(2035,'ruRU','Похоронный Звон','',0),
+(2035,'zhCN','丧钟镇','',0),
+(2035,'zhTW','喪鐘鎮','',0);
diff --git a/sql/updates/world/3.3.5/2016_05_26_01_world.sql b/sql/updates/world/3.3.5/2016_05_26_01_world.sql
new file mode 100644
index 00000000000..343bc6f0a17
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_26_01_world.sql
@@ -0,0 +1,8 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid`=18794 AND `id`=34;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(18794,0,34,0,1,0,100,0,0,0,0,0,11,32958,0,0,0,0,0,1,0,0,0,0,0,0,0,"Cabal Ritualist - Out of Combat - Cast 'Crystal Channel'");
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=32958;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,32958,0,0,31,0,3,18793,0,0,"","Crystal Channel – Effect 0 - Cast only on Invisible Target 18793.");
diff --git a/sql/updates/world/3.3.5/2016_05_26_02_world.sql b/sql/updates/world/3.3.5/2016_05_26_02_world.sql
new file mode 100644
index 00000000000..4cacdc73a47
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_26_02_world.sql
@@ -0,0 +1,2 @@
+-- Fix bounding radius for 'Ice Tomb'
+UPDATE `creature_model_info` SET `BoundingRadius`=7.5, `CombatReach`=6 WHERE `DisplayID`=30890;
diff --git a/sql/updates/world/3.3.5/2016_05_26_03_world.sql b/sql/updates/world/3.3.5/2016_05_26_03_world.sql
new file mode 100644
index 00000000000..f3a419e9bd0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_26_03_world.sql
@@ -0,0 +1,21 @@
+-- Pathing for Clam Master K Entry: 25800 'TDB FORMAT'
+SET @NPC := 114803;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=2342.325,`position_y`=5050.552,`position_z`=-21.01424 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,2342.325,5050.552,-21.01424,0,0,0,0,100,0), -- 06:32:15
+(@PATH,2,2338.003,5044.308,-22.64446,0,0,0,0,100,0), -- 06:32:22
+(@PATH,3,2336.804,5029.821,-26.94789,0,0,0,0,100,0), -- 06:32:27
+(@PATH,4,2341.884,5018.865,-30.1459,0,0,0,0,100,0), -- 06:32:33
+(@PATH,5,2348.352,5002.221,-30.94783,0,0,0,0,100,0), -- 06:32:40
+(@PATH,6,2349.925,4993.154,-32.16956,0,0,0,0,100,0), -- 06:32:45
+(@PATH,7,2354.025,4983.295,-33.4639,0,0,0,0,100,0), -- 06:32:50
+(@PATH,8,2357.896,4977.057,-33.84595,0,0,0,0,100,0), -- 06:32:53
+(@PATH,9,2353.561,4983.914,-33.77616,0,0,0,0,100,0), -- 06:33:00
+(@PATH,10,2349.806,4994.94,-31.05927,0,0,0,0,100,0), -- 06:33:04
+(@PATH,11,2346.473,5009.516,-31.52969,0,0,0,0,100,0), -- 06:33:08
+(@PATH,12,2338.316,5025.714,-28.18582,0,0,0,0,100,0), -- 06:33:13
+(@PATH,13,2334.683,5038.239,-23.58451,0,0,0,0,100,0); -- 06:33:20
diff --git a/sql/updates/world/3.3.5/2016_05_26_04_world.sql b/sql/updates/world/3.3.5/2016_05_26_04_world.sql
new file mode 100644
index 00000000000..00ae15af434
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_26_04_world.sql
@@ -0,0 +1,27 @@
+-- Pathing for Houndmaster Grebmar Entry: 9319 'TDB FORMAT'
+SET @NPC := 46284;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=594.4585,`position_y`=-178.3237,`position_z`=-84.23994 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,594.4585,-178.3237,-84.23994,0,0,0,0,100,0),
+(@PATH,2,598.2085,-180.3237,-84.23994,0,0,0,0,100,0),
+(@PATH,3,601.2085,-182.3237,-84.23994,0,0,0,0,100,0),
+(@PATH,4,605.1209,-184.6363,-84.23941,0,0,0,0,100,0),
+(@PATH,5,608.8709,-188.1363,-84.23941,0,0,0,0,100,0),
+(@PATH,6,612.06,-191.0042,-84.23634,0,0,0,0,100,0),
+(@PATH,7,611.81,-184.0042,-84.23634,0,0,0,0,100,0),
+(@PATH,8,611.5181,-178.7817,-84.23982,0,0,0,0,100,0),
+(@PATH,9,606.7681,-173.7817,-84.23982,0,0,0,0,100,0),
+(@PATH,10,601.315,-167.8244,-84.23912,0,0,0,0,100,0),
+(@PATH,11,594.565,-168.8244,-84.23912,0,0,0,0,100,0),
+(@PATH,12,585.8881,-169.7204,-84.24162,0,0,0,0,100,0),
+(@PATH,13,582.8881,-176.2204,-84.24162,0,0,0,0,100,0),
+(@PATH,14,579.5485,-182.8368,-84.24379,0,0,0,0,100,0),
+(@PATH,15,583.2985,-189.3368,-84.24379,0,0,0,0,100,0),
+(@PATH,16,586.8497,-196.4224,-84.24238,0,0,0,0,100,0),
+(@PATH,17,587.5997,-187.1724,-84.24238,0,0,0,0,100,0),
+(@PATH,18,591.6155,-181.6407,-84.24092,0,0,0,0,100,0),
+(@PATH,19,594.4585,-178.3237,-84.23994,0,0,0,0,100,0);
diff --git a/sql/updates/world/3.3.5/2016_05_26_05_world.sql b/sql/updates/world/3.3.5/2016_05_26_05_world.sql
new file mode 100644
index 00000000000..192ea0893d3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_26_05_world.sql
@@ -0,0 +1,3 @@
+-- DB/Creature: Add flag guard Deathguard Elite
+-- creature is a guard (Will ignore feign death and vanish)
+UPDATE `creature_template` SET `flags_extra`=32768 WHERE `entry`=7980;
diff --git a/sql/updates/world/3.3.5/2016_05_26_06_world_335.sql b/sql/updates/world/3.3.5/2016_05_26_06_world_335.sql
new file mode 100644
index 00000000000..0b8903f527d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_26_06_world_335.sql
@@ -0,0 +1,5 @@
+-- Anvilrage Overseer SAI (3.3.5 Only)
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=8889;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=8889 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(8889, 0, 0, 0, 0, 0, 100, 2, 4000, 6000, 7000, 9000, 11, 15580, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Anvilrage Overseer - In Combat - Cast \'Strike\' (Normal Dungeon)');
diff --git a/sql/updates/world/3.3.5/2016_05_26_07_world.sql b/sql/updates/world/3.3.5/2016_05_26_07_world.sql
new file mode 100644
index 00000000000..0749f080581
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_26_07_world.sql
@@ -0,0 +1,5 @@
+-- DB/Creature: Add missing Ornery Plainstrider SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=3245;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=3245 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(3245, 0, 0, 0, 2, 0, 100, 1, 0, 40, 0, 0, 11, 3019, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ornery Plainstrider - Between 0-40% Health - Cast \'Frenzy\' (No Repeat)');
diff --git a/sql/updates/world/3.3.5/2016_05_26_08_world.sql b/sql/updates/world/3.3.5/2016_05_26_08_world.sql
new file mode 100644
index 00000000000..af1d7a3d515
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_26_08_world.sql
@@ -0,0 +1 @@
+UPDATE `quest_offer_reward` SET `RewardText`= "I can't believe it! It was the gnome all along... I should have known!" WHERE `id` = 9531;
diff --git a/sql/updates/world/3.3.5/2016_05_26_09_world.sql b/sql/updates/world/3.3.5/2016_05_26_09_world.sql
new file mode 100644
index 00000000000..0ad751a01d4
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_26_09_world.sql
@@ -0,0 +1,14 @@
+-- Mebok Mizzyrix, NPC entry 3446
+SET @ENTRY := 3446;
+
+DELETE FROM `creature_text` WHERE `entry`= @ENTRY;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(@ENTRY,0,0,"Now let's try it...", 12,0,100, 7,0,0,2078,0,'Mebok Mizzyrix on Quest 865 rewarded'),
+(@ENTRY,1,0,"Ugh! That's terrible!",12,0,100,33,0,0,2079,0,'Mebok Mizzyrix on Quest 865 rewarded');
+
+UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry`= @ENTRY;
+
+DELETE FROM `smart_scripts` WHERE `source_type`= 0 AND `entryorguid`= @ENTRY;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,1,20,0,100,0,865,0,0,0,1,0,4000,0,0,0,0,1,0,0,0,0,0,0,0,'Mebok Mizzyrix - on Quest 865 Rewarded - Say Line 0'),
+(@ENTRY,0,1,0,61,0,100,0, 0,0,0,0,1,1,4000,0,0,0,0,1,0,0,0,0,0,0,0,'Mebok Mizzyrix - on Quest 865 Rewarded - Say Line 1');
diff --git a/sql/updates/world/3.3.5/2016_05_28_00_world.sql b/sql/updates/world/3.3.5/2016_05_28_00_world.sql
new file mode 100644
index 00000000000..602f7834cd8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_28_00_world.sql
@@ -0,0 +1 @@
+UPDATE `creature_addon` SET `auras`=55701 WHERE `guid`=100071;
diff --git a/sql/updates/world/3.3.5/2016_05_28_01_world.sql b/sql/updates/world/3.3.5/2016_05_28_01_world.sql
new file mode 100644
index 00000000000..0ce802fd363
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_28_01_world.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_ioc_seaforium_blast_credit';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(66676, 'spell_ioc_seaforium_blast_credit'),
+(66672, 'spell_ioc_seaforium_blast_credit');
diff --git a/sql/updates/world/3.3.5/2016_05_28_02_world_335.sql b/sql/updates/world/3.3.5/2016_05_28_02_world_335.sql
new file mode 100644
index 00000000000..b0db2e7c4e9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_28_02_world_335.sql
@@ -0,0 +1,240 @@
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN(19671,19672,19673);
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(19671,19672,19673,19666) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(1966600,1967200,1967100,1967101,1967102,1967103,1967104,1967105,1967106,1967107,1967108) AND `source_type`=9;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=18311 AND `source_type`=0 AND `id`=5;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=18312 AND `source_type`=0 AND `id`=6;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=18313 AND `source_type`=0 AND `id`=16;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=18315 AND `source_type`=0 AND `id`=5;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=19307 AND `source_type`=0 AND `id`=4;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(18311, 0, 5, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 19671, 0, 0, 0, 0, 0, 0, 'Ethereal Crypt Raider - On Just Summoned - Start Attack'),
+(18312, 0, 6, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 19671, 0, 0, 0, 0, 0, 0, 'Ethereal Spellbinder - On Just Summoned - Start Attack'),
+(18313, 0, 16, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 19671, 0, 0, 0, 0, 0, 0, 'Ethereal Sorcerer - On Just Summoned - Start Attack'),
+(18315, 0, 5, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 19671, 0, 0, 0, 0, 0, 0, 'Ethereal Theurgist - On Just Summoned - Start Attack'),
+(19307, 0, 4, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 19671, 0, 0, 0, 0, 0, 0, 'Nexus Terror - On Just Summoned - Start Attack'),
+(19672, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 80, 1967200, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Consortium Laborer - On Just Summoned - Run Script'),
+(19673, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 80, 1967200, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Consortium Engineer - On Just Summoned - Run Script'),
+(19672, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Consortium Laborer - On Just Summoned - Set Emote State'),
+(19673, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Consortium Engineer - On Just Summoned - Set Emote State'),
+(19666, 0, 1, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, 1966600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - On Just Summoned - Run Script'),
+(19666, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 19671, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - On Death - Set Data'),
+(19671, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 80, 1967100, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Just Summoned - Run Script'),
+(19671, 0, 1, 2, 19, 0, 100, 1, 10218, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Quest Accept Ancient Spirit - Store Targetlist'),
+(19671, 0, 2, 0, 61, 0, 100, 0, 10218, 0, 0, 0, 80, 1967101, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Quest Accept Ancient Spirit - Store Targetlist'),
+(19671, 0, 3, 0, 40, 0, 100, 0, 1, 1967101, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP2 (Path 2) - Say Line 4'),
+(19671, 0, 4, 0, 40, 0, 100, 0, 2, 1967101, 0, 0, 80, 1967102, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP4 (Path 2) - Run Script 3'),
+(19671, 0, 5, 0, 40, 0, 100, 0, 9, 1967101, 0, 0, 80, 1967103, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP11 (Path 2) - Run Script 4'),
+(19671, 0, 6, 7, 40, 0, 100, 0, 16, 1967101, 0, 0, 1, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP18 (Path 2) - Say Line 8'),
+(19671, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 54, 7000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP18 (Path 2) - Pause WP'),
+(19671, 0, 8, 20, 40, 0, 100, 0, 17, 1967101, 0, 0, 1, 9, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP19 (Path 2) - Say Line 9'),
+(19671, 0, 9, 0, 40, 0, 100, 0, 20, 1967101, 0, 0, 80, 1967104, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP22 (Path 2) - Run Script 5'),
+(19671, 0, 10, 0, 40, 0, 100, 0, 31, 1967101, 0, 0, 80, 1967108, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP29 (Path 2) - Run Script 9'),
+(19671, 0, 13, 0, 40, 0, 100, 0, 36, 1967101, 0, 0, 80, 1967105, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP34 (Path 2) - Run Script 6'),
+(19671, 0, 14, 0, 40, 0, 100, 0, 43, 1967101, 0, 0, 80, 1967106, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP41 (Path 2) - Run Script 7'),
+(19671, 0, 15, 0, 6, 0, 100, 0, 0, 0, 0, 0, 6, 10218, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Death - Fail Quest'),
+(19671, 0, 16, 0, 38, 0, 100, 0, 1, 1, 0, 0, 80, 1967107, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Data Set - Run Script 8'),
+(19671, 0, 17, 0, 0, 1, 100, 0, 2000, 3000, 3000, 5000, 11, 13901, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - IC (Phase 1) - Cast Arcane Bolt'),
+(19671, 0, 18, 0, 9, 1, 100, 0, 0, 10, 15000, 23000, 11, 22938, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Range (Phase 1) - Cast Arcane Explosion'),
+(19671, 0, 19, 0, 4, 1, 100, 0, 0, 0, 0, 0, 11, 33839, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Agro (Phase 1) - Cast Vir aani Concentration'),
+(19671, 0, 20, 0, 61, 0, 100, 0, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Link - Turn run on'),
+(19671, 0, 22, 0, 40, 0, 100, 0, 5, 1967101, 0, 0, 59, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP5 Turn run on'),
+(19671, 0, 23, 0, 40, 0, 100, 0, 12, 1967101, 0, 0, 59, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On reached WP12 - Turn run off'),
+(19671, 0, 24, 0, 40, 0, 100, 0, 15, 1967101, 0, 0, 59, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On reached WP15 - Turn run off'),
+(19671, 0, 25, 0, 40, 0, 100, 0, 4, 1967101, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reached WP4 - Set NPC Flags'),
+(19671, 0, 26, 0, 25, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - On Reset - Set Phase 1'),
+(1966600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - Script - Say Line 0'),
+(1966600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - Script - Set Unit Flags'),
+(1966600, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 53, 1, 19666, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - Script - Start WP'),
+(1966600, 9, 3, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - Script - Say Line 1'),
+(1966600, 9, 4, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 14, 0, 0, 0, 0, 0, 19, 19671, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - Script - Say Line 14 on Cryo-Engineer Sha heen'),
+(1966600, 9, 5, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - Script - Say Line 2'),
+(1966600, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - Script - Set Unit Flags'),
+(1966600, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - Script - Set Hostile'),
+(1966600, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - Script - Set Aggressive'),
+(1966600, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 19671, 0, 0, 0, 0, 0, 0, 'Shadow Lord Xiraxis - Script - Start Attack'),
+(1967200, 9, 0, 0, 0, 0, 100, 0, 500, 500, 0, 0, 11, 12980, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Consortium Laborer - Script - Cast Simple Teleport'),
+(1967100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Set Phase 2'),
+(1967100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Rempve NPC Flags'),
+(1967100, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 33839, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Cast Vir aani Concentration'),
+(1967100, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Say Line 0'),
+(1967100, 9, 4, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Say Line 1'),
+(1967100, 9, 5, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 53, 0, 1967100, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Start WP'),
+(1967100, 9, 6, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Say Line 1'),
+(1967100, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 17, 234, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Set Emote State'),
+(1967100, 9, 8, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Set Emote State'),
+(1967100, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Set NPC Flags'),
+(1967100, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 107, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Summon Group 4'),
+(1967100, 9, 11, 0, 0, 0, 100, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Disable Auto Attack'),
+(1967100, 9, 12, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script - Set Phase 1'),
+(1967101, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 2 - Say Line 3'),
+(1967101, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 495, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 2 - Set Faction'),
+(1967101, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 53, 0, 1967101, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 2 - Start WP'),
+(1967102, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Set Phase 2'),
+(1967102, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Disable Combat Movement'),
+(1967102, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Set Passive'),
+(1967102, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 54, 10000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Pause WP'),
+(1967102, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 17, 233, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Set Emotestate'),
+(1967102, 9, 5, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Set Emotestate'),
+(1967102, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Enable Combat Movement'),
+(1967102, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Set Phase 1'),
+(1967102, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Say Line 5'),
+(1967102, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Set Defensive'),
+(1967102, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 3 - Turn Run Off'),
+(1967103, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Set Phase 2'),
+(1967103, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Disable Combat Movemet'),
+(1967103, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Set Passive'),
+(1967103, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0.2617994, 'Cryo-Engineer Sha heen - Script 4 - Set Orientation'),
+(1967103, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 54, 10000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Pause WP'),
+(1967103, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 17, 233, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Set Emotestate'),
+(1967103, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Say Line 6'),
+(1967103, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 107, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Summon Group 0'),
+(1967103, 9, 8, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Say Line 6'),
+(1967103, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Set Emotestate'),
+(1967103, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Set Phase 1'),
+(1967103, 9, 11, 0, 0, 0, 100, 0, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Set Defensive'),
+(1967103, 9, 12, 0, 0, 0, 100, 0, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Enable Combat Movemet'),
+(1967103, 9, 13, 0, 0, 0, 100, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Set Run Off'),
+(1967104, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Set Phase 2'),
+(1967104, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Set Passive'),
+(1967104, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Disable Combat Movement'),
+(1967104, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0.1396263, 'Cryo-Engineer Sha heen - Script 5 - Set Orientation'),
+(1967104, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 54, 10000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Pause WP'),
+(1967104, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 17, 233, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Set Emotestate'),
+(1967104, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 107, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 4 - Summon Group 1'),
+(1967104, 9, 7, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Set Emotestate'),
+(1967104, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Enable Combat Movement'),
+(1967104, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Set Phase 1'),
+(1967104, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Set Defensive'),
+(1967104, 9, 11, 0, 0, 0, 100, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Turn run off'),
+(1967105, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Set Phase 2'),
+(1967105, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Set Passive'),
+(1967105, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Disable Combat Movement'),
+(1967105, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 6.091199, 'Cryo-Engineer Sha heen - Script 6 - Set Orientation'),
+(1967105, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 54, 30000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Pause WP'),
+(1967105, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 17, 233, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Set Emotestate'),
+(1967105, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 11, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Say Line 11'),
+(1967105, 9, 7, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Set Emotestate'),
+(1967105, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Set Defensive'),
+(1967105, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Set Phase 1'),
+(1967105, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Enable Combat Movement'),
+(1967105, 9, 11, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 12, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Say Line 12'),
+(1967105, 9, 12, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 13, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 6 - Say Line 13'),
+(1967105, 9, 13, 0, 0, 0, 100, 0, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 5 - Say Line 11'),
+(1967106, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 54, 10000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 7 - Pause WP'),
+(1967106, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 107, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 7 - Summon Group 3'),
+(1967106, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 7 - Summon Group 3'),
+(1967107, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 15, 10218, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 8 - Complete Quest'),
+(1967107, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 15, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 8 - Say Line 15'),
+(1967107, 9, 2, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 8 - Say Line 16'),
+(1967107, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 15000, 0, 0, 0, 0, 0, 9, 19672, 0, 100, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 8 - Despawn'),
+(1967107, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 15000, 0, 0, 0, 0, 0, 9, 19673, 0, 100, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 8 - Despawn'),
+(1967107, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 8 - Despawn'),
+(1967108, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 9 - Say Line 10'),
+(1967108, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 107, 5, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 9 - Summon Group 5'),
+(1967108, 9, 2, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 107, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 9 - SUmmon Group 2'),
+(1967108, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cryo-Engineer Sha heen - Script 9 - Turn Run On');
+
+
+
+
+
+DELETE FROM `creature_text` WHERE `entry`=19666 AND `groupid`>0 AND `id`=0;
+
+DELETE FROM `creature_text` WHERE `entry`=19671;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(19671, 0, 0, '%s checks to make sure his body is intact.', 16, 0, 100, 0, 0, 0, 17228, 0, 'Cryo-Engineer Sha heen'),
+(19671, 1, 0, 'You made it! Well done, $r. Now if you''ll excuse me, I have to get the rest of our crew inside.', 12, 0, 100, 1, 0, 0, 17229, 0, 'Cryo-Engineer Sha heen'),
+(19671, 2, 0, '%s expertly manipulates the control panel.', 16, 0, 100, 0, 0, 0, 17230, 0, 'Cryo-Engineer Sha heen'),
+(19671, 3, 0, 'Let''s not waste any time! Take anything that isn''t nailed down to the floor and teleport directly to Stormspire! Chop chop!', 12, 0, 100, 1, 0, 0, 17231, 0, 'Cryo-Engineer Sha heen'),
+(19671, 4, 0, 'This should''t take very long. Just watch my back as I empty these nether collectors.', 12, 0, 100, 1, 0, 0, 17246, 0, 'Cryo-Engineer Sha heen'),
+(19671, 5, 0, 'Fantastic! Let''s move on, shall we?', 12, 0, 100, 1, 0, 0, 17248, 0, 'Cryo-Engineer Sha heen'),
+(19671, 6, 0, 'Looking at these energy levels, Shaffar was set to make a killing!', 12, 0, 100, 1, 0, 0, 17249, 0, 'Cryo-Engineer Sha heen'),
+(19671, 7, 0, 'That should do it...', 12, 0, 100, 1, 0, 0, 17251, 0, 'Cryo-Engineer Sha heen'),
+(19671, 8, 0, 'Hrm, now where is the next collector?', 12, 0, 100, 1, 0, 0, 17252, 0, 'Cryo-Engineer Sha heen'),
+(19671, 9, 0, 'Ah, there it is. Follow me, fleshling.', 12, 0, 100, 1, 0, 0, 17254, 0, 'Cryo-Engineer Sha heen'),
+(19671, 10, 0, 'What do we have here? I thought you said the area was secure? This is now the third attack? If we make it out of here, I will definitely be deducting this from your reward. Now don''t just stand there, destroy them so I can get to that collector.', 12, 0, 100, 1, 0, 0, 17256, 0, 'Cryo-Engineer Sha heen'),
+(19671, 11, 0, 'We''re close to the exit. I''ll let you rest for about thirty seconds, but then we''re out of here.', 12, 0, 100, 1, 0, 0, 17258, 0, 'Cryo-Engineer Sha heen'),
+(19671, 12, 0, 'Are you ready to go?', 12, 0, 100, 1, 0, 0, 17260, 0, 'Cryo-Engineer Sha heen'),
+(19671, 13, 0, 'Ok break time is OVER. Let''s go!', 12, 0, 100, 1, 0, 0, 17261, 0, 'Cryo-Engineer Sha heen'),
+(19671, 14, 0, 'Oh really? And what might that be?', 12, 0, 100, 1, 0, 0, 17263, 0, 'Cryo-Engineer Sha heen'),
+(19671, 15, 0, 'He was right, you know. I''ll have to take that tag-line for my own… It''s not like he''ll have a use for it anymore!', 12, 0, 100, 1, 0, 0, 17264, 0, 'Cryo-Engineer Sha heen'),
+(19671, 16, 0, 'Thanks and good luck!', 12, 0, 100, 1, 0, 0, 17265, 0, 'Cryo-Engineer Sha heen'),
+(19666, 1, 0, 'Bravo! Bravo! Good show… I couldn''t convince you to work for me, could I? No, I suppose the needless slaughter of my employees might negatively impact your employment application.', 14, 0, 100, 0, 0, 0, 17241, 0, 'Shadow Lord Xiraxis'),
+(19666, 2, 0, 'Your plan was a good one, Sha''heen, and you would have gotten away with it if not for one thing...', 12, 0, 100, 327, 0, 0, 17243, 0, 'Shadow Lord Xiraxis'),
+(19666, 3, 0, 'Never underestimate the other ethereal''s greed!', 12, 0, 100, 1, 0, 0, 17244, 0, 'Shadow Lord Xiraxis');
+
+DELETE FROM `waypoints` WHERE `entry` IN(1967100,1967101,19666);
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(19666, 1, -68.40214, -19.7878, -0.9529961, 'Shadow Lord Xiraxis'),
+(19666, 2, -67.83204, -48.33409, -0.9552881, 'Shadow Lord Xiraxis'),
+(19666, 3, -67.78506, -75.71738, -0.9389226, 'Shadow Lord Xiraxis'),
+(1967100, 1, -354.443, -65.6078, -0.9741728, 'Cryo-Engineer Sha heen'),
+(1967101, 1, -366.7985 ,-72.95073 ,-0.1383943, 'Cryo-Engineer Sha heen'),
+(1967101, 2, -370.5689 ,-73.03973 ,0.7014256, 'Cryo-Engineer Sha heen'),
+(1967101, 3, -363.5802 ,-72.44846 ,-0.9587624, 'Cryo-Engineer Sha heen'),
+(1967101, 4, -371.8158 ,-86.79798 ,-0.958762, 'Cryo-Engineer Sha heen'),
+(1967101, 5, -372.8067 ,-115.3902 ,-0.9587386, 'Cryo-Engineer Sha heen'),
+(1967101, 6, -373.5266 ,-149.3968 ,-0.9787918, 'Cryo-Engineer Sha heen'),
+(1967101, 7, -382.3674 ,-163.1939 ,-0.9493812, 'Cryo-Engineer Sha heen'),
+(1967101, 8, -378.7728 ,-164.4431 ,-0.1216383, 'Cryo-Engineer Sha heen'),
+(1967101, 9, -375.3421 ,-164.1911 ,0.7157794, 'Cryo-Engineer Sha heen'),
+(1967101, 10, -377.8079 ,-164.3831 ,0.09416915, 'Cryo-Engineer Sha heen'),
+(1967101, 11, -381.8036 ,-167.0499 ,-0.9587629, 'Cryo-Engineer Sha heen'),
+(1967101, 12, -374.2704 ,-195.67 ,-0.9876157, 'Cryo-Engineer Sha heen'),
+(1967101, 13, -371.0522 ,-221.1154 ,-0.957548, 'Cryo-Engineer Sha heen'),
+(1967101, 14, -357.3525 ,-224.1118 ,-0.9591594, 'Cryo-Engineer Sha heen'),
+(1967101, 15, -327.2074 ,-223.1011 ,-0.958185, 'Cryo-Engineer Sha heen'),
+(1967101, 16, -317.373 ,-220.9346 ,-0.953047, 'Cryo-Engineer Sha heen'),
+(1967101, 17, -302.139 ,-201.6109 ,-0.9018583, 'Cryo-Engineer Sha heen'),
+(1967101, 18, -291.9838 ,-190.2706 ,-0.9321695, 'Cryo-Engineer Sha heen'),
+(1967101, 19, -272.2044 ,-165.1142 ,-1.962067, 'Cryo-Engineer Sha heen'),
+(1967101, 20, -260.8738 ,-158.3423 ,-1.20301, 'Cryo-Engineer Sha heen'),
+(1967101, 21, -260.8686 ,-160.7864 ,-1.202524, 'Cryo-Engineer Sha heen'),
+(1967101, 22, -246.7021 ,-160.2355 ,-0.9534798, 'Cryo-Engineer Sha heen'),
+(1967101, 23, -238.4669 ,-174.3582 ,-0.953746, 'Cryo-Engineer Sha heen'),
+(1967101, 24, -237.8523 ,-188.0232 ,-0.9510807, 'Cryo-Engineer Sha heen'),
+(1967101, 25, -218.7323 ,-207.1752 ,0.04777823, 'Cryo-Engineer Sha heen'),
+(1967101, 26, -207.835, -211.8027, 1.176572, 'Cryo-Engineer Sha heen'),
+(1967101, 27, -195.085, -217.8027, 0.4265722, 'Cryo-Engineer Sha heen'),
+(1967101, 28, -190.835, -219.5527, -0.5734278, 'Cryo-Engineer Sha heen'),
+(1967101, 29, -183.5801 ,-223.2924 ,-0.9551997, 'Cryo-Engineer Sha heen'),
+(1967101, 30, -147.253 ,-222.2017 ,-0.7159179, 'Cryo-Engineer Sha heen'),
+(1967101, 31, -114.5249 ,-221.926 ,0.4013355, 'Cryo-Engineer Sha heen'),
+(1967101, 32, -89.60782 ,-222.852 ,-0.5187308, 'Cryo-Engineer Sha heen'),
+(1967101, 33, -67.58874 ,-223.6537 ,-0.405379, 'Cryo-Engineer Sha heen'),
+(1967101, 34, -56.8648 ,-223.1615 ,0.02639319, 'Cryo-Engineer Sha heen'),
+(1967101, 35, -20.5673 ,-224.0332 ,0.5167194, 'Cryo-Engineer Sha heen'),
+(1967101, 36, -12.58579 ,-222.5067 ,1.786049, 'Cryo-Engineer Sha heen'),
+(1967101, 37, -29.4036 ,-223.2606 ,0.01665334, 'Cryo-Engineer Sha heen'),
+(1967101, 38, -53.08645 ,-219.6514 ,0.2137061, 'Cryo-Engineer Sha heen'),
+(1967101, 39, -64.90977 ,-210.4424 ,-0.292502, 'Cryo-Engineer Sha heen'),
+(1967101, 40, -66.85043 ,-179.138 ,-1.307152, 'Cryo-Engineer Sha heen'),
+(1967101, 41, -67.13032 ,-133.7884 ,-1.034937, 'Cryo-Engineer Sha heen'),
+(1967101, 42, -67.16659 ,-112.9431 ,-0.7426757, 'Cryo-Engineer Sha heen'),
+(1967101, 43, -67.0159 ,-87.2571 ,-1.276771, 'Cryo-Engineer Sha heen');
+
+DELETE FROM `creature_summon_groups` WHERE `summonerId`=19671;
+INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`) VALUES
+(19671, 0, 0, 18312, -370.7318, -134.3002, -0.9618373, 4.572175, 6, 60000),
+(19671, 0, 0, 18315, -374.4721, -194.6065, -0.9929181, 1.529337, 6, 60000),
+(19671, 0, 0, 18312, -369.9984, -194.276, -0.9705924, 1.623082, 6, 60000),
+(19671, 0, 0, 18315, -375.2323, -133.8772, -0.968161, 4.922849, 6, 60000),
+(19671, 0, 1, 18311, -238.7594, -186.9294, -0.9510754, 1.999699, 6, 60000),
+(19671, 0, 1, 18313, -225.0942, -172.4903, -1.055191, 2.76561, 6, 60000),
+(19671, 0, 1, 18313, -288.748, -178.6396, -0.5875124, 0.6407801, 6, 60000),
+(19671, 0, 1, 18313, -283.9628, -188.2815, -0.3590364, 0.9258388, 6, 60000),
+(19671, 0, 2, 19307, -13.30131, -220.9802, 0.8455964, 3.126897, 6, 60000),
+(19671, 0, 3, 19666, -36.36667, 1.317166, -0.9543327, 3.285605, 6, 60000),
+(19671, 0, 4, 19673, -386.8928, -60.84314, -0.8754397, 3.368485, 6, 60000),
+(19671, 0, 4, 19672, -386.847, -72.83556, -0.8754347, 2.635447, 6, 60000),
+(19671, 0, 4, 19673, -375.7296, -88.8795, -0.8754307, 3.385939, 6, 60000),
+(19671, 0, 4, 19672, -360.1015, -67.55888, -0.8754327, 0.2094395, 6, 60000),
+(19671, 0, 4, 19673, -358.8426, -74.0751, -0.8726627, 0.6806784, 6, 60000),
+(19671, 0, 4, 19672, -370.8748, -82.77579, -0.8754287, 0.08726646, 6, 60000),
+(19671, 0, 4, 19673, -374.6943, -63.50459, -0.8754317, 0.5759587, 6, 60000),
+(19671, 0, 4, 19672, -358.8426, -74.0751, -0.8726627, 0.6806784, 6, 60000),
+(19671, 0, 4, 19673, -375.8055, -86.87415, -0.9587618, 1.608575, 6, 60000),
+(19671, 0, 4, 19673, -386.8928, -60.84314, -0.8754397, 3.368485, 6, 60000),
+(19671, 0, 5, 19307, -47.63387, -223.8948, -0.1993168, 3.440399, 6, 60000);
diff --git a/sql/updates/world/3.3.5/2016_05_28_03_world.sql b/sql/updates/world/3.3.5/2016_05_28_03_world.sql
new file mode 100644
index 00000000000..69ee8803260
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_28_03_world.sql
@@ -0,0 +1,25 @@
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=22139;
+UPDATE `smart_scripts` SET `target_param1`=22139, `target_param2`=100, `action_param2`=64 WHERE `entryorguid`=22138 AND `source_type`=0 AND `id`=0;
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=38469 AND `ElseGroup`=0;
+DELETE FROM `gameobject` WHERE `id`=184750;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (22137);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (22137) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (22138) AND `source_type`=0 AND id IN(1,2);
+
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(22137, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 75, 38457, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,0,'Summoned Old God - On reset - Add Transparency'),
+(22137, 0, 1, 0, 1, 8, 100, 0, 0, 0, 240000, 240000, 50, 184750, 240, 0, 0, 0, 0, 8, 0, 0, 0, -4161.259277, 1985.773804, 59.094448, 6.210211,'Summoned Old God - OOC (Phase 4) - spawn spell focus'),
+(22137, 0, 2, 0, 38, 0, 100, 0, 1, 1, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Summoned Old God - On Data Set 1 1 - Increment Phase'),
+(22137, 0, 3, 0, 38, 0, 100, 0, 2, 2, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Summoned Old God - On Data Set 2 2 - Set Phase 0'),
+(22137, 0, 4, 0, 11, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Summoned Old God - On Spawn Set Active'),
+(22137, 0, 5, 6, 8, 0, 100, 0, 38482, 0, 0, 0, 33, 22137, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,'Summoned Old God - On Spellhit - Give Kill Credit'),
+(22137, 0, 6, 7, 61, 0, 0, 0, 0, 0, 0, 0, 11, 37281, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Summoned Old God - On Spellhit - Cast Infernal Oversouls Wrath'),
+(22137, 0, 7, 8, 61, 0, 0, 0, 0, 0, 0, 0, 41, 1000, 0, 0, 0, 0, 0, 19, 22146, 0, 0, 0, 0, 0, 0,'Summoned Old God - On Spellhit - Despawn Summoning Voidstorm'),
+(22138, 0, 1, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 22137, 100, 0, 0, 0, 0,0,'Dark Conclave Ritualist - On Death - Set Data'),
+(22138, 0, 2, 0, 11, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, 22137, 100, 0, 0, 0, 0,0,'Dark Conclave Ritualist - On Respawn - Set Data');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=37281 AND `SourceId`=0 AND `ElseGroup`IN(2,3);
+
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 37281, 0, 2, 31, 0, 3, 22137, 0, 0, 0, 0, '', 'Infernal Oversouls Wrath targets Summoned Old God'),
+(13, 1, 37281, 0, 3, 31, 0, 3, 22146, 0, 0, 0, 0, '', 'Infernal Oversouls Wrath targets Summoning Voidstorm');
diff --git a/sql/updates/world/3.3.5/2016_05_30_00_world.sql b/sql/updates/world/3.3.5/2016_05_30_00_world.sql
new file mode 100644
index 00000000000..b6fdc5f3b89
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `ExclusiveGroup` = 11211 WHERE `ID` IN (11211,11214,11215);
diff --git a/sql/updates/world/3.3.5/2016_05_30_01_world.sql b/sql/updates/world/3.3.5/2016_05_30_01_world.sql
new file mode 100644
index 00000000000..a18ffe23ed5
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_01_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestID`=0 WHERE `ID`=11261;
diff --git a/sql/updates/world/3.3.5/2016_05_30_02_world.sql b/sql/updates/world/3.3.5/2016_05_30_02_world.sql
new file mode 100644
index 00000000000..2742f9c8ca9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_02_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `quest_template_addon` WHERE `MaxLevel` = 0 AND `AllowableClasses` = 0 AND `SourceSpellID` = 0 AND `PrevQuestID` = 0 AND `NextQuestID` = 0 AND `ExclusiveGroup` = 0 AND `RewardMailTemplateID` = 0 AND `RewardMailDelay` = 0 AND `RequiredSkillID` = 0 AND `RequiredSkillPoints` = 0 AND `RequiredMinRepFaction` = 0 AND `RequiredMaxRepFaction` = 0 AND `RequiredMinRepValue` = 0 AND `RequiredMaxRepValue` = 0 AND `ProvidedItemCount` = 0 AND `SpecialFlags` = 0;
diff --git a/sql/updates/world/3.3.5/2016_05_30_03_world.sql b/sql/updates/world/3.3.5/2016_05_30_03_world.sql
new file mode 100644
index 00000000000..eeaa7bf6d7b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_03_world.sql
@@ -0,0 +1,7 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=50232;
+INSERT INTO `conditions` VALUES
+(13, 1, 50232, 0, 1, 31, 0, 3, 28236, 0, 0, 0, 0, "", "Searing Wrath target can be Azure Ring Captain"),
+(13, 1, 50232, 0, 2, 31, 0, 3, 27638, 0, 0, 0, 0, "", "Searing Wrath target can be Azure Ring Guardian"),
+(13, 1, 50232, 0, 3, 31, 0, 3, 28276, 0, 0, 0, 0, "", "Searing Wrath target can be Greater Lay Whelp"),
+(13, 1, 50232, 0, 4, 31, 0, 3, 27656, 0, 0, 0, 0, "", "Searing Wrath target can be Eregos");
diff --git a/sql/updates/world/3.3.5/2016_05_30_04_world.sql b/sql/updates/world/3.3.5/2016_05_30_04_world.sql
new file mode 100644
index 00000000000..0fc9244c100
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_04_world.sql
@@ -0,0 +1,2 @@
+-- Change the Text <Name> to $N
+UPDATE `quest_request_items` SET `CompletionText`= "Back so soon? In case I didn\'t make myself clear we need you to kill 10 Stonesplinter Shaman and 10 Stonesplinter Bonesnappers, $N. Now go get\'em, Trogg-Slayer!" WHERE `id` = 263;
diff --git a/sql/updates/world/3.3.5/2016_05_30_05_world.sql b/sql/updates/world/3.3.5/2016_05_30_05_world.sql
new file mode 100644
index 00000000000..7209b3d8745
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_05_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `quest_template_addon` SET `SpecialFlags` = 1 WHERE `Id` = 13845;
+DELETE FROM `conditions` WHERE `SourceEntry` = 46004 AND `SourceTypeOrReferenceId` = 10;
diff --git a/sql/updates/world/3.3.5/2016_05_30_06_world.sql b/sql/updates/world/3.3.5/2016_05_30_06_world.sql
new file mode 100644
index 00000000000..5c81fcd5419
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_06_world.sql
@@ -0,0 +1,12 @@
+--
+DELETE FROM `gameobject_queststarter` WHERE `quest` IN (4722,4723,4725,4727,4728,4730,4731,4732,4733);
+INSERT INTO `gameobject_queststarter` VALUES
+(176190, 4722),
+(175233, 4723),
+(176197, 4725),
+(176196, 4727),
+(175226, 4728),
+(175227, 4730),
+(176198, 4731),
+(176191, 4732),
+(175230, 4733);
diff --git a/sql/updates/world/3.3.5/2016_05_30_07_world.sql b/sql/updates/world/3.3.5/2016_05_30_07_world.sql
new file mode 100644
index 00000000000..c8130b023af
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_07_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `achievement_criteria_data` SET `value1`=8 WHERE `criteria_id`=4958 AND `type`=8;
diff --git a/sql/updates/world/3.3.5/2016_05_30_08_world.sql b/sql/updates/world/3.3.5/2016_05_30_08_world.sql
new file mode 100644
index 00000000000..134617b0380
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_08_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid`=17071 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(17071,0,0,0,20,0,100,0,9312,0,0,0,80,1707100,2,0,0,0,0,1,0,0,0,0,0,0,0,"Technician Zhanaa - On Quest 'The Emitter' Finished - Run Script");
diff --git a/sql/updates/world/3.3.5/2016_05_30_09_world.sql b/sql/updates/world/3.3.5/2016_05_30_09_world.sql
new file mode 100644
index 00000000000..3ec588d0982
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_09_world.sql
@@ -0,0 +1,5 @@
+UPDATE `quest_template_addon` SET `SpecialFlags`=2 WHERE `ID`=1144;
+UPDATE `creature_template` SET `flags_extra`=64 WHERE `entry` IN(28111,28112,28078,28079,23667, 23668, 32669,28844,28843,24199,24198,23564);
+UPDATE `reference_loot_template` SET `GroupId`=2 WHERE `Entry`=34203 AND `Item`=43959;
+UPDATE `smart_scripts` SET `target_type`=12, `target_param1`=1 WHERE `entryorguid`=2735500 AND `source_type`=9 AND `id`=5 AND `link`=0;
+UPDATE `gameobject` SET `position_x`=5445.057129, `position_y`=4908.831543, `position_z`=-189.508224 WHERE `guid`=99748;
diff --git a/sql/updates/world/3.3.5/2016_05_30_10_world.sql b/sql/updates/world/3.3.5/2016_05_30_10_world.sql
new file mode 100644
index 00000000000..b8dbe0b94a6
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_30_10_world.sql
@@ -0,0 +1,26 @@
+DELETE FROM `gameobject_loot_template` WHERE `Entry`=26782;
+INSERT INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
+(26782, 44724, 0, 100, 0, 1, 1, 1, 1, NULL), -- Everfrost Chip
+(26782, 44725, 0, 19, 0, 1, 2, 1, 1, NULL), -- Everfrost Chip (Quest Starter)
+(26782, 44729, 0, 81, 0, 1, 2, 1, 1, NULL); -- Everfrost Powder
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=4 AND `SourceGroup`=26782;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(4, 26782, 44724, 0, 1, 8, 0, 13420, 0, 0, 0, 0, 0, '', NULL), -- Everfrost Chip only drops if player is rewarded for ever frost,
+(4, 26782, 44729, 0, 0, 9, 0, 13420, 0, 0, 1, 0, 0, '', NULL), -- Everfrost powder only drops if player has not taken or completed Everfrost,
+(4, 26782, 44729, 0, 0, 8, 0, 13420, 0, 0, 1, 0, 0, '', NULL), -- Everfrost powder only drops if player has not taken or completed Everfrost,
+(4, 26782, 44725, 0, 0, 9, 0, 13420, 0, 0, 1, 0, 0, '', NULL), -- Everfrost Chip (Quest Starter) only drops if player has not taken or completed Everfrost,
+(4, 26782, 44725, 0, 0, 8, 0, 13420, 0, 0, 1, 0, 0, '', NULL), -- Everfrost Chip (Quest Starter) only drops if player has not taken or completed Everfrost,
+(4, 26782, 44725, 0, 0, 5, 0, 1119, 8, 0, 0, 0, 0, '', NULL); -- Everfrost Chip (Quest Starter) only drops if player is friendly with Sons of Hodir,
+
+UPDATE `quest_template_addon` SET `SpecialFlags`=1 WHERE `ID`=13421;
+
+DELETE FROM `creature_questender` WHERE `quest`=13421;
+INSERT INTO `creature_questender` (`id`, `quest`) VALUES
+(32594, 13421);
+
+DELETE FROM `creature_queststarter` WHERE `quest`=13421;
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(32594, 13421);
+
+UPDATE `quest_template_addon` SET `PrevQuestID`=13420 WHERE `ID`=13421;
diff --git a/sql/updates/world/3.3.5/2016_05_31_00_world.sql b/sql/updates/world/3.3.5/2016_05_31_00_world.sql
new file mode 100644
index 00000000000..29a29413167
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_00_world.sql
@@ -0,0 +1,6 @@
+--
+UPDATE `creature` SET `position_x`= -3739.09, `position_y`= 5405.21, `position_z`=-3.33350, `orientation`=2.70103, `MovementType`=0, `spawndist`=0 WHERE `guid`=78837 AND `id`=22464;
+UPDATE `creature` SET `position_x`= -3743.46, `position_y`= 5403.87, `position_z`=-3.33635, `orientation`=1.16950, `MovementType`=0, `spawndist`=0 WHERE `guid`=78838 AND `id`=22464;
+UPDATE `creature` SET `position_x`= -3746.42, `position_y`= 5405.33, `position_z`=-3.33737, `orientation`=0.39587, `MovementType`=0, `spawndist`=0 WHERE `guid`=78839 AND `id`=22464;
+UPDATE `creature` SET `position_x`= -3750.65, `position_y`= 5408.94, `position_z`=-3.33391, `orientation`=2.54786, `MovementType`=0, `spawndist`=0 WHERE `guid`=78840 AND `id`=22464;
+UPDATE `creature` SET `position_x`= -3741.11, `position_y`= 5403.61, `position_z`=-3.33493, `orientation`=1.9117 WHERE `guid`=78818 AND `id`=22458;
diff --git a/sql/updates/world/3.3.5/2016_05_31_01_world_335.sql b/sql/updates/world/3.3.5/2016_05_31_01_world_335.sql
new file mode 100644
index 00000000000..2d92a9fc537
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_01_world_335.sql
@@ -0,0 +1,9 @@
+--
+DELETE FROM `conditions` WHERE `SourceEntry` IN (6545, 6546, 6547) AND `SourceTypeOrReferenceId` IN (19, 20);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(19, 0, 6545, 0, 0, 9, 0, 6543, 0, 0, 0, 0, 0, "", "Quest 'Warsong Runner Update' - Can accept if player has quest 'The Warsong Reports' in quest log"),
+(20, 0, 6545, 0, 0, 9, 0, 6543, 0, 0, 0, 0, 0, "", "Quest 'Warsong Runner Update' - Can accept if player has quest 'The Warsong Reports' in quest log"),
+(19, 0, 6546, 0, 0, 9, 0, 6543, 0, 0, 0, 0, 0, "", "Quest 'Warsong Outrider Update' - Can accept if player has quest 'The Warsong Reports' in quest log"),
+(20, 0, 6546, 0, 0, 9, 0, 6543, 0, 0, 0, 0, 0, "", "Quest 'Warsong Outrider Update' - Can accept if player has quest 'The Warsong Reports' in quest log"),
+(19, 0, 6547, 0, 0, 9, 0, 6543, 0, 0, 0, 0, 0, "", "Quest 'Warsong Scout Update' - Can accept if player has quest 'The Warsong Reports' in quest log"),
+(20, 0, 6547, 0, 0, 9, 0, 6543, 0, 0, 0, 0, 0, "", "Quest 'Warsong Scout Update' - Can accept if player has quest 'The Warsong Reports' in quest log");
diff --git a/sql/updates/world/3.3.5/2016_05_31_02_world.sql b/sql/updates/world/3.3.5/2016_05_31_02_world.sql
new file mode 100644
index 00000000000..09674385ab4
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_02_world.sql
@@ -0,0 +1,19 @@
+--
+UPDATE `creature` SET `spawndist`=0, `MovementType`=0, `unit_flags`=537133824 WHERE `guid` IN (103024, 103025, 103026, 103027, 103028);
+
+DELETE FROM `creature_addon` WHERE `guid` IN (103024, 103025, 103026, 103027, 103028);
+INSERT INTO `creature_addon` (`guid`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(103024, 0, 0x0, 0x1, '29266'), -- 25680 - 29266 - 29266
+(103025, 0, 0x0, 0x1, '29266'), -- 25680 - 29266 - 29266
+(103026, 0, 0x0, 0x1, '29266'), -- 25680 - 29266 - 29266
+(103027, 0, 0x0, 0x1, '29266'), -- 25680 - 29266 - 29266
+(103028, 0, 0x0, 0x1, '29266'); -- 25680 - 29266 - 29266
+
+UPDATE `creature` SET `spawndist`=0, `MovementType`=0 WHERE `id`=29546;
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN (24196, 29546);
+INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(24196, 0, 0x0, 0x1, '29266'), -- 24196 - 29266
+(29546, 0, 0x0, 0x1, '29266'); -- 29546 - 29266
+
+DELETE FROM `creature_addon` WHERE `guid`=105491;
diff --git a/sql/updates/world/3.3.5/2016_05_31_03_world.sql b/sql/updates/world/3.3.5/2016_05_31_03_world.sql
new file mode 100644
index 00000000000..60c07d15735
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_03_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `conditions` SET `ConditionValue1`=11248, `Comment`='Winterskorn mobs drop item 33314 only if Quest 11248 has been rewarded' WHERE `SourceTypeOrReferenceId`=1 AND `SourceEntry`=33314;
+UPDATE `conditions` SET `ConditionValue1`=11256, `Comment`='Winterskorn mobs drop item 33345 only if Quest 11256 has been rewarded' WHERE `SourceTypeOrReferenceId`=1 AND `SourceEntry`=33345;
diff --git a/sql/updates/world/3.3.5/2016_05_31_04_world.sql b/sql/updates/world/3.3.5/2016_05_31_04_world.sql
new file mode 100644
index 00000000000..d3ddfcfa05c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_04_world.sql
@@ -0,0 +1,15 @@
+--
+DELETE FROM `areatrigger_scripts` WHERE `entry` IN (5187, 5190);
+INSERT INTO `areatrigger_scripts` VALUES
+(5187, "SmartTrigger"),
+(5190, "SmartTrigger");
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (5187, 5190) AND `source_type`=2;
+INSERT INTO `smart_scripts` VALUES
+(5187, 2, 0, 0, 46, 0, 100, 0, 0, 0, 0, 0, 62, 571, 0, 0, 0, 0, 0, 7, 0, 0, 0, 6150.7563, -1071.3817, 402.7154, 2.1916, "Areatrigger - On Trigger - Teleport"),
+(5190, 2, 0, 0, 46, 0, 100, 0, 0, 0, 0, 0, 62, 571, 0, 0, 0, 0, 0, 7, 0, 0, 0, 6314.1860, -1758.2946, 457.0714, 1.6787, "Areatrigger - On Trigger - Teleport");
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceId`=2 AND SourceEntry IN (5187, 5190);
+INSERT INTO `conditions` VALUES
+(22, 1, 5187, 2, 0, 8, 0, 12821, 0, 0, 0, 0, 0, "", "Event requires quest rewarded"),
+(22, 1, 5190, 2, 0, 8, 0, 12821, 0, 0, 0, 0, 0, "", "Event requires quest rewarded");
diff --git a/sql/updates/world/3.3.5/2016_05_31_05_world.sql b/sql/updates/world/3.3.5/2016_05_31_05_world.sql
new file mode 100644
index 00000000000..18bbf61baa4
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_05_world.sql
@@ -0,0 +1,12 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestID`=0 WHERE `Id`=12836;
+
+DELETE FROM `conditions` WHERE `SourceEntry`=12828 AND `SourceTypeOrReferenceId` IN (19, 20);
+INSERT INTO `conditions` VALUES
+(19, 0, 12828, 0, 0, 8, 0, 12827, 0, 0, 0, 0, 0, "", "Show mark for quest 'Ample Inspiration' only if quest 'Reclaimed Rations' is rewarded"),
+(20, 0, 12828, 0, 0, 8, 0, 12827, 0, 0, 0, 0, 0, "", "Can accept quest 'Ample Inspiration' only if quest 'Reclaimed Rations' is rewarded");
+
+DELETE FROM `quest_template_addon` WHERE `ID` IN (12862, 13060);
+INSERT INTO `quest_template_addon` (`ID`, `PrevQuestId`) VALUES
+(12862, 12824),
+(13060, 12824);
diff --git a/sql/updates/world/3.3.5/2016_05_31_06_world.sql b/sql/updates/world/3.3.5/2016_05_31_06_world.sql
new file mode 100644
index 00000000000..46d8b875c82
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_06_world.sql
@@ -0,0 +1,10 @@
+--
+-- remove mis-spawned Mistbat (entry: 16353)
+DELETE FROM `creature` WHERE `guid`=57016;
+
+-- remove one too many spawned Elder Springpaw (entry: 15651)
+DELETE FROM `creature` WHERE `guid`=55946;
+
+-- set random movement and spawn distance to the common value for that creature
+UPDATE `creature` SET `spawndist`=5, `MovementType`=1 WHERE `guid`=55942;
+UPDATE `creature` SET `spawndist`=5, `MovementType`=1 WHERE `guid`=55945;
diff --git a/sql/updates/world/3.3.5/2016_05_31_07_world.sql b/sql/updates/world/3.3.5/2016_05_31_07_world.sql
new file mode 100644
index 00000000000..7ed017ff1cd
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_07_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_loot_template` SET `MinCount`=1, `MaxCount`=1 WHERE `Item`=11509;
diff --git a/sql/updates/world/3.3.5/2016_05_31_08_world.sql b/sql/updates/world/3.3.5/2016_05_31_08_world.sql
new file mode 100644
index 00000000000..2cf3fbcdfc4
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_08_world.sql
@@ -0,0 +1,13 @@
+--
+DELETE FROM `conditions` WHERE `SourceEntry`=23359 AND `SourceTypeOrReferenceId`=17;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`, `ErrorType`, `ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(17, 0, 23359, 0, 0, 31, 1, 3, 5357, 0, 0, 0, 0, "", "Transmogrify! target can be Land Walker"),
+(17, 0, 23359, 0, 0, 36, 1, 0, 0, 0, 0, 0, 0, "", "Transmogrify! target must be alive"),
+(17, 0, 23359, 0, 1, 31, 1, 3, 5358, 0, 0, 0, 0, "", "Transmogrify! target can be Cliff Giant"),
+(17, 0, 23359, 0, 1, 36, 1, 0, 0, 0, 0, 0, 0, "", "Transmogrify! target must be alive"),
+(17, 0, 23359, 0, 2, 31, 1, 3, 5359, 0, 0, 0, 0, "", "Transmogrify! target can be Shore Strider"),
+(17, 0, 23359, 0, 2, 36, 1, 0, 0, 0, 0, 0, 0, "", "Transmogrify! target must be alive"),
+(17, 0, 23359, 0, 3, 31, 1, 3, 5360, 0, 0, 0, 0, "", "Transmogrify! target can be Deep Strider"),
+(17, 0, 23359, 0, 3, 36, 1, 0, 0, 0, 0, 0, 0, "", "Transmogrify! target must be alive"),
+(17, 0, 23359, 0, 4, 31, 1, 3, 5361, 0, 0, 0, 0, "", "Transmogrify! target can be Wave Strider"),
+(17, 0, 23359, 0, 4, 36, 1, 0, 0, 0, 0, 0, 0, "", "Transmogrify! target must be alive");
diff --git a/sql/updates/world/3.3.5/2016_05_31_09_world.sql b/sql/updates/world/3.3.5/2016_05_31_09_world.sql
new file mode 100644
index 00000000000..73d62a92772
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_09_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `creature_template` SET `speed_run`=0.42857 WHERE `entry` IN (16027);
+UPDATE `smart_scripts` SET `action_param1`=22 WHERE `entryorguid`=16027 AND `source_type`=0 AND `id`=3 AND `link`=4;
diff --git a/sql/updates/world/3.3.5/2016_05_31_10_world.sql b/sql/updates/world/3.3.5/2016_05_31_10_world.sql
new file mode 100644
index 00000000000..e7536b3a51a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_10_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `creature_loot_template` WHERE `Item`=31245;
diff --git a/sql/updates/world/3.3.5/2016_05_31_11_world.sql b/sql/updates/world/3.3.5/2016_05_31_11_world.sql
new file mode 100644
index 00000000000..e5d35f5eb42
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_11_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `reference_loot_template` SET `Item`=49667, `Chance`=10 WHERE `Item`=48679;
diff --git a/sql/updates/world/3.3.5/2016_05_31_12_world_335.sql b/sql/updates/world/3.3.5/2016_05_31_12_world_335.sql
new file mode 100644
index 00000000000..b20c38b36ba
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_12_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestID`=155 WHERE `ID`=214;
diff --git a/sql/updates/world/3.3.5/2016_05_31_13_world.sql b/sql/updates/world/3.3.5/2016_05_31_13_world.sql
new file mode 100644
index 00000000000..6dd3d984c1c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_13_world.sql
@@ -0,0 +1,23 @@
+--
+UPDATE `quest_template_addon` SET `ExclusiveGroup`=8747 WHERE `Id` IN (8747, 8752, 8757);
+
+UPDATE `quest_template_addon` SET `PrevQuestId`=0, `SpecialFlags`=1 WHERE `Id` IN (8764, 8765, 8766);
+
+DELETE FROM `conditions` WHERE `SourceEntry` IN (8764, 8765, 8766);
+INSERT INTO `conditions` VALUES
+(19, 0, 8764, 0, 0, 2, 0, 21200, 1, 1, 0, 0, 0, "", "Quest 8764 is available only if player has item 21200 in bags or bank"),
+(20, 0, 8764, 0, 0, 2, 0, 21200, 1, 1, 0, 0, 0, "", "Show question mark for quest 8764 only if player has item 21200 in bags or bank"),
+
+(19, 0, 8765, 0, 0, 2, 0, 21210, 1, 1, 0, 0, 0, "", "Quest 8765 is available only if player has item 21210 in bags or bank"),
+(20, 0, 8765, 0, 0, 2, 0, 21210, 1, 1, 0, 0, 0, "", "Show question mark for quest 8765 only if player has item 21210 in bags or bank"),
+
+(19, 0, 8766, 0, 0, 2, 0, 21205, 1, 1, 0, 0, 0, "", "Quest 8766 is available only if player has item 21205 in bags or bank"),
+(20, 0, 8766, 0, 0, 2, 0, 21205, 1, 1, 0, 0, 0, "", "Show question mark for quest 8766 only if player has item 21205 in bags or bank");
+
+DELETE FROM `quest_offer_reward` WHERE `ID` IN (8747, 8752, 8757);
+INSERT INTO `quest_offer_reward` (`ID`,`Emote1`,`Emote2`,`Emote3`,`Emote4`,`EmoteDelay1`,`EmoteDelay2`,`EmoteDelay3`,`EmoteDelay4`,`RewardText`,`VerifiedBuild`) VALUES
+(8747,1,0,0,0,0,0,0,0,(SELECT `CompletionText` FROM `quest_request_items` WHERE `ID`=8747),12340),
+(8752,1,0,0,0,0,0,0,0,(SELECT `CompletionText` FROM `quest_request_items` WHERE `ID`=8752),12340),
+(8757,1,0,0,0,0,0,0,0,(SELECT `CompletionText` FROM `quest_request_items` WHERE `ID`=8757),12340);
+
+UPDATE `quest_request_items` SET `CompletionText` = "Never have I seen such tenacity! The Bronze Flight grants you one final enchantment. The Timeless One himself has requested it so!$B$BHand me your signet ring so that I may make the necessary adjustments." WHERE `ID` IN (8751, 8756, 8761);
diff --git a/sql/updates/world/3.3.5/2016_05_31_14_world_335.sql b/sql/updates/world/3.3.5/2016_05_31_14_world_335.sql
new file mode 100644
index 00000000000..496a9645bda
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_31_14_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `unit_flags`=33536 WHERE `entry`=24117;
diff --git a/sql/updates/world/3.3.5/2016_06_01_00_world.sql b/sql/updates/world/3.3.5/2016_06_01_00_world.sql
new file mode 100644
index 00000000000..5f4e7dbb01c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template` SET `AllowableRaces`=1024 WHERE `ID`=9429;
diff --git a/sql/updates/world/3.3.5/2016_06_01_01_world.sql b/sql/updates/world/3.3.5/2016_06_01_01_world.sql
new file mode 100644
index 00000000000..80ecabe34aa
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_01_world.sql
@@ -0,0 +1,5 @@
+--
+UPDATE `creature` SET `position_x`=3154.581, `position_y`=-3126.18, `position_z`=293.5911, `orientation`=4.430199 WHERE `guid`=76311;
+UPDATE `creature` SET `position_x`=3128.622, `position_y`=-3119.604, `position_z`=293.4113, `orientation`=4.738929 WHERE `guid`=76312;
+UPDATE `creature` SET `position_x`=3175.281, `position_y`=-3134.764, `position_z`=293.4368, `orientation`=4.244924 WHERE `guid`=76313;
+UPDATE `smart_scripts` SET `action_param1`=34 WHERE `entryorguid`=16027 AND `source_type`=0 AND `id`=3 AND `link`=4;
diff --git a/sql/updates/world/3.3.5/2016_06_01_02_world.sql b/sql/updates/world/3.3.5/2016_06_01_02_world.sql
new file mode 100644
index 00000000000..e2c27b15339
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_02_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestID`=985 WHERE `ID`=986;
diff --git a/sql/updates/world/3.3.5/2016_06_01_03_world.sql b/sql/updates/world/3.3.5/2016_06_01_03_world.sql
new file mode 100644
index 00000000000..54beb26b15c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_03_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `AllowableClasses`=256 WHERE `ID`=397;
diff --git a/sql/updates/world/3.3.5/2016_06_01_04_world.sql b/sql/updates/world/3.3.5/2016_06_01_04_world.sql
new file mode 100644
index 00000000000..1de1716102b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_04_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template` SET `AllowableRaces`=512 WHERE `ID`=9425;
diff --git a/sql/updates/world/3.3.5/2016_06_01_05_world.sql b/sql/updates/world/3.3.5/2016_06_01_05_world.sql
new file mode 100644
index 00000000000..3d7a32ac308
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_05_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `item_loot_template` SET `Chance`=100 WHERE `Entry`=24336;
diff --git a/sql/updates/world/3.3.5/2016_06_01_06_world.sql b/sql/updates/world/3.3.5/2016_06_01_06_world.sql
new file mode 100644
index 00000000000..9344147e067
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_06_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template` SET `AllowableRaces`=0 WHERE `ID`=1486;
diff --git a/sql/updates/world/3.3.5/2016_06_01_07_world.sql b/sql/updates/world/3.3.5/2016_06_01_07_world.sql
new file mode 100644
index 00000000000..9c159c54cb6
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_07_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `creature_queststarter` WHERE `quest`=249;
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(313, 249);
diff --git a/sql/updates/world/3.3.5/2016_06_01_08_world.sql b/sql/updates/world/3.3.5/2016_06_01_08_world.sql
new file mode 100644
index 00000000000..356c0561bf2
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_08_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_loot_template` SET `Chance`=100 WHERE `Item`=29795;
diff --git a/sql/updates/world/3.3.5/2016_06_01_09_world.sql b/sql/updates/world/3.3.5/2016_06_01_09_world.sql
new file mode 100644
index 00000000000..5cf06521a19
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_09_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `quest_template_addon` WHERE `ID`=768;
+INSERT INTO `quest_template_addon` (`ID`, `RequiredSkillID`, `RequiredSkillPoints`) VALUES
+(768, 393, 1);
diff --git a/sql/updates/world/3.3.5/2016_06_01_10_world.sql b/sql/updates/world/3.3.5/2016_06_01_10_world.sql
new file mode 100644
index 00000000000..abc358431e3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_10_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `SpecialFlags`=`SpecialFlags`|1 WHERE `ID` IN (961, 3375, 3382, 3483);
diff --git a/sql/updates/world/3.3.5/2016_06_01_11_world.sql b/sql/updates/world/3.3.5/2016_06_01_11_world.sql
new file mode 100644
index 00000000000..dc0b7b05a33
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_11_world.sql
@@ -0,0 +1,81 @@
+--
+DELETE FROM `conditions` WHERE `SourceEntry`=254 AND `SourceTypeOrReferenceId`=20 AND `ConditionTypeOrReference` IN (8, 28);
+INSERT INTO `conditions` VALUES
+(20, 0, 254, 0, 0, 8, 0, 253, 0, 0, 1, 0, 0, "", "Show question mark for quest 'Digging Through the Dirt' only if quest 'Bride of the Embalmer' is not rewarded"),
+(20, 0, 254, 0, 0, 28, 0, 253, 0, 0, 1, 0, 0, "", "Show question mark for quest 'Digging Through the Dirt' only if quest 'Bride of the Embalmer' is not completed");
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (19, 20) AND `SourceEntry` IN (349, 410, 431, 593, 779, 795, 813, 926, 961, 1191, 1462, 1463, 1464, 1714, 1789, 1790, 4041, 6581, 7645, 8508, 8732, 9483, 10850, 10919);
+INSERT INTO `conditions` VALUES
+(19, 0, 349, 0, 0, 9, 0, 348, 0, 0, 0, 0, 0, "", "Show quest 'Stranglethorn Fever' only if quest 'Stranglethorn Fever' is accepted but not completed"),
+(20, 0, 349, 0, 0, 9, 0, 348, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Stranglethorn Fever' only if quest 'Stranglethorn Fever' is accepted but not completed"),
+
+(19, 0, 410, 0, 0, 9, 0, 409, 0, 0, 0, 0, 0, "", "Show quest 'The Dormant Shade' only if quest 'Proving Allegiance' is accepted but not completed"),
+(20, 0, 410, 0, 0, 9, 0, 409, 0, 0, 0, 0, 0, "", "Show question mark for quest 'The Dormant Shade' only if quest 'Proving Allegiance' is accepted but not completed"),
+
+(19, 0, 431, 0, 0, 9, 0, 409, 0, 0, 0, 0, 0, "", "Show quest 'Candles of Beckoning' only if quest 'Proving Allegiance' is accepted but not completed"),
+(20, 0, 431, 0, 0, 9, 0, 409, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Candles of Beckoning' only if quest 'Proving Allegiance' is accepted but not completed"),
+
+(19, 0, 593, 0, 0, 9, 0, 592, 0, 0, 0, 0, 0, "", "Show quest 'Filling the Soul Gem' only if quest 'Saving Yenniku' is accepted but not completed"),
+(20, 0, 593, 0, 0, 9, 0, 592, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Filling the Soul Gem' only if quest 'Saving Yenniku' is accepted but not completed"),
+
+(19, 0, 779, 0, 0, 9, 0, 717, 0, 0, 0, 0, 0, "", "Show quest 'Seal of the Earth' only if quest 'Tremors of the Earth' is accepted but not completed"),
+(20, 0, 779, 0, 0, 9, 0, 717, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Seal of the Earth' only if quest 'Tremors of the Earth' is accepted but not completed"),
+
+(19, 0, 795, 0, 0, 9, 0, 793, 0, 0, 0, 0, 0, "", "Show quest 'Seal of the Earth' only if quest 'Broken Alliances' is accepted but not completed"),
+(20, 0, 795, 0, 0, 9, 0, 793, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Seal of the Earth' only if quest 'Broken Alliances' is accepted but not completed"),
+
+(19, 0, 813, 0, 0, 9, 0, 812, 0, 0, 0, 0, 0, "", "Show quest 'Finding the Antidote' only if quest 'Need for a Cure' is accepted"),
+(20, 0, 813, 0, 0, 9, 0, 812, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Finding the Antidote' only if quest 'Need for a Cure' is accepted but not completed"),
+
+(19, 0, 926, 0, 0, 9, 0, 924, 0, 0, 0, 0, 0, "", "Show quest 'Flawed Power Stone' only if quest 'The Demon Seed' is accepted but not completed"),
+(20, 0, 926, 0, 0, 9, 0, 924, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Flawed Power Stone' only if quest 'The Demon Seed' is accepted but not completed"),
+
+(19, 0, 961, 0, 0, 9, 0, 944, 0, 0, 0, 0, 0, "", "Show quest 'Onu is Meditating' only if quest 'The Demon Seed' is accepted but not completed OR"),
+(20, 0, 961, 0, 0, 9, 0, 944, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Onu is Meditating' only if quest 'The Demon Seed' is accepted but not completed OR"),
+(19, 0, 961, 0, 1, 9, 0, 949, 0, 0, 0, 0, 0, "", "Show quest 'Onu is Meditating' only if quest 'The Twilight Camp' is accepted but not completed"),
+(20, 0, 961, 0, 1, 9, 0, 949, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Onu is Meditating' only if quest 'The Twilight Camp' is accepted but not completed"),
+
+(19, 0, 1191, 0, 0, 9, 0, 1190, 0, 0, 0, 0, 0, "", "Show quest 'Zamek's Distraction' only if quest 'Keeping Pace' is accepted but not completed"),
+(20, 0, 1191, 0, 0, 9, 0, 1190, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Zamek's Distraction' only if quest 'Keeping Pace' is accepted but not completed"),
+
+(19, 0, 1462, 0, 0, 28, 0, 1520, 0, 0, 0, 0, 0, "", "Show quest 'Earth Sapta' only if quest 'Call of Earth' is completed"),
+(20, 0, 1462, 0, 0, 28, 0, 1520, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Earth Sapta' only if quest 'Call of Earth' is completed"),
+
+(19, 0, 1463, 0, 0, 28, 0, 1517, 0, 0, 0, 0, 0, "", "Show quest 'Earth Sapta' only if quest 'Call of Earth' is ompleted"),
+(20, 0, 1463, 0, 0, 28, 0, 1517, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Earth Sapta' only if quest 'Call of Earth' is completed"),
+
+(19, 0, 1464, 0, 0, 9, 0, 1526, 0, 0, 0, 0, 0, "", "Show quest 'Fire Sapta' only if quest 'Call of Fire' is accepted but not completed"),
+(20, 0, 1464, 0, 0, 9, 0, 1526, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Fire Sapta' only if quest 'Call of Fire' is accepted but not completed"),
+
+(19, 0, 1714, 0, 0, 9, 0, 1712, 0, 0, 0, 0, 0, "", "Show quest 'Essence of the Exile' only if quest 'Cyclonian' is accepted but not completed"),
+(20, 0, 1714, 0, 0, 9, 0, 1712, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Essence of the Exile' only if quest 'Cyclonian' is accepted but not completed"),
+
+(19, 0, 1789, 0, 0, 9, 0, 1783, 0, 0, 0, 0, 0, "", "Show quest 'The Symbol of Life' only if quest 'The Tome of Divinity' is accepted but not completed"),
+(20, 0, 1789, 0, 0, 9, 0, 1783, 0, 0, 0, 0, 0, "", "Show question mark for quest 'The Symbol of Life' only if quest 'The Tome of Divinity' is accepted but not completed"),
+
+(19, 0, 1790, 0, 0, 9, 0, 1786, 0, 0, 0, 0, 0, "", "Show quest 'The Symbol of Life' only if quest 'The Tome of Divinity' is accepted but not completed"),
+(20, 0, 1790, 0, 0, 9, 0, 1786, 0, 0, 0, 0, 0, "", "Show question mark for quest 'The Symbol of Life' only if quest 'The Tome of Divinity' is accepted but not completed"),
+
+(19, 0, 4041, 0, 0, 9, 0, 3909, 0, 0, 0, 0, 0, "", "Show quest 'The Videre Elixir' only if quest 'The Videre Elixir' is accepted but not completed"),
+(20, 0, 4041, 0, 0, 9, 0, 3909, 0, 0, 0, 0, 0, "", "Show question mark for quest 'The Videre Elixir' only if quest 'The Videre Elixir' is accepted but not completed"),
+
+(19, 0, 6581, 0, 0, 9, 0, 6571, 0, 0, 0, 0, 0, "", "Show quest 'Warsong Saw Blades' only if quest 'Warsong Supplies' is accepted but not completed"),
+(20, 0, 6581, 0, 0, 9, 0, 6571, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Warsong Saw Blades' only if quest 'Warsong Supplies' is accepted but not completed"),
+
+(19, 0, 7645, 0, 0, 9, 0, 7643, 0, 0, 0, 0, 0, "", "Show quest 'Manna-Enriched Horse Feed' only if quest 'Ancient Equine Spirit' is accepted but not completed"),
+(20, 0, 7645, 0, 0, 9, 0, 7643, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Manna-Enriched Horse Feed' only if quest 'Ancient Equine Spirit' is accepted but not completed"),
+
+(19, 0, 8508, 0, 0, 9, 0, 8507, 0, 0, 0, 0, 0, "", "Show quest 'Field Duty Papers' only if quest 'Field Duty' is accepted but not completed"),
+(20, 0, 8508, 0, 0, 9, 0, 8507, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Field Duty Papers' only if quest 'Field Duty' is accepted but not completed"),
+
+(19, 0, 8732, 0, 0, 9, 0, 8731, 0, 0, 0, 0, 0, "", "Show quest 'Field Duty Papers' only if quest 'Field Duty' is accepted but not completed"),
+(20, 0, 8732, 0, 0, 9, 0, 8731, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Field Duty Papers' only if quest 'Field Duty' is accepted but not completed"),
+
+(19, 0, 9483, 0, 0, 9, 0, 9472, 0, 0, 0, 0, 0, "", "Show quest 'Life's Finer Pleasures' only if quest 'Arelion's Mistress' is accepted but not completed"),
+(20, 0, 9483, 0, 0, 9, 0, 9472, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Life's Finer Pleasures' only if quest 'Arelion's Mistress' is accepted but not completed"),
+
+(19, 0, 10850, 0, 0, 9, 0, 10855, 0, 0, 0, 0, 0, "", "Show quest 'Nether Gas In a Fel Fire Engine' only if quest 'Fel Reavers, No Thanks!' is accepted but not completed"),
+(20, 0, 10850, 0, 0, 9, 0, 10855, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Nether Gas In a Fel Fire Engine' only if quest 'Fel Reavers, No Thanks!' is accepted but not completed"),
+
+(19, 0, 10919, 0, 0, 9, 0, 10916, 0, 0, 0, 0, 0, "", "Show quest 'Fei Fei's Treat' only if quest 'Digging for Prayer Beads' is accepted but not completed"),
+(20, 0, 10919, 0, 0, 9, 0, 10916, 0, 0, 0, 0, 0, "", "Show question mark for quest 'Fei Fei's Treat' only if quest 'Digging for Prayer Beads' is accepted but not completed");
diff --git a/sql/updates/world/3.3.5/2016_06_01_12_world.sql b/sql/updates/world/3.3.5/2016_06_01_12_world.sql
new file mode 100644
index 00000000000..f6fb906bb70
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_01_12_world.sql
@@ -0,0 +1,4 @@
+--
+UPDATE `conditions` SET `SourceEntry`=49667 WHERE `SourceEntry`=48679 AND `SourceTypeOrReferenceId`=10 AND `SourceGroup`=10016;
+UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=22137 AND `source_type`=0 AND `id`=7;
+UPDATE `creature_text` SET `emote`=0 WHERE `entry`=19666 AND `groupid`=2 AND `id`=0;
diff --git a/sql/updates/world/3.3.5/2016_06_02_00_world.sql b/sql/updates/world/3.3.5/2016_06_02_00_world.sql
new file mode 100644
index 00000000000..b192efa6814
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_02_00_world.sql
@@ -0,0 +1,20 @@
+DELETE FROM `spell_script_names` where `ScriptName` IN ('spell_jormungars_burning_spray','spell_jormungars_paralytic_spray','spell_jormungars_paralytic_toxin','spell_jormungars_paralysis');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(66902,'spell_jormungars_burning_spray'), -- Burning Spray 10m normal
+(67627,'spell_jormungars_burning_spray'), -- Burning Spray 25m normal
+(67628,'spell_jormungars_burning_spray'), -- Burning Spray 10m heroic
+(67629,'spell_jormungars_burning_spray'), -- Burning Spray 25m heroic
+(66901,'spell_jormungars_paralytic_spray'), -- Paralytic Spray 10m normal
+(67615,'spell_jormungars_paralytic_spray'), -- Paralytic Spray 25m normal
+(67616,'spell_jormungars_paralytic_spray'), -- Paralytic Spray 10m heroic
+(67617,'spell_jormungars_paralytic_spray'), -- Paralytic Spray 25m heroic
+(66823,'spell_jormungars_paralytic_toxin'), -- Paralytic Toxin 10m normal
+(67618,'spell_jormungars_paralytic_toxin'), -- Paralytic Toxin 25m normal
+(67619,'spell_jormungars_paralytic_toxin'), -- Paralytic Toxin 10m heroic
+(67620,'spell_jormungars_paralytic_toxin'), -- Paralytic Toxin 25m heroic
+(66830,'spell_jormungars_paralysis'); -- Paralysis
+
+-- Acidmaw missing text
+DELETE FROM `creature_text` where entry = 35144 AND groupid = 1;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(35144,1,0,'You have been infected with a Paralytic Toxin!',42,0,100,0,0,0,36323,0,'Acidmaw - Special Attack');
diff --git a/sql/updates/world/3.3.5/2016_06_02_01_world.sql b/sql/updates/world/3.3.5/2016_06_02_01_world.sql
new file mode 100644
index 00000000000..792f221e344
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_02_01_world.sql
@@ -0,0 +1,10 @@
+DELETE FROM `spell_script_names` where `ScriptName` IN ('spell_fel_streak_visual');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(66493,'spell_fel_streak_visual');
+
+DELETE FROM `creature_template_addon` WHERE `entry` IN (34815,35262,35263,35264);
+INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(34815,0,0,0,1,0,'66327'),
+(35262,0,0,0,1,0,'66327'),
+(35263,0,0,0,1,0,'66327'),
+(35264,0,0,0,1,0,'66327');
diff --git a/sql/updates/world/3.3.5/2016_06_04_00_world.sql b/sql/updates/world/3.3.5/2016_06_04_00_world.sql
new file mode 100644
index 00000000000..e44fe54de55
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_04_00_world.sql
@@ -0,0 +1,19 @@
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=6556;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=6556 AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=6557 AND `source_type`=0 AND `id`=7;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=6559 AND `source_type`=0 AND `id`=1;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(6556, 0, 0, 0, 8, 0, 100, 1, 15702, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Muculent Ooze - On Spell Hit (Filling Empty Jar) - Despawn'),
+(6557, 0, 7, 0, 8, 0, 100, 1, 15702, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Primal Ooze - On Spell Hit (Filling Empty Jar) - Despawn'),
+(6559, 0, 1, 0, 8, 0, 100, 1, 15702, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Glutinous Ooze - On Spell Hit (Filling Empty Jar) - Despawn');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=15702;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(17, 0, 15702, 0, 0, 31, 1, 3, 6556, 0, 0, 0, 0, '', 'Filling Empty Jar can be used on Muculent Ooze'),
+(17, 0, 15702, 0, 1, 31, 1, 3, 6557, 0, 0, 0, 0, '', 'Filling Empty Jar can be used on Muculent Ooze'),
+(17, 0, 15702, 0, 2, 31, 1, 3, 6559, 0, 0, 0, 0, '', 'Filling Empty Jar can be used on Muculent Ooze'),
+(17, 0, 15702, 0, 0, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Target must be dead'),
+(17, 0, 15702, 0, 1, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Target must be dead'),
+(17, 0, 15702, 0, 2, 36, 1, 0, 0, 0, 1, 0, 0, '', 'Target must be dead');
diff --git a/sql/updates/world/3.3.5/2016_06_04_01_world.sql b/sql/updates/world/3.3.5/2016_06_04_01_world.sql
new file mode 100644
index 00000000000..fb048449d40
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_04_01_world.sql
@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS `playercreateinfo_cast_spell`;
+CREATE TABLE IF NOT EXISTS `playercreateinfo_cast_spell` (
+ `raceMask` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `classMask` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `spell` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
+ `note` VARCHAR(255) DEFAULT NULL
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+DELETE FROM `playercreateinfo_cast_spell` WHERE `spell` IN (48266, 2457);
+INSERT INTO `playercreateinfo_cast_spell` (`racemask`, `classmask`, `spell`, `note`) VALUES
+(0, 32, 48266, 'Death Knight - Blood Presence'),
+(0, 1, 2457, 'Warrior - Battle Stance');
diff --git a/sql/updates/world/3.3.5/2016_06_05_00_world.sql b/sql/updates/world/3.3.5/2016_06_05_00_world.sql
new file mode 100644
index 00000000000..6da2282d424
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `page_text` SET `Text`="Westfall Stew$B$B3 parts Stringy Vulture Meat$B3 Goretusk Snouts$B3 Murloc Eyes$B3 Okra$B$BMix together and bring to a boil. Let simmer for at least two hours before serving." WHERE `ID`=213;
diff --git a/sql/updates/world/3.3.5/2016_06_05_01_world.sql b/sql/updates/world/3.3.5/2016_06_05_01_world.sql
new file mode 100644
index 00000000000..444a5be17ed
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_01_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `page_text` SET `Text`="Osric,$B$BPlease find below the list of armor of which we are in need:$B$B10 Mail shirts$B20 Helms$B30 Armor Patches$B15 Mail Boots$B$BWe are, as always, in your debt. And should Westfall ever be free of the thieves who threaten it, it would ease the guilt in my heart if I could invite you to my family's home, for a fine meal cooked from the bounty this land was once so well known.$B$B-Lewis$BQuartermaster, Sentinel Hill" WHERE `ID`=2512;
diff --git a/sql/updates/world/3.3.5/2016_06_05_02_world.sql b/sql/updates/world/3.3.5/2016_06_05_02_world.sql
new file mode 100644
index 00000000000..cab093eb88f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_02_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `page_text` SET `Text`="Grelin,$B$BMy time is short and many matters press on my time, and I hope that your investigation of the trolls will not be one of them. Therefore I will allow you to use my authority in dealing with the trolls in whatever fashion you deem necessary, more so if you are able to find an expedient solution.$B$BMagni Bronzebeard" WHERE `ID`=80;
diff --git a/sql/updates/world/3.3.5/2016_06_05_03_world.sql b/sql/updates/world/3.3.5/2016_06_05_03_world.sql
new file mode 100644
index 00000000000..d9bd5ecab2c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_03_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestID`=315 WHERE `ID`=415;
diff --git a/sql/updates/world/3.3.5/2016_06_05_04_world.sql b/sql/updates/world/3.3.5/2016_06_05_04_world.sql
new file mode 100644
index 00000000000..fdf6b535f8d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_04_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_offer_reward` SET `RewardText`="The Malt is brewed, the Boars are dead$BAnd before all is done and anything said$BWe will have to fight for first dibs$BOn these savory Beer Basted Boar Ribs!" WHERE `ID`=384;
diff --git a/sql/updates/world/3.3.5/2016_06_05_05_world.sql b/sql/updates/world/3.3.5/2016_06_05_05_world.sql
new file mode 100644
index 00000000000..9c69b2d7639
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_05_world.sql
@@ -0,0 +1,5 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestID`=8328 WHERE `ID`=10068;
+UPDATE `quest_template_addon` SET `PrevQuestID`=9676 WHERE `ID`=10069;
+UPDATE `quest_template_addon` SET `PrevQuestID`=9393 WHERE `ID`=10070;
+UPDATE `quest_template_addon` SET `PrevQuestID`=8564 WHERE `ID`=10072;
diff --git a/sql/updates/world/3.3.5/2016_06_05_06_world.sql b/sql/updates/world/3.3.5/2016_06_05_06_world.sql
new file mode 100644
index 00000000000..5d63a2c7e37
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_06_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestID`=8325 WHERE `ID` IN (9393, 8328, 9676, 8564, 9392, 8563);
diff --git a/sql/updates/world/3.3.5/2016_06_05_07_world.sql b/sql/updates/world/3.3.5/2016_06_05_07_world.sql
new file mode 100644
index 00000000000..71d39603080
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_07_world.sql
@@ -0,0 +1,4 @@
+-- add missing localization for item "Bamboo Cage Key" (entry: 12301)
+DELETE FROM `locales_item` WHERE `entry`=12301;
+INSERT INTO `locales_item` (`entry`, `name_loc2`, `name_loc3`, `name_loc6`, `name_loc7`, `name_loc8`) VALUES
+(12301, 'Clé de la cage en bambou', 'Bambuskäfigschlüssel', 'Llave de jaula de bambú', 'Llave de jaula de bambú', 'Ключ от бамбуковой клетки');
diff --git a/sql/updates/world/3.3.5/2016_06_05_08_world.sql b/sql/updates/world/3.3.5/2016_06_05_08_world.sql
new file mode 100644
index 00000000000..a2f5c580f92
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_08_world.sql
@@ -0,0 +1,2 @@
+-- adding a key requirement for gameobject "Cage Door" (entry: 143979) at Kurzen's Compound by closing it
+UPDATE `gameobject` SET `state`=1 WHERE `guid`=10673;
diff --git a/sql/updates/world/3.3.5/2016_06_05_09_world.sql b/sql/updates/world/3.3.5/2016_06_05_09_world.sql
new file mode 100644
index 00000000000..98f707aafcd
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_09_world.sql
@@ -0,0 +1,9 @@
+-- Plague Scientist SAI
+SET @ENTRY := 37023;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,0,0,100,0,2000,3000,23000,24000,11,71103,0,0,0,0,0,6,0,0,0,0,0,0,0,"Plague Scientist - In Combat - Cast 'Combobulating Spray'"),
+(@ENTRY,0,1,0,0,0,100,0,5000,6000,5000,6000,11,73079,0,0,0,0,0,2,0,0,0,0,0,0,0,"Plague Scientist - In Combat - Cast 'Plague Blast'"),
+(@ENTRY,0,2,0,0,0,100,0,9000,10000,25000,26000,11,69871,0,0,0,0,0,9,0,0,30,0,0,0,0,"Plague Scientist - In Combat - Cast 'Plague Stream'"),
+(@ENTRY,0,3,0,1,0,100,0,2000,3000,10000,10000,11,69871,0,0,0,0,0,9,10404,0,10,0,0,0,0,"Plague Scientist - Out of Combat - Cast 'Plague Stream'");
diff --git a/sql/updates/world/3.3.5/2016_06_05_10_world.sql b/sql/updates/world/3.3.5/2016_06_05_10_world.sql
new file mode 100644
index 00000000000..66c6e8dbc7c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_10_world.sql
@@ -0,0 +1,5 @@
+--
+DELETE FROM `spell_area` WHERE `spell` IN (74092, 74310);
+INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`) VALUES
+(74092,368,25495,25445,0,0,2,1,74),
+(74310,133,25287,25393,0,0,2,1,74);
diff --git a/sql/updates/world/3.3.5/2016_06_05_11_world.sql b/sql/updates/world/3.3.5/2016_06_05_11_world.sql
new file mode 100644
index 00000000000..3a76d73f9ab
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_11_world.sql
@@ -0,0 +1,7 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN(13,17) AND `SourceEntry`=58912;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(17,0,58912,0,0,31,1,3,31254,0,0,0,0,'','Deathstorm requires target Lordaeron Footsoldier'),
+(17,0,58912,0,1,31,1,3,32414,0,0,0,0,'','Deathstorm requires target Lordaeron Captain'),
+(13,1,58912,0,0,31,0,3,31254,0,0,0,0,'','Deathstorm can hit Lordaeron Footsoldier'),
+(13,1,58912,0,1,31,0,3,32414,0,0,0,0,'','Deathstorm can hit Lordaeron Captain');
diff --git a/sql/updates/world/3.3.5/2016_06_05_12_world.sql b/sql/updates/world/3.3.5/2016_06_05_12_world.sql
new file mode 100644
index 00000000000..a446260985f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_05_12_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `InhabitType` = 1 WHERE `entry` = 17312;
diff --git a/sql/updates/world/3.3.5/2016_06_06_00_world.sql b/sql/updates/world/3.3.5/2016_06_06_00_world.sql
new file mode 100644
index 00000000000..61d93dab677
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_06_00_world.sql
@@ -0,0 +1,83 @@
+-- ghoul_base_stats
+DELETE FROM `pet_levelstats` WHERE creature_entry = 26125;
+INSERT INTO `pet_levelstats` (`creature_entry`, `level`, `hp`, `mana`, `armor`, `str`, `agi`, `sta`, `inte`, `spi`) VALUES
+(26125,1,48,80,10,20,16,13,20,8),
+(26125,2,105,106,67,22,17,14,21,9),
+(26125,3,162,132,124,24,18,15,22,10),
+(26125,4,219,158,181,26,19,16,23,11),
+(26125,5,276,184,238,28,20,17,24,12),
+(26125,6,333,210,295,30,21,18,25,13),
+(26125,7,390,236,352,32,22,19,26,14),
+(26125,8,447,262,409,34,23,20,27,15),
+(26125,9,504,288,466,36,24,21,28,16),
+(26125,10,561,314,523,38,25,22,29,17),
+(26125,11,618,340,580,40,26,23,30,18),
+(26125,12,675,366,637,42,27,24,31,19),
+(26125,13,732,392,694,44,28,25,32,20),
+(26125,14,789,418,751,46,29,26,33,21),
+(26125,15,846,444,808,48,30,27,34,22),
+(26125,16,903,470,865,50,31,28,35,23),
+(26125,17,960,496,922,52,32,29,36,24),
+(26125,18,1017,522,979,54,33,30,37,25),
+(26125,19,1074,548,1036,56,34,31,38,26),
+(26125,20,1131,574,1093,58,35,32,39,27),
+(26125,21,1188,600,1150,60,36,33,40,28),
+(26125,22,1245,626,1207,62,37,34,41,29),
+(26125,23,1302,652,1264,64,38,35,42,30),
+(26125,24,1359,678,1321,66,39,36,43,31),
+(26125,25,1416,704,1378,68,40,37,44,32),
+(26125,26,1473,730,1435,70,41,38,45,33),
+(26125,27,1530,756,1492,72,42,39,46,34),
+(26125,28,1587,782,1549,74,43,40,47,35),
+(26125,29,1644,808,1606,76,44,41,48,36),
+(26125,30,1701,834,1663,78,45,42,49,37),
+(26125,31,1758,860,1720,80,46,43,50,38),
+(26125,32,1815,886,1777,82,47,44,51,39),
+(26125,33,1872,912,1834,84,48,45,52,40),
+(26125,34,1929,938,1891,86,49,46,53,41),
+(26125,35,1986,964,1948,88,50,47,54,42),
+(26125,36,2043,990,2005,90,51,48,55,43),
+(26125,37,2100,1016,2062,92,52,49,56,44),
+(26125,38,2157,1042,2119,94,53,50,57,45),
+(26125,39,2214,1068,2176,96,54,51,58,46),
+(26125,40,2271,1094,2233,98,55,52,59,47),
+(26125,41,2328,1120,2290,100,56,53,60,48),
+(26125,42,2385,1146,2347,102,57,54,61,49),
+(26125,43,2442,1172,2404,104,58,55,62,50),
+(26125,44,2499,1198,2461,106,59,56,63,51),
+(26125,45,2556,1224,2518,108,60,57,64,52),
+(26125,46,2613,1250,2575,110,61,58,65,53),
+(26125,47,2670,1276,2632,112,62,59,66,54),
+(26125,48,2727,1302,2689,114,63,60,67,55),
+(26125,49,2784,1328,2746,116,64,61,68,56),
+(26125,50,2841,1354,2803,118,65,62,69,57),
+(26125,51,2898,1380,2860,120,66,63,70,58),
+(26125,52,2955,1406,2917,122,67,64,71,59),
+(26125,53,3012,1432,2974,124,68,65,72,60),
+(26125,54,3069,1458,3031,126,69,66,73,61),
+(26125,55,3126,1484,3088,128,70,67,74,62),
+(26125,56,3183,1510,3145,130,71,68,75,63),
+(26125,57,3240,1536,3202,132,72,69,76,64),
+(26125,58,3297,1562,3259,134,73,70,77,65),
+(26125,59,3354,1588,3316,136,74,71,78,66),
+(26125,60,3411,1614,3373,138,75,72,79,67),
+(26125,61,3468,1640,3430,140,76,73,80,68),
+(26125,62,3525,1666,3487,142,77,74,81,69),
+(26125,63,3582,1692,3544,144,78,75,82,70),
+(26125,64,3639,1718,3601,146,79,76,83,71),
+(26125,65,3696,1744,3658,148,80,77,84,72),
+(26125,66,3753,1770,3715,150,81,78,85,73),
+(26125,67,3810,1796,3772,152,82,79,86,74),
+(26125,68,3867,1822,3829,154,83,80,87,75),
+(26125,69,3924,1848,3886,156,84,81,88,76),
+(26125,70,3981,1874,3943,158,85,82,89,77),
+(26125,71,4038,1900,4000,160,86,83,90,78),
+(26125,72,4095,1926,4057,162,87,84,91,79),
+(26125,73,4152,1952,4114,164,88,85,92,80),
+(26125,74,4209,1978,4171,166,89,86,93,81),
+(26125,75,4266,2004,4228,168,90,87,94,82),
+(26125,76,4323,2030,4285,170,91,88,95,83),
+(26125,77,4380,2056,4342,172,92,89,96,84),
+(26125,78,4437,2082,4399,174,93,90,97,85),
+(26125,79,4494,2108,4456,176,94,91,98,86),
+(26125,80,4551,2134,4513,331,95,92,99,87);
diff --git a/sql/updates/world/3.3.5/2016_06_06_01_world.sql b/sql/updates/world/3.3.5/2016_06_06_01_world.sql
new file mode 100644
index 00000000000..fc47dc4bf14
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_06_01_world.sql
@@ -0,0 +1,8 @@
+DELETE FROM `command` WHERE `name` = 'debug neargraveyard';
+INSERT INTO `command` (`name`, `permission`, `help`) VALUES
+('debug neargraveyard', 841, 'Syntax: .debug neargraveyard [linked]\nFind the nearest graveyard from dbc or db (if linked)');
+
+DELETE FROM `trinity_string` WHERE `entry` IN (82, 83);
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc6`, `content_loc7`) VALUES
+(82, 'Nearest graveyard found: %u (%.3f %.3f %.3f)', 'Cementerio mas cercano encontrado: %u (%.3f %.3f %.3f)', 'Cementerio mas cercano encontrado: %u (%.3f %.3f %.3f)'),
+(83, 'There are no graveyards near', 'No se ha encontrado ningun cementerio cerca', 'No se ha encontrado ningun cementerio cerca');
diff --git a/sql/updates/world/3.3.5/2016_06_07_00_world.sql b/sql/updates/world/3.3.5/2016_06_07_00_world.sql
new file mode 100644
index 00000000000..fbe7c362718
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_07_00_world.sql
@@ -0,0 +1,2 @@
+-- remove incorrect trigger flag from hodir ice blocks that prevents encounter from starting
+UPDATE `creature_template` SET `flags_extra`=(`flags_extra`&~128) WHERE `entry` IN (32938,33353);
diff --git a/sql/updates/world/3.3.5/2016_06_07_01_world.sql b/sql/updates/world/3.3.5/2016_06_07_01_world.sql
new file mode 100644
index 00000000000..09e86bc0396
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_07_01_world.sql
@@ -0,0 +1,622 @@
+--
+-- Waypoints for Ghostlands
+--
+-- Pathing for Deatholme Acolyte Entry: 16315 'TDB FORMAT'
+SET @NPC := 82514;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6980.597,`position_y`=-5898.018,`position_z`=28.76383 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6980.597,-5898.018,28.76383,0,0,0,0,100,0), -- 23:05:14
+(@PATH,2,6980.413,-5864.207,38.00547,0,0,0,0,100,0), -- 23:05:31
+(@PATH,3,6985.412,-5841.971,49.12637,0,0,0,0,100,0), -- 23:05:46
+(@PATH,4,6996.224,-5824.525,58.95233,0,0,0,0,100,0), -- 23:05:56
+(@PATH,5,7008.987,-5810.714,68.33813,0,0,0,0,100,0), -- 23:06:05
+(@PATH,6,7018.887,-5796.988,77.02762,0,0,0,0,100,0), -- 23:06:14
+(@PATH,7,7023.633,-5785.236,83.22521,0,0,0,0,100,0), -- 23:06:21
+(@PATH,8,7025.083,-5767.624,91.65661,0,0,0,0,100,0), -- 23:06:27
+(@PATH,9,7023.818,-5754.515,99.82605,0,0,0,0,100,0), -- 23:06:35
+(@PATH,10,7021.463,-5739.864,105.2905,0,0,0,0,100,0), -- 23:06:42
+(@PATH,11,7023.037,-5750.744,102.3329,0,0,0,0,100,0), -- 23:06:50
+(@PATH,12,7024.833,-5765.023,93.1219,0,0,0,0,100,0), -- 23:06:54
+(@PATH,13,7024.46,-5781.898,84.79234,0,0,0,0,100,0), -- 23:07:01
+(@PATH,14,7021.089,-5792.683,79.57092,0,0,0,0,100,0), -- 23:07:09
+(@PATH,15,7010.271,-5809.296,69.25038,0,0,0,0,100,0), -- 23:07:14
+(@PATH,16,6998.258,-5822.302,60.71892,0,0,0,0,100,0), -- 23:07:23
+(@PATH,17,6986.333,-5840.401,49.7908,0,0,0,0,100,0), -- 23:07:31
+(@PATH,18,6980.666,-5861.458,39.13383,0,0,0,0,100,0); -- 23:07:40
+
+-- Pathing for Deatholme Acolyte Entry: 16315 'TDB FORMAT'
+SET @NPC := 82536;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6997.067,`position_y`=-5687.621,`position_z`=102.8226 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6997.067,-5687.621,102.8226,0,0,0,0,100,0), -- 23:06:27
+(@PATH,2,6990.939,-5688.242,101.8386,0,0,0,0,100,0), -- 23:06:32
+(@PATH,3,6976.603,-5693.576,96.38464,0,0,0,0,100,0), -- 23:06:36
+(@PATH,4,6970.503,-5700.29,92.63046,0,0,0,0,100,0), -- 23:06:41
+(@PATH,5,6967.743,-5712.647,88.57698,0,0,0,0,100,0), -- 23:06:45
+(@PATH,6,6970.009,-5720.242,85.64739,0,0,0,0,100,0), -- 23:06:50
+(@PATH,7,6971.563,-5723.634,84.75957,0,0,0,0,100,0), -- 23:06:55
+(@PATH,8,6979.354,-5724.356,84.26402,0,0,0,0,100,0), -- 23:06:57
+(@PATH,9,6979.47,-5714.573,84.58974,0,0,0,0,100,0), -- 23:07:00
+(@PATH,10,6979.149,-5705.578,84.45787,0,0,0,0,100,0), -- 23:07:05
+(@PATH,11,6979.545,-5714.578,84.56152,0,0,0,0,100,0), -- 23:09:00
+(@PATH,12,6979.16,-5705.374,84.45621,0,0,0,0,100,0), -- 23:09:04
+(@PATH,13,6980.682,-5682.834,82.93341,0,0,0,0,100,0), -- 23:09:11
+(@PATH,14,6985.518,-5671.094,82.00629,0,0,0,0,100,0), -- 23:09:17
+(@PATH,15,6990.438,-5665.75,81.61432,0,0,0,0,100,0), -- 23:09:22
+(@PATH,16,6995.886,-5661.015,81.00694,0,0,0,0,100,0), -- 23:09:26
+(@PATH,17,6995.958,-5660.979,80.95592,0,0,0,0,100,0), -- 23:09:29
+(@PATH,18,6990.574,-5665.602,81.49225,0,0,0,0,100,0), -- 23:09:30
+(@PATH,19,6985.71,-5671.139,81.79518,0,0,0,0,100,0), -- 23:09:33
+(@PATH,20,6979.59,-5690.713,83.48748,0,0,0,0,100,0), -- 23:09:38
+(@PATH,21,6979.259,-5705.457,84.32413,0,0,0,0,100,0), -- 23:09:44
+(@PATH,22,6980.716,-5719.662,84.53703,0,0,0,0,100,0), -- 23:09:52
+(@PATH,23,6978.376,-5725.388,84.53719,0,0,0,0,100,0), -- 23:09:56
+(@PATH,24,6977.495,-5726.067,84.54002,0,0,0,0,100,0), -- 23:09:58
+(@PATH,25,6968.405,-5716.007,87.3763,0,0,0,0,100,0), -- 23:10:01
+(@PATH,26,6967.94,-5709.555,89.84632,0,0,0,0,100,0), -- 23:10:06
+(@PATH,27,6974.01,-5696.171,94.75365,0,0,0,0,100,0), -- 23:10:09
+(@PATH,28,6984.721,-5690.32,99.80565,0,0,0,0,100,0); -- 23:10:14
+
+-- Pathing for Deatholme Acolyte Entry: 16315 'TDB FORMAT'
+SET @NPC := 82537;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7010.643,`position_y`=-5693.538,`position_z`=102.6286 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7010.643,-5693.538,102.6286,0,0,0,0,100,0), -- 23:06:47
+(@PATH,2,7016.285,-5693.483,102.6231,0,0,0,0,100,0), -- 23:06:49
+(@PATH,3,7018.219,-5692.301,102.6074,0,0,0,0,100,0), -- 23:06:50
+(@PATH,4,7021.005,-5689.024,102.3725,0,0,0,0,100,0), -- 23:06:53
+(@PATH,5,7018.614,-5679.159,102.6098,0,0,0,0,100,0), -- 23:06:56
+(@PATH,6,7014.545,-5677.964,102.6143,0,0,0,0,100,0), -- 23:06:57
+(@PATH,7,7010.401,-5678.611,102.6134,0,0,0,0,100,0), -- 23:07:00
+(@PATH,8,7007.026,-5681.029,102.6129,0,0,0,0,100,0), -- 23:07:02
+(@PATH,9,7004.883,-5684.334,102.6098,0,0,0,0,100,0), -- 23:07:05
+(@PATH,10,7005.852,-5689.117,102.6089,0,0,0,0,100,0); -- 23:07:07
+
+-- Pathing for Deatholme Acolyte Entry: 16315 'TDB FORMAT'
+SET @NPC := 82540;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7029.595,`position_y`=-5682.818,`position_z`=102.658 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7029.595,-5682.818,102.658,0,0,0,0,100,0), -- 23:06:56
+(@PATH,2,7035.782,-5681.29,102.0026,0,0,0,0,100,0), -- 23:07:01
+(@PATH,3,7045.729,-5681.199,98.82371,0,0,0,0,100,0), -- 23:07:03
+(@PATH,4,7056.35,-5684.523,93.90004,0,0,0,0,100,0), -- 23:07:07
+(@PATH,5,7045.667,-5681.057,98.76253,0,0,0,0,100,0), -- 23:09:05
+(@PATH,6,7056.332,-5684.539,93.80215,0,0,0,0,100,0), -- 23:09:09
+(@PATH,7,7060.951,-5689.726,91.59099,0,0,0,0,100,0), -- 23:09:13
+(@PATH,8,7064.874,-5703.865,86.7645,0,0,0,0,100,0), -- 23:09:17
+(@PATH,9,7063.655,-5709.466,84.63042,0,0,0,0,100,0), -- 23:09:22
+(@PATH,10,7058.803,-5714.256,84.48442,0,0,0,0,100,0), -- 23:09:27
+(@PATH,11,7057.9,-5714.272,84.27392,0,0,0,0,100,0), -- 23:09:28
+(@PATH,12,7054.177,-5703.301,84.48618,0,0,0,0,100,0), -- 23:09:30
+(@PATH,13,7052.994,-5694.213,84.35367,0,0,0,0,100,0), -- 23:09:37
+(@PATH,14,7043.341,-5673.357,82.8222,0,0,0,0,100,0), -- 23:09:43
+(@PATH,15,7035.741,-5663.536,81.92133,0,0,0,0,100,0), -- 23:09:49
+(@PATH,16,7029.659,-5659.765,81.63133,0,0,0,0,100,0), -- 23:09:52
+(@PATH,17,7022.754,-5657.553,81.0175,0,0,0,0,100,0), -- 23:09:56
+(@PATH,18,7022.701,-5657.519,80.93935,0,0,0,0,100,0), -- 23:10:00
+(@PATH,19,7029.343,-5659.941,81.43478,0,0,0,0,100,0), -- 23:10:01
+(@PATH,20,7038.872,-5666.699,82.0325,0,0,0,0,100,0), -- 23:10:05
+(@PATH,21,7047.313,-5680.742,83.38,0,0,0,0,100,0), -- 23:10:08
+(@PATH,22,7052.837,-5694.202,84.4315,0,0,0,0,100,0), -- 23:10:14
+(@PATH,23,7053.863,-5703.065,84.7151,0,0,0,0,100,0), -- 23:10:20
+(@PATH,24,7054.707,-5709.983,84.50665,0,0,0,0,100,0), -- 23:10:26
+(@PATH,25,7057.84,-5714.267,84.24426,0,0,0,0,100,0), -- 23:10:29
+(@PATH,26,7064.392,-5706.512,85.34109,0,0,0,0,100,0), -- 23:10:30
+(@PATH,27,7063.626,-5695.099,89.8451,0,0,0,0,100,0), -- 23:10:34
+(@PATH,28,7059.115,-5687.389,92.43468,0,0,0,0,100,0), -- 23:10:39
+(@PATH,29,7048.491,-5681.79,97.46969,0,0,0,0,100,0), -- 23:10:43
+(@PATH,30,7038.716,-5681.117,100.7739,0,0,0,0,100,0); -- 23:10:48
+
+-- Pathing for Grimscale Oracle Entry: 15669 'TDB FORMAT'
+SET @NPC := 56234;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=8878.816,`position_y`=-5749.102,`position_z`=0.5971264 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,8878.816,-5749.102,0.5971264,0,0,0,0,100,0), -- 23:32:50
+(@PATH,2,8872.123,-5724.519,0.5082448,0,0,0,0,100,0), -- 23:33:17
+(@PATH,3,8858.525,-5719.116,0.797046,0,0,0,0,100,0), -- 23:33:23
+(@PATH,4,8820.211,-5718.883,-1.039287,0,0,0,0,100,0), -- 23:33:33
+(@PATH,5,8797.094,-5711.732,0.5297012,0,0,0,0,100,0), -- 23:33:43
+(@PATH,6,8789.655,-5709.307,0.9552886,0,0,0,0,100,0), -- 23:33:53
+(@PATH,7,8771.264,-5697.327,1.041862,0,0,0,0,100,0), -- 23:34:01
+(@PATH,8,8754.51,-5692.826,0.9234784,0,0,0,0,100,0), -- 23:34:08
+(@PATH,9,8754.548,-5692.86,0.8107796,0,0,0,0,100,0), -- 23:34:17
+(@PATH,10,8754.832,-5692.778,1.003729,0,0,0,0,100,0), -- 23:34:22
+(@PATH,11,8771.507,-5697.777,0.8035664,0,0,0,0,100,0), -- 23:34:29
+(@PATH,12,8806.005,-5714.252,-1.612888,0,0,0,0,100,0), -- 23:34:38
+(@PATH,13,8829.296,-5721.84,1.24645,0,0,0,0,100,0), -- 23:34:48
+(@PATH,14,8847.945,-5721.054,0.8082525,0,0,0,0,100,0), -- 23:34:57
+(@PATH,15,8858.877,-5719.242,0.7433279,0,0,0,0,100,0), -- 23:35:07
+(@PATH,16,8872.451,-5724.64,0.7027312,0,0,0,0,100,0); -- 23:35:13
+
+-- Pathing for Grimscale Oracle Entry: 15669 'TDB FORMAT'
+SET @NPC := 56221;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=8777.075,`position_y`=-5755.628,`position_z`=0.7944576 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,8777.075,-5755.628,0.7944576,0,0,0,0,100,0), -- 23:25:41
+(@PATH,2,8744.947,-5758.729,1.44137,0,0,0,0,100,0), -- 23:26:14
+(@PATH,3,8723.646,-5744.492,0.7795044,0,0,0,0,100,0), -- 23:26:24
+(@PATH,4,8711.309,-5729.942,1.035426,0,0,0,0,100,0), -- 23:26:32
+(@PATH,5,8691.229,-5710.955,0.2195589,0,0,0,0,100,0), -- 23:26:39
+(@PATH,6,8687.803,-5701.443,-0.1464095,0,0,0,0,100,0), -- 23:26:48
+(@PATH,7,8653.561,-5676.286,1.293998,0,0,0,0,100,0), -- 23:27:01
+(@PATH,8,8641.836,-5678.255,1.193712,0,0,0,0,100,0), -- 23:27:12
+(@PATH,9,8641.773,-5678.348,1.107449,0,0,0,0,100,0), -- 23:27:23
+(@PATH,10,8667.416,-5673.973,0.01454574,0,0,0,0,100,0), -- 23:27:32
+(@PATH,11,8675.772,-5684.51,0.2002553,0,0,0,0,100,0), -- 23:27:43
+(@PATH,12,8690.506,-5709.449,0.5053282,0,0,0,0,100,0), -- 23:27:56
+(@PATH,13,8694.455,-5720.396,0.996207,0,0,0,0,100,0), -- 23:28:04
+(@PATH,14,8711.694,-5730.25,0.9948567,0,0,0,0,100,0), -- 23:28:12
+(@PATH,15,8732.313,-5750.292,1.464421,0,0,0,0,100,0), -- 23:28:20
+(@PATH,16,8751.975,-5757.997,0.9221863,0,0,0,0,100,0), -- 23:28:30
+(@PATH,17,8777.087,-5755.516,0.800478,0,0,0,0,100,0); -- 23:28:43
+
+-- Pathing for Grimscale Forager Entry: 15670 'TDB FORMAT'
+SET @NPC := 56242;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=9071.955,`position_y`=-5877.383,`position_z`=0.6975139 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,9071.955,-5877.383,0.6975139,0,0,0,0,100,0), -- 23:37:45
+(@PATH,2,9059.324,-5868.073,-1.393102,0,0,0,0,100,0), -- 23:38:00
+(@PATH,3,9029.121,-5854.314,0.6379914,0,0,0,0,100,0), -- 23:38:11
+(@PATH,4,9026.947,-5821.172,1.145625,0,0,0,0,100,0), -- 23:38:21
+(@PATH,5,9027.102,-5820.248,1.393944,0,0,0,0,100,0), -- 23:38:35
+(@PATH,6,9032.799,-5775.275,0.952391,0,0,0,0,100,0), -- 23:38:44
+(@PATH,7,9031.125,-5767.591,0.8471048,0,0,0,0,100,0), -- 23:38:56
+(@PATH,8,9008.104,-5754.679,0.8015774,0,0,0,0,100,0), -- 23:39:07
+(@PATH,9,8966.937,-5741.705,1.29663,0,0,0,0,100,0), -- 23:39:17
+(@PATH,10,8962.295,-5740.867,1.235597,0,0,0,0,100,0), -- 23:39:27
+(@PATH,11,8927.979,-5767.035,0.04672858,0,0,0,0,100,0), -- 23:39:37
+(@PATH,12,8938.715,-5761.229,1.038244,0,0,0,0,100,0), -- 23:39:45
+(@PATH,13,8943.727,-5758.281,0.968925,0,0,0,0,100,0), -- 23:39:52
+(@PATH,14,8981.834,-5744.667,0.7889291,0,0,0,0,100,0), -- 23:40:02
+(@PATH,15,8986.465,-5746.015,0.8002989,0,0,0,0,100,0), -- 23:40:12
+(@PATH,16,9008.296,-5754.792,0.820213,0,0,0,0,100,0), -- 23:40:21
+(@PATH,17,9036.458,-5792.002,1.43752,0,0,0,0,100,0), -- 23:40:32
+(@PATH,18,9028.837,-5817.06,1.559729,0,0,0,0,100,0), -- 23:40:45
+(@PATH,19,9023.854,-5848.162,1.221549,0,0,0,0,100,0), -- 23:40:54
+(@PATH,20,9042.734,-5857.301,-2.073786,0,0,0,0,100,0); -- 23:41:08
+
+-- Pathing for Grimscale Seer Entry: 15950 'TDB FORMAT'
+SET @NPC := 56391;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=9037.592,`position_y`=-5766.527,`position_z`=0.5168767 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,9037.592,-5766.527,0.5168767,0,0,0,0,100,0), -- 23:42:42
+(@PATH,2,9048.254,-5784.458,0.9698197,0,0,0,0,100,0), -- 23:42:51
+(@PATH,3,9059.32,-5798.216,-0.9207587,0,0,0,0,100,0), -- 23:42:59
+(@PATH,4,9076.928,-5813.567,0.3946522,0,0,0,0,100,0), -- 23:43:10
+(@PATH,5,9080.393,-5815.896,0.6621327,0,0,0,0,100,0), -- 23:43:18
+(@PATH,6,9088.405,-5809.686,0.7750955,0,0,0,0,100,0), -- 23:43:21
+(@PATH,7,9106.832,-5804.949,0.821775,0,0,0,0,100,0), -- 23:43:28
+(@PATH,8,9123.148,-5807.707,0.8019806,0,0,0,0,100,0), -- 23:43:36
+(@PATH,9,9135.586,-5821.801,0.7773802,0,0,0,0,100,0), -- 23:43:43
+(@PATH,10,9149.662,-5822.438,0.7227378,0,0,0,0,100,0), -- 23:43:49
+(@PATH,11,9167.805,-5833.559,0.5458255,0,0,0,0,100,0), -- 23:43:58
+(@PATH,12,9167.66,-5833.448,0.4231594,0,0,0,0,100,0), -- 23:44:11
+(@PATH,13,9167.701,-5833.285,0.7127371,0,0,0,0,100,0), -- 23:44:23
+(@PATH,14,9149.432,-5822.394,0.7666007,0,0,0,0,100,0), -- 23:44:32
+(@PATH,15,9135.407,-5821.695,0.8019806,0,0,0,0,100,0), -- 23:44:38
+(@PATH,16,9123.027,-5807.496,0.8282324,0,0,0,0,100,0), -- 23:44:45
+(@PATH,17,9106.761,-5805.003,0.785993,0,0,0,0,100,0), -- 23:44:51
+(@PATH,18,9088.161,-5809.791,0.7095211,0,0,0,0,100,0), -- 23:45:00
+(@PATH,19,9071.598,-5809.765,-0.6348054,0,0,0,0,100,0), -- 23:45:03
+(@PATH,20,9050.107,-5787.132,0.9787122,0,0,0,0,100,0), -- 23:45:10
+(@PATH,21,9049.096,-5785.835,1.078146,0,0,0,0,100,0); -- 23:45:20
+
+-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT'
+SET @NPC := 145414;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7150.675,`position_y`=-7072.731,`position_z`=55.28159 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7150.675,-7072.731,55.28159,0,0,0,0,100,0), -- 11:51:25
+(@PATH,2,7140.165,-7095.667,56.32489,0,0,0,0,100,0), -- 11:51:41
+(@PATH,3,7134.295,-7111.137,58.849,0,0,0,0,100,0), -- 11:51:51
+(@PATH,4,7149.599,-7137.551,55.19991,0,0,0,0,100,0), -- 11:51:59
+(@PATH,5,7183.908,-7143.587,56.03042,0,0,0,0,100,0), -- 11:52:11
+(@PATH,6,7218.184,-7136.882,58.99335,0,0,0,0,100,0), -- 11:52:25
+(@PATH,7,7235.5,-7129.492,60.65919,0,0,0,0,100,0), -- 11:52:39
+(@PATH,8,7243.874,-7125.855,61.10926,0,30000,0,0,100,0), -- 11:52:51
+(@PATH,9,7243.135,-7095.02,61.9528,0,0,0,0,100,0), -- 11:53:38
+(@PATH,10,7224.584,-7078.627,58.69924,0,0,0,0,100,0), -- 11:54:28
+(@PATH,11,7189.417,-7063.731,58.10524,0,0,0,0,100,0); -- 11:54:29
+
+-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT'
+SET @NPC := 81743;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7483.415,`position_y`=-6898.222,`position_z`=96.65485 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7483.415,-6898.222,96.65485,0,0,0,0,100,0), -- 22:01:51
+(@PATH,2,7490.502,-6889.069,94.41743,0,0,0,0,100,0), -- 22:01:59
+(@PATH,3,7481.624,-6866.266,88.67288,0,0,0,0,100,0), -- 22:02:05
+(@PATH,4,7480.969,-6837.274,77.65476,0,0,0,0,100,0), -- 22:02:16
+(@PATH,5,7480.024,-6797.451,76.10669,0,0,0,0,100,0), -- 22:02:28
+(@PATH,6,7478.713,-6785.392,77.4765,0,0,0,0,100,0), -- 22:02:43
+(@PATH,7,7479.419,-6793.053,76.67186,0,0,0,0,100,0), -- 22:02:54
+(@PATH,8,7480.9,-6834.077,76.25935,0,0,0,0,100,0), -- 22:03:02
+(@PATH,9,7480.634,-6861.903,86.81428,0,0,0,0,100,0), -- 22:03:17
+(@PATH,10,7490.069,-6885.811,93.34169,0,0,0,0,100,0); -- 22:03:30
+
+-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT'
+SET @NPC := 81737;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7546.458,`position_y`=-6726.992,`position_z`=80.78694 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7546.458,-6726.992,80.78694,0,0,0,0,100,0), -- 22:05:54
+(@PATH,2,7527.194,-6732.486,80.58603,0,0,0,0,100,0), -- 22:06:08
+(@PATH,3,7604.331,-6767.942,85.9845,0,0,0,0,100,0), -- 22:09:49
+(@PATH,4,7593.505,-6753.936,89.24313,0,0,0,0,100,0), -- 22:09:59
+(@PATH,5,7575.111,-6734.221,84.59973,0,0,0,0,100,0); -- 22:10:07
+
+-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT'
+SET @NPC := 81723;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7640.057,`position_y`=-6821.591,`position_z`=80.17661 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7640.057,-6821.591,80.17661,0,0,0,0,100,0), -- 22:05:42
+(@PATH,2,7633.815,-6796.717,78.65404,0,0,0,0,100,0), -- 22:05:51
+(@PATH,3,7615.372,-6775.387,80.24687,0,0,0,0,100,0), -- 22:06:00
+(@PATH,4,7632.267,-6793.745,77.46573,0,0,0,0,100,0), -- 22:06:15
+(@PATH,5,7634.777,-6800.083,79.74638,0,0,0,0,100,0), -- 22:06:27
+(@PATH,6,7649.132,-6834.647,83.15082,0,0,0,0,100,0), -- 22:06:37
+(@PATH,7,7656.086,-6858.044,87.99471,0,0,0,0,100,0), -- 22:06:45
+(@PATH,8,7651.524,-6839.359,84.67632,0,0,0,0,100,0), -- 22:06:56
+(@PATH,9,7640.049,-6821.556,80.16749,0,0,0,0,100,0); -- 22:07:05
+
+-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT'
+SET @NPC := 81719;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7563.64,`position_y`=-6881.709,`position_z`=112.1673 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7563.64,-6881.709,112.1673,0,0,0,0,100,0), -- 18:53:33
+(@PATH,2,7551.659,-6901.236,112.1663,0,0,0,0,100,0), -- 18:53:38
+(@PATH,3,7555.867,-6910.663,111.9691,0,0,0,0,100,0), -- 18:56:12
+(@PATH,4,7565.996,-6914.735,108.4578,0,0,0,0,100,0), -- 18:53:51
+(@PATH,5,7579.56,-6906.405,103.1527,0,0,0,0,100,0), -- 18:54:00
+(@PATH,6,7591.544,-6890.522,95.51781,0,0,0,0,100,0), -- 18:54:08
+(@PATH,7,7595.471,-6871.276,94.72267,0,0,0,0,100,0), -- 18:54:18
+(@PATH,8,7586.251,-6861.987,93.77134,0,0,0,0,100,0), -- 18:54:24
+(@PATH,9,7577.42,-6854.581,93.04897,0,0,0,0,100,0), -- 18:55:26
+(@PATH,10,7578.87,-6826.335,87.31084,0,0,0,0,100,0), -- 18:54:34
+(@PATH,11,7578.864,-6821.618,86.92613,0,0,0,0,100,0), -- 18:54:47
+(@PATH,12,7561.332,-6803.103,87.30068,0,0,0,0,100,0), -- 18:55:15
+(@PATH,13,7560.291,-6799.682,87.58893,0,0,0,0,100,0), -- 18:55:08
+(@PATH,14,7556.946,-6782.622,89.82014,0,0,0,0,100,0), -- 18:54:58
+(@PATH,15,7560.291,-6799.682,87.58893,0,0,0,0,100,0), -- 18:55:08
+(@PATH,16,7561.332,-6803.103,87.30068,0,0,0,0,100,0), -- 18:55:15
+(@PATH,17,7578.864,-6821.618,86.92613,0,0,0,0,100,0), -- 18:54:47
+(@PATH,18,7578.87,-6826.335,87.31084,0,0,0,0,100,0), -- 18:54:34
+(@PATH,19,7577.42,-6854.581,93.04897,0,0,0,0,100,0), -- 18:55:26
+(@PATH,20,7588.399,-6863.539,93.97005,0,0,0,0,100,0), -- 18:55:39
+(@PATH,21,7593.956,-6877.988,95.42189,0,0,0,0,100,0), -- 18:55:48
+(@PATH,22,7583.048,-6903.001,101.4519,0,0,0,0,100,0), -- 18:55:55
+(@PATH,23,7570.524,-6913.488,106.4994,0,0,0,0,100,0), -- 18:56:05
+(@PATH,24,7555.867,-6910.663,111.9691,0,0,0,0,100,0), -- 18:56:12
+(@PATH,25,7551.659,-6901.236,112.1663,0,0,0,0,100,0), -- 18:53:38
+(@PATH,26,7563.374,-6882.594,112.1059,0,0,0,0,100,0); -- 18:56:20
+
+-- Pathing for Ghostlands Guardian Entry: 16541 'TDB FORMAT'
+SET @NPC := 81745;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7493.75,`position_y`=-6888.333,`position_z`=94.14599 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7493.75,-6888.333,94.14599,0,0,0,0,100,0), -- 21:57:19
+(@PATH,2,7481.219,-6899.196,97.32906,0,0,0,0,100,0), -- 21:57:29
+(@PATH,3,7455.676,-6912.633,103.082,0,0,0,0,100,0), -- 21:57:36
+(@PATH,4,7435.434,-6934.373,107.2755,0,0,0,0,100,0), -- 21:57:49
+(@PATH,5,7429.151,-6957.596,112.5967,0,0,0,0,100,0), -- 21:58:00
+(@PATH,6,7409.229,-6988.246,112.3306,0,0,0,0,100,0), -- 21:58:16
+(@PATH,7,7398.064,-7006.403,105.4191,0,0,0,0,100,0), -- 21:58:24
+(@PATH,8,7379.978,-7023.313,98.34062,0,0,0,0,100,0), -- 21:58:33
+(@PATH,9,7368.91,-7048.285,91.6894,0,0,0,0,100,0), -- 21:58:44
+(@PATH,10,7362.03,-7076.459,81.8666,0,0,0,0,100,0), -- 21:58:55
+(@PATH,11,7335.145,-7098.242,66.09917,0,0,0,0,100,0), -- 21:59:07
+(@PATH,12,7304.179,-7104.348,54.56339,0,0,0,0,100,0), -- 21:59:23
+(@PATH,13,7332.545,-7099.682,64.96516,0,0,0,0,100,0), -- 21:59:41
+(@PATH,14,7360.992,-7078.073,81.13574,0,0,0,0,100,0), -- 21:59:57
+(@PATH,15,7367.925,-7051.186,90.94432,0,0,0,0,100,0), -- 22:00:12
+(@PATH,16,7376.316,-7028.957,96.4644,0,0,0,0,100,0), -- 22:00:25
+(@PATH,17,7397.015,-7007.736,104.9266,0,0,0,0,100,0), -- 22:00:35
+(@PATH,18,7408.008,-6990.256,111.4358,0,0,0,0,100,0), -- 22:00:46
+(@PATH,19,7411.379,-6986.646,112.7126,0,0,0,0,100,0), -- 22:00:56
+(@PATH,20,7429.151,-6957.596,112.5967,0,0,0,0,100,0), -- 21:58:00
+(@PATH,21,7433.051,-6937.843,108.0633,0,0,0,0,100,0), -- 22:01:05
+(@PATH,22,7445.005,-6922.467,103.7956,0,0,0,0,100,0), -- 22:01:28
+(@PATH,23,7450.903,-6915.155,103.3749,0,0,0,0,100,0), -- 22:01:28
+(@PATH,24,7450.903,-6915.155,103.3749,0,0,0,0,100,0), -- 22:01:28
+(@PATH,25,7477.773,-6901.932,98.37746,0,0,0,0,100,0), -- 22:01:33
+(@PATH,26,7493.729,-6888.343,94.15305,0,0,0,0,100,0); -- 22:01:45
+
+-- Pathing for Blacksmith Frances Entry: 17655 'TDB FORMAT'
+SET @NPC := 81724;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7604.855,`position_y`=-6905.621,`position_z`=93.76188 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7604.855,-6905.621,93.76188,0.8203048,60000,0,0,100,0), -- 22:07:38
+(@PATH,2,7600.523,-6904.995,93.88599,0,0,0,0,100,0), -- 22:08:19
+(@PATH,3,7600.523,-6904.995,93.88599,1.780236,0,0,0,100,0), -- 22:08:21
+(@PATH,4,7600.064,-6907.846,93.76472,0,0,0,0,100,0), -- 22:09:30
+(@PATH,5,7600.523,-6904.995,93.88599,0,30000,0,0,100,0), -- 22:10:03
+(@PATH,6,7600.523,-6904.995,93.88599,1.780236,0,0,0,100,0), -- 22:10:04
+(@PATH,7,7598.409,-6904.81,94.34996,0,60000,0,0,100,0), -- 22:10:58
+(@PATH,8,7596.794,-6905.625,94.31394,3.996804,0,0,0,100,0), -- 22:10:59
+(@PATH,9,7600.523,-6904.995,93.88599,0,0,0,0,100,0), -- 22:11:26
+(@PATH,10,7600.523,-6904.995,93.88599,1.780236,0,0,0,100,0), -- 22:11:27
+(@PATH,11,7598.409,-6904.81,94.34996,0,60000,0,0,100,0), -- 22:12:20
+(@PATH,12,7596.794,-6905.625,94.31394,3.996804,0,0,0,100,0), -- 22:12:22
+(@PATH,13,7600.523,-6904.995,93.88599,0,0,0,0,100,0), -- 22:12:42
+(@PATH,14,7600.523,-6904.995,93.88599,1.780236,0,0,0,100,0), -- 22:12:44
+(@PATH,15,7604.855,-6905.621,93.76188,0,120000,0,0,100,0), -- 22:14:00
+(@PATH,16,7604.855,-6905.621,93.76188,0.8203048,0,0,0,100,0); -- 22:14:02
+
+-- Pathing for Rathis Tomber Entry: 16224 'TDB FORMAT'
+SET @NPC := 81720;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7638.232,`position_y`=-6842.241,`position_z`=84.2546 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,7638.232,-6842.241,84.2546,2.076942,0,0,0,100,0), -- 22:09:02
+(@PATH,2,7636.98,-6839.962,83.24476,0,0,0,0,100,0), -- 22:09:36
+(@PATH,3,7637.41,-6837.574,82.88759,0,0,0,0,100,0), -- 22:09:38
+(@PATH,4,7639.8,-6835.542,82.59454,0,0,0,0,100,0), -- 22:09:39
+(@PATH,5,7643.04,-6835.119,82.58206,0,0,0,0,100,0), -- 22:09:40
+(@PATH,6,7644.657,-6837.574,83.20168,0,0,0,0,100,0), -- 22:09:41
+(@PATH,7,7644.05,-6838.9,83.9032,0,60000,0,0,100,0),
+(@PATH,8,7645.192,-6836.052,83.1027,0,0,0,0,100,0), -- 22:09:50
+(@PATH,9,7642.421,-6834.729,82.59531,0,0,0,0,100,0), -- 22:09:51
+(@PATH,10,7639.884,-6835.1,82.53012,0,0,0,0,100,0), -- 22:09:52
+(@PATH,11,7637.52,-6837.243,82.75238,0,0,0,0,100,0), -- 22:09:53
+(@PATH,12,7636.066,-6839.554,82.94509,0,0,0,0,100,0), -- 22:09:55
+(@PATH,13,7637.412,-6842.98,83.70974,0,10000,0,0,100,0), -- 22:09:56
+(@PATH,14,7638.232,-6842.241,84.2546,0,0,0,0,100,0), -- 22:10:06
+(@PATH,15,7638.232,-6842.241,84.2546,2.076942,60000,0,0,100,0); -- 22:10:06
+
+-- Pathing for Sentinel Infiltrator Entry: 16333 'TDB FORMAT'
+SET @NPC := 85939;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6826.52,`position_y`=-7216.635,`position_z`=26.2077 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6826.52,-7216.635,26.2077,0,0,0,0,100,0), -- 18:25:44
+(@PATH,2,6840.17,-7215.392,27.32393,0,0,0,0,100,0), -- 18:25:48
+(@PATH,3,6842.315,-7214.781,27.5872,0,0,0,0,100,0), -- 18:25:52
+(@PATH,4,6847.95,-7208.919,27.60912,0,0,0,0,100,0), -- 18:25:54
+(@PATH,5,6846.517,-7200.238,27.39073,0,0,0,0,100,0), -- 18:25:58
+(@PATH,6,6836.5,-7187.716,26.55817,0,0,0,0,100,0), -- 18:26:01
+(@PATH,7,6829.814,-7187.942,25.16908,0,0,0,0,100,0), -- 18:26:05
+(@PATH,8,6828.214,-7188.198,24.70531,0,0,0,0,100,0), -- 18:26:08
+(@PATH,9,6820.545,-7191.426,24.19164,0,0,0,0,100,0), -- 18:26:11
+(@PATH,10,6816.887,-7196.539,24.25371,0,0,0,0,100,0), -- 18:26:15
+(@PATH,11,6816.825,-7206.355,24.66104,0,0,0,0,100,0), -- 18:26:18
+(@PATH,12,6824.003,-7215.546,25.92787,0,0,0,0,100,0); -- 18:26:22
+
+-- Pathing for Sentinel Infiltrator Entry: 16333 'TDB FORMAT'
+-- Needs SAI scripting
+SET @NPC := 85810;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6834.944,`position_y`=-7216.469,`position_z`=26.75792 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6834.944,-7216.469,26.75792,0,0,0,0,100,0), -- 18:21:32
+(@PATH,2,6826.208,-7222.83,27.19634,0,0,0,0,100,0), -- 18:21:40
+(@PATH,3,6817.325,-7206.505,24.92965,0,0,0,0,100,0), -- 18:21:52
+(@PATH,4,6819.723,-7180.195,25.83248,0,0,0,0,100,0), -- 18:22:00
+(@PATH,5,6811.1,-7153.327,37.85592,0,0,0,0,100,0), -- 18:22:11
+(@PATH,6,6794.896,-7138.714,44.19709,0,0,0,0,100,0), -- 18:22:24
+(@PATH,7,6778.596,-7138.577,47.74215,0,0,0,0,100,0), -- 18:22:34
+(@PATH,8,6770.257,-7144.743,49.66928,0,0,0,0,100,0), -- 18:22:40
+(@PATH,9,6786.903,-7138.087,45.32982,0,0,0,0,100,0), -- 18:22:53
+(@PATH,10,6817.342,-7166.106,30.71012,0,0,0,0,100,0), -- 18:23:03
+(@PATH,11,6823.649,-7165.904,28.29505,0,0,0,0,100,0), -- 18:23:20
+(@PATH,12,6835.131,-7148.97,30.26661,0,0,0,0,100,0), -- 18:23:27
+(@PATH,13,6835.175,-7162.583,27.79875,0,0,0,0,100,0), -- 18:23:38
+(@PATH,14,6835.874,-7170.188,26.83617,0,0,0,0,100,0), -- 18:23:45
+(@PATH,15,6827.219,-7186.351,24.99562,0,0,0,0,100,0), -- 18:23:49
+(@PATH,16,6818.312,-7181.476,25.84511,0,0,0,0,100,0), -- 18:23:56
+(@PATH,17,6813.708,-7178.023,26.07334,0,0,0,0,100,0), -- 18:24:03
+(@PATH,18,6800.086,-7180.936,26.13367,0,0,0,0,100,0), -- 18:24:08
+(@PATH,19,6788.234,-7196.194,26.14623,0,0,0,0,100,0), -- 18:24:16
+(@PATH,20,6784.672,-7191.459,26.15236,0,0,0,0,100,0), -- 18:25:03
+(@PATH,21,6802.208,-7180.021,26.09461,0,0,0,0,100,0), -- 18:25:13
+(@PATH,22,6821.094,-7186.088,24.97617,0,0,0,0,100,0), -- 18:25:20
+(@PATH,23,6836.174,-7190.566,26.19097,0,0,0,0,100,0), -- 18:25:24
+(@PATH,24,6844.302,-7187.855,27.69562,0,0,0,0,100,0), -- 18:25:32
+(@PATH,25,6846.742,-7212.095,27.73918,0,0,0,0,100,0); -- 18:25:45
+
+-- Pathing for Sentinel Infiltrator Entry: 16333 'TDB FORMAT'
+-- Needs SAI scripting
+SET @NPC := 85876;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6814.882,`position_y`=-7163.52,`position_z`=33.06502 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6814.882,-7163.52,33.06502,0,0,0,0,100,0), -- 18:26:55
+(@PATH,2,6796.829,-7138.427,44.13749,0,0,0,0,100,0), -- 18:27:03
+(@PATH,3,6778.327,-7138.773,48.00482,0,0,0,0,100,0), -- 18:27:16
+(@PATH,4,6776.107,-7139.004,48.73849,0,0,0,0,100,0), -- 18:27:24
+(@PATH,5,6783.224,-7137.825,46.49815,0,0,0,0,100,0), -- 18:27:51
+(@PATH,6,6794.398,-7137.108,44.60288,0,0,0,0,100,0), -- 18:27:56
+(@PATH,7,6800.035,-7146.845,40.49599,0,0,0,0,100,0), -- 18:28:01
+(@PATH,8,6795.779,-7165.81,32.8607,0,0,0,0,100,0), -- 18:28:05
+(@PATH,9,6794.719,-7181.562,26.63479,0,0,0,0,100,0), -- 18:28:14
+(@PATH,10,6794.198,-7190.434,25.95545,0,0,0,0,100,0), -- 18:28:24
+(@PATH,11,6789.857,-7191.004,25.8968,0,0,0,0,100,0), -- 18:28:38
+(@PATH,12,6789.924,-7190.855,26.1468,0,0,0,0,100,0), -- 18:28:41
+(@PATH,13,6801.363,-7179.81,25.90792,0,0,0,0,100,0), -- 18:28:54
+(@PATH,14,6801.586,-7179.51,26.09436,0,0,0,0,100,0), -- 18:29:01
+(@PATH,15,6817.118,-7187.298,24.99203,0,0,0,0,100,0), -- 18:29:06
+(@PATH,16,6818.806,-7191.954,24.44993,0,0,0,0,100,0), -- 18:29:13
+(@PATH,17,6819.498,-7215.1,25.45433,0,0,0,0,100,0), -- 18:29:18
+(@PATH,18,6817.387,-7217.657,26.22639,0,0,0,0,100,0), -- 18:29:24
+(@PATH,19,6815.59,-7207.964,25.15621,0,0,0,0,100,0), -- 18:29:35
+(@PATH,20,6816.641,-7195.688,24.46806,0,0,0,0,100,0), -- 18:29:44
+(@PATH,21,6830.292,-7179.979,26.3147,0,0,0,0,100,0), -- 18:29:50
+(@PATH,22,6823.895,-7177.721,26.77645,0,0,0,0,100,0); -- 18:30:03
+
+-- Pathing for Shadowpine Catlord Entry: 16345 'TDB FORMAT'
+SET @NPC := 85833;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6825.845,`position_y`=-7407.999,`position_z`=47.05538 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6825.845,-7407.999,47.05538,0,0,0,0,100,0), -- 18:03:11
+(@PATH,2,6819.822,-7407.742,47.8176,0,0,0,0,100,0), -- 18:03:23
+(@PATH,3,6797.965,-7395.941,47.85873,0,0,0,0,100,0), -- 18:03:32
+(@PATH,4,6790.372,-7391.337,48.14279,0,0,0,0,100,0), -- 18:05:27
+(@PATH,5,6785.934,-7382.063,48.67854,0,0,0,0,100,0), -- 18:05:12
+(@PATH,6,6780.216,-7369.419,49.53757,0,0,0,0,100,0), -- 18:03:44
+(@PATH,7,6762.875,-7356.745,49.3274,0,0,0,0,100,0), -- 18:03:59
+(@PATH,8,6757.482,-7359.899,49.68204,0,0,0,0,100,0), -- 18:04:51
+(@PATH,9,6752.945,-7365.431,51.41992,0,0,0,0,100,0), -- 18:04:05
+(@PATH,10,6736.967,-7385.644,51.58582,0,0,0,0,100,0), -- 18:04:20
+(@PATH,11,6707.192,-7407.871,51.19869,0,0,0,0,100,0), -- 18:04:48
+(@PATH,12,6706.392,-7408.471,51.19869,0,0,0,0,100,0), -- 18:04:48
+(@PATH,13,6736.911,-7385.608,51.53582,0,0,0,0,100,0), -- 18:04:48
+(@PATH,14,6752.945,-7365.431,51.41992,0,0,0,0,100,0), -- 18:04:05
+(@PATH,15,6757.482,-7359.899,49.68204,0,0,0,0,100,0), -- 18:04:51
+(@PATH,16,6765.563,-7357.226,49.71237,0,0,0,0,100,0), -- 18:05:06
+(@PATH,17,6780.216,-7369.419,49.53757,0,0,0,0,100,0), -- 18:03:44
+(@PATH,18,6785.934,-7382.063,48.67854,0,0,0,0,100,0), -- 18:05:12
+(@PATH,19,6790.372,-7391.337,48.14279,0,0,0,0,100,0), -- 18:05:27
+(@PATH,20,6797.965,-7395.941,47.85873,0,0,0,0,100,0), -- 18:03:32
+(@PATH,21,6819.822,-7407.742,47.8176,0,0,0,0,100,0); -- 18:03:23
+
+-- Pathing for Shadowpine Catlord Entry: 16345 'TDB FORMAT'
+SET @NPC := 85899;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6642.614,`position_y`=-7403.334,`position_z`=65.37686 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6642.614,-7403.334,65.37686,0,0,0,0,100,0), -- 18:12:02
+(@PATH,2,6655.589,-7402.668,65.25717,0,0,0,0,100,0), -- 18:12:07
+(@PATH,3,6659.145,-7404.814,64.66093,0,0,0,0,100,0), -- 18:12:13
+(@PATH,4,6666.81,-7405.762,59.45066,0,0,0,0,100,0), -- 18:12:16
+(@PATH,5,6670.078,-7400.617,57.92281,0,0,0,0,100,0), -- 18:12:19
+(@PATH,6,6683.644,-7387.567,57.7993,0,0,0,0,100,0), -- 18:12:25
+(@PATH,7,6694.211,-7385.182,53.51888,0,0,0,0,100,0), -- 18:12:30
+(@PATH,8,6701.323,-7375.21,53.19016,0,0,0,0,100,0), -- 18:12:39
+(@PATH,9,6706.042,-7306.476,52.34984,0,0,0,0,100,0), -- 18:12:56
+(@PATH,10,6698.629,-7306.6,52.3459,0,0,0,0,100,0), -- 18:13:09
+(@PATH,11,6658.128,-7346.422,53.5539,0,0,0,0,100,0), -- 18:13:25
+(@PATH,12,6663.863,-7357.194,55.34796,0,0,0,0,100,0), -- 18:13:40
+(@PATH,13,6687.574,-7370.823,53.74558,0,0,0,0,100,0), -- 18:13:48
+(@PATH,14,6692.782,-7383.596,54.75917,0,0,0,0,100,0), -- 18:14:00
+(@PATH,15,6679.604,-7389.391,57.81517,0,0,0,0,100,0), -- 18:14:09
+(@PATH,16,6668.09,-7405,57.93337,0,0,0,0,100,0), -- 18:14:14
+(@PATH,17,6663.221,-7406.32,61.86858,0,0,0,0,100,0), -- 18:14:20
+(@PATH,18,6657.667,-7403.231,64.99197,0,0,0,0,100,0), -- 18:14:23
+(@PATH,19,6646.945,-7407.651,65.2119,0,0,0,0,100,0), -- 18:14:27
+(@PATH,20,6642.138,-7401.195,67.02313,0,0,0,0,100,0), -- 18:14:32
+(@PATH,21,6643.672,-7393.591,70.57539,0,0,0,0,100,0), -- 18:14:37
+(@PATH,22,6648.191,-7390.153,70.75128,0,0,0,0,100,0), -- 18:14:41
+(@PATH,23,6655.95,-7390.098,70.72308,0,0,0,0,100,0), -- 18:14:45
+(@PATH,24,6672.11,-7389.826,70.80399,0,0,0,0,100,0), -- 18:14:49
+(@PATH,25,6674.516,-7400.391,70.78954,0,0,0,0,100,0), -- 18:14:54
+(@PATH,26,6670.333,-7405.347,70.74722,0,0,0,0,100,0), -- 18:14:58
+(@PATH,27,6655.763,-7405.991,70.77985,0,0,0,0,100,0), -- 18:15:03
+(@PATH,28,6652.884,-7398.17,70.53949,0,0,0,0,100,0), -- 18:15:08
+(@PATH,29,6648.519,-7390.229,70.74633,0,0,0,0,100,0), -- 18:15:14
+(@PATH,30,6643.527,-7393.528,70.72253,0,0,0,0,100,0), -- 18:15:17
+(@PATH,31,6642.74,-7403.402,65.47425,0,0,0,0,100,0); -- 18:15:22
+
+-- Pathing for Shadowpine Hexxer Entry: 16346 'TDB FORMAT'
+SET @NPC := 85922;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6544.311,`position_y`=-7415.042,`position_z`=66.8414 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,6544.311,-7415.042,66.8414,0,0,0,0,100,0), -- 18:12:06
+(@PATH,2,6557.531,-7398.131,62.547,0,0,0,0,100,0), -- 18:12:18
+(@PATH,3,6584.465,-7368.215,56.64576,0,0,0,0,100,0), -- 18:12:52
+(@PATH,4,6589.184,-7361.762,55.35123,0,0,0,0,100,0), -- 18:12:52
+(@PATH,5,6593.902,-7355.309,54.72623,0,0,0,0,100,0), -- 18:12:52
+(@PATH,6,6598.534,-7348.974,54.28678,0,0,0,0,100,0), -- 18:12:52
+(@PATH,7,6603.207,-7346.335,54.47303,0,0,0,0,100,0), -- 18:15:13
+(@PATH,8,6609.078,-7343.148,54.03077,0,0,0,0,100,0), -- 18:12:53
+(@PATH,9,6619.535,-7340.988,53.94233,0,0,0,0,100,0), -- 18:15:00
+(@PATH,10,6636.512,-7345.48,53.38771,0,0,0,0,100,0), -- 18:13:02
+(@PATH,11,6650.978,-7350.788,53.67146,0,0,0,0,100,0), -- 18:14:42
+(@PATH,12,6679.457,-7366.645,54.62379,0,0,0,0,100,0), -- 18:13:15
+(@PATH,13,6688.482,-7368.755,53.68621,0,0,0,0,100,0), -- 18:13:31
+(@PATH,14,6707.076,-7373.765,53.0295,0,0,0,0,100,0), -- 18:14:20
+(@PATH,15,6724.337,-7391.231,52.32455,0,0,0,0,100,0), -- 18:13:40
+(@PATH,16,6742.169,-7407.499,51.53728,0,0,0,0,100,0), -- 18:13:54
+(@PATH,17,6740.595,-7406.18,51.4976,0,0,0,0,100,0), -- 18:14:08
+(@PATH,18,6724.337,-7391.231,52.32455,0,0,0,0,100,0), -- 18:13:40
+(@PATH,19,6707.076,-7373.765,53.0295,0,0,0,0,100,0), -- 18:14:20
+(@PATH,20,6686.671,-7368.761,53.71722,0,0,0,0,100,0), -- 18:14:34
+(@PATH,21,6679.457,-7366.645,54.62379,0,0,0,0,100,0), -- 18:13:15
+(@PATH,22,6650.978,-7350.788,53.67146,0,0,0,0,100,0), -- 18:14:42
+(@PATH,23,6636.512,-7345.48,53.38771,0,0,0,0,100,0), -- 18:13:02
+(@PATH,24,6619.535,-7340.988,53.94233,0,0,0,0,100,0), -- 18:15:00
+(@PATH,25,6609.078,-7343.148,54.03077,0,0,0,0,100,0), -- 18:12:53
+(@PATH,26,6603.207,-7346.335,54.47303,0,0,0,0,100,0), -- 18:15:13
+(@PATH,27,6598.534,-7348.974,54.28678,0,0,0,0,100,0), -- 18:12:52
+(@PATH,28,6593.902,-7355.309,54.72623,0,0,0,0,100,0), -- 18:12:52
+(@PATH,29,6586.425,-7365.703,56.44064,0,0,0,0,100,0), -- 18:15:20
+(@PATH,30,6560.438,-7394.56,61.59495,0,0,0,0,100,0), -- 18:15:30
+(@PATH,31,6544.499,-7415.031,66.93755,0,0,0,0,100,0); -- 18:15:45
diff --git a/sql/updates/world/3.3.5/2016_06_09_00_world.sql b/sql/updates/world/3.3.5/2016_06_09_00_world.sql
new file mode 100644
index 00000000000..f3a8ec3d6e8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_09_00_world.sql
@@ -0,0 +1,33 @@
+-- Mountaineer Pebblebitty (creature_template.entry 3836)
+SET @ENTRY := 3836;
+
+UPDATE `creature_template` SET `AIName`= "SmartAI", `ScriptName`= '' WHERE `entry`= @ENTRY;
+
+-- Correct gossip_menu_options for Quest 3181 gossip
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1201,1202,1203,1204,1205,1206) AND `id` = 0;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(1201, 0,0, "What's the worst that could happen?", 4266, 1,1, 1202, 0,0,0,'',0),
+(1202, 0,0, "Another way? Do tell...", 4268, 1,1, 1203, 0,0,0,'',0),
+(1203, 0,0, "Orcs? Badlands? I'm invulnerable!", 4270, 1,1, 1204, 0,0,0,'',0),
+(1204, 0,0, "Absolutely!", 4272, 1,1, 1205, 0,0,0,'',0),
+(1205, 0,0, "My apologies, Pebblebitty.", 4274, 1,1, 1206, 0,0,0,'',0),
+(1206, 0,0, "Done, done, and done.", 4276, 1,1, 0, 0,0,0,'',0);
+
+-- Link gossip_menu_option.menu_id to npc_text.ID (1201,1833 already in TDB)
+DELETE FROM `gossip_menu` WHERE `entry` IN (1202,1203,1204,1205,1206);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(1202,1834),
+(1203,1835),
+(1204,1836),
+(1205,1837),
+(1206,1838);
+
+-- Mountaineer Pebblebitty gossip SAI for quest 3181 (gossip has to be closed)
+DELETE FROM `smart_scripts` WHERE `entryorguid`= @ENTRY AND `source_type` = 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,62,0,100,0,1206,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Mountaineer Pebblebitty - on Gossip Menu Option 1206 selected - Close Gossip");
+
+-- Condition for gossip_menu_option 1201 and Quest 3181 (The Horn of the Beast)
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup`= 1201;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15, 1201,0, 0,0, 28,0, 3181,0,0, 0,0,0, '', 'Show gossip menu option 1201 only if Quest 3181 is completed');
diff --git a/sql/updates/world/3.3.5/2016_06_09_01_world.sql b/sql/updates/world/3.3.5/2016_06_09_01_world.sql
new file mode 100644
index 00000000000..b29242b6038
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_09_01_world.sql
@@ -0,0 +1,14 @@
+-- Majordomo Executus' gossip when friendly (entry 12018 in 3.3.5)
+UPDATE `creature_template` SET `gossip_menu_id` = 4093 WHERE `entry` = 12018;
+
+DELETE FROM `gossip_menu` WHERE `entry` IN (4108,4109,4093) AND `text_id` IN (4995,5011,5012);
+INSERT INTO gossip_menu (`entry`,`text_id`) VALUES
+(4093, 4995), -- 54404 (Majordomo Executus' DB entry ID from retail)
+(4109, 5011), -- 54404 (Majordomo Executus' DB entry ID from retail)
+(4108, 5012); -- 54404 (Majordomo Executus' DB entry ID from retail)
+
+DELETE FROM `gossip_menu_option` WHERE (`menu_id`=4108 AND `id`=0) OR (`menu_id`=4109 AND `id`=0) OR (`menu_id`=4093 AND `id`=0);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(4093,0,0, 'Tell me more.', 7675,1,1,4109,0,0,0,'',0), -- menu_id + text in TDB 6.04
+(4109,0,0, 'What else do you have to say?', 7673,1,1,4108,0,0,0,'',0), -- menu_id + text in TDB 6.04
+(4108,0,0, 'You challenged us and we have come. Where is this master you speak of?\n', 7646,1,1, 0,0,0,0,'',0); -- menu_id + text in TDB 6.04
diff --git a/sql/updates/world/3.3.5/2016_06_09_02_world.sql b/sql/updates/world/3.3.5/2016_06_09_02_world.sql
new file mode 100644
index 00000000000..b2a7d985a9f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_09_02_world.sql
@@ -0,0 +1,21 @@
+-- Correct gossip menu option lines, text found in broadcast_text:
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (6186,6185,6187,6208,6209,6210,6211);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(6186, 0,0, "I am ready to discover where my fortune lies!",10047,1,1,6185,0,0,0,'',0),
+(6185, 0,0, "I slay the man on the spot as my liege would expect me to do, as he is nothing more than a thief and a liar.", 10049,1,1,6187,0,0,0,'',0),
+(6185, 1,0, "I turn over the man to my liege for punishment, as he has broken the law of the land and it is my sworn duty to enforce it.", 10050,1,1,6187,0,0,0,'',0),
+(6185, 2,0, "I confiscate the corn he has stolen, warn him that stealing is a path towards doom and destruction, but I let him go to return to his family.", 10051,1,1,6187,0,0,0,'',0),
+(6185, 3,0, "I allow the man to take enough corn to feed his family for a couple of days, encouraging him to leave the land.", 10052,1,1,6187,0,0,0,'',0),
+(6187, 0,0, "I execute him as per my liege's instructions, and do it in such a manner that he suffers painfully before he dies as retribution for his crimes against my people.", 10075,1,1,6208,0,0,0,'',0),
+(6187, 1,0, "I execute him as per my liege's instructions, but doing so in as painless of a way as possible. Justice must be served, but I can show some compassion.", 10076,1,1,6208,0,0,0,'',0),
+(6187, 2,0, "I risk my own life and free him so that he may prove his innocence. If I can, I'll help him in any way.", 10077,1,1,6208,0,0,0,'',0),
+(6208, 0,0, "I confront the ruler on his malicious behavior, upholding my liege's honor at the risk of any future diplomacy.", 10079,1,1,6209,0,0,0,'',0),
+(6208, 1,0, "I not-so-quietly ignore the insult, hoping to instill a fear in the ruler that he may have gaffed. I then inform my liege of the insult when I return.", 10080,1,1,6209,0,0,0,'',0),
+(6208, 2,0, "I quietly ignore the insult. I will not tell my liege, as I am to secure peace at all costs. It's only an insult - not a declaration of war.", 10081,1,1,6209,0,0,0,'',0),
+(6209, 0,0, "I would speak against my brother joining the order, rushing a permanent breach in our relationship. He would be a danger to himself and those around him, and that is too great a risk hoping he would improve over time.", 10083,1,1,6210,0,0,0,'',0),
+(6209, 1,0, "I would speak for my brother joining the order, potentially risking the safety of the order. I could help him with the order's regimens, and I'd have faith in his ability to adapt and learn.", 10084,1,1,6210,0,0,0,'',0),
+(6209, 2,0, "I would create some surreptitious means to keep my brother out of the order. I can keep him out without him being any bit wiser, thereby saving our familial bonds.", 10085,1,1,6210,0,0,0,'',0),
+(6210, 0,0, "I would show my liege the beast's ear and claim the beast's death as my own, taking the reward for my own use. It is wrong to claim a deed as your own that someone else in fact did.", 10086,1,1,6211,0,0,0,'',0),
+(6210, 1,0, "I would show my liege the beast's ear and claim the beast's death as my own - after all, I did slay it. I would then offer some of the reward to the destitute knight to help his family.", 10088,1,1,6211,0,0,0,'',0),
+(6210, 2,0, "I would remain silent about the kill and allow the knight to claim the reward to aid his family.", 10089,1,1,6211,0,0,0,'',0),
+(6211, 0,0, "I'd love to get one of those written fortunes you mentioned! I've got the space in my inventory for it.", 10091,1,1,0,0,0,0,'',0);
diff --git a/sql/updates/world/3.3.5/2016_06_09_03_world_335.sql b/sql/updates/world/3.3.5/2016_06_09_03_world_335.sql
new file mode 100644
index 00000000000..c4be18500b9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_09_03_world_335.sql
@@ -0,0 +1,23 @@
+-- Remove outdated ScriptName from NPC 7775 Gregan Brewspewer
+UPDATE `creature_template` SET `ScriptName`= '' WHERE `entry`= 7775;
+
+-- Remove broadcast_text link from Gregan's default gossip "What can I do for ya?"
+-- to enable npc_text.ID 2433 "Hi there! The name's Gregan. What can I do for ya?"
+-- This mixup is caused by invalid duplicate use of BroadcastTextID0 = 8275,
+-- duplicate of npc_text.ID 5695, used by NPC entry 5167 Fenthwick <Rogue Trainer>
+-- Lookup queries to verify this information:
+-- SELECT * FROM `npc_text` WHERE `BroadcastTextID0`= 8275; -- (ID 2433 + 5695)
+-- SELECT * FROM `gossip_menu` WHERE `text_id`= 5695; -- (4561,5695)
+-- SELECT * FROM `gossip_menu_option` WHERE `menu_id`= 4561; -- (id 0,1,2,4) "I'm lookin' for rogue trainin'."
+-- SELECT * FROM `creature_template` WHERE `gossip_menu_id`= 4561; -- (5167 Fenthwick <Rogue Trainer>)
+
+UPDATE `npc_text` SET `BroadcastTextID0`= 0 WHERE `ID`= 2433; -- old (invalid) BroadcastTextID0 : 8275
+
+-- Activate selection of the next gossip menus in the gossip dialogue
+UPDATE `gossip_menu_option` SET `action_menu_id`= 1801 WHERE `menu_id`= 1802 AND `id`= 0;
+UPDATE `gossip_menu_option` SET `action_menu_id`= 1915 WHERE `menu_id`= 1801 AND `id`= 0;
+
+-- Condition for gossip_menu_option.menu_id 1802, shown in Gregan Brewspewer's default gossip menu 2433
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup`= 1802 AND `SourceEntry`=0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15, 1802, 0, 0, 0, 9, 0, 3909, 0, 0, 0, 0, 0, "", "Show Gossip Menu Option menu_id 1802 id 0 if Quest 3909 is taken (active)");
diff --git a/sql/updates/world/3.3.5/2016_06_09_04_world.sql b/sql/updates/world/3.3.5/2016_06_09_04_world.sql
new file mode 100644
index 00000000000..ecff9eb7ce6
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_09_04_world.sql
@@ -0,0 +1,6 @@
+-- NPC ID 17603 Grandmother gossip_menu_option (new rows)
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7441,7442,7443);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(7441,0,0,"Oh, grandmother, what big ears you have.", 14217,0,0,7442,0,0,0,'',0),
+(7442,0,0,"Oh, grandmother, what big eyes you have.", 14219,0,0,7443,0,0,0,'',0),
+(7443,0,0,"Oh, grandmother, what phat lewts you have.",14221,0,0, 0,0,0,0,'',0);
diff --git a/sql/updates/world/3.3.5/2016_06_09_05_world.sql b/sql/updates/world/3.3.5/2016_06_09_05_world.sql
new file mode 100644
index 00000000000..50c99117c03
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_09_05_world.sql
@@ -0,0 +1,82 @@
+-- NPC entry 29665 (Pazik "The Pick" Prylock), 29725 (Benik Boltshear) and 29728 (Walter Soref)
+SET @MENU_ID := 9823;
+SET @Pazik := 29665;
+SET @Benik := 29725;
+SET @Walter := 29728;
+
+-- Corrected gossip menu options based on text found in broadcast_text:
+DELETE FROM `gossip_menu_option` WHERE `menu_id` = @MENU_ID;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(@MENU_ID, 0,0, "I've lost my key to Scholomance.", 30315,1,1,0,0,0,0,'',0),
+(@MENU_ID, 1,0, "I've lost my key to The Arcatraz.", 30316,1,1,0,0,0,0,'',0),
+(@MENU_ID, 2,0, "I've lost my key to The Shattered Halls.", 30317,1,1,0,0,0,0,'',0),
+(@MENU_ID, 3,0, "I've lost my key to Searing Gorge.", 30318,1,1,0,0,0,0,'',0),
+(@MENU_ID, 4,0, "I've lost my Shadowforge Key.", 30319,1,1,0,0,0,0,'',0),
+(@MENU_ID, 5,0, "I've lost The Eye of Haramad.", 30320,1,1,0,0,0,0,'',0),
+(@MENU_ID, 6,0, "I've lost my key to Karazhan.", 30321,1,1,0,0,0,0,'',0),
+(@MENU_ID, 7,0, "I've lost my key to the Violet Hold.", 35500,1,1,0,0,0,0,'',0),
+(@MENU_ID, 8,0, "I've lost my Essence-Infused Moonstone. Can you replace it?", 20969,1,1,0,0,0,0,'',0);
+
+-- Walter Soref is missing his npcflag for gossip (the other 2 locksmiths are OK)
+UPDATE `creature` SET `npcflag`=(`npcflag`|1) WHERE `id` = @Walter;
+
+UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` IN (@Pazik,@Benik,@Walter);
+
+DELETE FROM `smart_scripts` WHERE `source_type` = 0 AND `entryorguid` IN (@Pazik,@Benik,@Walter);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@Pazik, 0,0,9,62,0,100,0,9823,0,0,0,11,54883,0,0,0,0,0,7,0,0,0,0,0,0,0,"Pazik \"The Pick\" Prylock - on Gossip Option 0 selected - cast 'Create Skeleton Key'"),
+(@Pazik, 0,1,9,62,0,100,0,9823,1,0,0,11,54881,0,0,0,0,0,7,0,0,0,0,0,0,0,"Pazik \"The Pick\" Prylock - on Gossip Option 1 selected - cast 'Create Key to the Arcatraz'"),
+(@Pazik, 0,2,9,62,0,100,0,9823,2,0,0,11,54884,0,0,0,0,0,7,0,0,0,0,0,0,0,"Pazik \"The Pick\" Prylock - on Gossip Option 2 selected - cast 'Create Shattered Halls Key'"),
+(@Pazik, 0,3,9,62,0,100,0,9823,3,0,0,11,54880,0,0,0,0,0,7,0,0,0,0,0,0,0,"Pazik \"The Pick\" Prylock - on Gossip Option 3 selected - cast 'Create Key to Searing Gorge'"),
+(@Pazik, 0,4,9,62,0,100,0,9823,4,0,0,11,54882,0,0,0,0,0,7,0,0,0,0,0,0,0,"Pazik \"The Pick\" Prylock - on Gossip Option 4 selected - cast 'Create Shadowforge Key'"),
+(@Pazik, 0,5,9,62,0,100,0,9823,5,0,0,11,54887,0,0,0,0,0,7,0,0,0,0,0,0,0,"Pazik \"The Pick\" Prylock - on Gossip Option 5 selected - cast 'Create They Eye of Haramad'"),
+(@Pazik, 0,6,9,62,0,100,0,9823,6,0,0,11,54885,0,0,0,0,0,7,0,0,0,0,0,0,0,"Pazik \"The Pick\" Prylock - on Gossip Option 6 selected - cast 'Create The Master's Key'"),
+(@Pazik, 0,7,9,62,0,100,0,9823,7,0,0,11,67253,0,0,0,0,0,7,0,0,0,0,0,0,0,"Pazik \"The Pick\" Prylock - on Gossip Option 7 selected - cast 'Create The Violet Hold Key'"),
+(@Pazik, 0,8,9,62,0,100,0,9823,8,0,0,11,40173,0,0,0,0,0,7,0,0,0,0,0,0,0,"Pazik \"The Pick\" Prylock - on Gossip Option 8 selected - cast 'Create Essence-Infused Moonstone'"),
+(@Pazik, 0,9,0,61,0,100,0, 0,0,0,0,72, 0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Pazik \"The Pick\" Prylock - on Gossip Option * selected - close Gossip"),
+(@Benik, 0,0,9,62,0,100,0,9823,0,0,0,11,54883,0,0,0,0,0,7,0,0,0,0,0,0,0,"Benik Boltshear - on Gossip Option 0 selected - cast 'Create Skeleton Key'"),
+(@Benik, 0,1,9,62,0,100,0,9823,1,0,0,11,54881,0,0,0,0,0,7,0,0,0,0,0,0,0,"Benik Boltshear - on Gossip Option 1 selected - cast 'Create Key to the Arcatraz'"),
+(@Benik, 0,2,9,62,0,100,0,9823,2,0,0,11,54884,0,0,0,0,0,7,0,0,0,0,0,0,0,"Benik Boltshear - on Gossip Option 2 selected - cast 'Create Shattered Halls Key'"),
+(@Benik, 0,3,9,62,0,100,0,9823,3,0,0,11,54880,0,0,0,0,0,7,0,0,0,0,0,0,0,"Benik Boltshear - on Gossip Option 3 selected - cast 'Create Key to Searing Gorge'"),
+(@Benik, 0,4,9,62,0,100,0,9823,4,0,0,11,54882,0,0,0,0,0,7,0,0,0,0,0,0,0,"Benik Boltshear - on Gossip Option 4 selected - cast 'Create Shadowforge Key'"),
+(@Benik, 0,5,9,62,0,100,0,9823,5,0,0,11,54887,0,0,0,0,0,7,0,0,0,0,0,0,0,"Benik Boltshear - on Gossip Option 5 selected - cast 'Create They Eye of Haramad'"),
+(@Benik, 0,6,9,62,0,100,0,9823,6,0,0,11,54885,0,0,0,0,0,7,0,0,0,0,0,0,0,"Benik Boltshear - on Gossip Option 6 selected - cast 'Create The Master's Key'"),
+(@Benik, 0,7,9,62,0,100,0,9823,7,0,0,11,67253,0,0,0,0,0,7,0,0,0,0,0,0,0,"Benik Boltshear - on Gossip Option 7 selected - cast 'Create The Violet Hold Key'"),
+(@Benik, 0,8,9,62,0,100,0,9823,8,0,0,11,40173,0,0,0,0,0,7,0,0,0,0,0,0,0,"Benik Boltshear - on Gossip Option 8 selected - cast 'Create Essence-Infused Moonstone'"),
+(@Benik, 0,9,0,61,0,100,0, 0,0,0,0,72, 0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Benik Boltshear - on Gossip Option * selected - close Gossip"),
+(@Walter,0,0,9,62,0,100,0,9823,0,0,0,11,54883,0,0,0,0,0,7,0,0,0,0,0,0,0,"Walter Soref - on Gossip Option 0 selected - cast 'Create Skeleton Key'"),
+(@Walter,0,1,9,62,0,100,0,9823,1,0,0,11,54881,0,0,0,0,0,7,0,0,0,0,0,0,0,"Walter Soref - on Gossip Option 1 selected - cast 'Create Key to the Arcatraz'"),
+(@Walter,0,2,9,62,0,100,0,9823,2,0,0,11,54884,0,0,0,0,0,7,0,0,0,0,0,0,0,"Walter Soref - on Gossip Option 2 selected - cast 'Create Shattered Halls Key'"),
+(@Walter,0,3,9,62,0,100,0,9823,3,0,0,11,54880,0,0,0,0,0,7,0,0,0,0,0,0,0,"Walter Soref - on Gossip Option 3 selected - cast 'Create Key to Searing Gorge'"),
+(@Walter,0,4,9,62,0,100,0,9823,4,0,0,11,54882,0,0,0,0,0,7,0,0,0,0,0,0,0,"Walter Soref - on Gossip Option 4 selected - cast 'Create Shadowforge Key'"),
+(@Walter,0,5,9,62,0,100,0,9823,5,0,0,11,54887,0,0,0,0,0,7,0,0,0,0,0,0,0,"Walter Soref - on Gossip Option 5 selected - cast 'Create They Eye of Haramad'"),
+(@Walter,0,6,9,62,0,100,0,9823,6,0,0,11,54885,0,0,0,0,0,7,0,0,0,0,0,0,0,"Walter Soref - on Gossip Option 6 selected - cast 'Create The Master's Key'"),
+(@Walter,0,7,9,62,0,100,0,9823,7,0,0,11,67253,0,0,0,0,0,7,0,0,0,0,0,0,0,"Walter Soref - on Gossip Option 7 selected - cast 'Create The Violet Hold Key'"),
+(@Walter,0,8,9,62,0,100,0,9823,8,0,0,11,40173,0,0,0,0,0,7,0,0,0,0,0,0,0,"Walter Soref - on Gossip Option 8 selected - cast 'Create Essence-Infused Moonstone'"),
+(@Walter,0,9,0,61,0,100,0, 0,0,0,0,72, 0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Walter Soref - on Gossip Option * selected - close Gossip");
+
+-- conditions for gossip_menu_option.menu_id 9823:
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup`= @MENU_ID;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,@MENU_ID,0,0, 0, 8,0, 5505,0,0, 0,0,0,'',"Show gossip option 9823 id 0 if quest 5505 is rewarded AND player does NOT have item 13704."),
+(15,@MENU_ID,0,0, 0, 2,0,13704,1,0, 1,0,0,'',"Show gossip option 9823 id 0 if player does NOT have item 13704 AND quest 5505 is rewarded."),
+(15,@MENU_ID,0,0, 1, 8,0, 5511,0,0, 0,0,0,'',"Show gossip option 9823 id 0 if quest 5511 is rewarded AND player does NOT have item 13704."),
+(15,@MENU_ID,0,0, 1, 2,0,13704,1,0, 1,0,0,'',"Show gossip option 9823 id 0 if player does NOT have item 13704 AND quest 5511 is rewarded."),
+(15,@MENU_ID,1,0, 0, 8,0,10704,0,0, 0,0,0,'',"Show gossip option 9823 id 1 if quest 10704 is rewarded AND player does NOT have item 31084."),
+(15,@MENU_ID,1,0, 0, 2,0,31084,1,0, 1,0,0,'',"Show gossip option 9823 id 1 if player does NOT have item 31084 AND quest 10704 is rewarded."),
+(15,@MENU_ID,2,0, 0, 8,0,10758,0,0, 0,0,0,'',"Show gossip option 9823 id 2 if quest 10758 is rewarded AND player does NOT have item 28395."),
+(15,@MENU_ID,2,0, 0, 2,0,28395,1,0, 1,0,0,'',"Show gossip option 9823 id 2 if player does NOT have item 28395 AND quest 10758 is rewarded."),
+(15,@MENU_ID,2,0, 1, 8,0,10764,0,0, 0,0,0,'',"Show gossip option 9823 id 2 if quest 10764 is rewarded AND player does NOT have item 28395."),
+(15,@MENU_ID,2,0, 1, 2,0,28395,1,0, 1,0,0,'',"Show gossip option 9823 id 2 if player does NOT have item 28395 AND quest 10764 is rewarded."),
+(15,@MENU_ID,3,0, 0, 8,0, 3201,0,0, 0,0,0,'',"Show gossip option 9823 id 3 if quest 3201 is rewarded AND player does NOT have item 5396."),
+(15,@MENU_ID,3,0, 0, 2,0, 5396,1,0, 1,0,0,'',"Show gossip option 9823 id 3 if player does NOT have item 5396 AND quest 3201 is rewarded."),
+(15,@MENU_ID,4,0, 0, 8,0, 3802,0,0, 0,0,0,'',"Show gossip option 9823 id 4 if quest 3802 is rewarded AND player does NOT have item 11000."),
+(15,@MENU_ID,4,0, 0, 2,0,11000,1,0, 1,0,0,'',"Show gossip option 9823 id 4 if player does NOT have item 11000 AND quest 3802 is rewarded."),
+(15,@MENU_ID,5,0, 0, 8,0,10982,0,0, 0,0,0,'',"Show gossip option 9823 id 5 if quest 10982 is rewarded AND player does NOT have item 32092."),
+(15,@MENU_ID,5,0, 0, 2,0,32092,1,0, 1,0,0,'',"Show gossip option 9823 id 5 if player does NOT have item 32092 AND quest 10982 is rewarded."),
+(15,@MENU_ID,6,0, 0, 8,0, 9837,0,0, 0,0,0,'',"Show gossip option 9823 id 6 if quest 9837 is rewarded AND player does NOT have item 24490."),
+(15,@MENU_ID,6,0, 0, 2,0,24490,1,0, 1,0,0,'',"Show gossip option 9823 id 6 if player does NOT have item 24490 AND quest 9837 is rewarded."),
+(15,@MENU_ID,7,0, 0, 8,0,13159,0,0, 0,0,0,'',"Show gossip option 9823 id 7 if quest 13159 is rewarded AND player does NOT have item 42482."),
+(15,@MENU_ID,7,0, 0, 2,0,42482,1,0, 1,0,0,'',"Show gossip option 9823 id 7 if player does NOT have item 42482 AND quest 13159 is rewarded."),
+(15,@MENU_ID,8,0, 0, 8,0,11011,0,0, 0,0,0,'',"Show gossip option 9823 id 8 if quest 11011 is rewarded AND player does NOT have item 32449."),
+(15,@MENU_ID,8,0, 0, 2,0,32449,1,0, 1,0,0,'',"Show gossip option 9823 id 8 if player does NOT have item 32449 AND quest 11011 is rewarded.");
diff --git a/sql/updates/world/3.3.5/2016_06_09_06_world.sql b/sql/updates/world/3.3.5/2016_06_09_06_world.sql
new file mode 100644
index 00000000000..9037a2a2fe5
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_09_06_world.sql
@@ -0,0 +1,3 @@
+-- Wrong respawntimer for Quest GameObjects
+-- Bingles's Toolbucket, Bingles's Blastencapper
+UPDATE `gameobject` SET `spawntimesecs` = 10 WHERE `id` IN (104564,104569,104574,104575);
diff --git a/sql/updates/world/3.3.5/2016_06_11_00_world.sql b/sql/updates/world/3.3.5/2016_06_11_00_world.sql
new file mode 100644
index 00000000000..ea81a3ce563
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_00_world.sql
@@ -0,0 +1,3 @@
+-- Creature entry 19871 World Trigger (Not Immune NPC)
+-- set InhabitType [Flying] to enable hover mode for this creature
+UPDATE `creature_template` SET `InhabitType`= 4 WHERE `entry` = 19871;
diff --git a/sql/updates/world/3.3.5/2016_06_11_01_world.sql b/sql/updates/world/3.3.5/2016_06_11_01_world.sql
new file mode 100644
index 00000000000..c7185f6642c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_01_world.sql
@@ -0,0 +1,2 @@
+-- Correct page text for item 9568, Rune-Inscribed Parchment
+UPDATE `page_text` SET `Text` = "Lok'tar, $g brother:sister;. The elements beckon you closer and bid me to show you the path of the shaman. The spirits of our ancestors watch from beyond and swell with pride knowing you have joined our ranks.$B$BWhen you are ready, seek me out near the entrance to the Den. It is there that I will be training others of our kind. Until then, may the wind be at your back.$B$B-Shikrik, Shaman Trainer" WHERE `ID`= 2461;
diff --git a/sql/updates/world/3.3.5/2016_06_11_02_world.sql b/sql/updates/world/3.3.5/2016_06_11_02_world.sql
new file mode 100644
index 00000000000..ac5d1f6037c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_02_world.sql
@@ -0,0 +1,9 @@
+--
+DELETE FROM `conditions` WHERE `SourceEntry`=6383 AND SourceTypeOrReferenceId IN(19, 20);
+INSERT INTO `conditions` VALUES
+(19, 0, 6383, 0, 0, 28, 0, 235, 0, 0, 1, 0, 0, "", "Show quest 'The Ashenvale Hunt' if quest 'The Ashenvale Hunt' (breadcrumb) is not completed"),
+(20, 0, 6383, 0, 0, 28, 0, 235, 0, 0, 1, 0, 0, "", "Show quest 'The Ashenvale Hunt' if quest 'The Ashenvale Hunt' (breadcrumb) is not completed"),
+(19, 0, 6383, 0, 0, 28, 0, 742, 0, 0, 1, 0, 0, "", "Show quest 'The Ashenvale Hunt' if quest 'The Ashenvale Hunt' (breadcrumb) is not completed"),
+(20, 0, 6383, 0, 0, 28, 0, 742, 0, 0, 1, 0, 0, "", "Show quest 'The Ashenvale Hunt' if quest 'The Ashenvale Hunt' (breadcrumb) is not completed"),
+(19, 0, 6383, 0, 0, 28, 0, 6382, 0, 0, 1, 0, 0, "", "Show quest 'The Ashenvale Hunt' if quest 'The Ashenvale Hunt' (breadcrumb) is not completed"),
+(20, 0, 6383, 0, 0, 28, 0, 6382, 0, 0, 1, 0, 0, "", "Show quest 'The Ashenvale Hunt' if quest 'The Ashenvale Hunt' (breadcrumb) is not completed");
diff --git a/sql/updates/world/3.3.5/2016_06_11_03_world.sql b/sql/updates/world/3.3.5/2016_06_11_03_world.sql
new file mode 100644
index 00000000000..47e3aefa366
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_03_world.sql
@@ -0,0 +1,5 @@
+-- fix string in trinity_string incorrectly implying character customization is forced at login
+UPDATE `trinity_string` SET `content_default`='customization for player %s will be requested at next login.' WHERE `entry`=345;
+UPDATE `trinity_string` SET `content_default`='customization for player %s (GUID #%u) will be requested at next login.' WHERE `entry`=346;
+
+UPDATE `trinity_string` SET `content_default`='You already have a pet.' WHERE `entry`=344; -- add missing article
diff --git a/sql/updates/world/3.3.5/2016_06_11_04_world.sql b/sql/updates/world/3.3.5/2016_06_11_04_world.sql
new file mode 100644
index 00000000000..f45f868006b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_04_world.sql
@@ -0,0 +1,5 @@
+--
+UPDATE `quest_request_items` SET `CompletionText`="So, Motega Firemane sends word of Arikara... well now that is grave news.$B$B<Magatha looks around.>$B$BArikara is a deadly creature born only to seek vengeance against those who have committed heinous acts.$B$B<Magatha smiles.>" WHERE `ID`=5062;
+UPDATE `quest_offer_reward` SET `RewardText`="You have returned from Desolace more than successful, $N. Thank you.$B$BThank you for your efforts, your time, and your understanding to my plea. Thrall understands and desires peace between the Horde and Alliance, and by taking measures to insure our appearance is acceptable, we will not provoke any further threats of unnecessary violence." WHERE `ID`=1436;
+UPDATE `quest_offer_reward` SET `RewardText`="Ah, this horn belongs to a Tauren, Roon Wildmane. My father spoke often of the good times they had together hunting the beasts of Desolace. So Roon is inviting me to join him, is he?$B$BWe're neck deep in the jungle right now, but thank you, $N. Perhaps my next expedition will take me to Desolace, the land of the centaurs." WHERE `ID`=5763;
+UPDATE `quest_offer_reward` SET `RewardText`="This does not make sense. Why would Arikara be after Cairne Bloodhoof? Magatha could not be wrong, she is our most powerful shaman.$B$B<Motega shakes his head.>$B$BRegardless, your great deed to the Horde shall not go unnoticed - please, choose one of these as a reward for your aid." WHERE `ID`=5088;
diff --git a/sql/updates/world/3.3.5/2016_06_11_05_world.sql b/sql/updates/world/3.3.5/2016_06_11_05_world.sql
new file mode 100644
index 00000000000..8c088c6f139
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_05_world.sql
@@ -0,0 +1,6 @@
+--
+DELETE FROM `creature_queststarter` WHERE `quest`=1361;
+INSERT INTO `creature_queststarter` VALUES
+(2229, 1361),
+(10540, 1361),
+(4485, 1361);
diff --git a/sql/updates/world/3.3.5/2016_06_11_06_world.sql b/sql/updates/world/3.3.5/2016_06_11_06_world.sql
new file mode 100644
index 00000000000..12def3cc386
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_06_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `quest_template_addon` WHERE `ID`=680;
+INSERT INTO `quest_template_addon` (`ID`, `PrevQuestID`) VALUES
+(680, 678);
diff --git a/sql/updates/world/3.3.5/2016_06_11_07_world.sql b/sql/updates/world/3.3.5/2016_06_11_07_world.sql
new file mode 100644
index 00000000000..2e05fbac8fc
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_07_world.sql
@@ -0,0 +1,6 @@
+--
+UPDATE `quest_template_addon` SET `SpecialFlags`=0 WHERE `ID` IN (8552, 3785);
+
+DELETE FROM `quest_template_addon` WHERE `ID`=2882;
+INSERT INTO `quest_template_addon` (`ID`, `SpecialFlags`) VALUES
+(2882, 1);
diff --git a/sql/updates/world/3.3.5/2016_06_11_08_world.sql b/sql/updates/world/3.3.5/2016_06_11_08_world.sql
new file mode 100644
index 00000000000..be72014d0ba
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_08_world.sql
@@ -0,0 +1,9 @@
+--
+DELETE FROM `conditions` WHERE `SourceEntry`=1127 AND `SourceTypeOrReferenceId` IN (19, 20);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(19, 0, 1127, 0, 0, 9, 0, 1119, 0, 0, 0, 0, 0, "", "Quest 'Fool's Stout' - Can accept if player has quest 'Zanzil's Mixture and a Fool's Stout'"),
+(20, 0, 1127, 0, 0, 9, 0, 1119, 0, 0, 0, 0, 0, "", "Quest 'Fool's Stout' - Can accept if player has quest 'Zanzil's Mixture and a Fool's Stout'");
+
+DELETE FROM `quest_template_addon` WHERE `ID`=1127;
+INSERT INTO `quest_template_addon` (`ID`, `SpecialFlags`) VALUES
+(1127, 1);
diff --git a/sql/updates/world/3.3.5/2016_06_11_09_world.sql b/sql/updates/world/3.3.5/2016_06_11_09_world.sql
new file mode 100644
index 00000000000..71368bfb9c2
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_09_world.sql
@@ -0,0 +1,7 @@
+--
+UPDATE `quest_template_addon` SET `SpecialFlags`=1 WHERE `id`=1463;
+DELETE FROM `conditions` WHERE `SourceEntry`=1463 AND `SourceTypeOrReferenceId` IN (20, 19) AND `ConditionTypeOrReference` IN (2);
+INSERT INTO `conditions` VALUES
+(19, 0, 1463, 0, 0, 2, 0, 6635, 1, 1, 1, 0, 0, "", "Show quest 'Earth Sapta' only if the item 'earth-sapta' is not in player's bags or bank"),
+(20, 0, 1463, 0, 0, 2, 0, 6635, 1, 1, 1, 0, 0, "", "Show question mark for quest 'Earth Sapta' only if the item 'earth-sapta' is not in player's bags or bank");
+UPDATE `quest_request_items` SET `CompletionText`="I give you one in good faith. You already proved yourself once, but me tinkin' you should be more careful in the future." WHERE `ID`= 1463;
diff --git a/sql/updates/world/3.3.5/2016_06_11_10_world.sql b/sql/updates/world/3.3.5/2016_06_11_10_world.sql
new file mode 100644
index 00000000000..68f5151dc87
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_10_world.sql
@@ -0,0 +1,50 @@
+--
+DELETE FROM `conditions` WHERE `SourceEntry` IN (403, 308) AND `SourceTypeOrReferenceId` IN (19, 20);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(19, 0, 403, 0, 0, 28, 0, 310, 0, 0, 0, 0, 0, "", "Show quest 'Guarded Thunderbrew Barrel' if quest 'Bitter Rivals' is completed"),
+(20, 0, 403, 0, 0, 28, 0, 310, 0, 0, 0, 0, 0, "", "Show quest 'Guarded Thunderbrew Barrel' if quest 'Bitter Rivals' is completed"),
+(19, 0, 308, 0, 0, 8, 0, 403, 0, 0, 0, 0, 0, "", "Show quest 'Distracting Jarven' if quest 'Guarded Thunderbrew Barrel' is rewarded"),
+(20, 0, 308, 0, 0, 8, 0, 403, 0, 0, 0, 0, 0, "", "Show quest 'Distracting Jarven' if quest 'Guarded Thunderbrew Barrel' is rewarded"),
+(19, 0, 308, 0, 0, 28, 0, 310, 0, 0, 0, 0, 0, "", "Show quest 'Distracting Jarven' if quest 'Bitter Rivals' is completed"),
+(20, 0, 308, 0, 0, 28, 0, 310, 0, 0, 0, 0, 0, "", "Show quest 'Distracting Jarven' if quest 'Bitter Rivals' is completed");
+
+DELETE FROM `creature_text` WHERE `entry`=1373 AND `groupid`=0;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(1373, 0, 0, (SELECT `MaleText` FROM `broadcast_text` WHERE `id`=127), 12, 7, 100, 1, 0, 0, 127, 0, "Jarven Thunderbrew");
+
+UPDATE `gameobject` SET `position_x`=-5607.24, `position_y`=-547.934, `position_z`=392.985 WHERE `id`=270;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (1373, 137300);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(1373, 0, 0, 1, 20, 0, 100, 0, 308, 0, 0, 0, 53, 0, 1373, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On Quest Rewarded - Start WP"),
+(1373, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On Quest Rewarded - Remove Questgiver Flag"),
+(1373, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On Quest Rewarded - Say Line 0"),
+(1373, 0, 3, 4, 40, 0, 100, 0, 2, 0, 0, 0, 41, 44, 0, 0, 0, 0, 0, 14, 1037, 269, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On WP 2 Reached - Despawn Closest Gameobject \'Guarded Thunder Ale Barrel\'"),
+(1373, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 70, 45, 0, 0, 0,0, 0, 14, 35875, 270, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On WP 2 Reached - Respawn Closest Gameobject \'Unguarded Thunder Ale Barrel\'"),
+(1373, 0, 5, 6, 40, 0, 100, 0, 8, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On WP 8 Reached - Say Line 1"),
+(1373, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 5.6724, "Jarven Thunderbrew - On WP 8 Reached - Turn"),
+(1373, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 54, 10000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On WP 8 Reached - Pause WP for 10 seconds"),
+(1373, 0, 8, 0, 40, 0, 100, 0, 15, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On WP 15 Reached - Say Line 2"),
+(1373, 0, 9, 10, 58, 0, 100, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On WP Ended - Say Line 3"),
+(1373, 0, 10, 11, 61, 0, 100, 0, 0, 0, 0, 0, 82, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On WP Ended - Add Questgiver Flag"),
+(1373, 0, 11, 0, 61, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jarven Thunderbrew - On WP Ended - Reset Orientation");
+
+DELETE FROM `waypoints` WHERE `entry`= 1373;
+INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
+(1373, 1, -5601.64, -541.38, 392.42, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 2, -5597.94, -542.04, 392.42, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 3, -5597.95, -548.43, 395.48, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 4, -5605.31, -549.33, 399.09, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 5, -5607.55, -546.63, 399.09, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 6, -5597.52, -538.75, 399.09, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 7, -5597.62, -530.24, 399.65, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 8, -5603.67, -529.91, 399.65, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 9, -5603.67, -529.91, 399.65, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 10, -5597.62, -530.24, 399.65, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 11, -5597.52, -538.75, 399.09, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 12, -5607.55, -546.63, 399.09, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 13, -5605.31, -549.33, 399.09, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 14, -5597.95, -548.43, 395.48, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 15, -5597.94, -542.04, 392.42, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 16, -5601.64, -541.38, 392.42, 'Jarven Thunderbrew - Quest 308 Waypoint movement'),
+(1373, 17, -5605.96, -544.45, 392.43, 'Jarven Thunderbrew - Quest 308 Waypoint movement');
diff --git a/sql/updates/world/3.3.5/2016_06_11_11_world.sql b/sql/updates/world/3.3.5/2016_06_11_11_world.sql
new file mode 100644
index 00000000000..86e6fa082b2
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_11_world.sql
@@ -0,0 +1,32 @@
+--
+-- Mebok Mizzyrix SAI
+
+SET @ENTRY := 3446;
+DELETE FROM `creature_text` WHERE `entry`= @ENTRY AND `GroupId`=2;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(@ENTRY,2,0,"Hey $n! Don't forget to grab a crate, a manual and a command stick!", 12,0,100,0,0,0,1788,0,'Mebok Mizzyrix on Quest 1221 taken');
+
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,20,0,100,0,865,0,0,0,80,@ENTRY*100+00,0,0,0,0,0,1,0,0,0,0,0,0,0,"Mebok Mizzyrix - On Quest 'Raptor Horns' Finished - Run Script"),
+(@ENTRY,0,1,0,19,0,100,0,1221,0,0,0,80,@ENTRY*100+01,0,0,0,0,0,1,0,0,0,0,0,0,0,"Mebok Mizzyrix - On Quest 'Blueleaf Tubers' Taken - Run Script");
+
+-- Actionlist SAI
+SET @ENTRY := 344600;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Mebok Mizzyrix - On Script - Say Line 0"),
+(@ENTRY,9,1,0,0,0,100,0,2000,2000,0,0,11,17550,0,0,0,0,0,1,0,0,0,0,0,0,0,"Mebok Mizzyrix - On Script - Cast 'Purification'"),
+(@ENTRY,9,2,0,0,0,100,0,4000,4000,0,0,5,34,0,0,0,0,0,1,0,0,0,0,0,0,0,"Mebok Mizzyrix - On Script - Play Emote 34"),
+(@ENTRY,9,3,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Mebok Mizzyrix - On Script - Say Line 1");
+
+-- Actionlist SAI
+SET @ENTRY := 344601;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,7,0,0,0,0,0,0,0,"Mebok Mizzyrix - On Script - Say Line 2"),
+(@ENTRY,9,1,0,0,0,100,0,2000,2000,0,0,69,0,0,0,0,0,0,8,0,0,0,-929.023,-3696.98,7.97395,1.7352,"Mebok Mizzyrix - On Script - Move To Position"),
+(@ENTRY,9,2,0,0,0,100,0,3000,3000,0,0,5,25,0,0,0,0,0,1,0,0,0,0,0,0,0,"Mebok Mizzyrix - On Script - Play Emote 25"),
+(@ENTRY,9,3,0,0,0,100,0,3000,3000,0,0,69,0,0,0,0,0,0,8,0,0,0,-928.778,-3697.25,7.99705,6.17741,"Mebok Mizzyrix - On Script - Move To Position"),
+(@ENTRY,9,4,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-928.982,-3697.23,8.06642,3.08923,"Mebok Mizzyrix - On Script - Move To Position");
diff --git a/sql/updates/world/3.3.5/2016_06_11_12_world.sql b/sql/updates/world/3.3.5/2016_06_11_12_world.sql
new file mode 100644
index 00000000000..be2587e862a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_11_12_world.sql
@@ -0,0 +1,24 @@
+--
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `Entry` IN (21159, 18793, 20654);
+DELETE FROM `smart_scripts` WHERE `entryorguid`=18794;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(18794, 0, 0, 0, 1, 0, 100, 7, 1000, 1000, 0, 0, 11, 32958, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - Out of Combat - Cast \'Crystal Channel\ (Dungeon)'),
+(18794, 0, 1, 0, 1, 0, 100, 5, 0, 0, 0, 0, 30, 1, 4, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - Out of Combat - Set Random Phase(1, 4) (No Repeat) (Dungeon)'),
+(18794, 0, 2, 0, 0, 0, 100, 2, 6000, 10000, 4000, 6000, 11, 20795, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - In Combat - Cast \'Fire Blast\' (Normal Dungeon)'),
+(18794, 0, 3, 0, 0, 0, 100, 4, 6000, 10000, 4000, 6000, 11, 14145, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - In Combat - Cast \'Fire Blast\' (Heroic Dungeon)'),
+(18794, 0, 4, 0, 0, 0, 100, 6, 2000, 2000, 10000, 12000, 11, 9574, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - In Combat - Cast \'Flame Buffet\' (Dungeon)'),
+(18794, 0, 5, 0, 0, 0, 100, 6, 4000, 4000, 6000, 8000, 11, 12540, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - In Combat - Cast \'Gouge\' (Dungeon)'),
+(18794, 0, 6, 0, 4, 1, 100, 6, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - On Aggro - Increment Phase By 1 (Phase 1) (No Repeat) (Dungeon)'),
+(18794, 0, 7, 0, 0, 1, 100, 2, 0, 0, 2400, 3800, 11, 15497, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - Combat CMC - Cast \'Frostbolt\' (Phase 1) (Normal Dungeon)'),
+(18794, 0, 8, 0, 0, 1, 100, 4, 0, 0, 2400, 3800, 11, 12675, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - Combat CMC - Cast \'Frostbolt\' (Phase 1) (Heroic Dungeon)'),
+(18794, 0, 9, 0, 0, 1, 100, 2, 7000, 7000, 7000, 12000, 11, 15532, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - In Combat - Cast \'Frost Nova\' (Phase 1) (Normal Dungeon)'),
+(18794, 0, 10, 0, 0, 1, 100, 4, 7000, 7000, 7000, 12000, 11, 15063, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - In Combat - Cast \'Frost Nova\' (Phase 1) (Heroic Dungeon)'),
+(18794, 0, 11, 0, 0, 2, 100, 6, 4000, 4000, 6000, 8000, 11, 12540, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - In Combat - Cast \'Gouge\' (Phase 2) (Dungeon)'),
+(18794, 0, 12, 0, 3, 2, 100, 6, 30, 100, 100, 100, 23, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - Between 30-100% Mana - Decrement Phase By 1 (Phase 2) (Dungeon)'),
+(18794, 0, 13, 0, 4, 4, 100, 0, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - On Aggro - Increment Phase By 1 (Phase 4) (Dungeon)'),
+(18794, 0, 14, 0, 0, 4, 100, 2, 0, 0, 2400, 3800, 11, 33833, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - Combat CMC - Cast \'Arcane Missiles\' (Phase 4) (Normal Dungeon)'),
+(18794, 0, 15, 0, 0, 4, 100, 4, 0, 0, 2400, 3800, 11, 38264, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - Combat CMC - Cast \'Arcane Missiles\' (Phase 4) (Heroic Dungeon)'),
+(18794, 0, 16, 0, 3, 4, 100, 0, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - Between 0-15% Mana - Increment Phase By 1 (Phase 4) (No Repeat) (Dungeon)'),
+(18794, 0, 17, 0, 0, 4, 100, 6, 9000, 12000, 12000, 16000, 11, 33487, 1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - In Combat - Cast \'Addle Humanoid\' (Phase 4) (Dungeon)'),
+(18794, 0, 18, 0, 0, 8, 100, 6, 4000, 4000, 6000, 8000, 11, 12540, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - In Combat - Cast \'Gouge\' (Phase 8) (Dungeon)'),
+(18794, 0, 19, 0, 3, 8, 100, 6, 30, 100, 100, 100, 23, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cabal Ritualist - Between 30-100% Mana - Decrement Phase By 1 (Phase 8) (Dungeon)');
diff --git a/sql/updates/world/3.3.5/2016_06_12_00_world_335.sql b/sql/updates/world/3.3.5/2016_06_12_00_world_335.sql
new file mode 100644
index 00000000000..7e96065243c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_12_00_world_335.sql
@@ -0,0 +1,27 @@
+--
+SET @Entry := 17093;
+
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@Entry;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@Entry, @Entry*100);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@Entry , 0, 0, 0, 20, 0, 100, 0, 9434, 0, 0, 0, 80, @Entry*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Quest \"Testing the Tonic\" rewarded - Run script"),
+(@Entry*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Remove questgiver flag"),
+(@Entry*100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Talk (0)"),
+(@Entry*100, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 11, 60888, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - cast cosmetic emote"),
+(@Entry*100, 9, 3, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Talk (1)"),
+(@Entry*100, 9, 4, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Talk (2)"),
+(@Entry*100, 9, 5, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 17, 64, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Change emote state"),
+(@Entry*100, 9, 6, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 3, 17162, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Change model"),
+(@Entry*100, 9, 7, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Talk (3)"),
+(@Entry*100, 9, 8, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Talk (4)"),
+(@Entry*100, 9, 9, 0, 0, 0, 100, 0, 20000, 20000, 0, 0, 3, 17093, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Change Entry"),
+(@Entry*100, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 17, 30, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Change emote state"),
+(@Entry*100, 9, 11, 0, 0, 0, 100, 0, 0, 0, 0, 0, 82, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Magistrix Elosai - On Script - Add questgiver flag");
+
+DELETE FROM `creature_text` WHERE `entry`=@Entry;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(@Entry, 0, 0, (SELECT `FemaleText` FROM `broadcast_text` WHERE `ID`=13508), 16, 0, 100, 0, 0, 0, 13508, 0, ""),
+(@Entry, 1, 0, (SELECT `FemaleText` FROM `broadcast_text` WHERE `ID`=13509), 12, 0, 100, 7, 0, 0, 13509, 0, ""),
+(@Entry, 2, 0, (SELECT `FemaleText` FROM `broadcast_text` WHERE `ID`=13510), 12, 0, 100, 0, 0, 0, 13510, 0, ""),
+(@Entry, 3, 0, (SELECT `FemaleText` FROM `broadcast_text` WHERE `ID`=13511), 12, 0, 100, 0, 0, 0, 13511, 0, ""),
+(@Entry, 4, 0, (SELECT `FemaleText` FROM `broadcast_text` WHERE `ID`=14318), 12, 0, 100, 0, 0, 0, 14318, 0, "");
diff --git a/sql/updates/world/3.3.5/2016_06_12_01_world.sql b/sql/updates/world/3.3.5/2016_06_12_01_world.sql
new file mode 100644
index 00000000000..62e2c2cc600
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_12_01_world.sql
@@ -0,0 +1,45 @@
+--
+-- Add missing Emote & Say lines for NPC entry 20098(Jane), 20100(Jessel) and 20244(Nova)
+SET @Jane := 20098;
+SET @Jessel := 20100;
+SET @Nova := 20244;
+
+-- Set random movement around a new set spawndist for Nova
+UPDATE `creature` SET `position_x`= 10512.0615,`position_y`= -6499.652,`position_z`= 3.6119,`orientation`= 0.855017,`spawndist`= 8,`MovementType`= 1 WHERE `id`= @Nova;
+UPDATE `creature` SET `position_x`= 10512.0615,`position_y`= -6499.652,`position_z`= 3.6119,`orientation`= 0.855017,`spawndist`= 8,`MovementType`= 1 WHERE `id`= 20246;
+UPDATE `creature` SET `MovementType`=1, `spawndist`=8 WHERE `id` IN (20098,20247,20246);
+
+DELETE FROM `creature_text` WHERE `entry`= @Jane AND `groupid`= 1 AND `id`= 0;
+DELETE FROM `creature_text` WHERE `entry`= @Jessel AND `groupid`= 2 AND `id`= 0;
+DELETE FROM `creature_text` WHERE `entry`= @Nova AND `groupid` IN (0,1) AND `id` IN (0,1,2,3);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(@Jessel,2,0,'%s wakes up, startled.', 16,10,100,0,0,0,17595,0,'Jessel'),
+(@Jane, 1,0,'%s resumes playing on the beach.', 16,10,100,0,0,0,17599,0,'Jane'),
+(@Nova, 1,0,'I think I can see the Sunwell from here!', 12,10,100,1,0,0,17918,0,'Nova'),
+(@Nova, 1,1,'Can you really hear the ocean from one of these shells?',12,10,100,1,0,0,17919,0,'Nova'),
+(@Nova, 1,2,'Oooh! Look, a shiny one!', 12,10,100,1,0,0,17920,0,'Nova'),
+(@Nova, 1,3,'Jane will love this one!', 12,10,100,1,0,0,17921,0,'Nova'),
+(@Nova, 0,0,'%s picks up a sea shell.', 16,10,100,0,0,0,17922,0,'Nova'),
+(@Nova, 0,1,'%s holds a sea shell up to her ear.', 16,10,100,0,0,0,17923,0,'Nova'),
+(@Nova, 0,2,'%s shakes the dirt loose from the shell.', 16,10,100,0,0,0,17924,0,'Nova');
+
+-- Add SmartAI script lines for Jane, Jessel and Nova
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= @Nova;
+DELETE FROM `smart_scripts` WHERE `entryorguid`= @Jane AND `source_type`= 0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`= @Jessel AND `source_type`= 0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`= @Jessel*100 AND `source_type`= 9;
+DELETE FROM `smart_scripts` WHERE `entryorguid`= @Nova AND `source_type`= 0 AND `id` IN (0,1);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Nova, 0,0,0,1,0,100,0, 10000, 10000, 25000, 60000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nova - Out Of Combat - Say Line'),
+(@Nova, 0,1,0,1,0,100,0, 11000, 11000, 25000, 60000,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nova - Out Of Combat - Say Line'),
+(20100, 0, 0, 0, 1, 0, 100, 0, 0, 0, 300000, 300000, 80, 2010000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jessel - Ooc - Action list"),
+(2010000, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 50917, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jessel - Action list - Cast sleep aura"),
+(2010000, 9, 1, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 28, 50917, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jessel - Action list - rrmove sleep aura"),
+(2010000, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jessel - Action list - Say Line 2"),
+(2010000, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 90, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jessel - Action list - Set bytes 1"),
+(2010000, 9, 4, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jessel - Action list - Say Line 0"),
+(2010000, 9, 5, 0, 0, 0, 100, 0, 9000, 9000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @Jane, 50, 0, 0, 0, 0, 0, "Jessel - Action list - Say Line 0"),
+(2010000, 9, 6, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jessel - Action list - Say Line 1"),
+(2010000, 9, 7, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @Jane, 50, 0, 0, 0, 0, 0, "Jessel - Action list - Say Line 1"),
+(2010000, 9, 8, 6, 0, 0, 100, 0, 3000, 3000, 0, 0, 91, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jessel - Action list - remove bytes 1"),
+(2010000, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 50917, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Jessel - Action list - Cast sleep");
diff --git a/sql/updates/world/3.3.5/2016_06_12_02_world.sql b/sql/updates/world/3.3.5/2016_06_12_02_world.sql
new file mode 100644
index 00000000000..dc1709d6d2f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_12_02_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`= 2010000 AND `source_type`= 9;
diff --git a/sql/updates/world/3.3.5/2016_06_12_03_world.sql b/sql/updates/world/3.3.5/2016_06_12_03_world.sql
new file mode 100644
index 00000000000..c1864e88bc3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_12_03_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `creature_loot_template` SET `chance`=5.4 WHERE `entry` IN (3100, 3196, 3244, 3123, 3196, 3268) AND `item`=6514;
+UPDATE `creature_loot_template` SET `chance`=0.7 WHERE `entry`=3100 AND `item`=4663;
diff --git a/sql/updates/world/3.3.5/2016_06_12_04_world.sql b/sql/updates/world/3.3.5/2016_06_12_04_world.sql
new file mode 100644
index 00000000000..718394bc63b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_12_04_world.sql
@@ -0,0 +1,3 @@
+--
+-- Set CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ on Iron Sentinel Credit & Iron Dwarf Assailant & Corpulent Horror Credit
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|2097152 WHERE `entry` IN (30296,30297,30696);
diff --git a/sql/updates/world/3.3.5/2016_06_12_05_world_335.sql b/sql/updates/world/3.3.5/2016_06_12_05_world_335.sql
new file mode 100644
index 00000000000..18ac159672b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_12_05_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `locales_quest` SET `Title_loc2`='Nessa Chantelombre', `Title_loc3`='Nessa Schattensang', `Title_loc6`='Nessa Cantosombrío', `Title_loc7`='Nessa Cantosombrío', `Title_loc8`='Несса Песня Теней', `Details_loc2`="Une de mes amies, Nessa Chantelombre, est une marchande de poissons, dans le village de Rut'theran. Elle a besoin qu'un colis soit apporté à Sombrivage, et cherche quelqu'un qui serait d'accord pour l'aider.$B$BSi cela vous intéresse et que vous souhaitez rencontrer Nessa, il vous faut prendre le portail qui relie Darnassus et Rut'theran. Vous le trouverez à l'ouest des jardins du temple.", `Details_loc3`="Eine Freundin von mir, Nessa Schattensang, vertreibt Angelzubehör in Rut'theran. Sie hat ein Paket, das dringend nach Dunkelküste gebracht werden muss, und sucht jemanden, der ihr hilft.$B$BWenn Ihr Interesse habt, dann durchschreitet das Portal in Darnassus nach Rut'theran. Ihr findet das Portal westlich der Tempelgärten. ", `Details_loc6`="Una amiga mía, Nessa Cantosombrío, comercia con pescado en la Aldea Rut'theran. Necesita entregar un paquete en Costa Oscura y está buscando a alguien que le ayude.$B$BSi te interesa, coge el portal en Darnassus hasta la Aldea Rut'theran para ir a verla. Encontrarás el portal al oeste de Los Jardines del Templo. ", `Details_loc7`="Una amiga mía, Nessa Cantosombrío, comercia con pescado en la Aldea Rut'theran. Necesita entregar un paquete en Costa Oscura y está buscando a alguien que le ayude.$B$BSi te interesa, coge el portal en Darnassus hasta la Aldea Rut'theran para ir a verla. Encontrarás el portal al oeste de Los Jardines del Templo. ", `Details_loc8`="Моя подруга, Несса Песня Теней, торгует рыбой в деревне Рут'теран. Ей нужно доставить посылку на Темные берега, и она ищет кого-нибудь, кто мог бы ей помочь.$B$BЕсли вы хотите помочь Нессе, то ступайте в деревню Рут'теран через портал в Дарнасе. Портал находится к западу от Храмовых садов.", `Objectives_loc2`='Parler à Nessa Chantelombre.', `Objectives_loc3`='Sprecht mit Nessa Schattensang.', `Objectives_loc6`=' Habla con Nessa Cantosombrío.', `Objectives_loc7`=' Habla con Nessa Cantosombrío.', `Objectives_loc8`='Поговорите с Нессой Песня Теней.' WHERE `Id`=6344;
diff --git a/sql/updates/world/3.3.5/2016_06_12_06_world.sql b/sql/updates/world/3.3.5/2016_06_12_06_world.sql
new file mode 100644
index 00000000000..d3522334766
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_12_06_world.sql
@@ -0,0 +1,52 @@
+-- Bunthen Plainswind (NPC 11798) and Silva Fil'naveth (NPC 11800), Moonglade Druid Flight Masters
+UPDATE `creature_template` SET `AIName`= 'SmartAI', `ScriptName`= '' WHERE `entry` IN (11798,11800);
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (4041,4042);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(4041,0,0,"I'd like to fly to Rut'theran Village.", 7573,1,1, 0,0,0,0,'',0),
+(4041,1,0,"Do you know where I may find the Half Pendant of Aquatic Agility?", 8035,1,1,4225,0,0,0,'',0),
+(4041,2,0,"Do you know where I may find the Half Pendant of Aquatic Agility?", 8035,1,1,4226,0,0,0,'',0),
+(4042,0,0,"I'd like to fly to Thunder Bluff.", 12804,1,1, 0,0,0,0,'',0),
+(4042,1,0,"Do you know where I may find the Half Pendant of Aquatic Endurance?",8036,1,1,4223,0,0,0,'',0),
+(4042,2,0,"Do you know where I may find the Half Pendant of Aquatic Endurance?",8036,1,1,4224,0,0,0,'',0);
+
+-- Add gossip_menu entries to be linked to text_id gossip text (npc_text.id)
+DELETE FROM `gossip_menu` WHERE `text_id` IN (4917,4918,5373,5374,5375,5376);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(4042,4917),
+(4042,4918),
+(4223,5373),
+(4224,5374),
+(4225,5375),
+(4226,5376);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` IN (4041,4042);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+-- conditions for Silva's gossip menus
+(14,4041,4913,0, 0, 15,0,1024,0,0, 1, 0,0,'', "Show Gossip Menu entry 4041 text_id 4913 if player is NOT a Druid"),
+(14,4041,4914,0, 1, 15,0,1024,0,0, 0, 0,0,'', "Show Gossip Menu entry 4041 text_id 4914 if player is a Druid"),
+(14,4041,4914,0, 1, 6,0, 469,0,0, 0, 0,0,'', "Show Gossip Menu entry 4041 text_id 4914 if player is Alliance"),
+(14,4041,4915,0, 2, 15,0,1024,0,0, 0, 0,0,'', "Show Gossip Menu entry 4041 text_id 4915 if player is a Druid"),
+(14,4041,4915,0, 2, 6,0, 469,0,0, 1, 0,0,'', "Show Gossip Menu entry 4041 text_id 4915 if player is NOT Alliance"),
+(15,4041, 0,0, 3, 15,0,1024,0,0, 0, 0,0,'', "Show Gossip Menu Option menu_id 4041 id 0 if player is a Druid"),
+(15,4041, 0,0, 3, 6,0, 469,0,0, 0, 0,0,'', "Show Gossip Menu Option menu_id 4041 id 0 if player is Alliance"),
+(15,4041, 1,0, 0, 9,0, 272,0,0, 0, 0,0,'', "Show Gossip Menu Option menu_id 4041 id 1 if Quest 272 is taken"),
+(15,4041, 2,0, 0, 9,0, 30,0,0, 0, 0,0,'', "Show Gossip Menu Option menu_id 4041 id 2 if Quest 30 is taken"),
+-- conditions for Bunthen's gossip menus
+(14,4042,4916,0, 0, 15,0,1024,0,0, 1, 0,0,'', "Show Gossip Menu entry 4042 text_id 4916 if player is NOT a Druid"),
+(14,4042,4918,0, 4, 15,0,1024,0,0, 0, 0,0,'', "Show Gossip Menu entry 4042 text_id 4918 if player is a Druid"),
+(14,4042,4918,0, 4, 6,0, 67,0,0, 0, 0,0,'', "Show Gossip Menu entry 4042 text_id 4918 if player is Horde"),
+(14,4042,4917,0, 5, 15,0,1024,0,0, 0, 0,0,'', "Show Gossip Menu entry 4042 text_id 4917 if player is a Druid"),
+(14,4042,4917,0, 5, 6,0, 67,0,0, 1, 0,0,'', "Show Gossip Menu entry 4042 text_id 4917 if player is NOT Horde"),
+(15,4042, 0,0, 6, 15,0,1024,0,0, 0, 0,0,'', "Show Gossip Menu Option menu_id 4042 id 0 if player is a Druid"),
+(15,4042, 0,0, 6, 6,0, 67,0,0, 0, 0,0,'', "Show Gossip Menu Option menu_id 4042 id 0 if player is Horde"),
+(15,4042, 1,0, 0, 9,0, 272,0,0, 0, 0,0,'', "Show Gossip Menu Option menu_id 4042 id 1 if Quest 272 is taken"),
+(15,4042, 2,0, 0, 9,0, 30,0,0, 0, 0,0,'', "Show Gossip Menu Option menu_id 4042 id 2 if Quest 30 is taken");
+
+-- SmartAI for Bunthen & Silva
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (11798, 11800) AND `source_type` = 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(11798,0,0,1,62,0,100,0,4042,0,0,0,72, 0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Bunthen Plainswind - on Gossip Menu Option 4042 id 0 selected - close Gossip"),
+(11798,0,1,0,61,0,100,0, 0,0,0,0,52,316,0,0,0,0,0,7,0,0,0,0,0,0,0,"Bunthen Plainswind - on Gossip Menu Option 4042 id 0 selected - activate Taxi Path 316(Moonglade - Thunder Bluff)"),
+(11800,0,2,3,62,0,100,0,4041,0,0,0,72, 0,0,0,0,0,0,7,0,0,0,0,0,0,0, "Silva Fil'naveth - on Gossip Menu Option 4041 id 0 selected - close Gossip"),
+(11800,0,3,0,61,0,100,0, 0,0,0,0,52,315,0,0,0,0,0,7,0,0,0,0,0,0,0, "Silva Fil'naveth - on Gossip Menu Option 4041 id 0 selected - activate Taxi Path 315(Moonglade - Rut'theran Village)");
diff --git a/sql/updates/world/3.3.5/2016_06_12_07_world.sql b/sql/updates/world/3.3.5/2016_06_12_07_world.sql
new file mode 100644
index 00000000000..259975e8f14
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_12_07_world.sql
@@ -0,0 +1,33 @@
+-- "Plucky" Johnson (Magus Tirth's assistant) in quest 1950 "Get the Scoop":
+SET @CHICKEN := 6626;
+SET @HUMAN := 6666;
+
+UPDATE `creature_template` SET `gossip_menu_id`= 231, `AIName`= 'SmartAI' WHERE `entry`= @HUMAN;
+UPDATE `creature_template` SET `AIName`= 'SmartAI', `ScriptName`= '' WHERE `entry`= @CHICKEN;
+
+DELETE FROM `gossip_menu` WHERE `entry` IN (231,232) AND `text_id` IN (720,738);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(231, 720),
+(232, 738);
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id`= 231 AND `OptionBroadcastTextID`= 2707;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(231, 0, 0, "Tell me the phrase to Tirth's lockbox.", 2707, 1, 1, 232, 0, 0, 0, '', 0);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@CHICKEN,@HUMAN) AND `source_type`= 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`comment`) VALUES
+(@CHICKEN,0,0,1,22,0,100,0, 22,0,0,0,11, 9192, 2,0,0,0,0,1,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 22 - Cast "Plucky" Resumes Human Form'),
+(@CHICKEN,0,1,2,61,0,100,0, 0,0,0,0, 3, @HUMAN,6194,0,0,0,0,1,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 22 - Morph To Creature "Plucky" Johnson\'s Human Form'),
+(@CHICKEN,0,2,3,61,0,100,0, 0,0,0,0, 5, 3, 0,0,0,0,0,1,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 22 - Play Emote 3'),
+(@CHICKEN,0,3,4,61,0,100,0, 0,0,0,0,11, 9220, 0,0,0,0,0,1,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 22 - Cast "Plucky" Resumes Chicken Form'),
+(@CHICKEN,0,4,0,61,0,100,0, 0,0,0,0, 3,@CHICKEN,5369,0,0,0,0,1,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 22 - Morph To Creature "Plucky" Johnson'),
+(@CHICKEN,0,5,6,22,0,100,0, 7,0,0,0,11, 9192, 2,0,0,0,0,1,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 7 - Cast "Plucky" Resumes Human Form'),
+(@CHICKEN,0,6,7,61,0,100,0, 0,0,0,0, 3, @HUMAN,6194,0,0,0,0,1,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 7 - Morph To Creature "Plucky" Johnson\'s Human Form'),
+(@CHICKEN,0,7,8,61,0,100,0, 0,0,0,0,82, 1, 0,0,0,0,0,1,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 7 - Add Npc Flags Gossip'),
+(@CHICKEN,0,8,0,61,0,100,0, 0,0,0,0,69, 0, 0,0,0,0,0,7,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 7 - Move To Invoker'),
+(@HUMAN, 0,0,1,62,0,100,0,231,0,0,0,72, 0, 0,0,0,0,0,7,0,0,0,0,0,0,'"Plucky" Johnson\'s Human Form - On Gossip Option 0 Selected - Close Gossip'),
+(@HUMAN, 0,1,0,61,0,100,0, 0,0,0,0,15, 1950, 0,0,0,0,0,7,0,0,0,0,0,0,'"Plucky" Johnson\'s Human Form - On Gossip Option 0 Selected - Credit Quest 1950');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup`= 231;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,231,0, 0,0,9,0,1950,0,0,0,0,0,'', 'Show gossip menu option 231 only if Quest 1950 is taken (active)');
diff --git a/sql/updates/world/3.3.5/2016_06_12_08_world.sql b/sql/updates/world/3.3.5/2016_06_12_08_world.sql
new file mode 100644
index 00000000000..c39e59c7ec8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_12_08_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `quest_template` SET `AllowableRaces`=512 WHERE `ID` IN (8325, 9393, 8328, 9676, 8564, 9392, 8563, 8326, 8327, 8330, 8345, 8336, 8334, 8335, 8338, 8347, 9428, 9189);
+UPDATE `quest_template_addon` SET `PrevQuestID`=0 WHERE `ID`=9704;
diff --git a/sql/updates/world/3.3.5/2016_06_12_09_world.sql b/sql/updates/world/3.3.5/2016_06_12_09_world.sql
new file mode 100644
index 00000000000..19772c101ab
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_12_09_world.sql
@@ -0,0 +1,35 @@
+--
+SET @GUID := -65109;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=18211;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@GUID,0,0,0,6,0,100,0,0,0,0,0,45,0,1,0,0,0,0,9,18211,0,10,0,0,0,0,"Murkblood Brute - On Just Died - Set Data 0 1"),
+(@GUID,0,1,0,38,0,100,0,0,1,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Murkblood Brute - On Data Set 0 1 - Set Event Phase 1"),
+(@GUID,0,2,0,6,1,100,0,0,0,0,0,82,2,0,0,0,0,0,9,18210,0,10,0,0,0,0,"Murkblood Brute - On Just Died - Add Npc Flag Questgiver (Phase 1)"),
+(@GUID,0,3,0,1,0,100,0,0,0,500,1000,81,0,0,0,0,0,0,9,18210,0,10,0,0,0,0,"Murkblood Brute - On Respawn - Remove Npc Flag Questgiver");
+
+SET @GUID := -65110;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@GUID,0,0,0,6,0,100,0,0,0,0,0,45,0,1,0,0,0,0,9,18211,0,10,0,0,0,0,"Murkblood Brute - On Just Died - Set Data 0 1"),
+(@GUID,0,1,0,38,0,100,0,0,1,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Murkblood Brute - On Data Set 0 1 - Set Event Phase 1"),
+(@GUID,0,2,0,6,1,100,0,0,0,0,0,82,2,0,0,0,0,0,9,18210,0,10,0,0,0,0,"Murkblood Brute - On Just Died - Add Npc Flag Questgiver (Phase 1)"),
+(@GUID,0,3,0,1,0,100,0,0,0,500,1000,81,0,0,0,0,0,0,9,18210,0,10,0,0,0,0,"Murkblood Brute - On Respawn - Remove Npc Flag Questgiver");
+
+
+SET @GUID := -28663;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=18203;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@GUID,0,0,0,6,0,100,0,0,0,0,0,45,0,1,0,0,0,0,9,18203,0,10,0,0,0,0,"Murkblood Raider - On Just Died - Set Data 0 1"),
+(@GUID,0,1,0,38,0,100,0,0,1,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Murkblood Raider - On Data Set 0 1 - Set Event Phase 1"),
+(@GUID,0,2,0,6,1,100,0,0,0,0,0,82,2,0,0,0,0,0,9,18209,0,10,0,0,0,0,"Murkblood Raider - On Just Died - Add Npc Flag Questgiver (Phase 1)"),
+(@GUID,0,3,0,1,0,100,0,0,0,500,1000,81,0,0,0,0,0,0,9,18209,0,10,0,0,0,0,"Murkblood Raider - On Respawn - Remove Npc Flag Questgiver");
+
+SET @GUID := -28664;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@GUID,0,0,0,6,0,100,0,0,0,0,0,45,0,1,0,0,0,0,9,18203,0,10,0,0,0,0,"Murkblood Raider - On Just Died - Set Data 0 1"),
+(@GUID,0,1,0,38,0,100,0,0,1,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Murkblood Raider - On Data Set 0 1 - Set Event Phase 1"),
+(@GUID,0,2,0,6,1,100,0,0,0,0,0,82,2,0,0,0,0,0,9,18209,0,10,0,0,0,0,"Murkblood Raider - On Just Died - Add Npc Flag Questgiver (Phase 1)"),
+(@GUID,0,3,0,1,0,100,0,0,0,500,1000,81,0,0,0,0,0,0,9,18209,0,10,0,0,0,0,"Murkblood Raider - On Respawn - Remove Npc Flag Questgiver");
diff --git a/sql/updates/world/3.3.5/2016_06_13_00_world.sql b/sql/updates/world/3.3.5/2016_06_13_00_world.sql
new file mode 100644
index 00000000000..287fb53747e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_13_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid`= 5710 AND `source_type`= 0 AND `id`= 0 AND `link`= 1;
diff --git a/sql/updates/world/3.3.5/2016_06_13_01_world.sql b/sql/updates/world/3.3.5/2016_06_13_01_world.sql
new file mode 100644
index 00000000000..85d48c5a742
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_13_01_world.sql
@@ -0,0 +1,3 @@
+--
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 19512;
+INSERT INTO `spell_linked_spell` VALUES (19512, -19502, 1, 'Apply Salve - Sickly Critter Aura');
diff --git a/sql/updates/world/3.3.5/2016_06_13_02_world_335.sql b/sql/updates/world/3.3.5/2016_06_13_02_world_335.sql
new file mode 100644
index 00000000000..ff2313c700b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_13_02_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `spell_proc_event` SET `Cooldown`=15 WHERE `entry`=-57470;
diff --git a/sql/updates/world/3.3.5/2016_06_13_03_world_335.sql b/sql/updates/world/3.3.5/2016_06_13_03_world_335.sql
new file mode 100644
index 00000000000..c4d80e13405
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_13_03_world_335.sql
@@ -0,0 +1,4 @@
+--
+UPDATE `gameobject_loot_template` SET `Chance`=50, `MaxCount`=6 WHERE `Item`=2835 AND `Entry` IN (1502, 1735, 2626, 18092);
+UPDATE `gameobject_loot_template` SET `Chance`=50, `MaxCount`=8 WHERE `Item`=2836 AND `Entry` IN (1503, 1736, 2627, 18093);
+UPDATE `gameobject_loot_template` SET `MaxCount`=4 WHERE `Item` IN (2770, 2771) AND `Entry` IN (1502, 1503, 1735, 1736, 2626, 2627, 18092, 18093);
diff --git a/sql/updates/world/3.3.5/2016_06_13_04_world.sql b/sql/updates/world/3.3.5/2016_06_13_04_world.sql
new file mode 100644
index 00000000000..d2ad9c21b39
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_13_04_world.sql
@@ -0,0 +1,2 @@
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=28092;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=28092 AND `source_type`=0;
diff --git a/sql/updates/world/3.3.5/2016_06_13_05_world.sql b/sql/updates/world/3.3.5/2016_06_13_05_world.sql
new file mode 100644
index 00000000000..b19f167a81a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_13_05_world.sql
@@ -0,0 +1,55 @@
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=34320;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=34320 AND `source_type`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(34320, 0, 0, 0, 8, 0, 100, 0, 65258, 0, 2000, 2000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Venomhide Hatchling - On Spellhit (Feed Venomhide Hatchling) - Say'),
+(34320, 0, 1, 0, 8, 0, 100, 0, 65265, 0, 2000, 2000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Venomhide Hatchling - On Spellhit (Feed Venomhide Hatchling) - Say'),
+(34320, 0, 2, 0, 8, 0, 100, 0, 65200, 0, 2000, 2000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Venomhide Hatchling - On Spellhit (Feed Venomhide Hatchling) - Say');
+
+
+DELETE FROM `creature_text` WHERE `entry`=34320;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(34320, 0, 0, 'The %s''s strong jaws tear into the food.', 16, 0, 100, 0, 0, 0, 34521, 0, 'Venomhide Hatchling'),
+(34320, 0, 1, 'The %s quickly finishes the food and glances around for more.', 16, 0, 100, 0, 0, 0, 34522, 0, 'Venomhide Hatchling'),
+(34320, 0, 2, 'The %s devours the food.', 16, 0, 100, 0, 0, 0, 34519, 0, 'Venomhide Hatchling'),
+(34320, 0, 3, 'The %s catches the food in its mouth and swallows it in one gulp.', 16, 0, 100, 0, 0, 0, 34520, 0, 'Venomhide Hatchling');
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=20747;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=20747 AND `source_type`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(20747, 0, 0, 1, 2, 0, 100, 1, 0, 20, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Silkwing Larva - On Less Than 20% HP - Say Line 0 (No repeat)'),
+(20747, 0, 1, 0,61, 0, 100, 1, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Silkwing Larva - On Less Than 20% HP - Set Phase 2'),
+(20747, 0, 2, 3, 0, 2, 100, 1, 4000, 4000, 0, 0, 11, 36948, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Silkwing Larva - IC (Phase 2) - Cast Silkwing (No repeat)'),
+(20747, 0, 3, 0,61, 0, 100, 1, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Silkwing Larva - IC (Phase 2) - Die');
+
+DELETE FROM `creature_text` WHERE `entry`=20747;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(20747, 0, 0, '%s begins to metamorphose...', 16, 0, 100, 0, 0, 0, 18589, 0, 'Silkwing Larva');
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=26452;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=26452 AND `source_type`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(26452, 0, 0, 1, 8, 0, 100, 0, 47170, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Leviroth - On Spellhit (Impale Leviroth) - Remove Unit flags (Immune to PC)'),
+(26452, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 46767, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Leviroth - On Spellhit (Impale Leviroth) - Cast Cosmetic - Underwater Blood'),
+(26452, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Leviroth - On Spellhit (Impale Leviroth) - Start Attack');
+
+UPDATE `smart_scripts` SET `target_type`=1 WHERE `entryorguid`=8400 AND `source_type`=0 AND `id`=0 AND `link`=1;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=3127100 AND `source_type`=9 AND `id`=1;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=3127700 AND `source_type`=9 AND `id`=5;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=1468800 AND `source_type`=9 AND `id`=3;
+
+UPDATE `smart_scripts` SET `event_param1`=10000, `event_param2`=10000 WHERE `entryorguid`=31271 AND `source_type`=0 AND `id`=4 AND `link`=0;
+UPDATE `smart_scripts` SET `event_param1`=1000, `event_param2`=1000 WHERE `entryorguid`=3127700 AND `source_type`=9 AND `id`=3 AND `link`=0;
+UPDATE `smart_scripts` SET `event_param1`=7500, `event_param2`=7500 WHERE `entryorguid`=1468800 AND `source_type`=9 AND `id`=2 AND `link`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(3127100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Carnage - OOC script 1 - Remove Unit Flags'),
+(3127700, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Thane Banahogg - OOC script 1 - Remove Unit Flags'),
+(1468800, 9, 3, 0, 1, 0, 100, 0, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Sandoval - OOC script 1 - Remove Unit Flags');
+
diff --git a/sql/updates/world/3.3.5/2016_06_13_06_world.sql b/sql/updates/world/3.3.5/2016_06_13_06_world.sql
new file mode 100644
index 00000000000..4ca697f1266
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_13_06_world.sql
@@ -0,0 +1,5 @@
+DELETE FROM `gameobject_loot_template` WHERE `Entry` in(2515,2514) AND `Item`=2452;
+
+INSERT INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
+(2515, 2452, 0, 40, 0, 1, 0, 1, 2, NULL),
+(2514, 2452, 0, 20, 0, 1, 0, 1, 2, NULL);
diff --git a/sql/updates/world/3.3.5/2016_06_14_00_world.sql b/sql/updates/world/3.3.5/2016_06_14_00_world.sql
new file mode 100644
index 00000000000..536298da2f9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_14_00_world.sql
@@ -0,0 +1,78 @@
+-- Add missing world.command from auth.rbac_permissions
+DELETE FROM `command` WHERE `permission` IN (200,201,221,232,256,257,264,273,277,301,305,306,307,308,309,310,311,312,315,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,341,342,345,348,349,358,395,397,418,419,430,451,463,464,483,580,594,601,632,657,671,729,731,747,749,750,754,755,756,757,761,765,767,771,778);
+INSERT INTO `command` (`name`, `permission`, `help`) VALUES
+('rbac', 200, 'Syntax: bf $subcommand\n Type .rbac to see a list of possible subcommands\n or .help bf $subcommand to see info on the subcommand.'),
+('rbac account', 201, 'Syntax: rbac account $subcommand\n Type .rbac account to see a list of possible subcommands\n or .help rbac account $subcommand to see info on the subcommand.'),
+('account lock', 221, 'Syntax: .account lock [on|off]\n\n Allow login from account only from current used IP or remove this requirement.'),
+('arena', 232, 'Syntax: arena $subcommand\n Type .arena to see a list of possible subcommands\n or .help arena $subcommand to see info on the subcommand.'),
+('unban playeraccount', 256, 'Syntax: '),
+('bf', 257, 'Syntax: bf $subcommand\n Type .bf to see a list of possible subcommands\n or .help bf $subcommand to see info on the subcommand.'),
+('account set sec', 264, 'Syntax: '),
+('character', 273, 'Syntax: character $subcommand\n Type .character to see a list of possible subcommands\n or .help character $subcommand to see info on the subcommand.'),
+('character deleted', 277, 'Syntax: character deleted $subcommand\n Type .character deleted to see a list of possible subcommands\n or .help character deleted $subcommand to see info on the subcommand.'),
+('debug anim', 301, 'Syntax: '),
+('debug entervehicle', 305, 'Syntax: '),
+('debug getitemstate', 306, 'Syntax: '),
+('debug getitemvalue', 307, 'Syntax: '),
+('debug getvalue', 308, 'Syntax: '),
+('debug hostil', 309, 'Syntax: '),
+('debug itemexpire', 310, 'Syntax: '),
+('debug lootrecipient', 311, 'Syntax: '),
+('debug los', 312, 'Syntax: '),
+('debug play', 315, 'Syntax: '),
+('debug send', 319, 'Syntax: '),
+('debug send buyerror', 320, 'Syntax: '),
+('debug send channelnotify', 321, 'Syntax: '),
+('debug send chatmessage', 322, 'Syntax: '),
+('debug send equiperror', 323, 'Syntax: '),
+('debug send largepacket', 324, 'Syntax: '),
+('debug send opcode', 325, 'Syntax: '),
+('debug send qinvalidmsg', 326, 'Syntax: '),
+('debug send qpartymsg', 327, 'Syntax: '),
+('debug send sellerror', 328, 'Syntax: '),
+('debug send setphaseshift', 329, 'Syntax: '),
+('debug send spellfail', 330, 'Syntax: '),
+('debug setaurastate', 331, 'Syntax: '),
+('debug setbit', 332, 'Syntax: '),
+('debug setitemvalue', 333, 'Syntax: '),
+('debug setvalue', 334, 'Syntax: '),
+('debug setvid', 335, 'Syntax: '),
+('debug spawnvehicle', 336, 'Syntax: '),
+('debug threat', 337, 'Syntax: '),
+('debug update', 338, 'Syntax: '),
+('debug uws', 339, 'Syntax: '),
+('deserter', 341, 'Syntax: deserter $subcommand\n Type .deserter to see a list of possible subcommands\n or .help deserter $subcommand to see info on the subcommand.'),
+('deserter bg', 342, 'Syntax: '),
+('deserter instance', 345, 'Syntax: '),
+('disable', 348, 'Syntax: disable $subcommand\n Type .disable to see a list of possible subcommands\n or .help disable $subcommand to see info on the subcommand.'),
+('disable add', 349, 'Syntax: '),
+('disable remove', 358, 'Syntax: '),
+('gobject set', 395, 'Syntax: '),
+('gobject set state', 397, 'Syntax: '),
+('learn all', 418, 'Syntax: '),
+('learn all my', 419, 'Syntax: '),
+('lfg', 430, 'Syntax: lfg $subcommand\n Type .lfg to see a list of possible subcommands\n or .help lfg $subcommand to see info on the subcommand.'),
+('lookup player', 451, 'Syntax: '),
+('channel', 463, 'Syntax: channel $subcommand\n Type .channel to see a list of possible subcommands\n or .help channel $subcommand to see info on the subcommand.'),
+('channel set', 464, 'Syntax: '),
+('send', 483, 'Syntax: send $subcommand\n Type .send to see a list of possible subcommands\n or .help send $subcommand to see info on the subcommand.'),
+('npc set', 580, 'Syntax: '),
+('npc near', 594, 'Syntax: '),
+('npc tame', 601, 'Syntax: '),
+('mutehistory', 632, 'Syntax: '),
+('reload locales_achievement_reward', 657, 'Syntax: '),
+('reload npc_spellclick_spells', 671, 'Syntax: '),
+('server set', 729, 'Syntax: '),
+('server set difftime', 731, 'Syntax: '),
+('ticket complete', 747, 'Syntax: '),
+('ticket escalate', 749, 'Syntax: '),
+('ticket escalatedlist', 750, 'Syntax: '),
+('ticket response', 754, 'Syntax: '),
+('ticket response append', 755, 'Syntax: '),
+('ticket response appendln', 756, 'Syntax: '),
+('ticket togglesystem', 757, 'Syntax: '),
+('titles', 761, 'Syntax: '),
+('titles set', 765, 'Syntax: '),
+('wp', 767, 'Syntax: wp $subcommand\n Type .wp to see a list of possible subcommands\n or .help wp $subcommand to see info on the subcommand.'),
+('wp modify', 771, 'Syntax: '),
+('ahbot', 778, 'Syntax: ahbot $subcommand\n Type .ahbot to see a list of possible subcommands\n or .help ahbot $subcommand to see info on the subcommand.');
diff --git a/sql/updates/world/3.3.5/2016_06_14_01_world.sql b/sql/updates/world/3.3.5/2016_06_14_01_world.sql
new file mode 100644
index 00000000000..63bc2f9d00b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_14_01_world.sql
@@ -0,0 +1,104 @@
+--
+UPDATE `creature_template` SET `mechanic_immune_mask`= mechanic_immune_mask
+|1 -- CHARM
+|2 -- DISORIENTED
+|4 -- DISARM
+|8 -- DISTRACT
+|16 -- FEAR
+|32 -- GRIP
+|64 -- ROOT
+|256 -- SILENCE
+|512 -- SLEEP
+|1024 -- SNARE
+|2048 -- STUN
+|4096 -- FREEZE
+|8192 -- KNOCKOUT
+|65536 -- POLYMORPH
+|131072 -- BANISH
+|524288 -- SHACKLE
+|4194304 -- TURN
+|8388608 -- HORROR
+|67108864 -- DAZE
+|536870912 -- SAPPED
+WHERE `entry` IN
+-- Utgarde Keep
+(23953,30748, -- Prince Keleseth
+27390,31680, -- Skarvald the Constructor
+27389,31657, -- Dalronn the Controller
+23954,31673, -- Ingvar the Plunderer
+
+-- The Nexus
+26731,30510, -- Grand Magus Telestra
+26763,30529, -- Anomalus
+26794,30532, -- Ormorok the Tree-Shaper
+26723,30540, -- Keristrasza
+26796,30398, -- Commander Stoutbeard
+26798,30397, -- Commander Kolurg
+
+-- Azjol-Nerub
+28684,31612, -- Krik'thir the Gatewatcher
+28921,31611, -- Hadronox
+29120,31610, -- Anub'arak
+
+-- Ahn'kahet: The Old Kingdom
+29309,31456, -- Elder Nadox
+29308,31469, -- Prince Taldaram
+29310,31465, -- Jedoga Shadowseeker
+29311,31464, -- Herald Volazj
+30258,31463, -- Amanitar
+
+-- Drak'Tharon Keep
+26630,31362, -- Trollgore
+26631,31350, -- Novos the Summoner
+27483,31349, -- King Dred
+26632,31360, -- The Prophet Tharon'ja
+
+-- The Violet Hold
+29315,31507, -- Erekem
+29316,31510, -- Moragg
+29313,31508, -- Ichoron
+29266,31511, -- Xevozz
+29312,31509, -- Lavanthor
+29314,31512, -- Zuramat the Obliterator
+31134,31506, -- Cyanigosa
+
+-- Gundrak
+29304,31370, -- Slad'ran
+29307,31365, -- Drakkari Colossus
+29573,31367, -- Drakkari Elemental
+29305,30530, -- Moorabi
+29306,31368, -- Gal'darah
+29932, -- Eck the Ferocious
+
+-- Halls of Stone
+27975,31384, -- Maiden of Grief
+27977,31381, -- Krystallus
+27978,31386, -- Sjonnir The Ironshaper
+
+-- The Culling of Stratholme
+26529,31211, -- Meathook
+26530,31212, -- Salramm the Fleshcrafter
+26532,31215, -- Chrono-Lord Epoch
+26533,31217, -- Mal'Ganis
+32273,32313, -- Infinite Corruptor
+
+-- Halls of Lightning
+28586,31533, -- General Bjarngrim
+28587,31536, -- Volkhan
+28546,31537, -- Ionar
+28923,31538, -- Loken
+
+-- The Oculus
+27654,31558, -- Drakos the Interrogator
+27447,31559, -- Varos Cloudstrider
+27655,31560, -- Mage-Lord Urom
+27656,31561, -- Ley-Guardian Eregos
+
+-- Utgarde Pinnacle
+26668,30810, -- Svala Sorrowgrave
+26687,30774, -- Gortok Palehoof
+26693,30807, -- Skadi the Ruthless
+26861,30788, -- King Ymiron
+
+-- The Forge of Souls
+36497,36498); -- Bronjahm
diff --git a/sql/updates/world/3.3.5/2016_06_14_02_world.sql b/sql/updates/world/3.3.5/2016_06_14_02_world.sql
new file mode 100644
index 00000000000..eea9c0e6ac1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_14_02_world.sql
@@ -0,0 +1,14 @@
+-- "Plucky" Johnson (Magus Tirth's assistant) in quest 1950 "Get the Scoop":
+UPDATE `creature_template` SET `gossip_menu_id`= 231, `AIName`= 'SmartAI', `ScriptName`= '' WHERE `entry`= 6626;
+UPDATE `creature_template` SET `gossip_menu_id`= 0, `AIName`= '' WHERE `entry`= 6666;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (6626,6666) AND `source_type`= 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(6626,0,0,1,22,0,100,0, 22,0,0,0,11, 9192, 2,0,0,0,0,1,0,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 22 - Cast "Plucky" Resumes Human Form'),
+(6626,0,1,2,61,0,100,0, 0,0,0,0, 5, 3, 0,0,0,0,0,1,0,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 22 - Play Emote 3'),
+(6626,0,2,0,61,0,100,0, 0,0,0,0,11, 9220, 2,0,0,0,0,1,0,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 22 - Cast "Plucky" Resumes Chicken Form'),
+(6626,0,3,4,22,0,100,0, 7,0,0,0,11, 9192, 2,0,0,0,0,1,0,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 7 - Cast "Plucky" Resumes Human Form'),
+(6626,0,4,5,61,0,100,0, 0,0,0,0,82, 1, 0,0,0,0,0,1,0,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 7 - Add npcflags Gossip'),
+(6626,0,5,0,61,0,100,0, 0,0,0,0,69, 0, 0,0,0,0,0,7,0,0,0,0,0,0,0,'"Plucky" Johnson - Received Emote 7 - Move To Invoker'),
+(6626,0,6,7,62,0,100,0,231,0,0,0,72, 0, 0,0,0,0,0,7,0,0,0,0,0,0,0,'"Plucky" Johnson\'s Human Form - On Gossip Option 0 Selected - Close Gossip'),
+(6626,0,7,0,61,0,100,0, 0,0,0,0,15, 1950, 0,0,0,0,0,7,0,0,0,0,0,0,0,'"Plucky" Johnson\'s Human Form - On Gossip Option 0 Selected - Credit Quest 1950');
diff --git a/sql/updates/world/3.3.5/2016_06_14_03_world.sql b/sql/updates/world/3.3.5/2016_06_14_03_world.sql
new file mode 100644
index 00000000000..922182468dd
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_14_03_world.sql
@@ -0,0 +1,385 @@
+SET @CGUID:= 145427; -- 69 GUIDs required
+SET @OGUID:= 73587; -- 13 GUIDs required
+SET @OG_PORTAL:= 193206;
+SET @OG_TELEPORTSPELL:= 59064;
+SET @UCTELEPORTSPELL:= 59439;
+SET @HORDE_BUILDING1:= 193219;
+SET @HORDE_BUILDING2:= 193217;
+SET @HORDE_BUILDING3:= 193218;
+SET @HORDE_BUILDING4:= 193216;
+SET @HORDE_BUILDING5:= 193215;
+SET @REFUGEE1:= 31437;
+SET @REFUGEE2:= 31467;
+SET @MOUNTEDORC:= 31564; -- mounted on frostwolf
+SET @MOUNTEDORC2:= 31563; -- mounted on brown wolf
+SET @KORKRONGUARDS:= 31417; -- guards within thrall building
+SET @NPC_GRYSHKA:= 31433;
+SET @NPC_OVERLORD_RUNTHAK:= 31431;
+SET @NPC_OLVIA:= 31425;
+SET @NPC_SANA:= 31429;
+SET @NPC_FELIKA:= 31427;
+SET @NPC_THUNG:= 31430;
+SET @NPC_KAJA:= 31423;
+SET @NPC_GAMON:= 31424;
+SET @NPC_COMMONER:= 31434;
+SET @NPC_THRALL:= 31412;
+SET @PORTAL_STORMWIND:= 31640;
+SET @NPC_SYLVANAS:= 31419;
+SET @NPC_JAINA:= 31418;
+SET @UC_THRALL:= 31650;
+SET @UC_SYLVANAS:= 31651;
+SET @VOLJIN:= 31649;
+SET @UCPORTAL:= 193425; -- orgrimmar
+
+UPDATE `creature` SET `PhaseMask` = 65 WHERE `GUID` IN (6565, 10351, 3390, 3387, 10450, 8526, 6564, 8522, 6560, 11792, 7395, 6557, 6548, 3373, 3372, 6550, 6555, 3371, 6552, 6556, 6551, 3378, 7396, 3380, 3376, 3379, 3375, 6553);
+UPDATE `creature_template` SET `unit_flags` = 788 WHERE `entry` = @NPC_GAMON;
+UPDATE `creature_template` SET `ScriptName` = 'npc_overlord_runthak_orgrimmar' WHERE `entry` = @NPC_OVERLORD_RUNTHAK;
+UPDATE `creature_template` SET `ScriptName` = 'npc_thrall_herald_of_war' WHERE `entry` = @NPC_THRALL;
+UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = @NPC_SYLVANAS;
+UPDATE `creature_template` SET `unit_flags` = 768 WHERE `entry` = @NPC_JAINA;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC_SYLVANAS;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@NPC_SYLVANAS, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 90, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sylvanas - on reset - set byte kneel'),
+(@NPC_SYLVANAS, 0, 1, 0, 34, 0, 100, 0, 8, 2, 0, 0, 90, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sylvanas - on movement inform - set byte kneel');
+
+DELETE FROM `areatrigger_scripts` WHERE `entry` = 5279;
+INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
+(5279, "areatrigger_orgrimmar_herald_of_war");
+
+DELETE FROM `creature_text` WHERE `entry` IN (@NPC_GRYSHKA, @NPC_OLVIA, @NPC_FELIKA, @NPC_THUNG, @NPC_SANA, @NPC_KAJA, @NPC_OVERLORD_RUNTHAK, @NPC_THRALL, @NPC_SYLVANAS, @NPC_JAINA);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(@NPC_GRYSHKA, 0, 0, "When can we reopen our shops? I'm losing gold here!", 12, 0, 100, 0, 0, 0, 32237, 0, "inkeeper gryshka - herald of war"),
+(@NPC_GRYSHKA, 1, 0, "This is an outrage!", 12, 0, 100, 0, 0, 0, 32238, 0, "inkeeper gryshka - herald of war"),
+
+(@NPC_OLVIA, 0, 0, "Where is the Warchief?", 12, 0, 100, 0, 0, 0, 32236, 0, "olvia - herald of war"),
+(@NPC_OLVIA, 1, 0, "What are all these Forsaken doing here?", 12, 0, 100, 0, 0, 0, 32233, 0, "olvia - herald of war"),
+
+(@NPC_FELIKA, 0, 0, "What is going on?", 12, 0, 100, 0, 0, 0, 45914, 0, "felika - herald of war"),
+(@NPC_FELIKA, 1, 0, "This is an outrage!", 12, 0, 100, 0, 0, 0, 46620, 0, "felika - herald of war"),
+
+(@NPC_THUNG, 0, 0, "What is going on?", 12, 0, 100, 0, 0, 0, 32232, 0, "auctioneer thathung - herald of war"),
+
+(@NPC_KAJA, 0, 0, "Why is Thrall allowing this to happen to our city?", 12, 0, 100, 0, 0, 0, 32239, 0, "Kaja - herald of war"),
+
+(@NPC_SANA, 0, 0, "We demand answers!", 12, 0, 100, 0, 0, 0, 32235, 0, "Sana - herald of war"),
+
+(@NPC_OVERLORD_RUNTHAK, 0, 0, "SILENCE!", 12, 0, 100, 0, 0, 0, 32240, 0, "Overlord runthak - herald of war"),
+(@NPC_OVERLORD_RUNTHAK, 1, 0, "We are on the brink of all out war with the Alliance!", 12, 0, 100, 0, 0, 0, 32241, 0, "Overlord runthak - herald of war"),
+(@NPC_OVERLORD_RUNTHAK, 2, 0, "Tragic events have unfolded in Northrend. The Warchief is doing all that he can to keep us safe.", 12, 0, 100, 0, 0, 0, 32242, 0, "Overlord runthak - herald of war"),
+(@NPC_OVERLORD_RUNTHAK, 3, 0, "All services and shops are to remain closed until further notice! That is all!", 12, 0, 100, 0, 0, 0, 32243, 0, "Overlord runthak - herald of war"),
+
+(@NPC_THRALL, 0, 0, "Kor'kron, stand down!", 12, 0, 100, 0, 0, 16222, 32286, 0, "Thrall - herald of war"),
+(@NPC_THRALL, 1, 0, "Jaina...", 12, 0, 100, 0, 0, 16223, 32287, 0, "Thrall - herald of war"),
+(@NPC_THRALL, 2, 0, "Jaina, what happened at the Wrathgate. It was a betrayal from within...", 12, 0, 100, 0, 0, 16224, 32289, 0, "Thrall - herald of war"),
+(@NPC_THRALL, 3, 0, "The Horde has lost the Undercity.", 12, 0, 100, 1, 0, 16225, 32292, 0, "Thrall - herald of war"),
+(@NPC_THRALL, 4, 0, "We now prepare to lay siege to the city and bring the perpetrators of this unforgivable crime to justice.", 12, 0, 100, 378, 0, 16226, 32293, 0, "Thrall - herald of war"),
+(@NPC_THRALL, 5, 0, "If we are forced into a conflict, the Lich King will destroy our divided forces in Northrend.", 12, 0, 100, 378, 0, 16227, 32294, 0, "Thrall - herald of war"),
+(@NPC_THRALL, 6, 0, "We will make this right, Jaina. Tell your king all that you have learned here.", 12, 0, 100, 378, 0, 16228, 32295, 0, "Thrall - herald of war"),
+(@NPC_THRALL, 7, 0, "Kor'kron, prepare transport to the Undercity.", 12, 0, 100, 378, 0, 16229, 32300, 0, "Thrall - herald of war"),
+
+(@NPC_SYLVANAS, 0, 0, "Lady Proudmoore, the Warchief speaks the truth. This subterfuge was set in motion by Varimathras and Grand Apothecary Putress. It was not the Horde's doing.", 12, 0, 100, 0, 0, 16315, 32290, 0, "Sylvanas - herald of war"),
+(@NPC_SYLVANAS, 1, 0, "As the combined Horde and Alliance forces began their assault upon the Wrath Gate, an uprising broke out in the Undercity. Varimathras and hordes of his demonic brethren attacked. Hundreds of my people were slain in the coup. I barely managed to escape with my life.", 12, 0, 100, 0, 0, 16316, 32291, 0, "Sylvanas - herald of war"),
+
+(@NPC_JAINA, 0, 0, "Thrall, what has happened? The King is preparing for war...", 12, 0, 100, 0, 0, 16129, 32288, 0, "Jaina - herald of war"),
+(@NPC_JAINA, 1, 0, "I will deliver this information to King Wrynn, Thrall, but...", 12, 0, 100, 378, 0, 16130, 32296, 0, "Jaina - herald of war"),
+(@NPC_JAINA, 2, 0, "Bolvar was like a brother to him. In the King's absence, Bolvar kept the Alliance united. He found strength for our people in our darkest hours. He watched over Anduin, raising him as his own.", 12, 0, 100, 378, 0, 16131, 32297, 0, "Jaina - herald of war"),
+(@NPC_JAINA, 3, 0, "I fear that the rage will consume him, Thrall. I remain hopeful that reason will prevail, but we must prepare for the worst... for war.", 12, 0, 100, 378, 0, 16132, 32298, 0, "Jaina - herald of war"),
+(@NPC_JAINA, 4, 0, "Farewell, Warchief. I pray that the next time we meet it will be as allies.", 12, 0, 100, 0, 0, 16133, 32299, 0, "Jaina - herald of war");
+
+DELETE FROM `gameobject` WHERE `id` IN (@OG_PORTAL, @HORDE_BUILDING5, @HORDE_BUILDING4, @HORDE_BUILDING2, @HORDE_BUILDING3, @UCPORTAL);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
+(@OGUID, @OG_PORTAL, 571, 3537, 4129, 1, 1, 2830.01, 6179.37, 84.66, 4.16, 0, 0, 0.715875, -0.698228, 120, 100, 1, 0),
+(@OGUID + 1, @HORDE_BUILDING5, 1, 14, 14, 1, 64, 1339.00, -4413.98, 27.25, 2.29, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 2, @HORDE_BUILDING5, 1, 1637, 1637, 1, 64, 1508.90, -4429.49, 21.95, 6.13, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 3, @HORDE_BUILDING4, 1, 14, 14, 1, 64, 1290.05, -4417.47, 26.61, 0.72, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 4, @HORDE_BUILDING4, 1, 14, 14, 1, 64, 1346.67, -4343.90, 27.23, 4.48, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 5, @HORDE_BUILDING2, 1, 14, 14, 1, 64, 1376.69, -4355.44, 26.24, 1.15, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 6, @HORDE_BUILDING2, 1, 1637, 1637, 1, 64, 1437.96, -4365.91, 25.46, 0.41, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 7, @HORDE_BUILDING3, 1, 1637, 1637, 1, 64, 1425.65, -4356.49, 25.46, 4.84, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 8, @HORDE_BUILDING3, 1, 1637, 1637, 1, 64, 1441.50, -4432.17, 25.46, 0.05, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 9, @HORDE_BUILDING2, 1, 1637, 1637, 1, 64, 1429.12, -4423.08, 25.46, 3.28, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 10, @HORDE_BUILDING4, 1, 1637, 1637, 1, 64, 1501.42, -4392.46, 22.69, 4.83, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 11, @UCPORTAL, 1, 1637, 1637, 1, 64, 1912.070923, -4151.778809, 40.637005, 1.635784, 0, 0, 0, 0, 600, 0, 1, 0),
+(@OGUID + 12, @UCPORTAL, 1, 1637, 1637, 1, 64, 1931.545288, -4149.240723, 40.600616, 1.804645, 0, 0, 0, 0, 600, 0, 1, 0);
+
+DELETE FROM `creature` WHERE `GUID` BETWEEN @CGUID AND @CGUID + 68;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@CGUID, @REFUGEE1, 1, 14, 14, 1, 64, 0, 0, 1313.62, -4504.06, 22.9198, 1.60753, 300, 0, 0, 1, 0, 2, 0, 0, 0, 0),
+(@CGUID + 1, @REFUGEE1, 1, 14, 14, 1, 64, 0, 0, 1317.69, -4499.57, 25.0943, 1.60753, 300, 0, 0, 1, 0, 2, 0, 0, 0, 0),
+(@CGUID + 2, @REFUGEE2, 1, 14, 14, 1, 64, 0, 0, 1310.69, -4504.17, 22.2043, 1.60753, 300, 0, 0, 1, 0, 2, 0, 0, 0, 0),
+(@CGUID + 3, @REFUGEE2, 1, 14, 14, 1, 64, 0, 0, 1311.13, -4518.5, 22.2047, 1.55255, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+
+(@CGUID + 4, @REFUGEE1, 1, 14, 14, 1, 64, 0, 0, 1345.48, -4419.18, 27.4299, 2.28297, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 5, @REFUGEE1, 1, 14, 14, 1, 64, 0, 0, 1343.1, -4411.76, 27.6054, 2.31831, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 6, @REFUGEE2, 1, 14, 14, 1, 64, 0, 0, 1338.59, -4416.07, 27.143, 2.25548, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+
+(@CGUID + 7, @REFUGEE1, 1, 14, 14, 1, 64, 0, 0, 1348.62, -4339.38, 27.2402, 5.19288, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 8, @REFUGEE2, 1, 14, 14, 1, 64, 0, 0, 1344.26, -4341.66, 27.2953, 5.19288, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+
+(@CGUID + 9, @REFUGEE1, 1, 14, 14, 1, 64, 0, 0, 1373.44, -4354.1, 26.3845, 4.51351, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 10, @REFUGEE2, 1, 14, 14, 1, 64, 0, 0, 1377.47, -4355.02, 26.2234, 4.48603, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0),
+
+(@CGUID + 11, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1426.94, -4355.01, 25.4626, 4.82374, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0),
+(@CGUID + 12, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1439.5, -4368.21, 25.4626, 3.35504, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0),
+(@CGUID + 13, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1423.99, -4355.34, 25.4626, 4.82374, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 14, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1438.59, -4363.16, 25.4626, 3.44536, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0),
+
+(@CGUID + 15, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1442.41, -4382.73, 28.0943, 3.24115, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 16, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1418.21, -4354.67, 28.1022, 4.91012, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+
+(@CGUID + 17, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1425.6, -4423.85, 25.4629, 6.16282, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 18, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1428.84, -4420.12, 25.4629, 6.16282, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 19, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1440.43, -4431.69, 25.4629, 1.87456, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 20, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1428.35, -4424.18, 25.4629, 6.16282, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 21, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1425.12, -4421.19, 25.4629, 6.16282, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 22, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1444.34, -4433.12, 25.4629, 1.87456, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+
+(@CGUID + 23, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1506.86, -4436.01, 23.113, 1.97747, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 24, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1503.98, -4392.84, 21.9971, 5.36252, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 25, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1499.08, -4393.03, 23.3294, 5.3154, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 26, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1513.89, -4429.5, 20.4131, 1.76542, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 27, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1508.19, -4430.54, 22.2681, 1.89108, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 28, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1499.22, -4387.96, 23.339, 5.07193, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 29, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1503.9, -4386.66, 22.0753, 5.31148, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 30, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1512.58, -4435.7, 21.1882, 1.85966, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+
+(@CGUID + 31, @REFUGEE1, 1, 14, 14, 1, 64, 0, 0, 1345.22, -4407.99, 27.9504, 1.99711, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sleeping
+(@CGUID + 32, @REFUGEE2, 1, 14, 14, 1, 64, 0, 0, 1336.65, -4409.31, 27.3459, 1.86359, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 33, @REFUGEE1, 1, 14, 14, 1, 64, 0, 0, 1290.52, -4419.55, 26.6016, 1.35857, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 34, @REFUGEE1, 1, 14, 14, 1, 64, 0, 0, 1286.92, -4415.25, 26.5606, 1.23683, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0),
+(@CGUID + 35, @REFUGEE2, 1, 14, 14, 1, 64, 0, 0, 1287.15, -4418.59, 26.5876, 1.29181, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), -- sitting
+(@CGUID + 36, @REFUGEE2, 1, 14, 14, 1, 64, 0, 0, 1294.74, -4416.27, 26.6432, 3.06289, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0),
+
+(@CGUID + 37, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1655.2, -4416.18, 16.7609, 3.19012, 300, 0, 0, 1, 0, 2, 0, 0, 0, 0),
+(@CGUID + 38, @REFUGEE1, 1, 1637, 1637, 1, 64, 0, 0, 1550.75, -4411.13, 9.02373, 3.24117, 300, 0, 0, 1, 0, 2, 0, 0, 0, 0),
+(@CGUID + 39, @REFUGEE2, 1, 1637, 1637, 1, 64, 0, 0, 1588.68, -4440.77, 5.6737, 2.90345, 300, 0, 0, 1, 0, 2, 0, 0, 0, 0),
+(@CGUID + 40, @NPC_THRALL, 1, 1637, 1637, 1, 64, 0, 0, 1913.81, -4127.87, 43.23, 0.147480, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0),
+(@CGUID + 41, @NPC_SYLVANAS, 1, 1637, 1637, 1, 64, 0, 0, 1920.589233, -4130.980469, 43.090080, 1.741838, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0),
+(@CGUID + 42, @KORKRONGUARDS, 1, 1637, 1637, 1, 64, 0, 1, 1944.779541, -4136.510254, 41.157078, 3.683755, 300, 0, 0, 63000, 0, 0, 0, 0, 0, 0),
+(@CGUID + 43, @KORKRONGUARDS, 1, 1637, 1637, 1, 64, 0, 1, 1938.338501, -4215.597168, 42.321674, 3.534525, 300, 0, 0, 63000, 0, 0, 0, 0, 0, 0),
+(@CGUID + 44, @KORKRONGUARDS, 1, 1637, 1637, 1, 64, 0, 1, 1926.85, -4134.75, 40.6305, 4.6753, 300, 0, 0, 63000, 0, 0, 0, 0, 0, 0),
+(@CGUID + 45, @KORKRONGUARDS, 1, 1637, 1637, 1, 64, 0, 1, 1913.69, -4135.14, 40.6359, 4.79468, 300, 0, 0, 63000, 0, 0, 0, 0, 0, 0),
+(@CGUID + 46, @KORKRONGUARDS, 1, 1637, 1637, 1, 64, 0, 1, 1913.99, -4122.2, 43.2624, 4.84964, 300, 0, 0, 63000, 0, 0, 0, 0, 0, 0),
+(@CGUID + 47, @KORKRONGUARDS, 1, 1637, 1637, 1, 64, 0, 1, 1925.71, -4121.88, 43.2014, 4.73577, 300, 0, 0, 63000, 0, 0, 0, 0, 0, 0),
+
+(@CGUID + 48, @MOUNTEDORC, 1, 1637, 1637, 1, 64, 0, 0, 1527.04, -4398.42, 14.4175, 3.54668, 300, 0, 0, 31905, 0, 2, 0, 0, 0, 0),
+(@CGUID + 49, @MOUNTEDORC, 1, 1637, 1637, 1, 64, 0, 0, 1434.51, -4399.44, 25.4631, 1.64601, 300, 0, 0, 31905, 0, 2, 0, 0, 0, 0),
+
+(@CGUID + 50, @MOUNTEDORC2, 1, 14, 14, 1, 64, 0, 1, 1370.59, -4377.64, 26.0629, 3.47206, 300, 0, 0, 42540, 0, 2, 0, 0, 0, 0),
+(@CGUID + 51, @MOUNTEDORC2, 1, 1637, 1637, 1, 64, 0, 1, 1539.24, -4435.88, 12.4312, 1.64208, 300, 0, 0, 42540, 0, 2, 0, 0, 0, 0),
+
+(@CGUID + 52, @NPC_GAMON, 1, 1637, 1637, 1, 64, 0, 0, 1596.91, -4398.47, 7.63585, 0.605362, 300, 0, 0, 247, 0, 0, 0, 0, 0, 0),
+(@CGUID + 53, @NPC_OLVIA, 1, 1637, 1637, 1, 64, 0, 1, 1599.6, -4399.69, 8.52417, 0.687829, 300, 0, 0, 2769, 0, 0, 0, 0, 0, 0),
+(@CGUID + 54, @NPC_KAJA, 1, 1637, 1637, 1, 64, 0, 1, 1598.06, -4400.97, 7.78653, 0.687829, 300, 0, 0, 1003, 0, 0, 0, 0, 0, 0),
+(@CGUID + 55, @NPC_FELIKA, 1, 1637, 1637, 1, 64, 0, 1, 1601.15, -4401.67, 9.1794, 0.801712, 300, 0, 0, 1003, 0, 0, 0, 0, 0, 0),
+(@CGUID + 56, @NPC_SANA, 1, 1637, 1637, 1, 64, 0, 0, 1598.94, -4397.32, 8.49337, 0.664267, 300, 0, 0, 1003, 0, 0, 0, 0, 0, 0),
+(@CGUID + 57, @NPC_GRYSHKA, 1, 1637, 1637, 1, 64, 0, 1, 1597.02, -4395.84, 8.61465, 0.664267, 300, 0, 0, 1003, 0, 0, 0, 0, 0, 0),
+(@CGUID + 58, @NPC_THUNG, 1, 1637, 1637, 1, 64, 0, 0, 1594.9, -4395.75, 8.23313, 0.664267, 300, 0, 0, 126, 0, 0, 0, 0, 0, 0),
+(@CGUID + 59, @NPC_COMMONER, 1, 1637, 1637, 1, 64, 0, 0, 1596.92, -4404.38, 7.44287, 0.664267, 300, 0, 0, 1395, 0, 0, 0, 0, 0, 0),
+(@CGUID + 60, @NPC_COMMONER, 1, 1637, 1637, 1, 64, 0, 0, 1599.55, -4403.68, 8.18324, 0.664267, 300, 0, 0, 2292, 0, 0, 0, 0, 0, 0),
+(@CGUID + 61, @NPC_COMMONER, 1, 1637, 1637, 1, 64, 0, 0, 1595.14, -4402.1, 6.89729, 0.664267, 300, 0, 0, 1110, 0, 0, 0, 0, 0, 0),
+(@CGUID + 62, @NPC_COMMONER, 1, 1637, 1637, 1, 64, 0, 0, 1594.08, -4399.7, 6.717, 0.664267, 300, 0, 0, 955, 0, 0, 0, 0, 0, 0),
+(@CGUID + 63, @NPC_COMMONER, 1, 1637, 1637, 1, 64, 0, 0, 1592.45, -4397.61, 7.12726, 0.664267, 300, 0, 0, 247, 0, 0, 0, 0, 0, 0),
+(@CGUID + 64, @NPC_COMMONER, 1, 1637, 1637, 1, 64, 0, 0, 1592.86, -4394.45, 7.90426, 0.218946, 300, 0, 0, 71, 0, 0, 0, 0, 0, 0),
+(@CGUID + 65, @NPC_OVERLORD_RUNTHAK, 1, 1637, 1637, 1, 64, 0, 1, 1606.09, -4396.1, 10.1268, 3.7446, 300, 0, 0, 48832, 0, 0, 0, 0, 0, 0),
+(@CGUID + 66, @UC_SYLVANAS, 0, 85, 153, 1, 64, 0, 1, 1943.76, 237.566, 44.276, 3.09834, 300, 0, 0, 6972500, 0, 0, 0, 0, 0, 0),
+(@CGUID + 67, @VOLJIN, 0, 85, 153, 1, 64, 0, 1, 1944.09, 245.315, 44.2522, 3.09834, 300, 0, 0, 3585186, 0, 0, 0, 134217728, 0, 0),
+(@CGUID + 68, @UC_THRALL, 0, 85, 153, 1, 64, 0, 1, 1943.59, 233.699, 44.3204, 3.09834, 300, 0, 0, 7925544, 0, 0, 0, 134217728, 0, 0);
+
+-- pathing is pure guess, there is no sniff of this event. Seen lots of videos and everybody ignores those fuckers ;[
+DELETE FROM `waypoint_data` WHERE `id` IN ((@CGUID + 37) * 10, (@CGUID + 38) * 10, (@CGUID + 39) * 10, @CGUID * 10, (@CGUID + 2) * 10, (@CGUID + 1) * 10, (@CGUID + 51) * 10, (@CGUID + 49) * 10, (@CGUID + 48) * 10, (@CGUID + 50) * 10, (@CGUID + 65) * 10, (@CGUID + 40) * 10);
+INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
+((@CGUID + 37) * 10, 1, 1636.727661, -4419.891113, 15.754716, 3.374689, 0, 0, 0, 100, 0),
+((@CGUID + 37) * 10, 2, 1597.315430, -4436.729004, 6.685284, 3.547476, 0, 0, 0, 100, 0),
+((@CGUID + 37) * 10, 3, 1532.198364, -4418.569824, 12.707468, 2.803703, 0, 0, 0, 100, 0),
+((@CGUID + 37) * 10, 4, 1439.670654, -4423.134277, 25.462461, 3.070738, 0, 0, 0, 100, 0),
+((@CGUID + 37) * 10, 5, 1428.224976, -4366.074707, 25.462461, 1.739488, 0, 0, 0, 100, 0),
+((@CGUID + 37) * 10, 6, 1359.062012, -4372.103516, 26.125994, 3.259234, 0, 0, 0, 100, 0),
+((@CGUID + 37) * 10, 7, 1301.137085, -4391.241699, 26.268190, 3.479145, 0, 0, 0, 100, 0),
+((@CGUID + 37) * 10, 8, 1359.062012, -4372.103516, 26.125994, 3.259234, 0, 0, 0, 100, 0), -- 6
+((@CGUID + 37) * 10, 9, 1428.224976, -4366.074707, 25.462461, 1.739488, 0, 0, 0, 100, 0), -- 5
+((@CGUID + 37) * 10, 10, 1439.670654, -4423.134277, 25.462461, 3.070738, 0, 0, 0, 100, 0), -- 4
+((@CGUID + 37) * 10, 11, 1532.198364, -4418.569824, 12.707468, 2.803703, 0, 0, 0, 100, 0), -- 3
+((@CGUID + 37) * 10, 12, 1597.315430, -4436.729004, 6.685284, 3.547476, 0, 0, 0, 100, 0), -- 2
+((@CGUID + 37) * 10, 13, 1636.727661, -4419.891113, 15.754716, 3.374689, 0, 0, 0, 100, 0), -- 1
+((@CGUID + 37) * 10, 14, 1661.776733, -4411.652832, 17.281466, 0.494632, 0, 0, 0, 100, 0),
+
+((@CGUID + 38) * 10, 1, 1510.770508, -4415.110840, 19.337944, 3.245882, 0, 0, 0, 100, 0),
+((@CGUID + 38) * 10, 2, 1440.086914, -4422.711426, 25.462467, 3.249809, 0, 0, 0, 100, 0),
+((@CGUID + 38) * 10, 3, 1424.909790, -4370.168457, 25.462467, 2.820196, 0, 0, 0, 100, 0),
+((@CGUID + 38) * 10, 4, 1360.981689, -4377.626953, 26.084114, 3.323637, 0, 0, 0, 100, 0),
+((@CGUID + 38) * 10, 5, 1341.317139, -4405.867188, 27.853329, 4.383916, 0, 0, 0, 100, 0),
+((@CGUID + 38) * 10, 6, 1312.769043, -4491.074707, 22.622589, 4.560626, 3000, 0, 0, 100, 0),
+((@CGUID + 38) * 10, 7, 1341.317139, -4405.867188, 27.853329, 4.383916, 0, 0, 0, 100, 0), -- 5
+((@CGUID + 38) * 10, 8, 1360.981689, -4377.626953, 26.084114, 3.323637, 0, 0, 0, 100, 0), -- 4
+((@CGUID + 38) * 10, 9, 1424.909790, -4370.168457, 25.462467, 2.820196, 0, 0, 0, 100, 0), -- 3
+((@CGUID + 38) * 10, 10, 1440.086914, -4422.711426, 25.462467, 3.249809, 0, 0, 0, 100, 0), -- 2
+((@CGUID + 38) * 10, 11, 1510.770508, -4415.110840, 19.337944, 3.245882, 0, 0, 0, 100, 0), -- 1
+
+((@CGUID + 39) * 10, 1, 1519.227173, -4420.032715, 17.018894, 2.832764, 0, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 2, 1504.174561, -4397.063477, 21.904577, 1.835307, 4000, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 3, 1475.047607, -4416.577637, 25.462658, 3.688848, 0, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 4, 1432.220093, -4422.998535, 25.462658, 3.321281, 2500, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 5, 1427.358276, -4369.822754, 25.462658, 1.896568, 0, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 6, 1378.408691, -4357.613281, 26.151247, 2.623062, 3000, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 7, 1352.227661, -4360.893066, 26.748661, 1.684511, 0, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 8, 1348.345459, -4345.072754, 27.216478, 1.818029, 2000, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 9, 1362.780273, -4367.947266, 26.153179, 5.547090, 0, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 10, 1424.892334, -4363.779785, 25.462536, 0.076789, 0, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 11, 1449.072754, -4425.893555, 25.462536, 5.519594, 0, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 12, 1496.059570, -4419.106445, 23.187777, 0.163175, 0, 0, 0, 100, 0),
+((@CGUID + 39) * 10, 13, 1564.113159, -4412.110352, 7.560035, 0.171029, 0, 0, 0, 100, 0),
+
+(@CGUID * 10, 1, 1314.228394, -4472.458496, 23.983208, 1.540771, 0, 0, 0, 100, 0),
+(@CGUID * 10, 2, 1315.020996, -4391.339355, 26.246040, 1.591822, 0, 0, 0, 100, 0),
+(@CGUID * 10, 3, 1381.445679, -4373.530762, 26.022976, 0.193814, 0, 0, 0, 100, 0),
+(@CGUID * 10, 4, 1425.371216, -4371.731445, 25.462433, 5.196810, 0, 0, 0, 100, 0),
+(@CGUID * 10, 5, 1437.288330, -4423.067383, 25.462433, 5.133973, 0, 0, 0, 100, 0),
+(@CGUID * 10, 6, 1488.331787, -4418.357422, 24.094090, 0.166324, 0, 0, 0, 100, 0),
+(@CGUID * 10, 7, 1599.124756, -4407.760742, 7.388023, 0.376025, 10000, 0, 0, 100, 0),
+(@CGUID * 10, 8, 1488.331787, -4418.357422, 24.094090, 0.166324, 0, 0, 0, 100, 0), -- 6
+(@CGUID * 10, 9, 1437.288330, -4423.067383, 25.462433, 5.133973, 0, 0, 0, 100, 0), -- 5
+(@CGUID * 10, 10, 1425.371216, -4371.731445, 25.462433, 5.196810, 0, 0, 0, 100, 0), -- 4
+(@CGUID * 10, 11, 1381.445679, -4373.530762, 26.022976, 0.193814, 0, 0, 0, 100, 0), -- 3
+(@CGUID * 10, 12, 1315.020996, -4391.339355, 26.246040, 1.591822, 0, 0, 0, 100, 0), -- 2
+(@CGUID * 10, 13, 1314.228394, -4472.458496, 23.983208, 1.540771, 0, 0, 0, 100, 0),
+
+((@CGUID + 2) * 10, 1, 1311.382813, -4472.563477, 24.082273, 1.557264, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 2, 1314.851563, -4387.514160, 26.244619, 1.616169, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 3, 1381.291992, -4370.146484, 26.023146, 1.616169, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 4, 1429.167358, -4371.299805, 25.462433, 4.840226, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 5, 1438.546509, -4419.699707, 25.462433, 6.037951, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 6, 1488.069946, -4415.084961, 23.924955, 0.084631, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 7, 1594.640869, -4406.261719, 6.956670,0.752219, 10500, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 8, 1488.069946, -4415.084961, 23.924955, 0.084631, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 9, 1438.546509, -4419.699707, 25.462433, 6.037951, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 10, 1429.167358, -4371.299805, 25.462433, 4.840226, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 11, 1381.291992, -4370.146484, 26.023146, 1.616169, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 12, 1314.851563, -4387.514160, 26.244619, 1.616169, 0, 0, 0, 100, 0),
+((@CGUID + 2) * 10, 13, 1311.382813, -4472.563477, 24.082273, 1.557264, 0, 0, 0, 100, 0),
+
+((@CGUID + 1) * 10, 1, 1324.306641, -4474.051758, 25.471981, 1.623239, 1000, 0, 0, 100, 0),
+((@CGUID + 1) * 10, 2, 1294.313599, -4423.655762, 26.651222, 2.200507, 2000, 0, 0, 100, 0),
+((@CGUID + 1) * 10, 3, 1336.517456, -4413.115723, 27.156092, 0.119199, 2000, 0, 0, 100, 0),
+((@CGUID + 1) * 10, 4, 1350.187622, -4346.205078, 27.194891, 1.474011, 2000, 0, 0, 100, 0),
+((@CGUID + 1) * 10, 5, 1325.687866, -4406.854980, 27.066034, 4.489942, 0, 0, 0, 100, 0),
+((@CGUID + 1) * 10, 6, 1312.286133, -4514.444336, 22.207296, 4.427111, 3000, 0, 0, 100, 0),
+
+((@CGUID + 48) * 10, 1, 1503.223022, -4413.273926, 21.462757, 3.743015, 0, 0, 0, 100, 0),
+((@CGUID + 48) * 10, 2, 1551.767456, -4439.213867, 10.344376, 5.917779, 0, 0, 0, 100, 0),
+((@CGUID + 48) * 10, 3, 1571.801270, -4415.120605, 7.094321, 0.950135, 0, 0, 0, 100, 0),
+((@CGUID + 48) * 10, 4, 1530.485962, -4394.278809, 14.629207, 2.725135, 0, 0, 0, 100, 0),
+
+((@CGUID + 49) * 10, 1, 1428.319946, -4368.334961, 25.462538, 1.801508, 0, 0, 0, 100, 0),
+((@CGUID + 49) * 10, 2, 1379.236084, -4371.864258, 26.023857, 3.317327, 0, 0, 0, 100, 0),
+((@CGUID + 49) * 10, 3, 1317.712158, -4389.084473, 26.241236, 3.439064, 0, 0, 0, 100, 0),
+((@CGUID + 49) * 10, 4, 1312.412354, -4495.200684, 22.253731, 4.683920, 0, 0, 0, 100, 0),
+((@CGUID + 49) * 10, 5, 1317.712158, -4389.084473, 26.241236, 3.439064, 0, 0, 0, 100, 0),
+((@CGUID + 49) * 10, 6, 1379.236084, -4371.864258, 26.023857, 3.317327, 0, 0, 0, 100, 0),
+((@CGUID + 49) * 10, 7, 1428.319946, -4368.334961, 25.462538, 1.801508, 0, 0, 0, 100, 0),
+
+((@CGUID + 50) * 10, 1, 1350.657959, -4349.023926, 27.158371, 2.154161, 2000, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 2, 1328.607300, -4387.384277, 26.224094, 3.992004, 0, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 3, 1298.629150, -4412.804688, 26.687563, 3.768165, 0, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 4, 1292.821533, -4392.992188, 26.284231, 1.781106, 4000, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 5, 1379.779419, -4372.537598, 26.023079, 0.182821, 0, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 6, 1423.772461, -4367.567871, 25.462664, 0.061084, 0, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 7, 1438.552124, -4420.987793, 25.462664, 4.926629, 0, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 8, 1524.945923, -4410.342285, 14.457470, 0.163185, 0, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 9, 1582.459229, -4406.155273, 6.063486, 0.602228, 10000, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 10, 1524.945923, -4410.342285, 14.457470, 0.163185, 0, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 11, 1438.552124, -4420.987793, 25.462664, 4.926629, 0, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 12, 1423.772461, -4367.567871, 25.462664, 0.061084, 0, 0, 0, 100, 0),
+((@CGUID + 50) * 10, 13, 1379.779419, -4372.537598, 26.023079, 0.182821, 0, 0, 0, 100, 0),
+
+((@CGUID + 51) * 10, 1, 1535.931396, -4416.078125, 11.668506, 1.755966, 0, 0, 0, 100, 0),
+((@CGUID + 51) * 10, 2, 1580.108887, -4405.557617, 5.750760, 0.267636, 0, 0, 0, 100, 0),
+((@CGUID + 51) * 10, 3, 1651.950684, -4417.000488, 16.760706, 6.232729, 0, 0, 0, 100, 0),
+((@CGUID + 51) * 10, 4, 1556.471802, -4436.006348, 8.810843, 3.083283, 0, 0, 0, 100, 0),
+
+((@CGUID + 65) * 10, 1, 1601.677856, -4390.092773, 10.024803, 3.693547, 0, 0, 0, 100, 0),
+((@CGUID + 65) * 10, 2, 1607.239624, -4397.162109, 10.247937, 2.237402, 0, 0, 0, 100, 0),
+
+((@CGUID + 40) * 10, 1, 1923.388672, -4126.897949, 43.180893, 6.057603, 0, 0, 0, 100, 0),
+((@CGUID + 40) * 10, 2, 1916.156494, -4127.158691, 43.197136, 3.186971, 0, 0, 0, 100, 0);
+
+DELETE FROM `creature_addon` WHERE `guid` IN (@CGUID + 4, @CGUID + 6, @CGUID + 8, @CGUID + 10, @CGUID + 11 , @CGUID + 12, @CGUID + 14, @CGUID + 18, @CGUID + 19, @CGUID + 21, @CGUID + 22, @CGUID + 23, @CGUID + 25, @CGUID + 27, @CGUID + 29, @CGUID + 32, @CGUID + 5, @CGUID + 7, @CGUID + 9, @CGUID + 13, @CGUID + 15, @CGUID + 16, @CGUID + 17, @CGUID + 20, @CGUID + 24, @CGUID + 26, @CGUID + 28, @CGUID + 30, @CGUID + 31, @CGUID + 35, @CGUID + 33, @CGUID + 34, @CGUID + 3);
+INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+-- sitting
+(@CGUID + 4, 0, 0, 1, 0, 0, ""),
+(@CGUID + 6, 0, 0, 1, 0, 0, ""),
+(@CGUID + 8, 0, 0, 1, 0, 0, ""),
+(@CGUID + 10, 0, 0, 1, 0, 0, ""),
+(@CGUID + 11, 0, 0, 1, 0, 0, ""),
+(@CGUID + 12, 0, 0, 1, 0, 0, ""),
+(@CGUID + 14, 0, 0, 1, 0, 0, ""),
+(@CGUID + 18, 0, 0, 1, 0, 0, ""),
+(@CGUID + 19, 0, 0, 1, 0, 0, ""),
+(@CGUID + 21, 0, 0, 1, 0, 0, ""),
+(@CGUID + 22, 0, 0, 1, 0, 0, ""),
+(@CGUID + 23, 0, 0, 1, 0, 0, ""),
+(@CGUID + 25, 0, 0, 1, 0, 0, ""),
+(@CGUID + 27, 0, 0, 1, 0, 0, ""),
+(@CGUID + 29, 0, 0, 1, 0, 0, ""),
+(@CGUID + 32, 0, 0, 1, 0, 0, ""),
+(@CGUID + 35, 0, 0, 1, 0, 0, ""),
+(@CGUID + 33, 0, 0, 1, 0, 0, ""),
+(@CGUID + 3, 0, 0, 1, 0, 0, ""),
+
+-- sleeping
+(@CGUID + 5, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 7, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 9, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 13, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 15, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 16, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 17, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 20, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 24, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 26, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 28, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 30, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 31, 0, 0, 3, 0, 0, "42648"),
+(@CGUID + 34, 0, 0, 3, 0, 0, "42648");
+
+-- pathing and mounts
+DELETE FROM `creature_addon` WHERE `guid` IN (@CGUID + 37, @CGUID + 38, @CGUID + 39, @CGUID, @CGUID + 2, @CGUID + 1, @CGUID + 51, @CGUID + 48, @CGUID + 49, @CGUID + 50);
+INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(@CGUID + 37, (@CGUID + 37) * 10, 0, 0, 0, 0, ""),
+(@CGUID + 38, (@CGUID + 38) * 10, 0, 0, 0, 0, ""),
+(@CGUID + 39, (@CGUID + 39) * 10, 0, 0, 0, 0, ""),
+(@CGUID, @CGUID * 10, 0, 0, 0, 0, ""),
+(@CGUID + 2, (@CGUID + 2) * 10, 0, 0, 0, 0, ""),
+(@CGUID + 1, (@CGUID + 1) * 10, 0, 0, 0, 0, ""),
+(@CGUID + 51, (@CGUID + 51) * 10, 29283, 0, 0, 0, ""),
+(@CGUID + 50, (@CGUID + 50) * 10, 29283, 0, 0, 0, ""),
+(@CGUID + 48, (@CGUID + 48) * 10, 29260, 0, 0, 0, ""),
+(@CGUID + 49, (@CGUID + 49) * 10, 29260, 0, 0, 0, "");
+
+DELETE FROM `gameobject_addon` WHERE `guid` IN (@OGUID, @OGUID + 11, @OGUID + 12);
+INSERT INTO `gameobject_addon` (`guid`, `invisibilityType`, `invisibilityValue`) VALUES
+(@OGUID, 7, 1000),
+(@OGUID + 11, 7, 1000),
+(@OGUID + 12, 7, 1000);
+
+DELETE FROM `spell_area` WHERE `spell` IN (60943, 59062);
+INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES
+(60943, 4129, 13257, 13257, 0, 690, 2, 1, 2, 2),
+(59062, 14, 13257, 13267, 0, 690, 2, 1, 66, 11),
+(59062, 1637, 13257, 13267, 0, 690, 2, 1, 66, 11),
+(60943, 1637, 13266, 0, 0, 690, 2, 1, 2, 0),
+
+(59062, 85, 13257, 13267, 0, 690, 2, 1, 64, 11), -- tirisfal glades
+(59062, 1497, 13257, 13267, 0, 690, 2, 1, 64, 11); -- undercity
+
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (@OG_TELEPORTSPELL, @UCTELEPORTSPELL);
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(@OG_TELEPORTSPELL, 'spell_59064_59439_portals'),
+(@UCTELEPORTSPELL, 'spell_59064_59439_portals');
+
+-- Its not sniff verified, if anyone got any info about it, you're more than welcome to correct it
+DELETE FROM `spell_target_position` WHERE `ID` IN (58419, 59448);
+INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) VALUES
+(58419, 0, 1, 1336.34, -4374.32, 26.19, 0.09, 0),
+(59448, 0, 0, 1962.69, 235.92, 39.77, 3.09, 0);
diff --git a/sql/updates/world/3.3.5/2016_06_14_05_world.sql b/sql/updates/world/3.3.5/2016_06_14_05_world.sql
new file mode 100644
index 00000000000..2b34562e4bb
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_14_05_world.sql
@@ -0,0 +1,18 @@
+-- Add sniffed gossip text to menu
+DELETE FROM `gossip_menu_option` WHERE `menu_id` = 8207;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(8207, 0, 0, 'I need a new phase disruptor, Professor.', 18635,1,1,0,0,0,0,'',0);
+
+-- Migrate NPC to use SmartAI
+UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 20907;
+
+-- Create SmartAI for Dabiri
+DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 20907);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(20907,0, 0, 1, 62, 0, 100, 0, 8207, 0,0,0, 85, 35780, 0,0,0,0,0, 7, 0,0,0,0,0,0,0, "Professor Dabiri - On Gossip Option 0 Selected - Invoker Cast 'Summon Phase Disruptor'"),
+(20907,0, 1, 0, 61, 0, 100, 0, 0, 0,0,0, 72, 0, 0,0,0,0,0, 7, 0,0,0,0,0,0,0, 'Professor Dabiri - On Linked Actions - Close Gossip');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 8207;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,8207,0,0,0,2,0,29778,1,0,1,0,'','Professor Dabiri - Show gossip option 0 if player does not have item 29778 in inventory'),
+(15,8207,0,0,0,9,0,10438,0,0,0,0,'','Professor Dabiri - Show gossip option 0 if player has accepted quest 10438');
diff --git a/sql/updates/world/3.3.5/2016_06_15_00_world.sql b/sql/updates/world/3.3.5/2016_06_15_00_world.sql
new file mode 100644
index 00000000000..286d86dd7d3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_00_world.sql
@@ -0,0 +1,7 @@
+--
+UPDATE `quest_template` SET `AllowableRaces`=32 WHERE `ID`=748;
+
+UPDATE `quest_template_addon` SET `PrevQuestID`=0 WHERE `ID`=364;
+UPDATE `quest_template` SET `AllowableRaces`=0 WHERE `ID` IN (364, 3901);
+
+UPDATE `quest_template` SET `AllowableRaces`=0 WHERE `ID` IN (367, 368, 369, 492);
diff --git a/sql/updates/world/3.3.5/2016_06_15_01_world.sql b/sql/updates/world/3.3.5/2016_06_15_01_world.sql
new file mode 100644
index 00000000000..74e50e55785
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_01_world.sql
@@ -0,0 +1,8 @@
+--
+SET @OGUID := 6409;
+DELETE FROM `gameobject` WHERE `guid` IN (@OGUID+0,@OGUID+1,@OGUID+2,@OGUID+3);
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@OGUID+0,193988,615,3,1,3246.47,515.266,58.6196,1.54789,0,0,0.698963,0.715158,-300,0,1),
+(@OGUID+1,193988,615,3,1,3154.78,515.889,90.9767,3.18872,0,0,0.999722,-0.0235612,-300,0,1),
+(@OGUID+2,193988,615,3,1,3216.13,648.325,87.0783,0.693027,0,0,0.339621,0.940562,-300,0,1),
+(@OGUID+3,193988,615,3,1,3383.81,532.522,96.971,3.43866,0,0,0.988989,-0.147986,-300,0,1);
diff --git a/sql/updates/world/3.3.5/2016_06_15_02_world.sql b/sql/updates/world/3.3.5/2016_06_15_02_world.sql
new file mode 100644
index 00000000000..b94af5ec293
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_02_world.sql
@@ -0,0 +1,18 @@
+--
+DELETE FROM `item_loot_template` WHERE `Entry` IN (50301,54218);
+INSERT INTO `item_loot_template` (`Entry`,`Item`,`Reference`,`Chance`,`QuestRequired`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`,`Comment`) VALUES
+(50301,46779,0,36.36,0,1,1,50,50,'Landro\'s Pet Box, Path of Cenarius'),
+(50301,35223,0,36.36,0,1,1,50,50,'Landro\'s Pet Box, Papa Hummel\'s Old-Fashioned Pet Biscuit'),
+(50301,45047,0,27.28,0,1,1,50,50,'Landro\'s Pet Box, Sandbox Tiger'),
+(50301,32588,0,0.45,0,1,2,1,1,'Landro\'s Pet Box, Banana Charm'),
+(50301,38050,0,0.45,0,1,2,1,1,'Landro\'s Pet Box, Soul-Trader Beacon'),
+(50301,34493,0,0.10,0,1,2,1,1,'Landro\'s Pet Box, Dragon Kite'),
+(54218,46779,0,36.36,0,1,1,50,50,'Landro\'s Gift Box, Path of Cenarius'),
+(54218,35223,0,36.36,0,1,1,50,50,'Landro\'s Gift Box, Papa Hummel\'s Old-Fashioned Pet Biscuit'),
+(54218,45047,0,27.28,0,1,1,50,50,'Landro\'s Gift Box, Sandbox Tiger'),
+(54218,23720,0,0.50,0,1,2,1,1,'Landro\'s Gift Box, Riding Turtle'),
+(54218,49284,0,0.30,0,1,2,1,1,'Landro\'s Gift Box, Reins of the Swift Spectral Tiger'),
+(54218,49283,0,0.30,0,1,2,1,1,'Landro\'s Gift Box, Reins of the Spectral Tiger'),
+(54218,49286,0,0.30,0,1,2,1,1,'Landro\'s Gift Box, X-51 Nether-Rocket X-TREME'),
+(54218,49285,0,0.10,0,1,2,1,1,'Landro\'s Gift Box, X-51 Nether-Rocket'),
+(54218,49282,0,0.20,0,1,2,1,1,'Landro\'s Gift Box, Big Battle Bear');
diff --git a/sql/updates/world/3.3.5/2016_06_15_03_world.sql b/sql/updates/world/3.3.5/2016_06_15_03_world.sql
new file mode 100644
index 00000000000..edc42a33642
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_03_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `creature_template_addon` WHERE `entry`= 29403; -- Onslaught Gryphon
+INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(29403, 0, 0, 0, 1, 0, 54422); -- add aura 'Flying' to Onslaught Gryphon
diff --git a/sql/updates/world/3.3.5/2016_06_15_04_world.sql b/sql/updates/world/3.3.5/2016_06_15_04_world.sql
new file mode 100644
index 00000000000..f976ba3093b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_04_world.sql
@@ -0,0 +1,9 @@
+--
+DELETE FROM `creature_template_addon` WHERE `entry`=24783;
+INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(24783, 0, 0, 0, 1, 0, 43775);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN(13,17) AND `SourceEntry`=44422;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(17,0,44422,0,0,30,0,186946,5,0,0,0,0,'',"Spell 'Scavenge' target GameObject 'Fjord Hawk Egg'"),
+(13,1,44422,0,0,31,0,5,186946,0,0,0,0,'',"Spell 'Scavenge' target GameObject 'Fjord Hawk Egg'");
diff --git a/sql/updates/world/3.3.5/2016_06_15_05_world.sql b/sql/updates/world/3.3.5/2016_06_15_05_world.sql
new file mode 100644
index 00000000000..1524c2f2a5e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_05_world.sql
@@ -0,0 +1,5 @@
+--
+DELETE FROM `skill_fishing_base_level` WHERE `entry` IN (4100,4987);
+INSERT INTO `skill_fishing_base_level` (`entry`, `skill`) VALUES
+(4987, 480),
+(4100, 450);
diff --git a/sql/updates/world/3.3.5/2016_06_15_06_world.sql b/sql/updates/world/3.3.5/2016_06_15_06_world.sql
new file mode 100644
index 00000000000..1f8a50b65a3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_06_world.sql
@@ -0,0 +1,5 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestId`=0 WHERE `id`=9409;
+UPDATE `quest_template_addon` SET `PrevQuestId`=9409 WHERE `id`=9371;
+UPDATE `quest_template_addon` SET `ExclusiveGroup`=9280 WHERE `ID` IN (9280, 9369);
+UPDATE `quest_template` SET `RewardNextQuest`=9409 WHERE `ID`=9280;
diff --git a/sql/updates/world/3.3.5/2016_06_15_07_world.sql b/sql/updates/world/3.3.5/2016_06_15_07_world.sql
new file mode 100644
index 00000000000..a3ceba435dc
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_07_world.sql
@@ -0,0 +1,18 @@
+--
+UPDATE `quest_request_items` SET `CompletionText`="Did you find the Syndicate Shadow Mages, and collect from them the blood?" WHERE `ID`=1066;
+
+UPDATE `quest_request_items` SET CompletionText="Did you secure the books? They need to be kept out of the wrong hands." WHERE ID = 14356;
+UPDATE `quest_offer_reward` SET RewardText="Good, $C. You've done well. I'll keep these safe from prying eyes; the last thing we need is a strong Shadow Council rising up again.$B$BCheck back with me in the future; there's always something that needs doing around here, apparently, and I might need another able body." WHERE ID = 14356;
+
+UPDATE `page_text` SET `Text`="Supervisor Fizsprocket, please find enclosed a list of the equipment you have requisitioned, approved by President Razdunk.$B$BHe has asked me to remind and to emphasize to you of the Venture Company's vested interest in setting up operations throughout Kalimdor. Our drilling and mining outposts in the Barrens have proven profitable and efficient, but we still await sufficient production numbers from Mulgore, your jurisdiction.$B$BThe advisory board understands the difficulties in establishing" WHERE `ID`=352;
+UPDATE `page_text` SET `Text`="a large scale operation so close to the tauren homeland, but do not feel that they pose a large impediment to our overall business plan in the area.$B$BWe are pleased to hear that mining has begun in the mineral rich plains of Mulgore. Because of this the board has approved your equipment request. In addition to mining, we feel that Mulgore also has much to offer in the way of lumber, thus you will also be provided with several of our newest model shredders and raw materials to construct a mill.", `NextPageID`=0 WHERE `ID`=353;
+DELETE FROM `page_text` WHERE ID = 354;
+
+UPDATE `page_text` SET `Text`="Deathstalker Mission Report$B$BAgents: Rane Yorick, Quinn Yorick, Erland McKree$B$BPrimary mission: perform reconnaissance through northern silverpine, and determine threat levels of wildlife and Scourge." WHERE `ID`=380;
+UPDATE `page_text` SET `Text`="Agents commenced sweep, finding significant worg presence. Recommend hunting squads dispatched to reduce this threat.$B$BUndead gnolls were found at the farm steading dubbed The Dead Field. Their purpose at the farm is not known, though their movements and level of readiness suggest imminent military action. In the time they were observed, no notable leaders were found among the gnolls. It is assumed they await the arrival of leadership or reinforcements." WHERE `ID`=381;
+UPDATE `page_text` SET `Text`="Continuing the sweep, our agents were detained at Ivar's farm. Ivar, most of his family and his workers had succumbed to the Scourge and become its minions.$B$BOur agents were attacked and although successful in defeating their ambushers, they sustained serious injuries, particularly agent Quinn." WHERE `ID`=382;
+UPDATE `page_text` SET `Text`="A defensive position was taken in Ivar's old house, and while Rane kept watch for future attacks, Erland continued the reconnaissance mission.$B$BErland was then pinned by Worgs in a northern orchard, only escaping with the aid of another Forsaken agent. That agent is the bearer of this report." WHERE `ID`=383;
+UPDATE `page_text` SET `Text`="It should be noted here that this report bearer was instrumental in not only the success of our mission, but also in the defeat of Ivar the Foul, the rescue of Erland, and the deliverance of this report.$B$BWe extend our gratitude, and recommend that command acknowledges this individual with awards befitting such meritorious conduct as was displayed in the field.$B$B-Deathstalker Rane Yorick,$BMission Leader" WHERE `ID`=386;
+
+UPDATE `page_text` SET `NextPageID`=571, `Text`="The Bleeding Sparrow: Manifest$B$B(20) barrels rum. Destination: Theramore$B(50) sacks flour. Destination: Theramore$B(2) crates assorted gnome tools. Destination: Ratchet$B(30) bolts cotton cloth. Destination: Theramore$B(4) crates spices. Destination: Theramore$B(3) passengers. Destination: Theramore" WHERE `ID`=527;
+UPDATE `page_text` SET `NextPageID`=0, `Text`="Captain,$B$BI wish you fortune in your journeys. Regrettably, fortune did not favor our first abduction attempt.$B$BWhen our team made contact with the target in the Stormwind/Ironforge tunnels, they found only a decoy. It appears he showed more wisdom than we accredited him.$B$BBut our second plan is already in motion. Defias agents are prepared to intercept the target as he approaches Theramore. Soon Stormwind will feel our bite all too keenly..$B$B-M" WHERE `ID`=571;
diff --git a/sql/updates/world/3.3.5/2016_06_15_08_world.sql b/sql/updates/world/3.3.5/2016_06_15_08_world.sql
new file mode 100644
index 00000000000..49d3fbc4643
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_08_world.sql
@@ -0,0 +1,3 @@
+--
+DELETE FROM `creature_queststarter` WHERE `quest` IN (615, 8551);
+UPDATE `quest_template` SET `AllowableRaces`=0 WHERE `ID`=614;
diff --git a/sql/updates/world/3.3.5/2016_06_15_09_world_335.sql b/sql/updates/world/3.3.5/2016_06_15_09_world_335.sql
new file mode 100644
index 00000000000..51ab052ef56
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_09_world_335.sql
@@ -0,0 +1,11 @@
+DELETE FROM `creature_queststarter` WHERE `quest`IN(8143,8144);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(14905, 8143),
+(14905, 8144);
+
+DELETE FROM `creature_questender` WHERE `quest`IN(8143,8144);
+INSERT INTO `creature_questender` (`id`, `quest`) VALUES
+(14905, 8143),
+(14905, 8144);
+
+UPDATE `quest_template` SET `AllowableRaces`=0 WHERE `ID`=8144;
diff --git a/sql/updates/world/3.3.5/2016_06_15_10_world.sql b/sql/updates/world/3.3.5/2016_06_15_10_world.sql
new file mode 100644
index 00000000000..6033ee9446c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_10_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `gameobject` WHERE `guid`=5537;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `spawntimesecs`, `state`) VALUES
+(5537,4090,530,-2518.51001,7360.100098,10.6223,120,1);
diff --git a/sql/updates/world/3.3.5/2016_06_15_11_world.sql b/sql/updates/world/3.3.5/2016_06_15_11_world.sql
new file mode 100644
index 00000000000..5409a886b28
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_11_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM creature_template_addon WHERE `entry` IN (26514);
+INSERT INTO creature_template_addon (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(26514, 0, 0, 0, 1, 0, '29266');
diff --git a/sql/updates/world/3.3.5/2016_06_15_12_world.sql b/sql/updates/world/3.3.5/2016_06_15_12_world.sql
new file mode 100644
index 00000000000..16919326b48
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_12_world.sql
@@ -0,0 +1,99 @@
+--
+SET @CGUID := 87945; -- 15 required
+SET @OGUID := 64102; -- 15 required
+
+-- Set Earthen Ring Elder ID: 26221 friendly to both factions
+UPDATE `creature_template` SET `faction`=35 WHERE `entry`=26221;
+DELETE FROM `creature_queststarter` WHERE `id` IN (26221,25975,25324);
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID AND @CGUID+14;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(@CGUID, 25866, 1, 1, 1, 0, 0, 3886.6, 771.658, 5.00204, 3.78625, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+1, 25866, 1, 1, 1, 0, 0, 3873.34, 786.567, 3.15877, 1.19364, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+2, 25866, 1, 1, 1, 0, 0, 3886.25, 820.325, 1.23753, 1.74656, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+3, 25866, 1, 1, 1, 0, 0, 3922.2, 795.453, 9.05771, 3.07546, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+4, 25863, 1, 1, 1, 0, 0, 3956.09, 767.42, 7.88992, 5.17483, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+5, 25863, 1, 1, 1, 0, 0, 3988.96, 790.529, 6.19678, 0.208762, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+6, 25863, 1, 1, 1, 0, 0, 3899.13, 764.193, 6.01616, 5.62487, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+7, 25863, 1, 1, 1, 0, 0, 3923.53, 840.173, 2.29151, 2.07879, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+8, 25924, 1, 1, 1, 0, 0, 3916.05, 783.268, 9.0577, 0.717698, 300, 0, 0, 44, 0, 0, 0, 0, 0),
+(@CGUID+9, 25866, 1, 1, 1, 0, 0, 3900.86, 799.587, 7.80664, 1.37978, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+10, 25866, 1, 1, 1, 0, 0, 3950.07, 846.313, 7.9843, 4.16433, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+11, 25866, 1, 1, 1, 0, 0, 3982.71, 816.306, 8.04045, 4.0481, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+12, 25866, 1, 1, 1, 0, 0, 3918.32, 760.473, 7.77712, 1.94087, 300, 30, 0, 42, 0, 1, 0, 0, 0),
+(@CGUID+13, 25863, 1, 1, 1, 0, 0, 3922.62, 811.827, 7.79205, 2.56369, 300, 0, 0, 42, 0, 0, 0, 0, 0),
+(@CGUID+14, 25949, 1, 1, 1, 0, 0, 4196.1, 1172.44, 6.68073, 0.688985, 300, 0, 0, 486, 1357, 0, 0, 0, 0);
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID AND @OGUID+14;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID, 187989, 1, 1, 1, 3955.77, 862.105, 0.1785, 3.93579, 0, 0, 0.922187, -0.386745, 300, 0, 1),
+(@OGUID+1, 187989, 1, 1, 1, 3880.54, 795.812, 2.67948, 0.589994, 0, 0, 0.290737, 0.956803, 300, 0, 1),
+(@OGUID+2, 187989, 1, 1, 1, 3923.8, 748.779, 8.05033, 2.67052, 0, 0, 0.972389, 0.233364, 300, 0, 1),
+(@OGUID+3, 187989, 1, 1, 1, 3959.24, 760.694, 6.12531, 2.76477, 0, 0, 0.982303, 0.1873, 300, 0, 1),
+(@OGUID+4, 187989, 1, 1, 1, 3998.39, 815.017, 4.22604, 3.56744, 0, 0, 0.977417, -0.21132, 300, 0, 1),
+(@OGUID+5, 187989, 1, 1, 1, 3953.32, 808.406, 9.07383, 0.295474, 0, 0, 0.1472, 0.989107, 300, 0, 1),
+(@OGUID+6, 187989, 1, 1, 1, 3944.4, 817.924, 9.05937, 2.23541, 0, 0, 0.899098, 0.437748, 300, 0, 1),
+(@OGUID+7, 187918, 1, 1, 1, 3891.73, 795.127, 7.70466, 3.57844, 0, 0, 0.97624, -0.216691, 300, 0, 1),
+(@OGUID+8, 187918, 1, 1, 1, 3928.2, 818.467, 8.38597, 0.711076, 0, 0, 0.348095, 0.937459, 300, 0, 1),
+(@OGUID+9, 187918, 1, 1, 1, 3956.23, 854.015, 7.9829, 1.18232, 0, 0, 0.557323, 0.830296, 300, 0, 1),
+(@OGUID+10, 187918, 1, 1, 1, 3988.24, 819.46, 8.01849, 5.47452, 0, 0, 0.393407, -0.919365, 300, 0, 1),
+(@OGUID+11, 187918, 1, 1, 1, 3923.81, 758.498, 7.77727, 4.57321, 0, 0, 0.754564, -0.656226, 300, 0, 1),
+(@OGUID+12, 187918, 1, 1, 1, 3947.51, 812.939, 9.06439, 0.920322, 0, 0, 0.444092, 0.895981, 300, 0, 1),
+(@OGUID+13, 187989, 1, 1, 1, 3924.28, 779.525, 9.05821, 2.43535, 0, 0, 0.938298, 0.345828, 300, 0, 1),
+(@OGUID+14, 187989, 1, 1, 1, 3912.78, 792.797, 9.05821, 2.43771, 0, 0, 0.938704, 0.344723, 300, 0, 1);
+-- SAI and loot for Twilight Firesworn, Twilight Flameguard and Twilight Speaker Viktor
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (25863,25924,25866);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25863,0,0,0,0,0,100,0,0,1000,7000,7500,11,20793,0,0,0,0,0,2,0,0,0,0,0,0,0,'Firesworn - IC - Cast spell Fireball on victim'),
+(25863,0,1,0,4,0,100,0,0,0,0,0,11,184,0,0,0,0,0,1,0,0,0,0,0,0,0,'Firesworn - On aggro - Cast fire shield on self'),
+(25863,0,2,0,4,0,100,0,0,0,0,0,1,0,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Firesworn - On aggro - Say Text 0'),
+(25924,0,0,0,0,0,100,0,0,1000,7000,7500,11,20793,0,0,0,0,0,2,0,0,0,0,0,0,0,'Speaker Viktor - IC - Cast spell Fireball on victim'),
+(25924,0,1,0,4,0,100,0,0,0,0,0,1,0,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Speaker Viktor - On aggro - Say Text 0'),
+(25866,0,0,0,4,0,100,0,0,0,0,0,1,0,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Flameguard - On aggro - Say Text 0');
+UPDATE `creature_template` SET `lootid`=25866,`AIName`= 'SmartAI' WHERE `entry`=25866;
+UPDATE `creature_template` SET `lootid`=25863,`unit_class`=8,`AIName`= 'SmartAI' WHERE `entry`=25863;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`lootid` =25924,`unit_class`=8 WHERE `entry`=25924;
+DELETE FROM `creature_loot_template` WHERE `entry`IN (25866,25863,25924);
+INSERT INTO `creature_loot_template` VALUES
+(25866,35277,0,100,1,1,0,1,1,'Twilight Correspondence'),
+(25863,35277,0,100,1,1,0,1,1,'Twilight Correspondence'),
+(25924,35277,0,100,1,1,0,1,1,'Twilight Correspondence');
+-- Add SAI for quest "Unusual activity"
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN (26534,25324);
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (26534,25324);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(26534,0,0,0,1,0,100,1,6000,10000,0,0,12,25324,3,60000,0,0,0,23,0,0,0,0,0,0,0,'Totem - On event update - Summon guide'),
+(25324,0,0,0,54,0,100,0,0,0,0,0,29,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Earthen ring Guide - On just summonned - Follow Totem'),
+(25324,0,1,0,64,0,100,0,0,0,0,0,1,0,1500,0,0,0,0,1,0,0,0,0,0,0,0,'Earthen ring Guide - On gossip hello - Say text 0');
+-- Earthen Ring Guide text
+DELETE FROM `creature_text` WHERE `entry` IN (25324,25863,25924,25866);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES
+(25324,0,1,'What is it you need?',12,0,100,1,1500,0,'Earthen ring guide',25739),
+(25324,0,2,'Have you discovered something?',12,0,100,1,1500,0,'Earthen ring guide',25740),
+(25324,0,3,'The elemental spirits are restless...',12,0,100,1,1500,0,'Earthen ring guide',25741),
+(25863,0,0,'You are not allowed to interfere!',12,0,100,1,1500,0,'Twilight Firesworn',25098),
+(25924,0,0,'Our vision will be realized!',12,0,100,1,1500,0,'Twilight Speaker Viktor',25099),
+(25866,0,0,'The elements will crush you!',12,0,100,1,1500,0,'Twilight Speaker Viktor',25100);
+-- SAI for Briatha
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=25949;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25949;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=2594900;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25949,0,0,0,10,0,100,0,1,20,40000,40000,80,2594900,2,0,0,0,0,1,0,0,0,0,0,0,0,'Briatha - OOC LOS - Call Timed ActionList'),
+(2594900,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Briatha - Action list - Talk0'),
+(2594900,9,1,0,0,0,100,0,6000,6000,0,0,1,0,4000,0,0,0,0,9,25951,0,15,0,0,0,0,'Emissary - Action list - Say text 0'),
+(2594900,9,2,0,0,0,100,0,6000,6000,0,0,1,1,4000,0,0,0,0,1,0,0,0,0,0,0,0,'Briatha - Action list - Say text 1'),
+(2594900,9,3,0,0,0,100,0,6000,6000,0,0,1,1,4000,0,0,0,0,9,25951,0,15,0,0,0,0,'Emissary - Action list - Say text 1'),
+(2594900,9,4,0,0,0,100,0,6000,6000,0,0,1,2,3500,0,0,0,0,1,0,0,0,0,0,0,0,'Briatha - Action list - Say text 2'),
+(2594900,9,5,0,0,0,100,0,0,0,0,0,11,46375,0,0,0,0,0,1,0,0,0,0,0,0,0,'Briatha - Action list - Cast spell quest credit');
+-- Briatha and Heretic Emissary text
+DELETE FROM `creature_text` WHERE `entry` IN (25949,25951);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES
+(25949,0,0,'These stones should be the last of them. Our coordination with Neptulon''s forces will be impeccable.',12,0,100,1,0,0,'Briatha',25123),
+(25949,1,0,'And your own preparations? Will the Frost Lord have a path to the portal?',12,0,100,1,0,0,'Briatha',25126),
+(25949,2,0,'The ritual in Coilfang will bring Ahune through once he is fully prepared, and the resulting clash between Firelord and Frostlord will rend the foundations of this world. Our ultimate goals are in reach at last....',12,0,100,1,0,0,'Briatha',25128),
+(25951,0,0,'Yess. The Tidehunter will be pleased at this development. The Firelord\'s hold will weaken.',12,0,100,1,0,0,'Heretic Emissary',25124),
+(25951,1,0,'Skar\'this has informed us well. We have worked our way into the slave pens and await your cryomancerss.',12,0,100,1,0,0,'Heretic Emissary',25127);
+
+DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+14 AND `eventEntry`=1;
+INSERT INTO `game_event_creature` SELECT 1, creature.guid FROM `creature` WHERE creature.guid BETWEEN @CGUID+0 AND @CGUID+14;
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+14 AND `eventEntry`=1;
+INSERT INTO `game_event_gameobject` SELECT 1, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+14;
diff --git a/sql/updates/world/3.3.5/2016_06_15_13_world_335.sql b/sql/updates/world/3.3.5/2016_06_15_13_world_335.sql
new file mode 100644
index 00000000000..b38b0ff1cb3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_13_world_335.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `gameobject_template` WHERE `entry` IN (181290);
+INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `AIName`, `ScriptName`, `VerifiedBuild`) VALUES
+(181290,6,0,'Midsummer Bonfire Spawn Trap','','','',0,0,1,0,0,0,28784,0,0,-1,0,0,0,0,0,0,'','',0);
diff --git a/sql/updates/world/3.3.5/2016_06_15_14_world.sql b/sql/updates/world/3.3.5/2016_06_15_14_world.sql
new file mode 100644
index 00000000000..410ae76253d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_14_world.sql
@@ -0,0 +1,27 @@
+-- Creature entry 20243, Scrapped Fel Reaver, Quest "It's a Fel Reaver, But with Heart"
+SET @FEL := 20243; -- Scrapped Fel Reaver
+SET @Zaxxis := 20287; -- Zaxxis Ambusher
+
+DELETE FROM `creature_text` WHERE `entry` = @FEL;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(@FEL,0,0,"The %s's mechanical heart begins to beat softly.",16,0,100,0,0,0,18271,0,"Scrapped Fel Reaver - Zapped Emote");
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` = @FEL AND `source_type` = 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@FEL,0, 0,1, 8, 0,100,0, 35282, 0, 0, 0, 19, 256, 0, 0, 0,0,0, 1, 0, 0, 0, 0, 0, 0, 0, "Scrapped Fel Reaver - On Spellhit 'Fel Zapper' - Remove Flags Immune To Players"),
+(@FEL,0, 1,2, 61, 0,100,0, 0, 0, 0, 0, 1, 0, 1000, 0, 0,0,0, 1, 0, 0, 0, 0, 0, 0, 0, "Scrapped Fel Reaver - On Spellhit 'Fel Zapper' - Say Line 0"),
+(@FEL,0, 2,0, 61, 0,100,0, 0, 0, 0, 0, 18, 131076, 0, 0, 0,0,0, 1, 0, 0, 0, 0, 0, 0, 0, "Scrapped Fel Reaver - On Spellhit 'Fel Zapper' - Set Flags Disable Movement & Pacified"),
+(@FEL,0, 3,0, 0, 0,100,0, 2000, 2000, 30000, 30000, 12,@Zaxxis, 2, 180000, 1,0,0, 8, 0, 0, 0, 2547.08, 3982.24, 131.39, 2.01, "Scrapped Fel Reaver - In Combat - Summon Creature 'Zaxxis Ambusher'"),
+(@FEL,0, 4,0, 0, 0,100,0, 17000, 17000, 45000, 45000, 12,@Zaxxis, 2, 180000, 1,0,0, 8, 0, 0, 0, 2537.70, 3975.96, 130.40, 1.58, "Scrapped Fel Reaver - In Combat - Summon Creature 'Zaxxis Ambusher'"),
+(@FEL,0, 5,0, 0, 0,100,0, 32000, 32000, 45000, 45000, 12,@Zaxxis, 2, 180000, 1,0,0, 8, 0, 0, 0, 2506.46, 4008.93, 133.80, 6.19, "Scrapped Fel Reaver - In Combat - Summon Creature 'Zaxxis Ambusher'"),
+(@FEL,0, 6,0, 0, 0,100,0, 60000, 60000, 45000, 45000, 12,@Zaxxis, 2, 180000, 1,0,0, 8, 0, 0, 0, 2537.30, 4027.11, 135.50, 4.30, "Scrapped Fel Reaver - In Combat - Summon Creature 'Zaxxis Ambusher'"),
+(@FEL,0, 7,0, 6, 0,100,0, 0, 0, 0, 0, 51, 0, 0, 0, 0,0,0, 9,@Zaxxis, 0, 150, 0, 0, 0, 0, "Scrapped Fel Reaver - On Just Died - Kill Target"),
+(@FEL,0, 8,0, 7, 0,100,0, 0, 0, 0, 0, 51, 0, 0, 0, 0,0,0, 9,@Zaxxis, 0, 150, 0, 0, 0, 0, "Scrapped Fel Reaver - On Evade - Kill Target"),
+(@FEL,0, 9,0, 11, 0,100,0, 0, 0, 0, 0, 75, 39311, 0, 0, 0,0,0, 1, 0, 0, 0, 0, 0, 0, 0, "Scrapped Fel Reaver - On Respawn - Add Aura 'Scrapped Fel Reaver Transform'");
+
+-- Creature entry 20287, Zaxxis Ambusher
+UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = @Zaxxis;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` = @Zaxxis AND `source_type` = 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Zaxxis,0, 0,0, 54, 0,100,0, 0,0,0,0, 49, 0,0,0,0,0,0, 21, 85, 0,0,0,0,0,0, 'Zaxxis Ambusher - On Just Summoned - Start Attacking');
diff --git a/sql/updates/world/3.3.5/2016_06_15_15_world_335.sql b/sql/updates/world/3.3.5/2016_06_15_15_world_335.sql
new file mode 100644
index 00000000000..34b28152f28
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_15_15_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `type_flags`=0 WHERE `entry` IN (33557,33555,33553,33556,33554,33657,33653,33307,33310,33650);
diff --git a/sql/updates/world/3.3.5/2016_06_16_00_world.sql b/sql/updates/world/3.3.5/2016_06_16_00_world.sql
new file mode 100644
index 00000000000..f6958ad4dc7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_16_00_world.sql
@@ -0,0 +1,16 @@
+-- delete frogger spawn locations from `creature`, move them to `creature_summon_groups`
+SET @FROGGER = 16027;
+DELETE FROM `creature` WHERE `id` = @FROGGER;
+DELETE FROM `creature_summon_groups` WHERE `summonerId`=533 AND `summonerType`=2;
+INSERT INTO `creature_summon_groups` (`summonerType`,`summonerId`,`groupId`,`entry`,`position_x`,`position_y`,`position_z`,`orientation`,`summonType`,`summonTime`) VALUES
+(2,533,0,@FROGGER,3175.281,-3134.764,293.4368,4.244924,3,7500),
+(2,533,1,@FROGGER,3154.581,-3126.18 ,293.5911,4.430199,3,7500),
+(2,533,2,@FROGGER,3128.622,-3119.604,293.4113,4.738929,3,7500);
+DELETE FROM `waypoint_data` WHERE `id` BETWEEN @FROGGER*10+0 AND @FROGGER*10+2;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`) VALUES
+(@FROGGER*10+0,1,3158.253,-3163.889,293.3027),
+(@FROGGER*10+1,1,3145.881,-3158.563,293.3215),
+(@FROGGER*10+2,1,3130.79 ,-3156.624,293.3239);
+DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN -76313 AND -76311 AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@FROGGER AND `source_type`=0 AND `id` BETWEEN 2 AND 5;
+UPDATE `creature_template` SET `unit_flags`=(`unit_flags`|256) WHERE `entry`=@FROGGER;
diff --git a/sql/updates/world/3.3.5/2016_06_17_00_world.sql b/sql/updates/world/3.3.5/2016_06_17_00_world.sql
new file mode 100644
index 00000000000..33094fd818a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_17_00_world.sql
@@ -0,0 +1,5 @@
+--
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (48778, 73313);
+INSERT INTO `spell_linked_spell` (`spell_trigger` ,`spell_effect`, `type`, `comment`) VALUES
+(48778, 50772, 0, 'Acherus Deathcharger - Summon Unholy Mount Visual'),
+(73313, 50772, 0, 'Crimson Deathcharger - Summon Unholy Mount Visual');
diff --git a/sql/updates/world/3.3.5/2016_06_18_00_world.sql b/sql/updates/world/3.3.5/2016_06_18_00_world.sql
new file mode 100644
index 00000000000..8135c5e64b0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_18_00_world.sql
@@ -0,0 +1,134 @@
+-- Fjord Hawk Matriarch
+UPDATE `creature_template` SET `InhabitType`='5' WHERE `entry`=24787;
+-- Pathing for Entry: 24787 'TDB FORMAT'
+SET @NPC := 115835;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=491.5974,`position_y`=-6158.39,`position_z`=144.1042 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '43775');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,491.5974,-6158.39,144.1042,0,0,1,0,100,0),
+(@PATH,2,509.5939,-6162.629,111.2709,0,0,1,0,100,0),
+(@PATH,3,526.574,-6162.785,95.60418,0,0,1,0,100,0),
+(@PATH,4,574.4791,-6163.997,95.60418,0,0,1,0,100,0),
+(@PATH,5,603.0228,-6169.135,135.1598,0,0,1,0,100,0),
+(@PATH,6,621.6965,-6158.342,152.5963,0,0,1,0,100,0),
+(@PATH,7,637.6,-6155.499,154.6354,0,0,1,0,100,0),
+(@PATH,8,663.0421,-6125.693,179.4132,0,0,1,0,100,0),
+(@PATH,9,656.72,-6138.115,215.4652,0,0,1,0,100,0),
+(@PATH,10,639.1322,-6143.215,215.4652,0,0,1,0,100,0),
+(@PATH,11,618.7733,-6150.35,208.0208,0,0,1,0,100,0),
+(@PATH,12,588.9388,-6145.327,208.0208,0,0,1,0,100,0),
+(@PATH,13,554.6487,-6152.367,187.5208,0,0,1,0,100,0),
+(@PATH,14,528.2413,-6138.124,166.6597,0,0,1,0,100,0),
+(@PATH,15,497.937,-6157.058,187.5208,0,0,1,0,100,0),
+(@PATH,16,482.7061,-6146.376,174.6875,0,0,1,0,100,0),
+(@PATH,17,491.5974,-6158.39,144.1042,0,0,1,0,100,0);
+
+-- Pathing for Entry: 24787 'TDB FORMAT'
+SET @NPC := 115836;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=520.6224,`position_y`=-6137.84,`position_z`=169.3022 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '43775');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,520.6224,-6137.84,169.3022,0,0,1,0,100,0),
+(@PATH,2,539.8384,-6131.232,149.1912,0,0,1,0,100,0),
+(@PATH,3,520.709,-6158.917,160.4134,0,0,1,0,100,0),
+(@PATH,4,485.8767,-6155.685,160.4134,0,0,1,0,100,0),
+(@PATH,5,438.8145,-6158.287,160.4134,0,0,1,0,100,0),
+(@PATH,6,419.3206,-6156.742,160.4134,0,0,1,0,100,0),
+(@PATH,7,390.6546,-6143.165,160.4134,0,0,1,0,100,0),
+(@PATH,8,377.2733,-6114.98,160.4134,0,0,1,0,100,0),
+(@PATH,9,383.0898,-6128.999,185.83,0,0,0,1,100,0),
+(@PATH,10,417.4906,-6154.904,185.83,0,0,1,0,100,0),
+(@PATH,11,452.2428,-6147.803,185.83,0,0,1,0,100,0),
+(@PATH,12,497.4655,-6150.674,185.83,0,0,1,0,100,0),
+(@PATH,13,520.6224,-6137.84,169.3022,0,0,1,0,100,0);
+
+-- Pathing for Entry: 24787 'TDB FORMAT'
+SET @NPC := 115837;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=596.8774,`position_y`=-6114.975,`position_z`=271.1343 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '43775');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,596.8774,-6114.975,271.1343,0,0,1,0,100,0),
+(@PATH,2,595.4591,-6109.405,278.3748,0,0,1,0,100,0),
+(@PATH,3,571.2776,-6109.743,290.4025,0,0,1,0,100,0),
+(@PATH,4,556.7193,-6108.814,297.3566,0,0,1,0,100,0),
+(@PATH,5,517.0029,-6104.844,297.3566,0,0,1,0,100,0),
+(@PATH,6,503.9214,-6117.692,297.3566,0,0,1,0,100,0),
+(@PATH,7,466.3313,-6107.801,271.1343,0,0,1,0,100,0),
+(@PATH,8,475.6375,-6120.523,271.1343,0,0,1,0,100,0),
+(@PATH,9,500.4033,-6130.543,271.1343,0,0,1,0,100,0),
+(@PATH,10,542.1522,-6114.92,271.1343,0,0,1,0,100,0),
+(@PATH,11,567.1166,-6129.524,271.1343,0,0,1,0,100,0),
+(@PATH,12,596.8774,-6114.975,271.1343,0,0,1,0,100,0);
+
+-- Pathing for Entry: 24787 'TDB FORMAT'
+SET @NPC := 115843;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=290.8945,`position_y`=-6070.151,`position_z`=84.36917 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '43775');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,290.8945,-6070.151,84.36917,0,0,1,0,100,0),
+(@PATH,2,273.076,-6034.628,84.36917,0,0,1,0,100,0),
+(@PATH,3,268.3575,-6009.71,121.8221,0,0,1,0,100,0),
+(@PATH,4,282.7736,-6034.701,150.6469,0,0,1,0,100,0),
+(@PATH,5,297.921,-6060.3,111.1191,0,0,1,0,100,0),
+(@PATH,6,324.4433,-6101.173,115.008,0,0,1,0,100,0),
+(@PATH,7,351.7174,-6115.625,115.008,0,0,1,0,100,0),
+(@PATH,8,380.059,-6146.51,102.4525,0,0,1,0,100,0),
+(@PATH,9,381.592,-6162.233,80.36916,0,0,1,0,100,0),
+(@PATH,10,363.2276,-6145.913,80.36916,0,0,1,0,100,0),
+(@PATH,11,338.3981,-6105.44,80.36916,0,0,1,0,100,0),
+(@PATH,12,319.2164,-6096.714,84.36917,0,0,1,0,100,0),
+(@PATH,13,290.8945,-6070.151,84.36917,0,0,1,0,100,0);
+
+-- Pathing for Entry: 24787 'TDB FORMAT'
+SET @NPC := 115845;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=360.9156,`position_y`=-6061.682,`position_z`=302.8403 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '43775');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,360.9156,-6061.682,302.8403,0,0,1,0,100,0),
+(@PATH,2,389.247,-6078.495,302.8403,0,0,1,0,100,0),
+(@PATH,3,392.2037,-6094.839,296.007,0,0,1,0,100,0),
+(@PATH,4,374.589,-6096.534,288.5903,0,0,1,0,100,0),
+(@PATH,5,358.6935,-6082.393,274.9237,0,0,1,0,100,0),
+(@PATH,6,338.8949,-6049.761,274.9237,0,0,1,0,100,0),
+(@PATH,7,320.3495,-6021.407,274.9237,0,0,1,0,100,0),
+(@PATH,8,306.0276,-5998.132,285.257,0,0,1,0,100,0),
+(@PATH,9,313.4884,-5983.751,285.2291,0,0,1,0,100,0),
+(@PATH,10,320.7385,-5972.151,286.1277,0,0,1,0,100,0),
+(@PATH,11,330.6828,-6007.996,302.8403,0,0,1,0,100,0),
+(@PATH,12,349.4529,-6033.62,302.8403,0,0,1,0,100,0),
+(@PATH,13,360.9156,-6061.682,302.8403,0,0,1,0,100,0);
+
+-- Pathing for Entry: 24787 'TDB FORMAT'
+SET @NPC := 115844;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=389.949,`position_y`=-6113.926,`position_z`=217.1557 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '43775');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,389.949,-6113.926,217.1557,0,0,1,0,100,0),
+(@PATH,2,365.9727,-6083.048,249.1279,0,0,1,0,100,0),
+(@PATH,3,348.9503,-6058.797,249.1279,0,0,1,0,100,0),
+(@PATH,4,334.4755,-6041.239,249.1279,0,0,1,0,100,0),
+(@PATH,5,306.4679,-6010.077,240.8223,0,0,1,0,100,0),
+(@PATH,6,305.4742,-6011.148,217.1557,0,0,1,0,100,0),
+(@PATH,7,308.0244,-6019.713,217.1557,0,0,1,0,100,0),
+(@PATH,8,331.7084,-6052.974,217.1557,0,0,1,0,100,0),
+(@PATH,9,350.9348,-6071.563,217.1557,0,0,1,0,100,0),
+(@PATH,10,371.7133,-6102.678,217.1557,0,0,1,0,100,0),
+(@PATH,11,389.949,-6113.926,217.1557,0,0,1,0,100,0);
diff --git a/sql/updates/world/3.3.5/2016_06_18_01_world.sql b/sql/updates/world/3.3.5/2016_06_18_01_world.sql
new file mode 100644
index 00000000000..1a9d8fbce85
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_18_01_world.sql
@@ -0,0 +1,8 @@
+DELETE FROM `conditions` WHERE `SourceEntry`=42490 AND `SourceTypeOrReferenceId`=13;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 42490, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, "", "Spell 'Energized!' targets players"),
+(13, 1, 42490, 0, 1, 31, 0, 3, 23832, 0, 0, 0, 0, "", "Spell 'Energized!' targets creature 'Zeppelin Power Core'");
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=-18587;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+('-18587','0','0','0','63','0','100','0','0','0','0','0','11','42491','2','0','0','0','0','1','0','0','0','0','0','0','0',"Zeppelin Power Core - On Reset - Cast 'Energized Periodic'");
diff --git a/sql/updates/world/3.3.5/2016_06_18_02_world.sql b/sql/updates/world/3.3.5/2016_06_18_02_world.sql
new file mode 100644
index 00000000000..7b49e7c25f3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_18_02_world.sql
@@ -0,0 +1,5 @@
+UPDATE `creature_template` SET `gossip_menu_id`=10497,`npcflag`=3 WHERE `entry`=34320;
+
+DELETE FROM `gossip_menu` WHERE `entry`=10497;
+INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
+(10497, 14527); -- 34320
diff --git a/sql/updates/world/3.3.5/2016_06_20_00_world.sql b/sql/updates/world/3.3.5/2016_06_20_00_world.sql
new file mode 100644
index 00000000000..d14f0042fa7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_20_00_world.sql
@@ -0,0 +1,3 @@
+--
+DELETE FROM `creature_queststarter` WHERE `quest` IN (6131, 6606);
+DELETE FROM `creature_questender` WHERE `quest`=6606;
diff --git a/sql/updates/world/3.3.5/2016_06_20_01_world.sql b/sql/updates/world/3.3.5/2016_06_20_01_world.sql
new file mode 100644
index 00000000000..eb8ebef9293
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_20_01_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `SpecialFlags`=0 WHERE `ID`=7846;
diff --git a/sql/updates/world/3.3.5/2016_06_20_02_world.sql b/sql/updates/world/3.3.5/2016_06_20_02_world.sql
new file mode 100644
index 00000000000..9bb24fa9b60
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_20_02_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `creature_loot_template` SET `Chance`=100 WHERE `Item` IN (5884, 11503, 29590);
+UPDATE `creature_loot_template` SET `Chance`=80 WHERE `Item`=31347;
diff --git a/sql/updates/world/3.3.5/2016_06_20_03_world.sql b/sql/updates/world/3.3.5/2016_06_20_03_world.sql
new file mode 100644
index 00000000000..3d94c0ace5f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_20_03_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template` SET `RewardNextQuest`=6610 WHERE `ID` IN (6611, 6612);
diff --git a/sql/updates/world/3.3.5/2016_06_20_04_world.sql b/sql/updates/world/3.3.5/2016_06_20_04_world.sql
new file mode 100644
index 00000000000..da0d6b05919
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_20_04_world.sql
@@ -0,0 +1,6 @@
+--
+SET @CGUID := 87945; -- 15 required
+SET @OGUID := 64102; -- 15 required
+
+DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+14 AND `eventEntry`=14;
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+14 AND `eventEntry`=14;
diff --git a/sql/updates/world/3.3.5/2016_06_22_00_world.sql b/sql/updates/world/3.3.5/2016_06_22_00_world.sql
new file mode 100644
index 00000000000..fd2d4d8743b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_22_00_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `creature_queststarter` WHERE `quest` IN (SELECT `quest` FROM `game_event_creature_quest`);
diff --git a/sql/updates/world/3.3.5/2016_06_22_01_world.sql b/sql/updates/world/3.3.5/2016_06_22_01_world.sql
new file mode 100644
index 00000000000..bf11bee736b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_22_01_world.sql
@@ -0,0 +1,5 @@
+--
+DELETE FROM `quest_template_addon` WHERE `ID` IN (9796, 10105);
+INSERT INTO `quest_template_addon` (`ID`, `ExclusiveGroup`) VALUES
+(9796, 9796),
+(10105, 9796);
diff --git a/sql/updates/world/3.3.5/2016_06_22_02_world.sql b/sql/updates/world/3.3.5/2016_06_22_02_world.sql
new file mode 100644
index 00000000000..f73b0f6a6f6
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_22_02_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `quest_template_addon` SET `NextQuestId`=10389, `ExclusiveGroup`=-10392 WHERE `ID` IN (10392, 10393);
+UPDATE `quest_template_addon` SET `PrevQuestId`=0 WHERE `ID`=10389;
diff --git a/sql/updates/world/3.3.5/2016_06_22_03_world.sql b/sql/updates/world/3.3.5/2016_06_22_03_world.sql
new file mode 100644
index 00000000000..5c7b71e479a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_22_03_world.sql
@@ -0,0 +1,3321 @@
+-- Hordes's Honor the Flame quests full data support + spawned missing camps/or individual gameojbect and npcs, also corrected creature_templates/
+UPDATE `gameobject_template` SET `data2`=5 WHERE `entry`=181376; -- makes bonfires hit with little fire on right range in when jump to it /was too little before/
+-- Add missing creature_quesrelation and involvedrealation that were blocking quests
+-- The Flame Keeper of Kalimdor - {Achievement=1026}
+DELETE FROM `creature_queststarter` WHERE `quest` IN (11846,11845,11852,11839,11859,11841,11849,11861,11847);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(25929, 11846), -- Durotar
+(25928, 11845), -- Desolace
+(25936, 11852), -- Mulgore
+(25922, 11839), -- Winterspring
+(25943, 11859), -- Barrens
+(25932, 11849), -- Feralas
+(25884, 11841), -- Ashenvale
+(25930, 11847), -- Dustwallow marsh
+(25945, 11861); -- Thousand Needles
+UPDATE `quest_template` SET `AllowableRaces`=690 WHERE `ID` IN (11846, 11852, 11859, 11838, 11841, 11839, 11845, 11861, 11849, 11847, 11836, 11856);
+-- The Flame Keeper of Outland - {Achievement=1027}
+DELETE FROM `creature_queststarter` WHERE `quest` IN (11851,11855,11835,11858,11863,11821,11854);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(25934, 11851), -- Hellfire Peninsula
+(25938, 11855), -- Shadowmoon Valley
+(25918, 11835), -- Netherstorm
+(25942, 11858), -- Terokkar
+(25947, 11863), -- Zangarmarsh
+(25937, 11854); -- Nagrand
+UPDATE `quest_template` SET `AllowableRaces`=690 WHERE `ID` IN (11851, 11855, 11854, 11835, 11843, 11858, 11863);
+-- Flame Keeper of Northrend
+UPDATE `quest_template` SET `AllowableRaces`=690 WHERE `ID` IN (13500,13493,13494,13495,13496,13497,13498,13499);
+DELETE FROM `creature_queststarter` WHERE `quest` IN (13500,13493,13494,13495,13496,13497,13498,13499);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(32816, 13500), -- Zul'Drak
+(32809, 13493), -- Borean Tundra
+(32810, 13494), -- Sholazar Basin
+(32811, 13495), -- Dragonblight
+(32815, 13499), -- Crystalsong Forest
+(32814, 13498), -- Storm Peaks
+(32813, 13497), -- Grizzly Hills
+(32812, 13496); -- Howling Fjords
+UPDATE `quest_template` SET `AllowableRaces`=690 WHERE `ID` IN (13500, 13493, 13494, 13495, 13499, 13498, 13497, 13496);
+-- Flame Keeper of Eastern Kingdom? {Achievement=1025}
+UPDATE `quest_template` SET `AllowableRaces`=690 WHERE `ID` IN (11850,11848,11853,11857,11837,11844,11860,11584,11862,11842,11840);
+DELETE FROM `creature_queststarter` WHERE `quest` IN (11850,11848,11853,11857,11837,11844,11860,11584,11862,11842,11840);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(25933, 11850), -- Ghostland
+(25931, 11848), -- Eversong woods
+(25935, 11853), -- Hillsbrad Foothills
+(25941, 11857), -- Swamp of sorrows
+(25920, 11837), -- Cape of Stranglethorn
+(25927, 11844), -- Burning Steppes
+(25944, 11860), -- The Hinterlands
+(25939, 11584), -- Silverpine Forest
+(25946, 11862), -- Tirisfal Glades
+(25925, 11842), -- Badlands
+(25923, 11840); -- Arathi Highlands
+UPDATE `quest_template` SET `AllowableRaces`=690 WHERE `ID` IN (11850, 11848, 11853, 11857, 11837, 11844, 11860, 11584, 11862, 11842, 11840);
+
+-- Add missing camps, npcs, gobject in general, corrected npc data for Horde/Kalimdor,Eastern Kingdoms,Outland/
+-- The ids below are deleting duplicate doubles spawns from Tanaris horde fire camp and reuse the guids to recreate another one + few extra objects
+-- Update creature_template for some creatures
+UPDATE `creature_template` SET `faction`=35 WHERE `entry`=16781; -- the celebrants should be friendly to all, ignore the 17++ faction it is a blizzard bug
+UPDATE `creature_template` SET `minlevel`=30,`maxlevel`=30,`faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25929); -- Durotar
+UPDATE `creature_template` SET `minlevel`=20,`maxlevel`=20,`faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25936); -- Mulgore
+UPDATE `creature_template` SET `minlevel`=25,`maxlevel`=25,`faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25946,25931); -- Tirisfal Glades and Eversong Woods
+UPDATE `creature_template` SET `minlevel`=30,`maxlevel`=30,`faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25933); -- Ghostlands
+UPDATE `creature_template` SET `minlevel`=74,`maxlevel`=74,`faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32811); -- Dragonblight
+UPDATE `creature_template` SET `minlevel`=75,`maxlevel`=75,`faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32813); -- Grizzly Hills
+UPDATE `creature_template` SET `minlevel`=72,`maxlevel`=72,`faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32812); -- Howling Fjord
+UPDATE `creature_template` SET `minlevel`=77,`maxlevel`=77,`faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32816); -- Zul'Drak
+-- Add npcs for the Midsummer Festival Camp in Mulgore
+DELETE FROM `creature` WHERE `guid` IN (94696,94723,94698,94724,94513,86426,94792,127358); -- Remove double spawned unused npc from Tanaris horde fire camp
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(94696, 16781, 1, 1, 1, 16446, 0, -2336.91, -619.347, -7.48957, 1.3426, 300, 0, 0, 3942, 0, 0, 0, 0, 0),
+(94723, 16781, 1, 1, 1, 16438, 0, -2333.01, -607.47, -8.5825, 4.26458, 300, 0, 0, 3427, 0, 0, 0, 0, 0),
+(94698, 16781, 1, 1, 1, 16445, 0, -2336.15, -605.978, -8.47793, 5.03898, 300, 0, 0, 3834, 0, 0, 0, 0, 0),
+(94724, 16781, 1, 1, 1, 16438, 0, -2336.28, -611.022, -8.02869, 1.1973, 300, 0, 0, 2138, 0, 0, 0, 0, 0),
+(94513, 25994, 1, 1, 1, 0, 1, -2344.99, -615.533, -7.06313, 0.976602, 300, 0, 0, 2871, 0, 0, 0, 0, 0),
+(86426, 25936, 1, 1, 1, 0, 0, -2321.77, -614.483, -9.27059, 5.80089, 300, 0, 0, 484, 0, 0, 0, 0, 0);
+-- Add objects for the Midsummer Festival Camp in Mulgore
+DELETE FROM `gameobject` WHERE `guid` IN (51596,52357,50996,50855,50750,50747,52277,52467,51350,50692,52548,52284,51349,6537,6538,6539);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(51596, 181355, 1, 1, 1, -2335.13, -621.407, -7.62503, 5.5, 0, 0, 0.414693, 0.909961, 180, 100, 1),
+(52357, 188020, 1, 1, 1, -2327.16, -631.314, -8.68343, 5.5, 0, 0, 0.398749, 0.91706, 180, 100, 1),
+(50996, 181605, 1, 1, 1, -2342.39, -609.245, -7.76984, 5.5, 0, 0, 0.25038, -0.968148, 0, 100, 1),
+(50855, 181306, 1, 1, 1, -2323.77, -610.206, -9.16689, 5.5, 0, 0, 0.843391, 0.5373, 180, 100, 1),
+(50750, 181302, 1, 1, 1, -2326.25, -610.633, -8.98158, 1.58409, 0, 0, 0.711791, 0.702392, 180, 100, 1),
+(50747, 181302, 1, 1, 1, -2325.28, -608.627, -9.18096, 1.58409, 0, 0, 0.711791, 0.702392, 180, 100, 1),
+(52277, 188020, 1, 1, 1, -2318.53, -608.976, -9.42005, 5.5, 0, 0, 0.469472, 0.882948, 180, 100, 1),
+(52467, 188021, 1, 1, 1, -2326.65, -613.461, -8.78372, 1.19925, 0, 0, 0.564334, 0.825546, 180, 100, 1),
+(51350, 181355, 1, 1, 1, -2330.4, -606.562, -8.87822, 5.5, 0, 0, 0.414693, 0.909961, 180, 100, 1),
+(50692, 187965, 1, 1, 1, -2329.42, -624.806, -8.27507, 5.5, 0, 0, 0.766044, -0.642788, 0, 100, 1),
+(52548, 181376, 1, 1, 1, -2329.42, -624.806, -6.27507, 5.5, 0, 0, -0.34202, 0.939693, 180, 0, 1),
+(52284, 188020, 1, 1, 1, -2337.14, -602.794, -8.71659, 5.5, 0, 0, 0.477159, 0.878817, 180, 100, 1),
+(51349, 181355, 1, 1, 1, -2320.03, -612.344, -9.38502, 5.5, 0, 0, 0.21644, -0.976296, 180, 100, 1),
+(6537, 188020, 1, 1, 1, -2348.37, -615.991, -6.85173, 5.82288, 0, 0, 0.228128, -0.973631, 300, 0, 1),
+(6538, 181305, 1, 1, 1, -2330.42, -611.458, -8.53482, 6.06204, 0, 0, 0.110346, -0.993893, 300, 0, 1),
+(6539, 181307, 1, 1, 1, -2330.98, -609.979, -7.54302, 5.68898, 0, 0, 0.292752, -0.956188, 300, 0, 1);
+-- Fix few Burning Steppes camp objects and npcs
+DELETE FROM `gameobject` WHERE `guid` IN (52517,50934,12654,12655); -- fix pavilion, mug, table and crate
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(52517, 188021, 0, 1, 1, -7596.67, -2079.81, 125.968, 3.20786, 0, 0, 0.999451, -0.0331301, 180, 100, 1),
+(50934, 181307, 0, 1, 1, -7591.5, -2080.49, 126.518, 0.593412, 0, 0, 0.292372, 0.956305, 180, 100, 1),
+(12654, 181305, 0, 1, 1, -7591.14, -2081, 125.519, 3.49137, 0, 0, 0.984746, -0.174, 300, 0, 1),
+(12655, 181302, 0, 1, 1, -7594.62, -2076.47, 126.604, 3.71993, 0, 0, 0.958482, -0.285154, 300, 0, 1);
+-- Fix Tirisfal Glade Flamekeeper orientation
+DELETE FROM `creature` WHERE `guid` IN (202758);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(202758, 25946, 0, 1, 1, 0, 0, 2278.37, 447.68, 34.0328, 3.14884, 120, 0, 0, 1, 0, 0, 0, 0, 0);
+-- Add missing objects in Badlands camp
+DELETE FROM `gameobject` WHERE `guid` IN (12656,12657,12658);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(12656, 181355, 0, 1, 1, -6685.84, -2205.18, 249.466, 3.56287, 0, 0, 0.977897, -0.209085, 300, 0, 1),
+(12657, 181355, 0, 1, 1, -6685.35, -2190.66, 247.391, 4.19511, 0, 0, 0.864441, -0.502734, 300, 0, 1),
+(12658, 181355, 0, 1, 1, -6710.1, -2202.15, 248.991, 6.13819, 0, 0, 0.0724366, -0.997373, 300, 0, 1);
+-- Add missing pavilion in Hillsbrad Foothills
+DELETE FROM `gameobject` WHERE `guid` IN (21499);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(21499, 188021, 0, 1, 1, -140.643, -811.518, 55.3504, 2.31117, 0, 0, 0.915031, 0.403384, 300, 0, 1);
+-- Add whole missing camp in Shadowmoon valley and remove doubles spawns from Stranglethorn one
+UPDATE `creature_template` SET `minlevel`=40,`maxlevel`=40,`faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25938); -- Shadowmoon Valley Flamekeeper
+DELETE FROM `gameobject` WHERE `guid` IN (51791,50690,52560,52333,52329,52511,50740,50741,50869,52399,52334,21500,21501,21502,21503,21504,21505);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(51791, 188021, 530, 1, 1, -3065.99, 2385.69, 62.3736, 2.08047, 0, 0, 0.862523, 0.506019, 300, 0, 1),
+(50690, 188020, 530, 1, 1, -3045.07, 2384.62, 62.3369, 3.34888, 0, 0, 0.994634, -0.10346, 300, 0, 1),
+(52560, 181605, 530, 1, 1, -3045.53, 2393.71, 61.5344, 3.48476, 0, 0, 0.985316, -0.170741, 300, 0, 1),
+(52333, 181355, 530, 1, 1, -3051.54, 2384.15, 62.8406, 3.5845, 0, 0, 0.975579, -0.21965, 300, 0, 1),
+(52329, 181376, 530, 1, 1, -3059.17, 2374.85, 65.1011, 2.03334, 0, 0, 0.850361, 0.526199, 300, 0, 1),
+(52511, 187967, 530, 1, 1, -3059.17, 2374.85, 63.1011, 2.03334, 0, 0, 0.850361, 0.526199, 300, 0, 1),
+(50740, 188020, 530, 1, 1, -3082.82, 2371.64, 62.3845, 0.325101, 0, 0, 0.161836, 0.986818, 300, 0, 1),
+(50741, 181305, 530, 1, 1, -3067.53, 2387.47, 62.1022, 2.2666, 0, 0, 0.905816, 0.423671, 300, 0, 1),
+(50869, 181307, 530, 1, 1, -3066.21, 2387.82, 63.0923, 2.58076, 0, 0, 0.96094, 0.276755, 300, 0, 1),
+(52399, 181306, 530, 1, 1, -3061.06, 2385.06, 62.9053, 3.68032, 0, 0, 0.963941, -0.266117, 300, 0, 1),
+(52334, 181302, 530, 1, 1, -3062.49, 2384.41, 62.8574, 3.88531, 0, 0, 0.931654, -0.363346, 300, 0, 1),
+(21500, 181302, 530, 1, 1, -3062.11, 2386.29, 62.7605, 3.23892, 0, 0, 0.998816, -0.0486467, 300, 0, 1),
+(21501, 181355, 530, 1, 1, -3083.01, 2388.64, 62.5579, 5.67117, 0, 0, 0.301252, -0.953545, 300, 0, 1),
+(21502, 181355, 530, 1, 1, -3075.49, 2375.19, 61.7323, 5.22193, 0, 0, 0.506076, -0.862489, 300, 0, 1),
+(21503, 181355, 530, 1, 1, -3065.87, 2401.47, 61.8687, 5.24138, 0, 0, 0.497663, -0.86737, 300, 0, 1),
+(21504, 188020, 530, 1, 1, -3088.61, 2389.5, 61.8999, 0.53056, 0, 0, 0.26218, 0.965019, 300, 0, 1),
+(21505, 188020, 530, 1, 1, -3062.43, 2404.35, 61.4089, 3.57398, 0, 0, 0.976721, -0.214514, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (94710,94518,94656,94694,11001,11002, 127362);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(94710, 25938, 530, 1, 1, 0, 0, -3069.81, 2382.73, 61.8417, 3.90071, 300, 0, 0, 42, 0, 0, 0, 0, 0),
+(94518, 16781, 530, 1, 1, 21085, 0, -3061.44, 2392.12, 62.0978, 0.0381287, 300, 0, 0, 3834, 0, 0, 0, 0, 0),
+(94656, 16781, 530, 1, 1, 16438, 0, -3058.96, 2387.94, 62.7011, 1.21073, 300, 0, 0, 2292, 0, 0, 0, 0, 0),
+(94694, 16781, 530, 1, 1, 16443, 0, -3055.48, 2394.64, 61.4168, 3.79155, 300, 0, 0, 1716, 0, 0, 0, 0, 0),
+(11001, 16781, 530, 1, 1, 16432, 0, -3047.02, 2383.16, 62.5462, 2.35427, 300, 0, 0, 3427, 0, 0, 0, 0, 0),
+(11002, 25994, 530, 1, 1, 0, 1, -3050.94, 2390.53, 61.9839, 0.536069, 300, 0, 0, 2453, 0, 0, 0, 0, 0);
+-- Add missing Blade's Edge camp
+UPDATE `creature_template` SET `minlevel`=65,`maxlevel`=65,`faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25926); -- Blade's Edge Flamekeeper
+DELETE FROM `gameobject` WHERE `guid` BETWEEN 65164 AND 65180;
+
+DELETE FROM `gameobject` WHERE `guid` IN (65169,65165,21498,21496,21480,21479,21478,21481, 21494, 21495, 21484, 21482, 21497);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(65164, 188021, 530, 1, 1, 2297.41, 6129.3, 135.503, 2.66739, 0, 0, 0.972023, 0.234886, 300, 0, 1),
+(65166, 181355, 530, 1, 1, 2267.92, 6124.56, 137.287, 6.13852, 0, 0, 0.0722688, -0.997385, 300, 0, 1),
+(65167, 181376, 530, 1, 1, 2282.43, 6134.5, 136.337, 6.01364, 0, 0, 0.134365, -0.990932, 300, 0, 1),
+(65168, 187955, 530, 1, 1, 2282.43, 6134.5, 136.337, 6.01364, 0, 0, 0.134365, -0.990932, 300, 0, 1),
+(65170, 181355, 530, 1, 1, 2271.19, 6164.05, 138.481, 5.89111, 0, 0, 0.194785, -0.980846, 300, 0, 1),
+(65171, 188020, 530, 1, 1, 2311.24, 6163.44, 135.095, 3.22861, 0, 0, 0.999054, -0.0434958, 300, 0, 1),
+(65172, 181355, 530, 1, 1, 2308.2, 6167.38, 135.411, 3.45245, 0, 0, 0.987945, -0.154804, 300, 0, 1),
+(65173, 188020, 530, 1, 1, 2314.15, 6140.14, 134.04, 3.13044, 0, 0, 0.999984, 0.00557797, 300, 0, 1),
+(65174, 181355, 530, 1, 1, 2311.99, 6135.23, 134.223, 2.95765, 0, 0, 0.995774, 0.0918422, 300, 0, 1),
+(65175, 181605, 530, 1, 1, 2286.62, 6163.9, 136.412, 4.79359, 0, 0, 0.677824, -0.735224, 300, 0, 1),
+(65176, 181305, 530, 1, 1, 2301.15, 6129.99, 135.447, 3.79771, 0, 0, 0.94667, -0.322204, 300, 0, 1),
+(65177, 181307, 530, 1, 1, 2302.43, 6129.19, 136.444, 0.67575, 0, 0, 0.331483, 0.943461, 300, 0, 1),
+(65178, 181302, 530, 1, 1, 2293.44, 6127.34, 135.515, 0.934927, 0, 0, 0.450623, 0.892714, 300, 0, 1),
+(65179, 181302, 530, 1, 1, 2295.65, 6126.58, 135.553, 0.663179, 0, 0, 0.325546, 0.945526, 300, 0, 1),
+(65180, 181306, 530, 1, 1, 2293.88, 6125.2, 135.587, 0.923931, 0, 0, 0.445708, 0.895178, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (209666,209667,209668,209669,209670,209673,209675, 127367);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(209666, 16781, 530, 1, 1, 16444, 0, 2269.74, 6134.05, 137.055, 6.04866, 300, 0, 0, 2699, 0, 0, 0, 0, 0),
+(209667, 16781, 530, 1, 1, 16442, 0, 2271.41, 6128.35, 137.214, 0.679679, 300, 0, 0, 1990, 0, 0, 0, 0, 0),
+(209668, 16781, 530, 1, 1, 21085, 0, 2271.34, 6158.77, 138.457, 0.683606, 300, 0, 0, 2371, 0, 0, 0, 0, 0),
+(209669, 16781, 530, 1, 1, 16436, 0, 2300.8, 6167.7, 136.322, 5.55072, 300, 0, 0, 1651, 0, 0, 0, 0, 0),
+(209670, 16781, 530, 1, 1, 21086, 0, 2304.68, 6161.6, 134.924, 1.72976, 300, 0, 0, 2062, 0, 0, 0, 0, 0),
+(209673, 25994, 530, 1, 1, 0, 1, 2279.56, 6162.76, 137.703, 0.112621, 300, 0, 0, 2961, 0, 0, 0, 0, 0),
+(209675, 25926, 530, 1, 1, 0, 0, 2298.33, 6134.3, 135.674, 1.15799, 300, 0, 0, 42, 0, 0, 0, 0, 0);
+-- Add missing Netherstorm camp
+UPDATE `creature_template` SET `minlevel`=70,`maxlevel`=70, `faction`=83,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25918); -- Netherstorm
+DELETE FROM `gameobject` WHERE `guid` IN (164459,164460,164461,164462,164463,164464,164466,164468,164470,164473,164474,164476,164479,164480,164481,164482,164483);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164459, 188021, 530, 1, 1, 2930.82, 3700.62, 143.562, 2.68546, 0, 0, 0.974105, 0.226094, 300, 0, 1),
+(164460, 188020, 530, 1, 1, 2939, 3710.42, 143.775, 5.91502, 0, 0, 0.183045, -0.983104, 300, 0, 1),
+(164461, 188020, 530, 1, 1, 2929.71, 3714.03, 144.258, 5.84826, 0, 0, 0.215752, -0.976448, 300, 0, 1),
+(164462, 188020, 530, 1, 1, 2926.49, 3680.92, 143.656, 5.85611, 0, 0, 0.211916, -0.977288, 300, 0, 1),
+(164463, 188020, 530, 1, 1, 2914.81, 3686.23, 144.3, 5.85611, 0, 0, 0.211916, -0.977288, 300, 0, 1),
+(164464, 181355, 530, 1, 1, 2916.61, 3688.95, 144.099, 5.95036, 0, 0, 0.165644, -0.986186, 300, 0, 1),
+(164466, 181355, 530, 1, 1, 2936.48, 3709.34, 143.92, 1.22619, 0, 0, 0.575402, 0.817871, 300, 0, 1),
+(164468, 181355, 530, 1, 1, 2930.48, 3712.12, 144.464, 5.82155, 0, 0, 0.228773, -0.97348, 300, 0, 1),
+(164470, 181355, 530, 1, 1, 2924.86, 3684.41, 143.645, 5.79079, 0, 0, 0.243717, -0.969846, 300, 0, 1),
+(164473, 181376, 530, 1, 1, 2921.26, 3690.47, 145.838, 5.94709, 0, 0, 0.167258, -0.985913, 300, 0, 1),
+(164474, 187949, 530, 1, 1, 2922.17, 3690.15, 143.809, 5.94709, 0, 0, 0.167258, -0.985913, 300, 0, 1),
+(164476, 181605, 530, 1, 1, 2917.63, 3677.32, 144.166, 1.11217, 0, 0, 0.527867, 0.849327, 300, 0, 1),
+(164479, 181305, 530, 1, 1, 2929.17, 3694.77, 143.652, 3.48177, 0, 0, 0.98557, -0.169269, 300, 0, 1),
+(164480, 181307, 530, 1, 1, 2927.52, 3695.79, 144.646, 6.06337, 0, 0, 0.109686, -0.993966, 300, 0, 1),
+(164481, 181302, 530, 1, 1, 2934.2, 3699.41, 143.281, 5.29132, 0, 0, 0.475852, -0.879525, 300, 0, 1),
+(164482, 181302, 530, 1, 1, 2932.66, 3699.09, 143.42, 3.97499, 0, 0, 0.91443, -0.404745, 300, 0, 1),
+(164483, 181306, 530, 1, 1, 2933.35, 3701.68, 143.353, 4.69363, 0, 0, 0.713707, -0.700444, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (209925,209926,209927,209928,209929,209930, 127369);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(209925, 25918, 530, 1, 1, 0, 0, 2927.71, 3702.01, 143.705, 2.80239, 300, 0, 0, 42, 0, 0, 0, 0, 0),
+(209926, 16781, 530, 1, 1, 16432, 0, 2933.41, 3708.45, 144.048, 5.94399, 300, 0, 0, 3624, 0, 0, 0, 0, 0),
+(209927, 16781, 530, 1, 1, 16431, 0, 2935.32, 3705.25, 143.374, 1.8505, 300, 0, 0, 2371, 0, 0, 0, 0, 0),
+(209928, 16781, 530, 1, 1, 16442, 0, 2917.5, 3683.52, 144.197, 0.0558533, 300, 0, 0, 1524, 0, 0, 0, 0, 0),
+(209929, 16781, 530, 1, 1, 16436, 0, 2922.56, 3684.94, 143.823, 3.96478, 300, 0, 0, 3624, 0, 0, 0, 0, 0),
+(209930, 25994, 530, 1, 1, 0, 0, 2919.92, 3676.76, 144.123, 1.41695, 300, 0, 0, 1848, 0, 0, 0, 0, 0);
+-- Northrend
+-- Add Borean tundra camp
+DELETE FROM `gameobject` WHERE `guid` IN (164507,164509,164510,164511,164512,164513,164514,164515,164515,164516,164517,164518,164519,164520,164521,164522,164524,164525);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164507, 188021, 571, 1, 1, 4454.99, 5625.29, 56.8959, 4.29074, 0, 0, 0.839423, -0.543479, 300, 0, 1),
+(164509, 188020, 571, 1, 1, 4425.93, 5623.18, 54.1981, 1.06747, 0, 0, 0.508751, 0.860913, 300, 0, 1),
+(164510, 188020, 571, 1, 1, 4438.21, 5646.36, 59.8882, 4.28367, 0, 0, 0.841339, -0.540508, 300, 0, 1),
+(164511, 188020, 571, 1, 1, 4476.71, 5632.46, 60.6755, 4.46182, 0, 0, 0.789922, -0.613208, 300, 0, 1),
+(164512, 188020, 571, 1, 1, 4470.92, 5609.85, 56.8847, 4.46182, 0, 0, 0.789922, -0.613208, 300, 0, 1),
+(164513, 181605, 571, 1, 1, 4470.25, 5621.62, 58.661, 1.19849, 0, 0, 0.56402, 0.825761, 300, 0, 1),
+(164514, 181355, 571, 1, 1, 4472.86, 5630.19, 59.8352, 4.29296, 0, 0, 0.838819, -0.54441, 300, 0, 1),
+(164515, 181355, 571, 1, 1, 4468.37, 5613.21, 57.1389, 1.30374, 0, 0, 0.606674, 0.794951, 300, 0, 1),
+(164516, 181355, 571, 1, 1, 4429.57, 5625.52, 54.9768, 1.37443, 0, 0, 0.634385, 0.773017, 300, 0, 1),
+(164517, 181355, 571, 1, 1, 4438.18, 5641.68, 58.4478, 1.00136, 0, 0, 0.480023, 0.877256, 300, 0, 1),
+(164518, 194033, 571, 1, 1, 4441.05, 5627.71, 56.3487, 4.54665, 0, 0, 0.763211, -0.646149, 300, 0, 1),
+(164519, 181376, 571, 1, 1, 4441.05, 5627.71, 58.3487, 4.69194, 0, 0, 0.714298, -0.699841, 300, 0, 1),
+(164520, 181305, 571, 1, 1, 4457.34, 5627.04, 57.2747, 0.298436, 0, 0, 0.148665, 0.988888, 300, 0, 1),
+(164521, 181307, 571, 1, 1, 4457.69, 5628.67, 58.2895, 4.7218, 0, 0, 0.703772, -0.710426, 300, 0, 1),
+(164522, 181302, 571, 1, 1, 4450.11, 5628.14, 56.7657, 1.65482, 0, 0, 0.73618, 0.676786, 300, 0, 1),
+(164524, 181302, 571, 1, 1, 4451.86, 5626.77, 56.7422, 0.725691, 0, 0, 0.354936, 0.934891, 300, 0, 1),
+(164525, 181306, 571, 1, 1, 4450.1, 5626.02, 56.6652, 1.32259, 0, 0, 0.614141, 0.789196, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (210411,210412,210413,210414,210415,210416,210420, 127341);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(210411, 16781, 571, 1, 1, 16438, 0, 4464.65, 5615.53, 56.9756, 0.761036, 300, 0, 0, 3427, 0, 0, 0, 0, 0),
+(210412, 16781, 571, 1, 1, 16443, 0, 4463.64, 5619.44, 57.2937, 0.348702, 300, 0, 0, 3237, 0, 0, 0, 0, 0),
+(210413, 16781, 571, 1, 1, 16432, 0, 4468.31, 5631.88, 59.2365, 4.61106, 300, 0, 0, 2292, 0, 0, 0, 0, 0),
+(210414, 16781, 571, 1, 1, 16438, 0, 4431.68, 5629.68, 55.7222, 0.687992, 300, 0, 0, 3144, 0, 0, 0, 0, 0),
+(210415, 16781, 571, 1, 1, 16444, 0, 4437.48, 5636.46, 57.3127, 4.94564, 300, 0, 0, 3524, 0, 0, 0, 0, 0),
+(210416, 25994, 571, 1, 1, 0, 0, 4469.26, 5627.85, 59.0877, 4.69872, 300, 0, 0, 2138, 0, 0, 0, 0, 0),
+(210420, 32809, 571, 1, 1, 0, 0, 4451.59, 5621.71, 56.6329, 4.04133, 300, 0, 0, 9610, 0, 0, 0, 0, 0);
+-- Add Dragonblight camp
+DELETE FROM `gameobject` WHERE `guid` IN (164527,164528,164529,164530,164531,164532,164534,164535,164536,164537,164538,164539,164540,165334);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164527, 188021, 571, 1, 1, 3776.27, 1479.31, 91.7672, 3.0495, 0, 0, 0.99894, 0.0460317, 300, 0, 1),
+(164528, 188020, 571, 1, 1, 3773.6, 1491.79, 90.9616, 4.7656, 0, 0, 0.688046, -0.725667, 300, 0, 1),
+(164529, 188020, 571, 1, 1, 3779.89, 1492.12, 90.4649, 4.7656, 0, 0, 0.688046, -0.725667, 300, 0, 1),
+(164530, 181355, 571, 1, 1, 3778.33, 1469.59, 92.0022, 4.64779, 0, 0, 0.729573, -0.683903, 300, 0, 1),
+(164531, 181355, 571, 1, 1, 3771.26, 1470.33, 92.3044, 1.40802, 0, 0, 0.64728, 0.762252, 300, 0, 1),
+(164532, 194037, 571, 1, 1, 3773.85, 1464.02, 92.4174, 6.10863, 0, 0, 0.087167, -0.996194, 300, 0, 1),
+(164534, 181376, 571, 1, 1, 3773.85, 1464.02, 94.4174, 6.10863, 0, 0, 0.087167, -0.996194, 300, 0, 1),
+(164535, 181305, 571, 1, 1, 3781.69, 1479.45, 91.1799, 3.55216, 0, 0, 0.979003, -0.203846, 300, 0, 1),
+(164536, 181307, 571, 1, 1, 3781.29, 1478.05, 92.1919, 4.88734, 0, 0, 0.642628, -0.766178, 300, 0, 1),
+(164537, 181302, 571, 1, 1, 3777.92, 1483, 91.6054, 3.43435, 0, 0, 0.989306, -0.145857, 300, 0, 1),
+(164538, 181302, 571, 1, 1, 3776.35, 1482.86, 91.7922, 4.69099, 0, 0, 0.714632, -0.699501, 300, 0, 1),
+(164539, 181306, 571, 1, 1, 3777.17, 1481, 91.7202, 2.13923, 0, 0, 0.877016, 0.480461, 300, 0, 1),
+(164540, 181605, 571, 1, 1, 3776.57, 1488.67, 91.3695, 0.109765, 0, 0, 0.0548551, 0.998494, 300, 0, 1),
+(165334, 181358, 571, 1, 1, 3807.96, 1478.17, 90.0332, 3.09271, 0, 0, 0.999701, 0.0244413, 300, 0, 1); -- hanging decoration
+DELETE FROM `creature` WHERE `guid` IN (210425,210426,210427,210428,210429,127344);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(210425, 25994, 571, 1, 1, 0, 1, 3779.24, 1486.12, 91.2991, 1.70099, 300, 0, 0, 2699, 0, 0, 0, 0, 0),
+(210426, 16781, 571, 1, 1, 16436, 0, 3769.56, 1489.51, 91.3562, 6.25787, 300, 0, 0, 3052, 0, 0, 0, 0, 0),
+(210427, 16781, 571, 1, 1, 16432, 0, 3769.51, 1485.73, 92.0116, 0.944649, 300, 0, 0, 3728, 0, 0, 0, 0, 0),
+(210428, 16781, 571, 1, 1, 16443, 0, 3781.98, 1488.53, 90.6925, 3.65584, 300, 0, 0, 3524, 0, 0, 0, 0, 0),
+(210429, 32811, 571, 1, 1, 0, 0, 3771.49, 1478.74, 92.3424, 3.16654, 300, 0, 0, 42, 0, 0, 0, 0, 0);
+-- Add Grizzly Hills camp
+DELETE FROM `gameobject` WHERE `guid` IN (164564,164565,164566,164567,164568,164571,164572,164573,164575,164577,164577,164578,164579,164580,164581,164582,164583,164584, 127348);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164564, 188021, 571, 1, 1, 3367.71, -2126.35, 124.935, 0.20145, 0, 0, 0.100555, 0.994932, 300, 0, 1),
+(164565, 188020, 571, 1, 1, 3378.53, -2152.36, 124.326, 1.7272, 0, 0, 0.760187, 0.649704, 300, 0, 1),
+(164566, 188020, 571, 1, 1, 3364.78, -2153.98, 124.066, 1.67615, 0, 0, 0.743357, 0.668895, 300, 0, 1),
+(164567, 188020, 571, 1, 1, 3368.13, -2094.44, 122.167, 4.85309, 0, 0, 0.655653, -0.755062, 300, 0, 1),
+(164568, 188020, 571, 1, 1, 3358.46, -2095.84, 122.702, 4.85702, 0, 0, 0.65417, -0.756348, 300, 0, 1),
+(164571, 181355, 571, 1, 1, 3360.44, -2102.71, 123.301, 4.93556, 0, 0, 0.623972, -0.781447, 300, 0, 1),
+(164572, 181355, 571, 1, 1, 3366.44, -2142.59, 124.385, 0.12135, 0, 0, 0.060638, 0.99816, 300, 0, 1),
+(164573, 181355, 571, 1, 1, 3372.23, -2141.88, 124.779, 0.12135, 0, 0, 0.060638, 0.99816, 300, 0, 1),
+(164575, 181305, 571, 1, 1, 3368.46, -2120.32, 124.972, 4.52273, 0, 0, 0.770885, -0.636974, 300, 0, 1),
+(164577, 181307, 571, 1, 1, 3367.51, -2120.73, 125.963, 0.112713, 0, 0, 0.0563269, 0.998412, 300, 0, 1),
+(164578, 181302, 571, 1, 1, 3364.09, -2126.28, 124.594, 1.64817, 0, 0, 0.733926, 0.67923, 300, 0, 1),
+(164579, 181302, 571, 1, 1, 3363.96, -2124.64, 124.71, 0.774805, 0, 0, 0.377785, 0.925894, 300, 0, 1),
+(164580, 181306, 571, 1, 1, 3365.8, -2125.85, 124.807, 4.92171, 0, 0, 0.629368, -0.777107, 300, 0, 1),
+(164581, 181355, 571, 1, 1, 3368.61, -2102.49, 122.991, 3.15926, 0, 0, 0.999961, -0.00883358, 300, 0, 1),
+(164582, 181605, 571, 1, 1, 3370.82, -2150.59, 124.43, 1.7102, 0, 0, 0.754638, 0.656142, 300, 0, 1),
+(164583, 194042, 571, 1, 1, 3368.48, -2135.25, 124.53, 0.20224, 0, 0, 0.100948, 0.994892, 300, 0, 1),
+(164584, 181376, 571, 1, 1, 3366.29, -2135.71, 126.592, 0.275273, 0, 0, 0.137202, 0.990543, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (210677,210682,210683,210684,210685,210686);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(210677, 32813, 571, 1, 1, 0, 0, 3371.86, -2126.5, 124.993, 0.184933, 300, 0, 0, 42, 0, 0, 0, 0, 0),
+(210682, 16781, 571, 1, 1, 21086, 0, 3361.63, -2146.48, 124.113, 6.12412, 300, 0, 0, 2453, 0, 0, 0, 0, 0),
+(210683, 16781, 571, 1, 1, 16442, 0, 3362.85, -2143.59, 124.017, 5.52722, 300, 0, 0, 3331, 0, 0, 0, 0, 0),
+(210684, 16781, 571, 1, 1, 16445, 0, 3365.06, -2149.12, 124.395, 2.17279, 300, 0, 0, 3331, 0, 0, 0, 0, 0),
+(210685, 16781, 571, 1, 1, 16438, 0, 3376.29, -2142.8, 124.829, 3.63755, 300, 0, 0, 1919, 0, 0, 0, 0, 0),
+(210686, 25994, 571, 1, 1, 0, 1, 3374.3, -2153.8, 123.999, 2.2042, 300, 0, 0, 2533, 0, 0, 0, 0, 0);
+-- Add Howling Fjords camp
+DELETE FROM `gameobject` WHERE `guid` IN (164608,164609,164610,164612,164613,164614,164615,164616,164617,164618,164620,164621,164622,164623,164624,164625,164626);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164608, 188021, 571, 1, 1, 2598.68, -4341.88, 275.709, 4.15841, 0, 0, 0.873519, -0.48679, 300, 0, 1),
+(164609, 188020, 571, 1, 1, 2568.84, -4325.53, 277.908, 0.773361, 0, 0, 0.377116, 0.926166, 300, 0, 1),
+(164610, 181355, 571, 1, 1, 2573.18, -4321.63, 277.706, 5.89809, 0, 0, 0.191362, -0.981519, 300, 0, 1),
+(164612, 181355, 571, 1, 1, 2585.37, -4330.36, 276.802, 5.59728, 0, 0, 0.336267, -0.941767, 300, 0, 1),
+(164613, 188020, 571, 1, 1, 2583.94, -4336.2, 275.877, 4.28332, 0, 0, 0.841436, -0.540357, 300, 0, 1),
+(164614, 194039, 571, 1, 1, 2579.72, -4325.59, 276.934, 5.77529, 0, 0, 0.251227, -0.967928, 300, 0, 1),
+(164615, 181376, 571, 1, 1, 2577.57, -4325.97, 278.995, 0.226445, 0, 0, 0.112981, 0.993597, 300, 0, 1),
+(164616, 188020, 571, 1, 1, 2601.28, -4351.41, 275.622, 3.9414, 0, 0, 0.921098, -0.389331, 300, 0, 1),
+(164617, 188020, 571, 1, 1, 2610.63, -4359.39, 276.012, 3.96889, 0, 0, 0.91566, -0.401954, 300, 0, 1),
+(164618, 181355, 571, 1, 1, 2585.83, -4354.56, 276.176, 0.915263, 0, 0, 0.441825, 0.897101, 300, 0, 1),
+(164620, 181355, 571, 1, 1, 2593.08, -4361.44, 275.514, 2.42794, 0, 0, 0.93701, 0.349302, 300, 0, 1),
+(164621, 181605, 571, 1, 1, 2584.82, -4363.27, 275.305, 0.908194, 0, 0, 0.438651, 0.898658, 300, 0, 1),
+(164622, 181302, 571, 1, 1, 2598.83, -4338.72, 276.13, 1.4619, 0, 0, 0.667577, 0.744541, 300, 0, 1),
+(164623, 181302, 571, 1, 1, 2597, -4339.46, 275.976, 1.84439, 0, 0, 0.796929, 0.604073, 300, 0, 1),
+(164624, 181306, 571, 1, 1, 2598.77, -4340.42, 275.851, 3.60996, 0, 0, 0.972704, -0.23205, 300, 0, 1),
+(164625, 181305, 571, 1, 1, 2602.92, -4344.35, 275.756, 3.60446, 0, 0, 0.973338, -0.229375, 300, 0, 1),
+(164626, 181307, 571, 1, 1, 2603.7, -4344.96, 276.749, 3.60446, 0, 0, 0.973338, -0.229375, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (210944,210946,210947,210948,210949,210950,210951, 127346);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(210944, 32812, 571, 1, 1, 0, 0, 2597.28, -4345.41, 275.49, 3.92805, 300, 0, 0, 42, 0, 0, 0, 0, 0),
+(210946, 16781, 571, 1, 1, 16436, 0, 2611.27, -4353.51, 276.147, 2.90625, 300, 0, 0, 3942, 0, 0, 0, 0, 0),
+(210947, 16781, 571, 1, 1, 16442, 0, 2607.34, -4349.77, 275.811, 4.8831, 300, 0, 0, 3427, 0, 0, 0, 0, 0),
+(210948, 16781, 571, 1, 1, 16431, 0, 2591.12, -4366.18, 275.385, 1.70773, 300, 0, 0, 2533, 0, 0, 0, 0, 0),
+(210949, 16781, 571, 1, 1, 16443, 0, 2589.82, -4356.76, 275.862, 4.90509, 300, 0, 0, 1524, 0, 0, 0, 0, 0),
+(210950, 16781, 571, 1, 1, 21086, 0, 2582.78, -4356.01, 276.146, 6.05884, 300, 0, 0, 2533, 0, 0, 0, 0, 0),
+(210951, 25994, 571, 1, 1, 0, 1, 2586.97, -4359.34, 275.729, 4.3074, 300, 0, 0, 2614, 0, 0, 0, 0, 0);
+-- Add Zul'Drak camp
+DELETE FROM `gameobject` WHERE `guid` IN (164628,164629,164630,164631,164632,164633,164634,164635,164638,164639,164640,164641,164642,164643,164644);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164628, 188021, 571, 1, 1, 5285.44, -2771.26, 292.418, 2.22832, 0, 0, 0.897541, 0.440932, 300, 0, 1),
+(164629, 188020, 571, 1, 1, 5305.23, -2759.31, 292.211, 2.32649, 0, 0, 0.918095, 0.396361, 300, 0, 1),
+(164630, 188020, 571, 1, 1, 5300.14, -2753.37, 292.419, 2.27937, 0, 0, 0.908502, 0.417882, 300, 0, 1),
+(164631, 188020, 571, 1, 1, 5272.4, -2788.86, 292.419, 2.16077, 0, 0, 0.88214, 0.470987, 300, 0, 1),
+(164632, 188020, 571, 1, 1, 5267.47, -2781.49, 292.419, 2.16077, 0, 0, 0.88214, 0.470987, 300, 0, 1),
+(164633, 181605, 571, 1, 1, 5276.31, -2779.24, 292.419, 0.767265, 0, 0, 0.374292, 0.927311, 300, 0, 1),
+(164634, 181355, 571, 1, 1, 5273.81, -2783.22, 292.419, 2.0506, 0, 0, 0.854871, 0.518841, 300, 0, 1),
+(164635, 181355, 571, 1, 1, 5280.99, -2777.12, 292.419, 2.19198, 0, 0, 0.88938, 0.457168, 300, 0, 1),
+(164638, 181376, 571, 1, 1, 5294.92, -2761.88, 292.419, 2.12359, 0, 0, 0.873231, 0.487306, 300, 0, 1),
+(164639, 194048, 571, 1, 1, 5294.92, -2761.88, 292.419, 2.12359, 0, 0, 0.873231, 0.487306, 300, 0, 1),
+(164640, 181305, 571, 1, 1, 5289.89, -2768.68, 292.419, 6.05528, 0, 0, 0.113708, -0.993514, 300, 0, 1),
+(164641, 181307, 571, 1, 1, 5290.46, -2768.24, 293.42, 0.654878, 0, 0, 0.321619, 0.946869, 300, 0, 1),
+(164642, 181302, 571, 1, 1, 5285.31, -2775.88, 292.419, 1.63505, 0, 0, 0.729456, 0.684028, 300, 0, 1),
+(164643, 181302, 571, 1, 1, 5282.75, -2774.74, 292.419, 2.02383, 0, 0, 0.847848, 0.53024, 300, 0, 1),
+(164644, 181306, 571, 1, 1, 5283.45, -2776.25, 292.419, 5.98302, 0, 0, 0.149522, -0.988758, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (210982,210983,210984,210985, 127354);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(210982, 32816, 571, 1, 1, 0, 0, 5282.69, -2767.44, 292.419, 1.95942, 300, 0, 0, 42, 0, 0, 0, 0, 0),
+(210983, 16781, 571, 1, 1, 16446, 0, 5271.7, -2776.47, 292.419, 5.91363, 300, 0, 0, 2533, 0, 0, 0, 0, 0),
+(210984, 16781, 571, 1, 1, 16438, 0, 5271.27, -2780.54, 292.419, 1.37088, 300, 0, 0, 1919, 0, 0, 0, 0, 0),
+(210985, 25994, 571, 1, 1, 0, 1, 5276.13, -2771.1, 292.419, 4.75359, 300, 0, 0, 2533, 0, 0, 0, 0, 0);
+-- Sholazar Basin
+DELETE FROM `gameobject` WHERE `guid` IN (165359,164668,164670,164672,164673,164674,164675,164676,164677,164678,164679,164680,164681,164682,164683);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164668, 188021, 571, 1, 1, 5504.05, 4879.15, -198.169, 6.24464, 0, 0, 0.0192691, -0.999814, 300, 0, 1),
+(164670, 194034, 571, 1, 1, 5499.12, 4869.82, -197.467, 5.88414, 0, 0, 0.198201, -0.980161, 300, 0, 1),
+(165359, 181376, 571, 1, 1, 5497.1, 4868.86, -195.368, 0.418565, 0, 0, 0.207758, 0.97818, 300, 0, 1),
+(164672, 188020, 571, 1, 1, 5500.69, 4859.37, -197.247, 0.114598, 0, 0, 0.0572678, 0.998359, 300, 0, 1),
+(164673, 188020, 571, 1, 1, 5525.06, 4861.98, -197.564, 0.106744, 0, 0, 0.0533468, 0.998576, 300, 0, 1),
+(164674, 188020, 571, 1, 1, 5516.82, 4892.55, -196.273, 3.38578, 0, 0, 0.992556, -0.121792, 300, 0, 1),
+(164675, 188020, 571, 1, 1, 5496.17, 4892.9, -198.774, 3.03235, 0, 0, 0.998509, 0.0545924, 300, 0, 1),
+(164676, 181355, 571, 1, 1, 5495.91, 4883.4, -198.56, 6.25326, 0, 0, 0.0149618, -0.999888, 300, 0, 1),
+(164677, 181355, 571, 1, 1, 5515.37, 4883.68, -197.054, 0.0242677, 0, 0, 0.0121336, 0.999926, 300, 0, 1),
+(164678, 181605, 571, 1, 1, 5515.33, 4863.4, -198.357, 4.06043, 0, 0, 0.896311, -0.443427, 300, 0, 1),
+(164679, 181302, 571, 1, 1, 5507.71, 4879.47, -198.299, 0.657298, 0, 0, 0.322765, 0.946479, 300, 0, 1),
+(164680, 181302, 571, 1, 1, 5505.69, 4877.91, -198.203, 0.292873, 0, 0, 0.145914, 0.989297, 300, 0, 1),
+(164681, 181306, 571, 1, 1, 5507.58, 4877.19, -198.261, 2.40952, 0, 0, 0.933753, 0.357918, 300, 0, 1),
+(164682, 181305, 571, 1, 1, 5505.18, 4882.54, -198.365, 3.11481, 0, 0, 0.99991, 0.0133924, 300, 0, 1),
+(164683, 181307, 571, 1, 1, 5505.92, 4882.53, -197.375, 3.13444, 0, 0, 0.999994, 0.00357527, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (211249,211256,211257,211258,211259,211260,211261,127342);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(211249, 32810, 571, 1, 1, 0, 0, 5499.31, 4878.6, -197.97, 3.13758, 300, 0, 0, 11770, 0, 0, 0, 0, 0),
+(211256, 16781, 571, 1, 1, 16436, 0, 5508.26, 4891.52, -197.537, 3.49338, 300, 0, 0, 1919, 0, 0, 0, 0, 0),
+(211257, 16781, 571, 1, 1, 16442, 0, 5503.99, 4886.98, -198.356, 1.25892, 300, 0, 0, 2961, 0, 0, 0, 0, 0),
+(211258, 16781, 571, 1, 1, 16445, 0, 5500.44, 4895, -198.054, 5.57939, 300, 0, 0, 2453, 0, 0, 0, 0, 0),
+(211259, 16781, 571, 1, 1, 16436, 0, 5513.58, 4886.29, -197.178, 2.68991, 300, 0, 0, 2614, 0, 0, 0, 0, 0),
+(211260, 16781, 571, 1, 1, 16444, 0, 5511.2, 4870.94, -198.257, 4.65341, 300, 0, 0, 3728, 0, 0, 0, 0, 0),
+(211261, 25994, 571, 1, 1, 0, 1, 5509.13, 4864.95, -198.144, 6.08048, 300, 0, 0, 1919, 0, 0, 0, 0, 0);
+-- Crystalsong Forest
+DELETE FROM `gameobject` WHERE `guid` IN (164727,164728,164729,164730,164731,164732,164733,164735,164736,164737,164738,164739,164740,164741,164742);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164727, 188021, 571, 1, 1, 5537.66, -737.121, 149.903, 3.31719, 0, 0, 0.996148, -0.0876849, 300, 0, 1),
+(164728, 188020, 571, 1, 1, 5545.47, -751.288, 152.872, 3.29205, 0, 0, 0.997172, -0.0751598, 300, 0, 1),
+(164729, 188020, 571, 1, 1, 5534.63, -751.743, 152.043, 6.26479, 0, 0, 0.0091994, -0.999958, 300, 0, 1),
+(164730, 188020, 571, 1, 1, 5528.85, -718.125, 149.06, 0.120616, 0, 0, 0.0602714, 0.998182, 300, 0, 1),
+(164731, 188020, 571, 1, 1, 5538.1, -716.912, 150.739, 0.277696, 0, 0, 0.138402, 0.990376, 300, 0, 1),
+(164732, 181355, 571, 1, 1, 5521.75, -729.266, 148.2, 0.10176, 0, 0, 0.050858, 0.998706, 300, 0, 1),
+(164733, 181355, 571, 1, 1, 5523.81, -747.375, 150.338, 6.06293, 0, 0, 0.109904, -0.993942, 300, 0, 1),
+(164735, 181376, 571, 1, 1, 5531.08, -726.827, 148.981, 5.3977, 0, 0, 0.428418, -0.903581, 300, 0, 1),
+(164736, 194046, 571, 1, 1, 5530.53, -726.151, 148.904, 5.3977, 0, 0, 0.428418, -0.903581, 300, 0, 1),
+(164737, 181605, 571, 1, 1, 5539.79, -749.386, 152.047, 1.77309, 0, 0, 0.774893, 0.632092, 300, 0, 1),
+(164738, 181302, 571, 1, 1, 5540.05, -734.53, 149.889, 1.3152, 0, 0, 0.611221, 0.79146, 300, 0, 1),
+(164739, 181302, 571, 1, 1, 5539.56, -736.342, 150.01, 0.0978369, 0, 0, 0.048899, 0.998804, 300, 0, 1),
+(164740, 181306, 571, 1, 1, 5541.73, -735.983, 150.224, 2.34957, 0, 0, 0.922608, 0.385739, 300, 0, 1),
+(164741, 181305, 571, 1, 1, 5544.59, -739.644, 150.773, 3.64391, 0, 0, 0.968625, -0.248527, 300, 0, 1),
+(164742, 181307, 571, 1, 1, 5544.71, -740.658, 151.776, 4.72383, 0, 0, 0.70305, -0.711141, 300, 0, 1);
+
+DELETE FROM `creature` WHERE `guid` IN (211540,211541,211542,211543,211544,211545,211546, 127353, 127352);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(211540, 16781, 571, 1, 1, 16446, 0, 5523.19, -720.827, 148.211, 5.25948, 300, 0, 0, 2961, 0, 0, 0, 0, 0),
+(211541, 16781, 571, 1, 1, 16438, 0, 5520.46, -724.236, 148.091, 0.741081, 300, 0, 0, 3427, 0, 0, 0, 0, 0),
+(211542, 16781, 571, 1, 1, 16443, 0, 5525.58, -732.861, 148.853, 5.66631, 300, 0, 0, 3624, 0, 0, 0, 0, 0),
+(211543, 16781, 571, 1, 1, 16438, 0, 5535.22, -748.433, 151.399, 5.70637, 300, 0, 0, 1585, 0, 0, 0, 0, 0),
+(211544, 16781, 571, 1, 1, 16438, 0, 5540.74, -753.426, 153.249, 2.39199, 300, 0, 0, 3427, 0, 0, 0, 0, 0),
+(211545, 25994, 571, 1, 1, 0, 1, 5544.48, -746.126, 151.578, 3.61956, 300, 0, 0, 2371, 0, 0, 0, 0, 0),
+(211546, 32815, 571, 1, 1, 0, 0, 5532.98, -735.849, 149.538, 3.17817, 300, 0, 0, 12600, 0, 0, 0, 0, 0);
+-- The Storm Peaks
+DELETE FROM `gameobject` WHERE `guid` IN (164707,164708,164711,164712,164713,164714,164715,164716,164717,164718,164719,164720,164721,164722,164723,164726);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164707, 188021, 571, 1, 1, 6151.36, -1017.1, 407.519, 1.69575, 0, 0, 0.749875, 0.66158, 300, 0, 1),
+(164708, 188020, 571, 1, 1, 6132.71, -1015.73, 409.439, 1.61878, 0, 0, 0.723865, 0.689942, 300, 0, 1),
+(164711, 188020, 571, 1, 1, 6132.91, -1025.75, 409.86, 1.60476, 0, 0, 0.719011, 0.694998, 300, 0, 1),
+(164712, 188020, 571, 1, 1, 6175.57, -1021.52, 408.539, 1.75031, 0, 0, 0.767644, 0.640876, 300, 0, 1),
+(164713, 188020, 571, 1, 1, 6173.75, -1011.53, 407.582, 1.75031, 0, 0, 0.767644, 0.640876, 300, 0, 1),
+(164714, 181355, 571, 1, 1, 6159.65, -1016.22, 407.636, 3.2465, 0, 0, 0.998625, -0.0524288, 300, 0, 1),
+(164715, 181355, 571, 1, 1, 6136.52, -1021.34, 409.514, 3.30462, 0, 0, 0.99668, -0.0814223, 300, 0, 1),
+(164716, 181355, 571, 1, 1, 6153.47, -1027.3, 408.786, 1.79116, 0, 0, 0.780572, 0.625066, 300, 0, 1),
+(164717, 181302, 571, 1, 1, 6150.61, -1022.3, 408.201, 1.04268, 0, 0, 0.498041, 0.867154, 300, 0, 1),
+(164718, 181302, 571, 1, 1, 6151.6, -1020.59, 407.992, 2.47524, 0, 0, 0.945009, 0.327045, 300, 0, 1),
+(164719, 181306, 571, 1, 1, 6152.41, -1022.41, 408.186, 3.21273, 0, 0, 0.999367, -0.0355623, 300, 0, 1),
+(164720, 181305, 571, 1, 1, 6155.09, -1017.04, 407.54, 0.888738, 0, 0, 0.429888, 0.902882, 300, 0, 1),
+(164721, 181307, 571, 1, 1, 6155.22, -1018.19, 408.53, 1.70398, 0, 0, 0.752593, 0.658486, 300, 0, 1),
+(164722, 181605, 571, 1, 1, 6169.62, -1017.84, 408.118, 3.12084, 0, 0, 0.999946, 0.0103772, 300, 0, 1),
+(164723, 181376, 571, 1, 1, 6142.18, -1020.42, 408.493, 1.81865, 0, 0, 0.789088, 0.61428, 300, 0, 1),
+(164726, 194043, 571, 1, 1, 6142.19, -1020.44, 408.496, 1.91604, 0, 0, 0.818053, 0.575142, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (211513,211520,211521,211522,211523,211524, 127350);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(211513, 32814, 571, 1, 1, 0, 0, 6150.65, -1012.62, 406.944, 1.65607, 300, 0, 0, 12600, 0, 0, 0, 0, 0),
+(211520, 16781, 571, 1, 1, 16438, 0, 6166.94, -1008.14, 407.495, 4.42539, 300, 0, 0, 3834, 0, 0, 0, 0, 0),
+(211521, 16781, 571, 1, 1, 16442, 0, 6161.54, -1013.07, 407.498, 6.11635, 300, 0, 0, 3624, 0, 0, 0, 0, 0),
+(211522, 16781, 571, 1, 1, 21086, 0, 6164.34, -1020.92, 408.305, 1.35684, 300, 0, 0, 2292, 0, 0, 0, 0, 0),
+(211523, 16781, 571, 1, 1, 29243, 0, 6150.78, -1024.97, 408.505, 2.09119, 300, 0, 0, 3237, 0, 0, 0, 0, 0),
+(211524, 25994, 571, 1, 1, 0, 1, 6171.72, -1022.75, 408.506, 1.97024, 300, 0, 0, 2699, 0, 0, 0, 0, 0);
+-- Add SAI support for all flamekeepers to cast summon Scorchling on spawn
+-- Eeastern Kingdoms
+DELETE FROM `creature` WHERE `id`=26520;
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25933; -- Ghostland
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25933;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25933,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25931; -- Eversong woods
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25931;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25931,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25935; -- Hillsbrad Foothills
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25935;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25935,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25941; -- Swamp of sorrows
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25941;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25941,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25920; -- Cape of Stranglethorn
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25920;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25920,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25927; -- Burning Steppes
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25927;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25927,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25944; -- The Hinterlands
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25944;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25944,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25939; -- Silverpine Forest
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25939;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25939,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25946; -- Tirisfal Glades
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25946;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25946,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25925; -- Badlands
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25925;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25925,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25923; -- Arathi Highlands
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25923;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25923,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+-- Kalimdor
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25929; -- Durotar
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25929;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25929,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25928; -- Desolace
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25928;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25928,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25936; -- Mulgore
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25936;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25936,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25922; -- Winterspring
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25922;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25922,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25943; -- Barrens
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25943;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25943,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25932; -- Feralas
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25932;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25932,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25884; -- Ashenvale
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25884;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25884,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25930; -- Dustwallow marsh
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25930;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25930,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25945; -- Thousand Needles
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25945;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25945,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25919; -- Silithus
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25919;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25919,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25921; -- Tanaris
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25921;
+-- Outland
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25921,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25934; -- Hellfire Peninsula
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25934;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25934,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25938; -- Shadowmoon Valley
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25938;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25938,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25918; -- Netherstorm
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25918;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25918,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25942; -- Terokkar
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25942;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25942,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25947; -- Zangarmarsh
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25947;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25947,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25937; -- Nagrand
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25937;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25937,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25926; -- Blade's Edge Mountain
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25926;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25926,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+-- Northrend
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32816; -- Zul'Drak
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32816;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32816,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32809; -- Borean Tundra
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32809;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32809,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32810; -- Sholazar Basin
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32810;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32810,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32811; -- Dragonblight
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32811;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32811,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32815; -- Crystalsong Forest
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32815;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32815,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32814; -- Storm Peaks
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32814;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32814,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32813; -- Grizzly Hills
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32813;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32813,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32812; -- Howling Fjords
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32812;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32812,0,0,0,25,0,100,0,0,0,0,0,11,47123,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+-- Allieance's Honor the Flame quests full data + spawned missing camps/or individual gameojbect and npcs, also corrected creature_templates/
+DELETE FROM `creature` where `id`=26401; -- scorchlings are spawned by spells not manualy
+-- Add missing creature_quesrelation and involvedrealation that were blocking quests
+-- The Flame Warden of Kalimdor - {Achievement=1026}
+DELETE FROM `creature_queststarter` WHERE `quest` IN (11805,11812,11815,11834,11833,11831,11817,11811,11806,11809,11826,11824);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(25883, 11805), -- Ashenvale
+(25894, 11812), -- Desolace
+(25897, 11815), -- Dustwallow Marsh
+(25917, 11834), -- Winterspring
+(25916, 11833), -- Tanaris
+(25914, 11831), -- Silithus
+(25899, 11817), -- Feralas
+(25893, 11811), -- Darkshore
+(25888, 11806), -- Azuremyst Isle
+(25891, 11809), -- Bloodmyst Isle
+(25906, 11824); -- Teldrassil
+UPDATE `quest_template` SET `AllowableRaces`=1101 WHERE `ID` IN (11805, 11812, 11815, 11834, 11833, 11831, 11817, 11811, 11806, 11809, 11824);
+-- Flame Warden of Eastern Kingdoms {Achievement=1025}
+DELETE FROM `creature_queststarter` WHERE `quest` IN (11826,11827,11819,11583,11828,11816,11810,11808,11804,11832,11813,11814,11820,11822);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(25908, 11826), -- The Hinterlands
+(25909, 11827), -- The Western Plaguelands
+(25901, 11819), -- Hillsbrad Foothills
+(25910, 11583), -- Westfall
+(25911, 11828), -- Wetlands
+(25898, 11816), -- Elwynn Forest
+(25892, 11810), -- Burning Steppes
+(25890, 11808), -- Blasted Lands
+(25887, 11804), -- Arathi Highlands
+(25915, 11832), -- Cape of Stranglethorn
+(25895, 11813), -- Dun Morogh
+(25896, 11814), -- Duskwood
+(25902, 11820), -- Loch Modan
+(25904, 11822); -- Redridge Mountains
+
+UPDATE `quest_template` SET `AllowableRaces`=1101 WHERE `ID` IN (11826,11827,11819,11583,11828,11816,11810,11808,11804,11832,11813,11814,11820,11822);
+-- The Flame Warden of Northrend
+DELETE FROM `creature_queststarter` WHERE `quest` IN (13485,13487,13489,13488,13492,13490,13486,13491);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(32801, 13485), -- Borean Tundra
+(32803, 13487), -- Dragonblight
+(32805, 13489), -- Grizzly Hills
+(32804, 13488), -- Howling Fjord
+(32808, 13492), -- Zul'Drak
+(32806, 13490), -- The Storm Peaks
+(32802, 13486), -- Sholazar Basin
+(32807, 13491); -- Crystalsong Forest
+UPDATE `quest_template` SET `AllowableRaces`=1101 WHERE `ID` IN (13485,13487,13489,13488,13492,13490,13486,13491);
+
+-- The Flame Warden of Outland - {Achievement=1027}
+DELETE FROM `creature_queststarter` WHERE `quest` IN (11823,11821,11830,11818,11825,11807,11829);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(25905, 11823), -- Shadowmoon Valley
+(25903, 11821), -- Nagrand
+(25913, 11830), -- Netherstorm
+(25900, 11818), -- Hellfire Peninsula
+(25907, 11825), -- Terokkar
+(25889, 11807), -- Blade's Edge
+(25912, 11829); -- Zangarmarsh
+UPDATE `quest_template` SET `AllowableRaces`=1101 WHERE `ID` IN (11823,11821,11830,11818,11825,11807,11829);
+
+
+-- Add missing camps, npcs, gobject in general, corrected npc data for Alliance/Kalimdor,Eastern Kingdoms,Outland/
+-- Update creature_template for some creatures
+UPDATE `creature_template` SET `minlevel`=50,`maxlevel`=50,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25892); -- Burning Steppes
+UPDATE `creature_template` SET `minlevel`=65,`maxlevel`=65,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25909); -- Western Plaguelands
+UPDATE `creature_template` SET `minlevel`=20,`maxlevel`=20,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25891); -- Bloodmyst Isle
+UPDATE `creature_template` SET `minlevel`=25,`maxlevel`=25,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25888); -- Azuremyst Isle
+UPDATE `creature_template` SET `minlevel`=70,`maxlevel`=70,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25913); -- Netherstorm
+UPDATE `creature_template` SET `minlevel`=65,`maxlevel`=65,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25889); -- Blade's Edge Mountains
+UPDATE `creature_template` SET `minlevel`=70,`maxlevel`=70,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25903); -- Nagrand
+UPDATE `creature_template` SET `minlevel`=70,`maxlevel`=70,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25905); -- Shadowmoon valley
+UPDATE `creature_template` SET `minlevel`=65,`maxlevel`=65,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25912); -- Zangarmarsh
+UPDATE `creature_template` SET `minlevel`=65,`maxlevel`=65,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (25907); -- Terokkar
+UPDATE `creature_template` SET `minlevel`=72,`maxlevel`=72,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32801); -- Borean Tundra
+UPDATE `creature_template` SET `minlevel`=74,`maxlevel`=74,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32803); -- Dragonblight
+UPDATE `creature_template` SET `minlevel`=75,`maxlevel`=75,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32805); -- Grizzly Hills
+UPDATE `creature_template` SET `minlevel`=72,`maxlevel`=72,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32804); -- Howling Fjord
+UPDATE `creature_template` SET `minlevel`=77,`maxlevel`=77,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32808); -- Zul'Drak
+UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32806); -- The Storm Peaks
+UPDATE `creature_template` SET `minlevel`=78,`maxlevel`=78,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32802); -- Sholazar Basin
+UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`faction`=84,`dynamicflags`=8,`unit_flags`=37632,`npcflag`=3 WHERE `entry` IN (32807); -- Crystalsong Forest
+-- Add npcs for the Midsummer Festival Camp in Burning Steppes
+DELETE FROM `gameobject` WHERE `guid` IN (164766,164767,164768,164769,164770,164771,164772,164773,164774,164775,164776,164778,164779,164780,164781,164783,164784,164785,164786,164787,164788,17834);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164775, 181376, 0, 1, 1, -8245.62, -2623.9, 133.155, 4.04776, 0, 0, 0.899102, -0.43774, 300, 0, 1),
+(164776, 187922, 0, 1, 1, -8245.62, -2623.9, 133.155, 4.04776, 0, 0, 0.899102, -0.43774, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (211790,211791,211792,211793,211794,211797);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(211790, 25892, 0, 1, 1, 0, 0, -8254.28, -2625.62, 133.159, 1.29179, 300, 0, 0, 1524, 0, 0, 0, 0, 0),
+(211791, 16781, 0, 1, 1, 21083, 0, -8255.11, -2614.33, 133.154, 0.508745, 300, 0, 0, 2784, 0, 0, 0, 0, 0),
+(211792, 16781, 0, 1, 1, 16413, 0, -8253.26, -2611.61, 133.154, 4.93446, 300, 0, 0, 3524, 0, 0, 0, 0, 0),
+(211793, 16781, 0, 1, 1, 16412, 0, -8262.75, -2643.66, 133.39, 5.27218, 300, 0, 0, 3144, 0, 0, 0, 0, 0),
+(211794, 16781, 0, 1, 1, 16435, 0, -8259.55, -2650.01, 133.476, 2.09132, 300, 0, 0, 1919, 0, 0, 0, 0, 0),
+(211797, 25962, 0, 1, 1, 0, 1, -8245.74, -2607.85, 133.155, 3.51183, 300, 0, 0, 2533, 0, 0, 0, 0, 0);
+-- Add npcs for the Midsummer Festival Camp in Western Plaguelands
+DELETE FROM `gameobject` WHERE `guid` IN (164812,164813,164814,164815,164816,164817,164818,164819,164820,164821,164822,164823,164825,164826,164827);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164812, 188021, 0, 1, 1, 1001.53, -1449.68, 61.5049, 5.19952, 0, 0, 0.515706, -0.856766, 300, 0, 1),
+(164813, 188020, 0, 1, 1, 979.325, -1460, 61.2327, 0.184752, 0, 0, 0.0922449, 0.995736, 300, 0, 1),
+(164814, 188020, 0, 1, 1, 976.518, -1452.56, 63.6489, 0.312772, 0, 0, 0.155749, 0.987797, 300, 0, 1),
+(164815, 181355, 0, 1, 1, 979.858, -1454.79, 62.3009, 0.417231, 0, 0, 0.207105, 0.978319, 300, 0, 1),
+(164816, 188020, 0, 1, 1, 1020.23, -1447.65, 62.7199, 3.3342, 0, 0, 0.995366, -0.0961551, 300, 0, 1),
+(164817, 188020, 0, 1, 1, 1017.55, -1438.45, 63.4337, 3.48735, 0, 0, 0.985093, -0.17202, 300, 0, 1),
+(164818, 181355, 0, 1, 1, 1009.52, -1446.07, 62.2457, 3.52662, 0, 0, 0.981526, -0.191327, 300, 0, 1),
+(164819, 181302, 0, 1, 1, 999.693, -1442.64, 62.6698, 4.58298, 0, 0, 0.751349, -0.659905, 300, 0, 1),
+(164820, 181302, 0, 1, 1, 1000.27, -1440.61, 62.97, 3.38682, 0, 0, 0.992493, -0.122305, 300, 0, 1),
+(164821, 181306, 0, 1, 1, 1000.89, -1443.8, 62.3705, 1.42489, 0, 0, 0.653687, 0.756765, 300, 0, 1),
+(164822, 181305, 0, 1, 1, 998.898, -1448.43, 61.636, 5.72102, 0, 0, 0.277395, -0.960756, 300, 0, 1),
+(164823, 181307, 0, 1, 1, 999.225, -1446.96, 62.6326, 3.82978, 0, 0, 0.941381, -0.337345, 300, 0, 1),
+(164825, 181605, 0, 1, 1, 995.265, -1436.64, 64.3036, 5.13434, 0, 0, 0.543351, -0.839505, 300, 0, 1),
+(164826, 181376, 0, 1, 1, 989.562, -1453.47, 61.0011, 4.9859, 0, 0, 0.604106, -0.796904, 300, 0, 1),
+(164827, 187939, 0, 1, 1, 989.562, -1453.47, 61.0011, 4.9105, 0, 0, 0.633713, -0.773569, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (212038,212039,212040,212041,212042,212043);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(212038, 25962, 0, 1, 1, 0, 1, 992.05, -1438.97, 64.3942, 5.22073, 300, 0, 0, 1782, 0, 0, 0, 0, 0),
+(212039, 16781, 0, 1, 1, 16435, 0, 989.633, -1444.97, 63.2034, 0.579809, 300, 0, 0, 3427, 0, 0, 0, 0, 0),
+(212040, 16781, 0, 1, 1, 16447, 0, 1003.8, -1434.55, 63.5274, 3.86513, 300, 0, 0, 3052, 0, 0, 0, 0, 0),
+(212041, 16781, 0, 1, 1, 16412, 0, 997.675, -1428.17, 65.905, 4.35443, 300, 0, 0, 2138, 0, 0, 0, 0, 0),
+(212042, 16781, 0, 1, 1, 16431, 0, 1007.68, -1441.76, 62.6307, 2.69567, 300, 0, 0, 2784, 0, 0, 0, 0, 0),
+(212043, 25909, 0, 1, 1, 16339, 0, 1002.08, -1454.41, 61.1954, 5.05265, 300, 0, 0, 42, 0, 0, 0, 0, 0);
+-- Delete double spawns from Arathi camp
+DELETE FROM `gameobject` WHERE `guid` IN (52335,51814,52409,51573,51014,51554,51579,51981,52412,52407,51578,50931,52481,52542,50836,51580,50553,51820,50802,50897,50803,165383);
+DELETE FROM `creature` WHERE `guid` IN (94557,94605,90490,94556,94704);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165383, 187945, 1, 1, 1, -7216.15, -3859.66, 11.9664, 4.00788, 0, 0, 0.907652, -0.419724, 300, 0, 1);
+-- Delete double spawns from Stranglethorn camp
+DELETE FROM `gameobject` WHERE `guid` IN (52393,52541,50682,51782,52325,51028,51797,51028,51798,50784,50871,50785,51545,52331,52509,165384);
+DELETE FROM `creature` WHERE `guid` IN (94553,94551,86711,94554,94555);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165384, 187943, 1, 1, 1, -6771.96, 527.151, -1.40004, 3.1949, 0, 0, 0.999645, -0.0266517, 300, 0, 1);
+-- Add Bloodmyst camp
+DELETE FROM `gameobject` WHERE `guid` IN (164852,164853,164854,164855,164856,164857,164858,164859,164861,164862,164863,164864,164865,164866,164867,164868,164869,164870);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164852, 188021, 530, 1, 1, -2238.65, -11884.9, 27.2942, 5.0887, 0, 0, 0.562366, -0.826888, 300, 0, 1),
+(164853, 181355, 530, 1, 1, -2247.36, -11891.2, 27.273, 5.12561, 0, 0, 0.547009, -0.837127, 300, 0, 1),
+(164854, 181376, 530, 1, 1, -2254.78, -11896.3, 27.4979, 5.24028, 0, 0, 0.498141, -0.867096, 300, 0, 1),
+(164855, 187921, 530, 1, 1, -2254.78, -11896.3, 27.4979, 5.24028, 0, 0, 0.498141, -0.867096, 300, 0, 1),
+(164856, 181355, 530, 1, 1, -2263.35, -11897.7, 27.4214, 4.9112, 0, 0, 0.633442, -0.77379, 300, 0, 1),
+(164857, 188020, 530, 1, 1, -2267.6, -11910.3, 26.5801, 3.82107, 0, 0, 0.942842, -0.333239, 300, 0, 1),
+(164858, 181305, 530, 1, 1, -2234.49, -11884.7, 29.2704, 2.36494, 0, 0, 0.925544, 0.378641, 300, 0, 1),
+(164859, 181307, 530, 1, 1, -2233.15, -11884.7, 30.2608, 3.17861, 0, 0, 0.999829, -0.0185081, 300, 0, 1),
+(164861, 181605, 530, 1, 1, -2232.01, -11915.4, 26.5822, 1.82694, 0, 0, 0.791628, 0.611003, 300, 0, 1),
+(164862, 188020, 530, 1, 1, -2246.85, -11930.2, 27.0976, 3.92552, 0, 0, 0.92416, -0.382005, 300, 0, 1),
+(164863, 181355, 530, 1, 1, -2229.91, -11931.1, 29.9614, 2.41049, 0, 0, 0.933927, 0.357465, 300, 0, 1),
+(164864, 188020, 530, 1, 1, -2206.14, -11905.5, 29.0653, 0.581295, 0, 0, 0.286573, 0.958058, 300, 0, 1),
+(164865, 188020, 530, 1, 1, -2218.01, -11884.8, 29.2497, 3.56425, 0, 0, 0.977754, -0.209757, 300, 0, 1),
+(164866, 181355, 530, 1, 1, -2207.24, -11920.6, 31.7791, 1.97971, 0, 0, 0.835947, 0.548811, 300, 0, 1),
+(164867, 181355, 530, 1, 1, -2224.91, -11879.8, 29.7914, 1.97971, 0, 0, 0.835947, 0.548811, 300, 0, 1),
+(164868, 181302, 530, 1, 1, -2243.58, -11886.5, 28.3418, 0.455247, 0, 0, 0.225663, 0.974205, 300, 0, 1),
+(164869, 181302, 530, 1, 1, -2241.55, -11887.8, 28.4584, 1.37809, 0, 0, 0.635801, 0.771853, 300, 0, 1),
+(164870, 181306, 530, 1, 1, -2243.06, -11888.3, 28.1292, 1.35453, 0, 0, 0.626664, 0.77929, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (212289,212290,212291,212292,212293,212295);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(212289, 16781, 530, 1, 1, 16414, 0, -2227.85, -11887.9, 28.3225, 4.4168, 300, 0, 0, 1716, 0, 0, 0, 0, 0),
+(212290, 16781, 530, 1, 1, 16434, 0, -2230.5, -11891.1, 27.6743, 0.651601, 300, 0, 0, 3728, 0, 0, 0, 0, 0),
+(212291, 16781, 530, 1, 1, 16412, 0, -2246.13, -11921, 25.4183, 6.15017, 300, 0, 0, 1919, 0, 0, 0, 0, 0),
+(212292, 16781, 530, 1, 1, 21083, 0, -2240.57, -11922.3, 26.6757, 2.72819, 300, 0, 0, 3144, 0, 0, 0, 0, 0),
+(212293, 25962, 530, 1, 1, 0, 1, -2224.37, -11912.7, 26.95, 2.63237, 300, 0, 0, 2784, 0, 0, 0, 0, 0),
+(212295, 25891, 530, 1, 1, 0, 0, -2238.78, -11890.3, 28.0834, 4.91003, 300, 0, 0, 1524, 0, 0, 0, 0, 0);
+-- Add Feralas camp
+DELETE FROM `gameobject` WHERE `guid` IN (164894,164895,164896,164897,164898,164899,164900,164901,164902,164903,164904,164905);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164894, 188020, 1, 1, 1, -4397.96, 3483.41, 11.6035, 0.0273144, 0, 0, 0.0136568, 0.999907, 300, 0, 1),
+(164895, 188020, 1, 1, 1, -4426.01, 3485.49, 15.1689, 6.18994, 0, 0, 0.0466055, -0.998913, 300, 0, 1),
+(164896, 188020, 1, 1, 1, -4431.3, 3458.68, 18.2034, 6.16324, 0, 0, 0.0599382, -0.998202, 300, 0, 1),
+(164897, 181355, 1, 1, 1, -4404.42, 3477.56, 12.3551, 6.17894, 0, 0, 0.052098, -0.998642, 300, 0, 1),
+(164898, 181605, 1, 1, 1, -4417.13, 3455.78, 14.9771, 5.72732, 0, 0, 0.274366, -0.961625, 300, 0, 1),
+(164899, 181305, 1, 1, 1, -4414.79, 3466.24, 12.9118, 0.476933, 0, 0, 0.236213, 0.971701, 300, 0, 1),
+(164900, 181307, 1, 1, 1, -4415.03, 3464.71, 13.9024, 0.516203, 0, 0, 0.255246, 0.966876, 300, 0, 1),
+(164901, 181302, 1, 1, 1, -4411.8, 3462.72, 13.1523, 0.397609, 0, 0, 0.197498, 0.980303, 300, 0, 1),
+(164902, 181302, 1, 1, 1, -4413.43, 3462.26, 13.1455, 5.04874, 0, 0, 0.578774, -0.815488, 300, 0, 1),
+(164903, 181306, 1, 1, 1, -4411.95, 3460.55, 13.3287, 1.76734, 0, 0, 0.773073, 0.634317, 300, 0, 1),
+(164904, 181376, 1, 1, 1, -4412.02, 3480.24, 12.6312, 6.12709, 0, 0, 0.0779694, -0.996956, 300, 0, 1),
+(164905, 187929, 1, 1, 1, -4412.02, 3480.24, 12.6312, 6.12709, 0, 0, 0.0779694, -0.996956, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (212536,212537,212538,212539,212540,212541);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(212536, 25899, 1, 1, 1, 0, 0, -4405.5, 3466.01, 12.818, 0.172199, 300, 0, 0, 1524, 0, 0, 0, 0, 0),
+(212537, 25962, 1, 1, 1, 0, 1, -4426.59, 3463.45, 14.9376, 6.14436, 300, 0, 0, 2138, 0, 0, 0, 0, 0),
+(212538, 16781, 1, 1, 1, 16433, 0, -4406.22, 3458.47, 13.1618, 2.99649, 300, 0, 0, 3524, 0, 0, 0, 0, 0),
+(212539, 16781, 1, 1, 1, 16447, 0, -4408.65, 3454.41, 14.0291, 1.02042, 300, 0, 0, 1585, 0, 0, 0, 0, 0),
+(212540, 16781, 1, 1, 1, 16414, 0, -4411.13, 3457.27, 13.6321, 6.03912, 300, 0, 0, 2215, 0, 0, 0, 0, 0),
+(212541, 16781, 1, 1, 1, 16413, 0, -4417.18, 3487.8, 12.7708, 5.29378, 300, 0, 0, 2138, 0, 0, 0, 0, 0);
+-- Add Azuremyst Isle camp
+DELETE FROM `gameobject` WHERE `guid` IN (164906,164907,164908,164909,164910,164911,164913,164914,164915,164916,164917,164918,164919,164920,164921,164922,164923,164924);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164906, 188021, 530, 1, 1, -4213.9, -12294, 1.92798, 5.8395, 0, 0, 0.220026, -0.975494, 300, 0, 1),
+(164907, 181376, 530, 1, 1, -4219.28, -12303.5, 2.90522, 5.69342, 0, 0, 0.290628, -0.956836, 300, 0, 1),
+(164908, 187917, 530, 1, 1, -4219.28, -12303.5, 2.90522, 5.69342, 0, 0, 0.290628, -0.956836, 300, 0, 1),
+(164909, 181355, 530, 1, 1, -4208.46, -12282.1, 3.21486, 1.92744, 0, 0, 0.821318, 0.57047, 300, 0, 1),
+(164910, 181355, 530, 1, 1, -4197.32, -12277.3, 1.88286, 2.5746, 0, 0, 0.960084, 0.279712, 300, 0, 1),
+(164911, 181605, 530, 1, 1, -4198.35, -12312.5, 1.07796, 2.84635, 0, 0, 0.989124, 0.147085, 300, 0, 1),
+(164913, 188020, 530, 1, 1, -4236.15, -12336.3, 5.75984, 1.06449, 0, 0, 0.507467, 0.861671, 300, 0, 1),
+(164914, 188020, 530, 1, 1, -4213.2, -12341.7, 4.5449, 1.15166, 0, 0, 0.544533, 0.83874, 300, 0, 1),
+(164915, 188020, 530, 1, 1, -4176.14, -12281.3, 0.011331, 4.10634, 0, 0, 0.885897, -0.463882, 300, 0, 1),
+(164916, 188020, 530, 1, 1, -4191.53, -12268.3, 1.30263, 4.11027, 0, 0, 0.884984, -0.465621, 300, 0, 1),
+(164917, 181355, 530, 1, 1, -4179.3, -12286.9, -0.144273, 4.14876, 0, 0, 0.875859, -0.482566, 300, 0, 1),
+(164918, 181355, 530, 1, 1, -4207.73, -12332.2, 2.70515, 4.14954, 0, 0, 0.87567, -0.48291, 300, 0, 1),
+(164919, 181355, 530, 1, 1, -4228.71, -12323.4, 3.0214, 2.66043, 0, 0, 0.971199, 0.238268, 300, 0, 1),
+(164920, 181305, 530, 1, 1, -4212.47, -12291.7, 1.64004, 0.517075, 0, 0, 0.255667, 0.966765, 300, 0, 1),
+(164921, 181307, 530, 1, 1, -4212.91, -12290.5, 2.64394, 4.74173, 0, 0, 0.696657, -0.717404, 300, 0, 1),
+(164922, 181302, 530, 1, 1, -4217.7, -12294.9, 2.66322, 5.99994, 0, 0, 0.14115, -0.989988, 300, 0, 1),
+(164923, 181302, 530, 1, 1, -4219.81, -12294.4, 2.97659, 0.62389, 0, 0, 0.30691, 0.951738, 300, 0, 1),
+(164924, 181306, 530, 1, 1, -4218.2, -12293.3, 2.44695, 3.98539, 0, 0, 0.912313, -0.409495, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (212598,212599,212600,212601,212602,212603,212604);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(212598, 16781, 530, 1, 1, 16413, 0, -4204.91, -12289.1, 1.57936, 1.63705, 300, 0, 0, 3834, 0, 0, 0, 0, 0),
+(212599, 16781, 530, 1, 1, 16412, 0, -4205.15, -12284.2, 2.51655, 4.81948, 300, 0, 0, 1585, 0, 0, 0, 0, 0),
+(212600, 16781, 530, 1, 1, 21084, 0, -4204.2, -12322.9, 2.18588, 1.49174, 300, 0, 0, 3834, 0, 0, 0, 0, 0),
+(212601, 16781, 530, 1, 1, 16433, 0, -4204.16, -12316.3, 1.96402, 4.73543, 300, 0, 0, 3144, 0, 0, 0, 0, 0),
+(212602, 16781, 530, 1, 1, 16448, 0, -4194.72, -12303.8, 0.665216, 3.58718, 300, 0, 0, 3624, 0, 0, 0, 0, 0),
+(212603, 25888, 530, 1, 1, 0, 0, -4210.83, -12297.8, 1.66611, 0.00183678, 300, 0, 0, 1524, 0, 0, 0, 0, 0),
+(212604, 25962, 530, 1, 1, 0, 1, -4189.94, -12310.1, -0.885672, 3.28087, 300, 0, 0, 2138, 0, 0, 0, 0, 0);
+
+
+-- Delete extra spawns from Silithus camp
+DELETE FROM `gameobject` WHERE `guid` IN (50680);
+-- Outland
+-- Netherstorm
+DELETE FROM `gameobject` WHERE `guid` IN (164974,164975,164976,164977,164978,164979,164980,164981,164982,164983,164984,164985,165408);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(164974, 188020, 530, 1, 1, 3124.32, 3767.21, 141.72, 6.15712, 0, 0, 0.0629915, -0.998014, 300, 0, 1),
+(164975, 188020, 530, 1, 1, 3118.47, 3768.31, 142, 5.99611, 0, 0, 0.143044, -0.989716, 300, 0, 1),
+(164976, 188020, 530, 1, 1, 3128.04, 3723.67, 142.125, 3.6241, 0, 0, 0.971039, -0.238921, 300, 0, 1),
+(164977, 181355, 530, 1, 1, 3129.41, 3728.35, 141.836, 3.15679, 0, 0, 0.999971, -0.00759801, 300, 0, 1),
+(164978, 181355, 530, 1, 1, 3118.56, 3728.18, 145.543, 3.26674, 0, 0, 0.998043, -0.0625352, 300, 0, 1),
+(164979, 181355, 530, 1, 1, 3106.03, 3725.62, 144.981, 3.3335, 0, 0, 0.9954, -0.0958082, 300, 0, 1),
+(164980, 181605, 530, 1, 1, 3113, 3717.87, 144.699, 1.34645, 0, 0, 0.62351, 0.781815, 300, 0, 1),
+(164981, 181302, 530, 1, 1, 3119, 3742.2, 142.069, 1.01658, 0, 0, 0.486685, 0.873577, 300, 0, 1),
+(164982, 181302, 530, 1, 1, 3120.72, 3741.49, 141.941, 1.31503, 0, 0, 0.611153, 0.791512, 300, 0, 1),
+(164983, 181306, 530, 1, 1, 3119.22, 3739.92, 141.977, 1.78627, 0, 0, 0.779042, 0.626972, 300, 0, 1),
+(164984, 181376, 530, 1, 1, 3121.5, 3753.88, 141.851, 5.85856, 0, 0, 0.21072, -0.977546, 300, 0, 1),
+(164985, 187942, 530, 1, 1, 3121.5, 3753.88, 141.851, 5.85856, 0, 0, 0.21072, -0.977546, 300, 0, 1),
+(165408, 188021, 530, 1, 1, 3124.08, 3743.19, 141.84, 0.373246, 0, 0, 0.185542, 0.982636, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (212847,212848,212849,212850,212851,212852);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(212847, 16781, 530, 1, 1, 21084, 0, 3105.5, 3720.48, 144.815, 0.250816, 300, 0, 0, 4050, 0, 0, 0, 0, 0),
+(212848, 16781, 530, 1, 1, 16435, 0, 3115.55, 3726.49, 145.316, 4.10869, 300, 0, 0, 2961, 0, 0, 0, 0, 0),
+(212849, 16781, 530, 1, 1, 16447, 0, 3120.66, 3721, 145.281, 2.74995, 300, 0, 0, 1990, 0, 0, 0, 0, 0),
+(212850, 16781, 530, 1, 1, 16412, 0, 3125.3, 3727.87, 142.621, 5.58132, 300, 0, 0, 3237, 0, 0, 0, 0, 0),
+(212851, 25962, 530, 1, 1, 0, 1, 3106.88, 3712.88, 144.328, 0.980452, 300, 0, 0, 2371, 0, 0, 0, 0, 0),
+(212852, 25913, 530, 1, 1, 0, 0, 3127.12, 3744.35, 141.695, 5.94888, 300, 0, 0, 42, 0, 0, 0, 0, 0);
+-- Nagrand
+DELETE FROM `gameobject` WHERE `guid` IN (165034,165038,165039,165040,165041,165042,165043,165044,165045,165046,165047,165048,165049,165050,165051,165052,165053);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165034, 188021, 530, 1, 1, -2518.07, 7554.87, -1.84913, 5.25355, 0, 0, 0.492375, -0.870383, 300, 0, 1),
+(165038, 188020, 530, 1, 1, -2503.95, 7557.49, -1.08408, 5.53944, 0, 0, 0.363359, -0.931649, 300, 0, 1),
+(165039, 181355, 530, 1, 1, -2508.99, 7559.45, -1.49399, 5.21507, 0, 0, 0.509029, -0.860749, 300, 0, 1),
+(165040, 181305, 530, 1, 1, -2514.58, 7556.29, -1.9083, 3.55317, 0, 0, 0.9789, -0.204338, 300, 0, 1),
+(165041, 181307, 530, 1, 1, -2514.36, 7557.85, -0.918236, 4.60717, 0, 0, 0.743311, -0.668946, 300, 0, 1),
+(165042, 181302, 530, 1, 1, -2521.68, 7558.76, -1.93354, 5.38786, 0, 0, 0.43286, -0.901461, 300, 0, 1),
+(165043, 181302, 530, 1, 1, -2520.13, 7560.14, -1.93178, 4.59147, 0, 0, 0.748542, -0.663088, 300, 0, 1),
+(165044, 181306, 530, 1, 1, -2519.97, 7558.77, -1.99031, 3.1212, 0, 0, 0.999948, 0.0101965, 300, 0, 1),
+(165045, 188020, 530, 1, 1, -2528.76, 7534.67, -0.445196, 5.47583, 0, 0, 0.392805, -0.919622, 300, 0, 1),
+(165046, 181355, 530, 1, 1, -2530.75, 7540.66, -2.24676, 5.41692, 0, 0, 0.419715, -0.907656, 300, 0, 1),
+(165047, 181376, 530, 1, 1, -2526.69, 7548.83, -2.23534, 5.32817, 0, 0, 0.459565, -0.888144, 300, 0, 1),
+(165048, 187933, 530, 1, 1, -2526.69, 7548.83, -2.23534, 5.32817, 0, 0, 0.459565, -0.888144, 300, 0, 1),
+(165049, 188020, 530, 1, 1, -2511.48, 7518.87, -1.20825, 2.42299, 0, 0, 0.936142, 0.351621, 300, 0, 1),
+(165050, 181355, 530, 1, 1, -2506.01, 7514.91, -3.26091, 2.33267, 0, 0, 0.919314, 0.393525, 300, 0, 1),
+(165051, 181355, 530, 1, 1, -2485.85, 7534.2, -1.6549, 2.33267, 0, 0, 0.919314, 0.393525, 300, 0, 1),
+(165052, 188020, 530, 1, 1, -2489.07, 7542.57, -0.865097, 2.31931, 0, 0, 0.916666, 0.399654, 300, 0, 1),
+(165053, 181605, 530, 1, 1, -2502.95, 7522.09, -2.46418, 2.29811, 0, 0, 0.912378, 0.40935, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (213103,213104,213105,213106,213108,213109);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(213103, 16781, 530, 1, 1, 16412, 0, -2504.03, 7528.3, -0.64438, 0.776008, 300, 0, 0, 1782, 0, 0, 0, 0, 0),
+(213104, 16781, 530, 1, 1, 16447, 0, -2500.29, 7532.45, -0.97989, 2.51488, 300, 0, 0, 4050, 0, 0, 0, 0, 0),
+(213105, 16781, 530, 1, 1, 16413, 0, -2507.02, 7550.21, -0.997479, 1.49936, 300, 0, 0, 3052, 0, 0, 0, 0, 0),
+(213106, 16781, 530, 1, 1, 16431, 0, -2508.9, 7555.52, -1.63478, 4.96375, 300, 0, 0, 3834, 0, 0, 0, 0, 0),
+(213108, 25962, 530, 1, 1, 0, 1, -2488.89, 7531.11, -2.0437, 2.29261, 300, 0, 0, 2371, 0, 0, 0, 0, 0),
+(213109, 25903, 530, 1, 1, 0, 0, -2515.71, 7550.71, -1.47649, 4.94805, 300, 0, 0, 3052, 0, 0, 0, 0, 0);
+-- Shadowmoon Valley
+DELETE FROM `gameobject` WHERE `guid` IN (165054,165055,165056,165057,165058,165059,165060,165062,165063,165064,165066,165067,165068,165069);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165054, 188021, 530, 1, 1, -3953.72, 2048.88, 95.0652, 4.6418, 0, 0, 0.731618, -0.681714, 300, 0, 1),
+(165055, 181376, 530, 1, 1, -3941.98, 2048.49, 95.0656, 4.87742, 0, 0, 0.646421, -0.762981, 300, 0, 1),
+(165056, 187935, 530, 1, 1, -3941.98, 2048.49, 95.0656, 4.87742, 0, 0, 0.646421, -0.762981, 300, 0, 1),
+(165057, 181355, 530, 1, 1, -3959.23, 2040.55, 95.0649, 1.26694, 0, 0, 0.591944, 0.805979, 300, 0, 1),
+(165058, 181605, 530, 1, 1, -3965.24, 2039.3, 95.0659, 1.35098, 0, 0, 0.625278, 0.780402, 300, 0, 1),
+(165059, 188020, 530, 1, 1, -3951.26, 2032.03, 95.1979, 1.40988, 0, 0, 0.647988, 0.761651, 300, 0, 1),
+(165060, 181355, 530, 1, 1, -3947.07, 2032.04, 96.8815, 1.47585, 0, 0, 0.672754, 0.739866, 300, 0, 1),
+(165062, 188020, 530, 1, 1, -3932.45, 2051.71, 95.072, 0.10612, 0, 0, 0.0530353, 0.998593, 300, 0, 1),
+(165063, 188020, 530, 1, 1, -3931.76, 2044.1, 95.1721, 6.1741, 0, 0, 0.054514, -0.998513, 300, 0, 1),
+(165064, 181305, 530, 1, 1, -3951.84, 2053.02, 95.0649, 4.37555, 0, 0, 0.815632, -0.578571, 300, 0, 1),
+(165066, 181307, 530, 1, 1, -3953.39, 2052.79, 96.0565, 0.143821, 0, 0, 0.0718485, 0.997416, 300, 0, 1),
+(165067, 181302, 530, 1, 1, -3956.31, 2051.68, 95.0653, 4.80752, 0, 0, 0.672688, -0.739927, 300, 0, 1),
+(165068, 181302, 530, 1, 1, -3956.72, 2051.26, 96.3085, 0.346454, 0, 0, 0.172362, 0.985034, 300, 0, 1),
+(165069, 181306, 530, 1, 1, -3958.88, 2051.04, 95.0648, 6.24637, 0, 0, 0.0184091, -0.999831, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (213113,213114,213115,213116,213117,213118);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(213113, 16781, 530, 1, 1, 16431, 0, -3965.57, 2049.6, 95.0651, 0.431277, 300, 0, 0, 2784, 0, 0, 0, 0, 0),
+(213114, 16781, 530, 1, 1, 21084, 0, -3960.94, 2053.54, 95.0651, 3.89645, 300, 0, 0, 2215, 0, 0, 0, 0, 0),
+(213115, 16781, 530, 1, 1, 16434, 0, -3972.67, 2034.69, 95.0653, 0.376299, 300, 0, 0, 2699, 0, 0, 0, 0, 0),
+(213116, 16781, 530, 1, 1, 16447, 0, -3968.36, 2038.44, 95.0653, 3.94672, 300, 0, 0, 2699, 0, 0, 0, 0, 0),
+(213117, 25962, 530, 1, 1, 0, 1, -3962.59, 2045.64, 95.0653, 4.66928, 300, 0, 0, 1716, 0, 0, 0, 0, 0),
+(213118, 25905, 530, 1, 1, 0, 0, -3953.29, 2043.81, 95.0653, 4.37634, 300, 0, 0, 42, 0, 0, 0, 0, 0);
+-- Zangarmarsh
+DELETE FROM `gameobject` WHERE `guid` IN (165070,165071,165072,165074,165075,165077,165078,165079,165080,165081,165105,165106,165107,165108,165109,165110,165111);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165070, 188021, 530, 1, 1, 192.163, 6006.97, 22.1, 6.08217, 0, 0, 0.100341, -0.994953, 300, 0, 1),
+(165071, 181376, 530, 1, 1, 194.982, 6019.23, 21.9713, 6.05151, 0, 0, 0.115576, -0.993299, 300, 0, 1),
+(165072, 187941, 530, 1, 1, 192.209, 6015.13, 22.1067, 0.00709009, 0, 0, 0.00354504, 0.999994, 300, 0, 1),
+(165074, 188020, 530, 1, 1, 179.856, 6024.08, 22.3978, 3.98117, 0, 0, 0.913175, -0.407568, 300, 0, 1),
+(165075, 181355, 530, 1, 1, 182.649, 6013.91, 22.7399, 3.85237, 0, 0, 0.937511, -0.347954, 300, 0, 1),
+(165077, 181305, 530, 1, 1, 191.325, 6003.18, 24.2265, 1.22679, 0, 0, 0.575647, 0.817698, 300, 0, 1),
+(165078, 181307, 530, 1, 1, 190.107, 6002.77, 25.2167, 1.22679, 0, 0, 0.575647, 0.817698, 300, 0, 1),
+(165079, 181302, 530, 1, 1, 187.76, 6009.34, 23.9554, 6.21407, 0, 0, 0.0345506, -0.999403, 300, 0, 1),
+(165080, 181302, 530, 1, 1, 187.695, 6007.28, 24.1424, 0.567843, 0, 0, 0.280122, 0.959964, 300, 0, 1),
+(165081, 181306, 530, 1, 1, 190.136, 6008.65, 23.9259, 4.04009, 0, 0, 0.900774, -0.434289, 300, 0, 1),
+(165105, 181355, 530, 1, 1, 199.014, 6031.23, 20.5566, 3.50209, 0, 0, 0.983799, -0.179273, 300, 0, 1),
+(165106, 188020, 530, 1, 1, 201.225, 6033.47, 20.1022, 3.0819, 0, 0, 0.999555, 0.0298411, 300, 0, 1),
+(165107, 188020, 530, 1, 1, 201.553, 5989.88, 20.7907, 3.02849, 0, 0, 0.998401, 0.0565203, 300, 0, 1),
+(165108, 181355, 530, 1, 1, 199.671, 5991.72, 21.7141, 0.161778, 0, 0, 0.0808006, 0.99673, 300, 0, 1),
+(165109, 181605, 530, 1, 1, 188.262, 5991.39, 23.7141, 3.08425, 0, 0, 0.999589, 0.0286686, 300, 0, 1),
+(165110, 188020, 530, 1, 1, 177.593, 5991.78, 22.1575, 6.11588, 0, 0, 0.0835527, -0.996503, 300, 0, 1),
+(165111, 181355, 530, 1, 1, 180.409, 5994.73, 22.8062, 5.91168, 0, 0, 0.184688, -0.982797, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (85192,85193,85194,85195,85196,85197);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(85192, 16781, 530, 1, 1, 16434, 0, 183.656, 6001.85, 23.9098, 5.76245, 300, 0, 0, 3834, 0, 0, 0, 0, 0),
+(85193, 16781, 530, 1, 1, 16433, 0, 183.666, 5998.61, 23.7887, 1.12075, 300, 0, 0, 3144, 0, 0, 0, 0, 0),
+(85194, 16781, 530, 1, 1, 16435, 0, 181.842, 5991.56, 22.9939, 0.808944, 300, 0, 0, 2871, 0, 0, 0, 0, 0),
+(85195, 16781, 530, 1, 1, 16433, 0, 184.16, 5995.16, 23.7236, 4.20658, 300, 0, 0, 2453, 0, 0, 0, 0, 0),
+(85196, 25962, 530, 1, 1, 0, 1, 191.919, 5998.19, 24.2443, 4.56315, 300, 0, 0, 2453, 0, 0, 0, 0, 0),
+(85197, 25912, 530, 1, 1, 0, 0, 195.944, 6003.78, 23.5325, 5.86299, 300, 0, 0, 42, 0, 0, 0, 0, 0);
+-- Blade's Edge
+DELETE FROM `gameobject` WHERE `guid` IN (165009,165010,165012,165013,165014,165015,165016,165019,165020,165021,165022,165023,165024,165025,165026,165027,165028,165029,165030,165031,165032,165033);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165009, 188020, 530, 1, 1, 2027.6, 6566, 133.42, 1.47266, 0, 0, 0.671574, 0.740938, 300, 0, 1),
+(165010, 188020, 530, 1, 1, 2042.68, 6565.84, 133.415, 4.54986, 0, 0, 0.762173, -0.647374, 300, 0, 1),
+(165012, 181355, 530, 1, 1, 2045.62, 6568.03, 134.354, 0.139063, 0, 0, 0.0694754, 0.997584, 300, 0, 1),
+(165013, 181355, 530, 1, 1, 2050.79, 6579.78, 136.412, 1.58284, 0, 0, 0.711351, 0.702837, 300, 0, 1),
+(165014, 181355, 530, 1, 1, 2018.03, 6580.28, 134.434, 1.33936, 0, 0, 0.620737, 0.784019, 300, 0, 1),
+(165015, 181355, 530, 1, 1, 2023.32, 6573.3, 133.994, 1.56432, 0, 0, 0.704815, 0.709392, 300, 0, 1),
+(165016, 181355, 530, 1, 1, 2045.55, 6573.74, 134.924, 0.0665667, 0, 0, 0.0332772, 0.999446, 300, 0, 1),
+(165019, 181376, 530, 1, 1, 2019.7, 6587.14, 134.985, 6.23705, 0, 0, 0.023068, -0.999734, 300, 0, 1),
+(165020, 187919, 530, 1, 1, 2019.7, 6587.14, 134.985, 6.23705, 0, 0, 0.023068, -0.999734, 300, 0, 1),
+(165021, 188021, 530, 1, 1, 2019.32, 6604.34, 136.902, 6.24568, 0, 0, 0.01875, -0.999824, 300, 0, 1),
+(165022, 181305, 530, 1, 1, 2014.67, 6605.07, 137.254, 6.08075, 0, 0, 0.101046, -0.994882, 300, 0, 1),
+(165023, 181307, 530, 1, 1, 2014.07, 6606.01, 138.244, 5.27886, 0, 0, 0.481324, -0.876543, 300, 0, 1),
+(165024, 181302, 530, 1, 1, 2018.4, 6602.44, 136.665, 0.432949, 0, 0, 0.214788, 0.976661, 300, 0, 1),
+(165025, 181302, 530, 1, 1, 2020.24, 6602.73, 136.605, 1.1351, 0, 0, 0.537566, 0.843222, 300, 0, 1),
+(165026, 181306, 530, 1, 1, 2019.32, 6600.75, 136.353, 1.1351, 0, 0, 0.537566, 0.843222, 300, 0, 1),
+(165027, 181605, 530, 1, 1, 2049.6, 6588.34, 136.213, 3.18184, 0, 0, 0.999797, -0.020124, 300, 0, 1),
+(165028, 188020, 530, 1, 1, 2047.82, 6623.09, 140.822, 4.54372, 0, 0, 0.764156, -0.645031, 300, 0, 1),
+(165029, 188020, 530, 1, 1, 2036.31, 6623.38, 139.917, 4.61833, 0, 0, 0.739567, -0.673083, 300, 0, 1),
+(165030, 181355, 530, 1, 1, 2032.89, 6620.83, 139.426, 4.42198, 0, 0, 0.80198, -0.597351, 300, 0, 1),
+(165031, 181355, 530, 1, 1, 2025.48, 6616.34, 138.909, 4.42198, 0, 0, 0.80198, -0.597351, 300, 0, 1),
+(165032, 181355, 530, 1, 1, 2056.26, 6611.74, 139.958, 4.68352, 0, 0, 0.71724, -0.696826, 300, 0, 1),
+(165033, 181355, 530, 1, 1, 2050.81, 6619.04, 140.428, 4.6144, 0, 0, 0.740889, -0.671627, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (213096,213097,213098,213099,213100,213101);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(213096, 25962, 530, 1, 1, 0, 1, 2050.24, 6603.09, 138.073, 3.04753, 300, 0, 0, 1651, 0, 0, 0, 0, 0),
+(213097, 16781, 530, 1, 1, 16412, 0, 2048.81, 6582.75, 135.962, 2.2637, 300, 0, 0, 3524, 0, 0, 0, 0, 0),
+(213098, 16781, 530, 1, 1, 16434, 0, 2044.15, 6588.86, 135.588, 5.3888, 300, 0, 0, 2062, 0, 0, 0, 0, 0),
+(213099, 16781, 530, 1, 1, 16448, 0, 2035.12, 6612.1, 138.394, 1.97939, 300, 0, 0, 2138, 0, 0, 0, 0, 0),
+(213100, 16781, 530, 1, 1, 16433, 0, 2031.53, 6616.98, 138.934, 5.30162, 300, 0, 0, 3728, 0, 0, 0, 0, 0),
+(213101, 25889, 530, 1, 1, 0, 0, 2024.17, 6601.49, 136.211, 6.05482, 300, 0, 0, 1524, 0, 0, 0, 0, 0);
+-- Terokkar
+DELETE FROM `gameobject` WHERE `guid` IN (165112,165115,165116,165117,165118,165119,165120,165121);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165112, 188021, 530, 1, 1, -3005.53, 4160.88, 4.18469, 0.149162, 0, 0, 0.0745119, 0.99722, 300, 0, 1),
+(165115, 181376, 530, 1, 1, -3004.07, 4152.48, 3.64988, 1.75455, 0, 0, 0.769001, 0.639247, 300, 0, 1),
+(165116, 187937, 530, 1, 1, -3004.07, 4152.48, 3.64988, 1.75455, 0, 0, 0.769001, 0.639247, 300, 0, 1),
+(165117, 188020, 530, 1, 1, -3007.02, 4177.26, 4.07658, 4.79326, 0, 0, 0.677945, -0.735112, 300, 0, 1),
+(165118, 181355, 530, 1, 1, -3006.14, 4169.56, 3.93771, 6.15906, 0, 0, 0.0620252, -0.998075, 300, 0, 1),
+(165119, 181355, 530, 1, 1, -3000.22, 4138.67, 2.05751, 1.71684, 0, 0, 0.756811, 0.653634, 300, 0, 1),
+(165120, 188020, 530, 1, 1, -2996.65, 4116.85, 4.33362, 1.75611, 0, 0, 0.769498, 0.638649, 300, 0, 1),
+(165121, 181605, 530, 1, 1, -2988.84, 4126.66, 4.88284, 3.26329, 0, 0, 0.998149, -0.0608107, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (78648,78649,78650,78651,78652);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(78648, 25962, 530, 1, 1, 0, 1, -2986.96, 4130.72, 5.04767, 2.64597, 300, 0, 0, 2533, 0, 0, 0, 0, 0),
+(78649, 16781, 530, 1, 1, 16448, 0, -2999.23, 4136.4, 2.31857, 4.96681, 300, 0, 0, 1716, 0, 0, 0, 0, 0),
+(78650, 16781, 530, 1, 1, 16434, 0, -2997.71, 4131.23, 3.04313, 1.92339, 300, 0, 0, 2699, 0, 0, 0, 0, 0),
+(78651, 16781, 530, 1, 1, 16442, 0, -2992.17, 4134.37, 3.88179, 3.20281, 300, 0, 0, 3052, 0, 0, 0, 0, 0),
+(78652, 25907, 530, 1, 1, 16339, 0, -3000.43, 4160.95, 4.82476, 6.12213, 300, 0, 0, 42, 0, 0, 0, 0, 0);
+-- Northrend
+DELETE FROM `creature` WHERE `guid` IN (213720,213727,213728,213729,213731,213732,213733,213737,213738,213739,213740,213741,213742,213746,213747,213748,213749,213751,213752,213790,213791,213792,213793,213794,213795,213796,213797,213798,213799,213800,213801,213802,213803,213804,213805,213806,213807,213808,213809,213810,213811,213812,213813,213814,213815,213816,213817);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(213720, 32801, 571, 1, 1, 0, 0, 4127.57, 5395.95, 27.1605, 3.70375, 300, 0, 0, 9610, 0, 0, 0, 0, 0), -- borean
+(213727, 25962, 571, 1, 1, 0, 1, 4141.22, 5399.12, 26.8254, 0.573149, 300, 0, 0, 2215, 0, 0, 0, 0, 0),
+(213728, 16781, 571, 1, 1, 16434, 0, 4142.22, 5389.34, 26.5072, 1.07266, 300, 0, 0, 1524, 0, 0, 0, 0, 0),
+(213729, 16781, 571, 1, 1, 16435, 0, 4141.25, 5394.58, 27.4716, 5.24156, 300, 0, 0, 2961, 0, 0, 0, 0, 0),
+(213731, 16781, 571, 1, 1, 16412, 0, 4147.28, 5407.75, 28.0446, 1.51327, 300, 0, 0, 1848, 0, 0, 0, 0, 0),
+(213732, 16781, 571, 1, 1, 16413, 0, 4145.26, 5412.3, 28.2783, 5.25177, 300, 0, 0, 3237, 0, 0, 0, 0, 0),
+(213733, 16781, 571, 1, 1, 21084, 0, 3946.4, -634.725, 242.332, 2.18478, 300, 0, 0, 1990, 0, 0, 0, 0, 0), -- dragonblight
+(213737, 16781, 571, 1, 1, 16435, 0, 3944.54, -631.516, 242.718, 5.2062, 300, 0, 0, 3834, 0, 0, 0, 0, 0),
+(213738, 16781, 571, 1, 1, 16434, 0, 3942.9, -606.703, 241.48, 2.36464, 300, 0, 0, 2871, 0, 0, 0, 0, 0),
+(213739, 16781, 571, 1, 1, 21083, 0, 3940.65, -603.007, 241.622, 5.10253, 300, 0, 0, 1524, 0, 0, 0, 0, 0),
+(213740, 32803, 571, 1, 1, 16338, 0, 3937.7, -597.263, 241.288, 5.88322, 300, 0, 0, 42, 0, 0, 0, 0, 0),
+(213741, 25962, 571, 1, 1, 0, 1, 3954.38, -609.752, 240.94, 3.62441, 300, 0, 0, 2138, 0, 0, 0, 0, 0),
+(213742, 25962, 571, 1, 1, 0, 1, 3417.9, -2882.62, 201.901, 2.50837, 300, 0, 0, 2699, 0, 0, 0, 0, 0), -- grizzly
+(213746, 16781, 571, 1, 1, 21083, 0, 3410.97, -2879.33, 201.095, 0.0940601, 300, 0, 0, 2062, 0, 0, 0, 0, 0),
+(213747, 16781, 571, 1, 1, 16435, 0, 3413.05, -2875.08, 200.954, 4.47815, 300, 0, 0, 2215, 0, 0, 0, 0, 0),
+(213748, 16781, 571, 1, 1, 16414, 0, 3416.95, -2876.6, 201.513, 3.22073, 300, 0, 0, 1651, 0, 0, 0, 0, 0),
+(213749, 32805, 571, 1, 1, 0, 0, 3408.45, -2883.72, 201.054, 2.20128, 300, 0, 0, 42, 0, 0, 0, 0, 0),
+(213751, 32808, 571, 1, 1, 16339, 0, 5613.85, -2621.07, 292.419, 1.40597, 300, 0, 0, 42, 0, 0, 0, 0, 0), -- zul'drak
+(213752, 25962, 571, 1, 1, 0, 1, 5605.14, -2622.99, 292.418, 3.07023, 300, 0, 0, 1782, 0, 0, 0, 0, 0),
+(213790, 16781, 571, 1, 1, 21083, 0, 5598.5, -2620.43, 292.418, 3.79122, 300, 0, 0, 1716, 0, 0, 0, 0, 0),
+(213791, 16781, 571, 1, 1, 16412, 0, 5595.44, -2624.43, 292.418, 0.957505, 300, 0, 0, 2215, 0, 0, 0, 0, 0),
+(213792, 16781, 571, 1, 1, 16448, 0, 5591.45, -2618.79, 292.418, 5.53402, 300, 0, 0, 2961, 0, 0, 0, 0, 0),
+(213793, 16781, 571, 1, 1, 16414, 0, 5608.18, -2627.1, 292.38, 2.59506, 300, 0, 0, 2961, 0, 0, 0, 0, 0),
+(213794, 16781, 571, 1, 1, 16433, 0, 5350.19, 4865.15, -189.023, 5.81181, 300, 0, 0, 2614, 0, 0, 0, 0, 0), -- sholazar
+(213795, 16781, 571, 1, 1, 21084, 0, 5349.94, 4860.03, -189.519, 5.81181, 300, 0, 0, 1716, 0, 0, 0, 0, 0),
+(213796, 16781, 571, 1, 1, 16412, 0, 5359.3, 4851.5, -195.433, 2.15971, 300, 0, 0, 2453, 0, 0, 0, 0, 0),
+(213797, 16781, 571, 1, 1, 16434, 0, 5361.68, 4857.43, -195.012, 2.85086, 300, 0, 0, 1919, 0, 0, 0, 0, 0),
+(213798, 25962, 571, 1, 1, 0, 1, 5359.25, 4865.19, -192.408, 4.29363, 300, 0, 0, 2215, 0, 0, 0, 0, 0),
+(213799, 32802, 571, 1, 1, 0, 0, 5361.63, 4834.87, -196.682, 6.2634, 300, 0, 0, 11770, 0, 0, 0, 0, 0),
+(213800, 16781, 571, 1, 1, 21084, 0, 2475.51, -4899.2, 264.631, 4.34609, 300, 0, 0, 2215, 0, 0, 0, 0, 0), -- howling
+(213801, 16781, 571, 1, 1, 16412, 0, 2473.2, -4903.93, 264.472, 1.13459, 300, 0, 0, 1585, 0, 0, 0, 0, 0),
+(213802, 16781, 571, 1, 1, 16434, 0, 2470.25, -4897.93, 264.079, 5.37967, 300, 0, 0, 2614, 0, 0, 0, 0, 0),
+(213803, 16781, 571, 1, 1, 16435, 0, 2460.73, -4908.81, 263.856, 1.98283, 300, 0, 0, 1919, 0, 0, 0, 0, 0),
+(213804, 25962, 571, 1, 1, 0, 1, 2474.94, -4910.43, 265.088, 1.51708, 300, 0, 0, 2453, 0, 0, 0, 0, 0),
+(213805, 32804, 571, 1, 1, 0, 0, 2464.21, -4903.28, 263.834, 1.87601, 300, 0, 0, 42, 0, 0, 0, 0, 0),
+(213806, 16781, 571, 1, 1, 16448, 0, 5158.08, -705.974, 168.467, 3.02341, 300, 0, 0, 1919, 0, 0, 0, 0, 0), -- crystal song
+(213807, 16781, 571, 1, 1, 16434, 0, 5156.52, -702.266, 168.843, 4.44812, 300, 0, 0, 2871, 0, 0, 0, 0, 0),
+(213808, 16781, 571, 1, 1, 16433, 0, 5151.8, -705.612, 169.955, 0.254876, 300, 0, 0, 3728, 0, 0, 0, 0, 0),
+(213809, 16781, 571, 1, 1, 21084, 0, 5128.25, -708.394, 173.711, 1.15808, 300, 0, 0, 3144, 0, 0, 0, 0, 0),
+(213810, 25962, 571, 1, 1, 0, 1, 5145.91, -709.484, 170.821, 0.499922, 300, 0, 0, 1585, 0, 0, 0, 0, 0),
+(213811, 32807, 571, 1, 1, 0, 0, 5136.13, -707.254, 172.487, 4.90051, 300, 0, 0, 12600, 0, 0, 0, 0, 0),
+(213812, 32806, 571, 1, 1, 0, 0, 6070.88, -1104.53, 419.715, 1.83449, 300, 0, 0, 12600, 0, 0, 0, 0, 0), -- storm peaks
+(213813, 16781, 571, 1, 1, 16434, 0, 6065.56, -1113.57, 420.54, 4.16241, 300, 0, 0, 3427, 0, 0, 0, 0, 0),
+(213814, 16781, 571, 1, 1, 16412, 0, 6066.28, -1119.17, 420.628, 1.60201, 300, 0, 0, 2871, 0, 0, 0, 0, 0),
+(213815, 16781, 571, 1, 1, 16442, 0, 6061.11, -1119.26, 420.736, 0.384647, 300, 0, 0, 1919, 0, 0, 0, 0, 0),
+(213816, 16781, 571, 1, 1, 16447, 0, 6057.52, -1108.18, 421.177, 5.5188, 300, 0, 0, 3237, 0, 0, 0, 0, 0),
+(213817, 25962, 571, 1, 1, 0, 1, 6055.79, -1113.41, 420.965, 0.639908, 300, 0, 0, 2614, 0, 0, 0, 0, 0);
+DELETE FROM `gameobject` WHERE `guid` IN (165358,165145,165146,165147,165148,165149,165150,165151,165152,165153,165154,165156,165157,165160,165161,165162,165163,165164,165165,165166,165167,165168,165169,165170,165171,165172,165173,165174,165175,165176,165177,165178,165179,165180,165181,165182,165183,165184,165185,165186,165187,165188,165189,165190,165191,165192,165193,165194,165195,165196,165197,165198,165199,165200,165201,165202,165203,165204,165205,165206,165208,165209,165210,165211,165212,165213,165214,165215,165216,165217,165218,165219,165220,165221,165222,165223,165224,165225,165226,165227,165229,165230,165231,165232,165233,165234,165235,165236,165237,165238,165239,165240,165241,165242,165243,165244,165245,165246,165247,165248,165249,165250,165251,165252,165253,165254,165255,165256,165257,165259,165260);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165145, 188021, 571, 1, 1, 4132.22, 5395.21, 25.7191, 5.17561, 0, 0, 0.525913, -0.850539, 300, 0, 1), -- borean
+(165146, 181376, 571, 1, 1, 4122.37, 5390.27, 27.8408, 5.32484, 0, 0, 0.461047, -0.887376, 300, 0, 1),
+(165147, 194032, 571, 1, 1, 4122.37, 5390.27, 27.8408, 5.32484, 0, 0, 0.461047, -0.887376, 300, 0, 1),
+(165148, 188020, 571, 1, 1, 4129.22, 5405.02, 28.1789, 0.481285, 0, 0, 0.238326, 0.971185, 300, 0, 1),
+(165149, 188020, 571, 1, 1, 4151.06, 5414.97, 28.6058, 3.52863, 0, 0, 0.981333, -0.192314, 300, 0, 1),
+(165150, 181355, 571, 1, 1, 4156.95, 5401.1, 26.3092, 3.55219, 0, 0, 0.979, -0.203861, 300, 0, 1),
+(165151, 181355, 571, 1, 1, 4146.21, 5396.35, 26.6994, 3.55219, 0, 0, 0.979, -0.203861, 300, 0, 1),
+(165152, 181355, 571, 1, 1, 4142.18, 5405.59, 27.1525, 3.55219, 0, 0, 0.979, -0.203861, 300, 0, 1),
+(165153, 181355, 571, 1, 1, 4153.32, 5410.39, 28.7987, 3.52313, 0, 0, 0.981858, -0.189615, 300, 0, 1),
+(165154, 181605, 571, 1, 1, 4150.05, 5405.28, 27.8774, 5.08058, 0, 0, 0.565718, -0.824599, 300, 0, 1),
+(165156, 181305, 571, 1, 1, 4135.12, 5397.23, 25.5887, 3.85927, 0, 0, 0.936306, -0.351186, 300, 0, 1),
+(165157, 181307, 571, 1, 1, 4135.05, 5398.94, 26.5787, 4.14594, 0, 0, 0.876539, -0.481331, 300, 0, 1),
+(165160, 181306, 571, 1, 1, 4129.8, 5391.77, 26.5704, 0.0579356, 0, 0, 0.0289637, 0.99958, 300, 0, 1),
+(165161, 181302, 571, 1, 1, 4131.99, 5391.45, 26.3998, 2.4746, 0, 0, 0.944904, 0.327349, 300, 0, 1),
+(165162, 181302, 571, 1, 1, 4131.99, 5391.45, 27.643, 2.4746, 0, 0, 0.944904, 0.327349, 300, 0, 1),
+(165163, 188020, 571, 1, 1, 3931.83, -573.606, 240.92, 4.44752, 0, 0, 0.794288, -0.607542, 300, 0, 1), -- dragonblight
+(165164, 188021, 571, 1, 1, 3935.16, -604.422, 242.038, 0.314754, 0, 0, 0.156728, 0.987642, 300, 0, 1),
+(165165, 188020, 571, 1, 1, 3945.42, -581.269, 241.426, 3.2757, 0, 0, 0.997753, -0.0670037, 300, 0, 1),
+(165166, 194036, 571, 1, 1, 3936.15, -583.456, 240.5, 4.0611, 0, 0, 0.896162, -0.443727, 300, 0, 1),
+(165167, 181605, 571, 1, 1, 3943.7, -620.329, 242.649, 4.94546, 0, 0, 0.620095, -0.784527, 300, 0, 1),
+(165168, 181355, 571, 1, 1, 3939.36, -612.531, 242.424, 0.532305, 0, 0, 0.263021, 0.96479, 300, 0, 1),
+(165169, 181355, 571, 1, 1, 3935.15, -599.189, 241.726, 3.43592, 0, 0, 0.989191, -0.146634, 300, 0, 1),
+(165170, 181302, 571, 1, 1, 3932.46, -602.261, 241.839, 4.80251, 0, 0, 0.674536, -0.738242, 300, 0, 1),
+(165171, 181302, 571, 1, 1, 3933.35, -604.422, 242.14, 5.11746, 0, 0, 0.550417, -0.83489, 300, 0, 1),
+(165172, 181306, 571, 1, 1, 3930.72, -604.611, 242.786, 0.606916, 0, 0, 0.298822, 0.954309, 300, 0, 1),
+(165173, 181305, 571, 1, 1, 3937.87, -603.327, 241.851, 0.273907, 0, 0, 0.136526, 0.990636, 300, 0, 1),
+(165174, 181307, 571, 1, 1, 3937.11, -604.845, 242.841, 1.2478, 0, 0, 0.584205, 0.811606, 300, 0, 1),
+(165175, 188020, 571, 1, 1, 3951.62, -594.388, 242.067, 3.25449, 0, 0, 0.998407, -0.0564201, 300, 0, 1),
+(165176, 188020, 571, 1, 1, 3956.41, -622.677, 240.615, 3.44377, 0, 0, 0.988608, -0.150516, 300, 0, 1),
+(165358, 181376, 571, 1, 1, 3938.9, -583.532, 241.562, 3.02279, 0, 0, 0.998236, 0.0593654, 300, 0, 1),
+(165177, 188020, 571, 1, 1, 3395.09, -2897.63, 202.415, 3.91647, 0, 0, 0.92588, -0.377817, 300, 0, 1), -- grizzly
+(165178, 188020, 571, 1, 1, 3386.89, -2887.49, 201.433, 3.52822, 0, 0, 0.981373, -0.192111, 300, 0, 1),
+(165179, 188021, 571, 1, 1, 3411.02, -2887.95, 200.943, 2.32304, 0, 0, 0.917409, 0.397946, 300, 0, 1),
+(165180, 181376, 571, 1, 1, 3403.4, -2896.41, 201.988, 2.32303, 0, 0, 0.917408, 0.397948, 300, 0, 1),
+(165181, 194040, 571, 1, 1, 3403.4, -2896.41, 201.988, 2.32303, 0, 0, 0.917408, 0.397948, 300, 0, 1),
+(165182, 188020, 571, 1, 1, 3407.51, -2863.88, 200.72, 0.993352, 0, 0, 0.476506, 0.879171, 300, 0, 1),
+(165183, 188020, 571, 1, 1, 3417.07, -2866.24, 201.045, 1.32715, 0, 0, 0.615936, 0.787796, 300, 0, 1),
+(165184, 181355, 571, 1, 1, 3402.62, -2873.88, 201.036, 5.86281, 0, 0, 0.208643, -0.977992, 300, 0, 1),
+(165185, 181355, 571, 1, 1, 3420.67, -2873.09, 201.803, 6.15576, 0, 0, 0.0636678, -0.997971, 300, 0, 1),
+(165186, 181605, 571, 1, 1, 3418.83, -2879.6, 202.108, 2.79897, 0, 0, 0.985362, 0.170475, 300, 0, 1),
+(165187, 181305, 571, 1, 1, 3412.23, -2891.48, 201.275, 5.57692, 0, 0, 0.345838, -0.938294, 300, 0, 1),
+(165188, 181307, 571, 1, 1, 3411.04, -2891.93, 202.266, 5.61226, 0, 0, 0.329204, -0.944259, 300, 0, 1),
+(165189, 181302, 571, 1, 1, 3413.25, -2886.38, 200.913, 5.401, 0, 0, 0.426929, -0.904285, 300, 0, 1),
+(165190, 181302, 571, 1, 1, 3415.21, -2887.65, 201.016, 0.378376, 0, 0, 0.188062, 0.982157, 300, 0, 1),
+(165191, 181306, 571, 1, 1, 3415.86, -2885.54, 201.257, 2.86024, 0, 0, 0.990121, 0.140215, 300, 0, 1),
+(165192, 188021, 571, 1, 1, 5613.46, -2625.78, 292.419, 1.55992, 0, 0, 0.703251, 0.710942, 300, 0, 1), -- zul'drak
+(165193, 181355, 571, 1, 1, 5603.68, -2629.45, 293.617, 4.60018, 0, 0, 0.745644, -0.666345, 300, 0, 1),
+(165194, 181355, 571, 1, 1, 5626.09, -2630.44, 292.882, 1.48451, 0, 0, 0.675952, 0.736946, 300, 0, 1),
+(165195, 188020, 571, 1, 1, 5636.45, -2626.42, 292.419, 6.27937, 0, 0, 0.00190917, -0.999998, 300, 0, 1),
+(165196, 188020, 571, 1, 1, 5636.13, -2618.64, 292.199, 0.0786426, 0, 0, 0.0393112, 0.999227, 300, 0, 1),
+(165197, 188020, 571, 1, 1, 5582.98, -2620.34, 292.42, 0.0385866, 0, 0, 0.0192921, 0.999814, 300, 0, 1),
+(165198, 188020, 571, 1, 1, 5581.71, -2626.78, 292.419, 6.27386, 0, 0, 0.00466193, -0.999989, 300, 0, 1),
+(165199, 181605, 571, 1, 1, 5587.73, -2625.06, 292.41, 0.0409415, 0, 0, 0.0204693, 0.99979, 300, 0, 1),
+(165200, 181305, 571, 1, 1, 5616.57, -2625.53, 292.41, 0.749368, 0, 0, 0.365978, 0.930623, 300, 0, 1),
+(165201, 181307, 571, 1, 1, 5616.55, -2626.93, 293.402, 1.55676, 0, 0, 0.702126, 0.712053, 300, 0, 1),
+(165202, 181302, 571, 1, 1, 5611.85, -2625.48, 292.361, 4.696, 0, 0, 0.712879, -0.701287, 300, 0, 1),
+(165203, 181302, 571, 1, 1, 5609.81, -2625.66, 292.34, 5.23792, 0, 0, 0.499163, -0.866508, 300, 0, 1),
+(165204, 181306, 571, 1, 1, 5610.02, -2623.6, 292.418, 0.308762, 0, 0, 0.153769, 0.988107, 300, 0, 1),
+(165205, 181376, 571, 1, 1, 5626.92, -2622.29, 292.417, 1.6785, 0, 0, 0.744143, 0.668021, 300, 0, 1),
+(165206, 194049, 571, 1, 1, 5626.92, -2622.29, 292.417, 1.6785, 0, 0, 0.744143, 0.668021, 300, 0, 1),
+(165208, 188021, 571, 1, 1, 5357.4, 4835.99, -195.101, 1.59976, 0, 0, 0.717272, 0.696793, 300, 0, 1), -- sholazar
+(165209, 181376, 571, 1, 1, 5369.18, 4842.41, -197.357, 4.53948, 0, 0, 0.765523, -0.643408, 300, 0, 1),
+(165210, 194035, 571, 1, 1, 5369.18, 4842.41, -197.357, 4.53948, 0, 0, 0.765523, -0.643408, 300, 0, 1),
+(165211, 181355, 571, 1, 1, 5359.07, 4827.41, -197.019, 0.176586, 0, 0, 0.0881781, 0.996105, 300, 0, 1),
+(165212, 181355, 571, 1, 1, 5357.57, 4845.13, -195.788, 1.41909, 0, 0, 0.651487, 0.75866, 300, 0, 1),
+(165213, 181605, 571, 1, 1, 5357.67, 4855.99, -193.827, 2.00813, 0, 0, 0.843662, 0.536875, 300, 0, 1),
+(165214, 188020, 571, 1, 1, 5364.57, 4869.43, -193.105, 4.59916, 0, 0, 0.745985, -0.665963, 300, 0, 1),
+(165215, 188020, 571, 1, 1, 5354.34, 4871.09, -189.818, 4.65099, 0, 0, 0.728478, -0.685069, 300, 0, 1),
+(165216, 188021, 571, 1, 1, 2464.17, -4907.57, 263.922, 1.71737, 0, 0, 0.756984, 0.653433, 300, 0, 1), -- howling
+(165217, 181305, 571, 1, 1, 2466.21, -4913.1, 264.166, 1.87838, 0, 0, 0.807079, 0.590443, 300, 0, 1),
+(165218, 181307, 571, 1, 1, 2466.44, -4913.46, 265.097, 2.75802, 0, 0, 0.981666, 0.190611, 300, 0, 1),
+(165219, 181302, 571, 1, 1, 2461.97, -4910.5, 263.936, 2.04881, 0, 0, 0.854405, 0.519608, 300, 0, 1),
+(165220, 181302, 571, 1, 1, 2462.99, -4912.18, 264.014, 2.58759, 0, 0, 0.96188, 0.273472, 300, 0, 1),
+(165221, 181306, 571, 1, 1, 2460.13, -4911.21, 263.948, 0.18113, 0, 0, 0.0904413, 0.995902, 300, 0, 1),
+(165222, 181376, 571, 1, 1, 2454.19, -4910.31, 263.893, 1.66082, 0, 0, 0.738208, 0.674573, 300, 0, 1),
+(165223, 194038, 571, 1, 1, 2454.19, -4910.31, 263.893, 1.66082, 0, 0, 0.738208, 0.674573, 300, 0, 1),
+(165224, 188020, 571, 1, 1, 2440.82, -4917.07, 264.587, 3.04862, 0, 0, 0.99892, 0.0464672, 300, 0, 1),
+(165225, 188020, 571, 1, 1, 2438.66, -4906.68, 263.066, 3.01328, 0, 0, 0.997943, 0.0641126, 300, 0, 1),
+(165226, 188020, 571, 1, 1, 2484.02, -4906.27, 266.191, 3.40989, 0, 0, 0.991016, -0.133745, 300, 0, 1),
+(165227, 188020, 571, 1, 1, 2480.96, -4899.1, 265.064, 3.50885, 0, 0, 0.983188, -0.182596, 300, 0, 1),
+(165229, 181605, 571, 1, 1, 2477.58, -4905.4, 265.055, 3.54262, 0, 0, 0.979964, -0.199174, 300, 0, 1),
+(165230, 181355, 571, 1, 1, 2444.4, -4912.06, 263.951, 4.8615, 0, 0, 0.652474, -0.757811, 300, 0, 1),
+(165231, 181355, 571, 1, 1, 2479.59, -4904.05, 265.144, 5.29976, 0, 0, 0.472136, -0.881526, 300, 0, 1),
+(165232, 188021, 571, 1, 1, 5136.25, -701.964, 172.182, 5.14116, 0, 0, 0.540484, -0.841354, 300, 0, 1), -- crystalsong
+(165233, 181376, 571, 1, 1, 5144.94, -695.736, 171.284, 5.22017, 0, 0, 0.506833, -0.862045, 300, 0, 1),
+(165234, 194045, 571, 1, 1, 5144.94, -695.736, 171.284, 5.22017, 0, 0, 0.506833, -0.862045, 300, 0, 1),
+(165235, 188020, 571, 1, 1, 5157.7, -692.213, 168.342, 3.56062, 0, 0, 0.978132, -0.207985, 300, 0, 1),
+(165236, 181355, 571, 1, 1, 5153.61, -694.632, 169.363, 0.505421, 0, 0, 0.250029, 0.968238, 300, 0, 1),
+(165237, 188020, 571, 1, 1, 5122.22, -708.294, 175.114, 0.416673, 0, 0, 0.206832, 0.978376, 300, 0, 1),
+(165238, 181355, 571, 1, 1, 5126.09, -706.472, 174.339, 3.55198, 0, 0, 0.979021, -0.203758, 300, 0, 1),
+(165239, 181605, 571, 1, 1, 5151.54, -709.361, 169.826, 2.02988, 0, 0, 0.849448, 0.527672, 300, 0, 1),
+(165240, 181305, 571, 1, 1, 5133.04, -698.409, 172.585, 2.84669, 0, 0, 0.989149, 0.146918, 300, 0, 1),
+(165241, 181307, 571, 1, 1, 5134.11, -697.857, 173.575, 3.61874, 0, 0, 0.971676, -0.236315, 300, 0, 1),
+(165242, 181302, 571, 1, 1, 5130.8, -703.896, 173.441, 0.0954414, 0, 0, 0.0477026, 0.998862, 300, 0, 1),
+(165243, 181302, 571, 1, 1, 5130.87, -703.854, 174.684, 0.535265, 0, 0, 0.264449, 0.9644, 300, 0, 1),
+(165244, 181306, 571, 1, 1, 5131.38, -705.369, 173.303, 0.248594, 0, 0, 0.123977, 0.992285, 300, 0, 1),
+(165245, 188021, 571, 1, 1, 6071.62, -1109.83, 419.2, 0.405097, 0, 0, 0.201166, 0.979557, 300, 0, 1), -- storm peaks
+(165246, 181305, 571, 1, 1, 6068.33, -1111.01, 420.335, 0.181236, 0, 0, 0.0904939, 0.995897, 300, 0, 1),
+(165247, 181307, 571, 1, 1, 6068.13, -1112.28, 421.326, 1.41274, 0, 0, 0.649077, 0.760723, 300, 0, 1),
+(165248, 181302, 571, 1, 1, 6075.71, -1107.72, 419.811, 0.0485033, 0, 0, 0.0242493, 0.999706, 300, 0, 1),
+(165249, 181302, 571, 1, 1, 6074.48, -1109.44, 419.993, 0.613205, 0, 0, 0.301821, 0.953365, 300, 0, 1),
+(165250, 181306, 571, 1, 1, 6076.77, -1109.03, 419.873, 0.174952, 0, 0, 0.0873647, 0.996176, 300, 0, 1),
+(165251, 188020, 571, 1, 1, 6087.35, -1102.33, 417.415, 1.96409, 0, 0, 0.831634, 0.555324, 300, 0, 1),
+(165252, 181355, 571, 1, 1, 6088.04, -1106.9, 418.348, 3.61421, 0, 0, 0.972209, -0.234116, 300, 0, 1),
+(165253, 181355, 571, 1, 1, 6083.72, -1098.45, 417.139, 3.61421, 0, 0, 0.972209, -0.234116, 300, 0, 1),
+(165254, 188020, 571, 1, 1, 6052.44, -1113.82, 420.864, 1.8769, 0, 0, 0.806644, 0.591038, 300, 0, 1),
+(165255, 181355, 571, 1, 1, 6052.45, -1106.76, 421.632, 0.193794, 0, 0, 0.0967457, 0.995309, 300, 0, 1),
+(165256, 181355, 571, 1, 1, 6056.56, -1118.19, 420.868, 0.130963, 0, 0, 0.0654346, 0.997857, 300, 0, 1),
+(165257, 181605, 571, 1, 1, 6061.69, -1112.97, 420.771, 5.40099, 0, 0, 0.426933, -0.904283, 300, 0, 1),
+(165259, 181376, 571, 1, 1, 6081.58, -1107.81, 419.498, 5.2117, 0, 0, 0.510478, -0.859891, 300, 0, 1),
+(165260, 194044, 571, 1, 1, 6081.58, -1107.81, 419.498, 5.2117, 0, 0, 0.510478, -0.859891, 300, 0, 1);
+-- Add SAI support for all flame wardens to cast summon Scorchling on spawn
+-- Eeastern Kingdoms
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25908; -- The Hinterlands
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25908;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25908,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25909; -- The Western Plaguelands
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25909;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25909,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25901; -- Hillsbrad Foothills
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25901;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25901,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25910; -- Westfall
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25910;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25910,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25911; -- Wetlands
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25911;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25911,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25898; -- Elwynn Forest
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25898;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25898,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25892; -- Burning Steppes
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25892;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25892,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25890; -- Blasted Lands
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25890;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25890,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25887; -- Arathi Highlands
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25887;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25887,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25915; -- Cape of Stranglethorn
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25915;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25915,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25895; -- Dun Morogh
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25895;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25895,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25896; -- Duskwood
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25896;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25896,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25902; -- Loch Modan
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25902;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25902,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25904; -- Redridge Mountains
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25904;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25904,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+-- Kalimdor
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25883; -- Ashenvale
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25883;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25883,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25894; -- Desolace
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25894;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25894,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25897; -- Dustwallow Marsh
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25897;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25897,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25917; -- Winterspring
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25917;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25917,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25916; -- Tanaris
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25916;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25916,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25914; -- Silithus
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25914;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25914,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25899; -- Feralas
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25899;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25899,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25893; -- Darkshore
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25893;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25893,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25888; -- Azuremyst Isle
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25888;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25888,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25891; -- Bloodmyst Isle
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25891;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25891,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25906; -- Teldrassil
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25906;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25906,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+-- Outland
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25905; -- Shadowmoon Valley
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25905;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25905,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25903; -- Nagrand
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25903;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25903,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25913; -- Netherstorm
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25913;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25913,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25900; -- Hellfire Peninsula
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25900;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25900,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25907; -- Terokkar
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25907;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25907,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25889; -- Blade's Edge
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25889;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25889,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25912; -- Zangarmarsh
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25912;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25912,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+-- Northrend
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32808; -- Zul'Drak
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32808;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32808,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32801; -- Borean Tundra
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32801;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32801,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32802; -- Sholazar Basin
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32802;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32802,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32803; -- Dragonblight
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32803;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32803,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32807; -- Crystalsong Forest
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32807;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32807,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32806; -- Storm Peaks
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32806;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32806,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32805; -- Grizzly Hills
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32805;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32805,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 32804; -- Howling Fjords
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=32804;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(32804,0,0,0,25,0,100,0,0,0,0,0,11,46972,0,0,0,0,0,1,0,0,0,0,0,0,0,'FK - On spawn - Cast summon scorchling');
+-- Remove unused guids from creature_addon after removal of some double spawns /that would give warning on start-up/
+DELETE FROM `creature_addon` WHERE `guid` IN (86376,86895,94735,94734,94716,94733,86321,94649,94738,86704,94700,94579);
+-- Alliance - Desecrate the flame fix + all achs related from /Desecration of the Horde 1035/
+-- Add missing gameobject_questrelation and involvedrelation that were blocking quests
+-- Extinguishing Kalimdor - {Achievement=1029}
+DELETE FROM `gameobject_queststarter` WHERE `id` IN (187958,187952,187953,187950,187973,187971,187968,187965,187961,187957,187959,187948);
+INSERT INTO `gameobject_queststarter` (`id`, `quest`) VALUES
+(187958, 11770), -- Durotar
+(187957, 11769), -- Desolace
+(187965, 11777), -- Mulgore
+(187953, 11803), -- Winterspring
+(187971, 11783), -- Barrens
+(187961, 11773), -- Feralas
+(187948, 11765), -- Ashenvale
+(187959, 11771), -- Dustwallow marsh
+(187973, 11785), -- Thousand Needles
+(187950, 11800), -- Silithus
+(187968, 11780), -- Stonetalon Mountains
+(187952, 11802); -- Tanaris
+UPDATE `quest_template` SET `AllowableRaces`=1101 WHERE `ID` IN (11770, 11777, 11783, 11802, 11765, 11803, 11769, 11785, 11773, 11771, 11800, 11780);
+-- Extinguishing Outland - {Achievement=1030}
+DELETE FROM `gameobject_queststarter` WHERE `id` IN (187963,187967,187949,187970,187975,187966,187955);
+INSERT INTO `gameobject_queststarter` (`id`, `quest`) VALUES
+(187963, 11775), -- Hellfire Peninsula
+(187967, 11779), -- Shadowmoon Valley
+(187949, 11799), -- Netherstorm
+(187970, 11782), -- Terokkar
+(187975, 11787), -- Zangarmarsh
+(187955, 11767), -- Blade' Edge
+(187966, 11778); -- Nagrand
+UPDATE `quest_template` SET `AllowableRaces`=1101 WHERE `ID` IN (11775,11779,11799,11782,11787,11767,11778);
+-- Extinguishing Northrend
+DELETE FROM `gameobject_queststarter` WHERE `id` IN (194048,194033,194034,194037,194046,194043,194042,194039);
+INSERT INTO `gameobject_queststarter` (`id`, `quest`) VALUES
+(194048, 13458), -- Zul'Drak
+(194033, 13441), -- Borean Tundra
+(194034, 13450), -- Sholazar Basin
+(194037, 13451), -- Dragonblight
+(194046, 13457), -- Crystalsong Forest
+(194043, 13455), -- Storm Peaks
+(194042, 13454), -- Grizzly Hills
+(194039, 13453); -- Howling Fjords
+UPDATE `quest_template` SET `AllowableRaces`=1101 WHERE `ID` IN (13458,13441,13450,13451,13457,13455,13454,13453);
+-- Extinguishing Eastern Kingdoms {Achievement=1028}
+DELETE FROM `gameobject_queststarter` WHERE `id` IN (187962,187960,187964,187969,187951,187956,187972,187559,187974,187954,187947);
+INSERT INTO `gameobject_queststarter` (`id`, `quest`) VALUES
+(187962, 11774), -- Ghostland
+(187960, 11772), -- Eversong woods
+(187964, 11776), -- Hillsbrad Foothills
+(187969, 11781), -- Swamp of sorrows
+(187951, 11801), -- Cape of Stranglethorn
+(187956, 11768), -- Burning Steppes
+(187972, 11784), -- The Hinterlands
+(187559, 11580), -- Silverpine Forest
+(187974, 11786), -- Tirisfal Glades
+(187954, 11766), -- Badlands
+(187947, 11764); -- Arathi Highlands
+UPDATE `quest_template` SET `AllowableRaces`=1101 WHERE `ID` IN (11774,11772,11776,11781,11801,11768,11784,11580,11786,11766,11764);
+
+-- Horde - Desecrate the flame fix + all achs related from /Desecration of the Alliance 1037/
+-- Add missing gameobject_questrelation and involvedrelation that were blocking quests
+-- Extinguishing Kalimdor - {Achievement=1029}
+DELETE FROM `gameobject_queststarter` WHERE `id` IN (187916,187924,187927,187946,187945,187943,187929,187923,187917,187921,187936);
+INSERT INTO `gameobject_queststarter` (`id`, `quest`) VALUES
+(187916, 11734), -- Ashenvale
+(187924, 11741), -- Desolace
+(187927, 11744), -- Dustwallow Marsh
+(187946, 11763), -- Winterspring
+(187945, 11762), -- Tanaris
+(187943, 11760), -- Silithus
+(187929, 11746), -- Feralas
+(187923, 11740), -- Darkshore
+(187917, 11735), -- Azuremyst Isle
+(187921, 11738), -- Bloodmyst Isle
+(187936, 11753); -- Teldrassil
+UPDATE `quest_template` SET `AllowableRaces`=690 WHERE `ID` IN (11734,11741,11744,11763,11762,11760,11746,11740,11735,11738,11753);
+
+-- Extinguishing Eastern Kingdoms
+DELETE FROM `gameobject_queststarter` WHERE `id` IN (187938,187939,187931,187564,187940,187928,187922,187920,187914,187944,187925,187926,187932,187934);
+INSERT INTO `gameobject_queststarter` (`id`, `quest`) VALUES
+(187938, 11755), -- The Hinterlands
+(187939, 11756), -- The Western Plaguelands
+(187931, 11748), -- Hillsbrad Foothills
+(187564, 11581), -- Westfall
+(187940, 11757), -- Wetlands
+(187928, 11745), -- Elwynn Forest
+(187922, 11739), -- Burning Steppes
+(187920, 11737), -- Blasted Lands
+(187914, 11732), -- Arathi Highlands
+(187944, 11761), -- Cape of Stranglethorn
+(187925, 11742), -- Dun Morogh
+(187926, 11743), -- Duskwood
+(187932, 11749), -- Loch Modan
+(187934, 11751); -- Redridge Mountains
+UPDATE `quest_template` SET `AllowableRaces`=690 WHERE `ID` IN (11755,11756,11748,11581,11757,11745,11739,11737,11732,11761,11742,11743,11749,11751);
+-- Extinguishing Northrend
+DELETE FROM `gameobject_queststarter` WHERE `id` IN (194032,194036,194040,194038,194049,194044,194035,194045);
+INSERT INTO `gameobject_queststarter` (`id`, `quest`) VALUES
+(194032, 13440), -- Borean Tundra
+(194036, 13443), -- Dragonblight
+(194040, 13445), -- Grizzly
+(194038, 13444), -- Howling Fjord
+(194049, 13449), -- Zul'Drak
+(194044, 13446), -- The Storm Peaks
+(194035, 13442), -- Sholazar Basin
+(194045, 13447); -- Crystalsong Forest
+UPDATE `quest_template` SET `AllowableRaces`=690 WHERE `ID` IN (13440,13443,13445,13444,13449,13446,13442,13447);
+-- Extinguishing Outland
+DELETE FROM `gameobject_queststarter` WHERE `id` IN (187935,187933,187942,187930,187937,187919,187941);
+INSERT INTO `gameobject_queststarter` (`id`, `quest`) VALUES
+(187935, 11752), -- Shadowmoon Valley
+(187933, 11750), -- Nagrand
+(187942, 11759), -- Netherstorm
+(187930, 11747), -- Hellfire Peninsula
+(187937, 11754), -- Terokkar
+(187919, 11736), -- Blade's Edge
+(187941, 11758); -- Zangarmarsh
+UPDATE `quest_template` SET `AllowableRaces`=690 WHERE `ID` IN (11752,11750,11759,11747,11754,11736,11758);
+-- #1
+-- Add SAI for Horde Flame Eater /Didn't want to take guids for action list, since events can do it fine/ and add for now data for celebrants text
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25994;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25994;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25994,0,0,0,60,0,100,0,15000,15000,36000,36000,5,7,0,0,0,0,0,1,0,0,0,0,0,0,0,'Flame Eater - On event update - Play emote drink'),
+(25994,0,1,0,60,0,100,0,16000,16000,37000,37000,11,46332,0,0,0,0,0,1,0,0,0,0,0,0,0,'Flame Eater - On event update - Cast flame breath'),
+(25994,0,2,0,60,0,100,0,17500,17500,38500,38500,11,46332,0,0,0,0,0,1,0,0,0,0,0,0,0,'Flame Eater - On event update - Cast flame breath'),
+(25994,0,3,0,60,0,100,0,19000,19000,40000,40000,11,46332,0,0,0,0,0,1,0,0,0,0,0,0,0,'Flame Eater - On event update - Cast flame breath');
+-- Add SAI for Alliance Fire Eater /Didn't want to take guids for action list, since events can do it fine/
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 25962;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25962;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25962,0,0,0,60,0,100,0,15000,15000,36000,36000,5,7,0,0,0,0,0,1,0,0,0,0,0,0,0,'Flame Eater - On event update - Play emote drink'),
+(25962,0,1,0,60,0,100,0,16000,16000,37000,37000,11,46332,0,0,0,0,0,1,0,0,0,0,0,0,0,'Flame Eater - On event update - Cast flame breath'),
+(25962,0,2,0,60,0,100,0,17500,17500,38500,38500,11,46332,0,0,0,0,0,1,0,0,0,0,0,0,0,'Flame Eater - On event update - Cast flame breath'),
+(25962,0,3,0,60,0,100,0,19000,19000,40000,40000,11,46332,0,0,0,0,0,1,0,0,0,0,0,0,0,'Flame Eater - On event update - Cast flame breath');
+-- Note: When he drinks the flask dissapear from hands and it shouldn't, maybe there is spell, but I can't find it after checking ~ spells, needs a sniff, to be fully blizzlike /all I know is the visua like, when Flask of North is being consumed, but the flask must be with yellowgreen liquid, not blue/ or maybe the creature addon shouldn't ignore equipment while performing drink.
+-- Midsummer Celebrant texts - this will be scripted when some bugs are sorted out with core
+DELETE FROM `creature_text` WHERE `entry`=16781;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES
+(16781,0,0,'The Horde fires will never be extinguished!',12,1,100,1,0,0,'Celebrant for the Horde',24534),
+(16781,1,0,'I''d like to see the Alliance try to steal our flame.',12,1,100,1,0,0,'Celebrant - Horde speech',24533),
+(16781,2,0,"The Horde have tried to steal our flames. I hope we return the favor.",12,7,100,1,0,0,'Celebrant - Alliance speech', 24531),
+(16781,3,0,"The Alliance fires burn strong and true!",12,7,100,1,0,0,'Celebrant - Alliance speech', 24532),
+(16781,4,0,"Midsummer Fire Festival is a great time to celebrate the summer!",12,0,100,1,0,0,'Celebrant - speech', 24535),
+(16781,5,0,"I love the firework show at the end of Midsummer Firefestival.",12,0,100,1,0,0,'Celebrant - speech', 24536);
+-- #2
+-- Fix quests for stealing 9325/TB/,9326/UC/,9324/Org/,9332/Darnassus/,9331/Ironforge/,9330/SW/ Flames by using linked_spells to conjure the proper items on using the capital's flames from the cleansing fires that hit players
+DELETE FROM `spell_scripts` WHERE `id` IN (29137,29135,29126,46671,29139,29138,29136,46672);
+INSERT INTO `spell_scripts` (`id`, `effIndex`,`command`, `datalong`, `datalong2`) VALUES
+(29137, 2, 15,29101, 2),
+(29135, 2, 15,29102, 2),
+(29126, 2, 15,29099, 2),
+(46671, 2, 15,46690, 2),
+(29139, 2, 15,29133, 2),
+(29136, 2, 15,29130, 2),
+(29138, 2, 15,29132, 2),
+(46672, 2, 15,46689, 2);
+-- Add missing gameobject_questrelation and involvedrelation that were blocking quests for {Q} A Thief'S Reward /H/A/ - 9339,9365 and the achievement accordingly
+DELETE FROM `creature_queststarter` WHERE `quest` IN (9365,9339);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(16817, 9365), -- Alliance
+(16818, 9339); -- Horde
+DELETE FROM `game_event_creature_quest` WHERE `quest` IN (9365,9339);
+INSERT INTO `game_event_creature_quest` (`eventEntry`, `id`, `quest`) VALUES
+(1, 16817, 9365), -- Alliance
+(1, 16818, 9339); -- Horde
+UPDATE `quest_template` SET `LogDescription`='', `QuestDescription`='' WHERE `Id` IN (9339, 9365); -- text here was wrong or such should not even exist, can't find any info, if there is another one.
+-- #3
+-- Add the missing burning bonfires, there should be 1 for quest and 1 with wood on top of it, both have different types and fuctions
+DELETE FROM `gameobject` WHERE `guid` IN (165409,165410,165411,165409,49313,165412,165413,165414,165415,165416,165417,165418,165419,165420,165421,165422,165423,165424,165425,165426,165427,165428,165429,165430,165431,165432,165433,165434,165435,165436,165437,165438,165439,165440,165441,165442,165443,165444,165445,165446,165447,165448,165449,165450,165451,165452,165453,165454,165455,165456,165457,165458,165459,165460,165461,165462,165463,165464,165465,165466,165467,165468,165469,165470,165471,165472,165473,165474,165475,165476,165477,165478,165479,165480,165481,165482,165483,165484,165485);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165409, 181288, 1, 1, 1, 145.521, -4713.82, 18.129, -2.53, 0, 0, 0, 0, 120, 0, 1),
+(165410, 181288, 1, 1, 1, -7122.51, -3657.11, 8.82202, -1.74533, 0, 0, 0.766044, -0.642788, 180, 100, 1),
+(165411, 181288, 1, 1, 1, 6855.99, -4564.4, 708.51, 0.855211, 0, 0, 0.414693, 0.909961, 180, 100, 1),
+(49313, 181288, 1, 1, 1, -7000.75, 918.851, 8.93831, -2.23402, 0, 0, 0.898794, -0.438371, 900, 100, 1), -- Using the guid since it is double spawn
+(165412, 181288, 1, 1, 1, -5513.93, -2299.73, -58.0752, 2.44346, 0, 0, 0.939693, 0.34202, 180, 100, 1),
+(165413, 181288, 1, 1, 1, -273.242, -2662.82, 91.695, -1.8675, 0, 0, 0.803857, -0.594823, 180, 100, 1),
+(165414, 181288, 1, 1, 1, 952.992, 776.968, 104.474, -1.55334, 0, 0, 0.700909, -0.71325, 180, 100, 1),
+(165415, 181288, 1, 1, 1, -2329.42, -624.806, -8.27507, 5.5, 0, 0, 0.766044, -0.642788, 0, 100, 1),
+(165416, 181288, 1, 1, 1, -4573.22, 407.388, 41.5461, 2.46091, 0, 0, 0.942641, 0.333807, 180, 100, 1),
+(165417, 181288, 1, 1, 1, -1862.36, 3055.71, 0.744157, 2.49582, 0, 0, 0.948324, 0.317305, 180, 100, 1),
+(165418, 181288, 1, 1, 1, -3110.59, -2722.41, 33.4626, 0.226893, 0, 0, 0.113203, 0.993572, 180, 100, 1),
+(165419, 181288, 1, 1, 1, 2014.65, -2337.84, 89.5211, 2.37365, 0, 0, 0.927184, 0.374607, 180, 100, 1),
+(165420, 181288, 530, 1, 1, 41.2448, 2587.44, 68.3453, -2.28638, 0, 0, 0.909961, -0.414693, 180, 100, 1),
+(165421, 181288, 530, 1, 1, -3059.17, 2374.85, 63.1011, 2.03334, 0, 0, 0.850361, 0.526199, 300, 0, 1),
+(165422, 181288, 530, 1, 1, 2922.17, 3690.15, 143.809, 5.94709, 0, 0, 0.167258, -0.985913, 300, 0, 1),
+(165423, 181288, 530, 1, 1, -2553.32, 4277.61, 20.614, -1.36136, 0, 0, 0.629321, -0.777146, 180, 100, 1),
+(165424, 181288, 530, 1, 1, 200.9, 7686.96, 22.508, -0.506145, 0, 0, 0.25038, -0.968148, 180, 100, 1),
+(165425, 181288, 530, 1, 1, -1211.01, 7474.44, 21.9953, -2.02458, 0, 0, 0.848048, -0.529919, 180, 100, 1),
+(165426, 181288, 530, 1, 1, 2282.43, 6134.5, 136.337, 6.01364, 0, 0, 0.134365, -0.990932, 300, 0, 1),
+(165427, 181288, 571, 1, 1, 5294.92, -2761.88, 292.419, 2.12359, 0, 0, 0.873231, 0.487306, 300, 0, 1),
+(165428, 181288, 571, 1, 1, 4441.05, 5627.71, 56.3487, 4.54665, 0, 0, 0.763211, -0.646149, 300, 0, 1),
+(165429, 181288, 571, 1, 1, 5499.12, 4869.82, -197.467, 5.88414, 0, 0, 0.198201, -0.980161, 300, 0, 1),
+(165430, 181288, 571, 1, 1, 3773.85, 1464.02, 92.4174, 6.10863, 0, 0, 0.087167, -0.996194, 300, 0, 1),
+(165431, 181288, 571, 1, 1, 5530.53, -726.151, 148.904, 5.3977, 0, 0, 0.428418, -0.903581, 300, 0, 1),
+(165432, 181288, 571, 1, 1, 6142.19, -1020.44, 408.496, 1.91604, 0, 0, 0.818053, 0.575142, 300, 0, 1),
+(165433, 181288, 571, 1, 1, 3368.48, -2135.25, 124.53, 0.20224, 0, 0, 0.100948, 0.994892, 300, 0, 1),
+(165434, 181288, 571, 1, 1, 2579.72, -4325.59, 276.934, 5.77529, 0, 0, 0.251227, -0.967928, 300, 0, 1),
+(165435, 181288, 530, 1, 1, 7693.53, -6836.51, 77.787, 2.7052, 0, 0, 0, 0, 120, 0, 1),
+(165436, 181288, 530, 1, 1, 9386.86, -6772.24, 14.412, -2.9146, 0, 0, 0, 0, 120, 0, 1),
+(165437, 181288, 0, 1, 1, -134.688, -802.767, 55.0147, -1.62316, 0, 0, 0.725374, -0.688354, 180, 100, 1),
+(165438, 181288, 0, 1, 1, -10331.4, -3297.73, 21.9992, -2.89725, 0, 0, 0.992546, -0.121869, 180, 100, 1),
+(165439, 181288, 0, 1, 1, -14376.7, 115.921, 1.4532, 2.11185, 0, 0, 0.870356, 0.492424, 180, 100, 1),
+(165440, 181288, 0, 1, 1, -7596.42, -2086.6, 125.17, -0.942478, 0, 0, 0.453991, -0.891006, 180, 100, 1),
+(165441, 181288, 0, 1, 1, -447.95, -4527.65, 8.59595, 1.53589, 0, 0, 0.694658, 0.71934, 180, 100, 1),
+(165442, 181288, 0, 1, 1, 587.056, 1365.02, 90.4778, 2.6529, 0, 0, 0.970296, 0.241922, 180, 100, 1),
+(165443, 181288, 0, 1, 1, 2279.25, 456.009, 33.867, 0.3665, 0, 0, 0, 0, 120, 0, 1),
+(165444, 181288, 0, 1, 1, -6704.48, -2200.91, 248.609, 0.017453, 0, 0, 0.008727, 0.999962, 180, 100, 1),
+(165445, 181288, 0, 1, 1, -1134.84, -3531.81, 51.0719, -0.820305, 0, 0, 0.398749, -0.91706, 180, 100, 1),
+(165446, 181288, 1, 1, 1, 2558.73, -481.666, 109.821, -2.47837, 0, 0, 0.945519, -0.325568, 180, 100, 1),
+(165447, 181288, 1, 1, 1, -55.5039, 1271.35, 91.9489, 1.5708, 0, 0, 0.707107, 0.707107, 180, 100, 1),
+(165448, 181288, 1, 1, 1, -3447.55, -4231.67, 10.6645, 0.802851, 0, 0, 0.390731, 0.920505, 180, 100, 1),
+(165449, 181288, 1, 1, 1, 6860.03, -4767.11, 696.833, -2.63545, 0, 0, 0.968148, -0.25038, 180, 100, 1),
+(165450, 181288, 1, 1, 1, -7216.15, -3859.66, 11.9664, 4.00788, 0, 0, 0.907652, -0.419724, 300, 0, 1),
+(165451, 181288, 1, 1, 1, -6771.96, 527.151, -1.40004, 3.1949, 0, 0, 0.999645, -0.0266517, 300, 0, 1),
+(165452, 181288, 1, 1, 1, -4412.02, 3480.24, 12.6312, 6.12709, 0, 0, 0.0779694, -0.996956, 300, 0, 1),
+(165453, 181288, 1, 1, 1, 6327.68, 512.61, 17.4723, 0.034907, 0, 0, 0.017452, 0.999848, 180, 100, 1),
+(165454, 181288, 530, 1, 1, -4219.28, -12303.5, 2.90522, 5.69342, 0, 0, 0.290628, -0.956836, 300, 0, 1),
+(165455, 181288, 530, 1, 1, -2254.78, -11896.3, 27.4979, 5.24028, 0, 0, 0.498141, -0.867096, 300, 0, 1),
+(165456, 181288, 1, 1, 1, 9778.64, 1019.38, 1299.79, 0.261799, 0, 0, 0.130526, 0.991445, 180, 100, 1),
+(165457, 181288, 0, 1, 1, 188.243, -2132.53, 102.674, -1.37881, 0, 0, 0.636078, -0.771625, 180, 100, 1),
+(165458, 181288, 0, 1, 1, 989.562, -1453.47, 61.0011, 4.9105, 0, 0, 0.633713, -0.773569, 300, 0, 1),
+(165459, 181288, 0, 1, 1, -604.148, -545.813, 36.579, 0.698132, 0, 0, 0.34202, 0.939693, 180, 100, 1),
+(165460, 181288, 0, 1, 1, -10657.1, 1054.63, 32.6733, 2.47837, 0, 0, 0.945519, 0.325568, 180, 100, 1),
+(165461, 181288, 0, 1, 1, -3448.2, -938.102, 10.6583, 0.034907, 0, 0, 0.017452, 0.999848, 180, 100, 1),
+(165462, 181288, 0, 1, 1, -9394.21, 37.5017, 59.882, 1.15192, 0, 0, 0.544639, 0.838671, 180, 100, 1),
+(165463, 181288, 0, 1, 1, -8245.62, -2623.9, 133.155, 4.04776, 0, 0, 0.899102, -0.43774, 300, 0, 1),
+(165464, 181288, 0, 1, 1, -10951.5, -3218.1, 41.3475, 1.91986, 0, 0, 0.819152, 0.573576, 180, 100, 1),
+(165465, 181288, 0, 1, 1, -1211.6, -2676.88, 45.3612, -0.645772, 0, 0, 0.317305, -0.948324, 180, 100, 1),
+(165466, 181288, 0, 1, 1, -14288.1, 61.8062, 0.68836, 1.37881, 0, 0, 0.636078, 0.771625, 180, 100, 1),
+(165467, 181288, 0, 1, 1, -5404.93, -492.299, 395.597, -0.506145, 0, 0, 0.25038, -0.968148, 180, 100, 1),
+(165468, 181288, 0, 1, 1, -10704.8, -1146.38, 24.7909, 2.09439, 0, 0, 0.866025, 0.5, 180, 100, 1),
+(165469, 181288, 0, 1, 1, -5233.16, -2893.37, 337.286, -0.226893, 0, 0, 0.113203, -0.993572, 180, 100, 1),
+(165470, 181288, 0, 1, 1, -9434.3, -2110.36, 65.8038, 0.349066, 0, 0, 0.173648, 0.984808, 180, 100, 1),
+(165471, 181288, 571, 1, 1, 4122.37, 5390.27, 27.8408, 5.32484, 0, 0, 0.461047, -0.887376, 300, 0, 1),
+(165472, 181288, 571, 1, 1, 3936.15, -583.456, 240.5, 4.0611, 0, 0, 0.896162, -0.443727, 300, 0, 1),
+(165473, 181288, 571, 1, 1, 3403.4, -2896.41, 201.988, 2.32303, 0, 0, 0.917408, 0.397948, 300, 0, 1),
+(165474, 181288, 571, 1, 1, 2454.19, -4910.31, 263.893, 1.66082, 0, 0, 0.738208, 0.674573, 300, 0, 1),
+(165475, 181288, 571, 1, 1, 5626.92, -2622.29, 292.417, 1.6785, 0, 0, 0.744143, 0.668021, 300, 0, 1),
+(165476, 181288, 571, 1, 1, 6081.58, -1107.81, 419.498, 5.2117, 0, 0, 0.510478, -0.859891, 300, 0, 1),
+(165477, 181288, 571, 1, 1, 5369.18, 4842.41, -197.357, 4.53948, 0, 0, 0.765523, -0.643408, 300, 0, 1),
+(165478, 181288, 571, 1, 1, 5144.94, -695.736, 171.284, 5.22017, 0, 0, 0.506833, -0.862045, 300, 0, 1),
+(165479, 181288, 530, 1, 1, -3941.98, 2048.49, 95.0656, 4.87742, 0, 0, 0.646421, -0.762981, 300, 0, 1),
+(165480, 181288, 530, 1, 1, -2526.69, 7548.83, -2.23534, 5.32817, 0, 0, 0.459565, -0.888144, 300, 0, 1),
+(165481, 181288, 530, 1, 1, 3121.5, 3753.88, 141.851, 5.85856, 0, 0, 0.21072, -0.977546, 300, 0, 1),
+(165482, 181288, 530, 1, 1, -528.509, 2339.11, 38.7252, 2.14675, 0, 0, 0.878817, 0.477159, 180, 100, 1),
+(165483, 181288, 530, 1, 1, -3004.07, 4152.48, 3.64988, 1.75455, 0, 0, 0.769001, 0.639247, 300, 0, 1),
+(165484, 181288, 530, 1, 1, 2019.7, 6587.14, 134.985, 6.23705, 0, 0, 0.023068, -0.999734, 300, 0, 1),
+(165485, 181288, 530, 1, 1, 192.209, 6015.13, 22.1067, 0.00709009, 0, 0, 0.00354504, 0.999994, 300, 0, 1);
+-- #4
+-- Add the missing burning bonfires the npcs* /upon which on quest complete steam is casted upon
+DELETE FROM `creature` WHERE `guid` IN (152327,152328,152329,152330,152331,152332,152333,152334,152335,152336,152337,152338,152339,152340,152341,152342,152343,152344,152345,152346,152347,152348,152349,152350,152351,152352,152353,152354,152355,152356,152357,152358,152359,152360,152361,152362,152363,152364,152365,152366,152367,152368,152369,152370,152371,152372,152373,152374,152375,152376,152377,152378,152379,152380,152381,152382,152383,152384,152385,152386,152387,152388,152389,152390,152391,152392,152393,152394,152395,152396,152397,152398,152399,152400,152401,152402,152403,152404);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`,`orientation`) VALUES
+(152327, 16592, 1, 1, 1, 145.521, -4713.82, 18.129, -2.53),
+(152328, 16592, 1, 1, 1, -7122.51, -3657.11, 8.82202, -1.74533),
+(152329, 16592, 1, 1, 1, 6855.99, -4564.4, 708.51, 0.855211),
+(152330, 16592, 1, 1, 1, -7000.75, 918.851, 8.93831, -2.23402),
+(152331, 16592, 1, 1, 1, -5513.93, -2299.73, -58.0752, 2.44346),
+(152332, 16592, 1, 1, 1, -273.242, -2662.82, 91.695, -1.8675),
+(152333, 16592, 1, 1, 1, 952.992, 776.968, 104.474, -1.55334),
+(152334, 16592, 1, 1, 1, -2329.42, -624.806, -8.27507, 5.5),
+(152335, 16592, 1, 1, 1, -4573.22, 407.388, 41.5461, 2.46091),
+(152336, 16592, 1, 1, 1, -1862.36, 3055.71, 0.744157, 2.49582),
+(152337, 16592, 1, 1, 1, -3110.59, -2722.41, 33.4626, 0.226893),
+(152338, 16592, 1, 1, 1, 2014.65, -2337.84, 89.5211, 2.37365),
+(152339, 16592, 530, 1, 1, 41.2448, 2587.44, 68.3453, -2.28638),
+(152340, 16592, 530, 1, 1, -3059.17, 2374.85, 63.1011, 2.03334),
+(152341, 16592, 530, 1, 1, 2922.17, 3690.15, 143.809, 5.94709),
+(152342, 16592, 530, 1, 1, -2553.32, 4277.61, 20.614, -1.36136),
+(152343, 16592, 530, 1, 1, 200.9, 7686.96, 22.508, -0.506145),
+(152344, 16592, 530, 1, 1, -1211.01, 7474.44, 21.9953, -2.02458),
+(152345, 16592, 530, 1, 1, 2282.43, 6134.5, 136.337, 6.01364),
+(152346, 16592, 571, 1, 1, 5294.92, -2761.88, 292.419, 2.12359),
+(152347, 16592, 571, 1, 1, 4441.05, 5627.71, 56.3487, 4.54665),
+(152348, 16592, 571, 1, 1, 5499.12, 4869.82, -197.467, 5.88414),
+(152349, 16592, 571, 1, 1, 3773.85, 1464.02, 92.4174, 6.10863),
+(152350, 16592, 571, 1, 1, 5530.53, -726.151, 148.904, 5.3977),
+(152351, 16592, 571, 1, 1, 6142.19, -1020.44, 408.496, 1.91604),
+(152352, 16592, 571, 1, 1, 3368.48, -2135.25, 124.53, 0.20224),
+(152353, 16592, 571, 1, 1, 2579.72, -4325.59, 276.934, 5.77529),
+(152354, 16592, 530, 1, 1, 7693.53, -6836.51, 77.787, 2.7052),
+(152355, 16592, 530, 1, 1, 9386.86, -6772.24, 14.412, -2.9146),
+(152356, 16592, 0, 1, 1, -134.688, -802.767, 55.0147, -1.62316),
+(152357, 16592, 0, 1, 1, -10331.4, -3297.73, 21.9992, -2.89725),
+(152358, 16592, 0, 1, 1, -14376.7, 115.921, 1.4532, 2.11185),
+(152359, 16592, 0, 1, 1, -7596.42, -2086.6, 125.17, -0.942478),
+(152360, 16592, 0, 1, 1, -447.95, -4527.65, 8.59595, 1.53589),
+(152361, 16592, 0, 1, 1, 587.056, 1365.02, 90.4778, 2.6529),
+(152362, 16592, 0, 1, 1, 2279.25, 456.009, 33.867, 0.3665),
+(152363, 16592, 0, 1, 1, -6704.48, -2200.91, 248.609, 0.017453),
+(152364, 16592, 0, 1, 1, -1134.84, -3531.81, 51.0719, -0.820305),
+(152365, 16592, 1, 1, 1, 2558.73, -481.666, 109.821, -2.47837),
+(152366, 16592, 1, 1, 1, -55.5039, 1271.35, 91.9489, 1.5708),
+(152367, 16592, 1, 1, 1, -3447.55, -4231.67, 10.6645, 0.802851),
+(152368, 16592, 1, 1, 1, 6860.03, -4767.11, 696.833, -2.63545),
+(152369, 16592, 1, 1, 1, -7216.15, -3859.66, 11.9664, 4.00788),
+(152370, 16592, 1, 1, 1, -6771.96, 527.151, -1.40004, 3.1949),
+(152371, 16592, 1, 1, 1, -4412.02, 3480.24, 12.6312, 6.12709),
+(152372, 16592, 1, 1, 1, 6327.68, 512.61, 17.4723, 0.034907),
+(152373, 16592, 530, 1, 1, -4219.28, -12303.5, 2.90522, 5.69342),
+(152374, 16592, 530, 1, 1, -2254.78, -11896.3, 27.4979, 5.24028),
+(152375, 16592, 1, 1, 1, 9778.64, 1019.38, 1299.79, 0.261799),
+(152376, 16592, 0, 1, 1, 188.243, -2132.53, 102.674, -1.37881),
+(152377, 16592, 0, 1, 1, 989.562, -1453.47, 61.0011, 4.9105),
+(152378, 16592, 0, 1, 1, -604.148, -545.813, 36.579, 0.698132),
+(152379, 16592, 0, 1, 1, -10657.1, 1054.63, 32.6733, 2.47837),
+(152380, 16592, 0, 1, 1, -3448.2, -938.102, 10.6583, 0.034907),
+(152381, 16592, 0, 1, 1, -9394.21, 37.5017, 59.882, 1.15192),
+(152382, 16592, 0, 1, 1, -8245.62, -2623.9, 133.155, 4.04776),
+(152383, 16592, 0, 1, 1, -10951.5, -3218.1, 41.3475, 1.91986),
+(152384, 16592, 0, 1, 1, -1211.6, -2676.88, 45.3612, -0.645772),
+(152385, 16592, 0, 1, 1, -14288.1, 61.8062, 0.68836, 1.37881),
+(152386, 16592, 0, 1, 1, -5404.93, -492.299, 395.597, -0.506145),
+(152387, 16592, 0, 1, 1, -10704.8, -1146.38, 24.7909, 2.09439),
+(152388, 16592, 0, 1, 1, -5233.16, -2893.37, 337.286, -0.226893),
+(152389, 16592, 0, 1, 1, -9434.3, -2110.36, 65.8038, 0.349066),
+(152390, 16592, 571, 1, 1, 4122.37, 5390.27, 27.8408, 5.32484),
+(152391, 16592, 571, 1, 1, 3936.15, -583.456, 240.5, 4.0611),
+(152392, 16592, 571, 1, 1, 3403.4, -2896.41, 201.988, 2.32303),
+(152393, 16592, 571, 1, 1, 2454.19, -4910.31, 263.893, 1.66082),
+(152394, 16592, 571, 1, 1, 5626.92, -2622.29, 292.417, 1.6785),
+(152395, 16592, 571, 1, 1, 6081.58, -1107.81, 419.498, 5.2117),
+(152396, 16592, 571, 1, 1, 5369.18, 4842.41, -197.357, 4.53948),
+(152397, 16592, 571, 1, 1, 5144.94, -695.736, 171.284, 5.22017),
+(152398, 16592, 530, 1, 1, -3941.98, 2048.49, 95.0656, 4.87742),
+(152399, 16592, 530, 1, 1, -2526.69, 7548.83, -2.23534, 5.32817),
+(152400, 16592, 530, 1, 1, 3121.5, 3753.88, 141.851, 5.85856),
+(152401, 16592, 530, 1, 1, -528.509, 2339.11, 38.7252, 2.14675),
+(152402, 16592, 530, 1, 1, -3004.07, 4152.48, 3.64988, 1.75455),
+(152403, 16592, 530, 1, 1, 2019.7, 6587.14, 134.985, 6.23705),
+(152404, 16592, 530, 1, 1, 192.209, 6015.13, 22.1067, 0.00709009);
+-- #5
+-- Remove unused guids from creature_addon after removal of some double spawns /that would give warning on start-up/
+DELETE FROM `creature_addon` WHERE `guid` IN (86232,86242,86243,86244,86245,86246,86247,86248,86249,86250,86251,86252,86253,86254,86255,86256,86258,86259,86260,86261,86262,86264,86265,86266,86267,86268,86329,86711,90490,94551,94553,94554,94555,94556,94557,94605,94704,94777,94778,94779,94780,94781,94782,94783,94784,94785,94787,94788,94789,94790,94791,94792,94793,94794,94795,94796,94797,94798,94799,94800);
+-- #6
+-- Add correct data for Midsummer Bonfire
+UPDATE `gameobject_template` SET `type`=8, `data0`=1365, `data1`=10, `data10`=0, `data12`=0 WHERE `entry`=181288; -- /this is blizzard data I know is a WDB edit, but it won't hurt to stay here for people that will use it someday or till we get parsed outside of 12340./
+-- #7
+
+-- #8
+-- Add condition for Stamp Out fire steam to target bunnies only on complete of any of the Desecrate the Fires quests
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=45437;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition` ,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,45437,0,0,31,0,3,16592,0,0,0,'','Steam can only target bunnies');
+-- #9
+-- Set Eearthen Ring Elder ID: 26221 friendly to both factions as it should be
+UPDATE `creature_template` SET `faction`=1727 WHERE `entry`=26221;
+-- #10
+-- Add proper level requirements, remove disables /flag no idea why it was set/ for Earthern ring daillies and chain fix up of some quest relations
+UPDATE `quest_template` SET `QuestType`=2 WHERE `Id`=11917; -- Striking Back
+UPDATE `quest_template` SET `QuestType`=2 WHERE `Id`=11947; -- -//-
+UPDATE `quest_template` SET `QuestType`=2 WHERE `Id`=11948; -- -//-
+UPDATE `quest_template` SET `QuestType`=2 WHERE `Id`=11952; -- -//-
+UPDATE `quest_template` SET `QuestType`=2 WHERE `Id`=11953; -- -//-
+UPDATE `quest_template` SET `QuestType`=2 WHERE `Id`=11954; -- -//-
+UPDATE `quest_template` SET `QuestType`=2 WHERE `Id`=11955; -- Ahune, the Frost Lord
+UPDATE `quest_template_addon` SET `PrevQuestId`=12012,`MaxLevel`=28 WHERE `Id`=11917; -- Striking Back
+UPDATE `quest_template_addon` SET `PrevQuestId`=12012,`MaxLevel`=38 WHERE `Id`=11947; -- -//-
+UPDATE `quest_template_addon` SET `PrevQuestId`=12012,`MaxLevel`=48 WHERE `Id`=11948; -- -//-
+UPDATE `quest_template_addon` SET `PrevQuestId`=12012,`MaxLevel`=55 WHERE `Id`=11952; -- -//-
+UPDATE `quest_template_addon` SET `PrevQuestId`=12012,`MaxLevel`=63 WHERE `Id`=11953; -- -//-
+UPDATE `quest_template_addon` SET `PrevQuestId`=12012 WHERE `Id`=11954; -- -//-
+UPDATE `quest_template_addon` SET `PrevQuestId`=12012 WHERE `Id`=11955; -- Ahune, the Frost Lord
+UPDATE `quest_template_addon` SET `PrevQuestId`=11955 WHERE `Id`=11696; -- Ahune is here!
+
+
+-- #12
+-- Disable deprecated quests /in 2008/ from Midsummer Fire Festival
+DELETE FROM `disables` WHERE `sourceType` = 1 AND `entry` in (9388,9322,9389,9323);
+INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES
+(1,9388,0,0,0,'Disable quest Flickering Flames in Kalimdor /Deprecated after 2008/'),
+(1,9322,0,0,0,'Disable quest Wild Fires in Kalimdor /Deprecated after 2008/'),
+(1,9389,0,0,0,'Disable quest Flickering Flames in the Eastern Kingdoms /Deprecated after 2008/'),
+(1,9323,0,0,0,'Disable quest Wild Fires in Eastern Kingdoms /Deprecated after 2008/');
+-- #13
+-- Fix relations of More Torch Tossing and Catching quests
+UPDATE `quest_template_addon` SET `PrevQuestId`=11731 WHERE `Id`=11921; -- More Torch Tossing /A/
+UPDATE `quest_template_addon` SET `PrevQuestId`=11922 WHERE `Id`=11926; -- More Torch Tossing /H/
+UPDATE `quest_template_addon` SET `PrevQuestId`=11657 WHERE `Id`=11924; -- More Torch Catching /A/
+UPDATE `quest_template_addon` SET `PrevQuestId`=11923 WHERE `Id`=11925; -- More Torch Catching /H/
+-- Add missing quest relations for the mentioned above quest's questgivers
+DELETE FROM `creature_queststarter` WHERE `quest` IN (11921,11924,11925,11926);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(25975, 11921), -- Master fire eater
+(25975, 11924), -- Master fire eater
+(26113, 11925), -- Master flame eater
+(26113, 11926); -- Master flame eater
+
+-- #14
+-- Add missing objects and creatures from capital cities and fix some minor misc on already spawned ones
+-- The Exodar
+DELETE FROM `gameobject` WHERE `guid` IN (165509,165510,165511,165512,165513,165514,165515,165516,165517,165518,165519,165520,165521,165522,165523,165524,165525);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165509, 181376, 530, 1, 1, -3794.02, -11502.1, -134.74, 5.00689, 0, 0, 0.59571, -0.8032, 300, 0, 1),
+(165510, 188128, 530, 1, 1, -3794.02, -11502.1, -134.74, 5.00689, 0, 0, 0.59571, -0.8032, 300, 0, 1),
+(165511, 181305, 530, 1, 1, -3794.46, -11519.8, -134.94, 1.89985, 0, 0, 0.813373, 0.581743, 300, 0, 1),
+(165512, 181307, 530, 1, 1, -3795.81, -11519.3, -133.928, 0.0211825, 0, 0, 0.010591, 0.999944, 300, 0, 1),
+(165513, 181302, 530, 1, 1, -3800.48, -11515.8, -134.966, 6.21562, 0, 0, 0.0337776, -0.999429, 300, 0, 1),
+(165514, 181302, 530, 1, 1, -3800.87, -11517.1, -135.02, 2.979, 0, 0, 0.996697, 0.0812088, 300, 0, 1),
+(165515, 181302, 530, 1, 1, -3800.86, -11516.4, -133.722, 2.56666, 0, 0, 0.958966, 0.283523, 300, 0, 1),
+(165516, 181306, 530, 1, 1, -3799.04, -11517.6, -134.986, 3.29551, 0, 0, 0.99704, -0.0768831, 300, 0, 1),
+(165517, 188020, 530, 1, 1, -3793.84, -11533.9, -134.975, 5.90226, 0, 0, 0.189314, -0.981916, 300, 0, 1),
+(165518, 188020, 530, 1, 1, -3774.53, -11496.2, -134.493, 2.69547, 0, 0, 0.975225, 0.221214, 300, 0, 1),
+(165519, 181355, 530, 1, 1, -3772.21, -11491.7, -134.447, 4.23172, 0, 0, 0.855095, -0.518471, 300, 0, 1),
+(165520, 181355, 530, 1, 1, -3797.16, -11540.5, -134.957, 1.12154, 0, 0, 0.531839, 0.846846, 300, 0, 1),
+(165521, 187708, 530, 1, 1, -3768.73, -11511.2, -134.479, 2.70805, 0, 0, 0.976597, 0.215078, 300, 0, 1),
+(165522, 187708, 530, 1, 1, -3773.26, -11519.4, -134.56, 2.53526, 0, 0, 0.954396, 0.298543, 300, 0, 1),
+(165523, 187708, 530, 1, 1, -3776.32, -11511.5, -134.569, 5.69256, 0, 0, 0.291037, -0.956712, 300, 0, 1),
+(165524, 187708, 530, 1, 1, -3775.23, -11506.7, -134.539, 5.79074, 0, 0, 0.243745, -0.969839, 300, 0, 1),
+(165525, 187708, 530, 1, 1, -3780.47, -11514.1, -134.626, 5.66115, 0, 0, 0.30603, -0.952022, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (152405,152406,152407);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(152405, 26221, 530, 1, 1, 0, 1, -3796.67, -11496.8, -134.748, 2.2101, 300, 0, 0, 8982, 3155, 0, 0, 0, 0),
+(152406, 16781, 530, 1, 1, 0, 0, -3814.35, -11505.7, -138.534, 2.81721, 120, 0, 0, 1, 0, 0, 0, 0, 0),
+(152407, 16781, 530, 1, 1, 0, 0, -3816.08, -11510.3, -138.573, 1.88337, 120, 0, 0, 1, 0, 0, 0, 0, 0);
+UPDATE `creature` SET `modelid`=21084 WHERE `guid`=202765;
+UPDATE `gameobject_template` SET `faction`=1735 WHERE `entry`=188128; -- Set faction for Exodar flame so it can be looted only by alliance
+-- Silvermoon
+DELETE FROM `creature` WHERE `guid` IN (152408);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(152408, 26124, 530, 1, 1, 0, 0, 9790.85, -7250.58, 26.1002, 5.48896, 300, 0, 0, 3524, 0, 0, 0, 0, 0);
+DELETE FROM `gameobject` WHERE `guid` IN (165550,165551,165552,165553,165554,165555,165556,165557);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165550, 181306, 530, 1, 1, 9791.79, -7248.75, 26.0815, 4.80477, 0, 0, 0.673703, -0.739003, 300, 0, 1),
+(165551, 187708, 530, 1, 1, 9817.67, -7227.84, 26.1104, 3.89843, 0, 0, 0.929251, -0.36945, 300, 0, 1),
+(165552, 187708, 530, 1, 1, 9810.38, -7226.95, 26.0582, 0.898206, 0, 0, 0.434157, 0.900837, 300, 0, 1),
+(165553, 187708, 530, 1, 1, 9819.87, -7234.51, 26.1176, 0.898206, 0, 0, 0.434157, 0.900837, 300, 0, 1),
+(165554, 187708, 530, 1, 1, 9823.56, -7229.12, 26.1209, 3.78847, 0, 0, 0.948148, -0.317829, 300, 0, 1),
+(165555, 187708, 530, 1, 1, 9817.55, -7221.36, 26.1142, 3.80025, 0, 0, 0.946259, -0.323409, 300, 0, 1),
+(165556, 188020, 530, 1, 1, 9819.17, -7251.91, 26.1485, 5.37496, 0, 0, 0.438667, -0.89865, 300, 0, 1),
+(165557, 188020, 530, 1, 1, 9795.99, -7270.21, 26.3648, 2.06541, 0, 0, 0.858689, 0.512496, 300, 0, 1);
+UPDATE `creature` SET `modelid`=21085 WHERE `guid`=202746;
+UPDATE `creature` SET `modelid`=21086 WHERE `guid`=202749;
+UPDATE `creature` SET `modelid`=16436 WHERE `guid`=202748;
+UPDATE `gameobject_template` SET `faction`=1732 WHERE `entry`=188129; -- Set faction for Silvermoon flame so it can be looted only by horde
+-- Undercity and Ironforge missing stuff and double spawns
+DELETE FROM `gameobject` WHERE `guid` IN (165581,165582,165583);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165581, 188021, 0, 1, 1, 1802.13, 222.644, 59.9682, 1.02433, 0, 0, 0.490064, 0.871686, 300,100,1),
+(165582, 188021, 0, 1, 1, -4711.33, -1224.68, 501.66, 3.95557, 0, 0, 0.918317, -0.395846, 300,100,1),
+(165583, 181376, 0, 1, 1, -4700.28, -1224.34, 501.659, -2.14675, 0, 0, 0.878817, -0.477159, 180,100,1);
+DELETE FROM `creature` WHERE `guid` IN (202858,202859,202863,202861,202860,86165,202862);
+DELETE FROM `creature_addon` WHERE `guid` IN (202858,202859,202863,202861,202860,86165,202862);
+-- Stormwind and Darnassus
+DELETE FROM `gameobject` WHERE `guid` IN (165607,165608,165609,165610,165612,165613,165614,165615,165616,165617,165618);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165607, 181305, 0, 1, 1, -8833.44, 875.047, 98.5645, 3.04849, 0, 0, 0.998917, 0.0465366, 300, 0, 1),
+(165608, 181307, 0, 1, 1, -8832.66, 876.386, 99.5549, 4.18967, 0, 0, 0.865805, -0.500381, 300, 0, 1),
+(165609, 181302, 0, 1, 1, -8831.75, 880.124, 98.4636, 4.62321, 0, 0, 0.737923, -0.674885, 300, 0, 1),
+(165610, 181302, 0, 1, 1, -8829.84, 879.278, 98.5062, 5.90498, 0, 0, 0.187978, -0.982173, 300, 0, 1),
+(165612, 181302, 0, 1, 1, -8830.09, 879.49, 99.7495, 3.72942, 0, 0, 0.957117, -0.289703, 300, 0, 1),
+(165613, 181306, 0, 1, 1, -8830.36, 881.029, 98.4529, 4.14019, 0, 0, 0.877919, -0.478809, 300, 0, 1),
+(165614, 187708, 0, 1, 1, -8816.54, 854.183, 98.882, 4.34518, 0, 0, 0.824323, -0.56612, 300, 0, 1),
+(165615, 187708, 0, 1, 1, -8815.11, 860.487, 98.96, 4.75751, 0, 0, 0.690976, -0.722877, 300, 0, 1),
+(165616, 187708, 0, 1, 1, -8818.01, 865.253, 98.9761, 4.47084, 0, 0, 0.787149, -0.616763, 300, 0, 1),
+(165617, 181306, 1, 1, 1, 8705.34, 970.3, 12.2316, 5.19882, 0, 0, 0.516009, -0.856583, 300, 0, 1),
+(165618, 181307, 1, 1, 1, 8703.78, 967.116, 13.6598, 4.10868, 0, 0, 0.885353, -0.46492, 300, 0, 1);
+DELETE FROM `creature` WHERE `guid` IN (165584,165585,165586,165587,165588,165589,94739);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(165584, 16781, 0, 1, 1, 16434, 0, -8823.33, 857.655, 99.0305, 1.57502, 300, 0, 0, 2614, 0, 0, 0, 0, 0),
+(165585, 16781, 0, 1, 1, 16433, 0, -8824.21, 861.431, 98.9968, 4.82972, 300, 0, 0, 4050, 0, 0, 0, 0, 0),
+(165586, 16781, 0, 1, 1, 16433, 0, -8826.99, 859.058, 99.0299, 0.149527, 300, 0, 0, 3331, 0, 0, 0, 0, 0),
+(165587, 26221, 0, 1, 1, 0, 1, -8832.81, 861.687, 98.8931, 0.880735, 300, 0, 0, 8982, 3155, 0, 0, 0, 0),
+(165588, 26123, 0, 1, 1, 0, 0, -8827.68, 875.783, 98.6689, 4.60823, 300, 0, 0, 3524, 0, 0, 0, 0, 0),
+(165589, 16817, 0, 1, 1, 0, 0, -8831.73, 854.756, 99.1285, 5.71407, 300, 0, 0, 3052, 0, 0, 0, 0, 0),
+(94739, 16781, 1, 1, 1, 16434, 0, 8720.84, 963.484, 11.851, 1.43676, 300, 0, 0, 1524, 0, 0, 0, 0, 0);
+-- #15
+-- Add SAIS for all of mentioned above /data taken from Blua project specific .lua and BrantX creator/
+SET @Flameguard := 25866;
+SET @Firesworn := 25863;
+SET @Viktor := 25924;
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=25866; -- set levels for Twilight Flameguards
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=25863; -- set levels for Twilight Firesworns
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=25924; -- set levels for Twilight Speaker Viktor
+-- Firesworn
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Firesworn;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Firesworn,0,0,0,0,0,100,0,0,1000,7000,7500,11,20793,0,0,0,0,0,2,0,0,0,0,0,0,0,'Firesworn - IC - Cast spell Fireball on victim'),
+(@Firesworn,0,1,0,4,0,100,0,0,0,0,0,11,184,0,0,0,0,0,1,0,0,0,0,0,0,0,'Firesworn - On aggro - Cast fiire shield on self /no need for remove aura event, sice it is only 1 minute long/');
+-- Viktor
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Viktor;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Viktor,0,0,0,0,0,100,0,0,1000,7000,7500,11,20793,0,0,0,0,0,2,0,0,0,0,0,0,0,'Viktor - IC - Cast spell Fireball on victim');
+-- #16
+-- #18
+-- Full support for quests with name Striking Back and full support for everything they are connected with
+-- General support for Striking Back quests = tons of things + SAIs... Add missing object from gameobject_template
+DELETE FROM `gameobject_template` WHERE `entry` IN (188134,188135,188139,188145,188146,188147);
+INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `size`, `name`, `data1`, `data2`, `data3`, `data6`, `VerifiedBuild`) VALUES
+(188134, 2, 7666, 1, 'Ice Stone', 0, 3, 9258, 0, 11723), -- /Ice stone/ this is a proven missing gameobject and the data is as of 11723 same model one taken from
+(188135, 2, 7666, 1, 'Ice Stone', 0, 3, 9259, 0, 11723), -- /Ice stone/ this is a proven missing gameobject and the data is as of 11723 same model one taken from
+(188139, 2, 7666, 1, 'Ice Stone', 0, 3, 9260, 0, 11723), -- /Ice stone/ this is a proven missing gameobject and the data is as of 11723 same model one taken from
+(188145, 2, 7666, 1, 'Ice Stone', 0, 3, 9266, 0, 11723), -- /Ice stone/ this is a proven missing gameobject and the data is as of 11723 same model one taken from
+(188146, 2, 7666, 1, 'Ice Stone', 0, 3, 9267, 0, 11723), -- /Ice stone/ this is a proven missing gameobject and the data is as of 11723 same model one taken from
+(188147, 2, 7666, 1, 'Ice Stone', 0, 3, 9268, 0, 11723); -- /Ice stone/ this is a proven missing gameobject and the data is as of 11723 same model one taken from
+-- Add missing gossip menus and options//I still don't get the idea for all the gossips and even different for same functions, but I'm just following the WDB example
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9258,9259,9260,9266,9267,9268,9213,9256,9257,9264,9265,9269,9271,9272,9273,9274,9275,9276);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`, `OptionBroadcastTextID`) VALUES
+(9258,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218), -- Desolace
+(9259,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9260,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9266,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218), -- Searing Gorge
+(9267,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9268,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9213,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218), -- Ashenvale
+(9256,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9257,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9264,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218), -- Stranglethorn
+(9265,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9269,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218), -- Silithus
+(9271,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9272,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9273,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218), -- Hellfire
+(9274,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9275,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218),
+(9276,0,0, 'Lay your hand on the Ice Stone.',1,1,0,0,0,0, '',25218);
+DELETE FROM `gossip_menu` WHERE `entry` IN (9258,9259,9260,9266,9267,9268,9213,9256,9257,9264,9265,9269,9271,9272,9273,9274,9275,9276);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(9258,12524),
+(9259,12524),
+(9260,12524),
+(9266,12524),
+(9267,12524),
+(9268,12524),
+(9213,12524),
+(9256,12524),
+(9257,12524),
+(9264,12524),
+(9265,12524),
+(9269,12524),
+(9271,12524),
+(9272,12524),
+(9273,12524),
+(9274,12524),
+(9275,12524),
+(9276,12524);
+-- Add conditions for gossip menus
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (9258,9259,9260,9266,9267,9268,9213,9256,9257,9264,9265,9269,9271,9272,9273,9274,9275,9276);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition` ,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,9213,0,0,0,9,0,11917,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Ashenvale/'),
+(15,9256,0,0,0,9,0,11917,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Ashenvale/'),
+(15,9257,0,0,0,9,0,11917,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Ashenvale/'),
+(15,9258,0,0,0,9,0,11947,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Desolace/'),
+(15,9259,0,0,0,9,0,11947,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Desolace/'),
+(15,9260,0,0,0,9,0,11947,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Desolace/'),
+(15,9264,0,0,0,9,0,11948,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Stranglethorn/'),
+(15,9265,0,0,0,9,0,11948,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Stranglethorn/'),
+(15,9266,0,0,0,9,0,11952,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Searing Gorge/'),
+(15,9267,0,0,0,9,0,11952,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Searing Gorge/'),
+(15,9268,0,0,0,9,0,11952,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Searing Gorge/'),
+(15,9269,0,0,0,9,0,11953,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Silithus/'),
+(15,9271,0,0,0,9,0,11953,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Silithus/'),
+(15,9272,0,0,0,9,0,11953,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Silithus/'),
+(15,9273,0,0,0,9,0,11954,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Hellfire/'),
+(15,9274,0,0,0,9,0,11954,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Hellfire/'),
+(15,9275,0,0,0,9,0,11954,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Hellfire/'),
+(15,9276,0,0,0,9,0,11954,0,0,0,0,'','Ice Stone - For Gossip player must have Striking back /Hellfire/');
+-- Add all missing go spawns for Striking Back quests and decorations connected with it
+DELETE FROM `gameobject` WHERE `guid` IN (165715,165723,165747,165748,165749,165773,165774,165800,165801,165802,165803,165827,165828,165829,165830,165831,165832,165833,165834,165835,165837,165838,165839,165840,165841,165842,165843,165844,165845,165846,165847,165848,165849,165850,165851,165852,165853,165854,165855,165856,165857,165858,165859,165860,165862,165886,165887,165888,165889,165890,165914,165915,165916,165917,165918,165919,165920,165921,165922,165923,165924,165925,165926,165951,165952,165953,165954,165955,165956,165957,165958,165959,165960,165961,165962,165963,165964);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(165715, 188048, 1, 1, 1, -461.769, 2472.11, 104.848, 4.40434, 0, 0, 0.807217, -0.590254, 300, 0, 1),
+(165723, 188048, 0, 1, 1, -12196, 887.421, 0.59987, 0.486257, 0, 0, 0.24074, 0.97059, 300, 0, 1),
+(165747, 188050, 0, 1, 1, -12196.5, 887.828, 2.72441, 1.8615, 0, 0, 0.802067, 0.597233, 300, 0, 1),
+(165748, 188143, 0, 1, 1, -12196.5, 887.828, 2.72441, 1.8615, 0, 0, 0.802067, 0.597233, 300, 0, 1),
+(165749, 188048, 0, 1, 1, -12170.1, 860.773, 19.0948, 1.7209, 0, 0, 0.758137, 0.652095, 300, 0, 1),
+(165773, 188050, 0, 1, 1, -12169.5, 860.835, 21.2184, 3.2917, 0, 0, 0.997185, -0.0749834, 300, 0, 1),
+(165774, 188144, 0, 1, 1, -12169.5, 860.835, 21.2184, 3.2917, 0, 0, 0.997185, -0.0749834, 300, 0, 1),
+(165800, 188050, 1, 1, 1, -462.112, 2472.26, 106.971, 5.9398, 0, 0, 0.170852, -0.985297, 300, 0, 1),
+(165801, 188134, 1, 1, 1, -462.112, 2472.26, 106.571, 5.9398, 0, 0, 0.170852, -0.985297, 300, 0, 1),
+(165802, 188048, 1, 1, 1, -438.441, 2451.37, 103.147, 1.53371, 0, 0, 0.693872, 0.720098, 300, 0, 1),
+(165803, 188048, 1, 1, 1, -465.8, 2452.56, 100.004, 5.15439, 0, 0, 0.534909, -0.84491, 300, 0, 1),
+(165827, 188050, 1, 1, 1, -437.932, 2451.39, 105.271, 3.04952, 0, 0, 0.99894, 0.0460223, 300, 0, 1),
+(165828, 188135, 1, 1, 1, -437.932, 2451.39, 105.271, 3.04952, 0, 0, 0.99894, 0.0460223, 300, 0, 1),
+(165829, 188050, 1, 1, 1, -466.49, 2452.25, 102.127, 0.38702, 0, 0, 0.192305, 0.981335, 300, 0, 1),
+(165830, 188139, 1, 1, 1, -466.49, 2452.25, 102.127, 0.38702, 0, 0, 0.192305, 0.981335, 300, 0, 1),
+(165831, 187989, 1, 1, 1, -437.406, 2438.64, 106.645, 2.94349, 0, 0, 0.995098, 0.0988888, 300, 0, 1),
+(165832, 187989, 1, 1, 1, -480.744, 2434.37, 99.8844, 0.284917, 0, 0, 0.141977, 0.98987, 300, 0, 1),
+(165833, 187989, 1, 1, 1, -475.681, 2367.79, 96.9422, 4.35126, 0, 0, 0.822596, -0.568627, 300, 0, 1),
+(165834, 187989, 1, 1, 1, -509.534, 2404.15, 97.0855, 0.344939, 0, 0, 0.171616, 0.985164, 300, 0, 1),
+(165835, 187989, 1, 1, 1, -451.373, 2483.46, 111.352, 4.62147, 0, 0, 0.738511, -0.674241, 300, 0, 1),
+(165837, 187918, 1, 1, 1, -479.677, 2420.32, 94.6018, 3.65464, 0, 0, 0.967278, -0.253719, 300, 0, 1),
+(165838, 187918, 1, 1, 1, -451.718, 2430.49, 98.9137, 0.354041, 0, 0, 0.176097, 0.984373, 300, 0, 1),
+(165839, 187918, 0, 1, 1, -12189.7, 842.621, 10.5679, 6.20423, 0, 0, 0.0394675, -0.999221, 300, 0, 1),
+(165840, 187918, 0, 1, 1, -12168.5, 835.455, 11.7295, 5.8885, 0, 0, 0.196064, -0.980591, 300, 0, 1),
+(165841, 187989, 0, 1, 1, -12178.2, 801.785, 2.18033, 3.98705, 0, 0, 0.911973, -0.410251, 300, 0, 1),
+(165842, 187989, 0, 1, 1, -12236.1, 837.722, 2.50857, 0.752642, 0, 0, 0.367501, 0.930023, 300, 0, 1),
+(165843, 187989, 0, 1, 1, -12156.2, 934.719, 2.21955, 4.7244, 0, 0, 0.702848, -0.71134, 300, 0, 1),
+(165844, 187989, 0, 1, 1, -12112.9, 870.413, 9.49334, 2.21505, 0, 0, 0.894596, 0.446876, 300, 0, 1),
+(165845, 188048, 0, 1, 1, -6636.4, -665.27, 233.754, 5.32295, 0, 0, 0.461881, -0.886942, 300, 0, 1),
+(165846, 188050, 0, 1, 1, -6637.01, -665.525, 235.876, 0.528097, 0, 0, 0.260991, 0.965341, 300, 0, 1),
+(165847, 188145, 0, 1, 1, -6637.01, -665.525, 235.876, 0.528097, 0, 0, 0.260991, 0.965341, 300, 0, 1),
+(165848, 188048, 0, 1, 1, -6603.47, -644.717, 233.754, 2.32509, 0, 0, 0.917816, 0.397006, 300, 0, 1),
+(165849, 188050, 0, 1, 1, -6603.16, -644.701, 235.877, 3.89824, 0, 0, 0.929285, -0.369364, 300, 0, 1),
+(165850, 188146, 0, 1, 1, -6603.16, -644.701, 235.877, 3.89824, 0, 0, 0.929285, -0.369364, 300, 0, 1),
+(165851, 188048, 0, 1, 1, -6620.78, -624.053, 233.755, 3.24086, 0, 0, 0.998768, -0.0496152, 300, 0, 1),
+(165852, 188050, 0, 1, 1, -6620.71, -623.62, 235.878, 4.71892, 0, 0, 0.704796, -0.70941, 300, 0, 1),
+(165853, 188147, 0, 1, 1, -6620.71, -623.62, 235.878, 4.71892, 0, 0, 0.704796, -0.70941, 300, 0, 1),
+(165854, 187989, 0, 1, 1, -6595.95, -663.852, 238.42, 5.19351, 0, 0, 0.518277, -0.855213, 300, 0, 1),
+(165855, 187989, 0, 1, 1, -6602.66, -667.151, 238.82, 3.59601, 0, 0, 0.974298, -0.225261, 300, 0, 1),
+(165856, 187989, 0, 1, 1, -6595.89, -691.631, 244.639, 4.34765, 0, 0, 0.823623, -0.567138, 300, 0, 1),
+(165857, 187989, 0, 1, 1, -6609.54, -690.698, 243.926, 3.1939, 0, 0, 0.999658, -0.0261491, 300, 0, 1),
+(165858, 187989, 0, 1, 1, -6611.29, -717.496, 247.221, 4.26282, 0, 0, 0.846928, -0.531708, 300, 0, 1),
+(165859, 187989, 0, 1, 1, -6621.53, -714.911, 247.568, 4.22355, 0, 0, 0.857204, -0.514977, 300, 0, 1),
+(165860, 187918, 0, 1, 1, -6637.37, -651.561, 241.749, 5.72995, 0, 0, 0.273105, -0.961984, 300, 0, 1),
+(165862, 188157, 530, 1, 1, -156.232, 1137.98, 26.5052, 0.537575, 0, 0, 0.265563, 0.964094, 300, 0, 1),
+(165886, 188156, 530, 1, 1, -155.708, 1136.65, 41.5227, 1.07635, 0, 0, 0.512571, 0.858645, 300, 0, 1),
+(165887, 188151, 530, 1, 1, -155.708, 1136.65, 41.5227, 1.07635, 0, 0, 0.512571, 0.858645, 300, 0, 1),
+(165888, 188157, 530, 1, 1, -350.997, 1130.78, 25.645, 2.66284, 0, 0, 0.971486, 0.237097, 300, 0, 1),
+(165889, 188157, 530, 1, 1, -132.353, 1203.6, 26.5964, 3.86685, 0, 0, 0.934967, -0.354735, 300, 0, 1),
+(165890, 188157, 530, 1, 1, -356.812, 1209.86, 24.809, 1.975, 0, 0, 0.374167, -0.927362, 300, 0, 1),
+(165914, 188156, 530, 1, 1, -349.997, 1132.78, 40.645, 0.0623619, 0, 0, 0.0311759, 0.999514, 300, 0, 1),
+(165915, 188152, 530, 1, 1, -349.997, 1132.18, 40.645, 0.0623619, 0, 0, 0.0311759, 0.999514, 300, 0, 1),
+(165916, 188156, 530, 1, 1, -133.263, 1204.24, 41.6632, 3.20002, 0, 0, 0.999573, -0.0292117, 300, 0, 1),
+(165917, 188153, 530, 1, 1, -133.263, 1204.24, 41.6632, 3.20002, 0, 0, 0.999573, -0.0292117, 300, 0, 1),
+(165918, 188156, 530, 1, 1, -355.812, 1209.86, 39.809, 1.975, 0, 0, 0.657948, -0.753063, 300, 0, 1),
+(165919, 188154, 530, 1, 1, -355.812, 1209.86, 39.809, 1.975, 0, 0, 0.657948, -0.753063, 300, 0, 1),
+(165920, 187989, 530, 1, 1, -168.654, 1223.93, 39.5249, 5.54051, 0, 0, 0.362863, -0.931843, 300, 0, 1),
+(165921, 187989, 530, 1, 1, -134.98, 1219.16, 39.9083, 4.46029, 0, 0, 0.790393, -0.6126, 300, 0, 1),
+(165922, 187989, 530, 1, 1, -164.647, 1183.49, 41.5094, 3.56022, 0, 0, 0.978174, -0.207788, 300, 0, 1),
+(165923, 187989, 530, 1, 1, -134.178, 1162.87, 41.4418, 4.88283, 0, 0, 0.644354, -0.764728, 300, 0, 1),
+(165924, 187989, 530, 1, 1, -157.004, 1100.52, 41.6002, 4.75795, 0, 0, 0.690816, -0.723031, 300, 0, 1),
+(165925, 187989, 530, 1, 1, -106.606, 1106.62, 47.2494, 6.25021, 0, 0, 0.0164877, -0.999864, 300, 0, 1),
+(165926, 187989, 530, 1, 1, -164.571, 1126.64, 50.9746, 1.11604, 0, 0, 0.52951, 0.848304, 300, 0, 1),
+(165951, 187918, 530, 1, 1, -341.539, 1149.69, 41.516, 1.49258, 0, 0, 0.678919, 0.734213, 300, 0, 1),
+(165952, 187989, 530, 1, 1, -346.156, 1149.88, 41.4797, 1.74469, 0, 0, 0.765839, 0.643032, 300, 0, 1),
+(165953, 187918, 530, 1, 1, -312.724, 1109.74, 41.6732, 3.11521, 0, 0, 0.999913, 0.0131916, 300, 0, 1),
+(165954, 187918, 530, 1, 1, -342.656, 1109.48, 41.8743, 3.19845, 0, 0, 0.999596, -0.0284273, 300, 0, 1),
+(165955, 187918, 530, 1, 1, -364.933, 1103.83, 45.7432, 0.55952, 0, 0, 0.276125, 0.961122, 300, 0, 1),
+(165956, 187989, 530, 1, 1, -370.16, 1104.04, 47.8775, 0.147176, 0, 0, 0.0735218, 0.997294, 300, 0, 1),
+(165957, 187918, 530, 1, 1, -371.512, 1154.24, 44.431, 3.18689, 0, 0, 0.999744, -0.0226447, 300, 0, 1),
+(165958, 187989, 530, 1, 1, -375.946, 1154.04, 45.4371, 3.18689, 0, 0, 0.999744, -0.0226447, 300, 0, 1),
+(165959, 187918, 530, 1, 1, -311.412, 1157.12, 41.3469, 3.19238, 0, 0, 0.999678, -0.0253915, 300, 0, 1),
+(165960, 187989, 530, 1, 1, -328.448, 1168.73, 41.6186, 3.31726, 0, 0, 0.996145, -0.0877198, 300, 0, 1),
+(165961, 187918, 530, 1, 1, -366.923, 1194.76, 41.3963, 3.25757, 0, 0, 0.998319, -0.0579546, 300, 0, 1),
+(165962, 187918, 530, 1, 1, -370.988, 1223.35, 38.3536, 5.61533, 0, 0, 0.327755, -0.944763, 300, 0, 1),
+(165963, 187989, 530, 1, 1, -337.191, 1228.54, 37.9438, 4.89356, 0, 0, 0.640242, -0.768173, 300, 0, 1),
+(165964, 187989, 530, 1, 1, -359.076, 1221.14, 38.6201, 0.0453942, 0, 0, 0.0226952, 0.999742, 300, 0, 1);
+-- Add SAIs for the all the Ice Stones
+-- Desolace
+SET @Script := 18813400;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188134;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188134;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188134,1,0,0,62,0,100,0,9258,0,0,0,80,@Script,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 00
+(@Script,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script,9,1,0,0,0,100,0,1000,1000,0,0,12,26178,3,120000,0,0,0,8,0,0,0,-458.956787,2471.237061,106.895035,5.979829,'Actionlist - On action 1 - Summon Hailstone Lieutenant'),
+(@Script,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script1 := 18813500;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188135;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188135;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script1;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188135,1,0,0,62,0,100,0,9259,0,0,0,80,@Script1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 01
+(@Script1,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script1,9,1,0,0,0,100,0,1000,1000,0,0,12,26178,3,120000,0,0,0,8,0,0,0,-441.233276,2451.243164,105.240685,2.942712,'Actionlist - On action 1 - Summon Hailstone Lieutenant'),
+(@Script1,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script2 := 18813900;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188139;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188139;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script2;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188139,1,0,0,62,0,100,0,9260,0,0,0,80,@Script2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 02
+(@Script2,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script2,9,1,0,0,0,100,0,1000,1000,0,0,12,26178,3,120000,0,0,0,8,0,0,0,-463.070892,2454.063965,102.002838,0.519758,'Actionlist - On action 1 - Summon Hailstone Lieutenant'),
+(@Script2,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Hailstone := 26178;
+UPDATE `creature_template` SET `resistance3`=1000, `AIName`= 'SmartAI' WHERE `entry`=@Hailstone;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Hailstone;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Hailstone,0,0,0,0,0,100,0,7500,15000,15000,25000,11,5164,0,0,0,0,0,2,0,0,0,0,0,0,0,'Hailstone Lieutenant - IC - Cast Knockback'),
+(@Hailstone,0,1,0,2,0,100,1,20,60,0,0,11,5276,0,0,0,0,0,2,0,0,0,0,0,0,0,'Hailstone Lieutenant - On HP %/20-60/ - Cast Freeze'),
+(@Hailstone,0,2,0,4,0,100,1,0,0,0,0,1,0,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Hailstone Lieutenant - On aggro - Say text 0');
+-- Hailstone Lieutenant texts
+DELETE FROM `creature_text` WHERE `entry`= @Hailstone;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`, `BroadcastTextId`) VALUES
+(@Hailstone,0,0,'You will not stop the Frost Lord from entering this world, mortal. The Tidehunter''s might will crush that of Ragnaros once and for all, leaving your land a frozen paradise!',12,0,100,1,2000,0,'Hailstone Lieutenant intro speech', 25372);
+-- Missing spawns for Heretic Crystal Guards + fix creature_template data
+SET @Guard := 26166;
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@Guard;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Guard;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Guard,0,0,0,4,0,100,0,0,0,0,0,11,7165,0,0,0,0,0,1,0,0,0,0,0,0,0,'Heretic Crystal Guard - On Aggro - Cast Battlestance'),
+(@Guard,0,1,0,0,0,100,0,0,10000,20000,25000,11,7947,0,0,0,0,0,2,0,0,0,0,0,0,0,'Heretic Crystal Guard - IC - Localized Toxin'),
+(@Guard,0,2,0,0,0,100,0,0,5000,5000,10000,11,9080,0,0,0,0,0,2,0,0,0,0,0,0,0,'Heretic Crystal Guard - IC - Cast Hamstring'),
+(@Guard,0,3,0,0,0,100,0,3500,15000,15500,20000,11,11977,0,0,0,0,0,2,0,0,0,0,0,0,0,'Heretic Crystal Guard - IC - Cast Rend');
+DELETE FROM `creature` WHERE `guid` IN (165590,165591,165592,165593,165594,165595);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(165590, @Guard, 1, 1, 1, 0, 1, -475.005, 2420.72, 95.1794, 4.42751, 300, 30, 0, 46, 0, 1, 0, 0, 0),
+(165591, @Guard, 1, 1, 1, 0, 1, -455.597, 2430.45, 98.5554, 1.74145, 300, 30, 0, 46, 0, 1, 0, 0, 0),
+(165592, @Guard, 1, 1, 1, 0, 1, -462.329, 2445.08, 100.308, 0.379569, 300, 30, 0, 46, 0, 1, 0, 0, 0),
+(165593, @Guard, 1, 1, 1, 0, 1, -444.525, 2455.68, 104.292, 5.14615, 300, 30, 0, 46, 0, 1, 0, 0, 0),
+(165594, @Guard, 1, 1, 1, 0, 1, -465.311, 2461.88, 104.4, 5.86479, 300, 30, 0, 46, 0, 1, 0, 0, 0),
+(165595, @Guard, 1, 1, 1, 0, 1, -482.672, 2389.5, 91.1305, 2.51664, 300, 30, 0, 46, 0, 1, 0, 0, 0);
+-- Searing Gorge
+SET @Script3 := 18814500;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188145;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188145;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script3;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188145,1,0,0,62,0,100,0,9266,0,0,0,80,@Script3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 03
+(@Script3,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script3,9,1,0,0,0,100,0,1000,1000,0,0,12,26214,3,120000,0,0,0,8,0,0,0,-6631.123047,-661.677856,234.803894,0.500000,'Actionlist - On action 1 - Summon Frigid Lieutenant'),
+(@Script3,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script4 := 18814600;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188146;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188146;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script4;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188146,1,0,0,62,0,100,0,9267,0,0,0,80,@Script4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 04
+(@Script4,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script4,9,1,0,0,0,100,0,1000,1000,0,0,12,26214,3,120000,0,0,0,8,0,0,0,-6607.436035,-648.119690,235.142166,3.400006,'Actionlist - On action 1 - Summon Frigid Lieutenant'),
+(@Script4,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script5 := 18814700;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188147;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188147;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script5;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188147,1,0,0,62,0,100,0,9268,0,0,0,80,@Script5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 05
+(@Script5,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script5,9,1,0,0,0,100,0,1000,1000,0,0,12,26214,3,120000,0,0,0,8,0,0,0,-6620.220215,-631.247192,234.565582,4.944000,'Actionlist - On action 1 - Summon Frigid Lieutenant'),
+(@Script5,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Frigid := 26214;
+UPDATE `creature_template` SET `resistance3`=1000, `AIName`= 'SmartAI' WHERE `entry`=@Frigid;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Frigid;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Frigid,0,0,0,0,0,100,0,1000,5000,10000,11000,11,3131,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frigid Lieutenant - IC - Cast Frost Breath'),
+(@Frigid,0,1,0,4,0,100,1,0,0,0,0,1,0,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Frigid Lieutenant - On aggro - Say text 0');
+-- Frigid Lieutenant texts
+DELETE FROM `creature_text` WHERE `entry`= @Frigid;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES
+(@Frigid,0,0,'You will not stop the Frost Lord from entering this world, mortal. The Tidehunter''s might will crush that of Ragnaros once and for all, leaving your land a frozen paradise!',12,0,100,1,2000,0,'Frigid Lieutenant intro speech',25372);
+-- Ashenvale
+SET @Script6 := 18804900;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188049;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188049;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script6;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188049,1,0,0,62,0,100,0,9213,0,0,0,80,@Script6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 06
+(@Script6,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script6,9,1,0,0,0,100,0,1000,1000,0,0,12,26116,3,120000,0,0,0,8,0,0,0,4203.157227,1147.510376,8.549132,2.018310,'Actionlist - On action 1 - Summon Frostwave Lieutenant'),
+(@Script6,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script7 := 18813700;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188137;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188137;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script7;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188137,1,0,0,62,0,100,0,9256,0,0,0,80,@Script7,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 07
+(@Script7,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script7,9,1,0,0,0,100,0,1000,1000,0,0,12,26116,3,120000,0,0,0,8,0,0,0,4228.956055,1167.375854,8.095765,2.707110,'Actionlist - On action 1 - Summon Frostwave Lieutenant'),
+(@Script7,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script8 := 18813800;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188138;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188138;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script8;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188138,1,0,0,62,0,100,0,9257,0,0,0,80,@Script8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 08
+(@Script8,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script8,9,1,0,0,0,100,0,1000,1000,0,0,12,26116,3,120000,0,0,0,8,0,0,0,4240.973145,1144.133179,10.043564,2.702398,'Actionlist - On action 1 - Summon Frostwave Lieutenant'),
+(@Script8,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Frostwave := 26178;
+UPDATE `creature_template` SET `resistance3`=1000,`AIName`= 'SmartAI' WHERE `entry`=@Frostwave;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Frostwave;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Frostwave,0,0,0,0,0,100,0,1000,5000,8000,9000,11,8056,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frostwave Lieutenant - IC - Cast Frost Shock'),
+(@Frostwave,0,1,0,0,0,100,0,6000,10000,10000,12000,11,122,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frostwave Lieutenant - IC - Cast Frost Nova'),
+(@Frostwave,0,2,0,4,0,100,1,0,0,0,0,1,0,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Frostwave Lieutenant - On aggro - Say text 0');
+-- Frostwave Lieutenant texts
+DELETE FROM `creature_text` WHERE `entry`= @Frostwave;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES
+(@Frostwave,0,0,'You will not stop the Frost Lord from entering this world, mortal. The Tidehunter''s might will crush that of Ragnaros once and for all, leaving your land a frozen paradise!',12,0,100,1,2000,0,'Frostwave Lieutenant intro speech',25372);
+-- Silithus
+SET @Script9 := 18814800;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188148;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188148;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188148,1,0,0,62,0,100,0,9269,0,0,0,80,@Script9,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 09
+(@Script9,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script9,9,1,0,0,0,100,0,1000,1000,0,0,12,26215,3,120000,0,0,0,8,0,0,0,-6439.836914,215.265793,5.144650,3.776884,'Actionlist - On action 1 - Summon Glacial Lieutenant'),
+(@Script9,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script10 := 18814900;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188149;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188149;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script10;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188149,1,0,0,62,0,100,0,9271,0,0,0,80,@Script10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 10
+(@Script10,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script10,9,1,0,0,0,100,0,1000,1000,0,0,12,26215,3,120000,0,0,0,8,0,0,0,-6424.708008,190.182739,7.241127,0.689485,'Actionlist - On action 1 - Summon Glacial Lieutenant'),
+(@Script10,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script11 := 18815000;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188150;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188150;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script11;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188150,1,0,0,62,0,100,0,9272,0,0,0,80,@Script11,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 11
+(@Script11,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script11,9,1,0,0,0,100,0,1000,1000,0,0,12,26215,3,120000,0,0,0,8,0,0,0,-6395.992676,204.004852,4.293016,2.75155,'Actionlist - On action 1 - Summon Glacial Lieutenant'),
+(@Script11,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Glacial := 26215;
+UPDATE `creature_template` SET `resistance3`=1000, `AIName`= 'SmartAI' WHERE `entry`=@Glacial;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Glacial;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Glacial,0,0,0,0,0,100,0,1000,5000,8000,9000,11,15089,0,0,0,0,0,2,0,0,0,0,0,0,0,'Glacial Lieutenant - IC - Cast Frost Shock'),
+(@Glacial,0,1,0,0,0,100,0,6000,10000,10000,12000,11,14907,0,0,0,0,0,2,0,0,0,0,0,0,0,'Glacial Lieutenant - IC - Cast Frost Nova'),
+(@Glacial,0,2,0,4,0,100,1,0,0,0,0,1,0,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Glacial Lieutenant - On aggro - Say text 0');
+-- Glacial Lieutenant texts
+DELETE FROM `creature_text` WHERE `entry`= @Glacial;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`, `BroadcastTextId`) VALUES
+(@Glacial,0,0,'You will not stop the Frost Lord from entering this world, mortal. The Tidehunter''s might will crush that of Ragnaros once and for all, leaving your land a frozen paradise!',12,0,100,1,2000,0,'Glacial Lieutenant intro speech',25372);
+-- Stranglethorn vale
+SET @Script12 := 18814300;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188143;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188143;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script12;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188143,1,0,0,62,0,100,0,9264,0,0,0,80,@Script12,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 12
+(@Script12,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script12,9,1,0,0,0,100,0,1000,1000,0,0,12,26204,3,120000,0,0,0,8,0,0,0,-12199.167969,893.045044,1.343297,1.343297,'Actionlist - On action 1 - Summon Chillwind Lieutenant'),
+(@Script12,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script13 := 18814400;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188144;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188144;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script13;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188144,1,0,0,62,0,100,0,9265,0,0,0,80,@Script13,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 13
+(@Script13,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script13,9,1,0,0,0,100,0,1000,1000,0,0,12,26204,3,120000,0,0,0,8,0,0,0,-12176.784180,860.724365,19.763479,-1.849757,'Actionlist - On action 1 - Summon Chillwind Lieutenant'),
+(@Script13,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Chillwind := 26204;
+UPDATE `creature_template` SET `resistance3`=1000,`AIName`= 'SmartAI' WHERE `entry`=@Chillwind;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Chillwind;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Chillwind,0,0,0,0,0,100,0,1000,5000,8000,9000,11,23115,0,0,0,0,0,2,0,0,0,0,0,0,0,'Chillwind Lieutenant - IC - Cast Frost Shock'),
+(@Chillwind,0,1,0,0,0,100,0,10000,10000,12000,15000,11,6982,0,0,0,0,0,2,0,0,0,0,0,0,0,'Chillwind Lieutenant - IC - Cast Rend'),
+(@Chillwind,0,2,0,4,0,100,1,0,0,0,0,1,0,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Chillwind Lieutenant - On aggro - Say text 0');
+-- Chillwind Lieutenant texts
+DELETE FROM `creature_text` WHERE `entry`= @Chillwind;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`, `BroadcastTextId`) VALUES
+(@Chillwind,0,0,'You will not stop the Frost Lord from entering this world, mortal. The Tidehunter''s might will crush that of Ragnaros once and for all, leaving your land a frozen paradise!',12,0,100,1,2000,0,'Chillwind Lieutenant intro speech', 25372);
+-- Hellfire Peninsula
+SET @Script14 := 18815100;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188151;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188151;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script14;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188151,1,0,0,62,0,100,0,9273,0,0,0,80,@Script14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 14
+(@Script14,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script14,9,1,0,0,0,100,0,1000,1000,0,0,12,26216,3,120000,0,0,0,8,0,0,0,-153.333008,1142.613159,41.497719,0.898327,'Actionlist - On action 1 - Summon Templar'),
+(@Script14,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script15 := 18815200;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188152;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188152;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script15;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188152,1,0,0,62,0,100,0,9274,0,0,0,80,@Script15,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 15
+(@Script15,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script15,9,1,0,0,0,100,0,1000,1000,0,0,12,26216,3,120000,0,0,0,8,0,0,0,-349.365326,1135.743896,40.712578,2.448330,'Actionlist - On action 1 - Summon Templar'),
+(@Script15,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script16 := 18815300;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188153;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188153;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script16;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188153,1,0,0,62,0,100,0,9275,0,0,0,80,@Script16,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 16
+(@Script16,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script16,9,1,0,0,0,100,0,1000,1000,0,0,12,26216,3,120000,0,0,0,8,0,0,0,-133.914488,1199.369141,41.514484,4.365863,'Actionlist - On action 1 - Summon Templar'),
+(@Script16,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Script17 := 18815400;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=188154;
+DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=188154;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script17;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(188154,1,0,0,62,0,100,0,9276,0,0,0,80,@Script17,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ice Stone - On gossip option select - Run script'),
+-- Script 17
+(@Script17,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Actionlist - On action 0 - Close gossip'),
+(@Script17,9,1,0,0,0,100,0,1000,1000,0,0,12,26216,3,120000,0,0,0,8,0,0,0,-355.553406,1204.580444,40.349644,1.815675,'Actionlist - On action 1 - Summon Templar'),
+(@Script17,9,2,0,0,0,100,0,1000,1000,0,0,70,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Linked with event 0 - Respawn object /make it reappear after 100 secs/');
+SET @Templar:= 26216;
+UPDATE `creature_template` SET `resistance3`=1000,`AIName`= 'SmartAI' WHERE `entry`=@Templar;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Templar;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Templar,0,0,0,0,0,100,0,1000,5000,8000,9000,11,15089,0,0,0,0,0,2,0,0,0,0,0,0,0,'Templar - IC - Cast Frost Shock'),
+(@Templar,0,1,0,0,0,100,0,6000,10000,10000,12000,11,14907,0,0,0,0,0,2,0,0,0,0,0,0,0,'Templar - IC - Cast Frost Nova'),
+(@Templar,0,2,0,0,0,100,0,7500,15000,15000,25000,11,5164,0,0,0,0,0,2,0,0,0,0,0,0,0,'Templar - IC - Cast Knockback'),
+(@Templar,0,3,0,4,0,100,1,0,0,0,0,1,0,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Templar - On aggro - Say text 0');
+-- Templar texts
+DELETE FROM `creature_text` WHERE `entry`= @Templar;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES
+(@Templar,0,0,'You will not stop the Frost Lord from entering this world, mortal. The Tidehunter''s might will crush that of Ragnaros once and for all, leaving your land a frozen paradise!',12,0,100,1,2000,0,'Templar intro speech', 25372);
+-- Add missing Twillight units for Hellfire's Twilight camp + data + SAI support
+DELETE FROM `creature` WHERE `guid` IN (165596, 165597, 165598, 165599, 165600, 165601, 165602, 165603, 165604, 165605, 165606, 165607, 165608, 165609, 165610, 165611, 165612, 165613, 165614, 165615, 165616);
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(165596, 26222, 530, 1, 1, 0, 1, -145.864, 1132.05, 41.5023, 1.53449, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165597, 26222, 530, 1, 1, 0, 1, -143.941, 1162.68, 41.4552, 4.23704, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165598, 26222, 530, 1, 1, 0, 1, -159.973, 1194.15, 41.2539, 5.30047, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165599, 26222, 530, 1, 1, 0, 1, -140.188, 1196.53, 41.3586, 4.13494, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165600, 26222, 530, 1, 1, 0, 1, -111.405, 1132.85, 41.6071, 2.77148, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165601, 26222, 530, 1, 1, 0, 1, -357.383, 1135.48, 41.6245, 2.04735, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165602, 26222, 530, 1, 1, 0, 1, -368.085, 1156.21, 43.6638, 2.04735, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165603, 26222, 530, 1, 1, 0, 1, -368.382, 1184.77, 42.1961, 0.422359, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165604, 26222, 530, 1, 1, 0, 1, -343.397, 1204.57, 40.4944, 3.76894, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165605, 26222, 530, 1, 1, 0, 1, -371.037, 1107.27, 47.9595, 0.709027, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165606, 26222, 530, 1, 1, 0, 1, -147.599, 1102.24, 42.7401, 0.371305, 300, 30, 0, 3239, 6229, 1, 0, 0, 0),
+(165607, 26223, 530, 1, 1, 0, 1, -142.396, 1110.21, 44.0022, 4.0454, 300, 30, 0, 3997, 0, 1, 0, 0, 0),
+(165608, 26223, 530, 1, 1, 0, 1, -140.525, 1139.81, 41.4874, 3.79407, 300, 30, 0, 3997, 0, 1, 0, 0, 0),
+(165609, 26223, 530, 1, 1, 0, 1, -119.467, 1135.69, 41.4797, 5.91936, 300, 30, 0, 3997, 0, 1, 0, 0, 0),
+(165610, 26223, 530, 1, 1, 0, 1, -151.996, 1157.21, 41.473, 0.438849, 300, 30, 0, 3997, 0, 1, 0, 0, 0),
+(165611, 26223, 530, 1, 1, 0, 1, -148.783, 1193.1, 41.2043, 1.53684, 300, 30, 0, 3997, 0, 1, 0, 0, 0),
+(165612, 26223, 530, 1, 1, 0, 1, -368.17, 1110.18, 46.4436, 3.85612, 300, 30, 0, 3997, 0, 1, 0, 0, 0),
+(165613, 26223, 530, 1, 1, 0, 1, -353.873, 1148.84, 41.5226, 4.61717, 300, 30, 0, 3997, 0, 1, 0, 0, 0),
+(165614, 26223, 530, 1, 1, 0, 1, -367.485, 1169.15, 43.1463, 4.74676, 300, 30, 0, 3997, 0, 1, 0, 0, 0),
+(165615, 26223, 530, 1, 1, 0, 1, -360.011, 1195.66, 41.1995, 4.1043, 300, 30, 0, 3997, 0, 1, 0, 0, 0),
+(165616, 26223, 530, 1, 1, 0, 1, -348.858, 1207.35, 40.1246, 5.18501, 300, 30, 0, 3997, 0, 1, 0, 0, 0);
+SET @Cryomancer:= 26222;
+UPDATE `creature_template` SET `resistance3`=1000,`AIName`= 'SmartAI' WHERE `entry`=@Cryomancer;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Cryomancer;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Cryomancer,0,0,0,4,0,100,1,0,0,0,0,11,12544,0,0,0,0,0,1,0,0,0,0,0,0,0,'Cryomancer - On aggro - Cast Frost Armor'),
+(@Cryomancer,0,1,0,0,0,100,0,0,6000,3000,8000,11,9672,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cryomancer - IC - Cast Frostbolt'),
+(@Cryomancer,0,2,0,0,0,100,0,6000,10000,10000,12000,11,11831,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cryomancer - IC - Cast Frost Nova'),
+(@Cryomancer,0,3,0,25,0,100,0,0,0,0,0,28,12544,0,0,0,0,0,1,0,0,0,0,0,0,0,'Cryomancer - On reset - Remove auras from frost armor');
+SET @Frostblade:= 26223;
+UPDATE `creature_template` SET `resistance3`=1000,`AIName`= 'SmartAI' WHERE `entry`=@Frostblade;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Frostblade;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Frostblade,0,0,0,0,0,100,0,0,1000,120000,120000,11,8599,0,0,0,0,0,1,0,0,0,0,0,0,0,'Frostblade - IC - Cast Enrage'),
+(@Frostblade,0,1,0,0,0,100,0,2500,12000,5000,15000,11,23600,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frostblade - IC - Cast Piercing Howl'),
+(@Frostblade,0,2,0,9,0,100,0,8,25,1000,2000,11,22911,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frostblade - In Range - Charge');
+-- #19
+-- Fix quests Incense for Summer Scorchlings and Incense for Fire Scorchlings/Add SAI support for quest end event
+SET @Scorchling:= 26520;
+SET @ScorchlingA:= 26401;
+SET @Talespinner:= 16818;
+SET @Loremaster:= 16817;
+SET @Script:= 2652000;
+SET @Script1:= 2640100;
+-- SAI for Telespinner
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@Talespinner;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Talespinner;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Talespinner,0,0,0,19,0,100,0,11966,0,0,0,15,11966,0,0,0,0,0,7,0,0,0,0,0,0,0,'Festival Talespinner - On target quest accepted - Call quest complete');
+-- SAI for Loremaster
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@Loremaster;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Loremaster;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Loremaster,0,0,0,19,0,100,0,11964,0,0,0,15,11964,0,0,0,0,0,7,0,0,0,0,0,0,0,'Festival Loremaster - On target quest accepted - Call quest complete');
+-- SAI Schorchling /Horde side/
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@Scorchling;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Scorchling;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Scorchling,0,0,0,8,0,100,0,47104,0,0,0,80,@Script,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - On spell hit by Get Incense - Run script 00'),
+(@Script,9,1,0,0,0,100,0,0,0,0,0,1,0,2000,0,0,0,0,21,3,0,0,0,0,0,0,'Actionlist - Action 1 - Say text 0'),
+(@Script,9,2,0,0,0,100,0,1000,1000,0,0,1,8,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 2 - Say text 8'),
+(@Script,9,3,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 3 - Cast grow'),
+(@Script,9,4,0,0,0,100,0,0,0,0,0,1,1,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 4 - Say text 1'),
+(@Script,9,5,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 5 - Cast grow'),
+(@Script,9,6,0,0,0,100,0,0,0,0,0,1,2,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 6 - Say text 2'),
+(@Script,9,7,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 7 - Cast grow'),
+(@Script,9,8,0,0,0,100,0,0,0,0,0,1,3,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 8 - Say text 3'),
+(@Script,9,9,0,0,0,100,0,1000,1000,0,0,1,9,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 9 - Say text 9'),
+(@Script,9,10,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 10 - Cast grow'),
+(@Script,9,11,0,0,0,100,0,0,0,0,0,1,4,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 11 - Say text 4'),
+(@Script,9,12,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 12 - Cast grow'),
+(@Script,9,13,0,0,0,100,0,0,0,0,0,1,5,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 13 - Say text 5'),
+(@Script,9,14,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 14 - Cast grow'),
+(@Script,9,15,0,0,0,100,0,0,0,0,0,1,6,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 15 - Say text 6'),
+(@Script,9,16,0,0,0,100,0,0,0,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 16 - Cast grow'),
+(@Script,9,17,0,0,0,100,0,0,0,0,0,1,10,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 17 - Say text 7'),
+(@Script,9,18,0,0,0,100,0,0,0,0,0,11,45889,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 18 - Cast Scorchling Blast'),
+(@Script,9,19,0,0,0,100,0,0,0,0,0,11,46660,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 19 - Cast Extinguished'),
+(@Script,9,20,0,0,0,100,0,0,0,0,0,28,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 20 - Remove aura from grow'),
+(@Script,9,21,0,0,0,100,0,3000,3000,0,0,1,7,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 21 - Say text 7');
+-- Scorchling texts
+DELETE FROM `creature_text` WHERE `entry`= @Scorchling;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`, `BroadcastTextId`) VALUES
+(@Scorchling,0,0,'Thank you again, $N, for this delectable incense.',12,0,100,1,1000,0,'Scorchling event with incense', 25699),
+(@Scorchling,1,0,'So good! So packed with energy!',12,0,100,1,1000,0,'Scorchling event with incense', 25718),
+(@Scorchling,2,0,'It has everything a growing scorchling needs!',12,0,100,1,1000,0,'Scorchling event with incense', 25719),
+(@Scorchling,3,0,'I can feel the power SURGING within me!',12,0,100,1,1000,0,'Scorchling event with incense', 25730),
+(@Scorchling,4,0,'Now! Finally! Our plans can take effect!',12,0,100,1,1000,0,'Scorchling event with incense', 25721),
+(@Scorchling,5,0,'KNEEL, LITTLE MORTAL! KNEEL BEFORE THE MIGHT OF THE HERALD OF RAGNAROS!',12,0,100,1,1000,0,'Scorchling event with incense', 25722),
+(@Scorchling,6,0,'YOU WILL ALL PERISH IN FLAMES!',12,0,100,1,1000,0,'Scorchling event with incense', 25723),
+(@Scorchling,7,0,'Ah. I was merely jesting...',12,0,100,1,1000,0,'Scorchling event with incense', 25725),
+(@Scorchling,8,0,'%s devours the incense. It''s ravenous!',16,0,100,1,1000,0,'Scorchling event with incense', 25717),
+(@Scorchling,9,0,'%s bellows with laughter!',16,0,100,1,1000,0,'Scorchling event with incense', 25720),
+(@Scorchling,10,0,'%s blinks...',16,0,100,1,1000,0,'Scorchling event with incense', 25724);
+-- SAI Schorchling /Alliance side/
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ScorchlingA;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ScorchlingA;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script1;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ScorchlingA,0,0,0,8,0,100,0,47104,0,0,0,80,@Script1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - On spell hit by Get Incense - Run script 00'),
+(@Script1,9,1,0,0,0,100,0,0,0,0,0,1,0,2000,0,0,0,0,21,3,0,0,0,0,0,0,'Actionlist - Action 1 - Say text 0'),
+(@Script1,9,2,0,0,0,100,0,1000,1000,0,0,1,8,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 2 - Say text 8'),
+(@Script1,9,3,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 3 - Cast grow'),
+(@Script1,9,4,0,0,0,100,0,0,0,0,0,1,1,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 4 - Say text 1'),
+(@Script1,9,5,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 5 - Cast grow'),
+(@Script1,9,6,0,0,0,100,0,0,0,0,0,1,2,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 6 - Say text 2'),
+(@Script1,9,7,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 7 - Cast grow'),
+(@Script1,9,8,0,0,0,100,0,0,0,0,0,1,3,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 8 - Say text 3'),
+(@Script1,9,9,0,0,0,100,0,1000,1000,0,0,1,9,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 9 - Say text 9'),
+(@Script1,9,10,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 10 - Cast grow'),
+(@Script1,9,11,0,0,0,100,0,0,0,0,0,1,4,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 11 - Say text 4'),
+(@Script1,9,12,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 12 - Cast grow'),
+(@Script1,9,13,0,0,0,100,0,0,0,0,0,1,5,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 13 - Say text 5'),
+(@Script1,9,14,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 14 - Cast grow'),
+(@Script1,9,15,0,0,0,100,0,0,0,0,0,1,6,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 15 - Say text 6'),
+(@Script1,9,16,0,0,0,100,0,0,0,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 16 - Cast grow'),
+(@Script1,9,17,0,0,0,100,0,0,0,0,0,1,10,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 17 - Say text 7'),
+(@Script1,9,18,0,0,0,100,0,0,0,0,0,11,45889,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 18 - Cast Scorchling Blast'),
+(@Script1,9,19,0,0,0,100,0,0,0,0,0,11,46660,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 19 - Cast Extinguished'),
+(@Script1,9,20,0,0,0,100,0,0,0,0,0,28,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 20 - Remove aura from grow'),
+(@Script1,9,21,0,0,0,100,0,3000,3000,0,0,1,7,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 21 - Say text 7');
+-- Scorchling texts /Alliance/
+DELETE FROM `creature_text` WHERE `entry`= @ScorchlingA;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`, `BroadcastTextId`) VALUES
+(@ScorchlingA,0,0,'Thank you again, $N, for this delectable incense.',12,0,100,1,1000,0,'Scorchling event with incense', 25699),
+(@ScorchlingA,1,0,'So good! So packed with energy!',12,0,100,1,1000,0,'Scorchling event with incense', 25718),
+(@ScorchlingA,2,0,'It has everything a growing scorchling needs!',12,0,100,1,1000,0,'Scorchling event with incense', 25719),
+(@ScorchlingA,3,0,'I can feel the power SURGING within me!',12,0,100,1,1000,0,'Scorchling event with incense', 25730),
+(@ScorchlingA,4,0,'Now! Finally! Our plans can take effect!',12,0,100,1,1000,0,'Scorchling event with incense', 25721),
+(@ScorchlingA,5,0,'KNEEL, LITTLE MORTAL! KNEEL BEFORE THE MIGHT OF THE HERALD OF RAGNAROS!',12,0,100,1,1000,0,'Scorchling event with incense', 25722),
+(@ScorchlingA,6,0,'YOU WILL ALL PERISH IN FLAMES!',12,0,100,1,1000,0,'Scorchling event with incense', 25723),
+(@ScorchlingA,7,0,'Ah. I was merely jesting...',12,0,100,1,1000,0,'Scorchling event with incense', 25725),
+(@ScorchlingA,8,0,'%s devours the incense. It''s ravenous!',16,0,100,1,1000,0,'Scorchling event with incense', 25717),
+(@ScorchlingA,9,0,'%s bellows with laughter!',16,0,100,1,1000,0,'Scorchling event with incense', 25720),
+(@ScorchlingA,10,0,'%s blinks...',16,0,100,1,1000,0,'Scorchling event with incense', 25724);
+-- Add conditions for Scorchling Gets Incense spell
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=47104;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition` ,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,47104,0,1,31,0,3,26520,0,0,0,'','Scorching gets incense can only hit Scorchling /Horde side/'),
+(13,1,47104,0,2,31,0,3,26401,0,0,0,'','Scorching gets incense can only hit Scorchling /Alliance side/');
+
+DELETE FROM `creature_queststarter` WHERE `quest` IN (SELECT `quest` FROM `game_event_creature_quest`);
+DELETE FROM `gameobject_queststarter` WHERE `quest` IN (SELECT `quest` FROM `game_event_gameobject_quest`);
+
+DELETE FROM `creature_equip_template` WHERE `CreatureID`=25962;
+INSERT INTO `creature_equip_template` (`CreatureID`,`ID`,`itemID1`,`itemID2`,`itemID3`) VALUES
+(25962,1,2200,0,0);
+
+DELETE FROM `game_event_gameobject` WHERE `guid` IN (21478,21479,21480,21481,21482,21484,21494,21495,21496,21497,21498,50680);
+
+
+
+
+
+
+
+
+
+DELETE FROM `creature` WHERE `guid` IN (86242,86243,86244,86245,86246,86247,86248,86249,86250,86251,86252,86253,86254,86255,86256,86258,86259,86260,86261,86262,86264,86265,86266,86267,86268,94777,94778,94779,94780,94781,94782,94783,94784,94785,94786,94787,94788,94789,94790,94791,94792,94793,94794,94795,94796,94797,94798,94799,94800,127340,127341,127342,127343,127344,127345,127346,127347,127348,127349,127350,127351,127352,127353,127354,127355,127356, 127358,127359, 127360, 127361, 127362, 127363, 127364,127365, 127366,127367,127368,127369);
+DELETE FROM `game_event_gameobject` WHERE `guid` IN (17834,86242,86243,86244,86245,86246,86247,86248,86249,86250,86251,86252,86253,86254,86255,86256,86258,86259,86260,86261,86262,86264,86265,86266,86267,86268,94777,94778,94779,94780,94781,94782,94783,94784,94785,94786,94787,94788,94789,94790,94791,94792,94793,94794,94795,94796,94797,94798,94799,94800,127340,127341,127342,127343,127344,127345,127346,127347,127348,127349,127350,127351,127352,127353,127354,127355,127356, 127358,127359, 127360, 127361, 127362, 127363, 127364,127365, 127366,127367,127368,127369);
+DELETE FROM `game_event_gameobject` WHERE `guid` IN (165112,165115,165116,165117,165118,165119,165120,165121,165009,165010,165012,165013,165014,165015,165016,165019,165020,165021,165022,165023,165024,165025,165026,165027,165028,165029,165030,165031,165032,165033,165070,165071,165072,165074,165075,165077,165078,165079,165080,165081,165105,165106,165054,165107,165055,165108,165056,165109,165057,165110,165058,165111,165059,165060,165062,165063,165064,165066,165067,165068,165069,165034,165038,165039,165040,165041,165042,165043,165044,165045,165046,165047,165048,165049,165050,165051,165052,165053,164974,164975,164976,164977,164978,164979,164980,164981,164982,164983,164984,164985,165408,164906,164907,164908,164909,164910,164911,164913,164914,164915,164916,164917,164918,164919,164920,164921,164922,164923,164924,164894,164895,164896,164897,164898,164899,164900,164901,164902,164903,164904,164905,164852,164853,164854,164855,164856,164857,164858,164859,164861,164862,164863,164864,164865,164866,164867,164868,164869,164870,165384,165383,164812,164813,164814,164815,164816,164817,164818,164819,164820,164821,164822,164823,164825,164826,164827,164775,164776,51596,52357,50996,50855,50750,50747,52277,52467,51350,50692,52548,52284,51349,6537,6538,6539,52517,50934,12654,12655,12656,12657,12658,21499,51791,50690,52560,52333,52329,52511,50740,50741,50869,52399,52334,21500,21501,21502,21503,21504,21505,65164,65166,65167,65168,65170,65171,65172,65173,65174,65175,65176,65177,65178,65179,65180,164459,164460,164461,164462,164463,164464,164466,164468,164470,164473,164474,164476,164479,164480,164481,164482,164483,164507,164509,164510,164511,164512,164513,164514,164515,164516,164517,164518,164519,164520,164521,164522,164524,164525,164527,164528,164529,164530,164531,164532,164534,164535,164536,164537,164538,164539,164540,165334,164564,164565,164566,164567,164568,164571,164572,164573,164575,164577,164578,164579,164580,164581,164582,164583,164584,164608,164609,164610,164612,164613,164614,164615,164616,164617,164618,164620,164621,164622,164623,164624,164625,164626,164628,164629,164630,164631,164632,164633,164634,164635,164638,164639,164640,164641,164642,164643,164644,164668,164670,165359,164672,164673,164674,164675,164676,164677,164678,164679,164680,164681,164682,164683,164727,164728,164729,164730,164731,164732,164733,164735,164736,164737,164738,164739,164740,164741,164742,164707,164708,164711,164712,164713,164714,164715,164716,164717,164718,164719,164720,164721,164722,164723,164726,165145,165146,165147,165148,165149,165150,165151,165152,165153,165154,165156,165157,165160,165161,165162,165163,165164,165165,165166,165167,165168,165169,165170,165171,165172,165173,165174,165175,165176,165358,165177,165178,165179,165180,165181,165182,165183,165184,165185,165186,165187,165188,165189,165190,165191,165192,165193,165194,165195,165196,165197,165198,165199,165200,165201,165202,165203,165204,165205,165206,165208,165209,165210,165211,165212,165213,165214,165215,165216,165217,165218,165219,165220,165221,165222,165223,165224,165225,165226,165227,165229,165230,165231,165232,165233,165234,165235,165236,165237,165238,165239,165240,165241,165242,165243,165244,165245,165246,165247,165248,165249,165250,165251,165252,165253,165254,165255,165256,165257,165259,165260,165409,165410,165411,49313, 165412,165413,165414,165415,165416,165417,165418,165419,165420,165421,165422,165423,165424,165425,165426,165427,165428,165429,165430,165431,165432,165433,165434,165435,165436,165437,165438,165439,165440,165441,165442,165443,165444,165445,165446,165447,165448,165449,165450,165451,165452,165453,165454,165455,165456,165457,165458,165459,165460,165461,165462,165463,165464,165465,165466,165467,165468,165469,165470,165471,165472,165473,165474,165475,165476,165477,165478,165479,165480,165481,165482,165483,165484,165485,165509,165510,165511,165512,165513,165514,165515,165516,165517,165518,165519,165520,165521,165522,165523,165524,165525,165550,165551,165552,165553,165554,165555,165556,165557,165581,165582,165583,165607,165608,165609,165610,165612,165613,165614,165615,165616,165617,165618,165715,165723,165747,165748,165749,165773,165774,165800,165801,165802,165803,165827,165828,165829,165830,165831,165832,165833,165834,165835,165837,165838,165839,165840,165841,165842,165843,165844,165845,165846,165847,165848,165849,165850,165851,165852,165853,165854,165855,165856,165857,165858,165859,165860,165862,165886,165887,165888,165889,165890,165914,165915,165916,165917,165918,165919,165920,165921,165922,165923,165924,165925,165926,165951,165952,165953,165954,165955,165956,165957,165958,165959,165960,165961,165962,165963,165964);
+INSERT INTO `game_event_gameobject` (`eventEntry`, `guid`) VALUES
+(1, 165112),
+(1, 165115),
+(1, 165116),
+(1, 165117),
+(1, 165118),
+(1, 165119),
+(1, 165120),
+(1, 165121),
+(1, 165009),
+(1, 165010),
+(1, 165012),
+(1, 165013),
+(1, 165014),
+(1, 165015),
+(1, 165016),
+(1, 165019),
+(1, 165020),
+(1, 165021),
+(1, 165022),
+(1, 165023),
+(1, 165024),
+(1, 165025),
+(1, 165026),
+(1, 165027),
+(1, 165028),
+(1, 165029),
+(1, 165030),
+(1, 165031),
+(1, 165032),
+(1, 165033),
+(1, 165070),
+(1, 165071),
+(1, 165072),
+(1, 165074),
+(1, 165075),
+(1, 165077),
+(1, 165078),
+(1, 165079),
+(1, 165080),
+(1, 165081),
+(1, 165105),
+(1, 165106),
+(1, 165054),
+(1, 165107),
+(1, 165055),
+(1, 165108),
+(1, 165056),
+(1, 165109),
+(1, 165057),
+(1, 165110),
+(1, 165058),
+(1, 165111),
+(1, 165059),
+(1, 165060),
+(1, 165062),
+(1, 165063),
+(1, 165064),
+(1, 165066),
+(1, 165067),
+(1, 165068),
+(1, 165069),
+(1, 165034),
+(1, 165038),
+(1, 165039),
+(1, 165040),
+(1, 165041),
+(1, 165042),
+(1, 165043),
+(1, 165044),
+(1, 165045),
+(1, 165046),
+(1, 165047),
+(1, 165048),
+(1, 165049),
+(1, 165050),
+(1, 165051),
+(1, 165052),
+(1, 165053),
+(1, 164974),
+(1, 164975),
+(1, 164976),
+(1, 164977),
+(1, 164978),
+(1, 164979),
+(1, 164980),
+(1, 164981),
+(1, 164982),
+(1, 164983),
+(1, 164984),
+(1, 164985),
+(1, 165408),
+(1, 164906),
+(1, 164907),
+(1, 164908),
+(1, 164909),
+(1, 164910),
+(1, 164911),
+(1, 164913),
+(1, 164914),
+(1, 164915),
+(1, 164916),
+(1, 164917),
+(1, 164918),
+(1, 164919),
+(1, 164920),
+(1, 164921),
+(1, 164922),
+(1, 164923),
+(1, 164924),
+(1, 164894),
+(1, 164895),
+(1, 164896),
+(1, 164897),
+(1, 164898),
+(1, 164899),
+(1, 164900),
+(1, 164901),
+(1, 164902),
+(1, 164903),
+(1, 164904),
+(1, 164905),
+(1, 164852),
+(1, 164853),
+(1, 164854),
+(1, 164855),
+(1, 164856),
+(1, 164857),
+(1, 164858),
+(1, 164859),
+(1, 164861),
+(1, 164862),
+(1, 164863),
+(1, 164864),
+(1, 164865),
+(1, 164866),
+(1, 164867),
+(1, 164868),
+(1, 164869),
+(1, 164870),
+(1, 165384),
+(1, 165383),
+(1, 164812),
+(1, 164813),
+(1, 164814),
+(1, 164815),
+(1, 164816),
+(1, 164817),
+(1, 164818),
+(1, 164819),
+(1, 164820),
+(1, 164821),
+(1, 164822),
+(1, 164823),
+(1, 164825),
+(1, 164826),
+(1, 164827),
+(1, 164775),
+(1, 164776),
+(1, 51596),
+(1, 52357),
+(1, 50996),
+(1, 50855),
+(1, 50750),
+(1, 50747),
+(1, 52277),
+(1, 52467),
+(1, 51350),
+(1, 50692),
+(1, 52548),
+(1, 52284),
+(1, 51349),
+(1, 6537),
+(1, 6538),
+(1, 6539),
+(1, 52517),
+(1, 50934),
+(1, 12654),
+(1, 12655),
+(1, 12656),
+(1, 12657),
+(1, 12658),
+(1, 21499),
+(1, 51791),
+(1, 50690),
+(1, 52560),
+(1, 52333),
+(1, 52329),
+(1, 52511),
+(1, 50740),
+(1, 50741),
+(1, 50869),
+(1, 52399),
+(1, 52334),
+(1, 21500),
+(1, 21501),
+(1, 21502),
+(1, 21503),
+(1, 21504),
+(1, 21505),
+(1, 65164),
+(1, 65166),
+(1, 65167),
+(1, 65168),
+(1, 65170),
+(1, 65171),
+(1, 65172),
+(1, 65173),
+(1, 65174),
+(1, 65175),
+(1, 65176),
+(1, 65177),
+(1, 65178),
+(1, 65179),
+(1, 65180),
+(1, 164459),
+(1, 164460),
+(1, 164461),
+(1, 164462),
+(1, 164463),
+(1, 164464),
+(1, 164466),
+(1, 164468),
+(1, 164470),
+(1, 164473),
+(1, 164474),
+(1, 164476),
+(1, 164479),
+(1, 164480),
+(1, 164481),
+(1, 164482),
+(1, 164483),
+(1, 164507),
+(1, 164509),
+(1, 164510),
+(1, 164511),
+(1, 164512),
+(1, 164513),
+(1, 164514),
+(1, 164515),
+(1, 164516),
+(1, 164517),
+(1, 164518),
+(1, 164519),
+(1, 164520),
+(1, 164521),
+(1, 164522),
+(1, 164524),
+(1, 164525),
+(1, 164527),
+(1, 164528),
+(1, 164529),
+(1, 164530),
+(1, 164531),
+(1, 164532),
+(1, 164534),
+(1, 164535),
+(1, 164536),
+(1, 164537),
+(1, 164538),
+(1, 164539),
+(1, 164540),
+(1, 165334),
+(1, 164564),
+(1, 164565),
+(1, 164566),
+(1, 164567),
+(1, 164568),
+(1, 164571),
+(1, 164572),
+(1, 164573),
+(1, 164575),
+(1, 164577),
+(1, 164578),
+(1, 164579),
+(1, 164580),
+(1, 164581),
+(1, 164582),
+(1, 164583),
+(1, 164584),
+(1, 164608),
+(1, 164609),
+(1, 164610),
+(1, 164612),
+(1, 164613),
+(1, 164614),
+(1, 164615),
+(1, 164616),
+(1, 164617),
+(1, 164618),
+(1, 164620),
+(1, 164621),
+(1, 164622),
+(1, 164623),
+(1, 164624),
+(1, 164625),
+(1, 164626),
+(1, 164628),
+(1, 164629),
+(1, 164630),
+(1, 164631),
+(1, 164632),
+(1, 164633),
+(1, 164634),
+(1, 164635),
+(1, 164638),
+(1, 164639),
+(1, 164640),
+(1, 164641),
+(1, 164642),
+(1, 164643),
+(1, 164644),
+(1, 164668),
+(1, 164670),
+(1, 165359),
+(1, 164672),
+(1, 164673),
+(1, 164674),
+(1, 164675),
+(1, 164676),
+(1, 164677),
+(1, 164678),
+(1, 164679),
+(1, 164680),
+(1, 164681),
+(1, 164682),
+(1, 164683),
+(1, 164727),
+(1, 164728),
+(1, 164729),
+(1, 164730),
+(1, 164731),
+(1, 164732),
+(1, 164733),
+(1, 164735),
+(1, 164736),
+(1, 164737),
+(1, 164738),
+(1, 164739),
+(1, 164740),
+(1, 164741),
+(1, 164742),
+(1, 164707),
+(1, 164708),
+(1, 164711),
+(1, 164712),
+(1, 164713),
+(1, 164714),
+(1, 164715),
+(1, 164716),
+(1, 164717),
+(1, 164718),
+(1, 164719),
+(1, 164720),
+(1, 164721),
+(1, 164722),
+(1, 164723),
+(1, 164726),
+(1, 165145),
+(1, 165146),
+(1, 165147),
+(1, 165148),
+(1, 165149),
+(1, 165150),
+(1, 165151),
+(1, 165152),
+(1, 165153),
+(1, 165154),
+(1, 165156),
+(1, 165157),
+(1, 165160),
+(1, 165161),
+(1, 165162),
+(1, 165163),
+(1, 165164),
+(1, 165165),
+(1, 165166),
+(1, 165167),
+(1, 165168),
+(1, 165169),
+(1, 165170),
+(1, 165171),
+(1, 165172),
+(1, 165173),
+(1, 165174),
+(1, 165175),
+(1, 165176),
+(1, 165358),
+(1, 165177),
+(1, 165178),
+(1, 165179),
+(1, 165180),
+(1, 165181),
+(1, 165182),
+(1, 165183),
+(1, 165184),
+(1, 165185),
+(1, 165186),
+(1, 165187),
+(1, 165188),
+(1, 165189),
+(1, 165190),
+(1, 165191),
+(1, 165192),
+(1, 165193),
+(1, 165194),
+(1, 165195),
+(1, 165196),
+(1, 165197),
+(1, 165198),
+(1, 165199),
+(1, 165200),
+(1, 165201),
+(1, 165202),
+(1, 165203),
+(1, 165204),
+(1, 165205),
+(1, 165206),
+(1, 165208),
+(1, 165209),
+(1, 165210),
+(1, 165211),
+(1, 165212),
+(1, 165213),
+(1, 165214),
+(1, 165215),
+(1, 165216),
+(1, 165217),
+(1, 165218),
+(1, 165219),
+(1, 165220),
+(1, 165221),
+(1, 165222),
+(1, 165223),
+(1, 165224),
+(1, 165225),
+(1, 165226),
+(1, 165227),
+(1, 165229),
+(1, 165230),
+(1, 165231),
+(1, 165232),
+(1, 165233),
+(1, 165234),
+(1, 165235),
+(1, 165236),
+(1, 165237),
+(1, 165238),
+(1, 165239),
+(1, 165240),
+(1, 165241),
+(1, 165242),
+(1, 165243),
+(1, 165244),
+(1, 165245),
+(1, 165246),
+(1, 165247),
+(1, 165248),
+(1, 165249),
+(1, 165250),
+(1, 165251),
+(1, 165252),
+(1, 165253),
+(1, 165254),
+(1, 165255),
+(1, 165256),
+(1, 165257),
+(1, 165259),
+(1, 165260),
+(1, 165409),
+(1, 165410),
+(1, 165411),
+(1, 49313),
+(1, 165412),
+(1, 165413),
+(1, 165414),
+(1, 165415),
+(1, 165416),
+(1, 165417),
+(1, 165418),
+(1, 165419),
+(1, 165420),
+(1, 165421),
+(1, 165422),
+(1, 165423),
+(1, 165424),
+(1, 165425),
+(1, 165426),
+(1, 165427),
+(1, 165428),
+(1, 165429),
+(1, 165430),
+(1, 165431),
+(1, 165432),
+(1, 165433),
+(1, 165434),
+(1, 165435),
+(1, 165436),
+(1, 165437),
+(1, 165438),
+(1, 165439),
+(1, 165440),
+(1, 165441),
+(1, 165442),
+(1, 165443),
+(1, 165444),
+(1, 165445),
+(1, 165446),
+(1, 165447),
+(1, 165448),
+(1, 165449),
+(1, 165450),
+(1, 165451),
+(1, 165452),
+(1, 165453),
+(1, 165454),
+(1, 165455),
+(1, 165456),
+(1, 165457),
+(1, 165458),
+(1, 165459),
+(1, 165460),
+(1, 165461),
+(1, 165462),
+(1, 165463),
+(1, 165464),
+(1, 165465),
+(1, 165466),
+(1, 165467),
+(1, 165468),
+(1, 165469),
+(1, 165470),
+(1, 165471),
+(1, 165472),
+(1, 165473),
+(1, 165474),
+(1, 165475),
+(1, 165476),
+(1, 165477),
+(1, 165478),
+(1, 165479),
+(1, 165480),
+(1, 165481),
+(1, 165482),
+(1, 165483),
+(1, 165484),
+(1, 165485),
+(1, 165509),
+(1, 165510),
+(1, 165511),
+(1, 165512),
+(1, 165513),
+(1, 165514),
+(1, 165515),
+(1, 165516),
+(1, 165517),
+(1, 165518),
+(1, 165519),
+(1, 165520),
+(1, 165521),
+(1, 165522),
+(1, 165523),
+(1, 165524),
+(1, 165525),
+(1, 165550),
+(1, 165551),
+(1, 165552),
+(1, 165553),
+(1, 165554),
+(1, 165555),
+(1, 165556),
+(1, 165557),
+(1, 165581),
+(1, 165582),
+(1, 165583),
+(1, 165607),
+(1, 165608),
+(1, 165609),
+(1, 165610),
+(1, 165612),
+(1, 165613),
+(1, 165614),
+(1, 165615),
+(1, 165616),
+(1, 165617),
+(1, 165618),
+(1, 165715),
+(1, 165723),
+(1, 165747),
+(1, 165748),
+(1, 165749),
+(1, 165773),
+(1, 165774),
+(1, 165800),
+(1, 165801),
+(1, 165802),
+(1, 165803),
+(1, 165827),
+(1, 165828),
+(1, 165829),
+(1, 165830),
+(1, 165831),
+(1, 165832),
+(1, 165833),
+(1, 165834),
+(1, 165835),
+(1, 165837),
+(1, 165838),
+(1, 165839),
+(1, 165840),
+(1, 165841),
+(1, 165842),
+(1, 165843),
+(1, 165844),
+(1, 165845),
+(1, 165846),
+(1, 165847),
+(1, 165848),
+(1, 165849),
+(1, 165850),
+(1, 165851),
+(1, 165852),
+(1, 165853),
+(1, 165854),
+(1, 165855),
+(1, 165856),
+(1, 165857),
+(1, 165858),
+(1, 165859),
+(1, 165860),
+(1, 165862),
+(1, 165886),
+(1, 165887),
+(1, 165888),
+(1, 165889),
+(1, 165890),
+(1, 165914),
+(1, 165915),
+(1, 165916),
+(1, 165917),
+(1, 165918),
+(1, 165919),
+(1, 165920),
+(1, 165921),
+(1, 165922),
+(1, 165923),
+(1, 165924),
+(1, 165925),
+(1, 165926),
+(1, 165951),
+(1, 165952),
+(1, 165953),
+(1, 165954),
+(1, 165955),
+(1, 165956),
+(1, 165957),
+(1, 165958),
+(1, 165959),
+(1, 165960),
+(1, 165961),
+(1, 165962),
+(1, 165963),
+(1, 165964);
+
+DELETE FROM `game_event_creature` WHERE `guid` IN (86242,86243,86244,86245,86246,86247,86248,86249,86250,86251,86252,86253,86254,86255,86256,86258,86259,86260,86261,86262,86264,86265,86266,86267,86268,94777,94778,94779,94780,94781,94782,94783,94784,94785,94786,94787,94788,94789,94790,94791,94792,94793,94794,94795,94796,94797,94798,94799,94800,127340,127341,127342,127343,127344,127345,127346,127347,127348,127349,127350,127351,127352,127353,127354,127355,127356,127358,127359,127360,127361,127362,127363,127364,127365,127366,127367,127368,127369,94696,94723,94698,94724,94513,86426,202758,94710,94518,94656,94694,11001,11002,209666,209667,209668,209669,209670,209673,209675,209925,209926,209927,209928,209929,209930,210411,210412,210413,210414,210415,210416,210420,210425,210426,210427,210428,210429,210677,210682,210683,210684,210685,210686,210944,210946,210947,210948,210949,210950,210951,210982,210983,210984,210985,211249,211256,211257,211258,211259,211260,211261,211540,211541,211542,211543,211544,211545,211546,211513,211520,211521,211522,211523,211524,211790,211791,211792,211793,211794,211797,212038,212039,212040,212041,212042,212043,212289,212290,212291,212292,212293,212295,212536,212537,212538,212539,212540,212541,212598,212599,212600,212601,212602,212603,212604,212847,212848,212849,212850,212851,212852,213103,213104,213105,213106,213108,213109,213113,213114,213115,213116,213117,213118,85192,85193,85194,85195,85196,85197,213096,213097,213098,213099,213100,213101,78648,78649,78650,78651,78652,213720,213727,213728,213729,213731,213732,213733,213737,213738,213739,213740,213741,213742,213746,213747,213748,213749,213751,213752,213790,213791,213792,213793,213794,213795,213796,213797,213798,213799,213800,213801,213802,213803,213804,213805,213806,213807,213808,213809,213810,213811,213812,213813,213814,213815,213816,213817,152327,152328,152329,152330,152331,152332,152333,152334,152335,152336,152337,152338,152339,152340,152341,152342,152343,152344,152345,152346,152347,152348,152349,152350,152351,152352,152353,152354,152355,152356,152357,152358,152359,152360,152361,152362,152363,152364,152365,152366,152367,152368,152369,152370,152371,152372,152373,152374,152375,152376,152377,152378,152379,152380,152381,152382,152383,152384,152385,152386,152387,152388,152389,152390,152391,152392,152393,152394,152395,152396,152397,152398,152399,152400,152401,152402,152403,152404,152405,152406,152407,152408,165584,165585,165586,165587,165588,165589,94739, 165590,165591,165592,165593,165594,165595,165596,165597,165598,165599,165600,165601,165602,165603,165604,165605,165606,165607,165608,165609,165610,165611,165612,165613,165614,165615,165616);
+INSERT INTO `game_event_creature` (`eventEntry`, `guid`) VALUES
+(1, 94696),
+(1, 94723),
+(1, 94698),
+(1, 94724),
+(1, 94513),
+(1, 86426),
+(1, 202758),
+(1, 94710),
+(1, 94518),
+(1, 94656),
+(1, 94694),
+(1, 11001),
+(1, 11002),
+(1, 209666),
+(1, 209667),
+(1, 209668),
+(1, 209669),
+(1, 209670),
+(1, 209673),
+(1, 209675),
+(1, 209925),
+(1, 209926),
+(1, 209927),
+(1, 209928),
+(1, 209929),
+(1, 209930),
+(1, 210411),
+(1, 210412),
+(1, 210413),
+(1, 210414),
+(1, 210415),
+(1, 210416),
+(1, 210420),
+(1, 210425),
+(1, 210426),
+(1, 210427),
+(1, 210428),
+(1, 210429),
+(1, 210677),
+(1, 210682),
+(1, 210683),
+(1, 210684),
+(1, 210685),
+(1, 210686),
+(1, 210944),
+(1, 210946),
+(1, 210947),
+(1, 210948),
+(1, 210949),
+(1, 210950),
+(1, 210951),
+(1, 210982),
+(1, 210983),
+(1, 210984),
+(1, 210985),
+(1, 211249),
+(1, 211256),
+(1, 211257),
+(1, 211258),
+(1, 211259),
+(1, 211260),
+(1, 211261),
+(1, 211540),
+(1, 211541),
+(1, 211542),
+(1, 211543),
+(1, 211544),
+(1, 211545),
+(1, 211546),
+(1, 211513),
+(1, 211520),
+(1, 211521),
+(1, 211522),
+(1, 211523),
+(1, 211524),
+(1, 211790),
+(1, 211791),
+(1, 211792),
+(1, 211793),
+(1, 211794),
+(1, 211797),
+(1, 212038),
+(1, 212039),
+(1, 212040),
+(1, 212041),
+(1, 212042),
+(1, 212043),
+(1, 212289),
+(1, 212290),
+(1, 212291),
+(1, 212292),
+(1, 212293),
+(1, 212295),
+(1, 212536),
+(1, 212537),
+(1, 212538),
+(1, 212539),
+(1, 212540),
+(1, 212541),
+(1, 212598),
+(1, 212599),
+(1, 212600),
+(1, 212601),
+(1, 212602),
+(1, 212603),
+(1, 212604),
+(1, 212847),
+(1, 212848),
+(1, 212849),
+(1, 212850),
+(1, 212851),
+(1, 212852),
+(1, 213103),
+(1, 213104),
+(1, 213105),
+(1, 213106),
+(1, 213108),
+(1, 213109),
+(1, 213113),
+(1, 213114),
+(1, 213115),
+(1, 213116),
+(1, 213117),
+(1, 213118),
+(1, 85192),
+(1, 85193),
+(1, 85194),
+(1, 85195),
+(1, 85196),
+(1, 85197),
+(1, 213096),
+(1, 213097),
+(1, 213098),
+(1, 213099),
+(1, 213100),
+(1, 213101),
+(1, 78648),
+(1, 78649),
+(1, 78650),
+(1, 78651),
+(1, 78652),
+(1, 213720),
+(1, 213727),
+(1, 213728),
+(1, 213729),
+(1, 213731),
+(1, 213732),
+(1, 213733),
+(1, 213737),
+(1, 213738),
+(1, 213739),
+(1, 213740),
+(1, 213741),
+(1, 213742),
+(1, 213746),
+(1, 213747),
+(1, 213748),
+(1, 213749),
+(1, 213751),
+(1, 213752),
+(1, 213790),
+(1, 213791),
+(1, 213792),
+(1, 213793),
+(1, 213794),
+(1, 213795),
+(1, 213796),
+(1, 213797),
+(1, 213798),
+(1, 213799),
+(1, 213800),
+(1, 213801),
+(1, 213802),
+(1, 213803),
+(1, 213804),
+(1, 213805),
+(1, 213806),
+(1, 213807),
+(1, 213808),
+(1, 213809),
+(1, 213810),
+(1, 213811),
+(1, 213812),
+(1, 213813),
+(1, 213814),
+(1, 213815),
+(1, 213816),
+(1, 213817),
+(1, 152327),
+(1, 152328),
+(1, 152329),
+(1, 152330),
+(1, 152331),
+(1, 152332),
+(1, 152333),
+(1, 152334),
+(1, 152335),
+(1, 152336),
+(1, 152337),
+(1, 152338),
+(1, 152339),
+(1, 152340),
+(1, 152341),
+(1, 152342),
+(1, 152343),
+(1, 152344),
+(1, 152345),
+(1, 152346),
+(1, 152347),
+(1, 152348),
+(1, 152349),
+(1, 152350),
+(1, 152351),
+(1, 152352),
+(1, 152353),
+(1, 152354),
+(1, 152355),
+(1, 152356),
+(1, 152357),
+(1, 152358),
+(1, 152359),
+(1, 152360),
+(1, 152361),
+(1, 152362),
+(1, 152363),
+(1, 152364),
+(1, 152365),
+(1, 152366),
+(1, 152367),
+(1, 152368),
+(1, 152369),
+(1, 152370),
+(1, 152371),
+(1, 152372),
+(1, 152373),
+(1, 152374),
+(1, 152375),
+(1, 152376),
+(1, 152377),
+(1, 152378),
+(1, 152379),
+(1, 152380),
+(1, 152381),
+(1, 152382),
+(1, 152383),
+(1, 152384),
+(1, 152385),
+(1, 152386),
+(1, 152387),
+(1, 152388),
+(1, 152389),
+(1, 152390),
+(1, 152391),
+(1, 152392),
+(1, 152393),
+(1, 152394),
+(1, 152395),
+(1, 152396),
+(1, 152397),
+(1, 152398),
+(1, 152399),
+(1, 152400),
+(1, 152401),
+(1, 152402),
+(1, 152403),
+(1, 152404),
+(1, 152405),
+(1, 152406),
+(1, 152407),
+(1, 152408),
+(1, 165584),
+(1, 165585),
+(1, 165586),
+(1, 165587),
+(1, 165588),
+(1, 165589),
+(1, 94739),
+(1, 165590),
+(1, 165591),
+(1, 165592),
+(1, 165593),
+(1, 165594),
+(1, 165595),
+(1, 165596),
+(1, 165597),
+(1, 165598),
+(1, 165599),
+(1, 165600),
+(1, 165601),
+(1, 165602),
+(1, 165603),
+(1, 165604),
+(1, 165605),
+(1, 165606),
+(1, 165607),
+(1, 165608),
+(1, 165609),
+(1, 165610),
+(1, 165611),
+(1, 165612),
+(1, 165613),
+(1, 165614),
+(1, 165615),
+(1, 165616);
diff --git a/sql/updates/world/3.3.5/2016_06_23_00_world.sql b/sql/updates/world/3.3.5/2016_06_23_00_world.sql
new file mode 100644
index 00000000000..49ec67454a3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_23_00_world.sql
@@ -0,0 +1,50 @@
+--
+SET @OGUID := 85065; -- 32 Required
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID AND @OGUID+31;
+INSERT INTO `gameobject` (`guid`, `id`, `map`,`zoneId`,`areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`,`VerifiedBuild`) VALUES
+(@OGUID,181371,1,0,0,1,1,1916.260620, -4339.434082, 21.460556, 2.969551,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+1,181371,1,0,0,1,1,1913.254395, -4333.927246, 21.604612, 4.351851,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+2,181371,1,0,0,1,1,1907.401245, -4337.044434, 21.677332, 6.107213,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+3,181371,1,0,0,1,1,1910.640137, -4342.747070, 21.676716, 5.887306,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+4,181371,1,0,0,1,1,-1028.846680, 293.187408, 135.844879, 1.204641,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+5,181371,1,0,0,1,1,-1030.881104, 297.332916, 136.117874, 6.148724,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+6,181371,1,0,0,1,1,-1027.052002, 299.510010, 136.164764, 4.558297,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+7,181371,1,0,0,1,1,-1024.677979, 295.472260, 136.143784, 3.823951,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+8,181371,1,0,0,1,1,8695.066406, 932.137634, 15.345254, 6.110,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+10,181371,1,0,0,1,1,8700.012695, 936.332153, 14.836842, 4.664,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+9,181371,1,0,0,1,1,8704.493164, 931.790894, 15.463143, 3.133,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+11,181371,1,0,0,1,1,8700.567383, 927.612854, 15.892158, 1.338,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+12,181371,0,0,0,1,1,-8833.281250, 855.614441, 99.411079, 2.575616,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+13,181371,0,0,0,1,1,-8834.824219, 861.003784, 99.434731, 3.883833,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+14,181371,0,0,0,1,1,-8840.805664, 860.021912, 99.391479, 4.602470,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+15,181371,0,0,0,1,1,-8839.428711, 853.691956, 99.298836, 0.486980,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+16,181371,0,0,0,1,1,-4701.214355, -1219.862183, 502.268250, 4.783111,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+17,181371,0,0,0,1,1,-4696.379395, -1224.597412, 502.304504, 2.941357,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+18,181371,0,0,0,1,1,-4702.767090, -1228.114258, 502.267609, 1.284167,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+19,181371,0,0,0,1,1,-4704.313477, -1222.943359, 502.269287, 1.830019,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+20,181371,0,0,0,1,1,1825.027954, 221.371674, 60.629555, 3.934886,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+21,181371,0,0,0,1,1,1823.459106, 214.621674, 60.507618, 2.686104,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+22,181371,0,0,0,1,1,1818.975342, 216.522690, 60.553699, 1.229190,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+23,181371,0,0,0,1,1,1819.281616, 221.073471, 60.566326, 5.925872,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+24,181371,530,0,0,1,1,9806.342773, -7244.069336, 26.683933, 1.731536,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+25,181371,530,0,0,1,1,9809.258789, -7237.612793, 26.686577, 2.387343,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+26,181371,530,0,0,1,1,9803.005859, -7236.524902, 26.655304, 3.757864,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+27,181371,530,0,0,1,1,9802.109375, -7242.179688, 26.474823, 5.874507,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+28,181371,530,0,0,1,1,-3790.196777, -11504.259766, -134.122711, 2.506965,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+29,181371,530,0,0,1,1,-3791.924805, -11498.497070, -134.097641, 4.148447,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+30,181371,530,0,0,1,1,-3797.747803, -11500.220703, -134.086700, 5.915591,0,0,0.945519,0.325568,180,100,0,0),
+(@OGUID+31,181371,530,0,0,1,1,-3793.995361, -11506.169922, -134.113098, 6.198332,0,0,0.945519,0.325568,180,100,0,0);
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+31 AND `eventEntry`=1;
+INSERT INTO `game_event_gameobject` SELECT 1, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+31;
+
+DELETE FROM `gameobject` WHERE `guid` IN (49312,165383,164812,164813,164814,164815,164816,164817,164818,164819,164820,164821,164822,164823,164825,164826,164827);
+DELETE FROM `gameobject` WHERE `guid` IN (164906,164907,164908,164909,164910,164911,164913,164914,164915,164916,164917,164918,164919,164920,164921,164922,164923,164924);
+DELETE FROM `game_event_gameobject` WHERE `guid` IN (49312,165383,164812,164813,164814,164815,164816,164817,164818,164819,164820,164821,164822,164823,164825,164826,164827);
+DELETE FROM `game_event_gameobject` WHERE `guid` IN (164906,164907,164908,164909,164910,164911,164913,164914,164915,164916,164917,164918,164919,164920,164921,164922,164923,164924);
+UPDATE `creature` SET `position_x`=1008.565002, `position_y`=-1452.775513, `position_z`=61.660973, `orientation`=5.272540 WHERE `guid`=212043;
+UPDATE `gameobject` SET `position_x`=989.562012, `position_y`=-1453.469971, `position_z`=61.001099, `orientation`=4.9105 WHERE `guid`=17857;
+UPDATE `gameobject` SET `position_x`=988.2767, `position_y`=-1440.3270, `position_z`=64.52133 WHERE `guid`=17853;
+UPDATE `gameobject` SET `position_x`=984.8693, `position_y`=-1445.037, `position_z`=63.92835 WHERE `guid`=17860;
+UPDATE `gameobject` SET `position_x`=-4223.839844, `position_y`=-12318.400391, `position_z`=2.47695 WHERE `guid`=165454;
+UPDATE `creature` SET `position_x`=-4223.839844, `position_y`=-12318.400391, `position_z`=2.47695 WHERE `guid`=152373;
+UPDATE `creature` SET `position_x`=-4217.176, `position_y`=-12309.458008, `position_z`=2.144819, `orientation`=5.988677 WHERE `guid`=212603;
diff --git a/sql/updates/world/3.3.5/2016_06_25_00_world.sql b/sql/updates/world/3.3.5/2016_06_25_00_world.sql
new file mode 100644
index 00000000000..f1337038533
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_25_00_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `creature_template` SET `unit_flags`=2147746560 WHERE `entry` BETWEEN 33608 AND 33615;
+UPDATE `creature_template_addon` SET `auras`="28782" WHERE `entry` BETWEEN 33608 AND 33615;
diff --git a/sql/updates/world/3.3.5/2016_06_25_01_world.sql b/sql/updates/world/3.3.5/2016_06_25_01_world.sql
new file mode 100644
index 00000000000..a318c821fb9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_25_01_world.sql
@@ -0,0 +1,6 @@
+--
+UPDATE `creature_template` SET `unit_flags`=33554944 WHERE `entry`=20143;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=20143;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(20143,0,0,0,25,0,100,0,0,0,0,0,3,0,18684,0,0,0,0,1,0,0,0,0,0,0,0,"Void Spawner - Quest - Warp Rifts - On Reset - Change modelID"),
+(20143,0,1,0,1,0,100,0,2000,5000,15000,23000,11,34943,0,0,0,0,0,1,0,0,0,0,0,0,0,"Void Spawner - Quest - Warp Rifts - Out of Combat - Cast 'Summon Unstable Voidwalker' (No Repeat)");
diff --git a/sql/updates/world/3.3.5/2016_06_25_02_world.sql b/sql/updates/world/3.3.5/2016_06_25_02_world.sql
new file mode 100644
index 00000000000..cf4e814d813
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_25_02_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `creature_template` SET `unit_flags`=2147746560 WHERE `entry` IN (33616, 33617, 33618, 33619, 33621, 33623);
+UPDATE `creature_template_addon` SET `auras`="28782" WHERE `entry` IN (33616, 33617, 33618, 33619, 33621, 33623);
diff --git a/sql/updates/world/3.3.5/2016_06_25_03_world.sql b/sql/updates/world/3.3.5/2016_06_25_03_world.sql
new file mode 100644
index 00000000000..d193f38a922
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_25_03_world.sql
@@ -0,0 +1,19 @@
+UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=19440 AND `id`=0;
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=38530 AND `ElseGroup`>0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 38530, 0, 1, 31, 0, 3, 16873, 0, 0, 0, 0, '', NULL),
+(13, 1, 38530, 0, 2, 31, 0, 3, 16907, 0, 0, 0, 0, '', NULL),
+(13, 1, 38530, 0, 3, 31, 0, 3, 19422, 0, 0, 0, 0, '', NULL),
+(13, 1, 38530, 0, 3, 31, 0, 3, 19424, 0, 0, 0, 0, '', NULL);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=16873 AND `source_type`=0 AND `id`=17;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=16907 AND `source_type`=0 AND `id`=1;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=19422 AND `source_type`=0 AND `id`=15;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=19424 AND `source_type`=0 AND `id`=4;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(16873, 0, 17, 0, 8, 0, 100, 1, 38530, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Bleeding Hollow Dark Shaman - On Spellhit - Start Attack'),
+(16907, 0, 1, 0, 8, 0, 100, 1, 38530, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Bleeding Hollow Peon - On Spellhit - Start Attack'),
+(19422, 0, 15, 0, 8, 0, 100, 1, 38530, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Bleeding Hollow Necrolyte - On Spellhit - Start Attack'),
+(19424, 0, 4, 0, 8, 0, 100, 1, 38530, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Bleeding Hollow Tormentor - On Spellhit - Start Attack');
diff --git a/sql/updates/world/3.3.5/2016_06_26_00_world.sql b/sql/updates/world/3.3.5/2016_06_26_00_world.sql
new file mode 100644
index 00000000000..1551f6a646e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_26_00_world.sql
@@ -0,0 +1,5 @@
+UPDATE `creature_template` SET `unit_flags`=64 WHERE `entry`=25740;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=45947;
+DELETE FROM `creature_template_addon` WHERE `entry`=25754;
+INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(25754,0,0,1,1,0,NULL);
diff --git a/sql/updates/world/3.3.5/2016_06_26_01_world.sql b/sql/updates/world/3.3.5/2016_06_26_01_world.sql
new file mode 100644
index 00000000000..b9ab8f12a54
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_26_01_world.sql
@@ -0,0 +1,10 @@
+-- Link Dancer Check Aura and Visual to Ribbon Pole Channel
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (29531,45390);
+INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
+(29531,45390,0, 'Ribbon Pole - Dancer Check Aura'),
+(45390,45406,2, 'Ribbon Pole - Periodic Visual');
+
+-- Spell Script
+DELETE FROM `spell_script_names` WHERE `spell_id`=45390;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(45390, 'spell_gen_ribbon_pole_dancer_check');
diff --git a/sql/updates/world/3.3.5/2016_06_26_02_world.sql b/sql/updates/world/3.3.5/2016_06_26_02_world.sql
new file mode 100644
index 00000000000..0e5064b33c1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_26_02_world.sql
@@ -0,0 +1,8 @@
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(25342,25343) AND `source_type`=0 AND `id`>2;
+UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid` IN(25342,25343) AND `source_type`=0 AND `id`=2 AND `link`=3;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(25342, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 50, 182071, 30, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dead Caravan Guard - On Spellhit \'Ragefist\'s Torch\' - Spawn GO Small Chapel Fire'),
+(25343, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 50, 182071, 30, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dead Caravan Worker - On Spellhit \'Ragefist\'s Torch\' - Spawn GO Small Chapel Fire'),
+(25342, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 30000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dead Caravan Guard - On Spellhit \'Ragefist\'s Torch\' - Despawn after 30 seconds'),
+(25343, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 30000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dead Caravan Worker - On Spellhit \'Ragefist\'s Torch\' - Despawn after 30 seconds');
+UPDATE `creature_template_addon` SET `auras`='48602' WHERE `entry`=27292;
diff --git a/sql/updates/world/3.3.5/2016_06_27_00_world.sql b/sql/updates/world/3.3.5/2016_06_27_00_world.sql
new file mode 100644
index 00000000000..d84c8158542
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_27_00_world.sql
@@ -0,0 +1,3 @@
+--
+DELETE FROM `gameobject` WHERE `guid` IN (165009,165010,165012,165013,165014,165015,165016,165019,165020,165021,165022,165023,165024,165025,165026,165027,165028,165029,165030,165031,165032,165033);
+UPDATE `gameobject` SET `position_x`=2019.6999, `position_y`=6587.1401, `position_z`=134.985001, `orientation`=6.237050 WHERE `guid`=70594;
diff --git a/sql/updates/world/3.3.5/2016_06_27_01_world.sql b/sql/updates/world/3.3.5/2016_06_27_01_world.sql
new file mode 100644
index 00000000000..6f7d3a34127
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_27_01_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (25324) AND `id`=2;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25324,0,2,0,25,0,100,0,0,0,0,0,3,0,23114,0,0,0,0,1,0,0,0,0,0,0,0,'Earthen ring Guide - On reset - morph to model');
diff --git a/sql/updates/world/3.3.5/2016_06_27_02_world.sql b/sql/updates/world/3.3.5/2016_06_27_02_world.sql
new file mode 100644
index 00000000000..6484f75afc4
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_27_02_world.sql
@@ -0,0 +1,107 @@
+--
+-- Fix quests Incense for the Festival Scorchlings and Incense for the Summer Scorchlings
+DELETE FROM `creature_queststarter` WHERE `quest`=11964;
+-- SAI for Festival Talespinner
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=16818;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=16818;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(16818,0,0,0,19,0,100,0,11966,0,0,0,11,46826,0,0,0,0,0,7,0,0,0,0,0,0,0,'Festival Talespinner - On target quest accepted - Cast Flame Keeper Breadcrumb');
+-- SAI for Festival Loremaster
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=16817;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=16817;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(16817,0,0,0,19,0,100,0,11964,0,0,0,11,46825,0,0,0,0,0,7,0,0,0,0,0,0,0,'Festival Loremaster - On target quest accepted - Cast Flame Warden Breadcrumb');
+-- Whisp of Ragnaros flag not selectable
+UPDATE `creature_template` SET `unit_flags`=33554432 WHERE `entry`=26502;
+-- SAI for Festival Schorchling
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=26520;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=26520;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=2652000;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(26520,0,0,0,8,0,100,0,47104,0,0,0,80,2652000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - On spell hit - Run script '),
+(2652000,9,1,0,0,0,100,0,0,0,0,0,1,0,2000,0,0,0,0,21,3,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 0'),
+(2652000,9,2,0,0,0,100,0,1000,1000,0,0,1,1,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 1'),
+(2652000,9,3,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,4,0,0,0,100,0,0,0,0,0,1,2,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 2'),
+(2652000,9,5,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,6,0,0,0,100,0,0,0,0,0,1,3,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 3'),
+(2652000,9,7,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,8,0,0,0,100,0,0,0,0,0,1,4,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 4'),
+(2652000,9,9,0,0,0,100,0,1000,1000,0,0,1,5,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 5'),
+(2652000,9,10,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,11,0,0,0,100,0,0,0,0,0,1,6,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 6'),
+(2652000,9,12,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,13,0,0,0,100,0,0,0,0,0,1,7,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 7'),
+(2652000,9,14,0,0,0,100,0,0,0,0,0,11,47120,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Summon Whisp of Ragnaros'),
+(2652000,9,15,0,0,0,100,0,0,0,0,0,75,45889,0,0,0,0,0,11,26502,10,0,0,0,0,0,'Festival Scorchling - Action list - Aura Scorchling Blast'),
+(2652000,9,16,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,17,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,11,26502,10,0,0,0,0,0,'Festival Scorchling - Action list - Despawn Whisp of Ragnaros '),
+(2652000,9,18,0,0,0,100,0,0,0,0,0,1,8,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 8'),
+(2652000,9,19,0,0,0,100,0,0,0,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast grow'),
+(2652000,9,20,0,0,0,100,0,0,0,0,0,1,9,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 9'),
+(2652000,9,21,0,0,0,100,0,1000,1000,0,0,11,46660,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Cast Extinguished'),
+(2652000,9,22,0,0,0,100,0,0,0,0,0,28,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Remove aura from grow'),
+(2652000,9,23,0,0,0,100,0,3000,3000,0,0,1,10,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Festival Scorchling - Action list - Say text 10');
+-- Festival Scorchling texts
+DELETE FROM `creature_text` WHERE `entry`= 26520;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES
+(26520,0,0,'Thank you again, $n, for this delectable incense.',12,0,100,1,1000,0,'Festival Scorchling',25699),
+(26520,1,0,'%s devours the incense. It\'s ravenous!',16,0,100,1,1000,0,'Festival Scorchling',25717),
+(26520,2,0,'So good! So packed with energy!',12,0,100,1,1000,0,'Festival Scorchling',25718),
+(26520,3,0,'It has everything a growing scorchling needs!',12,0,100,1,1000,0,'Festival Scorchling',25719),
+(26520,4,0,'I can feel the power SURGING within me!',12,0,100,1,1000,0,'Festival Scorchling',25730),
+(26520,5,0,'%s bellows with laughter!',16,0,100,1,1000,0,'Festival Scorchling',25720),
+(26520,6,0,'Now! Finally! Our plans can take effect!',12,0,100,1,1000,0,'Festival Scorchling',25721),
+(26520,7,0,'KNEEL, LITTLE MORTAL! KNEEL BEFORE THE MIGHT OF THE HERALD OF RAGNAROS!',12,0,100,1,1000,0,'Festival Scorchling',25722),
+(26520,8,0,'YOU WILL ALL PERISH IN FLAMES!',12,0,100,1,1000,0,'Festival Scorchling',25723),
+(26520,9,0,'%s blinks...',16,0,100,1,1000,0,'Festival Scorchling',25724),
+(26520,10,0,'Ah. I was merely jesting...',12,0,100,1,1000,0,'Festival Scorchling',25725);
+-- SAI for Summer Schorchling
+UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=26401;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=26401;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=2640100;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(26401,0,0,0,8,0,100,0,47104,0,0,0,80,2640100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - On spell hit - Start script'),
+(2640100,9,1,0,0,0,100,0,0,0,0,0,1,0,2000,0,0,0,0,21,3,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 0'),
+(2640100,9,2,0,0,0,100,0,1000,1000,0,0,1,1,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 1'),
+(2640100,9,3,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,4,0,0,0,100,0,0,0,0,0,1,2,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 2'),
+(2640100,9,5,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Actionlist - Action 5 - Cast grow'),
+(2640100,9,6,0,0,0,100,0,0,0,0,0,1,3,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 3'),
+(2640100,9,7,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,8,0,0,0,100,0,0,0,0,0,1,4,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 4'),
+(2640100,9,9,0,0,0,100,0,1000,1000,0,0,1,5,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 5'),
+(2640100,9,10,0,0,0,100,0,2000,2000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,11,0,0,0,100,0,0,0,0,0,1,6,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 6'),
+(2640100,9,12,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,13,0,0,0,100,0,0,0,0,0,1,7,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 7'),
+(2640100,9,14,0,0,0,100,0,0,0,0,0,11,47120,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Summon Whisp of Ragnaros'),
+(2640100,9,15,0,0,0,100,0,0,0,0,0,75,45889,0,0,0,0,0,11,26502,10,0,0,0,0,0,'Summer Scorchling - Action list - Aura Scorchling Blast'),
+(2640100,9,16,0,0,0,100,0,3000,3000,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,17,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,11,26502,10,0,0,0,0,0,'Summer Scorchling - Action list - Despawn Whisp of Ragnaros '),
+(2640100,9,18,0,0,0,100,0,0,0,0,0,1,8,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 8'),
+(2640100,9,19,0,0,0,100,0,0,0,0,0,11,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast grow'),
+(2640100,9,20,0,0,0,100,0,0,0,0,0,1,9,1000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 9'),
+(2640100,9,21,0,0,0,100,0,1000,1000,0,0,11,46660,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Cast Extinguished'),
+(2640100,9,22,0,0,0,100,0,0,0,0,0,28,47114,0,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Remove aura from grow'),
+(2640100,9,23,0,0,0,100,0,3000,3000,0,0,1,10,2000,0,0,0,0,1,0,0,0,0,0,0,0,'Summer Scorchling - Action list - Say text 10');
+-- Summer Scorchling texts
+DELETE FROM `creature_text` WHERE `entry`= 26401;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES
+(26401,0,0,'Thank you again, $n, for this delectable incense.',12,0,100,1,1000,0,'Summer Scorchling',25699),
+(26401,1,0,'%s devours the incense. It\'s ravenous!',16,0,100,1,1000,0,'Summer Scorchling',25717),
+(26401,2,0,'So good! So packed with energy!',12,0,100,1,1000,0,'Summer Scorchling',25718),
+(26401,3,0,'It has everything a growing scorchling needs!',12,0,100,1,1000,0,'Summer Scorchling',25719),
+(26401,4,0,'I can feel the power SURGING within me!',12,0,100,1,1000,0,'Summer Scorchling',25730),
+(26401,5,0,'%s bellows with laughter!',16,0,100,1,1000,0,'Summer Scorchling',25720),
+(26401,6,0,'Now! Finally! Our plans can take effect!',12,0,100,1,1000,0,'Summer Scorchling',25721),
+(26401,7,0,'KNEEL, LITTLE MORTAL! KNEEL BEFORE THE MIGHT OF THE HERALD OF RAGNAROS!',12,0,100,1,1000,0,'Summer Scorchling',25722),
+(26401,8,0,'YOU WILL ALL PERISH IN FLAMES!',12,0,100,1,1000,0,'Summer Scorchling',25723),
+(26401,9,0,'%s blinks...',16,0,100,1,1000,0,'Summer Scorchling',25724),
+(26401,10,0,'Ah. I was merely jesting...',12,0,100,1,1000,0,'Summer Scorchling',25725);
+
+-- Add conditions for spell Scorchling Gets Incense
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=47104;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition` ,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,47104,0,1,31,0,3,26520,0,0,0,'','Scorchling gets incense can hit Festival Scorchling'),
+(13,1,47104,0,2,31,0,3,26401,0,0,0,'','Scorchling gets incense can hit Summer Scorchling');
diff --git a/sql/updates/world/3.3.5/2016_06_29_00_world.sql b/sql/updates/world/3.3.5/2016_06_29_00_world.sql
new file mode 100644
index 00000000000..b4dcaf7c15e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_29_00_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `game_event_gameobject` WHERE `guid` IN (165009,165010,165012,165013,165014,165015,165016,165019,165020,165021,165022,165023,165024,165025,165026,165027,165028,165029,165030,165031,165032,165033);
diff --git a/sql/updates/world/3.3.5/2016_06_29_01_world.sql b/sql/updates/world/3.3.5/2016_06_29_01_world.sql
new file mode 100644
index 00000000000..4ffabf4b0a8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_29_01_world.sql
@@ -0,0 +1,2702 @@
+SET @OGUID:=87978;
+SET @Event:=1;
+
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+2691;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0 , 187572, 530, 1, 1, -241.8369, 5429.573, 24.37494, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3565)
+(@OGUID+1 , 187572, 530, 1, 1, -243.9615, 5443.92, 25.26089, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3565)
+(@OGUID+2 , 187572, 530, 1, 1, -252.851, 5437.038, 25.89111, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3565)
+(@OGUID+3 , 187572, 530, 1, 1, -224.2356, 5516.909, 28.54368, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3565)
+(@OGUID+4 , 187572, 530, 1, 1, -165.054, 5518.109, 31.18534, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3565)
+(@OGUID+5 , 187572, 530, 1, 1, 274.8896, 6057.858, 131.4415, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3644)
+(@OGUID+6 , 187572, 530, 1, 1, 277.9382, 6049.539, 131.4333, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3644)
+(@OGUID+7 , 187572, 530, 1, 1, 282, 6048.846, 131.4411, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3644)
+(@OGUID+8 , 187572, 530, 1, 1, 288.1331, 6056.699, 131.4345, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3644)
+(@OGUID+9 , 187572, 530, 1, 1, 282.4333, 6063.334, 131.4415, 5.899214, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3644)
+(@OGUID+10 , 187572, 530, 1, 1, 1039.835, 7363.489, 40.09451, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3766)
+(@OGUID+11 , 187572, 530, 1, 1, 1050.579, 7360.472, 40.28421, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3766)
+(@OGUID+12 , 187572, 530, 1, 1, 1048.977, 7358.21, 40.21627, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3766)
+(@OGUID+13 , 187572, 530, 1, 1, 1045.045, 7366.596, 40.2879, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3766)
+(@OGUID+14 , 187572, 530, 1, 1, 1042.174, 7364.971, 40.18074, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3766)
+(@OGUID+15 , 187572, 530, 1, 1, 1047.144, 7355.711, 40.11453, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3766)
+(@OGUID+16 , 187572, 530, 1, 1, 3057.186, 3708.671, 143.9881, 1.378809, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+17 , 187572, 530, 1, 1, 3054.319, 3706.454, 143.966, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+18 , 187572, 530, 1, 1, 3058.017, 3698.433, 143.8841, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+19 , 187572, 530, 1, 1, 3062.03, 3710.77, 143.9977, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+20 , 187572, 530, 1, 1, 3055.256, 3703.665, 143.9852, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+21 , 187572, 530, 1, 1, 3056.405, 3700.777, 144.005, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+22 , 187572, 530, 1, 1, 3070.169, 3714.774, 143.9962, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+23 , 187572, 530, 1, 1, 3064.977, 3685.611, 143.7038, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+24 , 187572, 530, 1, 1, 3073.896, 3715.572, 143.9741, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+25 , 187572, 530, 1, 1, 3062.429, 3690.319, 143.739, 5.340709, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+26 , 187572, 530, 1, 1, 3063.754, 3687.763, 143.681, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+27 , 187572, 530, 1, 1, 3066.316, 3712.954, 143.9952, 1.989672, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+28 , 187572, 530, 1, 1, 3073.009, 3686.083, 143.9886, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+29 , 187572, 530, 1, 1, 3070.123, 3684.238, 143.9739, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+30 , 187572, 530, 1, 1, 3076.475, 3712.604, 143.9648, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+31 , 187572, 530, 1, 1, 3067.167, 3683.273, 143.8312, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+32 , 187572, 530, 1, 1, 3078.454, 3709.075, 143.9676, 0.06981169, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+33 , 187572, 530, 1, 1, 3083.626, 3699.835, 143.9755, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+34 , 187572, 530, 1, 1, 3085.193, 3697.061, 143.9655, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+35 , 187572, 530, 1, 1, 3079.557, 3690.007, 143.9812, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+36 , 187572, 530, 1, 1, 3085.981, 3694.047, 143.961, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+37 , 187572, 530, 1, 1, 3083.373, 3691.876, 143.9724, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+38 , 187572, 530, 1, 1, 3076.299, 3688.263, 143.9803, 4.590216, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+39 , 187572, 530, 1, 1, 3081.989, 3702.521, 143.9719, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+40 , 187572, 530, 1, 1, 3080.312, 3705.64, 143.9753, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3712)
+(@OGUID+41 , 187572, 530, 1, 1, -2937.644, 4002.613, 2.06225, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+42 , 187572, 530, 1, 1, -2943.523, 3989.1, 0.545542, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+43 , 187572, 530, 1, 1, -2942.966, 3986.944, 3.025976, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+44 , 187572, 530, 1, 1, -2939.915, 3989.186, 0.54576, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+45 , 187572, 530, 1, 1, -2936.816, 4004.084, 2.03728, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+46 , 187572, 530, 1, 1, -2939.37, 3984.464, 3.025977, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+47 , 187572, 530, 1, 1, -2945.822, 3986.863, 0.551942, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+48 , 187572, 530, 1, 1, -2943.989, 3985.416, 3.025977, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+49 , 187572, 530, 1, 1, -2937.538, 3986.691, 0.568022, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+50 , 187572, 530, 1, 1, -2941.231, 3987.247, 3.025977, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+51 , 187572, 530, 1, 1, -2943.693, 3983.661, 3.025977, 0.6108634, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+52 , 187572, 530, 1, 1, -2939.676, 3986.295, 3.025977, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+53 , 187572, 530, 1, 1, -2945.819, 3983.282, 0.565527, 0.7679439, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+54 , 187572, 530, 1, 1, -2943.34, 3980.825, 0.567986, 0.06981169, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+55 , 187572, 530, 1, 1, -2939.93, 3980.845, 0.569154, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+56 , 187572, 530, 1, 1, -2942.087, 3982.628, 3.025977, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+57 , 187572, 530, 1, 1, -2937.55, 3983.1, 0.56814, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+58 , 187572, 530, 1, 1, -2940.342, 3982.971, 3.025977, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3684)
+(@OGUID+59 , 187572, 530, 1, 1, 225.2546, 8509.239, 26.65809, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+60 , 187572, 530, 1, 1, 206.8793, 8515.106, 26.21783, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+61 , 187572, 530, 1, 1, 225.1708, 8507.408, 25.51025, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+62 , 187572, 530, 1, 1, 211.4542, 8508.43, 25.87837, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+63 , 187572, 530, 1, 1, 229.2561, 8514.614, 25.6382, 4.153885, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+64 , 187572, 530, 1, 1, 214.8837, 8529.985, 25.71218, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+65 , 187572, 530, 1, 1, 228.41, 8521.593, 24.48324, 0.4712385, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+66 , 187572, 530, 1, 1, 221.5685, 8528.777, 25.17912, 0.2094394, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+67 , 187572, 530, 1, 1, 219.8215, 8519.024, 26.14288, 5.899214, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+68 , 187572, 530, 1, 1, 216.2591, 8521.201, 27.35521, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+69 , 187572, 530, 1, 1, 212.9643, 8518.036, 28.48465, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+70 , 187572, 530, 1, 1, 211.0715, 8528.457, 25.71797, 1.378809, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+71 , 187572, 530, 1, 1, 221.6456, 8527.546, 25.35055, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+72 , 187572, 530, 1, 1, 207.398, 8521.497, 26.20726, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+73 , 187572, 530, 1, 1, -3025.772, 2557.571, 81.67224, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3744)
+(@OGUID+74 , 187572, 530, 1, 1, -3025.11, 2559.661, 80.91459, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3744)
+(@OGUID+75 , 187572, 530, 1, 1, -3026.945, 2561.112, 81.63725, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3744)
+(@OGUID+76 , 187572, 530, 1, 1, -3018.662, 2544.411, 80.34085, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3744)
+(@OGUID+77 , 187572, 530, 1, 1, -4015.03, 2153.216, 106.7785, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3745)
+(@OGUID+78 , 187572, 530, 1, 1, -4009.631, 2150.075, 106.7804, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3745)
+(@OGUID+79 , 187572, 530, 1, 1, -4081.995, 2166.591, 112.2705, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3745)
+(@OGUID+80 , 187572, 530, 1, 1, -4081.902, 2162.457, 111.6688, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3745)
+(@OGUID+81 , 187572, 530, 1, 1, -4078.799, 2168.082, 109.4882, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3745)
+(@OGUID+82 , 187572, 571, 1, 1, 5231.799, -1312.145, 242.4062, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 66)
+(@OGUID+83 , 187572, 571, 1, 1, 5219.131, -1294.844, 243.2324, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 66)
+(@OGUID+84 , 187572, 571, 1, 1, 5220.16, -1332.954, 242.3486, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 66)
+(@OGUID+85 , 187572, 571, 1, 1, 5228.342, -1302.892, 242.7808, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 66)
+(@OGUID+86 , 187572, 571, 1, 1, 5205.623, -1333.328, 243.4024, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 66)
+(@OGUID+87 , 187572, 571, 1, 1, 5212.926, -1294.726, 242.5768, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 66)
+(@OGUID+88 , 187572, 571, 1, 1, 5190.682, -1317.712, 244.4336, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4312)
+(@OGUID+89 , 187572, 571, 1, 1, 5196.662, -1297.77, 244.9721, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4312)
+(@OGUID+90 , 187572, 571, 1, 1, 5191.56, -1305.979, 244.4355, 5.410522, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4312)
+(@OGUID+91 , 187572, 571, 1, 1, 5187.832, -2189, 237.5006, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+92 , 187572, 571, 1, 1, 5176.379, -2197.998, 237.5495, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+93 , 187572, 571, 1, 1, 5179.248, -2198.358, 238.4526, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+94 , 187572, 571, 1, 1, 5187.784, -2191.967, 238.5997, 1.06465, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+95 , 187572, 571, 1, 1, 5187.786, -2195.117, 239.4474, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4317)
+(@OGUID+96 , 187572, 571, 1, 1, 5182.681, -2198.434, 239.399, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4317)
+(@OGUID+97 , 187572, 571, 1, 1, 5767.042, -3564.952, 388.1387, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4323)
+(@OGUID+98 , 187572, 571, 1, 1, 5759.857, -3567.817, 388.3598, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4323)
+(@OGUID+99 , 187572, 571, 1, 1, 5767.813, -3565.605, 388.1718, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4323)
+(@OGUID+100 , 187572, 571, 1, 1, 5774.695, -3602.46, 389.2473, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4323)
+(@OGUID+101 , 187572, 571, 1, 1, 7802.333, -2954.012, 1258.015, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4441)
+(@OGUID+102 , 187572, 571, 1, 1, 7807.708, -2956.999, 1258.036, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4441)
+(@OGUID+103 , 187572, 571, 1, 1, 7803.764, -2952.953, 1257.529, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4441)
+(@OGUID+104 , 187572, 571, 1, 1, 7807.827, -2955.189, 1257.591, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4441)
+(@OGUID+105 , 187572, 571, 1, 1, 3854.739, -4497.549, 214.1914, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4205)
+(@OGUID+106 , 187572, 571, 1, 1, 3854.873, -4497.049, 214.1632, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4205)
+(@OGUID+107 , 187572, 571, 1, 1, 3862.255, -4495.877, 214.0401, 2.059488, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4205)
+(@OGUID+108 , 187572, 571, 1, 1, 3883.803, -4518.698, 219.4198, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4205)
+(@OGUID+109 , 187572, 571, 1, 1, 3846.244, -4514.318, 213.0963, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+110 , 187572, 571, 1, 1, 3846.859, -4514.041, 213.0314, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+111 , 187572, 571, 1, 1, 3851.367, -4529.999, 210.2527, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+112 , 187572, 571, 1, 1, 3846.599, -4507.069, 213.362, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+113 , 187572, 571, 1, 1, 3855.264, -4538.323, 210.3319, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+114 , 187572, 571, 1, 1, 3871.819, -4548.663, 211.196, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+115 , 187572, 571, 1, 1, 3844.863, -4537.382, 210.5569, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+116 , 187572, 571, 1, 1, 3851.176, -4541.075, 210.2534, 0.7853968, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+117 , 187572, 571, 1, 1, 3862.344, -4548.556, 211.4609, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+118 , 187572, 571, 1, 1, 3868.193, -4566.316, 215.3402, 5.916668, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+119 , 187572, 571, 1, 1, 3867.665, -4565.772, 215.3505, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+120 , 187572, 571, 1, 1, 3866.146, -4556.351, 217.2647, 1.780234, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+121 , 187572, 571, 1, 1, 3408.634, -2804.354, 212.2962, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+122 , 187572, 571, 1, 1, 3400.878, -2792.271, 212.3842, 4.153885, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+123 , 187572, 571, 1, 1, 3398.95, -2792.49, 212.3258, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+124 , 187572, 571, 1, 1, 3407.376, -2802.615, 212.3642, 2.303831, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+125 , 187572, 571, 1, 1, 3400.26, -2792.18, 212.3036, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+126 , 187572, 571, 1, 1, 3397.087, -2788.766, 212.2994, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4204)
+(@OGUID+127 , 187572, 571, 1, 1, 3399.973, -2790.529, 212.3376, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4204)
+(@OGUID+128 , 187572, 571, 1, 1, 3263.72, -2270.777, 115.3641, 4.101525, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4248)
+(@OGUID+129 , 187572, 571, 1, 1, 3242.611, -2233.558, 115.1097, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4248)
+(@OGUID+130 , 187572, 571, 1, 1, 3268.989, -2233.57, 116.2734, 3.438303, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4248)
+(@OGUID+131 , 187572, 571, 1, 1, 3266.978, -2238.066, 115.6821, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4248)
+(@OGUID+132 , 187572, 571, 1, 1, 3246.168, -2225.112, 116.2689, 0, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4248)
+(@OGUID+133 , 187572, 571, 1, 1, 3265.178, -2242.466, 115.056, 2.042035, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4248)
+(@OGUID+134 , 187572, 571, 1, 1, 3244.594, -2228.536, 115.6822, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4248)
+(@OGUID+135 , 187572, 571, 1, 1, 1431.97, -3278.05, 175.8965, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4071)
+(@OGUID+136 , 187572, 571, 1, 1, 1421.823, -3274.434, 175.8965, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4071)
+(@OGUID+137 , 187572, 571, 1, 1, 1424.238, -3271.245, 175.8965, 2.303831, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4071)
+(@OGUID+138 , 187572, 571, 1, 1, 1425.976, -3282.05, 175.8965, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4071)
+(@OGUID+139 , 187572, 571, 1, 1, 1421.333, -3278.195, 175.8965, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4071)
+(@OGUID+140 , 187572, 571, 1, 1, 1429.63, -3280.972, 175.8965, 5.794494, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4071)
+(@OGUID+141 , 187572, 571, 1, 1, 727.2495, -2932.994, 7.874049, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3987)
+(@OGUID+142 , 187572, 571, 1, 1, 730.0959, -2931.596, 7.918657, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3987)
+(@OGUID+143 , 187572, 571, 1, 1, 732.0202, -2926.204, 7.921756, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3987)
+(@OGUID+144 , 187572, 571, 1, 1, 732.6984, -2930.365, 7.934427, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3987)
+(@OGUID+145 , 187572, 571, 1, 1, 710.6893, -2929.116, -2.16061, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3987)
+(@OGUID+146 , 187572, 571, 1, 1, 725.784, -2925.61, 7.901932, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3987)
+(@OGUID+147 , 187572, 571, 1, 1, 729.1365, -2925.896, 7.908826, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3987)
+(@OGUID+148 , 187572, 571, 1, 1, 711.5972, -2934.622, -2.181822, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3987)
+(@OGUID+149 , 187572, 571, 1, 1, 588.3549, -4954.631, 27.2703, 1.815142, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3981)
+(@OGUID+150 , 187572, 571, 1, 1, 592.91, -4950.143, 27.2703, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3981)
+(@OGUID+151 , 187572, 571, 1, 1, 592.2098, -4945.239, 27.2703, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3981)
+(@OGUID+152 , 187572, 571, 1, 1, 583.0338, -4950.212, 27.2703, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3981)
+(@OGUID+153 , 187572, 571, 1, 1, 578.659, -4944.729, 18.32809, 0.2094394, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3981)
+(@OGUID+154 , 187572, 571, 1, 1, 576.8945, -4944.993, 17.68654, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3981)
+(@OGUID+155 , 187572, 571, 1, 1, 577.5501, -4940.387, 18.30996, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3981)
+(@OGUID+156 , 187572, 571, 1, 1, 575.9412, -4940.815, 17.56364, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 3981)
+(@OGUID+157 , 187572, 571, 1, 1, 3220.349, -685.9569, 167.1892, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+158 , 187572, 571, 1, 1, 3223.984, -684.1493, 167.24, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+159 , 187572, 571, 1, 1, 3222.427, -687.5139, 167.1181, 3.630291, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+160 , 187572, 571, 1, 1, 3221.639, -683.0989, 167.1992, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+161 , 187572, 571, 1, 1, 3205.693, -680.2454, 167.5366, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4186)
+(@OGUID+162 , 187572, 571, 1, 1, 3212.055, -681.3081, 174.8388, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4186)
+(@OGUID+163 , 187572, 571, 1, 1, 3209.019, -676.864, 167.5366, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4186)
+(@OGUID+164 , 187572, 571, 1, 1, 3568.101, 255.9918, 45.70592, 3.630291, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4161)
+(@OGUID+165 , 187572, 571, 1, 1, 3539.059, 247.203, 45.70501, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4161)
+(@OGUID+166 , 187572, 571, 1, 1, 3519.824, 270.4999, 45.70507, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4161)
+(@OGUID+167 , 187572, 571, 1, 1, 3570.456, 285.7692, 45.76595, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4161)
+(@OGUID+168 , 187572, 571, 1, 1, 3534.701, 297.3186, 45.70494, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4161)
+(@OGUID+169 , 187572, 571, 1, 1, 2775.393, 930.8277, 22.25009, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+170 , 187572, 571, 1, 1, 2779.236, 917.7034, 22.35922, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+171 , 187572, 571, 1, 1, 2785.635, 921.6565, 22.35873, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+172 , 187572, 571, 1, 1, 2647.045, 878.9326, 4.849034, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+173 , 187572, 571, 1, 1, 2656.301, 871.572, 4.834126, 3.630291, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+174 , 187572, 571, 1, 1, 2645.948, 874.8683, 4.83767, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+175 , 187572, 571, 1, 1, 2651.81, 856.4553, 4.84759, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+176 , 187572, 571, 1, 1, 2654.594, 866.0796, 4.808696, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+177 , 187572, 571, 1, 1, 2653.362, 862.1208, 4.809918, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+178 , 187572, 571, 1, 1, 2657.637, 875.5178, 4.844224, 5.009095, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+179 , 187572, 571, 1, 1, 2650.517, 852.668, 4.834447, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+180 , 187572, 571, 1, 1, 2644.318, 869.2494, 4.805964, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+181 , 187572, 571, 1, 1, 2640.068, 855.8304, 4.842837, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+182 , 187572, 571, 1, 1, 2643.018, 865.1339, 4.813616, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+183 , 187572, 571, 1, 1, 2638.512, 850.2684, 4.888963, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+184 , 187572, 571, 1, 1, 2637.107, 846.332, 4.828626, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+185 , 187572, 571, 1, 1, 2641.241, 859.7672, 4.846929, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+186 , 187572, 571, 1, 1, 2647.614, 843.0643, 4.812499, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+187 , 187572, 571, 1, 1, 2648.869, 847.0348, 4.817444, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4152)
+(@OGUID+188 , 187572, 571, 1, 1, 3831.97, 1516.262, 92.38146, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+189 , 187572, 571, 1, 1, 3831.801, 1519.576, 91.51768, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+190 , 187572, 571, 1, 1, 3831.554, 1524.541, 90.93062, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+191 , 187572, 571, 1, 1, 3831.325, 1529.669, 90.37012, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+192 , 187572, 571, 1, 1, 3851.648, 1516.306, 92.34167, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+193 , 187572, 571, 1, 1, 3852.458, 1529.622, 90.37012, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4165)
+(@OGUID+194 , 187572, 571, 1, 1, 3852.2, 1524.579, 90.92751, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4165)
+(@OGUID+195 , 187572, 571, 1, 1, 3851.949, 1520.867, 91.51768, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4165)
+(@OGUID+196 , 187572, 571, 1, 1, 3502.552, 1966.383, 66.30372, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+197 , 187572, 571, 1, 1, 3502.825, 1971.287, 66.33058, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+198 , 187572, 571, 1, 1, 3491.12, 1972.526, 66.79745, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+199 , 187572, 571, 1, 1, 3498.157, 1963.667, 66.98794, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+200 , 187572, 571, 1, 1, 3499.447, 1986.641, 66.0871, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+201 , 187572, 571, 1, 1, 3522.465, 1993.206, 66.59767, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+202 , 187572, 571, 1, 1, 3465.634, 1994.535, 65.82655, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+203 , 187572, 571, 1, 1, 3472.561, 1990.535, 65.79995, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+204 , 187572, 571, 1, 1, 3494.791, 1994.783, 65.50302, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+205 , 187572, 571, 1, 1, 3521.992, 1997.143, 66.58281, 3.752462, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+206 , 187572, 571, 1, 1, 3518.091, 1995.668, 66.5723, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+207 , 187572, 571, 1, 1, 3474.955, 2004.583, 64.86234, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+208 , 187572, 571, 1, 1, 3509.424, 2016.74, 66.59296, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+209 , 187572, 571, 1, 1, 3506.767, 2013.933, 66.58628, 5.305802, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+210 , 187572, 571, 1, 1, 3488.441, 2015.385, 66.21159, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+211 , 187572, 571, 1, 1, 3506.027, 2018.911, 66.59167, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+212 , 187572, 571, 1, 1, 5590.792, 5741.47, -69.95851, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+213 , 187572, 571, 1, 1, 5540.601, 5734.986, -74.41019, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+214 , 187572, 571, 1, 1, 5575.648, 5744.854, -74.17106, 0.6108634, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+215 , 187572, 571, 1, 1, 5579.48, 5743.395, -72.77816, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+216 , 187572, 571, 1, 1, 5580.207, 5754.729, -74.17179, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+217 , 187572, 571, 1, 1, 5534.636, 5748.279, -76.63572, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+218 , 187572, 571, 1, 1, 5582.845, 5753.317, -72.5528, 2.91469, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+219 , 187572, 571, 1, 1, 5558.958, 5761.582, -76.67675, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+220 , 187572, 571, 1, 1, 5563.845, 5763.661, -74.10222, 4.956738, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 0)
+(@OGUID+221 , 187572, 571, 1, 1, 3438.272, 4175.789, 15.59595, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+222 , 187572, 571, 1, 1, 3440.938, 4170, 16.75948, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+223 , 187572, 571, 1, 1, 3435.048, 4176.098, 14.48878, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+224 , 187572, 571, 1, 1, 3436.364, 4170.425, 15.11012, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+225 , 187572, 571, 1, 1, 3434.688, 4170.593, 14.47091, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+226 , 187572, 571, 1, 1, 3441.158, 4175.78, 17.07891, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+227 , 187572, 571, 1, 1, 3439.237, 4170.084, 16.16713, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+228 , 187572, 571, 1, 1, 3437.843, 4170.2, 15.68182, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+229 , 187572, 571, 1, 1, 3439.49, 4175.847, 16.23158, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+230 , 187572, 571, 1, 1, 3436.933, 4175.96, 15.01061, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+231 , 187572, 571, 1, 1, 3465.623, 4140.512, 16.15235, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+232 , 187572, 571, 1, 1, 3460.051, 4140.799, 16.05406, 5.724681, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4037)
+(@OGUID+233 , 187572, 571, 1, 1, 3003.013, 4061.593, 26.25469, 0.3665176, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4113)
+(@OGUID+234 , 187572, 571, 1, 1, 3007.808, 4061.098, 26.37004, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4113)
+(@OGUID+235 , 187572, 571, 1, 1, 2279.073, 5186.723, 21.08973, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4115)
+(@OGUID+236 , 187572, 571, 1, 1, 2274.589, 5181.036, 21.08973, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4115)
+(@OGUID+237 , 187572, 571, 1, 1, 2277.779, 5183.217, 21.08973, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4115)
+(@OGUID+238 , 187572, 571, 1, 1, 2268.911, 5183.354, 21.08973, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4032)
+(@OGUID+239 , 187572, 571, 1, 1, 2268.171, 5187.125, 21.08973, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4032)
+(@OGUID+240 , 187572, 571, 1, 1, 2269.356, 5190.188, 21.08973, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4032)
+(@OGUID+241 , 187572, 571, 1, 1, 2294.182, 5274.35, 13.35742, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4032)
+(@OGUID+242 , 187572, 571, 1, 1, 2297.376, 5281.584, 13.34355, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4032)
+(@OGUID+243 , 187572, 571, 1, 1, 2293.466, 5281.179, 13.21161, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4032)
+(@OGUID+244 , 187572, 571, 1, 1, 2291.847, 5277.312, 13.39523, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4032)
+(@OGUID+245 , 187572, 571, 1, 1, 2299.923, 5278.224, 13.3505, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4032)
+(@OGUID+246 , 187572, 571, 1, 1, 2298.162, 5274.419, 13.35744, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 4032)
+(@OGUID+247 , 187572, 0, 1, 1, -8989.75, 845.233, 29.6206, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 5154)
+(@OGUID+248 , 187572, 0, 1, 1, -8988.32, 846.486, 29.6206, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 187572 (Area: 5154)
+(@OGUID+249 , 187573, 530, 1, 1, -238.8798, 5437.085, 24.65068, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3565)
+(@OGUID+250 , 187573, 530, 1, 1, -250.4899, 5441.73, 24.82839, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3565)
+(@OGUID+251 , 187573, 530, 1, 1, -248.4952, 5431.159, 24.78823, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3565)
+(@OGUID+252 , 187573, 530, 1, 1, -210.9728, 5419.913, 22.73365, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3565)
+(@OGUID+253 , 187573, 530, 1, 1, -228.8186, 5515.436, 28.778, 1.762782, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3565)
+(@OGUID+254 , 187573, 530, 1, 1, -176.5589, 5530.886, 31.1645, 0.4886912, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3565)
+(@OGUID+255 , 187573, 530, 1, 1, 275.2674, 6052.903, 131.4272, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3644)
+(@OGUID+256 , 187573, 530, 1, 1, 287.0955, 6051.264, 131.4273, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3644)
+(@OGUID+257 , 187573, 530, 1, 1, 286.9392, 6061.178, 131.4276, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3644)
+(@OGUID+258 , 187573, 530, 1, 1, 277.5903, 6062.521, 131.4277, 5.305802, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3644)
+(@OGUID+259 , 187573, 530, 1, 1, 1043.888, 7365.904, 40.23934, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3766)
+(@OGUID+260 , 187573, 530, 1, 1, 1041.082, 7364.274, 40.12274, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3766)
+(@OGUID+261 , 187573, 530, 1, 1, 1045.886, 7354.14, 40.03497, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3766)
+(@OGUID+262 , 187573, 530, 1, 1, 1049.768, 7359.408, 40.2437, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3766)
+(@OGUID+263 , 187573, 530, 1, 1, 1038.146, 7362.734, 40.0191, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3766)
+(@OGUID+264 , 187573, 530, 1, 1, 1047.906, 7356.96, 40.14259, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3766)
+(@OGUID+265 , 187573, 530, 1, 1, -2941.41, 3986.282, 4.736197, 4.485497, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+266 , 187573, 530, 1, 1, -2942.449, 3986.07, 4.736196, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+267 , 187573, 530, 1, 1, -2941.786, 3989.554, 0.537406, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+268 , 187573, 530, 1, 1, -2944.944, 3987.97, 0.570116, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+269 , 187573, 530, 1, 1, -2937.137, 3985.113, 0.555474, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+270 , 187573, 530, 1, 1, -2940.374, 3984.695, 4.736196, 2.91469, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+271 , 187573, 530, 1, 1, -2946.097, 3984.941, 0.56581, 0, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+272 , 187573, 530, 1, 1, -2943.021, 3985.159, 4.736197, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+273 , 187573, 530, 1, 1, -2941.996, 3983.637, 4.736197, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+274 , 187573, 530, 1, 1, -2938.622, 3988.276, 0.563272, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+275 , 187573, 530, 1, 1, -2940.543, 3985.717, 4.736197, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+276 , 187573, 530, 1, 1, -2942.833, 3984.146, 4.736197, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+277 , 187573, 530, 1, 1, -2940.881, 3983.838, 4.736197, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+278 , 187573, 530, 1, 1, -2938.413, 3982.022, 0.589959, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+279 , 187573, 530, 1, 1, -2944.666, 3981.645, 0.566747, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+280 , 187573, 530, 1, 1, -2941.608, 3980.53, 0.570047, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3684)
+(@OGUID+281 , 187573, 530, 1, 1, 207.2742, 8513.318, 26.09295, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+282 , 187573, 530, 1, 1, 226.3656, 8508.611, 25.50576, 5.724681, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+283 , 187573, 530, 1, 1, 211.9016, 8507.246, 25.61444, 0.6108634, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+284 , 187573, 530, 1, 1, 206.3761, 8518.894, 25.77999, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+285 , 187573, 530, 1, 1, 215.9412, 8514.26, 26.64105, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+286 , 187573, 530, 1, 1, 214.8054, 8514.59, 28.14054, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+287 , 187573, 530, 1, 1, 219.2324, 8504.75, 26.13801, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+288 , 187573, 530, 1, 1, 218.3474, 8513.957, 27.7103, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+289 , 187573, 530, 1, 1, 206.1108, 8520.148, 25.86143, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+290 , 187573, 530, 1, 1, 217.8517, 8504.657, 25.45178, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+291 , 187573, 530, 1, 1, 212.179, 8517.118, 28.13404, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+292 , 187573, 530, 1, 1, 210.3614, 8507.658, 26.04743, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+293 , 187573, 530, 1, 1, 220.4575, 8527.881, 26.32528, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+294 , 187573, 530, 1, 1, 206.7841, 8524.708, 26.24488, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+295 , 187573, 530, 1, 1, 209.6522, 8527.366, 25.38888, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+296 , 187573, 530, 1, 1, 227.9758, 8522.56, 24.8175, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+297 , 187573, 530, 1, 1, 227.0161, 8523.277, 24.87525, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+298 , 187573, 530, 1, 1, 210.1593, 8528.237, 24.98867, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+299 , 187573, 530, 1, 1, 220.4873, 8529.452, 25.43293, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+300 , 187573, 530, 1, 1, -3028.058, 2558.158, 81.58592, 4.991644, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3744)
+(@OGUID+301 , 187573, 530, 1, 1, -3025.336, 2563.36, 80.77316, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3744)
+(@OGUID+302 , 187573, 530, 1, 1, -3017.158, 2544.05, 80.85657, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3744)
+(@OGUID+303 , 187573, 530, 1, 1, -4069.756, 2169.192, 108.0575, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3745)
+(@OGUID+304 , 187573, 530, 1, 1, -4077.366, 2168.902, 108.0576, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3745)
+(@OGUID+305 , 187573, 530, 1, 1, -4077.484, 2166.82, 109.4927, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3745)
+(@OGUID+306 , 187573, 571, 1, 1, 5218.292, -1294.741, 243.2421, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 66)
+(@OGUID+307 , 187573, 571, 1, 1, 5231.457, -1307.585, 242.9928, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 66)
+(@OGUID+308 , 187573, 571, 1, 1, 5223.798, -1297.246, 242.7465, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 66)
+(@OGUID+309 , 187573, 571, 1, 1, 5231.501, -1317.645, 242.3579, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 66)
+(@OGUID+310 , 187573, 571, 1, 1, 5214.561, -1333.356, 242.8055, 5.218536, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 66)
+(@OGUID+311 , 187573, 571, 1, 1, 5201.846, -1295.413, 244.2645, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4312)
+(@OGUID+312 , 187573, 571, 1, 1, 5194.785, -1301.008, 244.9712, 6.056293, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4312)
+(@OGUID+313 , 187573, 571, 1, 1, 5190.522, -1312.11, 244.0397, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4312)
+(@OGUID+314 , 187573, 571, 1, 1, 5200.819, -1331.565, 243.3316, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4312)
+(@OGUID+315 , 187573, 571, 1, 1, 5187.799, -2187.275, 237.0019, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+316 , 187573, 571, 1, 1, 5177.904, -2198.184, 237.9583, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+317 , 187573, 571, 1, 1, 5174.574, -2198.058, 237.0945, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+318 , 187573, 571, 1, 1, 5187.775, -2193.543, 239.013, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+319 , 187573, 571, 1, 1, 5187.847, -2190.572, 237.9477, 1.832595, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+320 , 187573, 571, 1, 1, 5180.932, -2198.266, 238.9099, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4317)
+(@OGUID+321 , 187573, 571, 1, 1, 5760.56, -3565.656, 388.2643, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4323)
+(@OGUID+322 , 187573, 571, 1, 1, 5762.455, -3566.792, 388.3224, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4323)
+(@OGUID+323 , 187573, 571, 1, 1, 5769.333, -3567.343, 388.2628, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4323)
+(@OGUID+324 , 187573, 571, 1, 1, 5774.232, -3603.223, 389.2473, 0.2443456, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4323)
+(@OGUID+325 , 187573, 571, 1, 1, 7801.777, -2955.337, 1258.213, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4441)
+(@OGUID+326 , 187573, 571, 1, 1, 7807.081, -2958.003, 1258.148, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4441)
+(@OGUID+327 , 187573, 571, 1, 1, 7803.43, -2953.615, 1257.581, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4441)
+(@OGUID+328 , 187573, 571, 1, 1, 7807.363, -2955.934, 1257.554, 0.5934101, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4441)
+(@OGUID+329 , 187573, 571, 1, 1, 3872.092, -4497.994, 214.228, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4205)
+(@OGUID+330 , 187573, 571, 1, 1, 3862.335, -4496.452, 213.9947, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4205)
+(@OGUID+331 , 187573, 571, 1, 1, 3854.382, -4497.912, 214.2029, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4205)
+(@OGUID+332 , 187573, 571, 1, 1, 3848.718, -4530.234, 210.0516, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+333 , 187573, 571, 1, 1, 3845.773, -4506.672, 213.3141, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+334 , 187573, 571, 1, 1, 3845.863, -4507.249, 213.2718, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+335 , 187573, 571, 1, 1, 3854.817, -4532.222, 210.2647, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+336 , 187573, 571, 1, 1, 3855.825, -4536.71, 210.2953, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+337 , 187573, 571, 1, 1, 3873.255, -4548.749, 211.2182, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+338 , 187573, 571, 1, 1, 3847.103, -4540.545, 210.2771, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+339 , 187573, 571, 1, 1, 3867.704, -4566.387, 215.409, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+340 , 187573, 571, 1, 1, 3865.873, -4555.702, 217.196, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+341 , 187573, 571, 1, 1, 3865.743, -4556.893, 217.2975, 2.094393, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+342 , 187573, 571, 1, 1, 3406.807, -2802.695, 212.3929, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+343 , 187573, 571, 1, 1, 3407.849, -2803.387, 213.6421, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+344 , 187573, 571, 1, 1, 3411.797, -2803.392, 212.6309, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+345 , 187573, 571, 1, 1, 3400.698, -2791.797, 212.2621, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+346 , 187573, 571, 1, 1, 3399.636, -2791.851, 212.2687, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+347 , 187573, 571, 1, 1, 3399.944, -2790.934, 212.2374, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4204)
+(@OGUID+348 , 187573, 571, 1, 1, 3398.436, -2790.138, 212.3292, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4204)
+(@OGUID+349 , 187573, 571, 1, 1, 3262.343, -2271.046, 115.3901, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4248)
+(@OGUID+350 , 187573, 571, 1, 1, 3245.255, -2227.15, 116.2699, 5.724681, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4248)
+(@OGUID+351 , 187573, 571, 1, 1, 3243.214, -2232.216, 115.6821, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4248)
+(@OGUID+352 , 187573, 571, 1, 1, 3267.605, -2236.559, 116.2713, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4248)
+(@OGUID+353 , 187573, 571, 1, 1, 3265.578, -2241.444, 115.6822, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4248)
+(@OGUID+354 , 187573, 571, 1, 1, 1430.809, -3279.443, 175.8965, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4071)
+(@OGUID+355 , 187573, 571, 1, 1, 1421.832, -3279.826, 175.8964, 1.204277, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4071)
+(@OGUID+356 , 187573, 571, 1, 1, 1421.365, -3276.445, 175.8965, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4071)
+(@OGUID+357 , 187573, 571, 1, 1, 1427.807, -3281.708, 175.8964, 3.665196, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4071)
+(@OGUID+358 , 187573, 571, 1, 1, 1423.193, -3272.82, 175.8964, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4071)
+(@OGUID+359 , 187573, 571, 1, 1, 1424.53, -3281.957, 175.8965, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4071)
+(@OGUID+360 , 187573, 571, 1, 1, 728.5954, -2932.345, 7.899311, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3987)
+(@OGUID+361 , 187573, 571, 1, 1, 725.778, -2933.188, 7.98472, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3987)
+(@OGUID+362 , 187573, 571, 1, 1, 731.3762, -2931.187, 7.874074, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3987)
+(@OGUID+363 , 187573, 571, 1, 1, 727.5428, -2925.693, 7.892454, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3987)
+(@OGUID+364 , 187573, 571, 1, 1, 730.603, -2926.013, 7.90405, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3987)
+(@OGUID+365 , 187573, 571, 1, 1, 724.4731, -2925.879, 8.002373, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3987)
+(@OGUID+366 , 187573, 571, 1, 1, 691.7236, -2938.802, -2.142258, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3987)
+(@OGUID+367 , 187573, 571, 1, 1, 690.4618, -2931.701, -2.140142, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3987)
+(@OGUID+368 , 187573, 571, 1, 1, 590.8006, -4953.907, 27.2703, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3981)
+(@OGUID+369 , 187573, 571, 1, 1, 584.3661, -4952.655, 27.2703, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3981)
+(@OGUID+370 , 187573, 571, 1, 1, 592.7435, -4947.684, 27.2703, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3981)
+(@OGUID+371 , 187573, 571, 1, 1, 577.9507, -4944.862, 17.89478, 0.4712385, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3981)
+(@OGUID+372 , 187573, 571, 1, 1, 579.667, -4944.608, 18.67778, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3981)
+(@OGUID+373 , 187573, 571, 1, 1, 582.3306, -4947.667, 27.2703, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3981)
+(@OGUID+374 , 187573, 571, 1, 1, 578.5413, -4940.095, 18.67357, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3981)
+(@OGUID+375 , 187573, 571, 1, 1, 576.8389, -4940.611, 17.8643, 0.7679439, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 3981)
+(@OGUID+376 , 187573, 571, 1, 1, 3222.819, -683.441, 167.1934, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+377 , 187573, 571, 1, 1, 3225.311, -685.1146, 167.2393, 2.059488, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+378 , 187573, 571, 1, 1, 3223.978, -687.8472, 167.1376, 6.056293, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+379 , 187573, 571, 1, 1, 3221.145, -686.8906, 167.1059, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+380 , 187573, 571, 1, 1, 3207.472, -680.3905, 167.5366, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4186)
+(@OGUID+381 , 187573, 571, 1, 1, 3208.13, -675.4476, 167.5366, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4186)
+(@OGUID+382 , 187573, 571, 1, 1, 3212.646, -680.04, 174.8388, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4186)
+(@OGUID+383 , 187573, 571, 1, 1, 3568.515, 256.3788, 45.83984, 5.148723, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4161)
+(@OGUID+384 , 187573, 571, 1, 1, 3539.575, 246.702, 45.88269, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4161)
+(@OGUID+385 , 187573, 571, 1, 1, 3570.373, 286.3419, 45.93883, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4161)
+(@OGUID+386 , 187573, 571, 1, 1, 3534.149, 297.4759, 45.83553, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4161)
+(@OGUID+387 , 187573, 571, 1, 1, 3519.518, 269.9622, 45.84327, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4161)
+(@OGUID+388 , 187573, 571, 1, 1, 2787.9, 919.5675, 22.35308, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+389 , 187573, 571, 1, 1, 2779.605, 915.4742, 22.3654, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+390 , 187573, 571, 1, 1, 2777.909, 931.191, 22.25009, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+391 , 187573, 571, 1, 1, 2650.791, 914.241, 4.894161, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+392 , 187573, 571, 1, 1, 2645.884, 922.8932, 4.901317, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+393 , 187573, 571, 1, 1, 2647.992, 919.4376, 4.902209, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+394 , 187573, 571, 1, 1, 2653.07, 910.7157, 4.905365, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+395 , 187573, 571, 1, 1, 2643.723, 905.2086, 4.899257, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+396 , 187573, 571, 1, 1, 2641.788, 908.7531, 4.885656, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+397 , 187573, 571, 1, 1, 2635.687, 939.923, 4.900528, 0.9599299, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+398 , 187573, 571, 1, 1, 2638.673, 913.8153, 4.863067, 5.166176, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+399 , 187573, 571, 1, 1, 2628.321, 930.7235, 4.880824, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+400 , 187573, 571, 1, 1, 2631.383, 925.7955, 4.897779, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+401 , 187573, 571, 1, 1, 2633.318, 922.2076, 4.915955, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+402 , 187573, 571, 1, 1, 2637.789, 936.4579, 4.902726, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+403 , 187573, 571, 1, 1, 2640.679, 931.2507, 4.902224, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+404 , 187573, 571, 1, 1, 2636.47, 917.1949, 4.885477, 1.815142, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+405 , 187573, 571, 1, 1, 2626.034, 934.2613, 4.898267, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+406 , 187573, 571, 1, 1, 2642.781, 927.8379, 4.907436, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4152)
+(@OGUID+407 , 187573, 571, 1, 1, 3831.902, 1517.429, 91.51768, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+408 , 187573, 571, 1, 1, 3832.146, 1514.425, 92.53931, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+409 , 187573, 571, 1, 1, 3831.676, 1520.898, 90.92908, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+410 , 187573, 571, 1, 1, 3831.508, 1525.937, 90.37012, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+411 , 187573, 571, 1, 1, 3851.638, 1514.683, 92.4583, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+412 , 187573, 571, 1, 1, 3851.653, 1517.668, 91.51768, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+413 , 187573, 571, 1, 1, 3851.953, 1522.166, 90.93674, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4165)
+(@OGUID+414 , 187573, 571, 1, 1, 3852.301, 1526.04, 90.37012, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4165)
+(@OGUID+415 , 187573, 571, 1, 1, 3488.589, 1973.783, 66.59254, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+416 , 187573, 571, 1, 1, 3497.365, 1963.606, 66.93625, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+417 , 187573, 571, 1, 1, 3499.461, 1967.509, 66.33823, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+418 , 187573, 571, 1, 1, 3504.412, 1968.746, 66.27369, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+419 , 187573, 571, 1, 1, 3499.829, 1970.681, 66.37333, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+420 , 187573, 571, 1, 1, 3474.247, 1975.943, 65.55033, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+421 , 187573, 571, 1, 1, 3497.175, 1986.859, 66.07224, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+422 , 187573, 571, 1, 1, 3469.649, 1992.181, 65.77794, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+423 , 187573, 571, 1, 1, 3518.384, 1993.599, 66.57746, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+424 , 187573, 571, 1, 1, 3520.4, 1992.353, 66.58147, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+425 , 187573, 571, 1, 1, 3523.218, 1995.243, 66.57938, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+426 , 187573, 571, 1, 1, 3519.827, 1997.372, 66.58945, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+427 , 187573, 571, 1, 1, 3504.783, 2015.089, 66.59443, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+428 , 187573, 571, 1, 1, 3504.489, 2017.339, 66.59454, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+429 , 187573, 571, 1, 1, 3488.406, 2016.174, 66.24207, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+430 , 187573, 571, 1, 1, 3508.786, 2014.839, 66.59763, 3.595379, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+431 , 187573, 571, 1, 1, 3508.152, 2018.778, 66.58207, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+432 , 187573, 571, 1, 1, 5577.259, 5744.397, -73.41306, 2.897245, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+433 , 187573, 571, 1, 1, 5540.335, 5733.044, -75.04021, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+434 , 187573, 571, 1, 1, 5581.268, 5753.967, -73.41984, 1.97222, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+435 , 187573, 571, 1, 1, 5533.86, 5752.435, -76.68381, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+436 , 187573, 571, 1, 1, 5564.51, 5764.215, -74.11523, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+437 , 187573, 571, 1, 1, 5557.555, 5761.386, -76.69409, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+438 , 187573, 571, 1, 1, 5543.19, 5771.249, -76.01951, 2.91469, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 0)
+(@OGUID+439 , 187573, 571, 1, 1, 3495.241, 4173.272, 14.71328, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+440 , 187573, 571, 1, 1, 3490.698, 4173.471, 16.36332, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+441 , 187573, 571, 1, 1, 3493.623, 4173.028, 15.33519, 5.410522, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+442 , 187573, 571, 1, 1, 3490.759, 4167.651, 16.33138, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+443 , 187573, 571, 1, 1, 3489.254, 4167.413, 17.13385, 2.984498, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+444 , 187573, 571, 1, 1, 3492.343, 4173.275, 15.8522, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+445 , 187573, 571, 1, 1, 3492.034, 4167.671, 15.9009, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+446 , 187573, 571, 1, 1, 3489.076, 4173.691, 16.91642, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+447 , 187573, 571, 1, 1, 3497.022, 4173.399, 14.05571, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+448 , 187573, 571, 1, 1, 3495.101, 4167.443, 14.67529, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+449 , 187573, 571, 1, 1, 3497.104, 4167.036, 14.14581, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+450 , 187573, 571, 1, 1, 3493.452, 4167.565, 15.12018, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+451 , 187573, 571, 1, 1, 3465.767, 4142.241, 16.7223, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+452 , 187573, 571, 1, 1, 3459.901, 4142.745, 16.77447, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+453 , 187573, 571, 1, 1, 3460.115, 4139.464, 15.57746, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+454 , 187573, 571, 1, 1, 3465.497, 4139.097, 15.685, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4037)
+(@OGUID+455 , 187573, 571, 1, 1, 3002.771, 4059.933, 26.68754, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4113)
+(@OGUID+456 , 187573, 571, 1, 1, 3007.46, 4059.381, 26.91751, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4113)
+(@OGUID+457 , 187573, 571, 1, 1, 2278.325, 5184.817, 21.08973, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4115)
+(@OGUID+458 , 187573, 571, 1, 1, 2276.303, 5181.947, 21.08973, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4115)
+(@OGUID+459 , 187573, 571, 1, 1, 2272.885, 5180.684, 21.08973, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4115)
+(@OGUID+460 , 187573, 571, 1, 1, 2268.475, 5184.938, 21.08973, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4032)
+(@OGUID+461 , 187573, 571, 1, 1, 2269.955, 5181.83, 21.08973, 0.5934101, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4032)
+(@OGUID+462 , 187573, 571, 1, 1, 2268.833, 5188.483, 21.08973, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4032)
+(@OGUID+463 , 187573, 571, 1, 1, 2299.509, 5276.083, 13.3505, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4032)
+(@OGUID+464 , 187573, 571, 1, 1, 2299.592, 5280.373, 13.3505, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4032)
+(@OGUID+465 , 187573, 571, 1, 1, 2296.215, 5273.702, 13.35049, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4032)
+(@OGUID+466 , 187573, 571, 1, 1, 2292.182, 5279.494, 13.3505, 1.640607, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4032)
+(@OGUID+467 , 187573, 571, 1, 1, 2295.349, 5281.834, 13.3505, 6.056293, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 4032)
+(@OGUID+468 , 187573, 0, 1, 1, -8985.27, 848.675, 29.6207, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 5154)
+(@OGUID+469 , 187573, 0, 1, 1, -8984.09, 849.971, 29.6206, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 5154)
+(@OGUID+470 , 187573, 0, 1, 1, -9021.08, 887.325, 29.6183, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 187573 (Area: 5154)
+(@OGUID+471 , 181354, 530, 1, 1, 1961.764, 6885.375, 162.7591, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3771)
+(@OGUID+472 , 181354, 530, 1, 1, 1965.24, 6884.419, 162.7591, 4.206246, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3772)
+(@OGUID+473 , 181354, 530, 1, 1, 1964.663, 6887.743, 162.7591, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3772)
+(@OGUID+474 , 181354, 530, 1, 1, 2095.012, 6821.211, 174.8731, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3772)
+(@OGUID+475 , 181354, 530, 1, 1, 2097.025, 6825.342, 174.8524, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3772)
+(@OGUID+476 , 181354, 530, 1, 1, 2092.416, 6825.399, 174.8686, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3772)
+(@OGUID+477 , 181354, 530, 1, 1, 2089.096, 6768.958, 164.8599, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3772)
+(@OGUID+478 , 181354, 530, 1, 1, 2093.987, 6769.731, 164.8697, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3772)
+(@OGUID+479 , 181354, 530, 1, 1, 2092.187, 6765.44, 164.8475, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3772)
+(@OGUID+480 , 181354, 530, 1, 1, 2991.37, 5483.188, 144.6114, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3951)
+(@OGUID+481 , 181354, 530, 1, 1, 2991.238, 5478.47, 144.5909, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3951)
+(@OGUID+482 , 181354, 530, 1, 1, 2986.906, 5481.471, 144.5909, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3951)
+(@OGUID+483 , 181354, 530, 1, 1, 3030.463, 5492.013, 147.1473, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3951)
+(@OGUID+484 , 181354, 530, 1, 1, 3012.275, 5442.078, 147.5007, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3951)
+(@OGUID+485 , 181354, 530, 1, 1, 3034.872, 5490.722, 147.1473, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3951)
+(@OGUID+486 , 181354, 530, 1, 1, 3008.707, 5438.396, 147.5007, 6.0912, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3951)
+(@OGUID+487 , 181354, 530, 1, 1, 3011.45, 5435.751, 147.5007, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3951)
+(@OGUID+488 , 181354, 571, 1, 1, 2558.805, -1994.658, 0, 5.078908, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+489 , 181354, 571, 1, 1, 2571.232, -1981.536, 0, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+490 , 181354, 571, 1, 1, 2530.056, -2001.654, 0, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+491 , 181354, 571, 1, 1, 2564.62, -1902.94, 0, 1.204277, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+492 , 181354, 571, 1, 1, 2578.922, -1926.984, 0, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+493 , 181354, 571, 1, 1, 2604.877, -1833.523, 0, 1.099556, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+494 , 181354, 571, 1, 1, 2600.202, -1864.442, 0, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+495 , 181354, 571, 1, 1, 2604.255, -1901.251, 0, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+496 , 181354, 571, 1, 1, 2600.614, -1814.094, 0, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+497 , 181354, 571, 1, 1, 2415.667, -1854.533, 0, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+498 , 181354, 571, 1, 1, 2407.166, -1845.278, 0, 2.268925, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+499 , 181354, 571, 1, 1, 2414.991, -1875.148, 0, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+500 , 181354, 571, 1, 1, 2404.097, -1864.177, 0, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4242)
+(@OGUID+501 , 181354, 571, 1, 1, 767.0814, -2846.513, 0, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3988)
+(@OGUID+502 , 181354, 571, 1, 1, 793.7769, -2840.536, 0, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3988)
+(@OGUID+503 , 181354, 571, 1, 1, 796.1247, -2842.772, 0, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3988)
+(@OGUID+504 , 181354, 571, 1, 1, 794.0623, -2848.875, 0, 1.378809, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3988)
+(@OGUID+505 , 181354, 571, 1, 1, 754.5249, -2854.845, 0, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3988)
+(@OGUID+506 , 181354, 571, 1, 1, 765.928, -2820.402, 0, 5.794494, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3988)
+(@OGUID+507 , 181354, 571, 1, 1, 2455.453, -5133.994, 275.5138, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4003)
+(@OGUID+508 , 181354, 571, 1, 1, 2455.139, -5131.472, 275.5138, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4003)
+(@OGUID+509 , 181354, 571, 1, 1, 2459.948, -5130.551, 275.5138, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4003)
+(@OGUID+510 , 181354, 571, 1, 1, 2380.471, -5088.479, 248.5613, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4003)
+(@OGUID+511 , 181354, 571, 1, 1, 2485.646, -5000.984, 274.5577, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4003)
+(@OGUID+512 , 181354, 571, 1, 1, 2502.854, -5015.77, 275.4288, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4003)
+(@OGUID+513 , 181354, 571, 1, 1, 2485.411, -5004.169, 274.5456, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4003)
+(@OGUID+514 , 181354, 571, 1, 1, 2369.498, -5004.655, 248.5613, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4003)
+(@OGUID+515 , 181354, 571, 1, 1, 2375.392, -5002.363, 248.5613, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4003)
+(@OGUID+516 , 181354, 571, 1, 1, 2717.166, 869.525, 0, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+517 , 181354, 571, 1, 1, 2717.919, 866.1157, 0, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+518 , 181354, 571, 1, 1, 2700.923, 919.1116, 0, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+519 , 181354, 571, 1, 1, 2702.725, 934.8021, 0, 1.780234, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+520 , 181354, 571, 1, 1, 2668.09, 872.3976, 0, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+521 , 181354, 571, 1, 1, 2658.5, 918.8054, 0, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+522 , 181354, 571, 1, 1, 2666.374, 918.7291, 0, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+523 , 181354, 571, 1, 1, 2670.15, 871.2205, 0, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+524 , 181354, 571, 1, 1, 2626.058, 889.1933, 0, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+525 , 181354, 571, 1, 1, 2627.73, 887.0659, 0, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+526 , 181354, 571, 1, 1, 2627.751, 895.2178, 0, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4152)
+(@OGUID+527 , 181354, 571, 1, 1, 3496.388, 1977.59, 65.96105, 5.969027, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 0)
+(@OGUID+528 , 181354, 571, 1, 1, 3495.364, 1981.665, 66.03764, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 0)
+(@OGUID+529 , 181354, 571, 1, 1, 3490.632, 1980.51, 65.99807, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 0)
+(@OGUID+530 , 181354, 571, 1, 1, 5478.349, 4771.299, -198.9465, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4291)
+(@OGUID+531 , 181354, 571, 1, 1, 5469.406, 4742.04, -198.9063, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4291)
+(@OGUID+532 , 181354, 571, 1, 1, 5469.105, 4760.201, -198.9201, 0.2443456, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4291)
+(@OGUID+533 , 181354, 571, 1, 1, 5467.913, 4754.535, -198.9201, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4291)
+(@OGUID+534 , 181354, 571, 1, 1, 5445.94, 4761.356, -199.0263, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4383)
+(@OGUID+535 , 181354, 571, 1, 1, 5450.431, 4755.577, -198.9201, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4383)
+(@OGUID+536 , 181354, 571, 1, 1, 5500.563, 5787.042, -82.11499, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4284)
+(@OGUID+537 , 181354, 571, 1, 1, 5513.074, 5766.733, -84.07557, 1.099556, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4284)
+(@OGUID+538 , 181354, 571, 1, 1, 5513.78, 5795.364, -80.6015, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4284)
+(@OGUID+539 , 181354, 571, 1, 1, 5509.842, 5766.954, -84.06371, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4284)
+(@OGUID+540 , 181354, 571, 1, 1, 5567.791, 5826.353, -73.64291, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4284)
+(@OGUID+541 , 181354, 571, 1, 1, 5510.346, 5761.825, -84.18658, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4284)
+(@OGUID+542 , 181354, 571, 1, 1, 5562.381, 5829.076, -73.01419, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4284)
+(@OGUID+543 , 181354, 571, 1, 1, 5501.959, 5802.074, -79.23232, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4284)
+(@OGUID+544 , 181354, 571, 1, 1, 2855.777, 4009.293, 0, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4113)
+(@OGUID+545 , 181354, 571, 1, 1, 2916.701, 3999.391, 0, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4113)
+(@OGUID+546 , 181354, 571, 1, 1, 2847.156, 4043.428, 0, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4113)
+(@OGUID+547 , 181354, 571, 1, 1, 2909.401, 3987.22, 0, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4113)
+(@OGUID+548 , 181354, 571, 1, 1, 2855.984, 4049.023, 0, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4113)
+(@OGUID+549 , 181354, 571, 1, 1, 2848.714, 4049.8, 0, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 4113)
+(@OGUID+550 , 181354, 530, 1, 1, 9890.715, -7214.22, 31.86613, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+551 , 181354, 530, 1, 1, 9850.549, -7216.786, 32.0508, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+552 , 181354, 530, 1, 1, 9883.755, -7223.828, 31.89215, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+553 , 181354, 530, 1, 1, 9850.072, -7193.472, 31.8566, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+554 , 181354, 530, 1, 1, 9861.693, -7203.565, 31.98161, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+555 , 181354, 530, 1, 1, 9871.146, -7211.522, 31.98824, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+556 , 181354, 530, 1, 1, 9889.951, -7200.953, 31.86972, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+557 , 181354, 530, 1, 1, 9860.642, -7225.191, 32.14094, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+558 , 181354, 530, 1, 1, 9857.701, -7186.151, 31.82882, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+559 , 181354, 530, 1, 1, 9881.252, -7191.335, 31.84415, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+560 , 181354, 530, 1, 1, 9870.332, -7184.636, 31.87049, 2.042035, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+561 , 181354, 530, 1, 1, 9825.888, -7237.287, 27.19095, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+562 , 181354, 530, 1, 1, 9830.139, -7251.79, 27.23245, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+563 , 181354, 530, 1, 1, 9838.824, -7231.604, 27.25398, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+564 , 181354, 530, 1, 1, 9848.271, -7239.6, 27.20893, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+565 , 181354, 530, 1, 1, 9844.719, -7253.453, 27.27034, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+566 , 181354, 530, 1, 1, 9561.597, -7129.251, 16.33114, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+567 , 181354, 530, 1, 1, 9558.121, -7144.923, 16.34306, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+568 , 181354, 530, 1, 1, 9552.82, -7127.345, 16.37856, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+569 , 181354, 530, 1, 1, 9548.759, -7142.452, 16.37524, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+570 , 181354, 530, 1, 1, 9564.466, -7138.307, 16.38212, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181354 (Area: 3487)
+(@OGUID+571 , 181358, 571, 1, 1, 5353.096, -2653.161, 310.5197, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 4275)
+(@OGUID+572 , 181358, 571, 1, 1, 5391.959, -2692.568, 310.2863, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 4275)
+(@OGUID+573 , 181358, 571, 1, 1, 3771.654, 1596.684, 107.9985, 5.009095, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 4165)
+(@OGUID+574 , 181358, 571, 1, 1, 3787.579, 1624.979, 107.0998, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 4165)
+(@OGUID+575 , 181358, 571, 1, 1, 2754.732, 6279.374, 181.2734, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 4129)
+(@OGUID+576 , 181358, 530, 1, 1, 9698.271, -7053.018, 22.76448, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 3487)
+(@OGUID+577 , 181358, 0, 1, 1, -8532.075, 1059.335, 28.8618, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 5409)
+(@OGUID+578 , 181358, 0, 1, 1, -8475.304, 1051.581, 29.42984, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 0)
+(@OGUID+579 , 181358, 530, 1, 1, -3989.117, -11849.08, 25.73339, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 0)
+(@OGUID+580 , 181358, 530, 1, 1, -3864.285, -11742.65, -84.61896, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 0)
+(@OGUID+581 , 181358, 530, 1, 1, -3966.45, -11587.63, -97.81689, 2.164206, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 0)
+(@OGUID+582 , 181358, 530, 1, 1, -3966.363, -11588.18, -97.23402, 5.305802, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 0)
+(@OGUID+583 , 181358, 530, 1, 1, -4011.885, -11672.07, -97.32943, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 0)
+(@OGUID+584 , 181358, 530, 1, 1, -4014.815, -11671.7, -97.84743, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181358 (Area: 0)
+(@OGUID+585 , 181390, 530, 1, 1, -4063.597, 2172.937, 112.3214, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 3745)
+(@OGUID+586 , 181390, 530, 1, 1, -3006.309, 859.5955, -5.977011, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 3754)
+(@OGUID+587 , 181390, 571, 1, 1, 7802.567, -2958.528, 1264.482, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 4441)
+(@OGUID+588 , 181390, 571, 1, 1, 3281.508, -2289.553, 109.7592, 1.06465, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 4206)
+(@OGUID+589 , 181390, 571, 1, 1, 3272.445, -2284.55, 109.6323, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 4206)
+(@OGUID+590 , 181390, 571, 1, 1, 3194.855, -2292.016, 108.0624, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 4206)
+(@OGUID+591 , 181390, 571, 1, 1, 3264.85, -2273.001, 109.3768, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 4248)
+(@OGUID+592 , 181390, 571, 1, 1, 2309.714, 5207.694, 20.94551, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 4115)
+(@OGUID+593 , 181390, 571, 1, 1, 2296.557, 5212.993, 20.75707, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 4032)
+(@OGUID+594 , 181390, 571, 1, 1, 2282.703, 5218.596, 20.9829, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 4032)
+(@OGUID+595 , 181390, 571, 1, 1, 2264.359, 5199.473, 21.16698, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 4032)
+(@OGUID+596 , 181390, 530, 1, 1, 9647.629, -7156.846, 35.76045, 4.590216, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 3487)
+(@OGUID+597 , 181390, 530, 1, 1, 9669.65, -7135.431, 35.5114, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 3487)
+(@OGUID+598 , 181390, 530, 1, 1, 9627.514, -7135.065, 35.41454, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 3487)
+(@OGUID+599 , 181390, 530, 1, 1, 9648.775, -7114.69, 35.3508, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 3487)
+(@OGUID+600 , 181390, 0, 1, 1, -8805.121, 868.1832, 109.9552, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5390)
+(@OGUID+601 , 181390, 0, 1, 1, -8745.31, 860.752, 111.098, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5390)
+(@OGUID+602 , 181390, 0, 1, 1, -8857.83, 931.661, 113.084, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5390)
+(@OGUID+603 , 181390, 0, 1, 1, -8999.5, 865.915, 129.676, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5154)
+(@OGUID+604 , 181390, 0, 1, 1, -9013.96, 872.141, 113.3, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5154)
+(@OGUID+605 , 181390, 0, 1, 1, -9006.26, 877.905, 116.466, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5154)
+(@OGUID+606 , 181390, 0, 1, 1, -9003.77, 862.552, 129.857, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5154)
+(@OGUID+607 , 181390, 0, 1, 1, -8680.8, 461.089, 105.228, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5390)
+(@OGUID+608 , 181390, 0, 1, 1, -8633.32, 421.481, 104.761, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5390)
+(@OGUID+609 , 181390, 0, 1, 1, -8640.89, 415.503, 104.791, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5390)
+(@OGUID+610 , 181390, 0, 1, 1, -8408.65, 635.033, 101.409, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5150)
+(@OGUID+611 , 181390, 0, 1, 1, -8343.89, 654.082, 100.36, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5150)
+(@OGUID+612 , 187576, 530, 1, 1, -158.5099, 5535.154, 31.47245, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3565)
+(@OGUID+613 , 187576, 530, 1, 1, -154.7856, 5523.646, 31.50904, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3565)
+(@OGUID+614 , 187576, 530, 1, 1, 1044.723, 7368.755, 43.1856, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3766)
+(@OGUID+615 , 187576, 530, 1, 1, 1052.611, 7359.699, 42.62963, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3766)
+(@OGUID+616 , 187576, 530, 1, 1, 2016.857, 6885.055, 182.8496, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3772)
+(@OGUID+617 , 187576, 530, 1, 1, 2944.679, 5466.702, 150.6358, 0, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3828)
+(@OGUID+618 , 187576, 530, 1, 1, 3013.267, 5429.971, 148.0764, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3951)
+(@OGUID+619 , 187576, 530, 1, 1, 2188.357, 4795.172, 158.674, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+620 , 187576, 530, 1, 1, 2181.066, 4706.845, 159.5976, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+621 , 187576, 530, 1, 1, 2165.546, 4727.486, 159.5631, 2.268925, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+622 , 187576, 530, 1, 1, 2045.43, 4686.257, 153.306, 1.029743, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3844)
+(@OGUID+623 , 187576, 530, 1, 1, 2032.304, 4663.961, 153.4191, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3844)
+(@OGUID+624 , 187576, 530, 1, 1, -3009.571, 3998.962, 5.706537, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3684)
+(@OGUID+625 , 187576, 530, 1, 1, -3002.449, 3997.882, 5.743727, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3684)
+(@OGUID+626 , 187576, 530, 1, 1, -2991.61, 3988.035, 5.85871, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3684)
+(@OGUID+627 , 187576, 530, 1, 1, -3026.769, 2565.998, 80.07526, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3744)
+(@OGUID+628 , 187576, 530, 1, 1, -3012.218, 2548.628, 79.43921, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3744)
+(@OGUID+629 , 187576, 530, 1, 1, -2979.819, 2565.84, 79.82945, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3744)
+(@OGUID+630 , 187576, 530, 1, 1, -2963.231, 2558.747, 80.31774, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3744)
+(@OGUID+631 , 187576, 530, 1, 1, -3977.41, 2165.698, 106.9871, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3745)
+(@OGUID+632 , 187576, 530, 1, 1, -4069.704, 2183.112, 108.5346, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3745)
+(@OGUID+633 , 187576, 530, 1, 1, -4075.49, 2189.597, 111.462, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3745)
+(@OGUID+634 , 187576, 530, 1, 1, -4064.588, 1124.245, 43.41816, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3938)
+(@OGUID+635 , 187576, 530, 1, 1, -3061.328, 737.1945, -8.771701, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+636 , 187576, 571, 1, 1, 5820.163, 557.1407, 653.0472, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4395)
+(@OGUID+637 , 187576, 571, 1, 1, 5813.242, 555.0104, 653.1141, 1.832595, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4395)
+(@OGUID+638 , 187576, 571, 1, 1, 5828.393, 518.7396, 659.42, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4395)
+(@OGUID+639 , 187576, 571, 1, 1, 5982.965, 599.3807, 651.8081, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4618)
+(@OGUID+640 , 187576, 571, 1, 1, 5988.552, 613.9961, 651.6794, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4618)
+(@OGUID+641 , 187576, 571, 1, 1, 5985.754, 606.6982, 651.8865, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4618)
+(@OGUID+642 , 187576, 571, 1, 1, 5625.892, 702.7949, 653.3616, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4568)
+(@OGUID+643 , 187576, 571, 1, 1, 5619.527, 688.4839, 653.2624, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4568)
+(@OGUID+644 , 187576, 571, 1, 1, 5622.715, 695.6467, 653.2054, 5.864307, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4568)
+(@OGUID+645 , 187576, 571, 1, 1, 5141.983, -2154.615, 244.3087, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+646 , 187576, 571, 1, 1, 5179.932, -2192.024, 239.8268, 2.897245, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+647 , 187576, 571, 1, 1, 5111.679, -2201.835, 243.7792, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+648 , 187576, 571, 1, 1, 5196.897, -2215.816, 243.9398, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4317)
+(@OGUID+649 , 187576, 571, 1, 1, 5193.838, -2203.542, 239.8356, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4317)
+(@OGUID+650 , 187576, 571, 1, 1, 5526.034, -2669.764, 304.289, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4275)
+(@OGUID+651 , 187576, 571, 1, 1, 5762.96, -3526.665, 391.1757, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+652 , 187576, 571, 1, 1, 5746.468, -3556.428, 390.0896, 6.056293, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4323)
+(@OGUID+653 , 187576, 571, 1, 1, 5768.534, -3620.057, 389.5159, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4323)
+(@OGUID+654 , 187576, 571, 1, 1, 5778.518, -3600.462, 387.3365, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4323)
+(@OGUID+655 , 187576, 571, 1, 1, 6122.76, -1081.095, 406.5847, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4418)
+(@OGUID+656 , 187576, 571, 1, 1, 6133.952, -1074.677, 406.6819, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4418)
+(@OGUID+657 , 187576, 571, 1, 1, 6139.989, -1079.811, 405.7787, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4418)
+(@OGUID+658 , 187576, 571, 1, 1, 6121.725, -1096.696, 406.5187, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4418)
+(@OGUID+659 , 187576, 571, 1, 1, 6105.763, -1080.907, 407.3781, 3.228859, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4418)
+(@OGUID+660 , 187576, 571, 1, 1, 6111.217, -1074.599, 407.2788, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4418)
+(@OGUID+661 , 187576, 571, 1, 1, 6122.866, -1073.905, 407.455, 1.640607, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4418)
+(@OGUID+662 , 187576, 571, 1, 1, 6193.209, -1053.005, 410.5604, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4418)
+(@OGUID+663 , 187576, 571, 1, 1, 7856.078, -735.8157, 1178.389, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+664 , 187576, 571, 1, 1, 8433.876, -362.944, 908.5649, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+665 , 187576, 571, 1, 1, 8418.453, -349.0424, 909.3304, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+666 , 187576, 571, 1, 1, 8473.581, -342.7954, 906.4036, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+667 , 187576, 571, 1, 1, 8863.629, -1319.788, 1033.377, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4445)
+(@OGUID+668 , 187576, 571, 1, 1, 7795.137, -2808.116, 1217.756, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4463)
+(@OGUID+669 , 187576, 571, 1, 1, 7817.069, -2963.269, 1259.725, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4441)
+(@OGUID+670 , 187576, 571, 1, 1, 4608.65, -4233.896, 181.3112, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+671 , 187576, 571, 1, 1, 4583.46, -4214.486, 178.712, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+672 , 187576, 571, 1, 1, 4588.769, -4259.397, 183.0127, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+673 , 187576, 571, 1, 1, 4545.505, -4198.653, 174.6676, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+674 , 187576, 571, 1, 1, 4525.026, -4220.745, 171.4343, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+675 , 187576, 571, 1, 1, 4524.598, -4165.28, 174.0965, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4159)
+(@OGUID+676 , 187576, 571, 1, 1, 4516.881, -4237.698, 172.0961, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4159)
+(@OGUID+677 , 187576, 571, 1, 1, 4530.678, -4141.924, 175.9093, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4159)
+(@OGUID+678 , 187576, 571, 1, 1, 4456.922, -4314.456, 160.9202, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4159)
+(@OGUID+679 , 187576, 571, 1, 1, 3876.39, -4523.813, 218.0925, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4205)
+(@OGUID+680 , 187576, 571, 1, 1, 3454.602, -2802.049, 202.4846, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+681 , 187576, 571, 1, 1, 3259.021, -2267.587, 114.378, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4248)
+(@OGUID+682 , 187576, 571, 1, 1, 3263.253, -2264.287, 115.0179, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4206)
+(@OGUID+683 , 187576, 571, 1, 1, 3095.98, -2049.74, 86.23113, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4206)
+(@OGUID+684 , 187576, 571, 1, 1, 3096.859, -2049.747, 86.25437, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4206)
+(@OGUID+685 , 187576, 571, 1, 1, 737.0417, -2925.07, 7.038448, 5.969027, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3987)
+(@OGUID+686 , 187576, 571, 1, 1, 737.8021, -2929.837, 6.96212, 0.5934101, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3987)
+(@OGUID+687 , 187576, 571, 1, 1, 789.0579, -2887.322, 6.061472, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3987)
+(@OGUID+688 , 187576, 571, 1, 1, 2472.168, -5058.874, 292.4872, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4003)
+(@OGUID+689 , 187576, 571, 1, 1, 2472.029, -5066.281, 286.0714, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4003)
+(@OGUID+690 , 187576, 571, 1, 1, 2474.881, -5069.709, 286.0041, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4003)
+(@OGUID+691 , 187576, 571, 1, 1, 2499.964, -5059.02, 286.9637, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4003)
+(@OGUID+692 , 187576, 571, 1, 1, 2491.536, -5071.006, 298.8146, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4003)
+(@OGUID+693 , 187576, 571, 1, 1, 2653.467, -4398.361, 284.5294, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+694 , 187576, 571, 1, 1, 2645.279, -4389.678, 283.9462, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+695 , 187576, 571, 1, 1, 3647.875, -707.9075, 217.1875, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4177)
+(@OGUID+696 , 187576, 571, 1, 1, 3644.348, -723.9233, 218.8718, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4177)
+(@OGUID+697 , 187576, 571, 1, 1, 3658.615, -719.4378, 218.7648, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4177)
+(@OGUID+698 , 187576, 571, 1, 1, 3720.316, -705.8351, 216.0074, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4177)
+(@OGUID+699 , 187576, 571, 1, 1, 3713.571, -686.2274, 216.503, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4177)
+(@OGUID+700 , 187576, 571, 1, 1, 2791.102, 904.5616, 23.04511, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4152)
+(@OGUID+701 , 187576, 571, 1, 1, 2787.111, 910.8663, 32.01936, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4152)
+(@OGUID+702 , 187576, 571, 1, 1, 2798.089, 941.0677, 24.67208, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4152)
+(@OGUID+703 , 187576, 571, 1, 1, 2792.32, 944.9219, 23.26566, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4152)
+(@OGUID+704 , 187576, 571, 1, 1, 2756.885, 920.0313, 24.40833, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4152)
+(@OGUID+705 , 187576, 571, 1, 1, 2756.815, 926.7635, 23.2116, 2.984498, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4152)
+(@OGUID+706 , 187576, 571, 1, 1, 2742.9, 887.7947, 6.358366, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4152)
+(@OGUID+707 , 187576, 571, 1, 1, 2713.987, 894.1632, 16.31461, 2.059488, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4152)
+(@OGUID+708 , 187576, 571, 1, 1, 2732.103, 881.1441, 6.379679, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4152)
+(@OGUID+709 , 187576, 571, 1, 1, 3612.027, 1412.47, 92.60597, 4.852017, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4154)
+(@OGUID+710 , 187576, 571, 1, 1, 3827.736, 1496.177, 95.10645, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+711 , 187576, 571, 1, 1, 3827.11, 1482.655, 95.12893, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+712 , 187576, 571, 1, 1, 3825.417, 1465.946, 95.10252, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+713 , 187576, 571, 1, 1, 3842.333, 1481.939, 97.79363, 1.640607, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+714 , 187576, 571, 1, 1, 3859.411, 1466.078, 94.9991, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+715 , 187576, 571, 1, 1, 3857.144, 1496.144, 95.12449, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+716 , 187576, 571, 1, 1, 3857.466, 1482.773, 96.1758, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+717 , 187576, 571, 1, 1, 3770.23, 1602.427, 95.77409, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4165)
+(@OGUID+718 , 187576, 571, 1, 1, 3781.036, 1623.459, 95.58131, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4165)
+(@OGUID+719 , 187576, 571, 1, 1, 3553.18, 1827.47, 81.077, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+720 , 187576, 571, 1, 1, 3643.384, 1884.3, 80.81538, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+721 , 187576, 571, 1, 1, 4967.139, 1265.599, 227.7066, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4170)
+(@OGUID+722 , 187576, 571, 1, 1, 4971.71, 1267.167, 228.3888, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4170)
+(@OGUID+723 , 187576, 571, 1, 1, 5009.385, 1205.95, 231.4591, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4170)
+(@OGUID+724 , 187576, 571, 1, 1, 4942.589, 1170.193, 239.8133, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4170)
+(@OGUID+725 , 187576, 571, 1, 1, 4951.857, 1167.702, 240.1477, 4.206246, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4170)
+(@OGUID+726 , 187576, 571, 1, 1, 4937.846, 1158.604, 240.5038, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4170)
+(@OGUID+727 , 187576, 571, 1, 1, 5482.611, 4728.695, -191.6311, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4291)
+(@OGUID+728 , 187576, 571, 1, 1, 4475.266, 5707.764, 82.36211, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4122)
+(@OGUID+729 , 187576, 571, 1, 1, 4470.285, 5710.635, 82.27143, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4122)
+(@OGUID+730 , 187576, 571, 1, 1, 4111.603, 5303.919, 31.3832, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+731 , 187576, 571, 1, 1, 3449.408, 4085.986, 17.83682, 1.815142, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4037)
+(@OGUID+732 , 187576, 571, 1, 1, 3026.245, 4045.878, 28.50895, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4113)
+(@OGUID+733 , 187576, 571, 1, 1, 2980.379, 4053.99, 28.38085, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4113)
+(@OGUID+734 , 187576, 571, 1, 1, 3007.164, 4071.765, 35.89487, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4113)
+(@OGUID+735 , 187576, 571, 1, 1, 2279.208, 5188.578, 16.22224, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4115)
+(@OGUID+736 , 187576, 571, 1, 1, 2288.109, 5196.549, 14.44638, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4115)
+(@OGUID+737 , 187576, 571, 1, 1, 2924.559, 6242.063, 209.8437, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4129)
+(@OGUID+738 , 187576, 571, 1, 1, 2924.903, 6244.5, 210.3616, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 4129)
+(@OGUID+739 , 187576, 530, 1, 1, -4227.08, -12484.05, 47.71632, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+740 , 187576, 530, 1, 1, -4231.724, -12498.08, 47.24671, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 0)
+(@OGUID+741 , 187576, 530, 1, 1, -4207.997, -12557.59, 46.31153, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3576)
+(@OGUID+742 , 187576, 530, 1, 1, -4183.172, -12564.08, 45.20827, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3576)
+(@OGUID+743 , 187576, 530, 1, 1, -4122.453, -12463.12, 48.0975, 3.842447, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3576)
+(@OGUID+744 , 187576, 530, 1, 1, -4105.227, -12501.2, 47.79556, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3576)
+(@OGUID+745 , 187576, 530, 1, 1, -4107.671, -12483.03, 47.42568, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 187576 (Area: 3576)
+(@OGUID+746 , 181401, 530, 1, 1, -2138.824, 5148.72, -8.640973, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 0)
+(@OGUID+747 , 181401, 530, 1, 1, -2013.85, 5671.153, 104.9756, 3.595379, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3898)
+(@OGUID+748 , 181401, 530, 1, 1, -1934.761, 5896.532, 150.6684, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 0)
+(@OGUID+749 , 181401, 530, 1, 1, -1942.879, 5914.961, 156.5788, 5.166176, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 0)
+(@OGUID+750 , 181401, 530, 1, 1, -341.6888, 5481.863, 37.94325, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3521)
+(@OGUID+751 , 181401, 530, 1, 1, -337.4103, 5481.802, 37.91649, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3521)
+(@OGUID+752 , 181401, 530, 1, 1, -175.3683, 5512.138, 33.37462, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3565)
+(@OGUID+753 , 181401, 530, 1, 1, -186.2492, 5519.735, 33.73346, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3565)
+(@OGUID+754 , 181401, 530, 1, 1, -181.5449, 5532.257, 33.22929, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3565)
+(@OGUID+755 , 181401, 530, 1, 1, -159.9268, 5517.314, 33.24236, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3565)
+(@OGUID+756 , 181401, 530, 1, 1, -155.342, 5529.741, 33.96249, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3565)
+(@OGUID+757 , 181401, 530, 1, 1, -166.1566, 5537.293, 33.22692, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3565)
+(@OGUID+758 , 181401, 530, 1, 1, 1044.882, 7361.025, 45.56539, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3766)
+(@OGUID+759 , 181401, 530, 1, 1, 2085.431, 6890.104, 190.4657, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3772)
+(@OGUID+760 , 181401, 530, 1, 1, 2095.052, 6899.62, 190.4382, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3772)
+(@OGUID+761 , 181401, 530, 1, 1, 2944.296, 5533.428, 163.821, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3828)
+(@OGUID+762 , 181401, 530, 1, 1, 2940.299, 5415.802, 165.9382, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3951)
+(@OGUID+763 , 181401, 530, 1, 1, 3085.633, 5473.628, 162.5824, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3951)
+(@OGUID+764 , 181401, 530, 1, 1, 2090.407, 4769.771, 175.6497, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3844)
+(@OGUID+765 , 181401, 530, 1, 1, 2078.747, 4789.831, 175.6968, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3844)
+(@OGUID+766 , 181401, 530, 1, 1, 2092.127, 4792.164, 175.6362, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3844)
+(@OGUID+767 , 181401, 530, 1, 1, 2098.946, 4779.432, 175.5325, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3844)
+(@OGUID+768 , 181401, 530, 1, 1, 2948.536, 3719.698, 150.2694, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 0)
+(@OGUID+769 , 181401, 530, 1, 1, 3018.137, 3748.76, 151.2779, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3712)
+(@OGUID+770 , 181401, 530, 1, 1, 3116.458, 3688.845, 150.6044, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3712)
+(@OGUID+771 , 181401, 530, 1, 1, 4118.572, 2954.05, 360.3641, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3738)
+(@OGUID+772 , 181401, 530, 1, 1, 4116.873, 3058.359, 349.9748, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3738)
+(@OGUID+773 , 181401, 530, 1, 1, 4184.254, 3009.556, 349.8448, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3738)
+(@OGUID+774 , 181401, 530, 1, 1, 2969.402, 1791.448, 145.6347, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3728)
+(@OGUID+775 , 181401, 530, 1, 1, 2984.813, 1803.785, 146.0861, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3728)
+(@OGUID+776 , 181401, 530, 1, 1, -699.2603, 2709.337, 101.0987, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3538)
+(@OGUID+777 , 181401, 530, 1, 1, -690.3901, 2717.364, 101.012, 0, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3538)
+(@OGUID+778 , 181401, 530, 1, 1, -716.8414, 2735.047, 100.798, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3538)
+(@OGUID+779 , 181401, 530, 1, 1, -717.3152, 2750.212, 100.8153, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3538)
+(@OGUID+780 , 181401, 530, 1, 1, -690.6761, 2732.448, 100.9171, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3538)
+(@OGUID+781 , 181401, 530, 1, 1, 203.049, 4333.749, 125.1613, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3552)
+(@OGUID+782 , 181401, 530, 1, 1, -3099.529, 2512.387, 75.96468, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+783 , 181401, 530, 1, 1, -3097.624, 2522.847, 75.95374, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+784 , 181401, 530, 1, 1, -3088.047, 2526.28, 75.9549, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+785 , 181401, 530, 1, 1, -3081.95, 2509.127, 75.9601, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+786 , 181401, 530, 1, 1, -3092.005, 2502.068, 76.35168, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+787 , 181401, 530, 1, 1, -3080.017, 2519.666, 75.95196, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+788 , 181401, 530, 1, 1, -2980.738, 2565.908, 97.9761, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+789 , 181401, 530, 1, 1, -2963.106, 2578.467, 97.77729, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+790 , 181401, 530, 1, 1, -2978.653, 2545.87, 97.51945, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+791 , 181401, 530, 1, 1, -2944.712, 2569.651, 97.11517, 0.6108634, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+792 , 181401, 530, 1, 1, -2960.054, 2536.851, 96.74974, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+793 , 181401, 530, 1, 1, -2943.146, 2549.089, 96.68553, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3744)
+(@OGUID+794 , 181401, 530, 1, 1, -4053.135, 2167.243, 117.8958, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3745)
+(@OGUID+795 , 181401, 530, 1, 1, -4063.405, 2159.092, 117.9386, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3745)
+(@OGUID+796 , 181401, 530, 1, 1, -4063.29, 2183.958, 117.962, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3745)
+(@OGUID+797 , 181401, 530, 1, 1, -4044.765, 2237.184, 118.0772, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3745)
+(@OGUID+798 , 181401, 530, 1, 1, -3956.793, 2241.567, 107.9687, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3745)
+(@OGUID+799 , 181401, 530, 1, 1, -4114.495, 1119.618, 52.38124, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3938)
+(@OGUID+800 , 181401, 530, 1, 1, -3006.023, 795.2581, -1.891022, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3754)
+(@OGUID+801 , 181401, 571, 1, 1, 5427.162, -2601.81, 310.7791, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+802 , 181401, 571, 1, 1, 5427.37, -2617.239, 310.7862, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+803 , 181401, 571, 1, 1, 5465.976, -2609.939, 310.7266, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+804 , 181401, 571, 1, 1, 5418.945, -2609.535, 310.7752, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+805 , 181401, 571, 1, 1, 5474.365, -2602.701, 310.6908, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+806 , 181401, 571, 1, 1, 5435.416, -2610.136, 310.76, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+807 , 181401, 571, 1, 1, 5473.117, -2618.065, 310.7838, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+808 , 181401, 571, 1, 1, 5482.347, -2610.531, 310.6789, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+809 , 181401, 571, 1, 1, 5426.538, -2647.546, 310.7589, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+810 , 181401, 571, 1, 1, 5418.217, -2654.892, 310.6752, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+811 , 181401, 571, 1, 1, 5472.982, -2649.109, 310.3139, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+812 , 181401, 571, 1, 1, 5481.421, -2655.851, 310.4912, 0, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4275)
+(@OGUID+813 , 181401, 571, 1, 1, 5779.607, -3647.157, 397.0788, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4323)
+(@OGUID+814 , 181401, 571, 1, 1, 3415.612, -2804.818, 207.8745, 5.340709, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 0)
+(@OGUID+815 , 181401, 571, 1, 1, 3426.07, -2797.111, 207.806, 5.340709, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 0)
+(@OGUID+816 , 181401, 571, 1, 1, 3404.855, -2779.617, 207.3744, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4204)
+(@OGUID+817 , 181401, 571, 1, 1, 3248.334, -2376.13, 125.8163, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4217)
+(@OGUID+818 , 181401, 571, 1, 1, 3220.808, -2360.816, 129.0979, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4217)
+(@OGUID+819 , 181401, 571, 1, 1, 3272.992, -2376.118, 126.1801, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4217)
+(@OGUID+820 , 181401, 571, 1, 1, 3313.64, -2339.259, 135.3806, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 0)
+(@OGUID+821 , 181401, 571, 1, 1, 3207.483, -2339.074, 129.0386, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 0)
+(@OGUID+822 , 181401, 571, 1, 1, 3194.915, -2304.803, 131.4482, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4206)
+(@OGUID+823 , 181401, 571, 1, 1, 3191.102, -2279.254, 131.5012, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4248)
+(@OGUID+824 , 181401, 571, 1, 1, 3331.027, -2305.595, 137.5376, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4248)
+(@OGUID+825 , 181401, 571, 1, 1, 3342.094, -2281.307, 137.6798, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4248)
+(@OGUID+826 , 181401, 571, 1, 1, 3351.668, -2245.885, 137.426, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4206)
+(@OGUID+827 , 181401, 571, 1, 1, 3325.675, -2187.142, 134.1245, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4206)
+(@OGUID+828 , 181401, 571, 1, 1, 2495.748, -1930.493, 18.89087, 0.5934101, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4242)
+(@OGUID+829 , 181401, 571, 1, 1, 2510.754, -1823.163, 18.16746, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4242)
+(@OGUID+830 , 181401, 571, 1, 1, 2508.891, -1811.156, 18.57204, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4242)
+(@OGUID+831 , 181401, 571, 1, 1, 2482.121, -1838.097, 19.10611, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4242)
+(@OGUID+832 , 181401, 571, 1, 1, 2493.719, -1840.646, 18.18876, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4242)
+(@OGUID+833 , 181401, 571, 1, 1, 2502.159, -1831.973, 18.18279, 5.480334, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4242)
+(@OGUID+834 , 181401, 571, 1, 1, 4568.499, 1399.641, 198.2307, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4169)
+(@OGUID+835 , 181401, 571, 1, 1, 4522.387, 5716.762, 86.95365, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4122)
+(@OGUID+836 , 181401, 571, 1, 1, 4505.328, 5718.376, 87.04783, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4122)
+(@OGUID+837 , 181401, 571, 1, 1, 4520.103, 5699.374, 86.98763, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4122)
+(@OGUID+838 , 181401, 571, 1, 1, 4502.594, 5701.009, 86.9327, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 4122)
+(@OGUID+839 , 181401, 530, 1, 1, 9954.997, -7098.571, 59.86189, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3487)
+(@OGUID+840 , 181401, 530, 1, 1, 10007.34, -7030.903, 57.97285, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3487)
+(@OGUID+841 , 181401, 530, 1, 1, 10002.23, -7202.467, 44.06782, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3487)
+(@OGUID+842 , 181401, 530, 1, 1, 9992.33, -7205.063, 44.06255, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3487)
+(@OGUID+843 , 181401, 530, 1, 1, 10010.68, -7199.167, 44.22095, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3487)
+(@OGUID+844 , 181401, 530, 1, 1, 9952.419, -7232.268, 43.9028, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3487)
+(@OGUID+845 , 181401, 530, 1, 1, 9945.498, -7242.049, 43.90578, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 3487)
+(@OGUID+846 , 181401, 0, 1, 1, -8892.52, 867.236, 109.002, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5390)
+(@OGUID+847 , 181401, 0, 1, 1, -8914.21, 995.188, 129.577, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5390)
+(@OGUID+848 , 181401, 0, 1, 1, -8937.31, 861.234, 119.3, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5154)
+(@OGUID+849 , 181401, 0, 1, 1, -8948.17, 861.865, 119.265, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5154)
+(@OGUID+850 , 181401, 0, 1, 1, -8623, 413.575, 114.802, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5390)
+(@OGUID+851 , 181401, 0, 1, 1, -8616.79, 405.722, 114.684, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5390)
+(@OGUID+852 , 181401, 0, 1, 1, -8610.86, 398.378, 114.794, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5390)
+(@OGUID+853 , 181401, 0, 1, 1, -8605.4, 391.313, 114.686, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5149)
+(@OGUID+854 , 181401, 0, 1, 1, -8341.17, 615.349, 104.273, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5150)
+(@OGUID+855 , 181401, 0, 1, 1, -8523.936, 930.3209, 108.977, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5346)
+(@OGUID+856 , 181401, 0, 1, 1, -8630.926, 945.2589, 136.5359, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5151)
+(@OGUID+857 , 181401, 0, 1, 1, -8578.42, 986.8, 133.948, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 5151)
+(@OGUID+858 , 181389, 530, 1, 1, -263.8385, 5499.673, 50.41258, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3565)
+(@OGUID+859 , 181389, 530, 1, 1, -260.162, 5513.389, 50.63232, 2.164206, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3565)
+(@OGUID+860 , 181389, 530, 1, 1, -250.3394, 5496.269, 50.57555, 5.305802, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3565)
+(@OGUID+861 , 181389, 530, 1, 1, -247.4611, 5509.375, 50.50355, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3565)
+(@OGUID+862 , 181389, 530, 1, 1, 282.604, 6088.575, 141.4437, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+863 , 181389, 530, 1, 1, -655.4515, 2575.622, 83.57739, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+864 , 181389, 530, 1, 1, -632.5417, 2590.197, 83.52296, 5.305802, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+865 , 181389, 530, 1, 1, -761.4095, 2621.017, 118.6791, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3538)
+(@OGUID+866 , 181389, 530, 1, 1, -784.1385, 2658.919, 119.216, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3538)
+(@OGUID+867 , 181389, 530, 1, 1, -2603.052, 4419.237, 49.35944, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+868 , 181389, 530, 1, 1, -2649.044, 4426.315, 49.63846, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3683)
+(@OGUID+869 , 181389, 530, 1, 1, -2591.57, 4496.896, 49.60318, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3683)
+(@OGUID+870 , 181389, 530, 1, 1, -2665.083, 4468.276, 49.83411, 2.984498, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3683)
+(@OGUID+871 , 181389, 530, 1, 1, -2637.212, 4503.528, 49.73413, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3683)
+(@OGUID+872 , 181389, 530, 1, 1, -2996.48, 3977.195, 18.39971, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3684)
+(@OGUID+873 , 181389, 530, 1, 1, -2991.834, 3970.603, 18.19912, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3684)
+(@OGUID+874 , 181389, 530, 1, 1, -2997.844, 3965.778, 18.08171, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3684)
+(@OGUID+875 , 181389, 530, 1, 1, -3002.288, 3972.225, 18.59078, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3684)
+(@OGUID+876 , 181389, 530, 1, 1, -2969.582, 2560.962, 107.134, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3744)
+(@OGUID+877 , 181389, 530, 1, 1, -3882.012, 2085.141, 99.7375, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3745)
+(@OGUID+878 , 181389, 530, 1, 1, -3891.201, 2089.942, 100.3711, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3745)
+(@OGUID+879 , 181389, 530, 1, 1, -3923.835, 2072.333, 100.5962, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3745)
+(@OGUID+880 , 181389, 530, 1, 1, -3922.777, 2062.049, 100.1208, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3745)
+(@OGUID+881 , 181389, 571, 1, 1, 5606.066, -662.3932, 232.8057, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4557)
+(@OGUID+882 , 181389, 571, 1, 1, 5422.828, -2574.388, 314.5182, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4275)
+(@OGUID+883 , 181389, 571, 1, 1, 5490.349, -2575.417, 313.0533, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4275)
+(@OGUID+884 , 181389, 571, 1, 1, 4524.684, -4252.019, 177.0246, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+885 , 181389, 571, 1, 1, 4532.347, -4148.53, 182.7989, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4159)
+(@OGUID+886 , 181389, 571, 1, 1, 3881.886, -4516.897, 223.7292, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4205)
+(@OGUID+887 , 181389, 571, 1, 1, 3431.319, -2776.561, 215.7577, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4204)
+(@OGUID+888 , 181389, 571, 1, 1, 3282.833, -2368.123, 117.8988, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4217)
+(@OGUID+889 , 181389, 571, 1, 1, 3293.471, -2350.238, 117.6907, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4217)
+(@OGUID+890 , 181389, 571, 1, 1, 3311.093, -2361.425, 117.9167, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4217)
+(@OGUID+891 , 181389, 571, 1, 1, 3300.602, -2378.899, 117.8947, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4217)
+(@OGUID+892 , 181389, 571, 1, 1, 3193.161, -2253.913, 117.8538, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4248)
+(@OGUID+893 , 181389, 571, 1, 1, 3191.496, -2233.637, 117.8115, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4248)
+(@OGUID+894 , 181389, 571, 1, 1, 3207.165, -2204.585, 142.3003, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4206)
+(@OGUID+895 , 181389, 571, 1, 1, 3187.294, -2198.184, 141.9457, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4206)
+(@OGUID+896 , 181389, 571, 1, 1, 3346.118, -2225.082, 119.375, 2.042035, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4206)
+(@OGUID+897 , 181389, 571, 1, 1, 3336.534, -2207.365, 120.0341, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4206)
+(@OGUID+898 , 181389, 571, 1, 1, 3193.716, -2178.347, 141.7413, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4206)
+(@OGUID+899 , 181389, 571, 1, 1, 1390.88, -3366.663, 194.8545, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3998)
+(@OGUID+900 , 181389, 571, 1, 1, 1350.993, -3356.948, 196.8577, 1.343901, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 3998)
+(@OGUID+901 , 181389, 571, 1, 1, 3232.417, -718.9236, 167.9964, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+902 , 181389, 571, 1, 1, 3599.903, -757.4666, 199.1967, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+903 , 181389, 571, 1, 1, 3557.501, -768.2603, 203.7256, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+904 , 181389, 571, 1, 1, 3641.374, -671.6805, 245.1112, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+905 , 181389, 571, 1, 1, 3628.027, -668.0167, 244.9439, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+906 , 181389, 571, 1, 1, 3647.813, -648.9062, 243.9453, 0.7679439, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+907 , 181389, 571, 1, 1, 3634.617, -644.8275, 244.1315, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+908 , 181389, 571, 1, 1, 3650.591, -754.5084, 201.8451, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+909 , 181389, 571, 1, 1, 3695.235, -765.3697, 202.1208, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+910 , 181389, 571, 1, 1, 3767.403, -747.8274, 211.6567, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+911 , 181389, 571, 1, 1, 3743.8, -773.8577, 209.3841, 0.7853968, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+912 , 181389, 571, 1, 1, 3800.189, -817.2236, 208.8302, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+913 , 181389, 571, 1, 1, 3815.78, -754.2736, 213.8814, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+914 , 181389, 571, 1, 1, 3779.269, -809.5614, 209.6387, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+915 , 181389, 571, 1, 1, 3826.977, -809.4998, 208.5766, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+916 , 181389, 571, 1, 1, 3809.892, -826.8338, 208.5438, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+917 , 181389, 571, 1, 1, 3816.917, -800.0577, 208.6812, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+918 , 181389, 571, 1, 1, 3847.43, -835.5692, 200.8211, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+919 , 181389, 571, 1, 1, 3807.228, -855.2426, 203.9786, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+920 , 181389, 571, 1, 1, 3797.328, -852.065, 204.1598, 3.630291, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+921 , 181389, 571, 1, 1, 3893.384, -829.6746, 205.0926, 5.218536, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+922 , 181389, 571, 1, 1, 3928.128, -732.9033, 262.2497, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+923 , 181389, 571, 1, 1, 3893.759, -696.3032, 261.979, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+924 , 181389, 571, 1, 1, 3966.297, -733.6108, 257.4371, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+925 , 181389, 571, 1, 1, 3905.213, -659.3301, 257.8033, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4177)
+(@OGUID+926 , 181389, 571, 1, 1, 3635.294, 245.6354, 58.86659, 0.06981169, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4161)
+(@OGUID+927 , 181389, 571, 1, 1, 3465.233, 228.1736, 59.31886, 3.263772, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4161)
+(@OGUID+928 , 181389, 571, 1, 1, 3457.301, 300.75, 59.31886, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4161)
+(@OGUID+929 , 181389, 571, 1, 1, 3628.324, 318.184, 59.31886, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4161)
+(@OGUID+930 , 181389, 571, 1, 1, 3665.188, 265.6042, -109.3723, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4161)
+(@OGUID+931 , 181389, 571, 1, 1, 3661.484, 303.9514, -109.4306, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4161)
+(@OGUID+932 , 181389, 571, 1, 1, 3775.937, 1543.239, 90.97485, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+933 , 181389, 571, 1, 1, 3784.709, 1522.594, 91.5054, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+934 , 181389, 571, 1, 1, 3865.47, 1634.12, 93.62034, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4165)
+(@OGUID+935 , 181389, 571, 1, 1, 3876.293, 1616.893, 93.54786, 2.059488, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4165)
+(@OGUID+936 , 181389, 571, 1, 1, 3466.604, 4204.274, 36.17081, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4037)
+(@OGUID+937 , 181389, 571, 1, 1, 2330.237, 5169.872, 25.637, 1.832595, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4115)
+(@OGUID+938 , 181389, 571, 1, 1, 2288.474, 5160.943, 25.54812, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4115)
+(@OGUID+939 , 181389, 571, 1, 1, 2293.54, 5174.718, 25.11965, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4115)
+(@OGUID+940 , 181389, 571, 1, 1, 2362.819, 5195.901, 19.76927, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4115)
+(@OGUID+941 , 181389, 571, 1, 1, 2373.82, 5235.902, 20.25008, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4032)
+(@OGUID+942 , 181389, 571, 1, 1, 2361.502, 5274.709, 25.85167, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 4032)
+(@OGUID+943 , 181389, 530, 1, 1, -4036.067, -11724.26, -125.3355, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+944 , 181389, 530, 1, 1, -4129.516, -11792.52, -122.0234, 2.268925, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+945 , 181389, 530, 1, 1, -3907.011, -11840.65, -17.3894, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+946 , 181389, 530, 1, 1, -3949.172, -11719.73, -231.7634, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+947 , 181389, 530, 1, 1, -3906.889, -11740.66, -247.1549, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+948 , 181389, 530, 1, 1, -3845.706, -11764.55, -72.85789, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+949 , 181389, 530, 1, 1, -3838.579, -11819.76, -46.66968, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+950 , 181389, 530, 1, 1, -3794.911, -11730.61, -93.07029, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+951 , 181389, 530, 1, 1, -3861.939, -11726.7, -264.6633, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+952 , 181389, 530, 1, 1, -3840.368, -11683.53, -278.9308, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+953 , 181389, 530, 1, 1, -3855.357, -11639.21, -293.8783, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+954 , 181389, 530, 1, 1, -3855.823, -11639.53, -169.8095, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+955 , 181389, 530, 1, 1, -3783.918, -11674.64, -93.70945, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+956 , 181389, 530, 1, 1, -3905.837, -11628.61, -302.9813, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+957 , 181389, 530, 1, 1, -3897.788, -11618.37, -185.5837, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+958 , 181389, 530, 1, 1, -3942.769, -11633, -199.4732, 5.497789, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+959 , 181389, 530, 1, 1, -3964.059, -11674.84, -216.94, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+960 , 181389, 530, 1, 1, -3905.153, -11333.2, -121.9205, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+961 , 181389, 530, 1, 1, -3871.696, -11319.82, -121.6228, 5.078908, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+962 , 181389, 530, 1, 1, -3662.133, -11453.98, -113.087, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 0)
+(@OGUID+963 , 181393, 530, 1, 1, -2282.402, 5556.487, 71.11912, 0.2094394, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+964 , 181393, 530, 1, 1, -2274.591, 5580.758, 71.46299, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+965 , 181393, 530, 1, 1, -183.2504, 5514.362, 30.78355, 0.4712385, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3565)
+(@OGUID+966 , 181393, 530, 1, 1, -186.922, 5525.658, 30.37905, 0.3665176, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3565)
+(@OGUID+967 , 181393, 530, 1, 1, 282.4311, 5967.021, 156.1607, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+968 , 181393, 530, 1, 1, 225.7361, 6059.827, 155.2052, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+969 , 181393, 530, 1, 1, 2947.151, 5538.044, 149.536, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3828)
+(@OGUID+970 , 181393, 530, 1, 1, 2941.788, 5528.235, 149.5077, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3828)
+(@OGUID+971 , 181393, 530, 1, 1, 2935.668, 5418.931, 149.9498, 4.206246, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3951)
+(@OGUID+972 , 181393, 530, 1, 1, 2945.663, 5412.689, 150.0003, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3951)
+(@OGUID+973 , 181393, 530, 1, 1, 3083.157, 5479.303, 146.7212, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3951)
+(@OGUID+974 , 181393, 530, 1, 1, 3087.416, 5468.229, 146.6802, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3951)
+(@OGUID+975 , 181393, 530, 1, 1, 2148.146, 4823.462, 153.2521, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3844)
+(@OGUID+976 , 181393, 530, 1, 1, 2127.926, 4832.968, 153.8778, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3844)
+(@OGUID+977 , 181393, 530, 1, 1, 2137.614, 4828.306, 155.2136, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3844)
+(@OGUID+978 , 181393, 530, 1, 1, 4109.984, 3055.683, 343.4562, 4.991644, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3738)
+(@OGUID+979 , 181393, 530, 1, 1, 4123.076, 3061.348, 343.5373, 5.166176, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3738)
+(@OGUID+980 , 181393, 530, 1, 1, 2951.238, 1778.57, 143.2276, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3728)
+(@OGUID+981 , 181393, 530, 1, 1, -706.2856, 2715.499, 95.24024, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3538)
+(@OGUID+982 , 181393, 530, 1, 1, 76.68159, 4292.62, 107.9898, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+983 , 181393, 530, 1, 1, 66.88628, 4352.609, 109.049, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+984 , 181393, 530, 1, 1, 67.68761, 4313.362, 103.2934, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+985 , 181393, 530, 1, 1, 67.80838, 4313.379, 109.1878, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+986 , 181393, 530, 1, 1, 74.12413, 4313.422, 107.8744, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+987 , 181393, 530, 1, 1, 66.69315, 4352.594, 103.5399, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+988 , 181393, 530, 1, 1, 73.21702, 4352.617, 107.5482, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+989 , 181393, 530, 1, 1, 158.0313, 4313.944, 115.8598, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3552)
+(@OGUID+990 , 181393, 530, 1, 1, 158.0299, 4353.155, 116.1294, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3552)
+(@OGUID+991 , 181393, 530, 1, 1, 160.362, 4290.866, 115.9002, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3552)
+(@OGUID+992 , 181393, 530, 1, 1, 208.2989, 4340.905, 122.2671, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3552)
+(@OGUID+993 , 181393, 530, 1, 1, 208.1318, 4326.834, 122.3028, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3552)
+(@OGUID+994 , 181393, 530, 1, 1, 237.0347, 4327.787, 122.8105, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3552)
+(@OGUID+995 , 181393, 530, 1, 1, 237.1911, 4339.148, 122.6282, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3552)
+(@OGUID+996 , 181393, 530, 1, 1, -2910.031, 4035.109, 1.929951, 4.485497, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3684)
+(@OGUID+997 , 181393, 530, 1, 1, -2927.013, 4021.806, 4.196482, 3.595379, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3684)
+(@OGUID+998 , 181393, 530, 1, 1, -2923.233, 4027.322, 2.017109, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3684)
+(@OGUID+999 , 181393, 530, 1, 1, -2921.817, 4013.159, 4.221461, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3684)
+(@OGUID+1000, 181393, 530, 1, 1, -2915.338, 4014.013, 1.949319, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3684)
+(@OGUID+1001, 181393, 530, 1, 1, -2902.193, 4021.935, 1.9572, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3684)
+(@OGUID+1002, 181393, 530, 1, 1, -2742.369, 7297.826, 47.88564, 2.094393, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3626)
+(@OGUID+1003, 181393, 530, 1, 1, -2772.801, 7324.949, 63.32422, 5.794494, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3626)
+(@OGUID+1004, 181393, 530, 1, 1, -2732.494, 7320.932, 47.57973, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3626)
+(@OGUID+1005, 181393, 530, 1, 1, -2738.571, 7309.452, 63.32978, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3626)
+(@OGUID+1006, 181393, 530, 1, 1, -3026.055, 2626.86, 81.10643, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1007, 181393, 530, 1, 1, -3020.87, 2621.106, 81.12374, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1008, 181393, 530, 1, 1, -3124.819, 2572.863, 66.77592, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1009, 181393, 530, 1, 1, -3123.647, 2558.357, 67.05743, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3744)
+(@OGUID+1010, 181393, 530, 1, 1, -2980.038, 2568.41, 79.19615, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3744)
+(@OGUID+1011, 181393, 530, 1, 1, -2982.046, 2563.972, 79.34058, 2.897245, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3744)
+(@OGUID+1012, 181393, 530, 1, 1, -4130.577, 1117.598, 46.67734, 1.780234, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3938)
+(@OGUID+1013, 181393, 530, 1, 1, -4121.725, 1129.575, 50.64345, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3938)
+(@OGUID+1014, 181393, 530, 1, 1, -4120.059, 1134.973, 47.51078, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3938)
+(@OGUID+1015, 181393, 571, 1, 1, 5745.579, -3534.724, 396.685, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1016, 181393, 571, 1, 1, 5769.655, -3530.542, 396.8302, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4323)
+(@OGUID+1017, 181393, 571, 1, 1, 6113.523, -1046.297, 406.5891, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4418)
+(@OGUID+1018, 181393, 571, 1, 1, 6127.377, -1046.22, 405.7823, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4418)
+(@OGUID+1019, 181393, 571, 1, 1, 3854.253, -4497.099, 208.4463, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4205)
+(@OGUID+1020, 181393, 571, 1, 1, 3876.38, -4541.031, 209.7021, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1021, 181393, 571, 1, 1, 3845.263, -4506.483, 208.0879, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1022, 181393, 571, 1, 1, 3858.301, -4564.549, 210.1741, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1023, 181393, 571, 1, 1, 3865.145, -4556.175, 211.0864, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1024, 181393, 571, 1, 1, 1421.958, -3261.318, 175.9854, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4071)
+(@OGUID+1025, 181393, 571, 1, 1, 724.0819, -2929.729, 7.998729, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3987)
+(@OGUID+1026, 181393, 571, 1, 1, 437.3842, -4539.971, 252.3735, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3991)
+(@OGUID+1027, 181393, 571, 1, 1, 438.4343, -4546.447, 249.3452, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3991)
+(@OGUID+1028, 181393, 571, 1, 1, 447.4662, -4556.945, 252.1781, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3991)
+(@OGUID+1029, 181393, 571, 1, 1, 442.4383, -4552.802, 249.542, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3991)
+(@OGUID+1030, 181393, 571, 1, 1, 481.2321, -4523.523, 260.9968, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3991)
+(@OGUID+1031, 181393, 571, 1, 1, 592.2986, -4952.793, 23.01477, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3981)
+(@OGUID+1032, 181393, 571, 1, 1, 585.9739, -4954.365, 22.9537, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3981)
+(@OGUID+1033, 181393, 571, 1, 1, 572.9479, -4943.799, 27.1676, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3981)
+(@OGUID+1034, 181393, 571, 1, 1, 1889.537, -6174.26, 27.78375, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4000)
+(@OGUID+1035, 181393, 571, 1, 1, 1886.857, -6181.003, 26.00835, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4000)
+(@OGUID+1036, 181393, 571, 1, 1, 1883.005, -6173.481, 30.73777, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4000)
+(@OGUID+1037, 181393, 571, 1, 1, 1896.369, -6177.458, 28.25126, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4000)
+(@OGUID+1038, 181393, 571, 1, 1, 1900.714, -6182.306, 31.16157, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4000)
+(@OGUID+1039, 181393, 571, 1, 1, 1892.778, -6183.736, 25.80629, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4000)
+(@OGUID+1040, 181393, 571, 1, 1, 1869.91, -6225.537, 14.98773, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4000)
+(@OGUID+1041, 181393, 571, 1, 1, 2482.825, -5081.014, 288.1022, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4003)
+(@OGUID+1042, 181393, 571, 1, 1, 2472.029, -5069.097, 290.739, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4003)
+(@OGUID+1043, 181393, 571, 1, 1, 2715.438, 895.9642, 10.36512, 0.2094394, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4152)
+(@OGUID+1044, 181393, 571, 1, 1, 2714.575, 895.9132, 10.34969, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4152)
+(@OGUID+1045, 181393, 571, 1, 1, 3109.58, 1232.019, 161.7771, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4154)
+(@OGUID+1046, 181393, 571, 1, 1, 3109.565, 1232.781, 161.7827, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4154)
+(@OGUID+1047, 181393, 571, 1, 1, 3500.457, 1971.03, 67.74579, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1048, 181393, 571, 1, 1, 3492.437, 1968.104, 68.17338, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1049, 181393, 571, 1, 1, 3518.783, 1993.761, 67.34436, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1050, 181393, 571, 1, 1, 3505.422, 2014.635, 68.21996, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1051, 181393, 571, 1, 1, 3519.55, 2023.388, 67.93623, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1052, 181393, 571, 1, 1, 3466.472, 4192.884, 28.92045, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4037)
+(@OGUID+1053, 181393, 571, 1, 1, 3491.174, 4170.668, 27.20992, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4037)
+(@OGUID+1054, 181393, 571, 1, 1, 3437.626, 4173.683, 27.00562, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4037)
+(@OGUID+1055, 181393, 571, 1, 1, 3462.824, 4143.795, 26.00627, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4037)
+(@OGUID+1056, 181393, 571, 1, 1, 3001.963, 4042.354, 29.05371, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4113)
+(@OGUID+1057, 181393, 571, 1, 1, 2786.774, 6151.367, 89.29953, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4020)
+(@OGUID+1058, 181393, 571, 1, 1, 2798.918, 6138.153, 89.22512, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4020)
+(@OGUID+1059, 181393, 571, 1, 1, 2794.336, 6171.501, 88.10828, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4020)
+(@OGUID+1060, 181393, 571, 1, 1, 2819.27, 6144.357, 87.87657, 2.303831, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4020)
+(@OGUID+1061, 181393, 571, 1, 1, 2815.826, 6166.08, 94.54527, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4129)
+(@OGUID+1062, 181393, 571, 1, 1, 3615.738, 5895.031, 180.1675, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4023)
+(@OGUID+1063, 181393, 571, 1, 1, 3644.961, 5913.442, 180.1508, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4023)
+(@OGUID+1064, 181393, 571, 1, 1, 3634.594, 5865.391, 179.9925, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4023)
+(@OGUID+1065, 181393, 571, 1, 1, 3664.062, 5884.241, 180.022, 2.91469, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 4023)
+(@OGUID+1066, 181393, 530, 1, 1, 9982.938, -7094.17, 55.73647, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1067, 181393, 530, 1, 1, 9971.994, -7098.172, 51.63682, 1.97222, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1068, 181393, 530, 1, 1, 9950.984, -7081.828, 51.59273, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1069, 181393, 530, 1, 1, 9825.279, -7214.288, 34.39079, 4.206246, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1070, 181393, 530, 1, 1, 9867.815, -7250.419, 34.28242, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1071, 181393, 530, 1, 1, 9842.312, -7339.947, 33.42025, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1072, 181393, 530, 1, 1, 9858.424, -7340.051, 33.53955, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1073, 181393, 530, 1, 1, 9888.206, -7440.489, 18.43325, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1074, 181393, 530, 1, 1, 9881.708, -7445.709, 18.44877, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1075, 181393, 530, 1, 1, 9820.213, -7445.313, 18.36214, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1076, 181393, 530, 1, 1, 9813.948, -7440.063, 18.53376, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1077, 181393, 530, 1, 1, 9800.513, -7459.873, 21.58522, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1078, 181393, 530, 1, 1, 9788.535, -7459.793, 21.5471, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1079, 181393, 530, 1, 1, 9787.977, -7515.988, 21.1214, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1080, 181393, 530, 1, 1, 9776.338, -7459.713, 21.53671, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1081, 181393, 530, 1, 1, 9799.942, -7516.057, 21.14704, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1082, 181393, 530, 1, 1, 9775.622, -7515.917, 21.18118, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1083, 181393, 530, 1, 1, 9702.63, -7494.749, 20.87424, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1084, 181393, 530, 1, 1, 9648.485, -7397.347, 19.71108, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1085, 181393, 530, 1, 1, 9664.004, -7494.526, 21.30559, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1086, 181393, 530, 1, 1, 9710.682, -7517.241, 24.60951, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1087, 181393, 530, 1, 1, 9655.724, -7516.808, 24.74897, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1088, 181393, 530, 1, 1, 9628.701, -7397.234, 19.89468, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1089, 181393, 530, 1, 1, 9575.924, -7474.412, 20.00644, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1090, 181393, 530, 1, 1, 9577.849, -7444.63, 20.28195, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1091, 181393, 530, 1, 1, 9578.052, -7454.913, 20.29773, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1092, 181393, 530, 1, 1, 9576.13, -7425.43, 20.0839, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1093, 181393, 530, 1, 1, 9626.567, -7252.648, 18.88096, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1094, 181393, 530, 1, 1, 9616.16, -7252.588, 18.90923, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1095, 181393, 530, 1, 1, 9657.013, -7150.79, 19.11701, 2.042035, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1096, 181393, 530, 1, 1, 9639.584, -7150.563, 19.08469, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1097, 181393, 530, 1, 1, 9633.485, -7144.688, 18.93979, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1098, 181393, 530, 1, 1, 9663.479, -7144.868, 19.02398, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1099, 181393, 530, 1, 1, 9663.398, -7126.579, 19.17594, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1100, 181393, 530, 1, 1, 9633.681, -7126.534, 19.35443, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1101, 181393, 530, 1, 1, 9640.129, -7120.771, 19.24785, 5.061456, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1102, 181393, 530, 1, 1, 9657.051, -7120.849, 19.23065, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1103, 181393, 530, 1, 1, 9575.294, -7071.046, 21.81329, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1104, 181393, 530, 1, 1, 9585.785, -7071.107, 21.8504, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1105, 181393, 530, 1, 1, 9560.381, -7195.122, 19.30699, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1106, 181393, 530, 1, 1, 9576.513, -7195.214, 19.32236, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1107, 181393, 530, 1, 1, 9522.363, -7245.137, 20.03247, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1108, 181393, 530, 1, 1, 9542.478, -7245.922, 19.69782, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1109, 181393, 530, 1, 1, 9536.9, -7291.12, 18.49589, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1110, 181393, 530, 1, 1, 9546.85, -7291.168, 18.46919, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1111, 181393, 530, 1, 1, 9556.167, -7309.81, 18.62683, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1112, 181393, 530, 1, 1, 9555.695, -7291.208, 18.44218, 1.640607, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1113, 181393, 530, 1, 1, 9546.783, -7309.744, 18.7086, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1114, 181393, 530, 1, 1, 9536.851, -7309.674, 18.88877, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1115, 181393, 530, 1, 1, 9487.176, -7335.846, 18.74969, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1116, 181393, 530, 1, 1, 9486.544, -7355.187, 18.55445, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3487)
+(@OGUID+1117, 181393, 530, 1, 1, -3759.184, -11686.47, -100.7426, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1118, 181393, 530, 1, 1, -3758.17, -11705.32, -100.7183, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1119, 181393, 530, 1, 1, -3740.868, -11676.38, -98.68883, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1120, 181393, 530, 1, 1, -3738.775, -11714.7, -99.08512, 1.378809, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1121, 181393, 530, 1, 1, -3720.252, -11684.94, -94.64872, 3.630291, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1122, 181393, 530, 1, 1, -3719.035, -11703.56, -95.14524, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 0)
+(@OGUID+1123, 181393, 530, 1, 1, -4084.942, -13760.45, 75.98574, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3526)
+(@OGUID+1124, 181393, 530, 1, 1, -4087.579, -13767.74, 75.97815, 0.06981169, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 3526)
+(@OGUID+1125, 187667, 530, 1, 1, 266.4354, 6094.357, 133.5182, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1126, 187667, 530, 1, 1, 276.0255, 6085.296, 135.0984, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1127, 187667, 530, 1, 1, 261.8294, 6096.237, 133.3653, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1128, 187667, 530, 1, 1, 270.995, 6092.489, 133.5649, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1129, 187667, 530, 1, 1, 289.163, 6085.788, 135.125, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1130, 187667, 530, 1, 1, 239.3766, 7930.089, 27.83519, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3645)
+(@OGUID+1131, 187667, 530, 1, 1, 223.9831, 7923.57, 27.90063, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3645)
+(@OGUID+1132, 187667, 530, 1, 1, 228.6397, 7945.422, 29.25893, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3645)
+(@OGUID+1133, 187667, 530, 1, 1, 3058.398, 3696.026, 144.8155, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3712)
+(@OGUID+1134, 187667, 530, 1, 1, 3057.197, 3694.741, 145.4213, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3712)
+(@OGUID+1135, 187667, 530, 1, 1, 3058.831, 3691.601, 145.45, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3712)
+(@OGUID+1136, 187667, 530, 1, 1, 3060.614, 3691.763, 144.8515, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3712)
+(@OGUID+1137, 187667, 530, 1, 1, -2954.958, 2567.078, 81.00614, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3744)
+(@OGUID+1138, 187667, 530, 1, 1, -2963.262, 2557.669, 96.95348, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3744)
+(@OGUID+1139, 187667, 530, 1, 1, -2961.015, 2557.951, 93.87666, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3744)
+(@OGUID+1140, 187667, 530, 1, 1, -2961.582, 2546.881, 79.93132, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3744)
+(@OGUID+1141, 187667, 530, 1, 1, -4074.347, 2162.13, 111.4437, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3745)
+(@OGUID+1142, 187667, 530, 1, 1, -4072.622, 2162.176, 111.4297, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3745)
+(@OGUID+1143, 187667, 530, 1, 1, -4076.15, 2162.084, 111.4253, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3745)
+(@OGUID+1144, 187667, 530, 1, 1, -2974.166, 852.9896, -5.184109, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3754)
+(@OGUID+1145, 187667, 530, 1, 1, -2979.535, 851.0223, -5.23692, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3754)
+(@OGUID+1146, 187667, 571, 1, 1, 5855.43, 634.2999, 649.2884, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4395)
+(@OGUID+1147, 187667, 571, 1, 1, 5838.521, 520.3542, 659.7874, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4395)
+(@OGUID+1148, 187667, 571, 1, 1, 5858.512, 638.0903, 649.1016, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4395)
+(@OGUID+1149, 187667, 571, 1, 1, 5819.291, 514.2288, 659.8239, 1.099556, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4395)
+(@OGUID+1150, 187667, 571, 1, 1, 5855.882, 661.2175, 649.2011, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4395)
+(@OGUID+1151, 187667, 571, 1, 1, 5852.286, 664.1205, 649.1534, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4395)
+(@OGUID+1152, 187667, 571, 1, 1, 5766.1, 706.9418, 619.6938, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4739)
+(@OGUID+1153, 187667, 571, 1, 1, 5730.19, 682.8389, 648.4232, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4739)
+(@OGUID+1154, 187667, 571, 1, 1, 5769.932, 711.6566, 619.6014, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4739)
+(@OGUID+1155, 187667, 571, 1, 1, 5726.839, 678.6988, 648.3967, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4739)
+(@OGUID+1156, 187667, 571, 1, 1, 5906.59, 480.6752, 643.4434, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4616)
+(@OGUID+1157, 187667, 571, 1, 1, 5904.753, 489.8196, 643.4774, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4616)
+(@OGUID+1158, 187667, 571, 1, 1, 5863.507, 473.3883, 642.9924, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4616)
+(@OGUID+1159, 187667, 571, 1, 1, 5864.693, 467.3737, 643.1257, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4616)
+(@OGUID+1160, 187667, 571, 1, 1, 5796.578, -3553.885, 388.331, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4323)
+(@OGUID+1161, 187667, 571, 1, 1, 6120.367, -1076.484, 404.6041, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4418)
+(@OGUID+1162, 187667, 571, 1, 1, 6120.694, -1074.873, 405.0674, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4418)
+(@OGUID+1163, 187667, 571, 1, 1, 6124.218, -1074.936, 405.0566, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4418)
+(@OGUID+1164, 187667, 571, 1, 1, 6124.213, -1076.51, 404.6239, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4418)
+(@OGUID+1165, 187667, 571, 1, 1, 7806.432, -2962.629, 1261.428, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4441)
+(@OGUID+1166, 187667, 571, 1, 1, 7797.768, -2957.828, 1261.514, 1.204277, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4441)
+(@OGUID+1167, 187667, 571, 1, 1, 3416.354, -2799.535, 203.6574, 2.042035, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1168, 187667, 571, 1, 1, 3421.742, -2795.542, 203.7708, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1169, 187667, 571, 1, 1, 3410.07, -2779.702, 203.9763, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4204)
+(@OGUID+1170, 187667, 571, 1, 1, 3404.744, -2783.643, 203.9436, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4204)
+(@OGUID+1171, 187667, 571, 1, 1, 1454.493, -3273.58, 168.5273, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4071)
+(@OGUID+1172, 187667, 571, 1, 1, 1445.74, -3257.578, 169.2403, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4071)
+(@OGUID+1173, 187667, 571, 1, 1, 1438.028, -3267.566, 169.513, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4071)
+(@OGUID+1174, 187667, 571, 1, 1, 1437.135, -3266.915, 169.5058, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4071)
+(@OGUID+1175, 187667, 571, 1, 1, 1429.582, -3265.274, 169.2192, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4071)
+(@OGUID+1176, 187667, 571, 1, 1, 1431.483, -3274.533, 169.1915, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4071)
+(@OGUID+1177, 187667, 571, 1, 1, 1427.002, -3268.351, 169.1821, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4071)
+(@OGUID+1178, 187667, 571, 1, 1, 440.0521, -4547.913, 248.6341, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3991)
+(@OGUID+1179, 187667, 571, 1, 1, 455.1633, -4536.68, 247.5673, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3991)
+(@OGUID+1180, 187667, 571, 1, 1, 441.8183, -4550.703, 248.5898, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3991)
+(@OGUID+1181, 187667, 571, 1, 1, 458.6449, -4542.124, 247.7258, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3991)
+(@OGUID+1182, 187667, 571, 1, 1, 581.4718, -4943.683, 20.63075, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3981)
+(@OGUID+1183, 187667, 571, 1, 1, 586.2632, -4934.662, 20.74441, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3981)
+(@OGUID+1184, 187667, 571, 1, 1, 587.3395, -4934.356, 20.82388, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3981)
+(@OGUID+1185, 187667, 571, 1, 1, 580.5126, -4939.842, 20.76777, 0.2094394, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3981)
+(@OGUID+1186, 187667, 571, 1, 1, 1872.679, -6195.768, 26.33468, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4000)
+(@OGUID+1187, 187667, 571, 1, 1, 1891.333, -6175.724, 26.62351, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4000)
+(@OGUID+1188, 187667, 571, 1, 1, 1894.171, -6177.047, 26.61499, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4000)
+(@OGUID+1189, 187667, 571, 1, 1, 1890.348, -6204.115, 26.52463, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4000)
+(@OGUID+1190, 187667, 571, 1, 1, 2425.66, -5166.585, 282.1942, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4055)
+(@OGUID+1191, 187667, 571, 1, 1, 2482.925, -5077.249, 291.7695, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4003)
+(@OGUID+1192, 187667, 571, 1, 1, 2472.532, -5054.136, 292.9761, 0, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4003)
+(@OGUID+1193, 187667, 571, 1, 1, 2681.623, -4397.512, 285.5597, 0.9599299, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1194, 187667, 571, 1, 1, 2678.708, -4395.557, 285.5654, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1195, 187667, 571, 1, 1, 2677.323, -4386.643, 290.0943, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1196, 187667, 571, 1, 1, 3217.361, -685.8459, 169.8989, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1197, 187667, 571, 1, 1, 3219.979, -680.9132, 169.6687, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1198, 187667, 571, 1, 1, 3207.445, -675.2426, 170.4363, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4186)
+(@OGUID+1199, 187667, 571, 1, 1, 3205.08, -679.9858, 170.4128, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4186)
+(@OGUID+1200, 187667, 571, 1, 1, 3635.864, -710.7761, 215.8188, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4177)
+(@OGUID+1201, 187667, 571, 1, 1, 3640.115, -711.2604, 215.9585, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4177)
+(@OGUID+1202, 187667, 571, 1, 1, 3651.599, -711.7225, 216.8413, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4177)
+(@OGUID+1203, 187667, 571, 1, 1, 3665.587, -710.9298, 217.4738, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4177)
+(@OGUID+1204, 187667, 571, 1, 1, 3666.347, -703.8602, 217.6456, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4177)
+(@OGUID+1205, 187667, 571, 1, 1, 2770.71, 934.493, 25.70063, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4152)
+(@OGUID+1206, 187667, 571, 1, 1, 2777.521, 938.1545, 25.58711, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4152)
+(@OGUID+1207, 187667, 571, 1, 1, 3480.165, 1977.29, 70.61582, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1208, 187667, 571, 1, 1, 3472.212, 1983.86, 69.00069, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1209, 187667, 571, 1, 1, 3476.039, 2008.531, 68.95277, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1210, 187667, 571, 1, 1, 3484.333, 2013.51, 68.88947, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1211, 187667, 571, 1, 1, 4176.385, 5285.042, 28.29611, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4108)
+(@OGUID+1212, 187667, 571, 1, 1, 4178.876, 5273.907, 40.73148, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4108)
+(@OGUID+1213, 187667, 571, 1, 1, 4176.302, 5277.055, 28.09965, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4108)
+(@OGUID+1214, 187667, 571, 1, 1, 4171.795, 5282.206, 41.54663, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4108)
+(@OGUID+1215, 187667, 571, 1, 1, 2299.134, 5198.044, 13.93274, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4115)
+(@OGUID+1216, 187667, 571, 1, 1, 2280.926, 5198.394, 14.63274, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4032)
+(@OGUID+1217, 187667, 571, 1, 1, 2281.226, 5199.101, 14.57226, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4032)
+(@OGUID+1218, 187667, 571, 1, 1, 2271.331, 5194.442, 14.39653, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4032)
+(@OGUID+1219, 187667, 571, 1, 1, 2272.831, 5198.149, 14.36126, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4032)
+(@OGUID+1220, 187667, 571, 1, 1, 2789.38, 6177.33, 88.61863, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4020)
+(@OGUID+1221, 187667, 571, 1, 1, 2792.786, 6176.63, 88.45963, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4129)
+(@OGUID+1222, 187667, 571, 1, 1, 2824.468, 6139.032, 88.58996, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4129)
+(@OGUID+1223, 187667, 571, 1, 1, 2824.102, 6142.47, 88.44103, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4129)
+(@OGUID+1224, 187667, 571, 1, 1, 3570.061, 6648.111, 197.2132, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4024)
+(@OGUID+1225, 187667, 571, 1, 1, 3568.583, 6652.051, 197.2804, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4024)
+(@OGUID+1226, 187667, 571, 1, 1, 3580.081, 6671.506, 197.7762, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4024)
+(@OGUID+1227, 187667, 571, 1, 1, 3576.648, 6667.775, 197.6963, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 4024)
+(@OGUID+1228, 187667, 530, 1, 1, -4207.088, -12473.58, 46.58454, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1229, 187667, 530, 1, 1, -4216.502, -12480.64, 48.98628, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1230, 187667, 530, 1, 1, -4192.907, -12467.66, 46.6215, 5.794494, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1231, 187667, 530, 1, 1, -4212.782, -12506.34, 46.88014, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1232, 187667, 530, 1, 1, -4212.281, -12515.08, 50.44548, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1233, 187667, 530, 1, 1, -4208.398, -12519.56, 47.62306, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 0)
+(@OGUID+1234, 187667, 530, 1, 1, -4163.363, -12455.46, 47.14916, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3576)
+(@OGUID+1235, 187667, 530, 1, 1, -4160.896, -12457.07, 47.62824, 4.153885, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3576)
+(@OGUID+1236, 187667, 530, 1, 1, -4152.799, -12480.7, 45.96771, 2.844883, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3576)
+(@OGUID+1237, 187667, 530, 1, 1, -4167.781, -12537.14, 48.95461, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3576)
+(@OGUID+1238, 187667, 530, 1, 1, -4149.234, -12485.86, 50.90091, 3.859896, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3576)
+(@OGUID+1239, 187667, 530, 1, 1, -4150.61, -12525.97, 49.39287, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3576)
+(@OGUID+1240, 187667, 530, 1, 1, -4164.37, -12536.8, 48.27224, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3576)
+(@OGUID+1241, 187667, 530, 1, 1, -4144.596, -12490.33, 45.72705, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3576)
+(@OGUID+1242, 187667, 530, 1, 1, -4153.813, -12532.33, 49.37784, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3576)
+(@OGUID+1243, 187667, 530, 1, 1, -4173.694, -13729.01, 76.77699, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3526)
+(@OGUID+1244, 187667, 530, 1, 1, -4047.493, -13771.29, 76.13934, 6.19592, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3527)
+(@OGUID+1245, 187667, 530, 1, 1, -4050.141, -13778.29, 76.35183, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 187667 (Area: 3527)
+(@OGUID+1246, 181355, 530, 1, 1, -1674.443, 5406.264, -40.40601, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1247, 181355, 530, 1, 1, -1993.964, 5686.367, 117.6628, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3898)
+(@OGUID+1248, 181355, 530, 1, 1, -1990.117, 5678.112, 117.6628, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3898)
+(@OGUID+1249, 181355, 530, 1, 1, -1962.946, 5684.213, 117.6628, 2.984498, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1250, 181355, 530, 1, 1, -1974.76, 5703.745, 117.6628, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1251, 181355, 530, 1, 1, -324.4565, 5466.785, 22.66969, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3521)
+(@OGUID+1252, 181355, 530, 1, 1, -344.9888, 5492.374, 22.00702, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3521)
+(@OGUID+1253, 181355, 530, 1, 1, -306.1548, 5479.317, 22.28877, 2.35619, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3521)
+(@OGUID+1254, 181355, 530, 1, 1, -253.026, 5481.032, 24.94352, 5.480334, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3565)
+(@OGUID+1255, 181355, 530, 1, 1, -196.088, 5525.092, 22.81344, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3565)
+(@OGUID+1256, 181355, 530, 1, 1, -192.4105, 5510.174, 22.67085, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3565)
+(@OGUID+1257, 181355, 530, 1, 1, -184.6291, 5506.406, 29.47097, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3565)
+(@OGUID+1258, 181355, 530, 1, 1, -213.9051, 5547.442, 24.07233, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3565)
+(@OGUID+1259, 181355, 530, 1, 1, -192.6228, 5531.502, 29.45192, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3565)
+(@OGUID+1260, 181355, 530, 1, 1, 261.4174, 5980.111, 132.9563, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1261, 181355, 530, 1, 1, 278.5881, 5966.778, 150.1677, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1262, 181355, 530, 1, 1, 269.9623, 5956.735, 26.43292, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1263, 181355, 530, 1, 1, 272.3167, 5944.75, 26.52184, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1264, 181355, 530, 1, 1, 296.5285, 5941.624, 26.55748, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1265, 181355, 530, 1, 1, 298.2953, 5957.52, 26.42815, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1266, 181355, 530, 1, 1, 280.785, 6008.137, 144.7295, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1267, 181355, 530, 1, 1, 301.7136, 5979.073, 132.4598, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1268, 181355, 530, 1, 1, 307.1656, 6055.835, 131.5718, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3644)
+(@OGUID+1269, 181355, 530, 1, 1, 217.2829, 6078.526, 148.3125, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1270, 181355, 530, 1, 1, 208.3886, 6049.729, 148.32, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1271, 181355, 530, 1, 1, 222.1361, 6049.518, 148.3132, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1272, 181355, 530, 1, 1, 227.5588, 6070.599, 148.3118, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1273, 181355, 530, 1, 1, 275.337, 6082.517, 131.545, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1274, 181355, 530, 1, 1, 276.2028, 6122.649, 142.509, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1275, 181355, 530, 1, 1, 290.4184, 6083.181, 131.5468, 4.590216, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1276, 181355, 530, 1, 1, 261.7739, 7872.234, 23.73318, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1277, 181355, 530, 1, 1, 1003.335, 7429.998, 28.07676, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3667)
+(@OGUID+1278, 181355, 530, 1, 1, 971.3665, 7408.698, 29.54321, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1279, 181355, 530, 1, 1, 1021.34, 7392.521, 36.32355, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1280, 181355, 530, 1, 1, 1058.58, 7386.76, 39.58334, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1281, 181355, 530, 1, 1, 1052.856, 7384.014, 39.65503, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1282, 181355, 530, 1, 1, 964.8279, 7387.548, 28.52687, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1283, 181355, 530, 1, 1, 1036.931, 7385.866, 40.72616, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1284, 181355, 530, 1, 1, 937.6202, 7360.125, 26.74729, 1.378809, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1285, 181355, 530, 1, 1, 957.7293, 7355.671, 29.15186, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1286, 181355, 530, 1, 1, 945.5008, 7392.224, 26.72158, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1287, 181355, 530, 1, 1, 993.2974, 7345.906, 35.77085, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1288, 181355, 530, 1, 1, 1006.334, 7322.549, 41.04741, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1289, 181355, 530, 1, 1, 1033.736, 7322.608, 40.50263, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1290, 181355, 530, 1, 1, 1042.453, 7348.262, 36.65906, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1291, 181355, 530, 1, 1, 1068.558, 7349.528, 40.72983, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1292, 181355, 530, 1, 1, 1072.741, 7372.522, 39.58335, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1293, 181355, 530, 1, 1, 1069.436, 7366.63, 39.64074, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3766)
+(@OGUID+1294, 181355, 530, 1, 1, 2017.319, 6873.481, 178.983, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3772)
+(@OGUID+1295, 181355, 530, 1, 1, 2007.013, 6878.822, 178.9834, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3772)
+(@OGUID+1296, 181355, 530, 1, 1, 2161.682, 6783.048, 183.4536, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3772)
+(@OGUID+1297, 181355, 530, 1, 1, 2950.829, 5486.531, 144.1427, 5.497789, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3828)
+(@OGUID+1298, 181355, 530, 1, 1, 3011.185, 5493.75, 145.0009, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3951)
+(@OGUID+1299, 181355, 530, 1, 1, 2969.01, 5459.725, 144.6972, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3951)
+(@OGUID+1300, 181355, 530, 1, 1, 2087.611, 4782.989, 157.7814, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3844)
+(@OGUID+1301, 181355, 530, 1, 1, 2019.061, 4700.482, 150.2378, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3844)
+(@OGUID+1302, 181355, 530, 1, 1, 2923.397, 3708.21, 144.1105, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1303, 181355, 530, 1, 1, 2946.058, 3725.089, 143.1839, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1304, 181355, 530, 1, 1, 2914.001, 3699.492, 143.6809, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1305, 181355, 530, 1, 1, 2945.531, 3714.857, 143.1773, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1306, 181355, 530, 1, 1, 2910.409, 3676.454, 144.3202, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1307, 181355, 530, 1, 1, 2923.083, 3674.278, 144.2727, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1308, 181355, 530, 1, 1, 2984.193, 3711.066, 142.8784, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1309, 181355, 530, 1, 1, 2947.035, 3659.529, 132.5782, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1310, 181355, 530, 1, 1, 2947.682, 3649.331, 132.5782, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1311, 181355, 530, 1, 1, 2972.385, 3659.229, 144.8418, 0, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1312, 181355, 530, 1, 1, 3004.393, 3656.724, 143.8046, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1313, 181355, 530, 1, 1, 2972.166, 3648.618, 144.8469, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1314, 181355, 530, 1, 1, 3014.989, 3753.323, 144.3842, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1315, 181355, 530, 1, 1, 3003.333, 3637.782, 143.8042, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1316, 181355, 530, 1, 1, 3025.728, 3750.257, 144.7281, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1317, 181355, 530, 1, 1, 3058.527, 3663.685, 143.0369, 2.042035, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1318, 181355, 530, 1, 1, 3037.129, 3606.581, 144.4336, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1319, 181355, 530, 1, 1, 3120.857, 3684.906, 143.2626, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1320, 181355, 530, 1, 1, 3115.857, 3694.574, 144.0382, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1321, 181355, 530, 1, 1, 3105.762, 3723.047, 144.983, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1322, 181355, 530, 1, 1, 3117.033, 3727.915, 145.4815, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1323, 181355, 530, 1, 1, 3129.166, 3726.417, 141.9053, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3712)
+(@OGUID+1324, 181355, 530, 1, 1, 4114.772, 2967.272, 352.1837, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1325, 181355, 530, 1, 1, 4122.787, 2967.157, 352.2287, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1326, 181355, 530, 1, 1, 4113.936, 3050.741, 339.3003, 5.899214, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1327, 181355, 530, 1, 1, 4177.452, 3004.381, 339.1197, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1328, 181355, 530, 1, 1, 4123.493, 3055.268, 339.3098, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1329, 181355, 530, 1, 1, 4082.152, 3077.441, 339.3883, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1330, 181355, 530, 1, 1, 4178.088, 3015.381, 339.1293, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1331, 181355, 530, 1, 1, 4200.194, 3075.751, 335.8202, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1332, 181355, 530, 1, 1, 4177.695, 3093.462, 335.8202, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1333, 181355, 530, 1, 1, 4126.727, 3096.481, 339.3884, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1334, 181355, 530, 1, 1, 4099.208, 3107.681, 339.3884, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1335, 181355, 530, 1, 1, 4114.827, 3105.379, 339.3884, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1336, 181355, 530, 1, 1, 4092.646, 3104.921, 339.3883, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1337, 181355, 530, 1, 1, 4105.933, 3108.072, 339.3884, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1338, 181355, 530, 1, 1, 4083.412, 3091.455, 339.3883, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1339, 181355, 530, 1, 1, 4087.922, 3100.24, 339.3883, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3738)
+(@OGUID+1340, 181355, 530, 1, 1, 293.5556, 2757.308, 85.24716, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3549)
+(@OGUID+1341, 181355, 530, 1, 1, 177.3938, 2641.12, 87.18604, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3536)
+(@OGUID+1342, 181355, 530, 1, 1, 184.4233, 2683.703, 88.28799, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3536)
+(@OGUID+1343, 181355, 530, 1, 1, 49.26655, 2658.362, 78.4103, 0.4712385, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3536)
+(@OGUID+1344, 181355, 530, 1, 1, -684.1902, 2664.04, 90.97864, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1345, 181355, 530, 1, 1, -681.7703, 2653.848, 90.5937, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1346, 181355, 530, 1, 1, -695.8323, 2638.751, 90.97626, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1347, 181355, 530, 1, 1, -685.2488, 2644.338, 90.4667, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1348, 181355, 530, 1, 1, -708.6624, 2640.041, 91.84985, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1349, 181355, 530, 1, 1, -690.535, 2673.585, 92.20389, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3538)
+(@OGUID+1350, 181355, 530, 1, 1, -717.8087, 2647.749, 93.05632, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3538)
+(@OGUID+1351, 181355, 530, 1, 1, -702.0106, 2676.552, 93.48396, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3538)
+(@OGUID+1352, 181355, 530, 1, 1, -714.3968, 2671.541, 93.92791, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3538)
+(@OGUID+1353, 181355, 530, 1, 1, -720.9301, 2658.757, 93.7806, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3538)
+(@OGUID+1354, 181355, 530, 1, 1, -699.3879, 2717.673, 94.73693, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3538)
+(@OGUID+1355, 181355, 530, 1, 1, -597.0756, 4097.25, 91.20135, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3543)
+(@OGUID+1356, 181355, 530, 1, 1, 82.60951, 4318.784, 102.0311, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1357, 181355, 530, 1, 1, 80.49339, 4347.601, 102.071, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1358, 181355, 530, 1, 1, 136.032, 4345.664, 106.6182, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3552)
+(@OGUID+1359, 181355, 530, 1, 1, 134.9947, 4319.371, 106.7541, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3552)
+(@OGUID+1360, 181355, 530, 1, 1, 152.2135, 4318.471, 106.2541, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3552)
+(@OGUID+1361, 181355, 530, 1, 1, 140.73, 4269.448, 107.4208, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3552)
+(@OGUID+1362, 181355, 530, 1, 1, 151.8665, 4348.405, 107.2158, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3552)
+(@OGUID+1363, 181355, 530, 1, 1, 147.9486, 4275.235, 107.2797, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3552)
+(@OGUID+1364, 181355, 530, 1, 1, 181.2025, 4317.459, 119.9638, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3552)
+(@OGUID+1365, 181355, 530, 1, 1, 181.4662, 4350.056, 119.962, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3552)
+(@OGUID+1366, 181355, 530, 1, 1, 196.2876, 4328.141, 116.8841, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3552)
+(@OGUID+1367, 181355, 530, 1, 1, 196.4538, 4339.529, 116.9748, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3552)
+(@OGUID+1368, 181355, 530, 1, 1, -2993.023, 4149.779, 5.160716, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3697)
+(@OGUID+1369, 181355, 530, 1, 1, -2966.667, 4073.203, 2.960989, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1370, 181355, 530, 1, 1, -2926.811, 4019.083, 0.413682, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3684)
+(@OGUID+1371, 181355, 530, 1, 1, -2924.175, 4014.802, 0.424108, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3684)
+(@OGUID+1372, 181355, 530, 1, 1, -2904.558, 4017.979, 0.378337, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3684)
+(@OGUID+1373, 181355, 530, 1, 1, -2942.975, 3949.947, 0.906697, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1374, 181355, 530, 1, 1, -2943.432, 3903.176, 3.423485, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3684)
+(@OGUID+1375, 181355, 530, 1, 1, -2956.34, 3907.056, 3.423482, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3684)
+(@OGUID+1376, 181355, 530, 1, 1, -2975.988, 3877.033, 9.545059, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3684)
+(@OGUID+1377, 181355, 530, 1, 1, -2987.699, 3860.738, 8.660349, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3684)
+(@OGUID+1378, 181355, 530, 1, 1, -2626.202, 7216.55, 20.35766, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1379, 181355, 530, 1, 1, -2600.806, 7237.711, 12.91722, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1380, 181355, 530, 1, 1, -2596.802, 7228.939, 13.47051, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1381, 181355, 530, 1, 1, -2630.099, 7224.425, 19.74051, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1382, 181355, 530, 1, 1, -2528.435, 7266.286, 16.27025, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1383, 181355, 530, 1, 1, -2534.468, 7256.75, 16.26636, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1384, 181355, 530, 1, 1, -2605.266, 7291.263, 19.8158, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1385, 181355, 530, 1, 1, -2570.705, 7291.29, 14.81433, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1386, 181355, 530, 1, 1, -2614.92, 7297.726, 20.7448, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1387, 181355, 530, 1, 1, -2602.271, 7282.346, 19.39945, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1388, 181355, 530, 1, 1, -2670.031, 7211.863, 23.66941, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1389, 181355, 530, 1, 1, -2678.989, 7214.03, 23.95701, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1390, 181355, 530, 1, 1, -2573.72, 7300.305, 13.90452, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1391, 181355, 530, 1, 1, -2625.71, 7298.209, 21.14083, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1392, 181355, 530, 1, 1, -2702.841, 7293.721, 88.63655, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1393, 181355, 530, 1, 1, -2692.656, 7296.979, 42.78501, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1394, 181355, 530, 1, 1, -2697.95, 7284.061, 42.72089, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1395, 181355, 530, 1, 1, -2762.166, 7267.401, 40.26734, 5.724681, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1396, 181355, 530, 1, 1, -2755.534, 7275.691, 40.27126, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1397, 181355, 530, 1, 1, -2752.121, 7315.08, 43.48479, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1398, 181355, 530, 1, 1, -2755.324, 7317.081, 56.35859, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1399, 181355, 530, 1, 1, -2721.762, 7343.454, 39.44633, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1400, 181355, 530, 1, 1, -2720.994, 7355.896, 39.75894, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1401, 181355, 530, 1, 1, -2614.572, 7330.876, 24.21089, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1402, 181355, 530, 1, 1, -2624.408, 7331.686, 24.46344, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1403, 181355, 530, 1, 1, -2618.061, 7338.908, 23.65936, 4.956738, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1404, 181355, 530, 1, 1, -2611.334, 7343.457, 23.60636, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1405, 181355, 530, 1, 1, -2561.666, 7378.96, 10.5709, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1406, 181355, 530, 1, 1, -2571.461, 7378.03, 11.05957, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3626)
+(@OGUID+1407, 181355, 530, 1, 1, -2505.922, 7527.336, 0.043322, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3705)
+(@OGUID+1408, 181355, 530, 1, 1, -2511.847, 7563.294, -1.760557, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1409, 181355, 530, 1, 1, -2497.057, 7536.151, -0.614676, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1410, 181355, 530, 1, 1, -1307.797, 6960.474, 32.26982, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3613)
+(@OGUID+1411, 181355, 530, 1, 1, -1254.381, 7007.266, 36.623, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3613)
+(@OGUID+1412, 181355, 530, 1, 1, -1241.754, 7003.594, 36.79386, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3613)
+(@OGUID+1413, 181355, 530, 1, 1, -1296.558, 6953.973, 33.24513, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3613)
+(@OGUID+1414, 181355, 530, 1, 1, -1184.679, 7246.92, 35.14313, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3613)
+(@OGUID+1415, 181355, 530, 1, 1, 201.9845, 8489.734, 24.44587, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1416, 181355, 530, 1, 1, 253.3038, 8489.067, 23.37944, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1417, 181355, 530, 1, 1, 265.287, 8514.346, 23.52993, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1418, 181355, 530, 1, 1, 223.5183, 8562.453, 23.26412, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1419, 181355, 530, 1, 1, -3031.269, 2631.006, 76.54335, 4.485497, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1420, 181355, 530, 1, 1, -3081.042, 2598.579, 61.74963, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1421, 181355, 530, 1, 1, -3104.677, 2582.695, 61.977, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1422, 181355, 530, 1, 1, -3107.003, 2545.114, 62.05597, 1.029743, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1423, 181355, 530, 1, 1, -3065.579, 2555.547, 65.75816, 3.752462, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1424, 181355, 530, 1, 1, -2970.731, 2573.003, 76.54335, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1425, 181355, 530, 1, 1, -3006.598, 2549.313, 78.11643, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1426, 181355, 530, 1, 1, -2979.335, 2554.049, 76.54335, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1427, 181355, 530, 1, 1, -2986.574, 2565.178, 76.54335, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1428, 181355, 530, 1, 1, -2956.544, 2554.592, 126.6191, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1429, 181355, 530, 1, 1, -3052.811, 2481.651, 66.65688, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1430, 181355, 530, 1, 1, -2921.617, 2644.625, 94.40192, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1431, 181355, 530, 1, 1, -3073.645, 2392.152, 62.55545, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1432, 181355, 530, 1, 1, -3050.082, 2384.462, 62.71082, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1433, 181355, 530, 1, 1, -3060.834, 2401.809, 61.1662, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3744)
+(@OGUID+1434, 181355, 530, 1, 1, -3930.809, 2115.148, 96.81004, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1435, 181355, 530, 1, 1, -3937.474, 2043.296, 95.10289, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1436, 181355, 530, 1, 1, -3936.5, 2054.585, 95.0647, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1437, 181355, 530, 1, 1, -3947.098, 2032.833, 96.91352, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1438, 181355, 530, 1, 1, -3959.747, 2043.662, 95.06471, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1439, 181355, 530, 1, 1, -3981.395, 2150.587, 105.0282, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1440, 181355, 530, 1, 1, -3948.719, 2165.375, 100.8409, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1441, 181355, 530, 1, 1, -3966.465, 2185.426, 101.8951, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1442, 181355, 530, 1, 1, -4008.345, 2172.325, 105.0965, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1443, 181355, 530, 1, 1, -3984.704, 2162.162, 105.4418, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1444, 181355, 530, 1, 1, -4026.63, 2188.58, 109.1173, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1445, 181355, 530, 1, 1, -4062.359, 2190.83, 109.8543, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1446, 181355, 530, 1, 1, -4047.156, 2228.053, 112.0462, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1447, 181355, 530, 1, 1, -4035.944, 2238.973, 112.2723, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3745)
+(@OGUID+1448, 181355, 530, 1, 1, -4130.572, 1173.389, 49.58154, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3938)
+(@OGUID+1449, 181355, 530, 1, 1, -4084.195, 1138.926, 44.43298, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3938)
+(@OGUID+1450, 181355, 530, 1, 1, -4062.444, 1135.474, 43.18277, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3938)
+(@OGUID+1451, 181355, 530, 1, 1, -4088.488, 1139.846, 44.42666, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3938)
+(@OGUID+1452, 181355, 530, 1, 1, -4065.08, 1138.295, 43.1756, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3938)
+(@OGUID+1453, 181355, 530, 1, 1, -4135.374, 1128.675, 54.58289, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3938)
+(@OGUID+1454, 181355, 530, 1, 1, -4114.819, 1116.677, 44.53127, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3938)
+(@OGUID+1455, 181355, 530, 1, 1, -4112.096, 1121.578, 44.54679, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3938)
+(@OGUID+1456, 181355, 530, 1, 1, -3079.415, 748.1234, -10.33996, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1457, 181355, 530, 1, 1, -3089.802, 837.7723, -19.92381, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1458, 181355, 530, 1, 1, -3055.614, 812.4755, -9.506436, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1459, 181355, 530, 1, 1, -3010.563, 770.086, -6.933084, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1460, 181355, 530, 1, 1, -3080.772, 825.7006, -11.35703, 1.029743, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1461, 181355, 530, 1, 1, -3040.775, 806.6836, -9.706291, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1462, 181355, 530, 1, 1, -3016.658, 795.0476, -9.916844, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1463, 181355, 530, 1, 1, -3009.987, 803.8392, -10.3957, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1464, 181355, 530, 1, 1, -3028.215, 823.3273, -9.546359, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1465, 181355, 530, 1, 1, -3041.075, 832.1203, -9.484895, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1466, 181355, 530, 1, 1, -2983.705, 809.1548, -6.9079, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1467, 181355, 530, 1, 1, -3007.626, 853.5888, -10.48604, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1468, 181355, 530, 1, 1, -3012.275, 861.4301, -10.48986, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1469, 181355, 530, 1, 1, -2983.507, 869.4686, -7.479865, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1470, 181355, 530, 1, 1, -3061.827, 853.1981, -11.37245, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1471, 181355, 530, 1, 1, -3075.424, 858.7751, -20.02081, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3754)
+(@OGUID+1472, 181355, 571, 1, 1, 5797.108, 551.8475, 661.095, 0.5759573, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1473, 181355, 571, 1, 1, 5843.04, 581.1298, 651.76, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1474, 181355, 571, 1, 1, 5803.461, 547.2244, 660.9998, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1475, 181355, 571, 1, 1, 5763.885, 572.2188, 649.8002, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1476, 181355, 571, 1, 1, 5864.823, 610.4653, 650.7043, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1477, 181355, 571, 1, 1, 5745.615, 586.7101, 649.3102, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1478, 181355, 571, 1, 1, 5839.251, 641.2769, 647.5121, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1479, 181355, 571, 1, 1, 5789.479, 641.6511, 647.4436, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1480, 181355, 571, 1, 1, 5761.894, 592.8934, 613.7905, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1481, 181355, 571, 1, 1, 5807.717, 654.8577, 647.4246, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1482, 181355, 571, 1, 1, 5846.925, 644.6152, 658.404, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1483, 181355, 571, 1, 1, 5825.186, 655.9732, 647.5557, 4.223697, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1484, 181355, 571, 1, 1, 5776.402, 530.3011, 641.5594, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1485, 181355, 571, 1, 1, 5748.025, 626.0618, 660.9924, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1486, 181355, 571, 1, 1, 5845.924, 652.1758, 658.404, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1487, 181355, 571, 1, 1, 5743.978, 624.6772, 648.4809, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1488, 181355, 571, 1, 1, 5735.165, 606.0434, 647.9391, 1.518436, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1489, 181355, 571, 1, 1, 5746.787, 636.5056, 660.9924, 5.916668, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1490, 181355, 571, 1, 1, 5833.373, 645.4617, 609.1575, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1491, 181355, 571, 1, 1, 5840.909, 508.295, 657.4862, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1492, 181355, 571, 1, 1, 5822.227, 502.8376, 657.378, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1493, 181355, 571, 1, 1, 5898.554, 629.4965, 646.7423, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4395)
+(@OGUID+1494, 181355, 571, 1, 1, 5805.41, 708.4702, 641.4802, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1495, 181355, 571, 1, 1, 5796.696, 707.4605, 641.7041, 1.762782, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1496, 181355, 571, 1, 1, 5751.683, 681.7147, 613.2468, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1497, 181355, 571, 1, 1, 5867.476, 689.2825, 643.1117, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1498, 181355, 571, 1, 1, 5750.272, 691.2866, 618.5539, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1499, 181355, 571, 1, 1, 5845.667, 696.0077, 610.6929, 4.153885, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1500, 181355, 571, 1, 1, 5826.764, 723.2586, 641.2166, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1501, 181355, 571, 1, 1, 5734.079, 690.025, 646.5366, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1502, 181355, 571, 1, 1, 5773.907, 718.0335, 618.5657, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1503, 181355, 571, 1, 1, 5904.524, 663.1807, 643.8438, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1504, 181355, 571, 1, 1, 5756.162, 712.4989, 618.5643, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1505, 181355, 571, 1, 1, 5771.891, 737.5848, 641.4211, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4739)
+(@OGUID+1506, 181355, 571, 1, 1, 5823.329, 760.0555, 640.327, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4613)
+(@OGUID+1507, 181355, 571, 1, 1, 5914.837, 700.7205, 641.8951, 2.879789, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4613)
+(@OGUID+1508, 181355, 571, 1, 1, 5892.815, 743.408, 639.8414, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4613)
+(@OGUID+1509, 181355, 571, 1, 1, 5929.599, 639.7736, 645.5601, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1510, 181355, 571, 1, 1, 5943.547, 636.654, 652.9702, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1511, 181355, 571, 1, 1, 5921.778, 619.2034, 645.9958, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1512, 181355, 571, 1, 1, 5944.347, 617.7059, 650.5828, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1513, 181355, 571, 1, 1, 5958.763, 626.1614, 650.6269, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1514, 181355, 571, 1, 1, 5934.438, 611.9415, 652.9656, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1515, 181355, 571, 1, 1, 5953.268, 610.4814, 650.6269, 5.951575, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1516, 181355, 571, 1, 1, 5947.679, 626.1014, 650.5775, 3.438303, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1517, 181355, 571, 1, 1, 5803.736, 772.4315, 661.2783, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1518, 181355, 571, 1, 1, 5787.012, 774.6193, 661.2783, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1519, 181355, 571, 1, 1, 5808.237, 791.7759, 632.587, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4620)
+(@OGUID+1520, 181355, 571, 1, 1, 5988.101, 621.1797, 650.6269, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4618)
+(@OGUID+1521, 181355, 571, 1, 1, 5978.208, 595.1833, 650.6149, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4618)
+(@OGUID+1522, 181355, 571, 1, 1, 5886.956, 526.6721, 642.1017, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4613)
+(@OGUID+1523, 181355, 571, 1, 1, 5890.065, 519.4915, 641.9147, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4613)
+(@OGUID+1524, 181355, 571, 1, 1, 5882.65, 517.4098, 641.9064, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4613)
+(@OGUID+1525, 181355, 571, 1, 1, 5845.724, 435.9962, 657.6264, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4616)
+(@OGUID+1526, 181355, 571, 1, 1, 5788.177, 425.141, 657.5775, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4616)
+(@OGUID+1527, 181355, 571, 1, 1, 5694.438, 614.2162, 646.6755, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4567)
+(@OGUID+1528, 181355, 571, 1, 1, 5676.881, 659.645, 647.1504, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1529, 181355, 571, 1, 1, 5663.002, 663.5723, 654.331, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1530, 181355, 571, 1, 1, 5659.298, 673.91, 651.942, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1531, 181355, 571, 1, 1, 5663.514, 682.673, 651.9452, 4.991644, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1532, 181355, 571, 1, 1, 5673.695, 687.83, 654.3299, 4.834563, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1533, 181355, 571, 1, 1, 5685.707, 679.8306, 646.3728, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1534, 181355, 571, 1, 1, 5648.303, 675.3729, 651.9927, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1535, 181355, 571, 1, 1, 5654.433, 690.0082, 651.9927, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1536, 181355, 571, 1, 1, 5668.66, 718.72, 653.374, 0.3665176, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1537, 181355, 571, 1, 1, 5620.479, 681.7556, 651.9917, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1538, 181355, 571, 1, 1, 5716.991, 723.6447, 641.6827, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1539, 181355, 571, 1, 1, 5630.848, 705.8953, 651.9803, 5.096362, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1540, 181355, 571, 1, 1, 5710.433, 728.6938, 641.7766, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1541, 181355, 571, 1, 1, 5677.676, 730.4684, 653.3763, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1542, 181355, 571, 1, 1, 5704.065, 734.105, 641.7964, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1543, 181355, 571, 1, 1, 5739.42, 737.81, 656.8243, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1544, 181355, 571, 1, 1, 5642.215, 754.7111, 641.5667, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1545, 181355, 571, 1, 1, 5740.807, 738.6092, 641.7399, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4568)
+(@OGUID+1546, 181355, 571, 1, 1, 5604.811, -585.7176, 190.7496, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1547, 181355, 571, 1, 1, 5584.251, -629.2432, 200.8343, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1548, 181355, 571, 1, 1, 5599.725, -657.509, 206.5477, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1549, 181355, 571, 1, 1, 5625.548, -686.5305, 206.7068, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4558)
+(@OGUID+1550, 181355, 571, 1, 1, 5580.268, -697.3196, 206.5641, 0.2443456, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4558)
+(@OGUID+1551, 181355, 571, 1, 1, 5589.943, -703.3426, 206.5078, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4558)
+(@OGUID+1552, 181355, 571, 1, 1, 5586.114, -689.245, 206.4881, 5.166176, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4558)
+(@OGUID+1553, 181355, 571, 1, 1, 5606.221, -679.8115, 206.6132, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4558)
+(@OGUID+1554, 181355, 571, 1, 1, 5588.058, -679.0422, 206.6395, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4558)
+(@OGUID+1555, 181355, 571, 1, 1, 5625.443, -713.1502, 206.2666, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4558)
+(@OGUID+1556, 181355, 571, 1, 1, 5607.554, -712.7868, 206.22, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4558)
+(@OGUID+1557, 181355, 571, 1, 1, 5536.639, -725.7694, 149.5032, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4558)
+(@OGUID+1558, 181355, 571, 1, 1, 5138.901, -690.0164, 170.9514, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1559, 181355, 571, 1, 1, 5073.382, -609.6163, 219.526, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1560, 181355, 571, 1, 1, 5075.984, -598.5662, 219.9713, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1561, 181355, 571, 1, 1, 5136.48, -723.6473, 172.1055, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1562, 181355, 571, 1, 1, 5053.332, -577.4028, 219.9713, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1563, 181355, 571, 1, 1, 5071.924, -583.3045, 219.9861, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1564, 181355, 571, 1, 1, 5054.523, -617.343, 219.3136, 0.6981314, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1565, 181355, 571, 1, 1, 5051.946, -596.0672, 220.2646, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4557)
+(@OGUID+1566, 181355, 571, 1, 1, 5059.967, -556.7086, 220.0492, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4559)
+(@OGUID+1567, 181355, 571, 1, 1, 5074.282, -550.5836, 219.9259, 3.438303, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4559)
+(@OGUID+1568, 181355, 571, 1, 1, 5046.622, -548.3624, 222.002, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4559)
+(@OGUID+1569, 181355, 571, 1, 1, 5027.92, -522.6423, 226.9366, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4559)
+(@OGUID+1570, 181355, 571, 1, 1, 5035.096, -526.5712, 225.6855, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4559)
+(@OGUID+1571, 181355, 571, 1, 1, 5034.275, -512.3834, 225.9249, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4559)
+(@OGUID+1572, 181355, 571, 1, 1, 5048.662, -524.6389, 220.05, 5.899214, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4559)
+(@OGUID+1573, 181355, 571, 1, 1, 5235.554, -1320.319, 242.1471, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 66)
+(@OGUID+1574, 181355, 571, 1, 1, 5233.944, -1309.333, 242.7248, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 66)
+(@OGUID+1575, 181355, 571, 1, 1, 5228.022, -1298.785, 242.8026, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 66)
+(@OGUID+1576, 181355, 571, 1, 1, 5221.921, -1337.251, 241.8586, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 66)
+(@OGUID+1577, 181355, 571, 1, 1, 5209.904, -1336.67, 242.6071, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 66)
+(@OGUID+1578, 181355, 571, 1, 1, 5197.744, -1301.545, 244.1698, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4312)
+(@OGUID+1579, 181355, 571, 1, 1, 5135.955, -2183.239, 236.8366, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1580, 181355, 571, 1, 1, 5174.28, -2190.904, 236.5399, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1581, 181355, 571, 1, 1, 5170.655, -2175.094, 236.524, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1582, 181355, 571, 1, 1, 5135.756, -2204.338, 236.5436, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1583, 181355, 571, 1, 1, 5196.799, -2208.144, 239.3988, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4317)
+(@OGUID+1584, 181355, 571, 1, 1, 5153.606, -2216.569, 236.805, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4317)
+(@OGUID+1585, 181355, 571, 1, 1, 5190.787, -2215.081, 239.3982, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4317)
+(@OGUID+1586, 181355, 571, 1, 1, 5406.375, -2612.042, 303.9539, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1587, 181355, 571, 1, 1, 5436.389, -2618.382, 306.5511, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1588, 181355, 571, 1, 1, 5464.559, -2619.046, 306.5511, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1589, 181355, 571, 1, 1, 5382.32, -2632.782, 303.9539, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1590, 181355, 571, 1, 1, 5408.356, -2679.761, 303.9539, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1591, 181355, 571, 1, 1, 5302.596, -2755.095, 292.2518, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1592, 181355, 571, 1, 1, 5500.086, -2657.195, 303.9539, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1593, 181355, 571, 1, 1, 5526.226, -2674.84, 303.9539, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1594, 181355, 571, 1, 1, 5528.214, -2651.125, 303.9539, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1595, 181355, 571, 1, 1, 5527.774, -2637.863, 303.9539, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1596, 181355, 571, 1, 1, 5606.558, -2623.187, 292.2171, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1597, 181355, 571, 1, 1, 5615.992, -2629.843, 293.4687, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1598, 181355, 571, 1, 1, 5636.928, -2630.586, 293.3238, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4275)
+(@OGUID+1599, 181355, 571, 1, 1, 5648.471, -2623.089, 292.4185, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1600, 181355, 571, 1, 1, 5268.589, -2787.73, 292.4185, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1601, 181355, 571, 1, 1, 5282.011, -2787.762, 293.2, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1602, 181355, 571, 1, 1, 5764.8, -3532.155, 388.3556, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1603, 181355, 571, 1, 1, 5750.8, -3535.454, 389.0267, 5.532695, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1604, 181355, 571, 1, 1, 5790.555, -3548.062, 387.1112, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4323)
+(@OGUID+1605, 181355, 571, 1, 1, 5758.551, -3620.203, 385.8352, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4323)
+(@OGUID+1606, 181355, 571, 1, 1, 5783.694, -3600.81, 387.7156, 2.35619, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4323)
+(@OGUID+1607, 181355, 571, 1, 1, 5789.338, -3595.79, 388.8241, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4323)
+(@OGUID+1608, 181355, 571, 1, 1, 5774.17, -3614.33, 387.6901, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4323)
+(@OGUID+1609, 181355, 571, 1, 1, 5794.01, -3586.305, 388.6537, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4323)
+(@OGUID+1610, 181355, 571, 1, 1, 6087.308, -1119.368, 420.1114, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4418)
+(@OGUID+1611, 181355, 571, 1, 1, 6132.971, -1080.292, 402.5479, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4418)
+(@OGUID+1612, 181355, 571, 1, 1, 6075.46, -1113.703, 420.0166, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4418)
+(@OGUID+1613, 181355, 571, 1, 1, 6143.565, -1062.889, 402.4637, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4418)
+(@OGUID+1614, 181355, 571, 1, 1, 6128.463, -1071.167, 402.915, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4418)
+(@OGUID+1615, 181355, 571, 1, 1, 6181.414, -1060.371, 410.6938, 1.343901, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4418)
+(@OGUID+1616, 181355, 571, 1, 1, 6195.851, -1050.231, 410.5798, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4418)
+(@OGUID+1617, 181355, 571, 1, 1, 6105.885, -1064.441, 403.3065, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4418)
+(@OGUID+1618, 181355, 571, 1, 1, 6104.259, -1076.63, 403.506, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4418)
+(@OGUID+1619, 181355, 571, 1, 1, 6158.618, -1034.013, 409.6059, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4418)
+(@OGUID+1620, 181355, 571, 1, 1, 7879.499, -759.5701, 1175.366, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4429)
+(@OGUID+1621, 181355, 571, 1, 1, 7856.442, -742.1389, 1177.688, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4429)
+(@OGUID+1622, 181355, 571, 1, 1, 7850.471, -793.3299, 1183.955, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4429)
+(@OGUID+1623, 181355, 571, 1, 1, 8436.615, -338.5281, 906.6075, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1624, 181355, 571, 1, 1, 8471.394, -348.3333, 906.9317, 1.815142, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1625, 181355, 571, 1, 1, 8442.052, -343.1962, 906.6075, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1626, 181355, 571, 1, 1, 8477.151, -325.8229, 905.8746, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1627, 181355, 571, 1, 1, 8856.849, -1321.51, 1033.438, 6.021387, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4445)
+(@OGUID+1628, 181355, 571, 1, 1, 8894.639, -1370.033, 1033.83, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4445)
+(@OGUID+1629, 181355, 571, 1, 1, 8861.067, -1331.563, 1032.665, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4445)
+(@OGUID+1630, 181355, 571, 1, 1, 8875.349, -1375.627, 1034.185, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4445)
+(@OGUID+1631, 181355, 571, 1, 1, 7816.585, -2769.492, 1188.78, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4463)
+(@OGUID+1632, 181355, 571, 1, 1, 7791.917, -2804.668, 1216.788, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4441)
+(@OGUID+1633, 181355, 571, 1, 1, 7776.338, -2838.651, 1217.121, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4441)
+(@OGUID+1634, 181355, 571, 1, 1, 7825.241, -2903.613, 1240.885, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4441)
+(@OGUID+1635, 181355, 571, 1, 1, 7794.875, -2944.564, 1257.248, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4441)
+(@OGUID+1636, 181355, 571, 1, 1, 7819.583, -2965.007, 1257.747, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4441)
+(@OGUID+1637, 181355, 571, 1, 1, 7784.97, -2964.539, 1259, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4441)
+(@OGUID+1638, 181355, 571, 1, 1, 7807.439, -2977.434, 1258.977, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4441)
+(@OGUID+1639, 181355, 571, 1, 1, 4604.299, -4216.11, 178.7165, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1640, 181355, 571, 1, 1, 4585.377, -4225.431, 178.0588, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1641, 181355, 571, 1, 1, 4578.913, -4263.682, 182.0264, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1642, 181355, 571, 1, 1, 4574.175, -4252.902, 182.2079, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1643, 181355, 571, 1, 1, 4554.03, -4232.887, 170.6884, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1644, 181355, 571, 1, 1, 4549.178, -4253.708, 170.7494, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1645, 181355, 571, 1, 1, 4550.191, -4182.836, 173.4989, 1.518436, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1646, 181355, 571, 1, 1, 4544.073, -4208.386, 170.6733, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1647, 181355, 571, 1, 1, 4531.979, -4176.561, 173.4836, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4159)
+(@OGUID+1648, 181355, 571, 1, 1, 3854.53, -4499.983, 208.0386, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4205)
+(@OGUID+1649, 181355, 571, 1, 1, 3883.566, -4522.057, 217.378, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4205)
+(@OGUID+1650, 181355, 571, 1, 1, 3848.002, -4506.846, 207.7856, 1.867502, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4205)
+(@OGUID+1651, 181355, 571, 1, 1, 3844.868, -4517.594, 210.5048, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1652, 181355, 571, 1, 1, 3866.024, -4531.325, 209.7259, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1653, 181355, 571, 1, 1, 3835.15, -4527.149, 210.6371, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1654, 181355, 571, 1, 1, 3847.246, -4556.365, 210.1268, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1655, 181355, 571, 1, 1, 3871.145, -4567.245, 207.5447, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1656, 181355, 571, 1, 1, 3415.254, -2872.224, 200.8262, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1657, 181355, 571, 1, 1, 3413.37, -2812.231, 200.4576, 5.078908, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1658, 181355, 571, 1, 1, 3399.997, -2879.164, 201.2327, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1659, 181355, 571, 1, 1, 3432.563, -2829.036, 201.7036, 1.97222, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1660, 181355, 571, 1, 1, 3414.616, -2778.184, 201.5204, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4204)
+(@OGUID+1661, 181355, 571, 1, 1, 3428.656, -2766.984, 200.3678, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4204)
+(@OGUID+1662, 181355, 571, 1, 1, 3441.72, -2747.261, 199.3887, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4204)
+(@OGUID+1663, 181355, 571, 1, 1, 3457.128, -2785.357, 201.2523, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4204)
+(@OGUID+1664, 181355, 571, 1, 1, 3452.198, -2755.466, 199.3946, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4204)
+(@OGUID+1665, 181355, 571, 1, 1, 3302.054, -2350.771, 108.8892, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4217)
+(@OGUID+1666, 181355, 571, 1, 1, 3316.353, -2328.825, 111.0914, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1667, 181355, 571, 1, 1, 3225.829, -2298.399, 107.2934, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4206)
+(@OGUID+1668, 181355, 571, 1, 1, 3267.523, -2271.925, 114.2197, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4248)
+(@OGUID+1669, 181355, 571, 1, 1, 3237.112, -2271.502, 113.9172, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4248)
+(@OGUID+1670, 181355, 571, 1, 1, 3323.304, -2296.872, 110.1093, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4248)
+(@OGUID+1671, 181355, 571, 1, 1, 3183.712, -2235.236, 114.8628, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4248)
+(@OGUID+1672, 181355, 571, 1, 1, 3184.458, -2253.973, 114.8628, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4248)
+(@OGUID+1673, 181355, 571, 1, 1, 3294.673, -2261.47, 111.9283, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4248)
+(@OGUID+1674, 181355, 571, 1, 1, 3248.892, -2223.04, 116.8297, 4.799657, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4248)
+(@OGUID+1675, 181355, 571, 1, 1, 3268.585, -2230.661, 116.8297, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4248)
+(@OGUID+1676, 181355, 571, 1, 1, 3308.395, -2221.642, 115.808, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4206)
+(@OGUID+1677, 181355, 571, 1, 1, 3352.523, -2221.079, 119.4523, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4206)
+(@OGUID+1678, 181355, 571, 1, 1, 3286.429, -2201.523, 117.3726, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4206)
+(@OGUID+1679, 181355, 571, 1, 1, 3344.212, -2203.41, 119.4523, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4206)
+(@OGUID+1680, 181355, 571, 1, 1, 3364.74, -2139.107, 124.0401, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4206)
+(@OGUID+1681, 181355, 571, 1, 1, 3097.866, -2272.845, 96.25359, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4206)
+(@OGUID+1682, 181355, 571, 1, 1, 3093.765, -2252.836, 97.05368, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4206)
+(@OGUID+1683, 181355, 571, 1, 1, 3363.374, -2105.042, 123.5086, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1684, 181355, 571, 1, 1, 3377.798, -2136.68, 124.9248, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1685, 181355, 571, 1, 1, 2538.165, -1999.59, 8.439572, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1686, 181355, 571, 1, 1, 2549.787, -1992.145, 8.439572, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1687, 181355, 571, 1, 1, 2503.962, -1936.449, 10.39561, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1688, 181355, 571, 1, 1, 2493.727, -1921.882, 10.72953, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1689, 181355, 571, 1, 1, 2553.7, -1912.366, 2.313859, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1690, 181355, 571, 1, 1, 2554.446, -1931.769, 3.000129, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1691, 181355, 571, 1, 1, 2546.487, -1837.444, 10.57294, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1692, 181355, 571, 1, 1, 2559.23, -1828.403, 10.51216, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1693, 181355, 571, 1, 1, 2600.053, -1802.445, 10.64246, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1694, 181355, 571, 1, 1, 2595.78, -1789.134, 10.64246, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1695, 181355, 571, 1, 1, 2491.829, -1845.16, 10.7064, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1696, 181355, 571, 1, 1, 2497.92, -1838.303, 10.55219, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1697, 181355, 571, 1, 1, 2485.413, -1882.31, 9.955285, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1698, 181355, 571, 1, 1, 2485.737, -1895.543, 10.02251, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1699, 181355, 571, 1, 1, 2444.651, -1838.691, 1.022343, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1700, 181355, 571, 1, 1, 2438.875, -1853.441, 1.204814, 0.2443456, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4242)
+(@OGUID+1701, 181355, 571, 1, 1, 2109.816, -2988.45, 148.3804, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4070)
+(@OGUID+1702, 181355, 571, 1, 1, 2117.118, -2965.382, 148.6169, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4070)
+(@OGUID+1703, 181355, 571, 1, 1, 2140.401, -2968.399, 148.3356, 4.433136, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1704, 181355, 571, 1, 1, 2142.096, -2984.892, 148.9165, 1.937312, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1705, 181355, 571, 1, 1, 1435.889, -3265.063, 178.2813, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4071)
+(@OGUID+1706, 181355, 571, 1, 1, 1428.256, -3256.8, 165.615, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4071)
+(@OGUID+1707, 181355, 571, 1, 1, 1401.351, -3262.329, 163.0069, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4071)
+(@OGUID+1708, 181355, 571, 1, 1, 1458.753, -3200.1, 165.5917, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4071)
+(@OGUID+1709, 181355, 571, 1, 1, 1408.13, -3251.247, 162.0143, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4071)
+(@OGUID+1710, 181355, 571, 1, 1, 1394.399, -3307.07, 166.7923, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1711, 181355, 571, 1, 1, 1349.468, -3297.907, 174.7129, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1712, 181355, 571, 1, 1, 1352.596, -3284.401, 174.7101, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1713, 181355, 571, 1, 1, 1370.036, -3334.958, 173.685, 4.852017, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1714, 181355, 571, 1, 1, 1341.442, -3276.221, 174.6177, 4.537859, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1715, 181355, 571, 1, 1, 1400.156, -3458.59, 174.5718, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1716, 181355, 571, 1, 1, 1351.665, -3457.366, 175.9246, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1717, 181355, 571, 1, 1, 1355.771, -3193.905, 162.8225, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1718, 181355, 571, 1, 1, 1371.299, -3185.653, 162.8225, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1719, 181355, 571, 1, 1, 1416.06, -3120.286, 167.5702, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1720, 181355, 571, 1, 1, 1429.037, -3131.07, 167.7346, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1721, 181355, 571, 1, 1, 1389.093, -3096.109, 167.4995, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1722, 181355, 571, 1, 1, 1431.132, -3152.292, 164.8159, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3998)
+(@OGUID+1723, 181355, 571, 1, 1, 811.6979, -2925.72, 7.491168, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1724, 181355, 571, 1, 1, 784.9827, -2956.3, 8.627842, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1725, 181355, 571, 1, 1, 765.1684, -2962.793, 9.955372, 6.021387, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1726, 181355, 571, 1, 1, 807.6268, -2945.674, 6.90544, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1727, 181355, 571, 1, 1, 731.5729, -2945.844, 9.658432, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1728, 181355, 571, 1, 1, 728.2534, -2936.78, 8.08532, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1729, 181355, 571, 1, 1, 738.8159, -2917.706, 7.83575, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1730, 181355, 571, 1, 1, 708.9809, -2939.207, -3.255977, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1731, 181355, 571, 1, 1, 726.3077, -2921.696, 7.548036, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1732, 181355, 571, 1, 1, 706.6024, -2924.741, -3.165701, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1733, 181355, 571, 1, 1, 733.0174, -2896.646, 7.161568, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1734, 181355, 571, 1, 1, 786.5696, -2895.316, 7.331877, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3987)
+(@OGUID+1735, 181355, 571, 1, 1, 785.8663, -2882.146, 4.527083, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3988)
+(@OGUID+1736, 181355, 571, 1, 1, 775.6638, -2854.298, 4.683801, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3988)
+(@OGUID+1737, 181355, 571, 1, 1, 785.3965, -2856.019, 4.484005, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3988)
+(@OGUID+1738, 181355, 571, 1, 1, 434.1599, -4539.468, 245.8032, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3991)
+(@OGUID+1739, 181355, 571, 1, 1, 404.2422, -4538.7, 245.8211, 3.769912, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3991)
+(@OGUID+1740, 181355, 571, 1, 1, 400.0066, -4535.086, 246.1532, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3991)
+(@OGUID+1741, 181355, 571, 1, 1, 446.3067, -4559.884, 245.5032, 4.363324, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3991)
+(@OGUID+1742, 181355, 571, 1, 1, 493.6993, -4605.006, 243.6478, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3991)
+(@OGUID+1743, 181355, 571, 1, 1, 403.795, -4652.395, 243.9677, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3991)
+(@OGUID+1744, 181355, 571, 1, 1, 412.7631, -4658.49, 246.6353, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3991)
+(@OGUID+1745, 181355, 571, 1, 1, 641.0491, -5019.355, 4.459393, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3981)
+(@OGUID+1746, 181355, 571, 1, 1, 563.828, -5017.783, 11.59005, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3981)
+(@OGUID+1747, 181355, 571, 1, 1, 569.194, -5003.27, 11.0998, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3981)
+(@OGUID+1748, 181355, 571, 1, 1, 604.1622, -5108.14, 4.842274, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3981)
+(@OGUID+1749, 181355, 571, 1, 1, 575.377, -5101.069, 5.191134, 0.6981314, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3981)
+(@OGUID+1750, 181355, 571, 1, 1, 577.2066, -4954.415, 18.2157, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3981)
+(@OGUID+1751, 181355, 571, 1, 1, 584.0461, -4934.744, 29.65519, 1.029743, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3981)
+(@OGUID+1752, 181355, 571, 1, 1, 569.7136, -4931.643, 17.79272, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3981)
+(@OGUID+1753, 181355, 571, 1, 1, 540.1192, -4999.92, 10.53384, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3981)
+(@OGUID+1754, 181355, 571, 1, 1, 1882.581, -6170.531, 23.82956, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4000)
+(@OGUID+1755, 181355, 571, 1, 1, 1899.31, -6178.332, 24.02914, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4000)
+(@OGUID+1756, 181355, 571, 1, 1, 1919.915, -6182.599, 24.47692, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4000)
+(@OGUID+1757, 181355, 571, 1, 1, 1927.329, -6186.836, 24.11248, 1.727875, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4000)
+(@OGUID+1758, 181355, 571, 1, 1, 2021.995, -6214.678, 7.750907, 2.094393, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4000)
+(@OGUID+1759, 181355, 571, 1, 1, 2429.503, -5159.25, 277.0016, 5.061456, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4055)
+(@OGUID+1760, 181355, 571, 1, 1, 2429.847, -5168.776, 277.1109, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4055)
+(@OGUID+1761, 181355, 571, 1, 1, 2438.945, -5120.976, 275.9086, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4003)
+(@OGUID+1762, 181355, 571, 1, 1, 2417.962, -5122.142, 276.594, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4003)
+(@OGUID+1763, 181355, 571, 1, 1, 2422.845, -5074.851, 272.2427, 0, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4003)
+(@OGUID+1764, 181355, 571, 1, 1, 2476.26, -5072.812, 283.0372, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4003)
+(@OGUID+1765, 181355, 571, 1, 1, 2464.117, -5036.913, 283.7561, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4003)
+(@OGUID+1766, 181355, 571, 1, 1, 2462.827, -5023.975, 283.7139, 5.410522, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4003)
+(@OGUID+1767, 181355, 571, 1, 1, 2451.606, -4908.155, 263.5596, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4003)
+(@OGUID+1768, 181355, 571, 1, 1, 2455.862, -4913.752, 264.1513, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4003)
+(@OGUID+1769, 181355, 571, 1, 1, 2455.862, -4913.752, 264.1513, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4003)
+(@OGUID+1770, 181355, 571, 1, 1, 2451.606, -4908.155, 263.5596, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4003)
+(@OGUID+1771, 181355, 571, 1, 1, 2461.599, -4898.379, 262.9199, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1772, 181355, 571, 1, 1, 2469.49, -4907.808, 264.066, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1773, 181355, 571, 1, 1, 2657.285, -4403.338, 283.9217, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1774, 181355, 571, 1, 1, 2654.31, -4365.038, 277.5075, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1775, 181355, 571, 1, 1, 2642.45, -4384.394, 283.2693, 6.03884, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1776, 181355, 571, 1, 1, 2681.611, -4385.324, 284.4337, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1777, 181355, 571, 1, 1, 2681.398, -4378.912, 282.9612, 1.989672, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1778, 181355, 571, 1, 1, 2675.206, -4331.749, 289.7764, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4018)
+(@OGUID+1779, 181355, 571, 1, 1, 2620.654, -4361.461, 276.4902, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4018)
+(@OGUID+1780, 181355, 571, 1, 1, 2596.458, -4358.913, 275.6402, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4018)
+(@OGUID+1781, 181355, 571, 1, 1, 2588.766, -4349.194, 275.7753, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4018)
+(@OGUID+1782, 181355, 571, 1, 1, 2571.572, -4316.572, 278.0044, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4018)
+(@OGUID+1783, 181355, 571, 1, 1, 3261.053, -755.9268, 174.2897, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1784, 181355, 571, 1, 1, 3274.188, -755.2222, 168.0432, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1785, 181355, 571, 1, 1, 3260.281, -749.4948, 168.42, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1786, 181355, 571, 1, 1, 3309.448, -746.7072, 179.006, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1787, 181355, 571, 1, 1, 3296.599, -736.467, 176.1194, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1788, 181355, 571, 1, 1, 3216.764, -730.0927, 173.64, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1789, 181355, 571, 1, 1, 3235.794, -713.0104, 167.6716, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1790, 181355, 571, 1, 1, 3281.076, -720.5919, 175.8908, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1791, 181355, 571, 1, 1, 3270.005, -719.1215, 168.8549, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1792, 181355, 571, 1, 1, 3266.31, -712.2863, 172.5281, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1793, 181355, 571, 1, 1, 3267.798, -689.1566, 173.7582, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1794, 181355, 571, 1, 1, 3257.232, -695.9045, 167.3684, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1795, 181355, 571, 1, 1, 3209.856, -708.0291, 173.0501, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1796, 181355, 571, 1, 1, 3254.467, -668.7876, 174.1768, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1797, 181355, 571, 1, 1, 3249.678, -674.059, 167.3249, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1798, 181355, 571, 1, 1, 3215.154, -685.1657, 174.8388, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1799, 181355, 571, 1, 1, 3216.414, -654.4945, 173.1659, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4186)
+(@OGUID+1800, 181355, 571, 1, 1, 3201.649, -673.1436, 172.2877, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4186)
+(@OGUID+1801, 181355, 571, 1, 1, 3202.44, -689.5214, 171.9362, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4186)
+(@OGUID+1802, 181355, 571, 1, 1, 3649.295, -702.2972, 215.0318, 6.19592, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1803, 181355, 571, 1, 1, 3632.087, -711.0179, 214.2405, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1804, 181355, 571, 1, 1, 3658.59, -706.5002, 224.446, 3.490667, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1805, 181355, 571, 1, 1, 3676.882, -702.1511, 214.3667, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1806, 181355, 571, 1, 1, 3674.527, -739.8177, 213.8958, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1807, 181355, 571, 1, 1, 3698.531, -714.2257, 214.151, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1808, 181355, 571, 1, 1, 3697.376, -742.7101, 213.797, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1809, 181355, 571, 1, 1, 3704.834, -687.1371, 215.5728, 5.148723, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1810, 181355, 571, 1, 1, 3716.316, -708.1945, 215.473, 2.268925, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1811, 181355, 571, 1, 1, 3749.342, -769.8768, 197.4349, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1812, 181355, 571, 1, 1, 3781.028, -803.4545, 197.2077, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1813, 181355, 571, 1, 1, 3794.07, -804.0314, 197.3381, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1814, 181355, 571, 1, 1, 3803.82, -793.8429, 197.2356, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1815, 181355, 571, 1, 1, 3862.428, -745.8948, 221.1198, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1816, 181355, 571, 1, 1, 3843.911, -763.369, 219.3806, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1817, 181355, 571, 1, 1, 3858.99, -724.03, 221.2304, 3.752462, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1818, 181355, 571, 1, 1, 3822.775, -695.2535, 223.0013, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1819, 181355, 571, 1, 1, 3866.354, -771.1376, 220.3779, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1820, 181355, 571, 1, 1, 3826.776, -685.0971, 223.0013, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1821, 181355, 571, 1, 1, 3951.355, -780.9128, 244.63, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4177)
+(@OGUID+1822, 181355, 571, 1, 1, 3562.132, 193.3676, 52.28502, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1823, 181355, 571, 1, 1, 3548.806, 191.4957, 52.29362, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1824, 181355, 571, 1, 1, 3576.012, 201.1324, -120.133, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1825, 181355, 571, 1, 1, 3543.596, 229.0154, 116.7898, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1826, 181355, 571, 1, 1, 3557.755, 230.3309, 116.7897, 3.228859, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1827, 181355, 571, 1, 1, 3563.86, 208.5335, 52.2564, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1828, 181355, 571, 1, 1, 3604.824, 221.3126, -120.0548, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1829, 181355, 571, 1, 1, 3565.379, 213.0888, 116.8406, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1830, 181355, 571, 1, 1, 3542.329, 206.0333, 52.2564, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1831, 181355, 571, 1, 1, 3539.345, 210.2894, 116.8406, 4.834563, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1832, 181355, 571, 1, 1, 3532.222, 198.4992, -120.1445, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1833, 181355, 571, 1, 1, 3501.747, 212.1927, -120.1452, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4254)
+(@OGUID+1834, 181355, 571, 1, 1, 3565.646, 245.8031, 117.1294, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1835, 181355, 571, 1, 1, 3517.434, 257.0187, 117.1313, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1836, 181355, 571, 1, 1, 3579.191, 264.8907, 117.1309, 2.897245, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1837, 181355, 571, 1, 1, 3535.776, 241.7472, 117.1205, 1.256636, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1838, 181355, 571, 1, 1, 3520.52, 258.9779, 47.3175, 0.4886912, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1839, 181355, 571, 1, 1, 3538.464, 244.5366, 47.31742, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1840, 181355, 571, 1, 1, 3561.06, 247.0676, 47.31746, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1841, 181355, 571, 1, 1, 3575.862, 264.2621, 47.31741, 2.844883, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1842, 181355, 571, 1, 1, 3613.162, 267.1122, 52.27297, 1.815142, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1843, 181355, 571, 1, 1, 3573.319, 287.2054, 47.31745, 3.630291, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1844, 181355, 571, 1, 1, 3483.588, 254.1247, 52.26856, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1845, 181355, 571, 1, 1, 3518.373, 281.8263, 47.31754, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1846, 181355, 571, 1, 1, 3576.934, 290.0081, 117.1281, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1847, 181355, 571, 1, 1, 3466.395, 254.6163, 52.29464, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1848, 181355, 571, 1, 1, 3595.918, 285.1813, -120.1526, 5.916668, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1849, 181355, 571, 1, 1, 3532.95, 299.9154, 47.31733, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1850, 181355, 571, 1, 1, 3559.003, 305.3416, 117.1257, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1851, 181355, 571, 1, 1, 3527.995, 301.947, 117.1261, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1852, 181355, 571, 1, 1, 3477.063, 249.0635, -120.1415, 0.4363316, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1853, 181355, 571, 1, 1, 3597.307, 271.0546, -120.1526, 0.3490652, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1854, 181355, 571, 1, 1, 3555.46, 301.8236, 47.3174, 4.415683, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1855, 181355, 571, 1, 1, 3514.207, 282.3757, 117.1297, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1856, 181355, 571, 1, 1, 3628.7, 289.4008, 52.28633, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1857, 181355, 571, 1, 1, 3530.838, 337.9557, 52.25639, 6.19592, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1858, 181355, 571, 1, 1, 3480.771, 279.4473, 52.26998, 4.939284, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1859, 181355, 571, 1, 1, 3535.763, 316.0141, 116.7898, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1860, 181355, 571, 1, 1, 3646.115, 260.8871, 52.25636, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1861, 181355, 571, 1, 1, 3553.869, 335.9773, 116.7962, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1862, 181355, 571, 1, 1, 3527.488, 332.789, 116.7998, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1863, 181355, 571, 1, 1, 3551.697, 340.1284, 52.2564, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1864, 181355, 571, 1, 1, 3463.682, 274.7737, 52.29326, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1865, 181355, 571, 1, 1, 3610.144, 292.3628, 52.27081, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1866, 181355, 571, 1, 1, 3492.134, 322.4423, -120.1445, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1867, 181355, 571, 1, 1, 3630.185, 272.4107, 52.28997, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1868, 181355, 571, 1, 1, 3471.14, 281.1834, -120.1448, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1869, 181355, 571, 1, 1, 3549.406, 317.3907, 116.7898, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1870, 181355, 571, 1, 1, 3562.234, 345.9385, -120.1445, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1871, 181355, 571, 1, 1, 3592.655, 332.8689, -120.1448, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1872, 181355, 571, 1, 1, 3515.109, 342.4366, -120.1445, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1873, 181355, 571, 1, 1, 3531.985, 349.9049, 52.27657, 0.01745246, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1874, 181355, 571, 1, 1, 3546.336, 351.4997, 52.27733, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1875, 181355, 571, 1, 1, 3675.714, 259.1941, 52.25635, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1876, 181355, 571, 1, 1, 3639.994, 308.4146, 52.25637, 5.724681, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1877, 181355, 571, 1, 1, 3658.891, 275.3087, -120.1445, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1878, 181355, 571, 1, 1, 3656.756, 292.7126, -120.1445, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4161)
+(@OGUID+1879, 181355, 571, 1, 1, 2837.893, 884.1483, 15.9367, 2.164206, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1880, 181355, 571, 1, 1, 2802.756, 890.1584, 12.88576, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1881, 181355, 571, 1, 1, 2801.712, 908.5086, 22.29059, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1882, 181355, 571, 1, 1, 2815.472, 918.7995, 20.88776, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1883, 181355, 571, 1, 1, 2771.326, 914.0045, 22.36399, 5.619962, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1884, 181355, 571, 1, 1, 2793.773, 931.6573, 22.35705, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1885, 181355, 571, 1, 1, 2772.131, 928.7278, 22.78977, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1886, 181355, 571, 1, 1, 2787.118, 905.9583, 22.15631, 1.308995, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1887, 181355, 571, 1, 1, 2781.197, 933.6979, 22.78251, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1888, 181355, 571, 1, 1, 2784.236, 959.4688, 22.49838, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1889, 181355, 571, 1, 1, 2795.232, 971.2288, 22.84727, 3.787367, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1890, 181355, 571, 1, 1, 2754.224, 894.7058, 5.906912, 4.76475, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1891, 181355, 571, 1, 1, 2763.372, 862.8993, 6.277842, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1892, 181355, 571, 1, 1, 2720.492, 904.6319, 5.697, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1893, 181355, 571, 1, 1, 2722.365, 888.5219, 5.181851, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1894, 181355, 571, 1, 1, 2743.732, 851.4514, 6.691175, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1895, 181355, 571, 1, 1, 2731.755, 930.2222, 0.360353, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1896, 181355, 571, 1, 1, 2659.202, 906.3993, 4.293646, 4.852017, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1897, 181355, 571, 1, 1, 2645.363, 884.6476, 4.748452, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1898, 181355, 571, 1, 1, 2663.845, 880.2552, 4.281791, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1899, 181355, 571, 1, 1, 2643.082, 897.5799, 4.501051, 6.021387, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4152)
+(@OGUID+1900, 181355, 571, 1, 1, 3766.468, 1474.748, 92.95084, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1901, 181355, 571, 1, 1, 3775.184, 1476.524, 91.86177, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1902, 181355, 571, 1, 1, 3756.168, 1518.429, 88.89409, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1903, 181355, 571, 1, 1, 3772.201, 1518.562, 87.60015, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1904, 181355, 571, 1, 1, 3763.406, 1539.296, 87.04375, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1905, 181355, 571, 1, 1, 3837.253, 1460.372, 91.84299, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1906, 181355, 571, 1, 1, 3805.442, 1540.334, 89.73431, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1907, 181355, 571, 1, 1, 3826.221, 1467.968, 91.71698, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1908, 181355, 571, 1, 1, 3827.208, 1483.951, 92.06059, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1909, 181355, 571, 1, 1, 3838.928, 1434.694, 90.64106, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1910, 181355, 571, 1, 1, 3833.705, 1420.332, 90.87871, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1911, 181355, 571, 1, 1, 3826.889, 1531.865, 95.81321, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1912, 181355, 571, 1, 1, 3847.981, 1459.16, 91.84016, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1913, 181355, 571, 1, 1, 3847.046, 1434.552, 90.64103, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1914, 181355, 571, 1, 1, 3856.728, 1468.202, 92.05556, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1915, 181355, 571, 1, 1, 3799.489, 1569.15, 89.72446, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1916, 181355, 571, 1, 1, 3828.599, 1550.87, 89.65501, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1917, 181355, 571, 1, 1, 3842.612, 1551.831, 89.72446, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1918, 181355, 571, 1, 1, 3807.621, 1601.288, 89.72446, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1919, 181355, 571, 1, 1, 3857.379, 1532.047, 95.73104, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1920, 181355, 571, 1, 1, 3781.226, 1617.937, 87.15925, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1921, 181355, 571, 1, 1, 3804.344, 1618.123, 89.31889, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1922, 181355, 571, 1, 1, 3856.719, 1587.243, 89.60239, 0.5934101, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1923, 181355, 571, 1, 1, 3825.676, 1611.223, 89.72446, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1924, 181355, 571, 1, 1, 3853.099, 1601.293, 89.72446, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1925, 181355, 571, 1, 1, 3869.433, 1563.036, 89.7524, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1926, 181355, 571, 1, 1, 3873.578, 1603.196, 90.13206, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1927, 181355, 571, 1, 1, 3852.562, 1420.469, 90.91337, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4165)
+(@OGUID+1928, 181355, 571, 1, 1, 3515.828, 1981.839, 64.86245, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1929, 181355, 571, 1, 1, 3463.338, 1991.168, 64.61589, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1930, 181355, 571, 1, 1, 3487.095, 1996.391, 64.86275, 3.228859, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1931, 181355, 571, 1, 1, 3503.747, 2013.127, 64.86234, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1932, 181355, 571, 1, 1, 3533.275, 2028.212, 67.83712, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1933, 181355, 571, 1, 1, 4576.1, 1411.883, 192.813, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1934, 181355, 571, 1, 1, 4592.099, 1465.794, 194.402, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1935, 181355, 571, 1, 1, 4570.489, 1446.241, 189.2318, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1936, 181355, 571, 1, 1, 4616.955, 1458.385, 180.9932, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1937, 181355, 571, 1, 1, 4605.558, 1414.259, 194.6597, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1938, 181355, 571, 1, 1, 4571.249, 1421.148, 189.204, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1939, 181355, 571, 1, 1, 4690.823, 1517.44, 261.1075, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1940, 181355, 571, 1, 1, 4613.751, 1415.247, 194.6607, 4.485497, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1941, 181355, 571, 1, 1, 4616.932, 1401.385, 195.1734, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1942, 181355, 571, 1, 1, 4618.971, 1409.788, 194.7806, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1943, 181355, 571, 1, 1, 4692.931, 1529.158, 261.0022, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4167)
+(@OGUID+1944, 181355, 571, 1, 1, 4570.071, 1394.947, 193.0704, 0, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4169)
+(@OGUID+1945, 181355, 571, 1, 1, 4591.207, 1394.502, 193.8047, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4169)
+(@OGUID+1946, 181355, 571, 1, 1, 4569.673, 1388.654, 192.915, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4169)
+(@OGUID+1947, 181355, 571, 1, 1, 4866.249, 1289.011, 222.6894, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4171)
+(@OGUID+1948, 181355, 571, 1, 1, 4896.076, 1252.84, 227.6416, 0.2443456, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4171)
+(@OGUID+1949, 181355, 571, 1, 1, 4908.99, 1241.123, 226.8822, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4171)
+(@OGUID+1950, 181355, 571, 1, 1, 4950.565, 1309.806, 235.062, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4171)
+(@OGUID+1951, 181355, 571, 1, 1, 4919.086, 1318.598, 229.563, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4171)
+(@OGUID+1952, 181355, 571, 1, 1, 4925.459, 1257.523, 226.8904, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4171)
+(@OGUID+1953, 181355, 571, 1, 1, 4958.919, 1196.348, 226.8051, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4170)
+(@OGUID+1954, 181355, 571, 1, 1, 4967.222, 1205.661, 227.3895, 2.548179, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4170)
+(@OGUID+1955, 181355, 571, 1, 1, 4978.83, 1243.004, 227.4904, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4170)
+(@OGUID+1956, 181355, 571, 1, 1, 4985.378, 1269.712, 229.3461, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4170)
+(@OGUID+1957, 181355, 571, 1, 1, 4980.446, 1205.421, 227.7068, 1.117009, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4170)
+(@OGUID+1958, 181355, 571, 1, 1, 5019.801, 1236.83, 230.0975, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4170)
+(@OGUID+1959, 181355, 571, 1, 1, 4948.565, 1174.379, 239.7921, 4.485497, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4170)
+(@OGUID+1960, 181355, 571, 1, 1, 4986.674, 1189.043, 227.4761, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4170)
+(@OGUID+1961, 181355, 571, 1, 1, 5003.663, 1190.19, 227.3823, 2.792518, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4170)
+(@OGUID+1962, 181355, 571, 1, 1, 4956.751, 1164.542, 239.6501, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4170)
+(@OGUID+1963, 181355, 571, 1, 1, 5499.655, 4733.096, -194.545, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4291)
+(@OGUID+1964, 181355, 571, 1, 1, 5480.355, 4744.158, -196.4283, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4291)
+(@OGUID+1965, 181355, 571, 1, 1, 5480.522, 4749.844, -197.1695, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4291)
+(@OGUID+1966, 181355, 571, 1, 1, 5489.249, 4730.626, -194.7575, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4291)
+(@OGUID+1967, 181355, 571, 1, 1, 5478.019, 4730.707, -195.1084, 0.7853968, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4291)
+(@OGUID+1968, 181355, 571, 1, 1, 5362.962, 4851.477, -196.1002, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4290)
+(@OGUID+1969, 181355, 571, 1, 1, 5367.597, 4870.541, -193.5737, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4290)
+(@OGUID+1970, 181355, 571, 1, 1, 5356.69, 4843.208, -195.7224, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4290)
+(@OGUID+1971, 181355, 571, 1, 1, 5412.587, 4907.621, -194.4221, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4290)
+(@OGUID+1972, 181355, 571, 1, 1, 5498.481, 4883.382, -198.6777, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4290)
+(@OGUID+1973, 181355, 571, 1, 1, 5512.88, 4877.948, -197.8936, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4290)
+(@OGUID+1974, 181355, 571, 1, 1, 5511.93, 4885.334, -197.5141, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4290)
+(@OGUID+1975, 181355, 571, 1, 1, 5538.608, 5734.042, -76.70612, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1976, 181355, 571, 1, 1, 5594.934, 5715.648, -72.77393, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1977, 181355, 571, 1, 1, 5547.863, 5726.392, -76.03914, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1978, 181355, 571, 1, 1, 5575.626, 5710.971, -76.69463, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1979, 181355, 571, 1, 1, 5565.491, 5758.583, -75.22591, 5.794494, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1980, 181355, 571, 1, 1, 5584.725, 5752.109, -72.06274, 3.612838, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1981, 181355, 571, 1, 1, 5581.773, 5765.792, -74.64859, 5.061456, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1982, 181355, 571, 1, 1, 5590.33, 5779.955, -71.88873, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1983, 181355, 571, 1, 1, 5533.617, 5764.573, -78.64155, 0.802851, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1984, 181355, 571, 1, 1, 5623.018, 5797.692, -71.15307, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4284)
+(@OGUID+1985, 181355, 571, 1, 1, 5591.747, 5812.308, -69.85215, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4284)
+(@OGUID+1986, 181355, 571, 1, 1, 5609.327, 5807.859, -70.49896, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4284)
+(@OGUID+1987, 181355, 571, 1, 1, 4503.089, 5725.708, 81.28325, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4122)
+(@OGUID+1988, 181355, 571, 1, 1, 4509.733, 5758.892, 81.67448, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4122)
+(@OGUID+1989, 181355, 571, 1, 1, 4496.206, 5716.174, 81.43398, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4122)
+(@OGUID+1990, 181355, 571, 1, 1, 4518.926, 5710.135, 81.47955, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4122)
+(@OGUID+1991, 181355, 571, 1, 1, 4504.061, 5681.631, 81.48656, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4122)
+(@OGUID+1992, 181355, 571, 1, 1, 4474.953, 5701.296, 81.26831, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4122)
+(@OGUID+1993, 181355, 571, 1, 1, 4464.801, 5710.149, 81.19541, 0.4886912, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4122)
+(@OGUID+1994, 181355, 571, 1, 1, 4477.252, 5619.131, 59.0644, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4122)
+(@OGUID+1995, 181355, 571, 1, 1, 4470.023, 5611.964, 57.05235, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4122)
+(@OGUID+1996, 181355, 571, 1, 1, 4436.702, 5642.711, 58.46593, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4122)
+(@OGUID+1997, 181355, 571, 1, 1, 4153.679, 5394.383, 25.56959, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1998, 181355, 571, 1, 1, 4148.606, 5402.479, 27.19845, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+1999, 181355, 571, 1, 1, 4143.483, 5389.272, 26.23728, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2000, 181355, 571, 1, 1, 4140.316, 5399.663, 26.79937, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2001, 181355, 571, 1, 1, 4174.55, 5310.481, 25.4746, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2002, 181355, 571, 1, 1, 4124.854, 5302.798, 29.50037, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2003, 181355, 571, 1, 1, 4047.685, 5298.593, 24.65438, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2004, 181355, 571, 1, 1, 4064.177, 5287.178, 28.33383, 0.4886912, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2005, 181355, 571, 1, 1, 4079.892, 5272.371, 27.84729, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2006, 181355, 571, 1, 1, 4038.373, 5295.928, 24.80445, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2007, 181355, 571, 1, 1, 4116.859, 5260.454, 24.72842, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4108)
+(@OGUID+2008, 181355, 571, 1, 1, 4133.651, 5261.081, 25.0436, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4108)
+(@OGUID+2009, 181355, 571, 1, 1, 4166.071, 5288.284, 26.37672, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4108)
+(@OGUID+2010, 181355, 571, 1, 1, 4188.307, 5253.252, 26.37672, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4108)
+(@OGUID+2011, 181355, 571, 1, 1, 4203.514, 5258.505, 32.30191, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4108)
+(@OGUID+2012, 181355, 571, 1, 1, 4245.934, 5261.749, 70.84612, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4108)
+(@OGUID+2013, 181355, 571, 1, 1, 3460.45, 4186.23, 18.21275, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2014, 181355, 571, 1, 1, 3472.248, 4185.592, 18.24646, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2015, 181355, 571, 1, 1, 3484.245, 4164.788, 17.17531, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2016, 181355, 571, 1, 1, 3484.917, 4176.376, 17.19302, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2017, 181355, 571, 1, 1, 3444.581, 4167.645, 17.16287, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2018, 181355, 571, 1, 1, 3445, 4178.582, 17.15816, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2019, 181355, 571, 1, 1, 3469.884, 4115.7, 16.70656, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2020, 181355, 571, 1, 1, 3455.853, 4140.363, 15.27709, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2021, 181355, 571, 1, 1, 3468.707, 4138.945, 15.28419, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2022, 181355, 571, 1, 1, 3429.658, 4124.901, 16.82856, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2023, 181355, 571, 1, 1, 3437.819, 4086.14, 17.09811, 1.518436, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2024, 181355, 571, 1, 1, 3409.352, 4091.084, 18.57693, 4.468043, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2025, 181355, 571, 1, 1, 3419, 4110.042, 17.55773, 6.021387, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2026, 181355, 571, 1, 1, 3473.787, 4089.247, 17.13011, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2027, 181355, 571, 1, 1, 3426.033, 4071.888, 18.0825, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2028, 181355, 571, 1, 1, 3458.691, 4082.395, 17.32234, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4037)
+(@OGUID+2029, 181355, 571, 1, 1, 2997.857, 4049.579, 26.61824, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2030, 181355, 571, 1, 1, 3017.189, 4065.652, 26.77533, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2031, 181355, 571, 1, 1, 2998.711, 4070.604, 26.91523, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2032, 181355, 571, 1, 1, 3008.427, 4048.363, 26.36823, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2033, 181355, 571, 1, 1, 2927.117, 4077.872, 2.141783, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2034, 181355, 571, 1, 1, 2959.034, 3995.016, 1.879538, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2035, 181355, 571, 1, 1, 2922.883, 4037.388, 1.768461, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2036, 181355, 571, 1, 1, 2904.64, 4073.7, 1.964231, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2037, 181355, 571, 1, 1, 2910.194, 4046.256, 1.670829, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2038, 181355, 571, 1, 1, 2899.832, 4067.156, 1.7923, 6.0912, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2039, 181355, 571, 1, 1, 2875.328, 4035.009, 5.441031, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2040, 181355, 571, 1, 1, 2872.569, 4041.228, 5.269434, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4113)
+(@OGUID+2041, 181355, 571, 1, 1, 2352.742, 5196.42, 7.632045, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4115)
+(@OGUID+2042, 181355, 571, 1, 1, 2366.833, 5211.396, 7.632044, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4115)
+(@OGUID+2043, 181355, 571, 1, 1, 2302.698, 5237.8, 11.3397, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2044, 181355, 571, 1, 1, 2248.404, 5206.861, 14.71353, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2045, 181355, 571, 1, 1, 2238.36, 5132.744, 5.344914, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2046, 181355, 571, 1, 1, 2238.517, 5180.176, 14.71353, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2047, 181355, 571, 1, 1, 2255.31, 5225.856, 14.71353, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2048, 181355, 571, 1, 1, 2288.013, 5313.147, 14.71353, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2049, 181355, 571, 1, 1, 2276.32, 5282.166, 15.66975, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2050, 181355, 571, 1, 1, 2234.987, 5298.379, 15.05626, 2.687807, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2051, 181355, 571, 1, 1, 2208.51, 5319.641, 23.37515, 2.897245, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2052, 181355, 571, 1, 1, 2213.95, 5333.778, 23.37515, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2053, 181355, 571, 1, 1, 2202.939, 5302.733, 23.37515, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2054, 181355, 571, 1, 1, 2226.791, 5136.915, 5.344575, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2055, 181355, 571, 1, 1, 2207.053, 5222.542, 14.10005, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2056, 181355, 571, 1, 1, 2187.269, 5257.097, 23.37515, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2057, 181355, 571, 1, 1, 2192.255, 5270.982, 24.45937, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2058, 181355, 571, 1, 1, 2214.695, 5241.333, 14.10005, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2059, 181355, 571, 1, 1, 2197.986, 5288.558, 24.45936, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2060, 181355, 571, 1, 1, 2157.476, 5301.414, 24.66485, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2061, 181355, 571, 1, 1, 2151.343, 5284.071, 24.66521, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2062, 181355, 571, 1, 1, 2122.561, 5320.263, 32.77589, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2063, 181355, 571, 1, 1, 2112.85, 5291.524, 32.77574, 1.239183, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4032)
+(@OGUID+2064, 181355, 571, 1, 1, 2805.134, 6135.274, 84.65132, 1.134463, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4020)
+(@OGUID+2065, 181355, 571, 1, 1, 2788.66, 6162.68, 84.8553, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4020)
+(@OGUID+2066, 181355, 571, 1, 1, 2799.835, 6186.328, 84.08407, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2067, 181355, 571, 1, 1, 2815.305, 6174.101, 121.9518, 5.497789, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2068, 181355, 571, 1, 1, 2823.609, 6165.092, 121.9373, 2.251473, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2069, 181355, 571, 1, 1, 2861.186, 6199.252, 208.7366, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2070, 181355, 571, 1, 1, 2853.404, 6207.334, 208.7359, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2071, 181355, 571, 1, 1, 2860.569, 6221.081, 208.7375, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2072, 181355, 571, 1, 1, 2876.308, 6204.336, 208.7393, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2073, 181355, 571, 1, 1, 2902.97, 6231.561, 208.8656, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2074, 181355, 571, 1, 1, 2899.378, 6242.913, 208.8885, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2075, 181355, 571, 1, 1, 2888.891, 6247.602, 208.8507, 4.276057, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2076, 181355, 571, 1, 1, 2892.682, 6263.139, 209.0361, 5.201083, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2077, 181355, 571, 1, 1, 2922.968, 6238.53, 208.9055, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4129)
+(@OGUID+2078, 181355, 571, 1, 1, 3519.409, 5943.527, 134.4016, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2079, 181355, 571, 1, 1, 3521.802, 5957.627, 134.0744, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2080, 181355, 571, 1, 1, 3584.385, 5975.644, 136.2158, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4023)
+(@OGUID+2081, 181355, 571, 1, 1, 3612.38, 5919.877, 136.0995, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4023)
+(@OGUID+2082, 181355, 571, 1, 1, 3605.886, 5989.136, 136.2162, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4023)
+(@OGUID+2083, 181355, 571, 1, 1, 3624.637, 5926.569, 136.2162, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4023)
+(@OGUID+2084, 181355, 571, 1, 1, 3623.188, 5947.213, 136.2162, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4023)
+(@OGUID+2085, 181355, 571, 1, 1, 3633.385, 5887.483, 140.0765, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4023)
+(@OGUID+2086, 181355, 571, 1, 1, 3647.803, 5882.226, 174.4943, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4023)
+(@OGUID+2087, 181355, 571, 1, 1, 3578.23, 6633.554, 195.1779, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4024)
+(@OGUID+2088, 181355, 571, 1, 1, 3585.12, 6674.991, 195.1799, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4024)
+(@OGUID+2089, 181355, 571, 1, 1, 3948.234, -593.3984, 241.733, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4175)
+(@OGUID+2090, 181355, 571, 1, 1, 3943.947, -610.4957, 241.5294, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4175)
+(@OGUID+2091, 181355, 571, 1, 1, 3935.917, -598.2784, 241.3665, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4175)
+(@OGUID+2092, 181355, 571, 1, 1, 3932.653, -576.1534, 240.7002, 0.8552105, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 4175)
+(@OGUID+2093, 181355, 530, 1, 1, 9654.513, -7165.117, 14.32294, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2094, 181355, 530, 1, 1, 9678.808, -7129.612, 14.323, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2095, 181355, 530, 1, 1, 9642.193, -7165.241, 14.32294, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2096, 181355, 530, 1, 1, 9678.796, -7142.301, 14.32305, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2097, 181355, 530, 1, 1, 9618.231, -7141.752, 14.32299, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2098, 181355, 530, 1, 1, 9618.2, -7129.268, 14.32341, 4.363324, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2099, 181355, 530, 1, 1, 9720.848, -7098.167, 14.37494, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2100, 181355, 530, 1, 1, 9716.24, -7078.561, 14.3665, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2101, 181355, 530, 1, 1, 9707.404, -7059.029, 14.43248, 0.06981169, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2102, 181355, 530, 1, 1, 9642.688, -7106.293, 14.32302, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2103, 181355, 530, 1, 1, 9655.052, -7106.376, 14.32302, 2.897245, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2104, 181355, 530, 1, 1, 9688.935, -7057.635, 14.38305, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2105, 181355, 530, 1, 1, 9571.572, -7081.525, 16.54363, 4.101525, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2106, 181355, 530, 1, 1, 9589.414, -7081.651, 16.54936, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2107, 181355, 530, 1, 1, 9579.722, -7178.49, 14.23274, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3487)
+(@OGUID+2108, 181355, 530, 1, 1, -3929.128, -11744.82, -138.6122, 0.6283169, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2109, 181355, 530, 1, 1, -3970.78, -11722.88, -138.8356, 1.518436, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2110, 181355, 530, 1, 1, -3848.473, -11713.9, -106.9602, 4.869471, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2111, 181355, 530, 1, 1, -3832.714, -11732.29, -106.8447, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2112, 181355, 530, 1, 1, -3838.553, -11690.54, -106.755, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2113, 181355, 530, 1, 1, -3839.154, -11664.52, -116.0718, 5.969027, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2114, 181355, 530, 1, 1, -3817.688, -11688.14, -107.0981, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2115, 181355, 530, 1, 1, -3928.31, -11712.54, -135.2059, 5.148723, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2116, 181355, 530, 1, 1, -3877.953, -11647.35, -134.3679, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2117, 181355, 530, 1, 1, -3943.487, -11689.1, -135.2892, 0.6108634, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2118, 181355, 530, 1, 1, -3819.228, -11660.32, -115.6466, 5.969027, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2119, 181355, 530, 1, 1, -3938.107, -11702.05, -135.2763, 1.500983, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2120, 181355, 530, 1, 1, -3856.057, -11632.63, -134.0159, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2121, 181355, 530, 1, 1, -3891.189, -11640.65, -134.4907, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2122, 181355, 530, 1, 1, -3919.52, -11641.97, -134.8313, 0.2094394, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2123, 181355, 530, 1, 1, -3905.643, -11638.75, -134.6634, 5.864307, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2124, 181355, 530, 1, 1, -3931.237, -11649.39, -135.003, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2125, 181355, 530, 1, 1, -3903.503, -11599.64, -137.7858, 3.926996, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2126, 181355, 530, 1, 1, -3935.253, -11599.68, -138.455, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2127, 181355, 530, 1, 1, -3974.517, -11624.75, -138.8757, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2128, 181355, 530, 1, 1, -3943.941, -11674.08, -135.2386, 3.595379, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2129, 181355, 530, 1, 1, -3939.98, -11660.92, -135.1454, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2130, 181355, 530, 1, 1, -3988.478, -11651.17, -139.0434, 0.383971, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2131, 181355, 530, 1, 1, -3985.045, -11695.91, -139.3659, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2132, 181355, 530, 1, 1, -3657.605, -11491.42, -119.0973, 1.989672, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2133, 181355, 530, 1, 1, -3640.533, -11468.59, -118.8086, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2134, 181355, 530, 1, 1, -4212.527, -12510.34, 45.44406, 0.2268925, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2135, 181355, 530, 1, 1, -4209.379, -12517.65, 45.81722, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2136, 181355, 530, 1, 1, -4185.712, -12504.83, 44.36132, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3576)
+(@OGUID+2137, 181355, 530, 1, 1, -4176.958, -12493.97, 44.361, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3576)
+(@OGUID+2138, 181355, 530, 1, 1, -4171.624, -12506.62, 44.36132, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3576)
+(@OGUID+2139, 181355, 530, 1, 1, -4158.644, -12533.33, 45.45204, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3576)
+(@OGUID+2140, 181355, 530, 1, 1, -4158.139, -12463.08, 45.08138, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3576)
+(@OGUID+2141, 181355, 530, 1, 1, -4153.742, -12484.6, 44.51342, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3576)
+(@OGUID+2142, 181355, 530, 1, 1, -4048.503, -13778.93, 75.01585, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 3527)
+(@OGUID+2143, 181388, 530, 1, 1, -258.9341, 5512.862, 67.77477, 0.4188786, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2144, 181388, 530, 1, 1, -261.8974, 5511.051, 67.76839, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2145, 181388, 530, 1, 1, -263.5012, 5501.786, 67.77054, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2146, 181388, 530, 1, 1, -249.4451, 5498.099, 67.77216, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2147, 181388, 530, 1, 1, -261.6719, 5498.666, 67.76727, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2148, 181388, 530, 1, 1, -252.3171, 5496.113, 67.77038, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2149, 181388, 530, 1, 1, -247.7021, 5507.62, 67.76896, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2150, 181388, 530, 1, 1, -249.5854, 5510.579, 67.77278, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2151, 181388, 530, 1, 1, -143.5471, 5538.288, 32.38039, 0.7504908, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2152, 181388, 530, 1, 1, -140.7353, 5529.81, 32.37604, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2153, 181388, 530, 1, 1, -139.3287, 5531.163, 32.36538, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3565)
+(@OGUID+2154, 181388, 530, 1, 1, 267.5295, 6098.781, 133.5178, 0.06981169, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2155, 181388, 530, 1, 1, 291.2011, 6097.795, 133.3371, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2156, 181388, 530, 1, 1, 285.8843, 6123.674, 143.5187, 5.113817, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2157, 181388, 530, 1, 1, 3016.262, 5430.181, 148.0061, 4.380776, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3951)
+(@OGUID+2158, 181388, 530, 1, 1, 2042.164, 4667.055, 151.2627, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3844)
+(@OGUID+2159, 181388, 530, 1, 1, 3060.135, 3699.842, 143.7799, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3712)
+(@OGUID+2160, 181388, 530, 1, 1, 3064.48, 3691.506, 143.6662, 3.508117, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3712)
+(@OGUID+2161, 181388, 530, 1, 1, -695.2222, 2715.149, 95.88277, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3538)
+(@OGUID+2162, 181388, 530, 1, 1, -708.1202, 2724.893, 94.95054, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3538)
+(@OGUID+2163, 181388, 530, 1, 1, -705.0544, 2721.336, 95.51184, 5.218536, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3538)
+(@OGUID+2164, 181388, 530, 1, 1, -701.3524, 2721.361, 95.51174, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3538)
+(@OGUID+2165, 181388, 530, 1, 1, -713.004, 2733.563, 95.85148, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3538)
+(@OGUID+2166, 181388, 530, 1, 1, -701.2917, 2728.885, 95.50826, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3538)
+(@OGUID+2167, 181388, 530, 1, 1, -704.9379, 2728.994, 95.55511, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3538)
+(@OGUID+2168, 181388, 530, 1, 1, -695.9877, 2721.337, 95.2422, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3538)
+(@OGUID+2169, 181388, 530, 1, 1, -698.7853, 2728.216, 95.19359, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3538)
+(@OGUID+2170, 181388, 530, 1, 1, -2904.197, 4031.597, 5.614199, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3684)
+(@OGUID+2171, 181388, 530, 1, 1, -2902.589, 4029.068, 5.627097, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3684)
+(@OGUID+2172, 181388, 530, 1, 1, -2760.969, 7304.01, 44.88898, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3626)
+(@OGUID+2173, 181388, 530, 1, 1, -2756.89, 7304.197, 44.86131, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3626)
+(@OGUID+2174, 181388, 530, 1, 1, -2765.625, 7302.786, 44.92822, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3626)
+(@OGUID+2175, 181388, 530, 1, 1, -2956.992, 2566.443, 79.33119, 4.136433, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3744)
+(@OGUID+2176, 181388, 530, 1, 1, -2955.877, 2547.723, 92.74033, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3744)
+(@OGUID+2177, 181388, 530, 1, 1, -3976.32, 2143.523, 105.8609, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3745)
+(@OGUID+2178, 181388, 530, 1, 1, -4051.087, 2170.193, 111.616, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3745)
+(@OGUID+2179, 181388, 530, 1, 1, -4052.169, 2163.663, 111.6861, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3745)
+(@OGUID+2180, 181388, 530, 1, 1, -4082.781, 2168.835, 112.2728, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3745)
+(@OGUID+2181, 181388, 530, 1, 1, -4082.235, 2188.566, 108.3726, 0.7679439, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3745)
+(@OGUID+2182, 181388, 530, 1, 1, -4143.162, 1122.724, 45.38457, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3938)
+(@OGUID+2183, 181388, 530, 1, 1, -4140.739, 1120.926, 45.42784, 5.148723, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3938)
+(@OGUID+2184, 181388, 530, 1, 1, -2980.903, 856.316, -6.719138, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3754)
+(@OGUID+2185, 181388, 530, 1, 1, -2970.08, 861.2813, -6.318128, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3754)
+(@OGUID+2186, 181388, 571, 1, 1, 5071.415, -592.7192, 221.034, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4557)
+(@OGUID+2187, 181388, 571, 1, 1, 5062.768, -549.4098, 219.9563, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4559)
+(@OGUID+2188, 181388, 571, 1, 1, 5058.464, -542.483, 219.9259, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4559)
+(@OGUID+2189, 181388, 571, 1, 1, 5061.948, -545.0692, 219.9297, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4559)
+(@OGUID+2190, 181388, 571, 1, 1, 5029.646, -527.3734, 228.6926, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4559)
+(@OGUID+2191, 181388, 571, 1, 1, 5137.096, -2201.546, 237.8019, 4.485497, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2192, 181388, 571, 1, 1, 5177.153, -2180.084, 236.5424, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2193, 181388, 571, 1, 1, 5157.259, -2201.744, 237.5309, 6.073746, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2194, 181388, 571, 1, 1, 5141.539, -2211.604, 238.1585, 0.2967052, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4317)
+(@OGUID+2195, 181388, 571, 1, 1, 5192.435, -2209.911, 239.3982, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4317)
+(@OGUID+2196, 181388, 571, 1, 1, 5157.712, -2215.265, 238.4418, 1.553341, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4317)
+(@OGUID+2197, 181388, 571, 1, 1, 3874.093, -4541.467, 210.1389, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2198, 181388, 571, 1, 1, 3877.073, -4546.678, 210.972, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2199, 181388, 571, 1, 1, 3838.456, -4544.684, 209.2909, 2.530723, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2200, 181388, 571, 1, 1, 3412.483, -2783.082, 202.9972, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4204)
+(@OGUID+2201, 181388, 571, 1, 1, 3407.589, -2786.686, 202.9973, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4204)
+(@OGUID+2202, 181388, 571, 1, 1, 3424.167, -2769.674, 201.4191, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4204)
+(@OGUID+2203, 181388, 571, 1, 1, 1432.413, -3253.822, 166.571, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4071)
+(@OGUID+2204, 181388, 571, 1, 1, 1422.948, -3265.153, 165.6199, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4071)
+(@OGUID+2205, 181388, 571, 1, 1, 1425.667, -3261.837, 165.5927, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4071)
+(@OGUID+2206, 181388, 571, 1, 1, 701.6729, -2935.085, -3.068489, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3987)
+(@OGUID+2207, 181388, 571, 1, 1, 701.3621, -2933.383, -3.068485, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3987)
+(@OGUID+2208, 181388, 571, 1, 1, 3629.777, -714.9827, 215.4509, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2209, 181388, 571, 1, 1, 3629.591, -716.7711, 215.4509, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2210, 181388, 571, 1, 1, 3630.091, -711.7509, 215.451, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2211, 181388, 571, 1, 1, 3630.212, -709.9004, 215.4509, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2212, 181388, 571, 1, 1, 3653.071, -692.7104, 223.6275, 0.6457717, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4177)
+(@OGUID+2213, 181388, 571, 1, 1, 3660.452, -698.0406, 223.6275, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4177)
+(@OGUID+2214, 181388, 571, 1, 1, 3658.893, -693.3231, 223.6275, 1.413715, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4177)
+(@OGUID+2215, 181388, 571, 1, 1, 3655.911, -710.7966, 227.4318, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4177)
+(@OGUID+2216, 181388, 571, 1, 1, 3652.148, -720.3037, 216.2393, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4177)
+(@OGUID+2217, 181388, 571, 1, 1, 3650.309, -697.8465, 223.6275, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4177)
+(@OGUID+2218, 181388, 571, 1, 1, 3653.49, -720.2332, 216.2393, 2.809975, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4177)
+(@OGUID+2219, 181388, 571, 1, 1, 3658.077, -721.1656, 216.2393, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4177)
+(@OGUID+2220, 181388, 571, 1, 1, 3655.506, -720.5035, 216.2393, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4177)
+(@OGUID+2221, 181388, 571, 1, 1, 3560.058, 249.0957, 45.70548, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4161)
+(@OGUID+2222, 181388, 571, 1, 1, 3529.886, 252.3539, 45.7051, 3.316144, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4161)
+(@OGUID+2223, 181388, 571, 1, 1, 3573.747, 275.6775, 45.70752, 5.061456, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4161)
+(@OGUID+2224, 181388, 571, 1, 1, 3521.046, 280.9596, 45.70491, 0.5585039, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4161)
+(@OGUID+2225, 181388, 571, 1, 1, 3555.038, 299.0926, 45.70468, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4161)
+(@OGUID+2226, 181388, 571, 1, 1, 3497.954, 1962.59, 67.00489, 5.148723, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2227, 181388, 571, 1, 1, 3489.518, 1973.308, 66.71261, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2228, 181388, 571, 1, 1, 3472.785, 1978.688, 66.46651, 1.274088, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2229, 181388, 571, 1, 1, 3498.045, 1985.921, 66.4942, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2230, 181388, 571, 1, 1, 3515.049, 1995.76, 66.57986, 5.515242, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2231, 181388, 571, 1, 1, 5543.533, 5732.819, -75.00607, 4.450591, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2232, 181388, 571, 1, 1, 5546.444, 5741.974, -75.40535, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2233, 181388, 571, 1, 1, 5592.455, 5748.157, -70.19862, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2234, 181388, 571, 1, 1, 5558.145, 5760.761, -76.66797, 2.286379, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2235, 181388, 571, 1, 1, 5565.401, 5770.03, -74.08703, 5.689774, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2236, 181388, 571, 1, 1, 5564.951, 5763.742, -74.10497, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2237, 181388, 571, 1, 1, 4502.473, 5716.374, 83.2963, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4122)
+(@OGUID+2238, 181388, 571, 1, 1, 2292.771, 5195.491, 16.54581, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4115)
+(@OGUID+2239, 181388, 571, 1, 1, 2295.146, 5194.604, 16.54581, 3.752462, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4115)
+(@OGUID+2240, 181388, 571, 1, 1, 3572.129, 6647.487, 197.2582, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4024)
+(@OGUID+2241, 181388, 571, 1, 1, 3572.212, 6646.873, 197.2582, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4024)
+(@OGUID+2242, 181388, 571, 1, 1, 3572.679, 6647.372, 197.2582, 5.759588, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 4024)
+(@OGUID+2243, 181388, 530, 1, 1, 9644.521, -7140.054, 16.77326, 4.991644, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3487)
+(@OGUID+2244, 181388, 530, 1, 1, 9652.589, -7140.016, 16.77326, 4.625124, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3487)
+(@OGUID+2245, 181388, 530, 1, 1, 9587.118, -7206.618, 17.41128, 2.33874, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3487)
+(@OGUID+2246, 181388, 530, 1, 1, 9644.567, -7131.666, 16.77325, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3487)
+(@OGUID+2247, 181388, 530, 1, 1, 9652.462, -7131.681, 16.77325, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3487)
+(@OGUID+2248, 181388, 0, 1, 1, -8895.29, 618.686, 101.258, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 5148)
+(@OGUID+2249, 181388, 530, 1, 1, -4026.65, -11731.49, -150.8, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2250, 181388, 530, 1, 1, -4022.252, -11739.32, -150.7981, 0.06981169, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2251, 181388, 530, 1, 1, -3740.327, -11688.57, -104.6048, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2252, 181388, 530, 1, 1, -3744.044, -11692.36, -104.6063, 3.42085, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2253, 181388, 530, 1, 1, -3743.692, -11697.82, -104.624, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2254, 181388, 530, 1, 1, -3739.73, -11701.29, -104.5924, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2255, 181388, 530, 1, 1, -3913.77, -11545.52, -148.9983, 0.4712385, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2256, 181388, 530, 1, 1, -3918.321, -11545.52, -149.0445, 0.4712385, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2257, 181388, 530, 1, 1, -3919.778, -11545.48, -149.061, 0.1047193, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2258, 181388, 530, 1, 1, -3924.433, -11545.48, -149.1109, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2259, 181388, 530, 1, 1, -3794.177, -11519.92, -133.9687, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2260, 181388, 530, 1, 1, -4206.351, -12449.98, 47.50156, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2261, 181388, 530, 1, 1, -4225.53, -12524.83, 45.94211, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 0)
+(@OGUID+2262, 181388, 530, 1, 1, -4155.963, -12472.56, 45.63326, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3576)
+(@OGUID+2263, 181388, 530, 1, 1, -4168.263, -12538.89, 46.0363, 0.087266, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3576)
+(@OGUID+2264, 181388, 530, 1, 1, -4126.576, -13723.57, 77.2606, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3526)
+(@OGUID+2265, 181388, 530, 1, 1, -4129.112, -13723.48, 77.24871, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3526)
+(@OGUID+2266, 181388, 530, 1, 1, -4089.863, -13747.79, 76.39077, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3526)
+(@OGUID+2267, 181388, 530, 1, 1, -4070.501, -13748.16, 77.0448, 4.34587, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3526)
+(@OGUID+2268, 181388, 530, 1, 1, -4068.368, -13749, 77.03782, 2.059488, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3526)
+(@OGUID+2269, 181388, 530, 1, 1, -4087.652, -13776.27, 78.02085, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181388 (Area: 3526)
+(@OGUID+2270, 181391, 530, 1, 1, -1896.941, 5765.268, 132.268, 0, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2271, 181391, 530, 1, 1, -1903.978, 5768.571, 132.8429, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2272, 181391, 530, 1, 1, -264.1175, 5509.565, 67.62336, 2.024579, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3565)
+(@OGUID+2273, 181391, 530, 1, 1, -264.9229, 5504.081, 67.62596, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3565)
+(@OGUID+2274, 181391, 530, 1, 1, -260.1642, 5496.425, 67.61719, 3.665196, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3565)
+(@OGUID+2275, 181391, 530, 1, 1, -247.0731, 5499.689, 67.61514, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3565)
+(@OGUID+2276, 181391, 530, 1, 1, -254.7681, 5494.834, 67.62044, 5.393069, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3565)
+(@OGUID+2277, 181391, 530, 1, 1, -256.5921, 5514.343, 67.6306, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3565)
+(@OGUID+2278, 181391, 530, 1, 1, -251.0405, 5512.968, 67.62232, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3565)
+(@OGUID+2279, 181391, 530, 1, 1, -246.2811, 5505.374, 67.62595, 2.216565, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3565)
+(@OGUID+2280, 181391, 530, 1, 1, 270.007, 6098.651, 133.5972, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2281, 181391, 530, 1, 1, 289.8021, 6098.125, 133.3653, 3.665196, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2282, 181391, 530, 1, 1, 285.9621, 6122.088, 143.566, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2283, 181391, 530, 1, 1, 298.2251, 6094.872, 133.0421, 0.05235888, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2284, 181391, 530, 1, 1, 3017.863, 5435.411, 147.4366, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3951)
+(@OGUID+2285, 181391, 530, 1, 1, 3026.327, 5430.919, 148.4493, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3951)
+(@OGUID+2286, 181391, 530, 1, 1, 3027.365, 5431.576, 148.4505, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3951)
+(@OGUID+2287, 181391, 530, 1, 1, 2173.999, 4726.616, 157.7524, 3.979355, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2288, 181391, 530, 1, 1, 2045.745, 4731.155, 151.8487, 4.81711, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3844)
+(@OGUID+2289, 181391, 530, 1, 1, -2903.531, 4030.889, 5.633335, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3684)
+(@OGUID+2290, 181391, 530, 1, 1, -2903.005, 4029.934, 5.655087, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3684)
+(@OGUID+2291, 181391, 530, 1, 1, -1229.269, 7157.398, 58.43764, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3613)
+(@OGUID+2292, 181391, 530, 1, 1, -1224.05, 7154.102, 58.44301, 5.777041, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3613)
+(@OGUID+2293, 181391, 530, 1, 1, -1220.818, 7159.29, 58.45349, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3613)
+(@OGUID+2294, 181391, 530, 1, 1, -1226.033, 7162.578, 58.45142, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3613)
+(@OGUID+2295, 181391, 530, 1, 1, -2955.542, 2564.842, 79.53258, 3.543024, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3744)
+(@OGUID+2296, 181391, 530, 1, 1, -2954.607, 2547.318, 92.76526, 0, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3744)
+(@OGUID+2297, 181391, 530, 1, 1, -3977.75, 2144.866, 105.8777, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3745)
+(@OGUID+2298, 181391, 530, 1, 1, -4050.742, 2163.796, 111.6861, 3.263772, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3745)
+(@OGUID+2299, 181391, 530, 1, 1, -4052.369, 2168.782, 111.6152, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3745)
+(@OGUID+2300, 181391, 530, 1, 1, -4073.993, 2183.056, 108.3961, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3745)
+(@OGUID+2301, 181391, 530, 1, 1, -4082.026, 2186.264, 108.3727, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3745)
+(@OGUID+2302, 181391, 530, 1, 1, -4141.914, 1121.718, 45.45483, 0.9599299, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3938)
+(@OGUID+2303, 181391, 530, 1, 1, -2970.285, 860.4757, -6.325652, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3754)
+(@OGUID+2304, 181391, 530, 1, 1, -2981.595, 858.2934, -6.682398, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3754)
+(@OGUID+2305, 181391, 530, 1, 1, -2979.788, 854.0434, -6.907697, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3754)
+(@OGUID+2306, 181391, 571, 1, 1, 5584.315, -666.3698, 205.8847, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4557)
+(@OGUID+2307, 181391, 571, 1, 1, 5589.941, -687.0692, 207.7939, 3.57793, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4558)
+(@OGUID+2308, 181391, 571, 1, 1, 5587.695, -670.3691, 206.4425, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4558)
+(@OGUID+2309, 181391, 571, 1, 1, 5589.274, -675.4409, 206.7487, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4558)
+(@OGUID+2310, 181391, 571, 1, 1, 5625.167, -709.793, 208.3863, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4558)
+(@OGUID+2311, 181391, 571, 1, 1, 5148.001, -2198.408, 237.614, 5.707228, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2312, 181391, 571, 1, 1, 5134.635, -2201.145, 238.8165, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2313, 181391, 571, 1, 1, 5173.95, -2179.033, 236.5379, 6.143561, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2314, 181391, 571, 1, 1, 5143.447, -2210.877, 237.8243, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4317)
+(@OGUID+2315, 181391, 571, 1, 1, 5190.736, -2212.201, 239.3978, 2.513274, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4317)
+(@OGUID+2316, 181391, 571, 1, 1, 5435.949, -2590.28, 304.9167, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4275)
+(@OGUID+2317, 181391, 571, 1, 1, 5407.927, -2617.18, 305.2808, 2.984498, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4275)
+(@OGUID+2318, 181391, 571, 1, 1, 5465.895, -2590.533, 304.9167, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4275)
+(@OGUID+2319, 181391, 571, 1, 1, 5492.885, -2617.632, 305.2991, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4275)
+(@OGUID+2320, 181391, 571, 1, 1, 5410.432, -2652.655, 306.231, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4275)
+(@OGUID+2321, 181391, 571, 1, 1, 5407.522, -2646.742, 305.2902, 3.141593, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4275)
+(@OGUID+2322, 181391, 571, 1, 1, 5492.635, -2649.156, 305.2701, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4275)
+(@OGUID+2323, 181391, 571, 1, 1, 5380.456, -2636.633, 304.966, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4275)
+(@OGUID+2324, 181391, 571, 1, 1, 5500.449, -2662.013, 304.9659, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4275)
+(@OGUID+2325, 181391, 571, 1, 1, 5524.156, -2679.053, 305.1702, 1.291542, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4275)
+(@OGUID+2326, 181391, 571, 1, 1, 5794.419, -3557.554, 388.8964, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4323)
+(@OGUID+2327, 181391, 571, 1, 1, 5759.467, -3565.396, 388.2509, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4323)
+(@OGUID+2328, 181391, 571, 1, 1, 5768.993, -3564.651, 388.132, 1.675514, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4323)
+(@OGUID+2329, 181391, 571, 1, 1, 5800.075, -3557.563, 389.7701, 0.3316107, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4323)
+(@OGUID+2330, 181391, 571, 1, 1, 5760.941, -3580.523, 388.6815, 4.66003, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4323)
+(@OGUID+2331, 181391, 571, 1, 1, 5767.891, -3581.12, 388.5618, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4323)
+(@OGUID+2332, 181391, 571, 1, 1, 5796.288, -3573.157, 388.1471, 3.211419, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4323)
+(@OGUID+2333, 181391, 571, 1, 1, 5801.048, -3572.997, 389.0887, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4323)
+(@OGUID+2334, 181391, 571, 1, 1, 5771.673, -3602.202, 388.4206, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4323)
+(@OGUID+2335, 181391, 571, 1, 1, 7809.753, -2956.811, 1259.647, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4441)
+(@OGUID+2336, 181391, 571, 1, 1, 3873.443, -4541.185, 210.1433, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2337, 181391, 571, 1, 1, 3862.321, -4549.055, 211.5898, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2338, 181391, 571, 1, 1, 3876.738, -4547.531, 210.9673, 5.183629, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2339, 181391, 571, 1, 1, 3408.684, -2785.898, 202.9841, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4204)
+(@OGUID+2340, 181391, 571, 1, 1, 3411.444, -2783.841, 202.9332, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4204)
+(@OGUID+2341, 181391, 571, 1, 1, 3421.057, -2770.74, 201.4035, 5.340709, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4204)
+(@OGUID+2342, 181391, 571, 1, 1, 3313.647, -2337.281, 112.4452, 0.157079, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2343, 181391, 571, 1, 1, 3201.634, -2297.767, 109.0517, 0.2792516, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4206)
+(@OGUID+2344, 181391, 571, 1, 1, 3240.247, -2236.566, 117.1561, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4248)
+(@OGUID+2345, 181391, 571, 1, 1, 1454.438, -3273.762, 173.5819, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4071)
+(@OGUID+2346, 181391, 571, 1, 1, 1458.552, -3277.082, 173.5854, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4071)
+(@OGUID+2347, 181391, 571, 1, 1, 1457.29, -3270.155, 173.5816, 5.567601, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4071)
+(@OGUID+2348, 181391, 571, 1, 1, 1456.939, -3279.144, 173.5854, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4071)
+(@OGUID+2349, 181391, 571, 1, 1, 1445.814, -3264.554, 168.441, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4071)
+(@OGUID+2350, 181391, 571, 1, 1, 1445.745, -3269.811, 179.7056, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4071)
+(@OGUID+2351, 181391, 571, 1, 1, 1447.377, -3267.913, 179.7009, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4071)
+(@OGUID+2352, 181391, 571, 1, 1, 1447.826, -3262.189, 168.441, 5.550147, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4071)
+(@OGUID+2353, 181391, 571, 1, 1, 607.8849, -4925.905, 24.95922, 3.298687, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3981)
+(@OGUID+2354, 181391, 571, 1, 1, 593.6772, -4929.414, 31.07939, 3.351047, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3981)
+(@OGUID+2355, 181391, 571, 1, 1, 589.4217, -4926.301, 19.81484, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3981)
+(@OGUID+2356, 181391, 571, 1, 1, 600.7967, -4920.292, 24.95571, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3981)
+(@OGUID+2357, 181391, 571, 1, 1, 606.9359, -4923.435, 24.95922, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3981)
+(@OGUID+2358, 181391, 571, 1, 1, 601.9346, -4924.686, 24.95571, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3981)
+(@OGUID+2359, 181391, 571, 1, 1, 582.0108, -4933.257, 31.07901, 0.1919852, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3981)
+(@OGUID+2360, 181391, 571, 1, 1, 588.7018, -4923.256, 19.81484, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3981)
+(@OGUID+2361, 181391, 571, 1, 1, 2688.802, -4390.23, 285.7001, 2.949595, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2362, 181391, 571, 1, 1, 2676.617, -4381.395, 285.7596, 5.131269, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2363, 181391, 571, 1, 1, 3645.812, -721.0574, 216.172, 6.19592, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4177)
+(@OGUID+2364, 181391, 571, 1, 1, 3646.148, -718.1918, 216.172, 6.0912, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4177)
+(@OGUID+2365, 181391, 571, 1, 1, 3659.441, -693.8284, 223.6275, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4177)
+(@OGUID+2366, 181391, 571, 1, 1, 3650.23, -698.5431, 223.6275, 0.03490625, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4177)
+(@OGUID+2367, 181391, 571, 1, 1, 3652.268, -693.3177, 223.6275, 5.305802, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4177)
+(@OGUID+2368, 181391, 571, 1, 1, 3652.888, -712.5886, 215.9271, 3.665196, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4177)
+(@OGUID+2369, 181391, 571, 1, 1, 3660.472, -699.2101, 223.6275, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4177)
+(@OGUID+2370, 181391, 571, 1, 1, 3652.607, -715.2568, 215.9243, 5.445428, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4177)
+(@OGUID+2371, 181391, 571, 1, 1, 3572.839, 265.1823, 45.7056, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4161)
+(@OGUID+2372, 181391, 571, 1, 1, 3522.945, 260.2353, 45.7145, 0.5061446, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4161)
+(@OGUID+2373, 181391, 571, 1, 1, 3549.799, 245.6209, 45.70576, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4161)
+(@OGUID+2374, 181391, 571, 1, 1, 3526.266, 290.7282, 45.74524, 5.497789, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4161)
+(@OGUID+2375, 181391, 571, 1, 1, 3564.303, 294.1375, 45.70594, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4161)
+(@OGUID+2376, 181391, 571, 1, 1, 2796.748, 906.8901, 22.3641, 2.164206, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4152)
+(@OGUID+2377, 181391, 571, 1, 1, 2751.04, 907.9393, 6.67607, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4152)
+(@OGUID+2378, 181391, 571, 1, 1, 3490.325, 1972.804, 66.7719, 1.06465, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2379, 181391, 571, 1, 1, 3474.909, 1975.443, 65.53431, 4.32842, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2380, 181391, 571, 1, 1, 3499.607, 1984.679, 66.15468, 3.246347, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2381, 181391, 571, 1, 1, 3494.898, 1995.773, 65.53641, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2382, 181391, 571, 1, 1, 3467.421, 1988.05, 66.54556, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2383, 181391, 571, 1, 1, 3490.95, 2015.379, 65.60335, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2384, 181391, 571, 1, 1, 5509.478, 4741.979, -194.4338, 2.111848, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4291)
+(@OGUID+2385, 181391, 571, 1, 1, 5510.404, 4753.548, -194.4338, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4291)
+(@OGUID+2386, 181391, 571, 1, 1, 5502.957, 4741.273, -194.4338, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4291)
+(@OGUID+2387, 181391, 571, 1, 1, 5513.061, 4747.659, -194.4338, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4291)
+(@OGUID+2388, 181391, 571, 1, 1, 5503.827, 4755.526, -194.4338, 4.904376, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4291)
+(@OGUID+2389, 181391, 571, 1, 1, 5498.593, 4745.716, -194.4338, 0.5235979, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4291)
+(@OGUID+2390, 181391, 571, 1, 1, 5479.872, 4726.03, -194.3498, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4291)
+(@OGUID+2391, 181391, 571, 1, 1, 5498.836, 4751.918, -194.4338, 5.899214, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4291)
+(@OGUID+2392, 181391, 571, 1, 1, 5547.074, 5741.959, -75.40535, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2393, 181391, 571, 1, 1, 5591.068, 5747.466, -70.53605, 2.059488, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2394, 181391, 571, 1, 1, 5564.963, 5765.209, -74.12182, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2395, 181391, 571, 1, 1, 5555.885, 5763.052, -76.68349, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2396, 181391, 571, 1, 1, 3472.41, 4163.705, 19.30917, 1.623156, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4037)
+(@OGUID+2397, 181391, 571, 1, 1, 3455.599, 4164.834, 19.33243, 1.483528, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4037)
+(@OGUID+2398, 181391, 571, 1, 1, 3458.478, 4132.48, 17.17745, 4.97419, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4037)
+(@OGUID+2399, 181391, 571, 1, 1, 2303.144, 5193.458, 18.77864, 5.899214, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4115)
+(@OGUID+2400, 181391, 571, 1, 1, 2300.871, 5202.066, 18.77514, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4115)
+(@OGUID+2401, 181391, 571, 1, 1, 2290.591, 5201.154, 24.89418, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4115)
+(@OGUID+2402, 181391, 571, 1, 1, 2291.031, 5196.256, 16.54581, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4115)
+(@OGUID+2403, 181391, 571, 1, 1, 2304.009, 5195.689, 18.77864, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4115)
+(@OGUID+2404, 181391, 571, 1, 1, 2296.923, 5193.869, 16.54581, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4115)
+(@OGUID+2405, 181391, 571, 1, 1, 2289.666, 5198.88, 24.89883, 2.722713, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4115)
+(@OGUID+2406, 181391, 571, 1, 1, 2288.108, 5203.884, 13.63426, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4032)
+(@OGUID+2407, 181391, 571, 1, 1, 2276.774, 5199.534, 24.8946, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4032)
+(@OGUID+2408, 181391, 571, 1, 1, 2278.045, 5202.725, 24.89859, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4032)
+(@OGUID+2409, 181391, 571, 1, 1, 2289.229, 5206.759, 13.6345, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4032)
+(@OGUID+2410, 181391, 571, 1, 1, 2789.675, 6148.044, 86.64036, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4020)
+(@OGUID+2411, 181391, 571, 1, 1, 2817.585, 6154.644, 86.02152, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 4129)
+(@OGUID+2412, 181391, 530, 1, 1, -4043.153, -11563, -136.8524, 5.358162, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2413, 181391, 530, 1, 1, -4182.415, -12436.82, 44.64597, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2414, 181391, 530, 1, 1, -4198.411, -12462.25, 47.02858, 1.06465, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2415, 181391, 530, 1, 1, -4206.79, -12467.33, 47.01455, 5.427975, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2416, 181391, 530, 1, 1, -4222.02, -12521.07, 47.00111, 1.361356, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 0)
+(@OGUID+2417, 181391, 530, 1, 1, -4163.938, -12541.48, 45.87748, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3576)
+(@OGUID+2418, 181391, 530, 1, 1, -4134.745, -12494.92, 46.35612, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3576)
+(@OGUID+2419, 181391, 530, 1, 1, -4044.267, -13771.41, 75.88164, 5.078908, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 3527)
+(@OGUID+2420, 181300, 530, 1, 1, -2037.28, 5275.622, -39.58699, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181300 (Area: 0)
+(@OGUID+2421, 187653, 530, 1, 1, -3943.586, 2116.151, 96.86256, 1.954769, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2422, 187653, 530, 1, 1, -3947.631, 2139.387, 98.95597, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2423, 187653, 530, 1, 1, -3976.474, 2192.468, 101.89, 4.101525, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2424, 187653, 530, 1, 1, -3952.103, 2178.58, 101.6065, 4.502952, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2425, 187653, 530, 1, 1, -3947.441, 2195.89, 101.9546, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2426, 187653, 530, 1, 1, -3962.669, 2179.875, 101.4113, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2427, 187653, 530, 1, 1, -3975.666, 2183.826, 102.0339, 0.4886912, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2428, 187653, 530, 1, 1, -4054.807, 2175.517, 110.4941, 5.602507, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2429, 187653, 530, 1, 1, -4039.186, 2197.357, 110.4058, 0.2617982, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2430, 187653, 530, 1, 1, -4043.826, 2199.081, 110.6511, 2.007128, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2431, 187653, 530, 1, 1, -3975.99, 2200.106, 101.8627, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2432, 187653, 530, 1, 1, -4036.585, 2201.172, 110.5763, 3.839725, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2433, 187653, 530, 1, 1, -4043.816, 2202.357, 110.7311, 1.326448, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2434, 187653, 530, 1, 1, -4040.059, 2204.321, 110.729, 6.178466, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2435, 187653, 530, 1, 1, -3999.656, 2223.364, 105.7338, 4.852017, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2436, 187653, 530, 1, 1, -3958.839, 2204.563, 101.8769, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2437, 187653, 530, 1, 1, -3955.339, 2215.828, 102.0366, 1.797689, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3745)
+(@OGUID+2438, 187653, 530, 1, 1, -3078.534, 758.6424, -10.39434, 1.780234, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 0)
+(@OGUID+2439, 187653, 530, 1, 1, -3075.44, 738.8243, -10.36887, 0.06981169, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 0)
+(@OGUID+2440, 187653, 530, 1, 1, -3039.37, 787.0753, -10.12921, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3754)
+(@OGUID+2441, 187653, 530, 1, 1, -3025.438, 832.5914, -10.05208, 5.166176, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3754)
+(@OGUID+2442, 187653, 530, 1, 1, -3034.829, 838.422, -9.614153, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3754)
+(@OGUID+2443, 187653, 530, 1, 1, -3017.362, 842.7576, -10.2879, 0.9599299, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3754)
+(@OGUID+2444, 187653, 530, 1, 1, -3025.444, 849.413, -10.2078, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3754)
+(@OGUID+2445, 187653, 530, 1, 1, -2995.243, 834.5243, -9.96244, 3.857183, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 3754)
+(@OGUID+2446, 187653, 571, 1, 1, 5592.357, -656.3683, 204.9975, 3.874631, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4557)
+(@OGUID+2447, 187653, 571, 1, 1, 5593.49, -638.1299, 201.8387, 1.012289, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4557)
+(@OGUID+2448, 187653, 571, 1, 1, 5609.004, -716.6079, 206.0215, 3.647741, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4558)
+(@OGUID+2449, 187653, 571, 1, 1, 5614.904, -750.4766, 202.3785, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4558)
+(@OGUID+2450, 187653, 571, 1, 1, 5604.041, -742.2601, 201.0262, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4558)
+(@OGUID+2451, 187653, 571, 1, 1, 5075.036, -564.8768, 220.1215, 0.4537851, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4557)
+(@OGUID+2452, 187653, 571, 1, 1, 5046.612, -520.1337, 220.6882, 4.188792, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4559)
+(@OGUID+2453, 187653, 571, 1, 1, 5052.197, -513.4913, 220.6307, 2.391098, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4559)
+(@OGUID+2454, 187653, 571, 1, 1, 3578.621, 5886.384, 128.054, 5.253442, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 0)
+(@OGUID+2455, 187653, 571, 1, 1, 3584.229, 5927.863, 130.1893, 4.572764, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 0)
+(@OGUID+2456, 187653, 571, 1, 1, 3620.697, 5927.822, 136.2143, 1.518436, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4023)
+(@OGUID+2457, 187653, 571, 1, 1, 3597.911, 5943.361, 136.2162, 5.044002, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4023)
+(@OGUID+2458, 187653, 571, 1, 1, 3598.844, 5919.046, 135.6739, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4023)
+(@OGUID+2459, 187653, 571, 1, 1, 3588.142, 6004.501, 136.2208, 4.310966, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4023)
+(@OGUID+2460, 187653, 571, 1, 1, 3603.936, 5993.001, 136.2162, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4023)
+(@OGUID+2461, 187653, 571, 1, 1, 3591.344, 5841.902, 128.4036, 0.6981314, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4023)
+(@OGUID+2462, 187653, 0, 1, 1, -8568.11, 1195.979, 5.486749, 2.932139, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 5409)
+(@OGUID+2463, 187653, 0, 1, 1, -8581.88, 1195.669, 5.435182, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 5409)
+(@OGUID+2464, 187653, 0, 1, 1, -8353.875, 1196.183, 5.640672, 5.916668, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4411)
+(@OGUID+2465, 187653, 0, 1, 1, -8308.013, 1196.14, 5.626017, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4411)
+(@OGUID+2466, 187653, 0, 1, 1, -8294.278, 1196.099, 5.625349, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4411)
+(@OGUID+2467, 187653, 0, 1, 1, -8213.142, 1196.279, 5.642607, 5.497789, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4411)
+(@OGUID+2468, 187653, 0, 1, 1, -8199.484, 1196.293, 5.615571, 3.159062, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4411)
+(@OGUID+2469, 187653, 0, 1, 1, -8367.961, 1196.207, 5.625067, 5.98648, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4411)
+(@OGUID+2470, 187653, 0, 1, 1, -8413.324, 1195.787, 5.620813, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4411)
+(@OGUID+2471, 187653, 0, 1, 1, -8427.168, 1195.69, 5.460219, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4411)
+(@OGUID+2472, 187653, 0, 1, 1, -8487.134, 1195.98, 5.574959, 3.228859, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4411)
+(@OGUID+2473, 187653, 0, 1, 1, -8473.291, 1195.89, 5.668799, 5.375615, 0, 0, 0, 1, 120, 255, 1), -- 187653 (Area: 4411)
+(@OGUID+2474, 188174, 530, 1, 1, -1748.72, 5333.596, -12.42814, 4.398232, 0, 0, 0, 1, 120, 255, 1), -- 188174 (Area: 0)
+(@OGUID+2475, 188174, 530, 1, 1, 9794.822, -7248.741, 26.09736, 3.68265, 0, 0, 0, 1, 120, 255, 1), -- 188174 (Area: 3487)
+(@OGUID+2476, 188174, 0, 1, 1, -8836.604, 866.36, 98.71682, 2.094393, 0, 0, 0, 1, 120, 255, 1), -- 188174 (Area: 5390)
+(@OGUID+2477, 188174, 530, 1, 1, -3798.689, -11508.98, -134.8212, 5.061456, 0, 0, 0, 1, 120, 255, 1), -- 188174 (Area: 0)
+(@OGUID+2478, 181392, 530, 1, 1, -249.9205, 5495.466, 36.7147, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3565)
+(@OGUID+2479, 181392, 530, 1, 1, 282.6363, 6085.975, 137.649, 4.747296, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2480, 181392, 530, 1, 1, 2009.813, 6871.413, 188.1808, 4.24115, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3772)
+(@OGUID+2481, 181392, 530, 1, 1, 2163.694, 6745.077, 172.4085, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3772)
+(@OGUID+2482, 181392, 530, 1, 1, 2168.956, 6752.182, 172.4387, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3772)
+(@OGUID+2483, 181392, 530, 1, 1, 2162.737, 6751.214, 172.4385, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3772)
+(@OGUID+2484, 181392, 530, 1, 1, 2169.925, 6745.97, 172.4366, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3772)
+(@OGUID+2485, 181392, 530, 1, 1, 3016.612, 5445.069, 151.877, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3951)
+(@OGUID+2486, 181392, 530, 1, 1, 3026.51, 5497.439, 151.5307, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3951)
+(@OGUID+2487, 181392, 530, 1, 1, 2155.25, 4720.381, 160.9449, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2488, 181392, 530, 1, 1, 2154.756, 4716.656, 160.9547, 3.001947, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3844)
+(@OGUID+2489, 181392, 530, 1, 1, 2035.05, 4693.116, 154.7217, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3844)
+(@OGUID+2490, 181392, 530, 1, 1, 2031.468, 4692.11, 154.7591, 1.884953, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3844)
+(@OGUID+2491, 181392, 530, 1, 1, 2962.525, 3697.009, 150.2677, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2492, 181392, 530, 1, 1, 3061.875, 3647.259, 149.6342, 2.373644, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3712)
+(@OGUID+2493, 181392, 530, 1, 1, 4103.79, 3058.691, 345.6179, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3738)
+(@OGUID+2494, 181392, 530, 1, 1, 4125.446, 3068.064, 345.6248, 3.525572, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3738)
+(@OGUID+2495, 181392, 530, 1, 1, -709.4097, 2704.609, 99.62894, 4.694937, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3538)
+(@OGUID+2496, 181392, 530, 1, 1, -716.9244, 2718.473, 100.4844, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3538)
+(@OGUID+2497, 181392, 530, 1, 1, -717.0001, 2714.823, 100.4722, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3538)
+(@OGUID+2498, 181392, 530, 1, 1, -716.8802, 2742.702, 100.7903, 3.176533, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3538)
+(@OGUID+2499, 181392, 530, 1, 1, -690.7932, 2724.943, 100.9289, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3538)
+(@OGUID+2500, 181392, 530, 1, 1, -2987.704, 4030.75, 7.28573, 2.478367, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3684)
+(@OGUID+2501, 181392, 530, 1, 1, -2923.89, 4017.942, 8.344274, 3.665196, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3684)
+(@OGUID+2502, 181392, 530, 1, 1, -2967.964, 4020.805, 7.264894, 5.67232, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3684)
+(@OGUID+2503, 181392, 530, 1, 1, -2982.132, 3981.363, 8.745137, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3684)
+(@OGUID+2504, 181392, 530, 1, 1, -2931.291, 3931.274, 8.816035, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2505, 181392, 530, 1, 1, -2677.658, 7203.919, 32.99669, 1.204277, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3626)
+(@OGUID+2506, 181392, 530, 1, 1, -2698.241, 7291.552, 49.91637, 5.969027, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3626)
+(@OGUID+2507, 181392, 530, 1, 1, -2713.36, 7298.445, 51.91501, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3626)
+(@OGUID+2508, 181392, 530, 1, 1, -2730.689, 7306.021, 51.7765, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3626)
+(@OGUID+2509, 181392, 530, 1, 1, -2775.226, 7326.033, 51.77103, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3626)
+(@OGUID+2510, 181392, 530, 1, 1, 195.0323, 8490.546, 35.5514, 0.6632232, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2511, 181392, 530, 1, 1, 264.8356, 8492.754, 34.60779, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2512, 181392, 530, 1, 1, 272.1655, 8509.436, 32.72204, 3.700105, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2513, 181392, 530, 1, 1, 219.5999, 8569.107, 33.13798, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2514, 181392, 530, 1, 1, -3022.694, 2624.565, 85.78185, 3.909541, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2515, 181392, 530, 1, 1, -2972.565, 2562.675, 83.66947, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3744)
+(@OGUID+2516, 181392, 530, 1, 1, -2955.605, 2554.495, 110.3285, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3744)
+(@OGUID+2517, 181392, 530, 1, 1, -4010.367, 2155.552, 109.9921, 1.06465, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3745)
+(@OGUID+2518, 181392, 530, 1, 1, -4058.762, 2175.685, 117.8552, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3745)
+(@OGUID+2519, 181392, 571, 1, 1, 5915.079, 710.2083, 646.6064, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4613)
+(@OGUID+2520, 181392, 571, 1, 1, 5915.948, 728.4288, 646.2543, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4620)
+(@OGUID+2521, 181392, 571, 1, 1, 5665.726, 718.7106, 647.9514, 3.368496, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4568)
+(@OGUID+2522, 181392, 571, 1, 1, 6122.517, -1074.911, 407.3852, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4418)
+(@OGUID+2523, 181392, 571, 1, 1, 7801.471, -2961.203, 1263.813, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4441)
+(@OGUID+2524, 181392, 571, 1, 1, 7799.634, -2964.866, 1264.699, 4.171338, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4441)
+(@OGUID+2525, 181392, 571, 1, 1, 4596.626, -4237.616, 181.8922, 2.303831, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2526, 181392, 571, 1, 1, 4551.28, -4238.457, 173.6895, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2527, 181392, 571, 1, 1, 3388.071, -2808.053, 207.0942, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2528, 181392, 571, 1, 1, 3396.49, -2809.565, 207.4137, 5.323256, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2529, 181392, 571, 1, 1, 3389.364, -2800.435, 207.4506, 2.18166, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2530, 181392, 571, 1, 1, 3407.778, -2803.883, 205.8443, 4.520406, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2531, 181392, 571, 1, 1, 3403.195, -2797.129, 217.5549, 0.6806767, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2532, 181392, 571, 1, 1, 3422.459, -2783.034, 207.0113, 3.804818, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4204)
+(@OGUID+2533, 181392, 571, 1, 1, 3431.648, -2776.44, 207.109, 0.6108634, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4204)
+(@OGUID+2534, 181392, 571, 1, 1, 3270.23, -2299.017, 105.3505, 1.047198, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4206)
+(@OGUID+2535, 181392, 571, 1, 1, 3253.434, -2199.932, 127.3124, 5.93412, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4206)
+(@OGUID+2536, 181392, 571, 1, 1, 3280.345, -2211.232, 127.4082, 2.705255, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4206)
+(@OGUID+2537, 181392, 571, 1, 1, 3272.255, -2192.748, 127.4287, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4206)
+(@OGUID+2538, 181392, 571, 1, 1, 2124.927, -2955.563, 154.9684, 1.850049, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4070)
+(@OGUID+2539, 181392, 571, 1, 1, 2127.25, -2962.019, 155.3076, 4.991644, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4070)
+(@OGUID+2540, 181392, 571, 1, 1, 2122.887, -2959.943, 155.2807, 3.47321, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4070)
+(@OGUID+2541, 181392, 571, 1, 1, 2129.331, -2957.729, 155.2842, 0.3665176, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4070)
+(@OGUID+2542, 181392, 571, 1, 1, 2132.394, -2996.245, 155.8432, 0.122173, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2543, 181392, 571, 1, 1, 2125.529, -2997.12, 155.7463, 3.33359, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2544, 181392, 571, 1, 1, 2128.509, -2993.269, 155.7663, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2545, 181392, 571, 1, 1, 2129.307, -3000.026, 155.8247, 4.852017, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2546, 181392, 571, 1, 1, 1465.599, -3290.57, 178.7285, 3.961899, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4071)
+(@OGUID+2547, 181392, 571, 1, 1, 1474.518, -3279.563, 178.9401, 0.8203033, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4071)
+(@OGUID+2548, 181392, 571, 1, 1, 1461.297, -3264.238, 183.4601, 0.8377575, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4071)
+(@OGUID+2549, 181392, 571, 1, 1, 1449.89, -3254.639, 183.1299, 0.9075702, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4071)
+(@OGUID+2550, 181392, 571, 1, 1, 1425.031, -3316.349, 173.5113, 2.094393, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4071)
+(@OGUID+2551, 181392, 571, 1, 1, 1428.773, -3274.498, 181.0417, 4.01426, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4071)
+(@OGUID+2552, 181392, 571, 1, 1, 1431.548, -3252.894, 183.7873, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4071)
+(@OGUID+2553, 181392, 571, 1, 1, 1426.495, -3265.443, 172.1592, 2.426008, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4071)
+(@OGUID+2554, 181392, 571, 1, 1, 713.499, -2931.399, 2.876178, 0.1396245, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3987)
+(@OGUID+2555, 181392, 571, 1, 1, 454.9619, -4528.652, 251.8441, 5.270896, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3991)
+(@OGUID+2556, 181392, 571, 1, 1, 463.7049, -4534.563, 254.9479, 3.717554, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3991)
+(@OGUID+2557, 181392, 571, 1, 1, 465.882, -4545.663, 251.8806, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3991)
+(@OGUID+2558, 181392, 571, 1, 1, 486.4948, -4520.141, 239.7659, 3.735006, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3991)
+(@OGUID+2559, 181392, 571, 1, 1, 445.4201, -4640.561, 253.3178, 2.076939, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3991)
+(@OGUID+2560, 181392, 571, 1, 1, 639.2745, -5012.341, 11.1266, 3.38594, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3981)
+(@OGUID+2561, 181392, 571, 1, 1, 597.412, -5011.138, 9.712256, 6.003934, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3981)
+(@OGUID+2562, 181392, 571, 1, 1, 587.5087, -4945.893, 32.49911, 4.886924, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3981)
+(@OGUID+2563, 181392, 571, 1, 1, 548.7562, -5021.973, 17.47475, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3981)
+(@OGUID+2564, 181392, 571, 1, 1, 578.7986, -4942.297, 23.31465, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3981)
+(@OGUID+2565, 181392, 571, 1, 1, 1960.26, -6117.287, 41.52031, 3.996807, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4000)
+(@OGUID+2566, 181392, 571, 1, 1, 1955.997, -6111.83, 41.53107, 4.084071, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4000)
+(@OGUID+2567, 181392, 571, 1, 1, 1949.33, -6147.306, 31.00299, 2.862335, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4000)
+(@OGUID+2568, 181392, 571, 1, 1, 1872.579, -6219.774, 42.40208, 1.099556, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4000)
+(@OGUID+2569, 181392, 571, 1, 1, 1933.835, -6188.439, 30.40494, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4000)
+(@OGUID+2570, 181392, 571, 1, 1, 1881.401, -6201.038, 33.84504, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4000)
+(@OGUID+2571, 181392, 571, 1, 1, 1966.471, -6119.723, 41.52581, 4.06662, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4000)
+(@OGUID+2572, 181392, 571, 1, 1, 1971.802, -6102.198, 73.7106, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4000)
+(@OGUID+2573, 181392, 571, 1, 1, 2477.306, -5073.561, 291.6375, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4003)
+(@OGUID+2574, 181392, 571, 1, 1, 2475.982, -5063.151, 289.1608, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4003)
+(@OGUID+2575, 181392, 571, 1, 1, 2469.7, -5056.41, 296.0691, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4003)
+(@OGUID+2576, 181392, 571, 1, 1, 2485.302, -5048.401, 296.4124, 1.466076, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4003)
+(@OGUID+2577, 181392, 571, 1, 1, 2496.864, -5066.933, 302.6931, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4003)
+(@OGUID+2578, 181392, 571, 1, 1, 2501.505, -5059.525, 285.9003, 6.161013, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4003)
+(@OGUID+2579, 181392, 571, 1, 1, 2483.536, -5065.366, 301.6975, 3.071766, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4003)
+(@OGUID+2580, 181392, 571, 1, 1, 2673.549, -4383.29, 290.4919, 2.600535, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2581, 181392, 571, 1, 1, 3230.017, -756.3438, 174.0186, 5.288348, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2582, 181392, 571, 1, 1, 3215.221, -748.2292, 173.9813, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2583, 181392, 571, 1, 1, 3243.007, -716.868, 174.0614, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2584, 181392, 571, 1, 1, 3226.663, -687.4913, 176.1088, 5.794494, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2585, 181392, 571, 1, 1, 3221.048, -666.5087, 175.2865, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4186)
+(@OGUID+2586, 181392, 571, 1, 1, 3212.471, -667.382, 175.2803, 2.617989, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4186)
+(@OGUID+2587, 181392, 571, 1, 1, 3203.728, -675.9549, 175.5281, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4186)
+(@OGUID+2588, 181392, 571, 1, 1, 3654.854, -700.4598, 228.6396, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4177)
+(@OGUID+2589, 181392, 571, 1, 1, 3665.362, -707.243, 221.1085, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4177)
+(@OGUID+2590, 181392, 571, 1, 1, 3667.354, -727.1337, 218.3601, 6.126106, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4177)
+(@OGUID+2591, 181392, 571, 1, 1, 3668.153, -722.3611, 218.7, 6.108654, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4177)
+(@OGUID+2592, 181392, 571, 1, 1, 3663.722, -720.0434, 224.0076, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4177)
+(@OGUID+2593, 181392, 571, 1, 1, 3668.486, -717.066, 218.9095, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4177)
+(@OGUID+2594, 181392, 571, 1, 1, 3577.127, 249.5916, 53.55267, 2.460913, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4161)
+(@OGUID+2595, 181392, 571, 1, 1, 3521.09, 240.6755, 53.60065, 0.8901166, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4161)
+(@OGUID+2596, 181392, 571, 1, 1, 3570.422, 301.9106, 53.45552, 4.031712, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4161)
+(@OGUID+2597, 181392, 571, 1, 1, 3515.238, 299.4315, 53.53123, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4161)
+(@OGUID+2598, 181392, 571, 1, 1, 4986.635, 1237.804, 232.5177, 4.293513, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4170)
+(@OGUID+2599, 181392, 571, 1, 1, 5013.381, 1244.962, 238.3039, 5.969027, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4170)
+(@OGUID+2600, 181392, 571, 1, 1, 5006.911, 1195.97, 235.5182, 2.44346, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4170)
+(@OGUID+2601, 181392, 571, 1, 1, 5027.053, 1209.406, 240.235, 1.082103, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4170)
+(@OGUID+2602, 181392, 571, 1, 1, 5027.013, 1209.431, 233.9405, 0.9773831, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4170)
+(@OGUID+2603, 181392, 571, 1, 1, 5544.886, 5730.654, -72.89562, 4.153885, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2604, 181392, 571, 1, 1, 5550.921, 5732.03, -72.89473, 5.742135, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2605, 181392, 571, 1, 1, 5543.419, 5736.716, -72.88883, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2606, 181392, 571, 1, 1, 5549.516, 5738.056, -72.93507, 0.9948372, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2607, 181392, 571, 1, 1, 5569.917, 5759.858, -69.32285, 4.677484, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2608, 181392, 571, 1, 1, 5584.953, 5748.914, -68.31659, 3.281239, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2609, 181392, 571, 1, 1, 5577.761, 5766.71, -69.34008, 6.230826, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2610, 181392, 571, 1, 1, 5562.838, 5767.768, -69.31071, 3.036838, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2611, 181392, 571, 1, 1, 5570.901, 5774.635, -69.3968, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 0)
+(@OGUID+2612, 181392, 571, 1, 1, 4172.988, 5271.836, 40.90479, 2.565632, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4108)
+(@OGUID+2613, 181392, 571, 1, 1, 4165.883, 5280.938, 31.36931, 3.089183, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4108)
+(@OGUID+2614, 181392, 571, 1, 1, 4174.368, 5270.975, 41.0957, 5.637414, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4108)
+(@OGUID+2615, 181392, 571, 1, 1, 4173.983, 5280.55, 30.62882, 6.213374, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4108)
+(@OGUID+2616, 181392, 571, 1, 1, 3464.886, 4177.207, 24.38719, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4037)
+(@OGUID+2617, 181392, 571, 1, 1, 2320.047, 5198.47, 23.71446, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4115)
+(@OGUID+2618, 181392, 571, 1, 1, 2314.894, 5185.276, 23.48018, 4.363324, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4115)
+(@OGUID+2619, 181392, 571, 1, 1, 2303.014, 5208.549, 27.68204, 1.186823, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4115)
+(@OGUID+2620, 181392, 571, 1, 1, 2274.934, 5189.169, 26.13615, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4032)
+(@OGUID+2621, 181392, 571, 1, 1, 2288.641, 5214.336, 27.50825, 1.169369, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4032)
+(@OGUID+2622, 181392, 571, 1, 1, 2270.879, 5210.542, 28.94806, 2.757613, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4032)
+(@OGUID+2623, 181392, 571, 1, 1, 2270.002, 5197.174, 17.32868, 2.740162, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4032)
+(@OGUID+2624, 181392, 571, 1, 1, 2769.89, 6123.314, 96.68723, 3.822273, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4020)
+(@OGUID+2625, 181392, 571, 1, 1, 2815.303, 6165.526, 90.96311, 3.944446, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4129)
+(@OGUID+2626, 181392, 571, 1, 1, 3624.583, 5913.436, 144.8049, 2.094393, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4023)
+(@OGUID+2627, 181392, 571, 1, 1, 3569.432, 6650.181, 201.2051, 0.3141584, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4024)
+(@OGUID+2628, 181392, 571, 1, 1, 3578.573, 6669.501, 200.2971, 5.585054, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4024)
+(@OGUID+2629, 181392, 530, 1, 1, 9790.945, -7316.393, 35.23556, 2.234018, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2630, 181392, 530, 1, 1, 9799.123, -7310.608, 35.23363, 2.199115, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2631, 181392, 530, 1, 1, 9757.145, -7186.155, 23.50618, 2.897245, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2632, 181392, 530, 1, 1, 9752.514, -7336.514, 34.97601, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2633, 181392, 530, 1, 1, 9734.03, -7343.019, 35.02362, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2634, 181392, 530, 1, 1, 9743.402, -7339.749, 34.94567, 1.902409, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2635, 181392, 530, 1, 1, 9724.499, -7346.248, 34.95547, 1.919862, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2636, 181392, 530, 1, 1, 9767.383, -7495.052, 28.28906, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2637, 181392, 530, 1, 1, 9767.382, -7480.58, 28.18164, 3.194002, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2638, 181392, 530, 1, 1, 9694.368, -7495.957, 25.62033, 1.605702, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2639, 181392, 530, 1, 1, 9672.388, -7495.991, 25.67016, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2640, 181392, 530, 1, 1, 9683.361, -7495.406, 26.99795, 1.53589, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2641, 181392, 530, 1, 1, 9638.369, -7397.279, 22.68563, 4.782203, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2642, 181392, 530, 1, 1, 9648.386, -7152.304, 23.26344, 1.570796, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2643, 181392, 530, 1, 1, 9665.867, -7135.831, 23.16022, 3.106652, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2644, 181392, 530, 1, 1, 9648.528, -7119.087, 23.2984, 4.729844, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2645, 181392, 530, 1, 1, 9631.138, -7135.575, 23.11801, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2646, 181392, 530, 1, 1, 9485.029, -7132.405, 24.43083, 0, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3487)
+(@OGUID+2647, 181392, 0, 1, 1, -8260.668, 1204.398, 16.41504, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4411)
+(@OGUID+2648, 181392, 0, 1, 1, -8276.106, 1193.003, 16.38176, 2.495818, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4411)
+(@OGUID+2649, 181392, 0, 1, 1, -8268.55, 1200.73, 16.45654, 2.146753, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4411)
+(@OGUID+2650, 181392, 0, 1, 1, -8238.383, 1200.478, 16.38265, 0.9424766, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4411)
+(@OGUID+2651, 181392, 0, 1, 1, -8246.669, 1204.407, 16.31734, 1.378809, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4411)
+(@OGUID+2652, 181392, 0, 1, 1, -8512.316, 1200.338, 16.39689, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4411)
+(@OGUID+2653, 181392, 0, 1, 1, -8504.936, 1192.633, 16.33525, 0.5410506, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4411)
+(@OGUID+2654, 181392, 0, 1, 1, -8520.524, 1204.205, 16.42972, 1.396262, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4411)
+(@OGUID+2655, 181392, 0, 1, 1, -8542.321, 1200.581, 16.43208, 2.129301, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4411)
+(@OGUID+2656, 181392, 0, 1, 1, -8534.486, 1204.204, 16.40989, 1.745327, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 4411)
+(@OGUID+2657, 181392, 530, 1, 1, -4205.994, -12527.13, 50.12775, 0.7155849, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3576)
+(@OGUID+2658, 181392, 530, 1, 1, -4152.035, -12529.42, 49.52319, 2.670348, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3576)
+(@OGUID+2659, 181392, 530, 1, 1, -4171.053, -13734.39, 82.08741, 2.775069, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3526)
+(@OGUID+2660, 181392, 530, 1, 1, -4054.646, -13772.28, 84.39475, 5.881761, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 3527)
+(@OGUID+2661, 181390, 1, 1, 1, 7460.37, -2500.04, 464.727, 1.658062, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 493)
+(@OGUID+2662, 181390, 1, 1, 1, 7470.38, -2496.05, 464.297, 2.408554, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 493)
+(@OGUID+2663, 181390, 1, 1, 1, 7446.36, -2483.69, 464.979, 6.265733, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 493)
+(@OGUID+2664, 181390, 1, 1, 1, 7447.76, -2494.9, 464.509, 0.7330382, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 493)
+(@OGUID+2665, 181355, 1, 1, 1, 7466.35, -2478.93, 462.023, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 493)
+(@OGUID+2666, 181355, 1, 1, 1, 7477.78, -2130.38, 492.102, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 0)
+(@OGUID+2667, 181390, 1, 1, 1, -1057.544, -259.6851, 168.6741, 1.710422, 0, 0, 0, 1, 120, 255, 1), -- 181390 (Area: 5345)
+(@OGUID+2668, 181401, 1, 1, 1, -2281.77, -330.859, 0.345907, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 222)
+(@OGUID+2669, 181392, 1, 1, 1, -2181, -409.815, 0.081098, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 223)
+(@OGUID+2670, 181392, 1, 1, 1, -2401.17, -390.563, 1.97371, 0.1745321, 0, 0, 0, 1, 120, 255, 1), -- 181392 (Area: 222)
+(@OGUID+2671, 181401, 1, 1, 1, -2281.77, -330.859, 0.345907, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 181401 (Area: 222)
+(@OGUID+2672, 181389, 1, 1, 1, -2329.6, -389.712, -4.72049, 4.049168, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 222)
+(@OGUID+2673, 181389, 1, 1, 1, -2329.57, -389.557, 13.5391, 4.118979, 0, 0, 0, 1, 120, 255, 1), -- 181389 (Area: 222)
+(@OGUID+2674, 181393, 1, 1, 1, -2281.92, -445.378, -2.27773, 5.654869, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 222)
+(@OGUID+2675, 181393, 1, 1, 1, -2346.1, -362.669, -6.45486, 5.899214, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 222)
+(@OGUID+2676, 181393, 1, 1, 1, -2304.88, -420.427, -2.17656, 2.059488, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 222)
+(@OGUID+2677, 181393, 1, 1, 1, -2341.52, -359.36, 5.71917, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 222)
+(@OGUID+2678, 181393, 1, 1, 1, -2319.4, -423.796, -2.1298, 1.448622, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 222)
+(@OGUID+2679, 181393, 1, 1, 1, -2342.03, -353.915, -6.13459, 5.916668, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 222)
+(@OGUID+2680, 181393, 1, 1, 1, -2319.47, -466.969, -2.06943, 3.560473, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 222)
+(@OGUID+2681, 181393, 1, 1, 1, -2286.41, -459.533, -2.33718, 6.248279, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 222)
+(@OGUID+2682, 181393, 1, 1, 1, -2329.6, -456.064, -2.42455, 4.258607, 0, 0, 0, 1, 120, 255, 1), -- 181393 (Area: 222)
+(@OGUID+2683, 181355, 1, 1, 1, -2280.82, -338.377, -9.42493, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 222)
+(@OGUID+2684, 181355, 1, 1, 1, -2289.85, -331.87, -9.42493, 4.642576, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 222)
+(@OGUID+2685, 181355, 1, 1, 1, -2333.27, -386.84, -7.97007, 2.967041, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 222)
+(@OGUID+2686, 181355, 1, 1, 1, -2325.58, -391.288, -7.98294, 5.026549, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 222)
+(@OGUID+2687, 181355, 1, 1, 1, -2371.6, -344.483, -8.95699, 5.829401, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 222)
+(@OGUID+2688, 181355, 1, 1, 1, -2387.83, -329.752, 0.278125, 4.555311, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 222)
+(@OGUID+2689, 181355, 1, 1, 1, -2393.57, -342.369, 0.274165, 1.151916, 0, 0, 0, 1, 120, 255, 1), -- 181355 (Area: 222)
+(@OGUID+2690, 181391, 1, 1, 1, -1224.425, 81.43978, 133.7147, 1.588249, 0, 0, 0, 1, 120, 255, 1), -- 181391 (Area: 5345)
+(@OGUID+2691, 181391, 1, 1, 1, -1228.749, 45.35286, 131.0965, 3.769912, 0, 0, 0, 1, 120, 255, 1); -- 181391 (Area: 5345)
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+2691 AND `eventEntry`=@Event;
+INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+2691;
+
+DELETE FROM `gameobject` WHERE `guid` IN (14100, 14101, 14103, 15114, 15196, 18521, 18523, 18874, 18891, 20978, 20985, 20993, 27068, 27072, 27322, 27553, 28155, 28191, 28195, 28197, 28201, 28202, 28206, 28240, 28242, 28249, 28254);
diff --git a/sql/updates/world/3.3.5/2016_06_30_00_world_335.sql b/sql/updates/world/3.3.5/2016_06_30_00_world_335.sql
new file mode 100644
index 00000000000..a31825e40a5
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_06_30_00_world_335.sql
@@ -0,0 +1,103 @@
+--
+SET @CGUID:=145496; -- 42 Cguid required
+SET @Event:=1;
+DELETE FROM `creature` WHERE `id` = 25535 AND `guid` BETWEEN @CGUID+0 AND @CGUID+34;
+DELETE FROM `creature` WHERE `id` = 25536 AND `guid` BETWEEN @CGUID+35 AND @CGUID+41;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(@CGUID+0, 25535, 1, 1, 1, -1048.8474, 299.9913, 136.2018, 0, 300, 0, 0), -- Thunderbluff
+(@CGUID+1, 25535, 1, 1, 1, -1049.0593, 306.6115, 134.7332, 0, 300, 0, 0), -- Thunderbluff
+(@CGUID+2, 25535, 1, 1, 1, -1042.5935, 306.5972, 136.2431, 0, 300, 0, 0), -- Thunderbluff
+(@CGUID+3, 25535, 1, 1, 1, -1041.5727, 313.1235, 135.0733, 0, 300, 0, 0), -- Thunderbluff
+(@CGUID+4, 25535, 1, 1, 1, -1035.8431, 312.5713, 136.4550, 0, 300, 0, 0), -- Thunderbluff
+(@CGUID+5, 25535, 1, 1, 1, 1915.7028, -4320.4287, 23.6215, 0, 300, 0, 0), -- Orgrimmar
+(@CGUID+6, 25535, 1, 1, 1, 1918.0462, -4314.7939, 24.6562, 0, 300, 0, 0), -- Orgrimmar
+(@CGUID+7, 25535, 1, 1, 1, 1920.3363, -4319.1167, 23.6321, 0, 300, 0, 0), -- Orgrimmar
+(@CGUID+8, 25535, 1, 1, 1, 1923.9064, -4315.2817, 24.2867, 0, 300, 0, 0), -- Orgrimmar
+(@CGUID+9, 25535, 1, 1, 1, 1925.2815, -4321.3115, 23.4577, 0, 300, 0, 0), -- Orgrimmar
+(@CGUID+10, 25535, 0, 1, 1, 1837.1390, 225.5553, 62.0426, 0, 300, 0, 0), -- Undercity
+(@CGUID+11, 25535, 0, 1, 1, 1840.1717, 222.4032, 62.0145, 0, 300, 0, 0), -- Undercity
+(@CGUID+12, 25535, 0, 1, 1, 1838.1589, 218.8164, 61.9465, 0, 300, 0, 0), -- Undercity
+(@CGUID+13, 25535, 0, 1, 1, 1840.9129, 216.1996, 61.8722, 0, 300, 0, 0), -- Undercity
+(@CGUID+14, 25535, 0, 1, 1, 1837.3494, 213.0867, 62.1371, 0, 300, 0, 0), -- Undercity
+(@CGUID+15, 25535, 530, 1, 1, 9817.4580, -7221.3481, 27.9115, 0, 300, 0, 0), -- Silvermoon
+(@CGUID+16, 25535, 530, 1, 1, 9823.5303, -7229.1431, 27.9129, 0, 300, 0, 0), -- Silvermoon
+(@CGUID+17, 25535, 530, 1, 1, 9817.6719, -7227.8506, 27.9026, 0, 300, 0, 0), -- Silvermoon
+(@CGUID+18, 25535, 530, 1, 1, 9819.8994, -7234.4990, 27.9108, 0, 300, 0, 0), -- Silvermoon
+(@CGUID+19, 25535, 530, 1, 1, 9810.4434, -7226.9809, 27.8514, 0, 300, 0, 0), -- Silvermoon
+(@CGUID+20, 25535, 530, 1, 1, -3768.7754, -11511.2832, -132.6796, 0, 300, 0, 0), -- Exodar
+(@CGUID+21, 25535, 530, 1, 1, -3773.2346, -11519.4140, -132.7663, 0, 300, 0, 0), -- Exodar
+(@CGUID+22, 25535, 530, 1, 1, -3776.4026, -11511.5449, -132.7721, 0, 300, 0, 0), -- Exodar
+(@CGUID+23, 25535, 530, 1, 1, -3780.6101, -11514.2666, -132.8303, 0, 300, 0, 0), -- Exodar
+(@CGUID+24, 25535, 530, 1, 1, -3775.3208, -11506.5390, -132.7359, 0, 300, 0, 0), -- Exodar
+(@CGUID+25, 25535, 0, 1, 1, -8818.0068, 865.1570, 100.7713, 0, 300, 0, 0), -- Stormwind
+(@CGUID+26, 25535, 0, 1, 1, -8815.1103, 860.5714, 100.7542, 0, 300, 0, 0), -- Stormwind
+(@CGUID+27, 25535, 0, 1, 1, -8816.6211, 854.2422, 100.6779, 0, 300, 0, 0), -- Stormwind
+(@CGUID+28, 25535, 0, 1, 1, -8825.8057, 845.7718, 100.8559, 0, 300, 0, 0), -- Stormwind
+(@CGUID+29, 25535, 0, 1, 1, -8819.5478, 848.5115, 100.7441, 0, 300, 0, 0), -- Stormwind
+(@CGUID+30, 25535, 0, 1, 1, -4683.9575, -1232.5522, 503.4600, 0, 300, 0, 0), -- Ironforge
+(@CGUID+31, 25535, 0, 1, 1, -4677.2891, -1229.7531, 503.4604, 0, 300, 0, 0), -- Ironforge
+(@CGUID+32, 25535, 0, 1, 1, -4675.4248, -1224.6980, 503.4550, 0, 300, 0, 0), -- Ironforge
+(@CGUID+33, 25535, 0, 1, 1, -4678.7412, -1219.3196, 503.4550, 0, 300, 0, 0), -- Ironforge
+(@CGUID+34, 25535, 0, 1, 1, -4686.2109, -1219.0109, 503.4662, 0, 300, 0, 0), -- Ironforge
+(@CGUID+35, 25536, 1, 1, 1, -1044.1012, 308.1366, 133.8391, 0, 300, 0, 0), -- Thunderbluff
+(@CGUID+36, 25536, 1, 1, 1, 1921.2700, -4316.9766, 22.6557, 0, 300, 0, 0), -- Orgrimmar
+(@CGUID+37, 25536, 0, 1, 1, 1841.7195, 220.2958, 60.8116, 0, 300, 0, 0), -- Undercity
+(@CGUID+38, 25536, 530, 1, 1, 9815.7236, -7229.8100, 26.0966, 0, 300, 0, 0), -- Silvermoon
+(@CGUID+39, 25536, 530, 1, 1, -3772.0854, -11514.6992, -134.5330, 0, 300, 0, 0), -- Exodar
+(@CGUID+40, 25536, 0, 1, 1, -8819.7685, 856.8655, 99.0269, 0, 300, 0, 0), -- Stormwind
+(@CGUID+41, 25536, 0, 1, 1, -4681.69, -1225.61, 501.66, 0, 300, 0, 0); -- Ironforge
+
+DELETE FROM `game_event_creature` WHERE `eventEntry` = 1 AND `guid` BETWEEN @CGUID+0 AND @CGUID+41;
+INSERT INTO `game_event_creature` SELECT @Event, `creature`.`guid` FROM `creature` WHERE `creature`.`guid` BETWEEN @CGUID+0 AND @CGUID+41;
+
+DELETE FROM `creature_addon` WHERE `guid`=46339;
+DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+34;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(@CGUID+0,0,0,0,4097,0,45723),
+(@CGUID+1,0,0,0,4097,0,''),
+(@CGUID+2,0,0,0,4097,0,''),
+(@CGUID+3,0,0,0,4097,0,''),
+(@CGUID+4,0,0,0,4097,0,''),
+(@CGUID+5,0,0,0,4097,0,45723),
+(@CGUID+6,0,0,0,4097,0,''),
+(@CGUID+7,0,0,0,4097,0,''),
+(@CGUID+8,0,0,0,4097,0,''),
+(@CGUID+9,0,0,0,4097,0,''),
+(@CGUID+10,0,0,0,4097,0,45723),
+(@CGUID+11,0,0,0,4097,0,''),
+(@CGUID+12,0,0,0,4097,0,''),
+(@CGUID+13,0,0,0,4097,0,''),
+(@CGUID+14,0,0,0,4097,0,''),
+(@CGUID+15,0,0,0,4097,0,45723),
+(@CGUID+16,0,0,0,4097,0,''),
+(@CGUID+17,0,0,0,4097,0,''),
+(@CGUID+18,0,0,0,4097,0,''),
+(@CGUID+19,0,0,0,4097,0,''),
+(@CGUID+20,0,0,0,4097,0,45723),
+(@CGUID+21,0,0,0,4097,0,''),
+(@CGUID+22,0,0,0,4097,0,''),
+(@CGUID+23,0,0,0,4097,0,''),
+(@CGUID+24,0,0,0,4097,0,''),
+(@CGUID+25,0,0,0,4097,0,45723),
+(@CGUID+26,0,0,0,4097,0,''),
+(@CGUID+27,0,0,0,4097,0,''),
+(@CGUID+28,0,0,0,4097,0,''),
+(@CGUID+29,0,0,0,4097,0,''),
+(@CGUID+30,0,0,0,4097,0,45723),
+(@CGUID+31,0,0,0,4097,0,''),
+(@CGUID+32,0,0,0,4097,0,''),
+(@CGUID+33,0,0,0,4097,0,''),
+(@CGUID+34,0,0,0,4097,0,'');
+
+DELETE FROM `game_event_creature` WHERE `guid` IN (46906,46908,46909,46910,46911,46914,46807,47614,1882);
+INSERT INTO `game_event_creature` (`eventEntry`,`guid`) VALUES
+(1, 46906),
+(1, 46908),
+(1, 46909),
+(1, 46910),
+(1, 46911),
+(1, 46914),
+(1, 46807),
+(1, 47614),
+(1, 1882);
+DELETE FROM `creature` WHERE `id`=26188;
diff --git a/sql/updates/world/3.3.5/2016_07_04_00_world.sql b/sql/updates/world/3.3.5/2016_07_04_00_world.sql
new file mode 100644
index 00000000000..d5c0e5fc05d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_00_world.sql
@@ -0,0 +1,6 @@
+--
+SET @GUID =6028;
+UPDATE `gameobject` SET `spawnMask`=3, `spawntimesecs`=604800 WHERE `guid`=55974;
+DELETE FROM `gameobject` WHERE `guid`=@GUID;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`)VALUES
+(@GUID, 195036, 603, 3, 1, 1757.896, 87.201, 342.384, 0.649495, 0, 0, 0, 1, 604800, 255, 1);
diff --git a/sql/updates/world/3.3.5/2016_07_04_01_world.sql b/sql/updates/world/3.3.5/2016_07_04_01_world.sql
new file mode 100644
index 00000000000..28f18ef6987
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_01_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `SpecialFlags`=0 WHERE `ID`=6962;
diff --git a/sql/updates/world/3.3.5/2016_07_04_02_world.sql b/sql/updates/world/3.3.5/2016_07_04_02_world.sql
new file mode 100644
index 00000000000..5282ae12337
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_02_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `skill_fishing_base_level` SET `skill`=430 WHERE `entry`=4197;
diff --git a/sql/updates/world/3.3.5/2016_07_04_03_world.sql b/sql/updates/world/3.3.5/2016_07_04_03_world.sql
new file mode 100644
index 00000000000..106953e74d7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_03_world.sql
@@ -0,0 +1,12 @@
+--
+UPDATE `creature_template` SET `VehicleId`=732, `unit_flags`=33554432, `InhabitType`=4 WHERE `entry`=40246;
+
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (74890, -75731);
+INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
+(74890, 75055, 0, "Instant Statue"),
+(-75731, -75055, 0, "Instant Statue"),
+(-75731, -74890, 0, "Instant Statue");
+
+DELETE FROM `spell_custom_attr` WHERE `entry`=75731;
+INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES
+(75731, 4096);
diff --git a/sql/updates/world/3.3.5/2016_07_04_04_world.sql b/sql/updates/world/3.3.5/2016_07_04_04_world.sql
new file mode 100644
index 00000000000..0b87d47f638
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_04_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template` SET `QuestType`=2 WHERE `Id`=13070;
diff --git a/sql/updates/world/3.3.5/2016_07_04_05_world.sql b/sql/updates/world/3.3.5/2016_07_04_05_world.sql
new file mode 100644
index 00000000000..d19e8862b45
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_05_world.sql
@@ -0,0 +1,9 @@
+--
+DELETE FROM `creature_queststarter` WHERE `quest`=10888;
+
+DELETE FROM `quest_template_addon` WHERE `ID` IN (10888, 13430);
+INSERT INTO `quest_template_addon` (`ID`, `ExclusiveGroup`) VALUES
+(10888, 10888),
+(13430, 10888);
+
+UPDATE `quest_template_addon` SET `NextQuestID`=13430 WHERE `ID` IN (10884, 10885, 10886);
diff --git a/sql/updates/world/3.3.5/2016_07_04_06_world.sql b/sql/updates/world/3.3.5/2016_07_04_06_world.sql
new file mode 100644
index 00000000000..6cc2a01d03c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_06_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestID`=0 WHERE `ID` IN (11526, 11877);
+UPDATE `quest_template_addon` SET `RequiredSkillID`=762, `RequiredSkillPoints`=225 WHERE `ID`=11526;
diff --git a/sql/updates/world/3.3.5/2016_07_04_07_world.sql b/sql/updates/world/3.3.5/2016_07_04_07_world.sql
new file mode 100644
index 00000000000..ae262760873
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_07_world.sql
@@ -0,0 +1,6 @@
+--
+DELETE FROM `creature_queststarter` WHERE `quest` IN (11520, 11532, 11535, 11538, 11539, 11542, 11545);
+
+DELETE FROM `creature_queststarter` WHERE `quest`=11534;
+INSERT INTO `creature_queststarter` VALUES
+(25034, 11534);
diff --git a/sql/updates/world/3.3.5/2016_07_04_08_world.sql b/sql/updates/world/3.3.5/2016_07_04_08_world.sql
new file mode 100644
index 00000000000..3af82274a98
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_08_world.sql
@@ -0,0 +1,13 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestId`=0 WHERE `Id`=11875;
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (19, 20) AND `SourceEntry`=11875;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(19, 0, 11875, 0, 0, 25, 0, 29354, 0, 0, 0, 0, 0, "", "Quest Gaining the Advantage requires Master Mining learned OR"),
+(20, 0, 11875, 0, 0, 25, 0, 29354, 0, 0, 0, 0, 0, "", "Quest Gaining the Advantage requires Master Mining learned OR"),
+
+(19, 0, 11875, 0, 1, 25, 0, 32678, 0, 0, 0, 0, 0, "", "Quest Gaining the Advantage requires Master Skinning learned OR"),
+(20, 0, 11875, 0, 1, 25, 0, 32678, 0, 0, 0, 0, 0, "", "Quest Gaining the Advantage requires Master Skinning learned OR"),
+
+(19, 0, 11875, 0, 2, 25, 0, 28695, 0, 0, 0, 0, 0, "", "Quest Gaining the Advantage requires Master Herbalism learned"),
+(20, 0, 11875, 0, 2, 25, 0, 28695, 0, 0, 0, 0, 0, "", "Quest Gaining the Advantage requires Master Herbalism learned");
diff --git a/sql/updates/world/3.3.5/2016_07_04_09_world.sql b/sql/updates/world/3.3.5/2016_07_04_09_world.sql
new file mode 100644
index 00000000000..29cb4809078
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_09_world.sql
@@ -0,0 +1,12 @@
+--
+DELETE FROM `conditions` WHERE `SourceEntry` IN (22777, 22776, 22775) AND `SourceTypeOrReferenceId`=23;
+INSERT INTO `conditions` VALUES
+(23, 16444, 22777, 0, 0, 9, 0, 9067, 0, 0, 0, 0, 0, "", "Bundle of Fireworks can be bought only if on quest 'The Party Never Ends'"),
+(23, 16443, 22776, 0, 0, 9, 0, 9067, 0, 0, 0, 0, 0, "", "Springpaw Appetizers can be bought only if on quest 'The Party Never Ends'"),
+(23, 16442, 22775, 0, 0, 9, 0, 9067, 0, 0, 0, 0, 0, "", "Suntouched Special Reserve can be bought only if on quest 'The Party Never Ends'");
+
+DELETE FROM `conditions` WHERE `SourceEntry` IN (1939, 1941, 1942) AND `SourceTypeOrReferenceId`=23;
+INSERT INTO `conditions` VALUES
+(23, 465, 1939, 0, 0, 9, 0, 116, 0, 0, 0, 0, 0, "", "Skin of Sweet Rum can be bought only if on quest 'Dry Times'"),
+(23, 277, 1941, 0, 0, 9, 0, 116, 0, 0, 0, 0, 0, "", "Cask of Merlot can be bought only if on quest 'Dry Times'"),
+(23, 274, 1942, 0, 0, 9, 0, 116, 0, 0, 0, 0, 0, "", "Bottle of Moonshine can be bought only if on quest 'Dry Times'");
diff --git a/sql/updates/world/3.3.5/2016_07_04_10_world.sql b/sql/updates/world/3.3.5/2016_07_04_10_world.sql
new file mode 100644
index 00000000000..564f03ac93b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_10_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `SpecialFlags`=0 WHERE `Id`=75;
diff --git a/sql/updates/world/3.3.5/2016_07_04_11_world.sql b/sql/updates/world/3.3.5/2016_07_04_11_world.sql
new file mode 100644
index 00000000000..e8989d28544
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_11_world.sql
@@ -0,0 +1,20 @@
+--
+SET @ENTRY_THE_LICH_KING := 25462;
+SET @QUEST_IN_SERVICE_OF_THE_LICH_KING := 12593;
+
+-- The Lich King Timed Actionlist
+DELETE FROM `smart_scripts` WHERE (source_type = 9 AND entryorguid = @ENTRY_THE_LICH_KING * 100);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@ENTRY_THE_LICH_KING * 100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 4, 14970, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - On Script - Play Sound 14970'),
+(@ENTRY_THE_LICH_KING * 100, 9, 1, 0, 0, 0, 100, 0, 21000, 21000, 0, 0, 4, 14971, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - On Script - Play Sound 14971'),
+(@ENTRY_THE_LICH_KING * 100, 9, 2, 0, 0, 0, 100, 0, 26000, 26000, 0, 0, 4, 14972, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - On Script - Play Sound 14972');
+
+-- The Lich King Timed Actionlist Trigger
+DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = @ENTRY_THE_LICH_KING);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@ENTRY_THE_LICH_KING, 0, 0, 0, 19, 0, 100, 0, @QUEST_IN_SERVICE_OF_THE_LICH_KING, 0, 0, 0, 80, 2546200, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - On Quest \'In service of The Lich King Taken\' - Run Script');
+
+-- 'In service of The Lich King' quest details
+DELETE FROM `quest_details` WHERE `ID` = @QUEST_IN_SERVICE_OF_THE_LICH_KING;
+INSERT INTO `quest_details` (`ID`, `Emote1`, `Emote2`, `Emote3`, `Emote4`, `EmoteDelay2`, `EmoteDelay3`, `EmoteDelay4`, `EmoteDelay1`, `VerifiedBuild`) VALUES
+(@QUEST_IN_SERVICE_OF_THE_LICH_KING, 396, 397, 396, 396, 500, 1000, 1000, 1000, 20886);
diff --git a/sql/updates/world/3.3.5/2016_07_04_12_world.sql b/sql/updates/world/3.3.5/2016_07_04_12_world.sql
new file mode 100644
index 00000000000..ea56bab8e79
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_12_world.sql
@@ -0,0 +1,27 @@
+-- Add sniffed gossip text to menu
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (8356, 8371);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(8356, 0, 0, 'Reclaim Flanis\'s pack.', 19326,1,1,0,0,0,0,'',0),
+(8371, 0, 0, 'Search the corpse for Kagrosh\'s pack.', 19400,1,1,0,0,0,0,'',0);
+
+-- Migrate NPCs to use SmartAI / remove from C++ script
+UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` IN (21727, 21725, 22112);
+UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` = 23489;
+
+-- Create SmartAI
+DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid IN (21727, 21725, 22112));
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(21727, 0, 0, 1, 62, 0, 100, 0, 8356, 0, 0, 0, 11, 37244, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Flanis Swiftwing - On Gossip Option 0 Selected - Cast Spell'),
+(21727, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Flanis Swiftwing - On Linked Action - Close Gossip'),
+(21725, 0, 0, 1, 62, 0, 100, 0, 8371, 0, 0, 0, 11, 37245, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kagrosh - On Gossip Option 0 Selected - Cast Spell'),
+(21725, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Kagrosh - On Linked Action - Close Gossip'),
+(22112, 0, 0, 0, 19, 0, 100, 0, 10866, 0, 0, 0, 12, 11980, 1, 300000, 0, 0, 0, 8, 0, 0, 0, -4204.94, 316.397, 122.508, 1.309, 'Karynaku - On Quest Accepted - Summon Creature \'Zuluhed the Whacked\''),
+(22112, 0, 1, 0, 19, 0, 100, 0, 10870, 0, 0, 0, 52, 649, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Karynaku - On Quest Accepted - Activate Taxi Path 649');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` IN (8356, 8371, 8754);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,8356,0,0,0,2,0,30658,1,0,1,0,'','Flanis Swiftwing - Show gossip option 0 if player does not have item 30658 in inventory'),
+(15,8356,0,0,0,9,0,10583,0,0,0,0,'','Flanis Swiftwing - Show gossip option 0 if player has accepted quest 10583'),
+(15,8371,0,0,0,2,0,30659,1,0,1,0,'','Kagrosh - Show gossip option 0 if player does not have item 30659 in inventory'),
+(15,8371,0,0,0,9,0,10601,0,0,0,0,'','Kagrosh - Show gossip option 0 if player has accepted quest 10601'),
+(15,8754,0,0,0,5,0,1015,128,0,0,0,'','Drake Dealer Hurlunk - Show gossip option 0 if player is exalted with faction 1015');
diff --git a/sql/updates/world/3.3.5/2016_07_04_13_world.sql b/sql/updates/world/3.3.5/2016_07_04_13_world.sql
new file mode 100644
index 00000000000..cc46a42cbb0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_13_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature` SET `phaseMask`=194 WHERE `id`=30657;
diff --git a/sql/updates/world/3.3.5/2016_07_04_14_world.sql b/sql/updates/world/3.3.5/2016_07_04_14_world.sql
new file mode 100644
index 00000000000..d639b5eefe7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_04_14_world.sql
@@ -0,0 +1,5 @@
+--
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (26022, 26023);
+INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
+(26022, 61417, 2, "Pursuit of Justice Mounted Movement Speed Increase"),
+(26023, 61418, 2, "Pursuit of Justice Mounted Movement Speed Increase");
diff --git a/sql/updates/world/3.3.5/2016_07_05_00_world.sql b/sql/updates/world/3.3.5/2016_07_05_00_world.sql
new file mode 100644
index 00000000000..c2eb2c5118c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_05_00_world.sql
@@ -0,0 +1,21 @@
+SET @CGUID := 11003;
+
+UPDATE `spell_dbc` SET `EffectBasePoints1`=20 WHERE `Id`=70507;
+UPDATE `creature_template` SET `unit_flags`=32832 WHERE `entry` IN(40142,40143,40144,40145);
+UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry` IN (40081,40470,40471,40472);
+
+DELETE FROM `creature` WHERE `guid`=@CGUID;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@CGUID, 40146, 724, 0, 0, 15, 33, 0, 0, 3156.037, 533.2656, 72.97205, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN( 'spell_halion_blazing_aura','spell_halion_combustion_consumption_periodic');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(75886, 'spell_halion_blazing_aura'),
+(75887, 'spell_halion_blazing_aura'),
+(74803, 'spell_halion_combustion_consumption_periodic'),
+(74629, 'spell_halion_combustion_consumption_periodic');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN(75886,75887);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 2, 75886, 0, 0, 31, 0, 3, 40683, 0, 0, 0, 0, '', 'Blazing Aura can only target Living Embers'),
+(13, 2, 75887, 0, 0, 31, 0, 3, 40683, 0, 0, 0, 0, '', 'Blazing Aura can only target Living Embers');
diff --git a/sql/updates/world/3.3.5/2016_07_05_01_world.sql b/sql/updates/world/3.3.5/2016_07_05_01_world.sql
new file mode 100644
index 00000000000..f0319889412
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_05_01_world.sql
@@ -0,0 +1,5 @@
+SET @CGUID := 11003;
+
+DELETE FROM `creature` WHERE `id`=40146;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@CGUID, 40146, 724, 0, 0, 15, 33, 0, 0, 3156.037, 533.2656, 72.97205, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_07_05_02_world.sql b/sql/updates/world/3.3.5/2016_07_05_02_world.sql
new file mode 100644
index 00000000000..2921c19b0c1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_05_02_world.sql
@@ -0,0 +1 @@
+UPDATE `command` SET `help` = 'Syntax: .cometome\nMake selected creature come to your current location (new position not saved to DB).' WHERE `command`.`name` = 'cometome';
diff --git a/sql/updates/world/3.3.5/2016_07_05_03_world.sql b/sql/updates/world/3.3.5/2016_07_05_03_world.sql
new file mode 100644
index 00000000000..6a91e39c26c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_05_03_world.sql
@@ -0,0 +1,22 @@
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (29531, 45390, 29726);
+INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
+(29726, 45406, 1, "Holiday - Midsummer, Ribbon Pole Periodic Visual");
+
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (45390, 45406);
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(45406, "spell_gen_ribbon_pole_dancer_check");
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=29726;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 29726, 0, 0, 31, 0, 3, 17066, 0, 0, 0, 0, "", "Spell 'Test Ribbon Pole Channel' targets creature 'Ribbon Pole Debug Target'");
+UPDATE `gameobject_template` SET `ScriptName`="go_midsummer_ribbon_pole" WHERE `entry`=181605;
+
+DELETE FROM `disables` WHERE `sourceType`=0 AND `entry` IN (46836, 46842);
+INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES
+(0, 46836, 64, 0, "", "Spell Flame Patch - Ignore LOS"),
+(0, 46842, 64, 0, "", "Spell Flame Ring - Ignore LOS");
+
+UPDATE `creature_template_addon` SET `bytes1`=33554688 WHERE `entry`=17066;
+DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id`=17066);
+UPDATE `creature` SET `MovementType`=0, `spawndist`=0 WHERE `id`=17066;
+UPDATE `creature_template` SET `ScriptName`="npc_midsummer_bunny_pole" WHERE `entry`=17066;
diff --git a/sql/updates/world/3.3.5/2016_07_06_00_world.sql b/sql/updates/world/3.3.5/2016_07_06_00_world.sql
new file mode 100644
index 00000000000..3875299dde0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_06_00_world.sql
@@ -0,0 +1,5 @@
+--
+SET @GUID := 12459;
+DELETE FROM `creature` WHERE `guid` IN (@GUID);
+INSERT INTO `creature` (`guid`, `id`, `map`, `SpawnMask`, `modelid`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(@GUID, 6491, 571, 1, 0, 4105.362, -4818.6, 76.074, 0.149361, 7200, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_07_06_01_world.sql b/sql/updates/world/3.3.5/2016_07_06_01_world.sql
new file mode 100644
index 00000000000..8275d04461c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_06_01_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_addon` SET `bytes1`=0, `auras`=45787 WHERE `guid`=97150;
diff --git a/sql/updates/world/3.3.5/2016_07_06_02_world.sql b/sql/updates/world/3.3.5/2016_07_06_02_world.sql
new file mode 100644
index 00000000000..954a82b5a8e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_06_02_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128, `unit_flags`=`unit_flags`|768 WHERE `entry` IN (26468, 26469, 26470);
diff --git a/sql/updates/world/3.3.5/2016_07_06_03_world.sql b/sql/updates/world/3.3.5/2016_07_06_03_world.sql
new file mode 100644
index 00000000000..db205700124
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_06_03_world.sql
@@ -0,0 +1,24 @@
+UPDATE `creature_template` SET `ScriptName`='',`AIName`='SmartAI' WHERE `entry`IN(15186,16069,15358,16445,15361);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(15186,16069,15358,16445,15361) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=1518600 AND `source_type`=9;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(15186, 0, 1, 0, 1, 0, 100, 0, 180000, 300000, 450000, 900000, 80, 1518600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Murky - OOC - Run Script'),
+(15186, 0, 2, 3, 25, 0, 100, 0, 0, 0, 0, 0, 11, 24983, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Murky - On Reset - Cast Baby Murloc Passive'),
+(15186, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Murky - On Reset - Set Emote State'),
+(16069, 0, 1, 0, 1, 0, 100, 0, 180000, 300000, 450000, 900000, 80, 1518600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gurky - OOC - Run Script'),
+(16069, 0, 2, 3, 25, 0, 100, 0, 0, 0, 0, 0, 11, 24983, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gurky - On Reset - Cast Baby Murloc Passive'),
+(16069, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gurky - On Reset - Set Emote State'),
+(15358, 0, 1, 0, 1, 0, 100, 0, 180000, 300000, 450000, 900000, 80, 1518600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lurky - OOC - Run Script'),
+(15358, 0, 2, 3, 25, 0, 100, 0, 0, 0, 0, 0, 11, 24983, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lurky - On Reset - Cast Baby Murloc Passive'),
+(15358, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Lurky - On Reset - Set Emote State'),
+(16445, 0, 1, 0, 1, 0, 100, 0, 180000, 300000, 450000, 900000, 80, 1518600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Terky - OOC - Run Script'),
+(16445, 0, 2, 3, 25, 0, 100, 0, 0, 0, 0, 0, 11, 24983, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Terky - On Reset - Cast Baby Murloc Passive'),
+(16445, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Terky - On Reset - Set Emote State'),
+(15361, 0, 1, 0, 1, 0, 100, 0, 180000, 300000, 450000, 900000, 80, 1518600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Murki - OOC - Run Script'),
+(15361, 0, 2, 3, 25, 0, 100, 0, 0, 0, 0, 0, 11, 24983, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Murki - On Reset - Cast Baby Murloc Passive'),
+(15361, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Murki - On Reset - Set Emote State'),
+(1518600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 17, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Baby Murloc - Script - Set Emote State'),
+(1518600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 25165, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Baby Murloc - Script - Cast Baby Murloc Dance'),
+(1518600, 9, 2, 0, 0, 0, 100, 0, 15000, 15000, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Baby Murloc - Script - Set Emote State');
diff --git a/sql/updates/world/3.3.5/2016_07_07_00_world.sql b/sql/updates/world/3.3.5/2016_07_07_00_world.sql
new file mode 100644
index 00000000000..edfb3fe7c28
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_07_00_world.sql
@@ -0,0 +1,6 @@
+--
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (1986, 1994);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (1986, 1994) AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(1986, 0, 0, 0, 0, 0, 100, 0, 3000, 7000, 3000, 7000, 11, 6751, 32, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Webwood Spider - In Combat - Cast \'Weak Poison\''),
+(1994, 0, 0, 0, 0, 0, 100, 0, 4000, 9000, 4000, 9000, 11, 11918, 32, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Githyiss the Vile - In Combat - Cast \'Poison\'');
diff --git a/sql/updates/world/3.3.5/2016_07_07_01_world.sql b/sql/updates/world/3.3.5/2016_07_07_01_world.sql
new file mode 100644
index 00000000000..e88a8173b9f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_07_01_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `conditions` WHERE `SourceEntry`=4170 AND `SourceTypeOrReferenceId`=13;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 4170, 0, 0, 31, 0, 3, 2775, 0, 0, 0, 0, "", "Cannon Ball can only hit \'Daggerspine Marauder\'");
diff --git a/sql/updates/world/3.3.5/2016_07_07_02_world.sql b/sql/updates/world/3.3.5/2016_07_07_02_world.sql
new file mode 100644
index 00000000000..90193d3ab45
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_07_02_world.sql
@@ -0,0 +1,82 @@
+--
+DELETE FROM `quest_details` WHERE `ID` IN (997, 6182, 6183, 6184, 6186, 7441, 9424, 9446, 9474, 9496, 9589, 9607, 9697, 9701, 9702, 9708, 9709, 9715, 9717, 9719, 9724, 9726, 9727, 9738, 9789, 9854, 9855, 9951, 9957, 9968, 9971, 9978, 9979, 10096,11576,11582,11587,11590,11646,11648,11663,11671,11679,11682,11900,11905,11911,11912,11914,11918,11919,11931,11936,11946,11951,11957,11984,11989,11990,11991,12037,12042,12068,12113,12114,12120,12123,12152,12190,12657,12766,264, 833, 857, 862, 1106, 9534,10177, 11538);
+INSERT INTO `quest_details` (`ID`, `Emote1`, `Emote2`, `Emote3`, `Emote4`, `EmoteDelay1`, `EmoteDelay2`, `EmoteDelay3`, `EmoteDelay4`, `VerifiedBuild`) VALUES
+(6182, 1, 1, 1, 1, 1000, 2000, 3000, 4000, 12340),
+(6183, 1, 1, 1, 6, 1000, 2000, 3000, 4000, 12340),
+(6184, 1, 1, 1, 1, 1000, 2000, 3000, 4000, 12340),
+(6186, 33, 1, 1, 25, 1000, 2000, 3000, 4000, 12340),
+(7441, 1, 1, 1, 1, 500, 1000, 1500, 2000, 12340),
+(9424, 0, 0, 0, 0, 500, 0, 0, 0, 12340),
+(9446, 1, 6, 0, 0, 0, 1000, 0, 0, 12340),
+(9474, 1, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(9496, 1, 0, 0, 0, 0, 0, 0, 0, 12340),
+(9589, 1, 1, 6, 0, 0, 1000, 1000, 0, 12340),
+(9607, 1, 6, 0, 0, 0, 1000, 0, 0, 12340),
+(9697, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(9701, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(9702, 6, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(9708, 1, 1, 6, 0, 0, 1000, 1000, 0, 12340),
+(9709, 1, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(9715, 1, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(9717, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(9719, 1, 1, 6, 0, 0, 1000, 1000, 0, 12340),
+(9724, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(9726, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(9727, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(9738, 1, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(9789, 6, 1, 11, 0, 0, 1000, 1000, 0, 12340),
+(9854, 6, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(9855, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(9951, 5, 1, 5, 0, 0, 1000, 1000, 0, 12340),
+(9957, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(9968, 1, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(9971, 1, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(9978, 1, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(9979, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(10096, 1, 1, 6, 0, 0, 0, 1000, 0, 12340),
+(11576, 2, 1, 1, 0, 0, 500, 1000, 0, 12340),
+(11582, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11587, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11590, 1, 1, 1, 0, 0, 1000, 500, 0, 12340),
+(11646, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11648, 1, 1, 0, 0, 0, 500, 0, 0, 12340),
+(11663, 5, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11671, 1, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(11679, 5, 1, 1, 0, 0, 1000, 500, 0, 12340),
+(11682, 2, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11900, 5, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11905, 1, 5, 1, 0, 0, 500, 1000, 0, 12340),
+(11911, 1, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(11912, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11914, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11918, 1, 1, 1, 0, 0, 500, 500, 0, 12340),
+(11919, 1, 1, 1, 0, 0, 500, 500, 0, 12340),
+(11931, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11936, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11946, 1, 1, 1, 0, 0, 1000, 500, 0, 12340),
+(11951, 1, 1, 1, 0, 0, 500, 1000, 0, 12340),
+(11957, 1, 1, 1, 0, 0, 1000, 1000, 0, 12340),
+(11984, 1, 1, 1, 0, 0, 500, 1000, 0, 12340),
+(11989, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11990, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(11991, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(12037, 1, 1, 0, 0, 0, 500, 0, 0, 12340),
+(12042, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(12068, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(12113, 1, 6, 0, 0, 0, 1000, 0, 0, 12340),
+(12114, 5, 1, 5, 0, 0, 1000, 0, 0, 12340),
+(12120, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(12123, 273, 1, 1, 0, 2000, 0, 0, 0, 12340),
+(12152, 1, 1, 0, 0, 0, 1000, 0, 0, 12340),
+(12190, 1, 1, 0, 0, 0, 500, 0, 0, 12340),
+(12657, 396, 15, 396, 0, 1000, 2000, 2000, 2000, 12340),
+(12766, 1, 6, 1, 0, 1000, 0, 0, 0, 12340),
+(997, 6, 1, 0, 0, 0, 1000, 0, 0, 15595),
+(264, 1, 0, 0, 0, 0, 0, 0, 0, 12340),
+(833, 4, 0, 0, 0, 0, 0, 0, 0, 12340),
+(857, 4, 0, 0, 0, 0, 0, 0, 0, 12340),
+(862, 4, 0, 0, 0, 0, 0, 0, 0, 12340),
+(1106, 4, 0, 0, 0, 0, 0, 0, 0, 12340),
+(9534, 4, 0, 0, 0, 0, 0, 0, 0, 12340),
+(10177, 4, 0, 0, 0, 0, 0, 0, 0, 12340),
+(11538, 4, 0, 0, 0, 0, 0, 0, 0, 12340);
diff --git a/sql/updates/world/3.3.5/2016_07_07_03_world.sql b/sql/updates/world/3.3.5/2016_07_07_03_world.sql
new file mode 100644
index 00000000000..3af1cdd1fb6
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_07_03_world.sql
@@ -0,0 +1,7 @@
+--
+DELETE FROM `creature_queststarter` WHERE `quest` IN (3763, 3789, 3790, 3803);
+INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
+(6735, 3763),
+(6740, 3789),
+(5111, 3790),
+(4217, 3803);
diff --git a/sql/updates/world/3.3.5/2016_07_07_04_world.sql b/sql/updates/world/3.3.5/2016_07_07_04_world.sql
new file mode 100644
index 00000000000..0747a024a0a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_07_04_world.sql
@@ -0,0 +1,4 @@
+--
+ALTER TABLE `gossip_menu` ADD COLUMN `VerifiedBuild` SMALLINT(5) NOT NULL DEFAULT '0';
+ALTER TABLE `gossip_menu_option` ADD COLUMN `VerifiedBuild` SMALLINT(5) NOT NULL DEFAULT '0';
+UPDATE `gossip_menu` SET `VerifiedBuild`=-1 where `entry` >49999;
diff --git a/sql/updates/world/3.3.5/2016_07_07_05_world.sql b/sql/updates/world/3.3.5/2016_07_07_05_world.sql
new file mode 100644
index 00000000000..fa6a9ede9f7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_07_05_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `InhabitType`=1 WHERE `entry` IN (25613, 23665);
diff --git a/sql/updates/world/3.3.5/2016_07_09_00_world.sql b/sql/updates/world/3.3.5/2016_07_09_00_world.sql
new file mode 100644
index 00000000000..87b6865e8a6
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_09_00_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=29420;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(17, 0, 29420, 0, 0, 31, 0, 3, 15644, 0, 0, 0, 0, "", "Spell 'Wretched Tap' can only be cast by creature 'Wretched Urchin'");
diff --git a/sql/updates/world/3.3.5/2016_07_10_00_world.sql b/sql/updates/world/3.3.5/2016_07_10_00_world.sql
new file mode 100644
index 00000000000..06f6e89de2d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_10_00_world.sql
@@ -0,0 +1,3 @@
+--
+DELETE FROM `creature_loot_template` WHERE `Item` IN (5058, 5359, 6083, 33348);
+UPDATE `creature_template` SET `lootid`=0 WHERE `entry`=4661;
diff --git a/sql/updates/world/3.3.5/2016_07_10_01_world.sql b/sql/updates/world/3.3.5/2016_07_10_01_world.sql
new file mode 100644
index 00000000000..11a04a8af30
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_10_01_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestID`=882 WHERE `ID`=6382;
diff --git a/sql/updates/world/3.3.5/2016_07_10_02_world.sql b/sql/updates/world/3.3.5/2016_07_10_02_world.sql
new file mode 100644
index 00000000000..57ff1fd9cca
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_10_02_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `creature_loot_template` WHERE `Item` IN (2996, 2997, 4305, 4339, 14048);
diff --git a/sql/updates/world/3.3.5/2016_07_10_03_world.sql b/sql/updates/world/3.3.5/2016_07_10_03_world.sql
new file mode 100644
index 00000000000..a63b75d0e0f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_10_03_world.sql
@@ -0,0 +1,13 @@
+--
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=5236 AND `id`=5;
+UPDATE `smart_scripts` SET `event_param1`=1200, `comment`="Gordunni Shaman - Friendly Missing 1200 Health - Cast 'Healing Wave'" WHERE `source_type`=0 AND `entryorguid`=5236 AND `id`=4;
+
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=5240;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(5240,0,0,0,0,0,100,0,0,0,4000,4000,11,20298,64,0,0,0,0,2,0,0,0,0,0,0,0,"Gordunni Warlock - Combat CMC - Cast 'Shadow Bolt'"),
+(5240,0,1,0,0,0,100,0,0,0,20000,25000,11,7289,65,0,0,0,0,2,0,0,0,0,0,0,0,"Gordunni Warlock - Combat CMC - Cast 'Shrink'");
+
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=5237;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(5237,0,0,0,0,0,100,0,0,0,4000,4000,11,9532,64,0,0,0,0,2,0,0,0,0,0,0,0,"Gordunni Ogre Mage - Combat CMC - Cast 'Lightning Bolt'"),
+(5237,0,1,0,2,0,100,1,0,30,0,0,11,6742,1,0,0,0,0,1,0,0,0,0,0,0,0,"Gordunni Ogre Mage - Between 0-30% Health - Cast 'Bloodlust' (No Repeat)");
diff --git a/sql/updates/world/3.3.5/2016_07_10_04_world.sql b/sql/updates/world/3.3.5/2016_07_10_04_world.sql
new file mode 100644
index 00000000000..343b4585da9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_10_04_world.sql
@@ -0,0 +1,4 @@
+--
+UPDATE `quest_offer_reward` SET `RewardText`="Ah, a new bundle of hides. I will get to work on these immediately!$B$BThank you, $Gbrother:sister;. You have done me a great service. Here are some coins to pay for your time and travel costs." WHERE `ID`=6362;
+UPDATE `quest_offer_reward` SET `RewardText`="This troll tablet must be the \"secret\" that Rin'ji was talking about.$B$BCovered with strange markings, you can not decipher what the tablet says." WHERE `ID`=2742;
+UPDATE `page_text` SET `Text`="Mr. Fizzlebub,$B$BThe beverage you gave my associate was a huge success. Not only is the drink strong, causing a huge dulling of wits, it seems to have an addictive quality. I'm sure those who have tried it will crave more.$B$BWe are indebted to you, Crank.$B$BAnd I invite you to come to Shimmering Flats, or to send a confidante, to take advantage of the new gambling opportunities we have here.$B$B--Kravel" WHERE `ID`=440;
diff --git a/sql/updates/world/3.3.5/2016_07_10_05_world.sql b/sql/updates/world/3.3.5/2016_07_10_05_world.sql
new file mode 100644
index 00000000000..46d0cd341fe
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_10_05_world.sql
@@ -0,0 +1,7 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=3397 AND `SourceGroup`=3;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(22, 3, 3397, 0, 0, 29, 0, 3395, 200, 0, 1, 0, 0, "", "Prevent summoning creature Verog the Dervish if already summoned");
+
+UPDATE `smart_scripts` SET `action_param2`=6, `action_param3`=20000 WHERE `source_type`=0 AND `entryorguid`=3397 AND `id`=3;
+UPDATE `smart_scripts` SET `event_chance`=20 WHERE `source_type`=0 AND `entryorguid`=3397 AND `id`=2;
diff --git a/sql/updates/world/3.3.5/2016_07_10_06_world.sql b/sql/updates/world/3.3.5/2016_07_10_06_world.sql
new file mode 100644
index 00000000000..7594560ce2a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_10_06_world.sql
@@ -0,0 +1,13 @@
+--
+UPDATE `creature_loot_template` SET `Chance`=100 WHERE `Item`=5877;
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=1 AND `SourceEntry`=5877;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(1, 4130, 5877, 0, 0, 8, 0, 1147, 0, 0, 0, 0, 0, "", "Item 'Cracked Silithid Carapace' can be looted if quest 'The Swarm Grows' is taken OR"),
+(1, 4131, 5877, 0, 0, 8, 0, 1147, 0, 0, 0, 0, 0, "", "Item 'Cracked Silithid Carapace' can be looted if quest 'The Swarm Grows' is taken OR"),
+(1, 4132, 5877, 0, 0, 8, 0, 1147, 0, 0, 0, 0, 0, "", "Item 'Cracked Silithid Carapace' can be looted if quest 'The Swarm Grows' is taken OR"),
+(1, 4133, 5877, 0, 0, 8, 0, 1147, 0, 0, 0, 0, 0, "", "Item 'Cracked Silithid Carapace' can be looted if quest 'The Swarm Grows' is taken OR"),
+(1, 4130, 5877, 0, 1, 9, 0, 1147, 0, 0, 0, 0, 0, "", "Item 'Cracked Silithid Carapace' can be looted if quest 'The Swarm Grows' is rewarded"),
+(1, 4131, 5877, 0, 1, 9, 0, 1147, 0, 0, 0, 0, 0, "", "Item 'Cracked Silithid Carapace' can be looted if quest 'The Swarm Grows' is rewarded"),
+(1, 4132, 5877, 0, 1, 9, 0, 1147, 0, 0, 0, 0, 0, "", "Item 'Cracked Silithid Carapace' can be looted if quest 'The Swarm Grows' is rewarded"),
+(1, 4133, 5877, 0, 1, 9, 0, 1147, 0, 0, 0, 0, 0, "", "Item 'Cracked Silithid Carapace' can be looted if quest 'The Swarm Grows' is rewarded");
diff --git a/sql/updates/world/3.3.5/2016_07_10_07_world.sql b/sql/updates/world/3.3.5/2016_07_10_07_world.sql
new file mode 100644
index 00000000000..03fb6fd6db4
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_10_07_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_loot_template` SET `Chance`=50 WHERE `Item`=33009;
diff --git a/sql/updates/world/3.3.5/2016_07_10_09_world.sql b/sql/updates/world/3.3.5/2016_07_10_09_world.sql
new file mode 100644
index 00000000000..67e6ce625e9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_10_09_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `mail_level_reward` WHERE `level`=77 AND `mailTemplateId`=265;
+INSERT INTO `mail_level_reward` (`level`, `raceMask`, `mailTemplateId`, `senderEntry`) VALUES
+(77, 1791, 265, 33817);
diff --git a/sql/updates/world/3.3.5/2016_07_12_00_world.sql b/sql/updates/world/3.3.5/2016_07_12_00_world.sql
new file mode 100644
index 00000000000..dd910e8c712
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_12_00_world.sql
@@ -0,0 +1,24 @@
+--
+UPDATE `creature` SET `position_x`=-138.96708, `position_y`=2216.8854, `position_z`=35.23352 WHERE `guid`=201066;
+UPDATE `creature` SET `position_x`=-139.10365, `position_y`=2206.1518, `position_z`=35.23352 WHERE `guid`=200966;
+UPDATE `creature` SET `position_x`=-170.46333, `position_y`=2211.5104, `position_z`=35.23444, `orientation`=0.0573 WHERE `guid`=201107;
+UPDATE `creature` SET `position_x`=-173.38168, `position_y`=2205.6416, `position_z`=35.23344, `orientation`=0.0573 WHERE `guid`=201146;
+UPDATE `creature` SET `position_x`=-215.74542, `position_y`=2210.8286, `position_z`=35.23345 WHERE `guid`=201080;
+UPDATE `creature` SET `spawnMask`=10, `position_x`=-240.49464, `position_y`=2216.4948, `position_z`=42.56450 WHERE `guid`=201090;
+
+SET @Guid:=86240;
+DELETE FROM `creature` WHERE `guid` BETWEEN @Guid AND @Guid+12;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@Guid+0, 37011, 631, 0, 0, 15, 1, 0, 0, -118.939, 2191.25, 32.522, 5.48788, 300, 0, 0, 1575000, 0, 0, 0, 0, 0, 0),
+(@Guid+1, 37011, 631, 0, 0, 15, 1, 0, 0, -103.527, 2211.8, 31.0923, 6.22616, 300, 0, 0, 1575000, 0, 0, 0, 0, 0, 0),
+(@Guid+2, 37011, 631, 0, 0, 15, 1, 0, 0, -117.35, 2230.88, 32.3868, 0.894935, 300, 0, 0, 1575000, 0, 0, 0, 0, 0, 0),
+(@Guid+3, 37011, 631, 0, 0, 15, 1, 0, 0, -172.569, 2217.53, 35.2335, 6.24856, 300, 0, 0, 1575000, 0, 0, 0, 0, 0, 0),
+(@Guid+4, 37011, 631, 0, 0, 10, 1, 0, 0, -167.622, 2166.53, 37.9851, 2.00976, 300, 0, 0, 1575000, 0, 0, 0, 0, 0, 0),
+(@Guid+5, 37011, 631, 0, 0, 10, 1, 0, 0, -161.425, 2256.88, 37.9853, 4.01646, 300, 0, 0, 1575000, 0, 0, 0, 0, 0, 0),
+(@Guid+6, 37012, 631, 0, 0, 10, 1, 0, 1, -198.303, 2215.24, 35.2334, 0.0689005, 300, 0, 0, 1134000, 0, 0, 0, 0, 0, 0),
+(@Guid+7, 37012, 631, 0, 0, 10, 1, 0, 1, -197.742, 2207.1, 35.2334, 0.0689005, 300, 0, 0, 1134000, 0, 0, 0, 0, 0, 0),
+(@Guid+8, 36724, 631, 0, 0, 10, 1, 0, 0, -212.28, 2222.43, 35.2335, 6.20612, 300, 0, 0, 1260000, 99850, 0, 0, 0, 0, 0),
+(@Guid+9, 36724, 631, 0, 0, 10, 1, 0, 0, -213.399, 2199.63, 35.234, 6.1472, 300, 0, 0, 1260000, 99850, 0, 0, 0, 0, 0),
+(@Guid+10, 36724, 631, 0, 0, 10, 1, 0, 0, -240.447, 2207.22, 42.5645, 0.00512781, 300, 0, 0, 1260000, 99850, 0, 0, 0, 0, 0),
+(@Guid+11, 37012, 631, 0, 0, 10, 1, 0, 1, -303.076, 2225.2, 41.9796, 6.12287, 300, 0, 0, 1134000, 0, 0, 0, 0, 0, 0),
+(@Guid+12, 37012, 631, 0, 0, 10, 1, 0, 1, -302.821, 2198.51, 41.9806, 6.26345, 300, 0, 0, 1134000, 0, 0, 0, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_07_12_01_world.sql b/sql/updates/world/3.3.5/2016_07_12_01_world.sql
new file mode 100644
index 00000000000..b717b3ad474
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_12_01_world.sql
@@ -0,0 +1,8 @@
+--
+SET @Guid:=52664;
+DELETE FROM `creature` WHERE `guid` BETWEEN @Guid AND @Guid+3;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@Guid+0, 36811, 631, 0, 0, 10, 1, 0, 1, -568.121, 2225.85, 49.4766, 3.12087, 300, 0, 0, 808800, 91600, 0, 0, 0, 0, 0),
+(@Guid+1, 36811, 631, 0, 0, 10, 1, 0, 1, -568.878, 2197.52, 49.4766, 2.93833, 300, 0, 0, 808800, 91600, 0, 0, 0, 0, 0),
+(@Guid+2, 36807, 631, 0, 0, 10, 1, 0, 0, -582.666, 2221.75, 49.4766, 3.32411, 300, 0, 0, 808800, 91600, 0, 0, 0, 0, 0),
+(@Guid+3, 36807, 631, 0, 0, 10, 1, 0, 0, -583.898, 2200.98, 49.4766, 3.00995, 300, 0, 0, 808800, 91600, 0, 0, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_07_12_02_world.sql b/sql/updates/world/3.3.5/2016_07_12_02_world.sql
new file mode 100644
index 00000000000..81991efe3e5
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_12_02_world.sql
@@ -0,0 +1,19 @@
+--
+SET @Guid:=91573;
+DELETE FROM `creature` WHERE `guid` BETWEEN @Guid AND @Guid+14;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@Guid+0, 37595, 631, 0, 0, 10, 1, 0, 1, 4517.7, 2761.09, 351.101, 0.973106, 300, 0, 0, 1294080, 91600, 0, 0, 0, 0, 0),
+(@Guid+1, 37664, 631, 0, 0, 10, 1, 0, 0, 4517.5, 2777.68, 351.101, 5.28887, 300, 0, 0, 1294080, 91600, 0, 0, 0, 0, 0),
+(@Guid+2, 37595, 631, 0, 0, 10, 1, 0, 1, 4624.9, 2779.31, 361.163, 2.14492, 300, 0, 0, 1294080, 91600, 0, 0, 0, 0, 0),
+(@Guid+3, 37666, 631, 0, 0, 10, 1, 0, 1, 4614.96, 2792.25, 361.163, 5.36904, 300, 0, 0, 2156960, 0, 0, 0, 0, 0, 0),
+(@Guid+4, 37595, 631, 0, 0, 10, 1, 0, 1, 4615.84, 2742.08, 361.165, 0.90562, 300, 0, 0, 1294080, 91600, 0, 0, 0, 0, 0),
+(@Guid+5, 37595, 631, 0, 0, 10, 1, 0, 1, 4625.39, 2754.32, 361.165, 4.14067, 300, 0, 0, 1294080, 91600, 0, 0, 0, 0, 0),
+(@Guid+6, 37662, 631, 0, 0, 15, 1, 0, 1, 4653.53, 2813.54, 361.173, 4.70146, 300, 0, 0, 1725440, 91600, 0, 0, 0, 0, 0),
+(@Guid+7, 37665, 631, 0, 0, 15, 1, 0, 1, 4656.46, 2811.54, 361.174, 4.58836, 300, 0, 0, 1725440, 91600, 0, 0, 0, 0, 0),
+(@Guid+8, 37666, 631, 0, 0, 15, 1, 0, 1, 4660.2, 2811.7, 361.178, 4.58836, 300, 0, 0, 2156960, 0, 0, 0, 0, 0, 0),
+(@Guid+9, 37666, 631, 0, 0, 10, 1, 0, 1, 4573.82, 2865.49, 384.686, 4.73412, 300, 0, 0, 2156960, 0, 0, 0, 0, 0, 0),
+(@Guid+10, 37666, 631, 0, 0, 10, 1, 0, 1, 4582.47, 2850.06, 384.686, 2.50044, 300, 0, 0, 2156960, 0, 0, 0, 0, 0, 0),
+(@Guid+11, 37666, 631, 0, 0, 10, 1, 0, 1, 4581.6, 2688.63, 384.684, 3.81672, 300, 0, 0, 2156960, 0, 0, 0, 0, 0, 0),
+(@Guid+12, 37666, 631, 0, 0, 10, 1, 0, 1, 4573.08, 2674.56, 384.684, 1.65374, 300, 0, 0, 2156960, 0, 0, 0, 0, 0, 0),
+(@Guid+13, 37666, 631, 0, 0, 10, 1, 0, 1, 4531.93, 2769.49, 403.983, 3.15507, 300, 0, 0, 2156960, 0, 0, 0, 0, 0, 0),
+(@Guid+14, 37666, 631, 0, 0, 10, 1, 0, 1, 4513, 2769.32, 403.983, 6.2581, 300, 0, 0, 2156960, 0, 0, 0, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_07_13_00_world.sql b/sql/updates/world/3.3.5/2016_07_13_00_world.sql
new file mode 100644
index 00000000000..4fb83eb1eb7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_13_00_world.sql
@@ -0,0 +1,2 @@
+-- quick typo fix, thanks keader for making me look at the PR and notice this
+UPDATE `trinity_string` SET `content_default` = 'VisualizeBoundary warning: Reached fail-safe flood boundary - check if your boundary is unbounded!' WHERE `entry` = 11013;
diff --git a/sql/updates/world/3.3.5/2016_07_13_01_world_335.sql b/sql/updates/world/3.3.5/2016_07_13_01_world_335.sql
new file mode 100644
index 00000000000..9e20aa59af7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_13_01_world_335.sql
@@ -0,0 +1,44 @@
+--
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=17066;
+
+SET @GUID := 145538; -- Need 35
+DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+34;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@GUID , 17066, 1, 0, 0, 1, 1, 11686, 0, 6841.91, -4747.45, 704.4439, -0.506145, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+1 , 17066, 1, 0, 0, 1, 1, 11686, 0, 146.607, -4735.15, 21.4890, -0.5061, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+2 , 17066, 530, 0, 0, 1, 1, 11686, 0, 9379.9, -6791.63, 21.5129, -0.5061, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+3 , 17066, 530, 0, 0, 1, 1, 11686, 0, 9805.37, -7255.5, 32.7329, -0.06981, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+4 , 17066, 530, 0, 0, 1, 1, 11686, 0, 7670.44, -6836.25, 86.1859, -0.506, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+5 , 17066, 0, 0, 0, 1, 1, 11686, 0, 2288.63, 422.085, 40.6129, -0.5061, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+6 , 17066, 0, 0, 0, 1, 1, 11686, 0, -8261.67, -2638.05, 139.8970, 5.77704, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+7 , 17066, 0, 0, 0, 1, 1, 11686, 0, 1002.28, -1432.47, 70.5572, 5.77704, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+8 , 17066, 1, 0, 0, 1, 1, 11686, 0, -4399.5, 2171.79, 18.3212, 5.77704, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+9 , 17066, 530, 0, 0, 1, 1, 11686, 0, -4204.67, -12321.1, 8.6988, 5.77704, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+10, 17066, 530, 0, 0, 1, 1, 11686, 0, 2046.23, 6579.71, 141.7480, 5.77704, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+11, 17066, 530, 0, 0, 1, 1, 11686, 0, 2286.62, 6163.9, 142.9120, 4.79359, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+12, 17066, 1, 0, 0, 1, 1, 11686, 0, -2342.39, -609.245, -1.2698, 5.5, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+13, 17066, 530, 0, 0, 1, 1, 11686, 0, -3045.53, 2393.71, 68.0344, 3.48476, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+14, 17066, 530, 0, 0, 1, 1, 11686, 0, 2917.63, 3677.32, 150.6660, 1.11217, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+15, 17066, 571, 0, 0, 1, 1, 11686, 0, 4470.25, 5621.62, 65.1609, 1.19849, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+16, 17066, 571, 0, 0, 1, 1, 11686, 0, 3776.57, 1488.67, 97.8694, 0.109765, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+17, 17066, 571, 0, 0, 1, 1, 11686, 0, 3370.82, -2150.59, 130.9300, 1.7102, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+18, 17066, 571, 0, 0, 1, 1, 11686, 0, 2584.82, -4363.27, 281.8049, 0.908194, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+19, 17066, 571, 0, 0, 1, 1, 11686, 0, 5276.31, -2779.24, 298.9190, 0.767265, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+20, 17066, 571, 0, 0, 1, 1, 11686, 0, 5515.33, 4863.4, -191.8569, 4.06043, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+21, 17066, 571, 0, 0, 1, 1, 11686, 0, 5539.79, -749.386, 158.5469, 1.77309, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+22, 17066, 571, 0, 0, 1, 1, 11686, 0, 6169.62, -1017.84, 414.6180, 3.12084, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+23, 17066, 530, 0, 0, 1, 1, 11686, 0, -2232.01, -11915.4, 33.0821, 1.82694, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+24, 17066, 1, 0, 0, 1, 1, 11686, 0, -4417.13, 3455.78, 21.4771, 5.72732, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+25, 17066, 530, 0, 0, 1, 1, 11686, 0, 3113, 3717.87, 151.1990, 1.34645, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+26, 17066, 530, 0, 0, 1, 1, 11686, 0, -2502.95, 7522.09, 4.0358, 2.29811, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+27, 17066, 530, 0, 0, 1, 1, 11686, 0, -3965.24, 2039.3, 101.5659, 1.35098, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+28, 17066, 530, 0, 0, 1, 1, 11686, 0, 188.262, 5991.39, 30.2140, 3.08425, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+29, 17066, 571, 0, 0, 1, 1, 11686, 0, 4150.05, 5405.28, 34.3773, 5.08058, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+30, 17066, 571, 0, 0, 1, 1, 11686, 0, 3418.83, -2879.6, 208.6080, 2.79897, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+31, 17066, 571, 0, 0, 1, 1, 11686, 0, 5587.73, -2625.06, 298.9100, 0.0409415, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+32, 17066, 571, 0, 0, 1, 1, 11686, 0, 5357.67, 4855.99, -187.3269, 2.00813, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+33, 17066, 571, 0, 0, 1, 1, 11686, 0, 2477.58, -4905.4, 271.5549, 3.54262, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0),
+(@GUID+34, 17066, 571, 0, 0, 1, 1, 11686, 0, 6061.69, -1112.97, 427.2709, 5.40099, 300, 0, 0, 42, 0, 0, 0, 0, 0, 0);
+
+DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @GUID+0 AND @GUID+34 AND `eventEntry`=1;
+INSERT INTO `game_event_creature` SELECT 1, `creature`.`guid` FROM `creature` WHERE `creature`.`guid` BETWEEN @GUID+0 AND @GUID+34;
diff --git a/sql/updates/world/3.3.5/2016_07_14_00_world.sql b/sql/updates/world/3.3.5/2016_07_14_00_world.sql
new file mode 100644
index 00000000000..5f45b70c942
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_14_00_world.sql
@@ -0,0 +1,4 @@
+--
+UPDATE `creature_equip_template` SET `itemID3`=5870 WHERE `CreatureID` IN (701);
+UPDATE `smart_scripts` SET `action_param2`=`action_param2`|2 WHERE `source_type`=0 AND `entryorguid`=7856 AND `id`=0;
+UPDATE `creature_equip_template` SET `itemID3`=5856 WHERE `CreatureID` IN (1162);
diff --git a/sql/updates/world/3.3.5/2016_07_15_00_world.sql b/sql/updates/world/3.3.5/2016_07_15_00_world.sql
new file mode 100644
index 00000000000..6168cb638f3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_00_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `quest_template_addon` WHERE `ID` IN (9432, 10752);
+INSERT INTO `quest_template_addon` (`ID`, `ExclusiveGroup`) VALUES
+(9432, 990);
diff --git a/sql/updates/world/3.3.5/2016_07_15_01_world.sql b/sql/updates/world/3.3.5/2016_07_15_01_world.sql
new file mode 100644
index 00000000000..2a6466dd1cc
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_01_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_loot_template` SET `Chance`=5.7 WHERE `Chance` > 5 AND `Reference`=0 AND `Item` IN (1438, 2959, 2960, 2963, 2964, 2967, 2972, 2975, 3200, 3207, 3213, 3214, 3323, 3643, 4560, 4658, 4662, 4684, 4690, 6506, 6508, 6514, 6515, 6517, 6549, 6566, 6579, 7350, 7351, 9744, 9745, 9750, 9752, 9754, 9759, 9760);
diff --git a/sql/updates/world/3.3.5/2016_07_15_02_world.sql b/sql/updates/world/3.3.5/2016_07_15_02_world.sql
new file mode 100644
index 00000000000..dfe56542182
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_02_world.sql
@@ -0,0 +1,9 @@
+--
+DELETE FROM `npc_text` WHERE `ID`=50000;
+INSERT INTO `npc_text` (`ID`, `text0_0`, `VerifiedBuild`) VALUES
+(50000, "The land has been good to our people, $c. We must be thankful for our good fortune.", -1);
+
+DELETE FROM `gossip_menu` WHERE `entry`=50000;
+INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES (50000, 50000, -1);
+
+UPDATE `creature_template` SET `gossip_menu_id`=50000 WHERE `entry`=2993;
diff --git a/sql/updates/world/3.3.5/2016_07_15_03_world.sql b/sql/updates/world/3.3.5/2016_07_15_03_world.sql
new file mode 100644
index 00000000000..b7a19638541
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_03_world.sql
@@ -0,0 +1,8 @@
+--
+DELETE FROM `spell_target_position` WHERE `ID`=42200;
+INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) VALUES
+(42200, 0, 1, 5010.165039, -4554.938965, 852.146362, 0.883979, 0);
+
+DELETE FROM `spell_area` WHERE `spell`=42202;
+INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES
+(42202, 616, 0, 0, 0, 0, 2, 1, 64, 11);
diff --git a/sql/updates/world/3.3.5/2016_07_15_04_world.sql b/sql/updates/world/3.3.5/2016_07_15_04_world.sql
new file mode 100644
index 00000000000..e45302cde89
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_04_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_text` SET `type`=41 WHERE `entry`=31125 AND `groupid`=1 AND `id`=0;
diff --git a/sql/updates/world/3.3.5/2016_07_15_05_world.sql b/sql/updates/world/3.3.5/2016_07_15_05_world.sql
new file mode 100644
index 00000000000..a024b62590e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_05_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `InhabitType`=`InhabitType`|8 WHERE `entry` IN (1921, 2674, 5674, 8035, 16236, 16400, 16897, 20251, 20561, 21322, 21413, 14697, 18679, 18695, 23076, 23077, 23876, 23996, 24210, 25284, 25534, 27064, 27430, 27894, 28156, 28366, 29475, 29483, 29613, 29747, 29790, 30236, 30475, 31103, 31280, 31424, 32347, 32795, 32938, 33174, 33184, 33229, 33243, 33272, 33342, 33352, 33353, 33651, 34047, 34050, 34068, 34071, 34096, 34108, 34110, 34121, 34149, 34362, 34363);
diff --git a/sql/updates/world/3.3.5/2016_07_15_06_world.sql b/sql/updates/world/3.3.5/2016_07_15_06_world.sql
new file mode 100644
index 00000000000..7a5e74a50d3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_06_world.sql
@@ -0,0 +1,63 @@
+--
+DELETE FROM `creature` WHERE `id`=2435;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(11004, 2435, 0, 1, 1, 0, 1, -740.538, -525.298, 21.9343, 3.9523, 3600, 0, 0, 1163, 0, 0, 0, 0, 0);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=2435;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(2435, 0, 0, 0, 11, 0, 100, 1, 5000, 5000, 5000, 5000, 53, 0, 2435, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Southshore Crier - On Spawn - Start Waypoint'),
+(2435, 0, 1, 0, 40, 0, 100, 0, 11, 0, 0, 0, 1, 0, 1000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Southshore Crier - On WP 11 reached - Say Line 0'),
+(2435, 0, 2, 3, 40, 0, 100, 0, 12, 2435, 0, 0, 54, 30000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Southshore Crier - On WP 12 reached - Pause Waypoint'),
+(2435, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 1, 5000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Southshore Crier - On WP 12 reached - Say Line 1'),
+(2435, 0, 4, 0, 52, 0, 100, 0, 1, 2435, 0, 0, 1, 2, 5000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Southshore Crier - On Text 1 Over - Say Line 2'),
+(2435, 0, 5, 0, 52, 0, 100, 0, 2, 2435, 0, 0, 1, 3, 5000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Southshore Crier - On Text 2 Over - Say line 3'),
+(2435, 0, 6, 7, 52, 0, 100, 0, 3, 2435, 0, 0, 1, 4, 500, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Southshore Crier - On Text 3 Over - Say line 4'),
+(2435, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 243500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Southshore Crier - On Text 3 Over – Start Script'),
+(2435, 0, 8, 9, 52, 0, 100, 0, 4, 2435, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Southshore Crier - On Text 4 Over - Say line 5'),
+(2435, 0, 9, 0, 61, 0, 100, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Southshore Crier - On Text 4 Over - Kill self');
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=243500;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(243500, 9, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -858.214, -471.187, 13.3554, 0.58591, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 1, 0, 0, 0, 100, 1, 0, 0, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -864.901, -472.452, 13.3564, 0.58591, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 2, 0, 0, 0, 100, 1, 0, 0, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -862.522, -476.413, 13.3564, 0.58591, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 3, 0, 0, 0, 100, 1, 0, 0, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -861.232, -542.347, 9.33058, 0.58591, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 4, 0, 0, 0, 100, 1, 0, 0, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -849.912, -536.618, 10.717, 0.30081, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 5, 0, 0, 0, 100, 1, 0, 0, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -842.906, -536.79, 12.5283, 6.23677, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 6, 0, 0, 0, 100, 1, 0, 0, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -843.281, -526.083, 11.1464, 0.819482, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 7, 0, 0, 0, 100, 1, 1000, 1000, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -848.99, -517.981, 12.1924, 0.819482, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 8, 0, 0, 0, 100, 1, 1000, 1000, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -867.763, -516.11, 11.3357, 0.819482, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 9, 0, 0, 0, 100, 1, 1000, 1000, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -855.221, -518.702, 11.547, 0.819482, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 10, 0, 0, 0, 100, 1, 1000, 1000, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -879.868, -538.859, 7.67274, 0.819482, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 11, 0, 0, 0, 100, 1, 1000, 1000, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -877.552, -561.351, 11.0384, 0.819482, 'Southshore Crier - On Script - Summon Shadowy Assassin'),
+(243500, 9, 12, 0, 0, 0, 100, 1, 1000, 1000, 0, 0, 12, 2434, 4, 15000, 0, 0, 0, 8, 0, 0, 0, -840.952, -505.281, 14.4908, 0.819482, 'Southshore Crier - On Script - Summon Shadowy Assassin');
+
+DELETE FROM `waypoints` WHERE `entry`=2435;
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(2435, 1, -745.74, -530.658, 21.0302, 'Southshore Crier'),
+(2435, 2, -749.623, -536.482, 19.8807, 'Southshore Crier'),
+(2435, 3, -749.831, -542.323, 19.0502, 'Southshore Crier'),
+(2435, 4, -751.399, -545.452, 18.7756, 'Southshore Crier'),
+(2435, 5, -751.399, -545.452, 18.7756, 'Southshore Crier'),
+(2435, 6, -760.746, -546.233, 18.1427, 'Southshore Crier'),
+(2435, 7, -771.772, -545.382, 17.7874, 'Southshore Crier'),
+(2435, 8, -787.449, -540.515, 17.7064, 'Southshore Crier'),
+(2435, 9, -803.583, -531.155, 15.9356, 'Southshore Crier'),
+(2435, 10, -815.697, -524.158, 14.4849, 'Southshore Crier'),
+(2435, 11, -824.224, -522.261, 13.1434, 'Southshore Crier'),
+(2435, 12, -840.92, -524.92, 11.2505, 'Southshore Crier'),
+(2435, 13, -857.888, -532.908, 9.43952, 'Southshore Crier'),
+(2435, 14, -870.759, -539.774, 8.12229, 'Southshore Crier'),
+(2435, 15, -880.055, -540.594, 7.56718, 'Southshore Crier'),
+(2435, 16, -898.525, -541.205, 6.87974, 'Southshore Crier'),
+(2435, 17, -901.819, -547.256, 6.87974, 'Southshore Crier'),
+(2435, 18, -903.291, -555.882, 6.87974, 'Southshore Crier');
+
+DELETE FROM `creature_text` WHERE `entry`=2435;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(2435, 0, 0, "Hear ye! Hear ye! *pant pant* Be warned citizens of Southshore: assassins are heading to our fair town!", 12, 7, 100, 0, 0, 0, 620, 0, "Southshore Crier"),
+(2435, 1, 0, "Help me! Help! Assassins in the hills! To arms! To arms!", 14, 7, 100, 22, 0, 0, 619, 0, "Southshore Crier"),
+(2435, 2, 0, "Guards to your posts! They must be after the Magistrate again. He must be protected! They could come from any direction!", 12, 7, 100, 1, 0, 0, 621, 0, "Southshore Crier"),
+(2435, 3, 0, "The Southshore Crier grabs the back of his neck and his eyes go wide.", 16, 0, 100, 0, 0, 0, 623, 0, "Southshore Crier"),
+(2435, 4, 0, "Assassins... save... th... Magistraaa...", 12, 7, 100, 65, 0, 0, 626, 0, "Southshore Crier"),
+(2435, 5, 0, "Southshore Crier dies.", 16, 0, 100, 0, 0, 0, 0, 0, "Southshore Crier");
diff --git a/sql/updates/world/3.3.5/2016_07_15_07_world.sql b/sql/updates/world/3.3.5/2016_07_15_07_world.sql
new file mode 100644
index 00000000000..b44d7669386
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_07_world.sql
@@ -0,0 +1,2 @@
+UPDATE `smart_scripts` SET `action_type`=114, `target_z`=`action_param1`, `action_param1`=0 WHERE `action_type` = 114 AND `action_param1` != 0;
+UPDATE `smart_scripts` SET `action_type`=114, `target_y`=`action_param1`, `action_param1`=0 WHERE `action_type` = 46 AND `action_param1` != 0;
diff --git a/sql/updates/world/3.3.5/2016_07_15_08_world.sql b/sql/updates/world/3.3.5/2016_07_15_08_world.sql
new file mode 100644
index 00000000000..e4ea72c2173
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_08_world.sql
@@ -0,0 +1,40 @@
+-- Fix requirement quest for the alliance
+UPDATE `quest_template_addon` SET `PrevQuestID`=2278, `NextQuestID`=2439 WHERE `ID`=2279;
+
+-- Add gossip text to menu
+
+UPDATE `creature_template` SET `gossip_menu_id`=57000 WHERE `entry`=7918;
+DELETE FROM `gossip_menu` WHERE `entry` IN (57000,57001,57002,57003,57004,57005,57006);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(57000,1674),(57001,1675),(57002,1676),(57003,1677),(57004,1678),(57005,1679);
+
+DELETE FROM `gossip_menu_option` WHERE (`menu_id` BETWEEN 57000 AND 57005) OR (`menu_id` IN (8072));
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`, `VerifiedBuild`) VALUES
+(57000,0,0,'What function do you serve?',4054,1,3,57001,0,0,0,'',0,-1),
+(57001,0,0,'What are the Plates of Uldum?',4056,1,3,57002,0,0,0,'',0,-1),
+(57002,0,0,'Where are the Plates of Uldum?',4057,1,3,57003,0,0,0,'',0,-1),
+(57003,0,0,'Excuse me? We\'ve been "rescheduled for visitation"? What does that mean?!',4058,1,3,57004,0,0,0,'',0,-1),
+(57004,0,0,'So... what\'s inside Uldum?',4059,1,3,57005,0,0,0,'',0,-1),
+(57005,0,0,'I will return when I have the Plates of Uldum.',4060,1,3,0,0,0,0,'',0,-1),
+(8072,0,0,'Please take me to the master\'s lair.',17742,1,3,0,0,0,0,'',0,18019);
+
+-- Migrate NPC's to use SmartAI
+UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` IN (7918, 20142);
+
+-- Create SmartAI
+DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid IN (7918, 20142));
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(7918,0,0,1,62,0,100,0,57005,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stone Watcher of Norgannon - On Gossip Option 0 Selected - Close Gossip'),
+(7918,0,1,0,61,0,100,0,0,0,0,0,15,2954,0,0,0,0,0,7,0,0,0,0,0,0,0,'Stone Watcher of Norgannon - On Gossip Option 0 Selected - Quest Credit 2954'),
+(20142,0,0,1,62,0,100,0,8072,0,0,0,85,34891,0,0,0,0,0,7,0,0,0,0,0,0,0,'Steward of Time - On Gossip Option 0 Selected - Invoker Cast \'Flight through Caverns\''),
+(20142,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Steward of Time - On Gossip Option 0 Selected - Close Gossip'),
+(20142,0,2,0,19,0,100,0,10279,0,0,0,85,34891,0,0,0,0,0,7,0,0,0,0,0,0,0,'Steward of Time - On Quest 10279 Taken - Invoker Cast \'Flight through Caverns\'');
+
+-- Conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` IN (57000,8072);
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 14 AND `SourceGroup` IN (8072);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,57000,0,0,0,9,0,2954,0,0,0,0,'','Stone Watcher of Norgannon - Show Gossip Option 0 if player has accepted quest 2954'),
+(15,8072,0,0,0,8,0,10279,0,0,0,0,'','Steward of Time - Show Gossip Option 0 if Quest 10279 is not rewarded'),
+(14,8072,9977,0,0,8,0,10279,0,0,1,0,'','Steward of Time - Show Gossip Menu text 9977 if Quest 10279 is not rewarded'),
+(14,8072,9978,0,0,8,0,10279,0,0,0,0,'','Steward of Time - Show Gossip Menu text 9978 if Quest 10279 is rewarded');
diff --git a/sql/updates/world/3.3.5/2016_07_15_09_world.sql b/sql/updates/world/3.3.5/2016_07_15_09_world.sql
new file mode 100644
index 00000000000..576d5317a4c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_09_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template` SET `AllowableRaces`=1101 WHERE `Id` IN (13603, 13757);
diff --git a/sql/updates/world/3.3.5/2016_07_15_10_world.sql b/sql/updates/world/3.3.5/2016_07_15_10_world.sql
new file mode 100644
index 00000000000..3b9491a1748
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_10_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=52839;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(17, 0, 52839, 0, 0, 29, 0, 28948, 40, 0, 1, 0, 0, "", "Spell Summon Escort Aura cannot be used if NPC Malmortis is within 40 yards.");
diff --git a/sql/updates/world/3.3.5/2016_07_15_11_world.sql b/sql/updates/world/3.3.5/2016_07_15_11_world.sql
new file mode 100644
index 00000000000..f0d5555af27
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_15_11_world.sql
@@ -0,0 +1,6 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (65200, 65258, 65265);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(17, 0, 65200, 0, 0, 29, 0, 34320, 5, 0, 0, 0, 0, "", "Spell 'Feed Venomhide Hatchling' (used for quest 'Hungry, Hungry Hatchling') requires NPC 'Venomhide Hatchling' to be within 5 yards"),
+(17, 0, 65258, 0, 0, 29, 0, 34320, 5, 0, 0, 0, 0, "", "Spell 'Feed Venomhide Hatchling' (used for quest 'Gorishi Grub') requires NPC 'Venomhide Hatchling' to be within 5 yards"),
+(17, 0, 65265, 0, 0, 29, 0, 34320, 5, 0, 0, 0, 0, "", "Spell 'Feed Venomhide Hatchling' (used for quest 'Poached, Scrambled, Or Raw?') requires NPC 'Venomhide Hatchling' to be within 5 yards");
diff --git a/sql/updates/world/3.3.5/2016_07_16_00_world.sql b/sql/updates/world/3.3.5/2016_07_16_00_world.sql
new file mode 100644
index 00000000000..0dd86f346e9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_16_00_world.sql
@@ -0,0 +1,8 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (12699, 31225);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(17, 0, 31225, 0, 0, 29, 0, 17768, 10, 0, 0, 0, 0, "", "Spell 'Shimmering Vessel' (used for quest 'Redeeming the Dead') requires NPC 'Blood Knight Stillblade' to be within 10 yards"),
+(17, 0, 12699, 0, 0, 36, 1, 0, 0, 0, 1, 0, 0, "", "Spell 'Summon Screecher Spirit' (used for quest 'Screecher Spirits') can only be used if target is dead AND"),
+(17, 0, 12699, 0, 0, 31, 1, 3, 5307, 0, 0, 0, 0, "", "Spell 'Summon Screecher Spirit' (used for quest 'Screecher Spirits') can only be used if target is NPC 'Vale Screecher'"),
+(17, 0, 12699, 0, 1, 36, 1, 0, 0, 0, 1, 0, 0, "", "Spell 'Summon Screecher Spirit' (used for quest 'Screecher Spirits') can only be used if target is dead AND"),
+(17, 0, 12699, 0, 1, 31, 1, 3, 5308, 0, 0, 0, 0, "", "Spell 'Summon Screecher Spirit' (used for quest 'Screecher Spirits') can only be used if target is NPC 'Rogue Vale Screecher'");
diff --git a/sql/updates/world/3.3.5/2016_07_16_01_world.sql b/sql/updates/world/3.3.5/2016_07_16_01_world.sql
new file mode 100644
index 00000000000..25b0dd9a071
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_16_01_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `reference_loot_template` WHERE `Entry`=24701 AND `Item`=6661;
diff --git a/sql/updates/world/3.3.5/2016_07_16_02_world.sql b/sql/updates/world/3.3.5/2016_07_16_02_world.sql
new file mode 100644
index 00000000000..ab625246ea7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_16_02_world.sql
@@ -0,0 +1,6 @@
+SET @Guid:=86240;
+UPDATE `creature` SET `spawntimesecs`=86400 WHERE `guid` BETWEEN @Guid AND @Guid+12;
+SET @Guid:=52664;
+UPDATE `creature` SET `spawntimesecs`=86400 WHERE `guid` BETWEEN @Guid AND @Guid+4;
+SET @Guid:=91573;
+UPDATE `creature` SET `spawntimesecs`=86400 WHERE `guid` BETWEEN @Guid AND @Guid+14;
diff --git a/sql/updates/world/3.3.5/2016_07_16_03_world.sql b/sql/updates/world/3.3.5/2016_07_16_03_world.sql
new file mode 100644
index 00000000000..986a96a6d57
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_16_03_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_roar_of_sacrifice';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(53480, 'spell_hun_roar_of_sacrifice');
diff --git a/sql/updates/world/3.3.5/2016_07_16_04_world.sql b/sql/updates/world/3.3.5/2016_07_16_04_world.sql
new file mode 100644
index 00000000000..9bdba2e4deb
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_16_04_world.sql
@@ -0,0 +1,2 @@
+-- Fix Flightmaster Runetog Wildhammer, Shatter Point
+UPDATE `gossip_menu_option` SET `option_id` = 4, `npc_option_npcflag` = 8192 WHERE `menu_id` = 8095;
diff --git a/sql/updates/world/3.3.5/2016_07_16_05_world_335.sql b/sql/updates/world/3.3.5/2016_07_16_05_world_335.sql
new file mode 100644
index 00000000000..6fd17188e7e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_16_05_world_335.sql
@@ -0,0 +1,3 @@
+DELETE FROM `creature` WHERE `guid`=52668;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(52668, 10979, 0, 1, 1, 2709, 0, 2109.13, -1829.79, 58.1995, 3.9185, 315, 3, 0, 2964, 0, 1, 0, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_07_16_06_world.sql b/sql/updates/world/3.3.5/2016_07_16_06_world.sql
new file mode 100644
index 00000000000..a8e9510c965
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_16_06_world.sql
@@ -0,0 +1 @@
+UPDATE `command` SET `help`='Syntax: .cooldown [#spell_id]\r\n\r\nRemove all (if spell_id not provided) or #spel_id spell cooldown from selected character or their pet or you (if no selection).' WHERE `name`='cooldown';
diff --git a/sql/updates/world/3.3.5/2016_07_16_07_world.sql b/sql/updates/world/3.3.5/2016_07_16_07_world.sql
new file mode 100644
index 00000000000..75af8add3d1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_16_07_world.sql
@@ -0,0 +1,5 @@
+-- enable 2 new spell scripts: spell_hallow_end_candy & spell_hallow_end_candy_pirate
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_hallow_end_candy','spell_hallow_end_candy_pirate');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(24930,'spell_hallow_end_candy'),
+(24926,'spell_hallow_end_candy_pirate');
diff --git a/sql/updates/world/3.3.5/2016_07_16_08_world.sql b/sql/updates/world/3.3.5/2016_07_16_08_world.sql
new file mode 100644
index 00000000000..af4db3f1567
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_16_08_world.sql
@@ -0,0 +1,8 @@
+--
+UPDATE `quest_template_addon` SET `PrevQuestID`=0 WHERE `ID` IN (12692, 12695);
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (19, 20) AND `SourceEntry` IN (12692, 12695);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(19, 0, 12692, 0, 0, 43, 0, 12582, 0, 0, 0, 0, 0, "", "Quest 'Return of the Lich Hunter' can be accepted if daily quest 'Frenzyheart Champion' hsa been turned in"),
+(20, 0, 12692, 0, 0, 43, 0, 12582, 0, 0, 0, 0, 0, "", "Quest mark for 'Return of the Lich Hunter' can be seen if daily quest 'Frenzyheart Champion' hsa been turned in"),
+(19, 0, 12695, 0, 0, 43, 0, 12689, 0, 0, 0, 0, 0, "", "Quest 'Return of the Friendly Dryskin' can be accepted if daily quest 'Hand of the Oracles' has been turned in"),
+(20, 0, 12695, 0, 0, 43, 0, 12689, 0, 0, 0, 0, 0, "", "Quest mark for 'Return of the Friendly Dryskin' can be accepted if daily quest 'Hand of the Oracles' has been turned in");
diff --git a/sql/updates/world/3.3.5/2016_07_18_00_world.sql b/sql/updates/world/3.3.5/2016_07_18_00_world.sql
new file mode 100644
index 00000000000..7682fe310e3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_18_00_world.sql
@@ -0,0 +1,13 @@
+--
+UPDATE `creature` SET `modelid`=0 WHERE `id` IN (36,46,48,92,95,98,114,115,117,121);
+UPDATE `creature_addon` SET `bytes2`=257 WHERE `guid` IN (79666,79689);
+UPDATE `creature_addon` SET `bytes2`=4097 WHERE `guid` IN (80190,81107);
+DELETE FROM `creature_addon` WHERE `guid` IN (4312,80149,80152,80154,80158,80168,80169,80181,80182,80187,
+80189,80196,80200,80205,80206,80216,80218,80222,80226,80230,80231,80237,80238,80246,80254,80255,79664,79671,
+79674,79704,79730,79731,79819,79861,79864,79865,120682,120685,120686,120687,120692,80419);
+UPDATE `creature` SET `modelid`=0 WHERE `id`=2345;
+UPDATE `creature_addon` SET `bytes2`=4097 WHERE `guid`=16127;
+UPDATE `creature` SET `modelid`=0 WHERE `id`=2346;
+UPDATE `creature_addon` SET `bytes2`=4097 WHERE `guid`=16164;
+UPDATE `creature` SET `modelid`=0 WHERE `id`=2458;
+UPDATE `creature_addon` SET `bytes2`=4097 WHERE `guid`=14480;
diff --git a/sql/updates/world/3.3.5/2016_07_18_01_world.sql b/sql/updates/world/3.3.5/2016_07_18_01_world.sql
new file mode 100644
index 00000000000..47425de1744
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_18_01_world.sql
@@ -0,0 +1,40 @@
+DELETE FROM `waypoints` WHERE `entry`=17893;
+
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(17893, 1, -190.9255, -796.3895, 43.79932, 'Naturalist Bite');
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=17893 AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=1789300 AND `source_type`=9;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=17957 AND `source_type`=0 AND `id`=3;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=17960 AND `source_type`=0 AND `id`=12;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=17961 AND `source_type`=0 AND `id`=16;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(17957, 0, 3, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 17893, 0, 0, 0, 0, 0, 0, 'Coilfang Champion - On Just Summoned - Start Attack'),
+(17960, 0, 12, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Coilfang Soothsayer - On Just Summoned - Start Attack'),
+(17961, 0, 16, 0, 54, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Coilfang Enchantress - On Just Summoned - Start Attack'),
+(17893, 0, 0, 1, 62, 0, 100, 0, 7520, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - On Gossip Select - Close Gossip'),
+(17893, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 17893, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - Linked with Previous Event - Give Kill Credit'),
+(17893, 0, 2, 0, 10, 1, 100, 0, 1, 15, 15000, 90000, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - On Los OOC - Say Line 0 (Phase 1)'),
+(17893, 0, 3, 0, 62, 0, 100, 1, 7520, 0, 0, 0, 80, 1789300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - On Gossip Select - Run Script'),
+(17893, 0, 4, 5, 40, 0, 100, 1, 1, 17893, 0, 0, 66, 0, 0, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - On Reached WP1 - Set Orientation'),
+(17893, 0, 5, 6, 61, 0, 100, 1, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - On Reached WP1 - Set Home Position'),
+(17893, 0, 6, 7, 61, 0, 100, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - On Reached WP1 - Say Line 1'),
+(17893, 0, 7, 8, 61, 0, 100, 1, 0, 0, 0, 0, 12, 17957, 8, 0, 0, 0, 0, 8, 0, 0, 0, -117.1674, -750.9227, 37.04787, 3.476038, 'Naturalist Bite - On Reached WP1 - Summon Coilfang Champion'),
+(17893, 0, 8, 9, 61, 0, 100, 1, 0, 0, 0, 0, 12, 17961, 8, 0, 0, 0, 0, 8, 0, 0, 0, -117.0361, -754.6592, 37.45506, 0.3444065, 'Naturalist Bite - On Reached WP1 - Summon Coilfang Enchantress'),
+(17893, 0, 9, 10, 61, 0, 100, 1, 0, 0, 0, 0, 12, 17960, 8, 0, 0, 0, 0, 8, 0, 0, 0, -119.7346, -750.3145, 37.0497, 0.611494, 'Naturalist Bite - On Reached WP1 - Summon Coilfang Soothsayer'),
+(17893, 0, 10, 11, 61, 0, 100, 1, 0, 0, 0, 0, 11, 34906, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - On Reached WP1 - Cast Mark of Bite'),
+(17893, 0, 11, 0, 61, 0, 100, 1, 0, 0, 0, 0, 11, 34906, 2, 0, 0, 0, 0, 21, 100, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - On Reached WP1 - Cast Mark of Bite'),
+(17893, 0, 12, 0, 11, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - On Spawn - Set Phase 1'),
+(1789300, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - Script - Set Phase 0'),
+(1789300, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 9, 0, 0, 0, 0, 0, 0, 20, 182094, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - Script - Activate GO'),
+(1789300, 9, 2, 0, 0, 0, 100, 0, 9000, 9000, 0, 0, 2, 113, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - Script - Start WP'),
+(1789300, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - Script - Set NPC Flags'),
+(1789300, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - Script - Set Unit Flags'),
+(1789300, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 53, 0, 17893, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Naturalist Bite - Script - Start WP');
+
+DELETE FROM `creature_text` WHERE `entry`=17893;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(17893, 0, 0, 'Hey! Over here! Yeah, over here... I\'m in this cage!!!', 14, 0, 100, 0, 0, 0, 14668, 0, 'Naturalist Bite'),
+(17893, 1, 0, 'Uh oh! It would appear that all of the noise you\'ve been making has attracted some unwanted attention!', 12, 0, 100, 0, 0, 0, 14575, 0, 'Naturalist Bite');
+
diff --git a/sql/updates/world/3.3.5/2016_07_19_00_world.sql b/sql/updates/world/3.3.5/2016_07_19_00_world.sql
new file mode 100644
index 00000000000..ae623f25db0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_19_00_world.sql
@@ -0,0 +1,20 @@
+--
+DROP TABLE IF EXISTS `quest_mail_sender`;
+CREATE TABLE `quest_mail_sender`
+(
+ `QuestId` INT(5) UNSIGNED NOT NULL DEFAULT 0,
+ `RewardMailSenderEntry` INT(5) UNSIGNED NOT NULL DEFAULT 0,
+ PRIMARY KEY (`QuestId`)
+);
+
+INSERT INTO `quest_mail_sender` (`QuestId`, `RewardMailSenderEntry`) VALUES
+(8729, 11811), -- Quest The Wrath of Neptulon sends mail from Narain Soothfancy
+(10588, 18166), -- Quest The Cipher of Damnation sends mail from Archmage Khadgar
+(12085, 5885), -- Quest A Letter for Home (Horde) sends mail from Deino
+(12067, 2708), -- Quest A Letter for Home (Alliance) sends mail from Archmage Malin
+(12422, 27102), -- Quest Tactical Clemency sends mail from Gorgonna
+(12711, 28930), -- Quest Abandoned Mail sends mail from Dansel Adams
+(22817, 10967), -- Quest Back to the Orphanage (Blood Elf) sends mail from Blood Elf Orphan
+(22818, 10966), -- Quest Back to the Orphanage (Draenei) sends mail from Draenei Orphan
+(28879, 33533), -- Quest Back To The Orphanage (Oracle) sends mail from Oracle Orphan
+(28880, 33532); -- Quest Back To The Orphanage (Wolvar) sends mail from Wolvar Orphan
diff --git a/sql/updates/world/3.3.5/2016_07_19_01_world.sql b/sql/updates/world/3.3.5/2016_07_19_01_world.sql
new file mode 100644
index 00000000000..02d522f183c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_19_01_world.sql
@@ -0,0 +1,21 @@
+DELETE FROM `creature` WHERE `guid`=113330;
+
+-- Pathing for Deathguard Molder Entry: 27320 'TDB FORMAT'
+SET @NPC := 113329;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3242.083,`position_y`=-683.1053,`position_z`=166.9898 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1 ,3234.214,-662.9944,166.701,0,60000,0,0,100,0),
+(@PATH,2 ,3242.083,-683.1053,166.9898,0,0,0,0,100,0),
+(@PATH,3 ,3244.742,-697.8635,167.0145,0,0,0,0,100,0),
+(@PATH,4 ,3248.017,-702.5844,167.3793,0,0,0,0,100,0),
+(@PATH,5 ,3252.101,-710.5942,167.6412,0,0,0,0,100,0),
+(@PATH,6 ,3257.548,-721.5476,168.0425,0,0,0,0,100,0),
+(@PATH,7 ,3260.511,-729.2581,168.5909,0,60000,0,0,100,0),
+(@PATH,8 ,3257.548,-721.5476,168.0425,0,0,0,0,100,0),
+(@PATH,9 ,3252.101,-710.5942,167.6412,0,0,0,0,100,0),
+(@PATH,10,3248.017,-702.5844,167.3793,0,0,0,0,100,0),
+(@PATH,11,3245.563,-698.4318,167.1446,0,0,0,0,100,0);
diff --git a/sql/updates/world/3.3.5/2016_07_19_02_world.sql b/sql/updates/world/3.3.5/2016_07_19_02_world.sql
new file mode 100644
index 00000000000..782178a66f8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_19_02_world.sql
@@ -0,0 +1,5 @@
+--
+DELETE FROM `creature_template_addon` WHERE `entry`=27267;
+INSERT INTO `creature_template_addon` (`entry`, `bytes1`, `bytes2`, `emote`) VALUES (27267, 256, 257, 233);
+UPDATE `creature_template` SET `unit_flags`=32768 WHERE `entry`=27267;
+UPDATE `gossip_menu_option` SET `option_id`=3, `npc_option_npcflag`=128 WHERE `menu_id`=9487;
diff --git a/sql/updates/world/3.3.5/2016_07_19_03_world.sql b/sql/updates/world/3.3.5/2016_07_19_03_world.sql
new file mode 100644
index 00000000000..147095d7ea0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_19_03_world.sql
@@ -0,0 +1,6 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid`=11443 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(11443, 0, 0, 0, 4, 0, 50, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Gordok Ogre-Mage - On Aggro - Say Line 0"),
+(11443, 0, 1, 0, 9, 0, 100, 0, 0, 40, 2400, 3800, 11, 20823, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Gordok Ogre-Mage - Between 0-40 Range - Cast 20823"),
+(11443, 0, 2, 0, 0, 0, 100, 0, 5000, 12000, 35000, 45000, 11, 6742, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Gordok Ogre-Mage - In Combat - Cast 6742");
diff --git a/sql/updates/world/3.3.5/2016_07_19_04_world.sql b/sql/updates/world/3.3.5/2016_07_19_04_world.sql
new file mode 100644
index 00000000000..449999b41e1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_19_04_world.sql
@@ -0,0 +1,4 @@
+--
+UPDATE `smart_scripts` SET `action_type`=11, `target_type`=7, target_param1=0 WHERE `entryorguid`=11832 AND `source_type`=0 AND `id`=1;
+UPDATE `smart_scripts` SET `action_param2`=0, `target_type`=7 WHERE `entryorguid`=30630 AND `source_type`=0 AND `id`=0;
+
diff --git a/sql/updates/world/3.3.5/2016_07_19_05_world.sql b/sql/updates/world/3.3.5/2016_07_19_05_world.sql
new file mode 100644
index 00000000000..7363465131c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_19_05_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `trainer_type`=2 WHERE `entry`=33639;
diff --git a/sql/updates/world/3.3.5/2016_07_19_06_world.sql b/sql/updates/world/3.3.5/2016_07_19_06_world.sql
new file mode 100644
index 00000000000..44fad2ffd2a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_19_06_world.sql
@@ -0,0 +1,15 @@
+--
+SET @Drak := 26919;
+
+-- Insert missing creature text for NPC 26919 Drak'aguul
+DELETE FROM `creature_text` WHERE `entry` = @Drak;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(@Drak, 0, 0, 'Dey be stronger then I expect mon, attack dem!', 12, 0, 100, 0, 0, 0, 28896, 0, "Drak'aguul - Between 0-30% Health - Call For Help"),
+(@Drak, 1, 0, 'Wait for me orders, I handle dis myself!', 12, 0, 100, 0, 0, 0, 28897, 0, "Drak'aguul - On Aggro - Order soldiers to wait");
+
+UPDATE `smart_scripts` SET `link`= 3 WHERE `entryorguid`= @Drak AND `source_type`= 0 AND `id`= 0;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`= @Drak AND `source_type`= 0 AND `id` IN (3,4);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Drak, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Drak'aguul - On Aggro - Say Line 1"),
+(@Drak, 0, 4, 0, 4, 0, 100, 0, 0, 0, 0, 0, 1, 0, 10000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Drak'aguul - On Aggro - Say Line 2");
diff --git a/sql/updates/world/3.3.5/2016_07_19_07_world.sql b/sql/updates/world/3.3.5/2016_07_19_07_world.sql
new file mode 100644
index 00000000000..6fafc733431
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_19_07_world.sql
@@ -0,0 +1,79 @@
+--
+DELETE FROM `areatrigger_scripts` WHERE `entry` IN (4950);
+INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
+(4950,'SmartTrigger');
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (4950) AND `source_type`=2;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(4950,2,0,1,46,0,100,0,4950,0,0,0,45,1,1,0,0,0,0,10,118282,26605,0,0,0,0,0,"On Trigger - Set Data");
+
+-- Anub'ar Underlord SAI
+SET @GUID := -118282;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=26605;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@GUID,0,0,1,11,0,100,1,0,0,0,0,11,34426,19,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Underlord - On Respawn - Cast 'Greater Invisibility' (No Repeat)"),
+(@GUID,0,1,0,61,0,100,0,0,0,0,0,18,128,0,0,0,0,0,0,0,0,0,0,0,0,0,"Anub'ar Underlord - On Respawn - Set Flag Not Attackable (No Repeat)"),
+(@GUID,0,2,0,38,0,100,1,1,1,120000,120000,80,2660500,2,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Underlord - On Data Set 1 1 - Run Script (No Repeat)"),
+(@GUID,0,3,0,25,0,100,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Underlord - On Respawn - Set Reactstate Passive");
+
+-- Anub'ar Underlord SAI
+SET @ENTRY := 26605;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,9,0,100,0,0,8,12500,17800,11,51681,0,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Underlord - Within 0-8 Range - Cast 'Rearing Stomp'");
+
+DELETE FROM `creature_text` WHERE `entry`=26605;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextId`) VALUES
+(26605, 0, 0, 'You have made a fatal mistake, mortal... There isss no essscape...', 12, 0, 100, 0, 0, 0, 'Anub''ar Underlord', 25860);
+
+-- Actionlist SAI
+SET @ENTRY := 2660500;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,28,34426,0,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Underlord - On Script - Remove Aura 'Greater Invisibility'"),
+(@ENTRY,9,1,0,0,0,100,0,0,0,0,0,1,0,10000,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Underlord - On Script - Say Line 0"),
+(@ENTRY,9,2,0,0,0,100,0,0,0,0,0,12,26606,2,30000,0,0,0,8,0,0,0,3703.85,2164.53,37.2352,3.81021,"Anub'ar Underlord - On Script - Summon Creature 'Anub'ar Slayer'"),
+(@ENTRY,9,3,0,0,0,100,0,0,0,0,0,12,26402,2,30000,0,0,0,8,0,0,0,3709.76,2158.12,37.2493,3.19637,"Anub'ar Underlord - On Script - Summon Creature 'Anub'ar Ambusher'"),
+(@ENTRY,9,4,0,0,0,100,0,100,100,0,0,45,1,1,0,0,0,0,9,0,0,2,0,0,0,0,"Anub'ar Underlord - On Script - Set Data 1 1"),
+(@ENTRY,9,5,0,0,0,100,0,4000,4000,0,0,45,1,1,0,0,0,0,10,98533,26653,0,0,0,0,0,"Anub'ar Underlord - On Script - Set Data 1 1"),
+(@ENTRY,9,6,0,0,0,100,0,0,0,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Underlord - On Script - Set Reactstate Aggressive"),
+(@ENTRY,9,7,0,0,0,100,0,0,0,0,0,45,1,2,0,0,0,0,9,0,0,2,0,0,0,0,"Anub'ar Underlord - On Script - Set Data 1 2"),
+(@ENTRY,9,8,0,0,0,100,0,0,0,0,0,38,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Underlord - On Script - Set In Combat With Zone");
+
+-- Kilix the Unraveler SAI
+SET @ENTRY := 26653;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,38,0,100,0,1,1,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Kilix the Unraveler - On Data Set 1 1 - Run Script"),
+(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kilix the Unraveler - On Reset - Set Reactstate Passive");
+
+-- Actionlist SAI
+SET @ENTRY := 2665300;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,1,0,25000,0,0,0,0,1,0,0,0,0,0,0,0,"Kilix the Unraveler - On Script - Say Line 0"),
+(@ENTRY,9,1,0,0,0,100,0,8000,8000,0,0,49,0,0,0,0,0,0,10,118282,26605,0,0,0,0,0,"Kilix the Unraveler - On Script - Start Attacking");
+
+DELETE FROM `creature_text` WHERE `entry`=26653;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextId`) VALUES
+(26653, 0, 0, 'Betrayers! The day of reckoning comes and with it comes your end! See then if your Lich King saves you from the ancient one\'s judgement! Now you die!', 12, 0, 100, 0, 0, 0, 'Kilix the Unraveler', 25861);
+
+-- Anub'ar Slayer SAI
+SET @ENTRY := 26606;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,38,0,100,0,1,1,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Slayer - On Data Set 1 1 - Set Reactstate Passive"),
+(@ENTRY,0,1,0,38,0,100,0,1,2,0,0,49,0,0,0,0,0,0,10,98533,26653,0,0,0,0,0,"Anub'ar Ambusher - On Data Set 1 2 - Start Attacking");
+
+-- Anub'ar Ambusher SAI
+SET @ENTRY := 26402;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,4,0,100,1,0,0,0,0,11,50347,0,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Ambusher - On Aggro - Cast 'Rush' (No Repeat)"),
+(@ENTRY,0,1,0,38,0,100,0,1,1,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Anub'ar Ambusher - On Data Set 1 1 - Set Reactstate Passive"),
+(@ENTRY,0,2,0,38,0,100,0,1,2,0,0,49,0,0,0,0,0,0,10,98533,26653,0,0,0,0,0,"Anub'ar Ambusher - On Data Set 1 2 - Start Attacking");
diff --git a/sql/updates/world/3.3.5/2016_07_20_00_world_335.sql b/sql/updates/world/3.3.5/2016_07_20_00_world_335.sql
new file mode 100644
index 00000000000..2bcc4f42bf2
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_20_00_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature` SET `position_z`= -265.613 WHERE `guid`= 24440 AND `id`= 14528;
diff --git a/sql/updates/world/3.3.5/2016_07_20_01_world.sql b/sql/updates/world/3.3.5/2016_07_20_01_world.sql
new file mode 100644
index 00000000000..47274168c85
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_20_01_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid`= 11443 AND `source_type`= 0 AND `id`= 3;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(11443,0,3,0,0,0,100,0,1000,3000,9000,9000,11,20822,0,0,0,0,0,2,0,0,0,0,0,0,0,"Gordok Ogre-Mage - IC - Cast 'Frostbolt'");
diff --git a/sql/updates/world/3.3.5/2016_07_20_02_world.sql b/sql/updates/world/3.3.5/2016_07_20_02_world.sql
new file mode 100644
index 00000000000..125fa3bd8c8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_20_02_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `smart_scripts` SET `event_type`=0, `event_flags`=1, `event_param1`=10000,`event_param2`=10000, `action_param2`=0 WHERE `entryorguid`= 26919 AND `source_type`= 0 AND `id`= 4;
+UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid` IN (4950) AND `source_type`=2;
diff --git a/sql/updates/world/3.3.5/2016_07_22_00_world.sql b/sql/updates/world/3.3.5/2016_07_22_00_world.sql
new file mode 100644
index 00000000000..9f2158cb723
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_22_00_world.sql
@@ -0,0 +1,2 @@
+-- Gurgleboggle's Bauble
+UPDATE `gameobject` SET `spawntimesecs` = 2 WHERE `id` IN (187885,187886);
diff --git a/sql/updates/world/3.3.5/2016_07_25_00_world.sql b/sql/updates/world/3.3.5/2016_07_25_00_world.sql
new file mode 100644
index 00000000000..3006fbde68d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_25_00_world.sql
@@ -0,0 +1,15 @@
+DELETE FROM `spell_dbc` WHERE `Id`=31338;
+INSERT INTO `spell_dbc` (`Id`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `Stances`, `StancesNot`, `Targets`, `CastingTimeIndex`, `AuraInterruptFlags`, `ProcFlags`, `ProcChance`, `ProcCharges`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `Effect1`, `Effect2`, `Effect3`, `EffectDieSides1`, `EffectDieSides2`, `EffectDieSides3`, `EffectRealPointsPerLevel1`, `EffectRealPointsPerLevel2`, `EffectRealPointsPerLevel3`, `EffectBasePoints1`, `EffectBasePoints2`, `EffectBasePoints3`, `EffectMechanic1`, `EffectMechanic2`, `EffectMechanic3`, `EffectImplicitTargetA1`, `EffectImplicitTargetA2`, `EffectImplicitTargetA3`, `EffectImplicitTargetB1`, `EffectImplicitTargetB2`, `EffectImplicitTargetB3`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectRadiusIndex3`, `EffectApplyAuraName1`, `EffectApplyAuraName2`, `EffectApplyAuraName3`, `EffectAmplitude1`, `EffectAmplitude2`, `EffectAmplitude3`, `EffectMultipleValue1`, `EffectMultipleValue2`, `EffectMultipleValue3`, `EffectItemType1`, `EffectItemType2`, `EffectItemType3`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectMiscValue3`, `EffectMiscValueB1`, `EffectMiscValueB2`, `EffectMiscValueB3`, `EffectTriggerSpell1`, `EffectTriggerSpell2`, `EffectTriggerSpell3`, `EffectSpellClassMaskA1`, `EffectSpellClassMaskA2`, `EffectSpellClassMaskA3`, `EffectSpellClassMaskB1`, `EffectSpellClassMaskB2`, `EffectSpellClassMaskB3`, `EffectSpellClassMaskC1`, `EffectSpellClassMaskC2`, `EffectSpellClassMaskC3`, `MaxTargetLevel`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `MaxAffectedTargets`, `DmgClass`, `PreventionType`, `DmgMultiplier1`, `DmgMultiplier2`, `DmgMultiplier3`, `AreaGroupId`, `SchoolMask`, `Comment`) VALUES
+(31338, 0, 0, 384, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 101, 0, 0, 0, 0, 3, 12, 0, -1, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18120, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 'Summon Ogre');
+
+UPDATE `creature_template` SET `unit_flags`=33024 WHERE `entry`=30718;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=3088400 AND `source_type`=9 AND `id`=2;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(3088400, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 19, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Slumbering Mjordin - On Script - Remove Unit Flags - Immune to pc-npc');
+
+UPDATE `smart_scripts` SET `target_type`=10, `target_param1`=85139, `target_param2`=33518 WHERE `entryorguid`=33707 AND `source_type`=0 AND `id`=9 AND `link`=10;
+
+UPDATE `creature_template` SET `flags_extra`=2 WHERE `entry`=18206;
+
+UPDATE `item_template` SET `FlagsExtra`=0 WHERE `entry`=7666;
diff --git a/sql/updates/world/3.3.5/2016_07_28_00_world.sql b/sql/updates/world/3.3.5/2016_07_28_00_world.sql
new file mode 100644
index 00000000000..89d9d616efb
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_28_00_world.sql
@@ -0,0 +1,53 @@
+SET @ATTUMEN_UNMOUNTED := 15550;
+SET @ATTUMEN_MOUNTED := 16152;
+SET @MIDNIGHT := 16151;
+SET @GMIDNIGHT := 135159;
+
+DELETE FROM `creature_text` WHERE `entry` IN (@MIDNIGHT, @ATTUMEN_UNMOUNTED, @ATTUMEN_MOUNTED);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(@ATTUMEN_UNMOUNTED, 0, 0, 'It was... inevitable.', 14, 0, 100, 0, 0, 9169, 13460, 0, 'attumen SAY_KILL1'),
+(@ATTUMEN_UNMOUNTED, 0, 1, 'Another trophy to add to my collection!', 14, 0, 100, 0, 0, 9300, 15333, 0,'attumen SAY_KILL2'),
+(@ATTUMEN_UNMOUNTED, 1, 0, 'Such easy sport.', 14, 0, 100, 0, 0, 9170, 0, 0,'attumen SAY_RANDOM1'),
+(@ATTUMEN_UNMOUNTED, 1, 1, 'Amateurs! Do not think you can best me! I kill for a living.', 14, 0, 100, 0, 0, 9304, 0, 0, 'attumen SAY_RANDOM2'),
+(@ATTUMEN_UNMOUNTED, 2, 0, 'Weapons are merely a convenience for a warrior of my skill!', 14, 0, 100, 0, 0, 9166, 13490, 0, 'attumen SAY_DISARMED'),
+(@ATTUMEN_UNMOUNTED, 3, 0, 'Well done, Midnight!', 14, 0, 100, 0, 0, 9173, 15334, 0, 'attumen SAY_MIDNIGHT_KILL'),
+(@ATTUMEN_UNMOUNTED, 4, 0, 'Cowards! Wretches!', 14, 0, 100, 0, 0, 9167, 13459, 0, 'attumen SAY_APPEAR1'),
+(@ATTUMEN_UNMOUNTED, 4, 1, 'Who dares attack the steed of the Huntsman?', 14, 0, 100, 0, 0, 9298, 15378, 0, 'attumen SAY_APPEAR2'),
+(@ATTUMEN_UNMOUNTED, 4, 2, 'Perhaps you would rather test yourselves against a more formidable opponent?!', 14, 0, 100, 0, 0, 9299, 15379, 0, 'attumen SAY_APPEAR3'),
+(@ATTUMEN_UNMOUNTED, 5, 0, 'Come Midnight, let\'s disperse this petty rabble!', 14, 0, 100, 0, 0, 9168, 13456, 0, 'attumen SAY_MOUNT'),
+
+(@ATTUMEN_MOUNTED, 0, 0, 'It was... inevitable.', 14, 0, 100, 0, 0, 9169, 13460, 0, 'attumen SAY_KILL1'),
+(@ATTUMEN_MOUNTED, 0, 1, 'Another trophy to add to my collection!', 14, 0, 100, 0, 0, 9300, 15333, 0,'attumen SAY_KILL2'),
+(@ATTUMEN_MOUNTED, 1, 0, 'Such easy sport.', 14, 0, 100, 0, 0, 9170, 0, 0,'attumen SAY_RANDOM1'),
+(@ATTUMEN_MOUNTED, 1, 1, 'Amateurs! Do not think you can best me! I kill for a living.', 14, 0, 100, 0, 0, 9304, 0, 0, 'attumen SAY_RANDOM2'),
+(@ATTUMEN_MOUNTED, 2, 0, 'Weapons are merely a convenience for a warrior of my skill!', 14, 0, 100, 0, 0, 9166, 13490, 0, 'attumen SAY_DISARMED'),
+(@ATTUMEN_MOUNTED, 3, 0, 'Always knew... someday I would become... the hunted.', 14, 0, 100, 0, 0, 9165, 13462, 0, 'attumen SAY_DEATH'),
+
+(@MIDNIGHT, 0, 0, '%s calls for her master!', 16, 0, 100, 0, 0, 0, 13439, 0, 'midnight EMOTE_CALL_ATTUMEN'),
+(@MIDNIGHT, 1, 0, '%s rushes to her master\'s aid.', 16, 0, 100, 0, 0, 0, 13455, 0, 'midnight EMOTE_MOUNT_UP');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceEntry` = 29770;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 29770, 0, 0, 31, 0, 3, 15550, 0, 0, 0, 0, '', 'Mount spell only hit Attumen the Huntsmen');
+
+DELETE FROM `creature_formations` WHERE `leaderGUID` = 135159;
+INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
+(@GMIDNIGHT, @GMIDNIGHT, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135828, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135836, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135829, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135839, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135833, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135840, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135834, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135830, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135841, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135842, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135831, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135837, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135838, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135832, 0, 0, 1, 0, 0),
+(@GMIDNIGHT, 135835, 0, 0, 1, 0, 0);
+
+UPDATE `creature_template` SET `ScriptName` = 'boss_attumen', `lootid` = @ATTUMEN_MOUNTED WHERE `entry` = @ATTUMEN_MOUNTED;
+UPDATE `creature_loot_template` SET `entry` = @ATTUMEN_MOUNTED WHERE `entry` = @ATTUMEN_UNMOUNTED;
diff --git a/sql/updates/world/3.3.5/2016_07_29_00_world.sql b/sql/updates/world/3.3.5/2016_07_29_00_world.sql
new file mode 100644
index 00000000000..89b32cd993a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_29_00_world.sql
@@ -0,0 +1,59 @@
+-- SmartAI script for creature entry 15170 Rutgar Glyphshaper and 15171 Frankal Stonebridge
+SET @RUTGAR := 15170;
+SET @FRANKAL := 15171;
+
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`= '' WHERE `entry` IN (@RUTGAR,@FRANKAL);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@RUTGAR,@FRANKAL) AND `source_type`= 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@RUTGAR, 0, 0,1, 62,0,100,0,6545,0,0,0, 33,15222,0,0,0,0,0, 7,0,0,0,0,0,0,0,"Rutgar Glyphshaper - on Gossip Menu 6545 id 0 selected - Kill Credit 'Rutgar Invisible Trigger'"),
+(@RUTGAR, 0, 1,0, 61,0,100,0, 0,0,0,0, 72, 0,0,0,0,0,0, 7,0,0,0,0,0,0,0,"Rutgar Glyphshaper - on Gossip Menu 6545 id 0 selected - Close Gossip"),
+(@FRANKAL,0, 2,3, 62,0,100,0,6552,0,0,0, 33,15221,0,0,0,0,0, 7,0,0,0,0,0,0,0,"Frankal Stonebridge - on Gossip Menu 6552 id 0 selected - Kill Credit 'Frankal Invisible Trigger'"),
+(@FRANKAL,0, 3,0, 61,0,100,0, 0,0,0,0, 72, 0,0,0,0,0,0, 7,0,0,0,0,0,0,0,"Frankal Stonebridge - on Gossip Menu 6552 id 0 selected - Close Gossip");
+
+-- gossip menu options for NPC 15170 Rutgar Glyphshaper and NPC 15171 Frankal Stonebridge
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (6534,6551,6550,6549,6548,6547,6546,6545,6533,6558,6557,6556,6555,6554,6553,6552);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(6534,0,0,"Hello, Rutgar. The Commander has sent me here to gather some information about his missing wife.", 10712,1,1,6551,0,0,0,'',0),
+(6551,0,0,"That sounds dangerous.", 10714,1,1,6550,0,0,0,'',0),
+(6550,0,0,"What happened to her after that?", 10716,1,1,6549,0,0,0,'',0),
+(6549,0,0,"Natalia?", 10718,1,1,6548,0,0,0,'',0),
+(6548,0,0,"What demands?", 10720,1,1,6547,0,0,0,'',0),
+(6547,0,0,"Lost it? What do you mean?", 10722,1,1,6546,0,0,0,'',0),
+(6546,0,0,"Possessed by what?", 10724,1,1,6545,0,0,0,'',0),
+(6545,0,0,"I'll be back once I straighten this mess out.", 10726,1,1, 0,0,0,0,'',0),
+(6533,0,0,"Hello, Frankal. I've heard that you might have some information as to the whereabouts of Mistress Natalia Mar'alith.",10727,1,1,6558,0,0,0,'',0),
+(6558,0,0,"That's what I like to hear.", 10729,1,1,6557,0,0,0,'',0),
+(6557,0,0,"That's odd.", 10731,1,1,6556,0,0,0,'',0),
+(6556,0,0,"You couldn't handle a lone night elf priestess?", 10733,1,1,6555,0,0,0,'',0),
+(6555,0,0,"I've been meaning to ask you about that monkey.", 10735,1,1,6554,0,0,0,'',0),
+(6554,0,0,"Then what?", 10737,1,1,6553,0,0,0,'',0),
+(6553,0,0,"What a story! So she went into Hive'Regal and that was the last you saw of her?", 10739,1,1,6552,0,0,0,'',0),
+(6552,0,0,"Thanks for the information, Frankal.", 10741,1,1, 0,0,0,0,'',0);
+
+-- conditions for Rutgar Glyphshaper's and Frankal Stonebridge's gossip menus
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` IN (6533,6534) AND `SourceEntry` IN (0,7735,7736);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(14,6533,7735,0,0,9,0,8304,0,0,0,0,0,'',"Show gossip_menu.entry 6533 text_id 7735 only if Quest 8304 is taken (active)"),
+(14,6534,7736,0,0,9,0,8304,0,0,0,0,0,'',"Show gossip_menu.entry 6534 text_id 7736 only if Quest 8304 is taken (active)"),
+(15,6533, 0,0,0,9,0,8304,0,0,0,0,0,'',"Show gossip_menu_option.menu_id 6533 id 0 only if Quest 8304 is taken (active)"),
+(15,6534, 0,0,0,9,0,8304,0,0,0,0,0,'',"Show gossip_menu_option.menu_id 6534 id 0 only if Quest 8304 is taken (active)");
+
+-- gossip menu options for gameobject_template.displayId 6425 Lesser Wind Stone, 6426 Wind Stone, 6427 Greater Wind Stone
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (6540,6542,6543) AND `id` IN (0,1,2,3,4);
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(6540,0,0,"I am no cultist, you monster! Come to me and face your destruction!", 10684,1,1,0,0,0,0,'',0),
+(6540,1,0,"Crimson Templar! I hold your crest of beckoning. Heed my summons!", 10685,1,1,0,0,0,0,'',0),
+(6540,2,0,"Azure Templar! I hold your crest of beckoning. Heed my summons!", 10692,1,1,0,0,0,0,'',0),
+(6540,3,0,"Earthen Templar! I hold your crest of beckoning. Heed my summons!", 10691,1,1,0,0,0,0,'',0),
+(6540,4,0,"Hoary Templar! I hold your crest of beckoning. Heed my summons!", 10690,1,1,0,0,0,0,'',0),
+(6542,0,0,"You will listen to this, vile duke! I am not your Twilight's Hammer lapdog! I am here to challenge you! Come! Come, and meet your death...",10698,1,1,0,0,0,0,'',0),
+(6542,1,0,"Duke of Cynders! I hold your signet! Heed my call!", 10699,1,1,0,0,0,0,'',0),
+(6542,2,0,"Duke of Fathoms! I hold your signet! Heed my call!", 10702,1,1,0,0,0,0,'',0),
+(6542,3,0,"Duke of Shards! I hold your signet! Heed my call!", 10701,1,1,0,0,0,0,'',0),
+(6542,4,0,"Duke of Zephyrs! I hold your signet! Heed my call!", 10700,1,1,0,0,0,0,'',0),
+(6543,0,0,"The day of judgement has come, fiend! I challenge you to battle!", 10707,1,1,0,0,0,0,'',0),
+(6543,1,0,"Skaldrenox! I hold your scepter, and charge you to enter this world!",10708,1,1,0,0,0,0,'',0),
+(6543,2,0,"Skwol! I hold your scepter! I command you to enter this world!", 10711,1,1,0,0,0,0,'',0),
+(6543,3,0,"Kazum! I hold your scepter! I command you to enter this world!", 10710,1,1,0,0,0,0,'',0),
+(6543,4,0,"Whirlaxis! I hold your scepter! I command you to enter this world!", 10709,1,1,0,0,0,0,'',0);
diff --git a/sql/updates/world/3.3.5/2016_07_30_00_world.sql b/sql/updates/world/3.3.5/2016_07_30_00_world.sql
new file mode 100644
index 00000000000..934f641f788
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_30_00_world.sql
@@ -0,0 +1,5 @@
+--
+UPDATE `creature_template` SET `dmgschool` =2 WHERE `entry` IN (20703,25571);
+UPDATE `creature_template` SET `dmgschool` =4 WHERE `entry` IN (20704);
+UPDATE `creature_template` SET `dmgschool` =5 WHERE `entry` IN (20690,20705,20267);
+UPDATE `creature_template` SET `dmgschool` =6 WHERE `entry` IN (25573,20702);
diff --git a/sql/updates/world/3.3.5/2016_07_30_01_world.sql b/sql/updates/world/3.3.5/2016_07_30_01_world.sql
new file mode 100644
index 00000000000..6eb896decc5
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_30_01_world.sql
@@ -0,0 +1,767 @@
+ALTER TABLE `gameobject_addon`
+ADD COLUMN `parent_rotation0` FLOAT NOT NULL DEFAULT '0' AFTER `guid`,
+ADD COLUMN `parent_rotation1` FLOAT NOT NULL DEFAULT '0' AFTER `parent_rotation0`,
+ADD COLUMN `parent_rotation2` FLOAT NOT NULL DEFAULT '0' AFTER `parent_rotation1`,
+ADD COLUMN `parent_rotation3` FLOAT NOT NULL DEFAULT '1' AFTER `parent_rotation2`;
+
+-- Old parent_rotation fields now go to addon table
+UPDATE `gameobject_addon` ga INNER JOIN `gameobject` g ON ga.`guid` = g.`guid` SET ga.`parent_rotation0` = g.`rotation0`, ga.`parent_rotation1` = g.`rotation1`, ga.`parent_rotation2` = g.`rotation2`, ga.`parent_rotation3` = g.`rotation3`;
+INSERT IGNORE INTO `gameobject_addon` (`guid`, `parent_rotation0`, `parent_rotation1`, `parent_rotation2`, `parent_rotation3`) SELECT `guid`, `rotation0`, `rotation1`, `rotation2`, `rotation3` FROM `gameobject` WHERE `rotation0` != 0 OR `rotation1` != 0 OR `rotation2` != 0 OR `rotation3` != 1;
+
+-- Retain compatibility with old UpdateRotationFields function
+UPDATE `gameobject_addon` ga INNER JOIN `gameobject` g ON ga.`guid` = g.`guid` SET ga.`parent_rotation2`= IF(g.`rotation2` != 0 OR g.`rotation3` != 0, g.`rotation2`, SIN(g.`orientation` / 2)), ga.`parent_rotation3` = IF(g.`rotation2` != 0 OR g.`rotation3` != 0, g.`rotation3`, COS(g.`orientation` / 2));
+UPDATE `gameobject` SET `rotation0`=0, `rotation1`=0, `rotation2`=SIN(`orientation`/2), `rotation3`=COS(`orientation`/2);
+
+-- After mass import into gameobject_addon, some rows won't be unit length, so unitize them to prevent errors when starting server
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=1341;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=1343;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=1890;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0.6762096538109234, `parent_rotation1`=-0.20673818018978996, `parent_rotation2`=0.7071066602321923, `parent_rotation3`=0 WHERE `guid`=4718;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0.6762096538109234, `parent_rotation1`=-0.20673818018978996, `parent_rotation2`=0.7071066602321923, `parent_rotation3`=0 WHERE `guid`=4958;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0.6762096538109234, `parent_rotation1`=-0.20673818018978996, `parent_rotation2`=0.7071066602321923, `parent_rotation3`=0 WHERE `guid`=5136;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=5306;
+UPDATE `gameobject_addon` SET `parent_rotation0`=-0.0030851075994373996, `parent_rotation1`=0.7070998757516332, `parent_rotation2`=0.7071069564239378, `parent_rotation3`=0 WHERE `guid`=5496;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=10528;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0.6957902409824018, `parent_rotation2`=0.6705396463625237, `parent_rotation3`=-0.25739565499377165 WHERE `guid`=12007;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=12098;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=12597;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0.5416755978208309, `parent_rotation1`=-0.4545190336806428, `parent_rotation2`=-0.45451857006530766, `parent_rotation3`=0.5416759771424687 WHERE `guid`=14036;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7963742763149461, `parent_rotation3`=-0.6048041104554813 WHERE `guid`=16736;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0.6678291213863456, `parent_rotation1`=0.2329403984683526, `parent_rotation2`=0.6674002564812922, `parent_rotation3`=-0.23306637045797093 WHERE `guid`=20458;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=-0.8164965561474501, `parent_rotation2`=-0.2508269266233929, `parent_rotation3`=0.5200184868637047 WHERE `guid`=20459;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=21636;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=21753;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22049;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22050;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22105;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22108;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22117;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22133;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22135;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22138;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22150;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22173;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22185;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22215;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22216;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22261;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22270;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22285;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22304;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=22681;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=24650;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=24651;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=24731;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=0.7071067811865475, `parent_rotation3`=0.7071067811865475 WHERE `guid`=24732;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0.7071067811865475, `parent_rotation2`=-0.7071067811865475, `parent_rotation3`=0 WHERE `guid`=46424;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0.7071067811865475, `parent_rotation2`=-0.7071067811865475, `parent_rotation3`=0 WHERE `guid`=46425;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0.7071067811865475, `parent_rotation2`=-0.7071067811865475, `parent_rotation3`=0 WHERE `guid`=46429;
+UPDATE `gameobject_addon` SET `parent_rotation0`=-0.5475785386184279, `parent_rotation1`=0.44738996187113267, `parent_rotation2`=0.7071067571883707, `parent_rotation3`=0 WHERE `guid`=67868;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0.26071837713139784, `parent_rotation2`=0.4995184262775704, `parent_rotation3`=0.8261399818645443 WHERE `guid`=99796;
+UPDATE `gameobject_addon` SET `parent_rotation0`=0, `parent_rotation1`=0, `parent_rotation2`=-0.7305848035703219, `parent_rotation3`=0.6828219715212115 WHERE `guid`=151892;
+
+-- Import special PARENT_ROTATION values for some transports, data taken from UDB
+DELETE FROM `gameobject_addon` WHERE `guid` IN (6945,6946,9290,9411,9450,14139,16760,16761,16871,16874,16875,16876,16877,18298,18435,18802,18803,18804,18805,18806,18807,20505,20639,20640,24055,24074,24075,25138,34057,35693,35694,44890,44891,44892,44893,44901,44909,44954,44962,44976,48263,55230,56744,56937,56954,56961,57132,57133,57140,57141,57799,57992,57993,57994,57995,57996,58299,58304,58305,58306,58310,58782,58824,58935,59160,59328,59336,59343,59350,59386,59762,59763,59764,59765,59766,59779,59780,59781,59782,59783,60421,60463,61053,65435,65436,65438,65439,65520,65588,66717,67873,67874,67875,67876);
+INSERT INTO `gameobject_addon`(`guid`,`parent_rotation0`,`parent_rotation1`,`parent_rotation2`,`parent_rotation3`) VALUES
+(6945,0,0,1,-0.0000000437114),
+(6946,0,0,1,-0.0000000437114),
+(9290,0,0,0.95502,0.296542),
+(9411,0,0,0.678801,0.734323),
+(9450,0,0,0.678801,0.734323),
+(14139,0,0,1,-0.0000000437114),
+(16760,0,0,-0.378575,0.92557),
+(16761,0,0,-0.378575,0.92557),
+(16871,0,0,0.694658,0.71934),
+(16874,0,0,0.989651,0.143493),
+(16875,0,0,-0.426569,0.904455),
+(16876,0,0,0.989651,0.143493),
+(16877,0,0,-0.426569,0.904455),
+(18298,0,0,0.612217,0.79069),
+(18435,0,0,0.612217,0.79069),
+(18802,0,0,1,-0.0000000437114),
+(18803,0,0,1,-0.0000000437114),
+(18804,0,0,1,-0.0000000437114),
+(18805,0,0,1,-0.0000000437114),
+(18806,0,0,1,-0.0000000437114),
+(18807,0,0,1,-0.0000000437114),
+(20505,0,0,-0.694658,0.71934),
+(20639,0,0,0.612217,0.79069),
+(20640,0,0,0.612217,0.79069),
+(24055,0,0,-0.526214,0.850352),
+(24074,0,0,-0.526214,0.850352),
+(24075,0,0,-0.526214,0.850352),
+(25138,0,0,0.45399,0.891007),
+(34057,0,0,0.000000325841,1),
+(35693,0,0,0.989651,0.143493),
+(35694,0,0,0.989651,0.143493),
+(44890,0,0,-0.0043634,0.99999),
+(44891,0,0,-0.0043634,0.99999),
+(44892,0,0,-0.0043634,0.99999),
+(44893,0,0,-0.0043634,0.99999),
+(44901,0,0,-0.0043634,0.99999),
+(44909,0,0,-0.0043634,0.99999),
+(44954,0,0,-0.0043634,0.99999),
+(44962,0,0,-0.0043634,0.99999),
+(44976,0,0,-0.0043634,0.99999),
+(48263,0,0,-0.522498,0.85264),
+(55230,0,0,0.999048,0.0436193),
+(56744,0,0,0.951057,0.309017),
+(56937,0,0,0.951057,0.309017),
+(56954,0,0,0.951057,0.309017),
+(56961,0,0,0.999048,0.0436193),
+(57132,-0.00276125,-0.00551835,-0.370553,0.928791),
+(57133,0.00544418,-0.00290476,0.918772,0.394739),
+(57140,-0.00276125,-0.00551835,-0.370553,0.928791),
+(57141,0.00544418,-0.00290476,0.918772,0.394739),
+(57799,0,0,0.999048,0.0436193),
+(57992,0,0,-0.370557,0.92881),
+(57993,0,0,-0.760406,0.649448),
+(57994,0,0,0.915312,0.402747),
+(57995,0,0,-0.748956,0.66262),
+(57996,0,0,0.995805,0.0915015),
+(58299,0,0,0.999048,0.0436193),
+(58304,0,0,-0.263031,0.964787),
+(58305,0,0,0.522499,0.85264),
+(58306,0,0,0.996917,-0.0784592),
+(58310,0,0,0.333807,0.942641),
+(58782,0,0,0.333807,0.942641),
+(58824,0,0,0.333807,0.942641),
+(58935,0,0,0.932008,-0.362438),
+(59160,0,0,0.99999,0.00436324),
+(59328,0,0,0.99999,-0.00436333),
+(59336,0,0,0.99999,-0.00436333),
+(59343,0,0,0.99999,-0.00436333),
+(59350,0,0,0.99999,-0.00436333),
+(59386,0,0,0.99999,-0.00436333),
+(59762,0,0,-0.370557,0.92881),
+(59763,0,0,-0.760406,0.649448),
+(59764,0,0,0.915312,0.402747),
+(59765,0,0,-0.748956,0.66262),
+(59766,0,0,0.995805,0.0915015),
+(59779,0,0,-0.370557,0.92881),
+(59780,0,0,-0.760406,0.649448),
+(59781,0,0,0.915312,0.402747),
+(59782,0,0,-0.748956,0.66262),
+(59783,0,0,0.995805,0.0915015),
+(60421,0,0,0.99999,0.00436324),
+(60463,0,0,0.999048,0.0436193),
+(61053,0,0,0.999048,0.0436193),
+(65435,0,0,0.915312,0.402747),
+(65436,0,0,0.99999,0.00436324),
+(65438,0,0,0.915312,0.402747),
+(65439,0,0,0.915312,0.402747),
+(65520,0,0,0.99999,0.00436324),
+(65588,0,0,1,-0.0000000437114),
+(66717,0,0,0.999657,0.0261769),
+(67873,-0.00276125,-0.00551835,-0.370553,0.928791),
+(67874,0.00544418,-0.00290476,0.918772,0.394739),
+(67875,-0.00276125,-0.00551835,-0.370553,0.928791),
+(67876,0.00544418,-0.00290476,0.918772,0.394739);
+
+-- Import from mangos UDB rows with explicit rotation in X or Y set
+UPDATE `gameobject` SET `rotation0`=0.00661993, `rotation1`=-0.0256987, `rotation2`=-0.913849, `rotation3`=0.405186 WHERE `guid`=31;
+UPDATE `gameobject` SET `rotation0`=0.0217795, `rotation1`=0.0566788, `rotation2`=-0.998154, `rotation3`=0.00154408 WHERE `guid`=39;
+UPDATE `gameobject` SET `rotation0`=0, `rotation1`=-1, `rotation2`=0, `rotation3`=0 WHERE `guid`=256;
+UPDATE `gameobject` SET `rotation0`=0.0647478, `rotation1`=0.0103159, `rotation2`=-0.996012, `rotation3`=0.0605139 WHERE `guid`=422;
+UPDATE `gameobject` SET `rotation0`=-0.0371165, `rotation1`=-0.0287819, `rotation2`=-0.959991, `rotation3`=0.276066 WHERE `guid`=425;
+UPDATE `gameobject` SET `rotation0`=0.0527701, `rotation1`=0.0327311, `rotation2`=-0.980893, `rotation3`=0.184371 WHERE `guid`=428;
+UPDATE `gameobject` SET `rotation0`=-0.0392456, `rotation1`=0.0261564, `rotation2`=0.998886, `rotation3`=0.00146484 WHERE `guid`=1643;
+UPDATE `gameobject` SET `rotation0`=-0.0232878, `rotation1`=-0.0147963, `rotation2`=-0.969871, `rotation3`=0.242053 WHERE `guid`=1692;
+UPDATE `gameobject` SET `rotation0`=-0.0346627, `rotation1`=-0.0136871, `rotation2`=-0.999145, `rotation3`=0.0179256 WHERE `guid`=1733;
+UPDATE `gameobject` SET `rotation0`=0.681389, `rotation1`=-0.188966, `rotation2`=0.68139, `rotation3`=0.188967 WHERE `guid`=5141;
+UPDATE `gameobject` SET `rotation0`=-0.316432, `rotation1`=-0.0235138, `rotation2`=-0.945716, `rotation3`=0.0702803 WHERE `guid`=5193;
+UPDATE `gameobject` SET `rotation0`=0.309975, `rotation1`=-0.635543, `rotation2`=0.309974, `rotation3`=0.635543 WHERE `guid`=5205;
+UPDATE `gameobject` SET `rotation0`=0.00517035, `rotation1`=-0.0122805, `rotation2`=-0.933433, `rotation3`=0.358505 WHERE `guid`=5352;
+UPDATE `gameobject` SET `rotation0`=0.61994, `rotation1`=-0.340111, `rotation2`=0.619939, `rotation3`=0.34011 WHERE `guid`=5382;
+UPDATE `gameobject` SET `rotation0`=0.607692, `rotation1`=-0.361538, `rotation2`=0.607693, `rotation3`=0.361539 WHERE `guid`=5398;
+UPDATE `gameobject` SET `rotation0`=0.607692, `rotation1`=-0.361538, `rotation2`=0.607693, `rotation3`=0.361539 WHERE `guid`=5405;
+UPDATE `gameobject` SET `rotation0`=0.147016, `rotation1`=-0.691655, `rotation2`=0.147016, `rotation3`=0.691655 WHERE `guid`=5425;
+UPDATE `gameobject` SET `rotation0`=0.0828447, `rotation1`=0.0300417, `rotation2`=0.870979, `rotation3`=0.483352 WHERE `guid`=5514;
+UPDATE `gameobject` SET `rotation0`=0.241845, `rotation1`=0.664462, `rotation2`=0.664463, `rotation3`=0.241847 WHERE `guid`=6166;
+UPDATE `gameobject` SET `rotation0`=-0.120005, `rotation1`=0.0474339, `rotation2`=-0.901711, `rotation3`=0.412634 WHERE `guid`=6771;
+UPDATE `gameobject` SET `rotation0`=-0.0218129, `rotation1`=-0.0130854, `rotation2`=-0.999676, `rotation3`=0.00117086 WHERE `guid`=6896;
+UPDATE `gameobject` SET `rotation0`=-0.00554562, `rotation1`=0.00270462, `rotation2`=-0.945506, `rotation3`=0.325546 WHERE `guid`=6943;
+UPDATE `gameobject` SET `rotation0`=0.00311899, `rotation1`=0.0220261, `rotation2`=-0.998138, `rotation3`=0.0567872 WHERE `guid`=6997;
+UPDATE `gameobject` SET `rotation0`=-0.000787735, `rotation1`=-0.0194941, `rotation2`=-0.911526, `rotation3`=0.41078 WHERE `guid`=7016;
+UPDATE `gameobject` SET `rotation0`=0.0240598, `rotation1`=-0.0310163, `rotation2`=-0.946024, `rotation3`=0.321711 WHERE `guid`=7033;
+UPDATE `gameobject` SET `rotation0`=-0.517355, `rotation1`=-0.209099, `rotation2`=-0.745465, `rotation3`=0.364559 WHERE `guid`=11584;
+UPDATE `gameobject` SET `rotation0`=0, `rotation1`=0.173648, `rotation2`=-0.98106, `rotation3`=0.0858351 WHERE `guid`=12045;
+UPDATE `gameobject` SET `rotation0`=-0.0702071, `rotation1`=0.0758209, `rotation2`=-0.969868, `rotation3`=0.220633 WHERE `guid`=12126;
+UPDATE `gameobject` SET `rotation0`=0.0112896, `rotation1`=-0.0421324, `rotation2`=-0.965006, `rotation3`=0.258575 WHERE `guid`=12153;
+UPDATE `gameobject` SET `rotation0`=-0.13007, `rotation1`=0.0567751, `rotation2`=0.989808, `rotation3`=0.0117644 WHERE `guid`=13380;
+UPDATE `gameobject` SET `rotation0`=-0.108055, `rotation1`=-0.0132675, `rotation2`=-0.98861, `rotation3`=0.103913 WHERE `guid`=14140;
+UPDATE `gameobject` SET `rotation0`=0.045383, `rotation1`=0.0708761, `rotation2`=-0.883594, `rotation3`=0.460629 WHERE `guid`=15274;
+UPDATE `gameobject` SET `rotation0`=0.045383, `rotation1`=0.0708761, `rotation2`=-0.883594, `rotation3`=0.460629 WHERE `guid`=15366;
+UPDATE `gameobject` SET `rotation0`=0.00190258, `rotation1`=-0.0435772, `rotation2`=-0.998096, `rotation3`=0.0435988 WHERE `guid`=15561;
+UPDATE `gameobject` SET `rotation0`=0.185185, `rotation1`=-0.389885, `rotation2`=-0.900506, `rotation3`=0.0527745 WHERE `guid`=17928;
+UPDATE `gameobject` SET `rotation0`=0.171708, `rotation1`=-0.056263, `rotation2`=0.382931, `rotation3`=0.905933 WHERE `guid`=21760;
+UPDATE `gameobject` SET `rotation0`=-0.0308428, `rotation1`=-0.000134468, `rotation2`=-0.704017, `rotation3`=0.709513 WHERE `guid`=21768;
+UPDATE `gameobject` SET `rotation0`=-0.0229378, `rotation1`=0.0318613, `rotation2`=-0.810947, `rotation3`=0.583801 WHERE `guid`=21774;
+UPDATE `gameobject` SET `rotation0`=-0.0175047, `rotation1`=0.00414562, `rotation2`=0.0124769, `rotation3`=0.99976 WHERE `guid`=21775;
+UPDATE `gameobject` SET `rotation0`=0.0281639, `rotation1`=-0.00794315, `rotation2`=0.739404, `rotation3`=0.672626 WHERE `guid`=21777;
+UPDATE `gameobject` SET `rotation0`=0.0193486, `rotation1`=0.00251198, `rotation2`=0.558642, `rotation3`=0.829179 WHERE `guid`=21778;
+UPDATE `gameobject` SET `rotation0`=-0.00526476, `rotation1`=-0.0032177, `rotation2`=0.972073, `rotation3`=0.234599 WHERE `guid`=22676;
+UPDATE `gameobject` SET `rotation0`=-0.00144768, `rotation1`=-0.00599766, `rotation2`=0.521473, `rotation3`=0.853246 WHERE `guid`=22681;
+UPDATE `gameobject` SET `rotation0`=-0.00425291, `rotation1`=-0.00447083, `rotation2`=0.878231, `rotation3`=0.478197 WHERE `guid`=22682;
+UPDATE `gameobject` SET `rotation0`=0.0059185, `rotation1`=0.00174522, `rotation2`=-0.999668, `rotation3`=0.025011 WHERE `guid`=22683;
+UPDATE `gameobject` SET `rotation0`=0.0133157, `rotation1`=-0.0566292, `rotation2`=-0.9983, `rotation3`=0.00370258 WHERE `guid`=23388;
+UPDATE `gameobject` SET `rotation0`=-0.0218129, `rotation1`=0.0130854, `rotation2`=0.999676, `rotation3`=0.00117086 WHERE `guid`=24026;
+UPDATE `gameobject` SET `rotation0`=-0.0425816, `rotation1`=-0.0586815, `rotation2`=0.995896, `rotation3`=0.0541643 WHERE `guid`=24222;
+UPDATE `gameobject` SET `rotation0`=-0.0627699, `rotation1`=0.0825901, `rotation2`=-0.992224, `rotation3`=0.0687813 WHERE `guid`=24223;
+UPDATE `gameobject` SET `rotation0`=0.00614643, `rotation1`=-0.000543594, `rotation2`=-0.921, `rotation3`=0.389515 WHERE `guid`=24716;
+UPDATE `gameobject` SET `rotation0`=0.0057869, `rotation1`=-0.002141, `rotation2`=-0.786171, `rotation3`=0.617978 WHERE `guid`=24718;
+UPDATE `gameobject` SET `rotation0`=-0.00567293, `rotation1`=-0.0024271, `rotation2`=0.995696, `rotation3`=0.0924729 WHERE `guid`=24719;
+UPDATE `gameobject` SET `rotation0`=0.00611162, `rotation1`=0.000849724, `rotation2`=-0.98495, `rotation3`=0.172729 WHERE `guid`=24720;
+UPDATE `gameobject` SET `rotation0`=0.00600815, `rotation1`=0.00140476, `rotation2`=-0.996615, `rotation3`=0.0819735 WHERE `guid`=24722;
+UPDATE `gameobject` SET `rotation0`=-0.00526476, `rotation1`=-0.0032177, `rotation2`=0.972073, `rotation3`=0.234599 WHERE `guid`=24726;
+UPDATE `gameobject` SET `rotation0`=0.00599813, `rotation1`=-0.00144768, `rotation2`=-0.853245, `rotation3`=0.521474 WHERE `guid`=24742;
+UPDATE `gameobject` SET `rotation0`=0.00387716, `rotation1`=-0.00479984, `rotation2`=-0.359471, `rotation3`=0.933136 WHERE `guid`=24745;
+UPDATE `gameobject` SET `rotation0`=-0.00043869, `rotation1`=0.00434017, `rotation2`=-0.994905, `rotation3`=0.100727 WHERE `guid`=24760;
+UPDATE `gameobject` SET `rotation0`=0.0261407, `rotation1`=-0.0523176, `rotation2`=0.998287, `rotation3`=0.00148505 WHERE `guid`=24869;
+UPDATE `gameobject` SET `rotation0`=0.101759, `rotation1`=0.00521469, `rotation2`=0.9523, `rotation3`=0.28765 WHERE `guid`=25120;
+UPDATE `gameobject` SET `rotation0`=0.0778918, `rotation1`=-0.124165, `rotation2`=0.683997, `rotation3`=0.714607 WHERE `guid`=25256;
+UPDATE `gameobject` SET `rotation0`=0.106593, `rotation1`=-0.075654, `rotation2`=0.960539, `rotation3`=0.245519 WHERE `guid`=25257;
+UPDATE `gameobject` SET `rotation0`=-0.0218129, `rotation1`=0.0130854, `rotation2`=0.999676, `rotation3`=0.00117086 WHERE `guid`=25913;
+UPDATE `gameobject` SET `rotation0`=-0.59733, `rotation1`=-0.208596, `rotation2`=-0.731095, `rotation3`=0.255313 WHERE `guid`=26628;
+UPDATE `gameobject` SET `rotation0`=-0.042439, `rotation1`=0.0258846, `rotation2`=-0.934402, `rotation3`=0.352734 WHERE `guid`=26846;
+UPDATE `gameobject` SET `rotation0`=0.0240598, `rotation1`=-0.0310163, `rotation2`=-0.946024, `rotation3`=0.321711 WHERE `guid`=31662;
+UPDATE `gameobject` SET `rotation0`=-0.00346088, `rotation1`=0.00462914, `rotation2`=0.577754, `rotation3`=0.81619 WHERE `guid`=32331;
+UPDATE `gameobject` SET `rotation0`=0.118706, `rotation1`=0.0711489, `rotation2`=-0.899253, `rotation3`=0.414959 WHERE `guid`=42485;
+UPDATE `gameobject` SET `rotation0`=-0.0733967, `rotation1`=-0.0395975, `rotation2`=0.686763, `rotation3`=0.722082 WHERE `guid`=42854;
+UPDATE `gameobject` SET `rotation0`=0.00646782, `rotation1`=0.00192738, `rotation2`=0.999939, `rotation3`=0.00874828 WHERE `guid`=42958;
+UPDATE `gameobject` SET `rotation0`=0.0646195, `rotation1`=0.0148668, `rotation2`=-0.997768, `rotation3`=0.00783916 WHERE `guid`=42985;
+UPDATE `gameobject` SET `rotation0`=0.0384789, `rotation1`=0.0146103, `rotation2`=-0.999125, `rotation3`=0.00748919 WHERE `guid`=43182;
+UPDATE `gameobject` SET `rotation0`=0.0646195, `rotation1`=0.0148668, `rotation2`=-0.997768, `rotation3`=0.00783916 WHERE `guid`=43193;
+UPDATE `gameobject` SET `rotation0`=-0.0566726, `rotation1`=0.0261345, `rotation2`=0.998049, `rotation3`=0.00195313 WHERE `guid`=45565;
+UPDATE `gameobject` SET `rotation0`=0.00597954, `rotation1`=-0.0124331, `rotation2`=-0.991918, `rotation3`=0.126131 WHERE `guid`=48526;
+UPDATE `gameobject` SET `rotation0`=-0.402262, `rotation1`=-0.303519, `rotation2`=-0.679092, `rotation3`=0.533756 WHERE `guid`=48529;
+UPDATE `gameobject` SET `rotation0`=-0.0139608, `rotation1`=-0.0136299, `rotation2`=-0.952168, `rotation3`=0.304953 WHERE `guid`=48551;
+UPDATE `gameobject` SET `rotation0`=0.0608597, `rotation1`=-0.0783129, `rotation2`=0.995057, `rotation3`=0.00495468 WHERE `guid`=50347;
+UPDATE `gameobject` SET `rotation0`=0.0022459, `rotation1`=0.0019207, `rotation2`=-0.82254, `rotation3`=0.568699 WHERE `guid`=55040;
+UPDATE `gameobject` SET `rotation0`=0.064477, `rotation1`=-0.0282221, `rotation2`=-0.982747, `rotation3`=0.171039 WHERE `guid`=55077;
+UPDATE `gameobject` SET `rotation0`=-0.0520096, `rotation1`=-0.0134745, `rotation2`=0.22455, `rotation3`=0.97298 WHERE `guid`=55419;
+UPDATE `gameobject` SET `rotation0`=-0.00342178, `rotation1`=-0.0196419, `rotation2`=0.583972, `rotation3`=0.811529 WHERE `guid`=56066;
+UPDATE `gameobject` SET `rotation0`=0.0469356, `rotation1`=-0.0745831, `rotation2`=-0.287543, `rotation3`=0.953705 WHERE `guid`=56099;
+UPDATE `gameobject` SET `rotation0`=0.0234499, `rotation1`=-0.0849457, `rotation2`=-0.550198, `rotation3`=0.830372 WHERE `guid`=56106;
+UPDATE `gameobject` SET `rotation0`=0.00357676, `rotation1`=0.00249863, `rotation2`=0.984033, `rotation3`=0.177935 WHERE `guid`=56122;
+UPDATE `gameobject` SET `rotation0`=0.0249286, `rotation1`=-0.0845232, `rotation2`=-0.535622, `rotation3`=0.839848 WHERE `guid`=56124;
+UPDATE `gameobject` SET `rotation0`=-0.00971794, `rotation1`=-0.0320435, `rotation2`=-0.997552, `rotation3`=0.0613915 WHERE `guid`=56222;
+UPDATE `gameobject` SET `rotation0`=-0.0123668, `rotation1`=-0.0872507, `rotation2`=-0.835673, `rotation3`=0.542111 WHERE `guid`=56223;
+UPDATE `gameobject` SET `rotation0`=-0.017982, `rotation1`=0.0323582, `rotation2`=0.703278, `rotation3`=0.709951 WHERE `guid`=56243;
+UPDATE `gameobject` SET `rotation0`=0.0828447, `rotation1`=0.0300417, `rotation2`=0.870979, `rotation3`=0.483352 WHERE `guid`=56294;
+UPDATE `gameobject` SET `rotation0`=0.0170689, `rotation1`=-0.00339508, `rotation2`=-0.831343, `rotation3`=0.555488 WHERE `guid`=56583;
+UPDATE `gameobject` SET `rotation0`=-0.00762081, `rotation1`=-0.0171156, `rotation2`=0.70084, `rotation3`=0.713072 WHERE `guid`=56656;
+UPDATE `gameobject` SET `rotation0`=-0.0153003, `rotation1`=0.0108137, `rotation2`=-0.836097, `rotation3`=0.548262 WHERE `guid`=56657;
+UPDATE `gameobject` SET `rotation0`=-0.00747776, `rotation1`=0.00981712, `rotation2`=-0.636003, `rotation3`=0.771587 WHERE `guid`=56707;
+UPDATE `gameobject` SET `rotation0`=0.00858116, `rotation1`=0.000598907, `rotation2`=0.70708, `rotation3`=0.707081 WHERE `guid`=56709;
+UPDATE `gameobject` SET `rotation0`=-0.00108576, `rotation1`=-0.00853348, `rotation2`=-0.831438, `rotation3`=0.555551 WHERE `guid`=56710;
+UPDATE `gameobject` SET `rotation0`=0.0329785, `rotation1`=0.027854, `rotation2`=-0.492602, `rotation3`=0.869183 WHERE `guid`=57528;
+UPDATE `gameobject` SET `rotation0`=0.0271997, `rotation1`=0.0176859, `rotation2`=-0.837915, `rotation3`=0.544835 WHERE `guid`=57532;
+UPDATE `gameobject` SET `rotation0`=0.00369692, `rotation1`=0.0233622, `rotation2`=-0.494075, `rotation3`=0.869098 WHERE `guid`=57536;
+UPDATE `gameobject` SET `rotation0`=-0.0176406, `rotation1`=0.0272284, `rotation2`=0.543453, `rotation3`=0.838812 WHERE `guid`=57540;
+UPDATE `gameobject` SET `rotation0`=0.0267119, `rotation1`=0.0184145, `rotation2`=-0.822888, `rotation3`=0.567276 WHERE `guid`=57567;
+UPDATE `gameobject` SET `rotation0`=0.0122328, `rotation1`=-0.0124474, `rotation2`=-0.713141, `rotation3`=0.700803 WHERE `guid`=57574;
+UPDATE `gameobject` SET `rotation0`=-0.0184145, `rotation1`=0.0267115, `rotation2`=0.567276, `rotation3`=0.822888 WHERE `guid`=57576;
+UPDATE `gameobject` SET `rotation0`=-0.0411167, `rotation1`=0.0145597, `rotation2`=-0.333488, `rotation3`=0.941745 WHERE `guid`=57631;
+UPDATE `gameobject` SET `rotation0`=0.0780907, `rotation1`=0.0286131, `rotation2`=-0.38856, `rotation3`=0.917662 WHERE `guid`=57635;
+UPDATE `gameobject` SET `rotation0`=-0.00915575, `rotation1`=0.0746326, `rotation2`=0.898921, `rotation3`=0.43161 WHERE `guid`=57768;
+UPDATE `gameobject` SET `rotation0`=0.0133748, `rotation1`=0.0159645, `rotation2`=0.999181, `rotation3`=0.0346989 WHERE `guid`=57778;
+UPDATE `gameobject` SET `rotation0`=0.997061, `rotation1`=-0.0563049, `rotation2`=-0.00894737, `rotation3`=0.0511718 WHERE `guid`=57781;
+UPDATE `gameobject` SET `rotation0`=-0.00120354, `rotation1`=-0.0202312, `rotation2`=0.999186, `rotation3`=0.0348925 WHERE `guid`=57792;
+UPDATE `gameobject` SET `rotation0`=-0.010067, `rotation1`=-0.0192642, `rotation2`=-0.544604, `rotation3`=0.838411 WHERE `guid`=57794;
+UPDATE `gameobject` SET `rotation0`=0.0594649, `rotation1`=0.0722637, `rotation2`=-0.99546, `rotation3`=0.0173821 WHERE `guid`=57800;
+UPDATE `gameobject` SET `rotation0`=-0.0636859, `rotation1`=0.0447683, `rotation2`=0.99641, `rotation3`=0.0332605 WHERE `guid`=57845;
+UPDATE `gameobject` SET `rotation0`=-0.0478525, `rotation1`=-0.0228243, `rotation2`=-0.901316, `rotation3`=0.429906 WHERE `guid`=57849;
+UPDATE `gameobject` SET `rotation0`=-0.0688047, `rotation1`=-0.0223722, `rotation2`=0.993367, `rotation3`=0.0893701 WHERE `guid`=57868;
+UPDATE `gameobject` SET `rotation0`=0.00230885, `rotation1`=-0.134351, `rotation2`=0.609957, `rotation3`=0.780959 WHERE `guid`=57887;
+UPDATE `gameobject` SET `rotation0`=-0.101412, `rotation1`=-0.0473404, `rotation2`=0.990035, `rotation3`=0.0854701 WHERE `guid`=57888;
+UPDATE `gameobject` SET `rotation0`=-0.061111, `rotation1`=-0.0142727, `rotation2`=-0.950614, `rotation3`=0.303965 WHERE `guid`=57889;
+UPDATE `gameobject` SET `rotation0`=-0.00625563, `rotation1`=0.00534725, `rotation2`=-0.79151, `rotation3`=0.611101 WHERE `guid`=57977;
+UPDATE `gameobject` SET `rotation0`=-0.021769, `rotation1`=0.00458431, `rotation2`=-0.304047, `rotation3`=0.952397 WHERE `guid`=57978;
+UPDATE `gameobject` SET `rotation0`=0.0169549, `rotation1`=0.00413513, `rotation2`=0.999241, `rotation3`=0.0348292 WHERE `guid`=57998;
+UPDATE `gameobject` SET `rotation0`=-0.00625563, `rotation1`=0.00534725, `rotation2`=-0.79151, `rotation3`=0.611101 WHERE `guid`=58003;
+UPDATE `gameobject` SET `rotation0`=-0.00561047, `rotation1`=0.00602055, `rotation2`=-0.855554, `rotation3`=0.517649 WHERE `guid`=58015;
+UPDATE `gameobject` SET `rotation0`=-0.00700092, `rotation1`=0.00432682, `rotation2`=-0.688617, `rotation3`=0.725079 WHERE `guid`=58033;
+UPDATE `gameobject` SET `rotation0`=-0.00797653, `rotation1`=0.00202751, `rotation2`=-0.439443, `rotation3`=0.898233 WHERE `guid`=58054;
+UPDATE `gameobject` SET `rotation0`=-0.0053606, `rotation1`=-0.0215902, `rotation2`=0.940907, `rotation3`=0.337935 WHERE `guid`=58137;
+UPDATE `gameobject` SET `rotation0`=-0.0053606, `rotation1`=-0.0215902, `rotation2`=0.940907, `rotation3`=0.337935 WHERE `guid`=58152;
+UPDATE `gameobject` SET `rotation0`=-0.0053606, `rotation1`=-0.0215902, `rotation2`=0.940907, `rotation3`=0.337935 WHERE `guid`=58175;
+UPDATE `gameobject` SET `rotation0`=-0.0190578, `rotation1`=-0.0114765, `rotation2`=0.426367, `rotation3`=0.904277 WHERE `guid`=58191;
+UPDATE `gameobject` SET `rotation0`=-0.0190578, `rotation1`=-0.0114765, `rotation2`=0.426367, `rotation3`=0.904277 WHERE `guid`=58208;
+UPDATE `gameobject` SET `rotation0`=-0.0215907, `rotation1`=0.0053606, `rotation2`=-0.337934, `rotation3`=0.940907 WHERE `guid`=58220;
+UPDATE `gameobject` SET `rotation0`=-0.0213366, `rotation1`=0.00629711, `rotation2`=-0.378653, `rotation3`=0.925272 WHERE `guid`=58225;
+UPDATE `gameobject` SET `rotation0`=0.0115876, `rotation1`=0.0149164, `rotation2`=-0.972156, `rotation3`=0.233574 WHERE `guid`=58300;
+UPDATE `gameobject` SET `rotation0`=-0.013093, `rotation1`=0.0179844, `rotation2`=-0.863675, `rotation3`=0.503558 WHERE `guid`=58303;
+UPDATE `gameobject` SET `rotation0`=-0.0203118, `rotation1`=-0.0571537, `rotation2`=0.737972, `rotation3`=0.6721 WHERE `guid`=58307;
+UPDATE `gameobject` SET `rotation0`=-0.00221872, `rotation1`=-0.00375652, `rotation2`=0.788001, `rotation3`=0.615658 WHERE `guid`=58972;
+UPDATE `gameobject` SET `rotation0`=0.0625529, `rotation1`=-0.00466824, `rotation2`=0.99803, `rotation3`=0.00142357 WHERE `guid`=59047;
+UPDATE `gameobject` SET `rotation0`=0.0179548, `rotation1`=-0.00972557, `rotation2`=0.999791, `rotation3`=0 WHERE `guid`=59052;
+UPDATE `gameobject` SET `rotation0`=-0.00726509, `rotation1`=0.0038681, `rotation2`=-0.640481, `rotation3`=0.76793 WHERE `guid`=59053;
+UPDATE `gameobject` SET `rotation0`=-0.00820541, `rotation1`=-0.000640869, `rotation2`=-0.127568, `rotation3`=0.991796 WHERE `guid`=59089;
+UPDATE `gameobject` SET `rotation0`=0.0214567, `rotation1`=-0.00587368, `rotation2`=0.997311, `rotation3`=0.0698328 WHERE `guid`=59092;
+UPDATE `gameobject` SET `rotation0`=-0.0145078, `rotation1`=-0.00969982, `rotation2`=0.66255, `rotation3`=0.748814 WHERE `guid`=59750;
+UPDATE `gameobject` SET `rotation0`=0.0100765, `rotation1`=-0.0142488, `rotation2`=-0.765911, `rotation3`=0.64271 WHERE `guid`=59757;
+UPDATE `gameobject` SET `rotation0`=-0.00212193, `rotation1`=-0.0173225, `rotation2`=-0.134826, `rotation3`=0.990716 WHERE `guid`=59769;
+UPDATE `gameobject` SET `rotation0`=0.010324, `rotation1`=-0.0140705, `rotation2`=-0.777019, `rotation3`=0.629236 WHERE `guid`=59787;
+UPDATE `gameobject` SET `rotation0`=-0.00570679, `rotation1`=-0.019104, `rotation2`=0.484539, `rotation3`=0.874542 WHERE `guid`=59858;
+UPDATE `gameobject` SET `rotation0`=0.000127792, `rotation1`=-0.0199375, `rotation2`=0.719059, `rotation3`=0.694663 WHERE `guid`=59873;
+UPDATE `gameobject` SET `rotation0`=0.0949898, `rotation1`=-0.0109949, `rotation2`=-0.438946, `rotation3`=0.893411 WHERE `guid`=60059;
+UPDATE `gameobject` SET `rotation0`=0.0462666, `rotation1`=0.00813198, `rotation2`=-0.997513, `rotation3`=0.0525493 WHERE `guid`=60356;
+UPDATE `gameobject` SET `rotation0`=0.000655651, `rotation1`=-0.00431347, `rotation2`=-0.99862, `rotation3`=0.0523356 WHERE `guid`=60402;
+UPDATE `gameobject` SET `rotation0`=-0.00369263, `rotation1`=0.0337515, `rotation2`=-0.998056, `rotation3`=0.0522552 WHERE `guid`=60422;
+UPDATE `gameobject` SET `rotation0`=-0.0572481, `rotation1`=0.0493526, `rotation2`=0.957794, `rotation3`=0.27734 WHERE `guid`=60430;
+UPDATE `gameobject` SET `rotation0`=-0.00782394, `rotation1`=0.00386524, `rotation2`=0.894899, `rotation3`=0.446183 WHERE `guid`=60434;
+UPDATE `gameobject` SET `rotation0`=0.0450549, `rotation1`=-0.035512, `rotation2`=0.997688, `rotation3`=0.0364277 WHERE `guid`=60443;
+UPDATE `gameobject` SET `rotation0`=0.0507827, `rotation1`=-0.00883389, `rotation2`=0.998049, `rotation3`=0.0352375 WHERE `guid`=60453;
+UPDATE `gameobject` SET `rotation0`=0.0323796, `rotation1`=-0.00742626, `rotation2`=0.831214, `rotation3`=0.554959 WHERE `guid`=60466;
+UPDATE `gameobject` SET `rotation0`=-0.00159168, `rotation1`=-0.0173798, `rotation2`=-0.165, `rotation3`=0.986139 WHERE `guid`=60505;
+UPDATE `gameobject` SET `rotation0`=0.00299168, `rotation1`=0.00317574, `rotation2`=0.465605, `rotation3`=0.884982 WHERE `guid`=60512;
+UPDATE `gameobject` SET `rotation0`=0.00376463, `rotation1`=-0.00488853, `rotation2`=-0.999977, `rotation3`=0.0027729 WHERE `guid`=60670;
+UPDATE `gameobject` SET `rotation0`=-0.00823879, `rotation1`=0.00287342, `rotation2`=-0.358356, `rotation3`=0.933544 WHERE `guid`=60705;
+UPDATE `gameobject` SET `rotation0`=0.0208797, `rotation1`=0.0497112, `rotation2`=-0.915771, `rotation3`=0.398067 WHERE `guid`=60758;
+UPDATE `gameobject` SET `rotation0`=-0.0140252, `rotation1`=-0.0223131, `rotation2`=-0.931563, `rotation3`=0.362623 WHERE `guid`=60818;
+UPDATE `gameobject` SET `rotation0`=-0.0140252, `rotation1`=-0.0223131, `rotation2`=-0.931563, `rotation3`=0.362623 WHERE `guid`=60869;
+UPDATE `gameobject` SET `rotation0`=-0.0112252, `rotation1`=0.019206, `rotation2`=-0.90978, `rotation3`=0.414495 WHERE `guid`=61001;
+UPDATE `gameobject` SET `rotation0`=-0.0112252, `rotation1`=0.019206, `rotation2`=-0.90978, `rotation3`=0.414495 WHERE `guid`=61006;
+UPDATE `gameobject` SET `rotation0`=-0.0192065, `rotation1`=-0.0112247, `rotation2`=0.414494, `rotation3`=0.90978 WHERE `guid`=61028;
+UPDATE `gameobject` SET `rotation0`=-0.0192065, `rotation1`=-0.0112247, `rotation2`=0.414494, `rotation3`=0.90978 WHERE `guid`=61058;
+UPDATE `gameobject` SET `rotation0`=-0.0192556, `rotation1`=-0.0111418, `rotation2`=0.41052, `rotation3`=0.91158 WHERE `guid`=61067;
+UPDATE `gameobject` SET `rotation0`=-0.0192556, `rotation1`=-0.0111418, `rotation2`=0.41052, `rotation3`=0.91158 WHERE `guid`=61091;
+UPDATE `gameobject` SET `rotation0`=-0.0113096, `rotation1`=0.0191565, `rotation2`=-0.907963, `rotation3`=0.41846 WHERE `guid`=61117;
+UPDATE `gameobject` SET `rotation0`=-0.0113096, `rotation1`=0.0191565, `rotation2`=-0.907963, `rotation3`=0.41846 WHERE `guid`=61128;
+UPDATE `gameobject` SET `rotation0`=-0.00185108, `rotation1`=-0.0210752, `rotation2`=0.926908, `rotation3`=0.374693 WHERE `guid`=61143;
+UPDATE `gameobject` SET `rotation0`=-0.00629711, `rotation1`=-0.0213366, `rotation2`=0.925271, `rotation3`=0.378654 WHERE `guid`=61166;
+UPDATE `gameobject` SET `rotation0`=-0.0210757, `rotation1`=0.00185108, `rotation2`=-0.374691, `rotation3`=0.926908 WHERE `guid`=61207;
+UPDATE `gameobject` SET `rotation0`=-0.0213366, `rotation1`=0.00629711, `rotation2`=-0.378653, `rotation3`=0.925272 WHERE `guid`=61214;
+UPDATE `gameobject` SET `rotation0`=-0.0215907, `rotation1`=0.0053606, `rotation2`=-0.337933, `rotation3`=0.940907 WHERE `guid`=61236;
+UPDATE `gameobject` SET `rotation0`=-0.0215907, `rotation1`=0.0053606, `rotation2`=-0.337933, `rotation3`=0.940907 WHERE `guid`=61242;
+UPDATE `gameobject` SET `rotation0`=-0.0213432, `rotation1`=0.00627518, `rotation2`=-0.377692, `rotation3`=0.925664 WHERE `guid`=61244;
+UPDATE `gameobject` SET `rotation0`=-0.0553427, `rotation1`=-0.069665, `rotation2`=0.955796, `rotation3`=0.280245 WHERE `guid`=61493;
+UPDATE `gameobject` SET `rotation0`=-0.00479174, `rotation1`=-0.0271702, `rotation2`=-0.655555, `rotation3`=0.754643 WHERE `guid`=61539;
+UPDATE `gameobject` SET `rotation0`=0.0131559, `rotation1`=0.0326118, `rotation2`=-0.994302, `rotation3`=0.100635 WHERE `guid`=61588;
+UPDATE `gameobject` SET `rotation0`=-0.00400114, `rotation1`=-0.00394249, `rotation2`=0.558556, `rotation3`=0.829448 WHERE `guid`=61665;
+UPDATE `gameobject` SET `rotation0`=-0.00552464, `rotation1`=0.00101566, `rotation2`=-0.359068, `rotation3`=0.933295 WHERE `guid`=61775;
+UPDATE `gameobject` SET `rotation0`=0.0938687, `rotation1`=-0.0521898, `rotation2`=-0.949377, `rotation3`=0.295209 WHERE `guid`=62004;
+UPDATE `gameobject` SET `rotation0`=0.0347409, `rotation1`=-0.07829, `rotation2`=-0.81131, `rotation3`=0.578308 WHERE `guid`=62008;
+UPDATE `gameobject` SET `rotation0`=-0.0624795, `rotation1`=-0.0596743, `rotation2`=0.803572, `rotation3`=0.588904 WHERE `guid`=62010;
+UPDATE `gameobject` SET `rotation0`=-0.0421896, `rotation1`=-0.0416889, `rotation2`=0.747766, `rotation3`=0.661308 WHERE `guid`=62013;
+UPDATE `gameobject` SET `rotation0`=-0.0421896, `rotation1`=-0.0416889, `rotation2`=0.747766, `rotation3`=0.661308 WHERE `guid`=62015;
+UPDATE `gameobject` SET `rotation0`=-0.070652, `rotation1`=-0.0217209, `rotation2`=0.76553, `rotation3`=0.639141 WHERE `guid`=62017;
+UPDATE `gameobject` SET `rotation0`=-0.0267367, `rotation1`=-0.0508165, `rotation2`=-0.143241, `rotation3`=0.988021 WHERE `guid`=62019;
+UPDATE `gameobject` SET `rotation0`=-0.0184536, `rotation1`=-0.0218439, `rotation2`=0.515646, `rotation3`=0.856324 WHERE `guid`=62020;
+UPDATE `gameobject` SET `rotation0`=0.544168, `rotation1`=0.438963, `rotation2`=-0.515592, `rotation3`=0.495336 WHERE `guid`=62022;
+UPDATE `gameobject` SET `rotation0`=-0.0297956, `rotation1`=-0.103779, `rotation2`=-0.0643826, `rotation3`=0.992067 WHERE `guid`=62029;
+UPDATE `gameobject` SET `rotation0`=-0.173857, `rotation1`=-0.281583, `rotation2`=0.244537, `rotation3`=0.91142 WHERE `guid`=62034;
+UPDATE `gameobject` SET `rotation0`=0.0402169, `rotation1`=-0.225434, `rotation2`=-0.500674, `rotation3`=0.834798 WHERE `guid`=62037;
+UPDATE `gameobject` SET `rotation0`=-0.267074, `rotation1`=0.195414, `rotation2`=-0.927796, `rotation3`=0.172276 WHERE `guid`=62039;
+UPDATE `gameobject` SET `rotation0`=-0.084765, `rotation1`=0.142902, `rotation2`=0.731836, `rotation3`=0.660916 WHERE `guid`=62040;
+UPDATE `gameobject` SET `rotation0`=-0.0131726, `rotation1`=-0.0648012, `rotation2`=0.134588, `rotation3`=0.988693 WHERE `guid`=62045;
+UPDATE `gameobject` SET `rotation0`=-0.0770526, `rotation1`=-0.0317087, `rotation2`=0.687312, `rotation3`=0.721567 WHERE `guid`=62070;
+UPDATE `gameobject` SET `rotation0`=0.0221438, `rotation1`=0.00338078, `rotation2`=-0.734296, `rotation3`=0.67846 WHERE `guid`=62071;
+UPDATE `gameobject` SET `rotation0`=0.097621, `rotation1`=0.66564, `rotation2`=0.227495, `rotation3`=0.704017 WHERE `guid`=62072;
+UPDATE `gameobject` SET `rotation0`=-0.0590367, `rotation1`=-0.00439453, `rotation2`=0.907238, `rotation3`=0.416431 WHERE `guid`=62074;
+UPDATE `gameobject` SET `rotation0`=-0.0321445, `rotation1`=0.0484037, `rotation2`=0.955317, `rotation3`=0.289817 WHERE `guid`=62076;
+UPDATE `gameobject` SET `rotation0`=-0.0091877, `rotation1`=0.0102921, `rotation2`=-0.370451, `rotation3`=0.92875 WHERE `guid`=62203;
+UPDATE `gameobject` SET `rotation0`=-0.038785, `rotation1`=-0.0182981, `rotation2`=-0.371068, `rotation3`=0.927615 WHERE `guid`=62207;
+UPDATE `gameobject` SET `rotation0`=0.057168, `rotation1`=0.211483, `rotation2`=-0.244818, `rotation3`=0.944495 WHERE `guid`=62211;
+UPDATE `gameobject` SET `rotation0`=-0.149701, `rotation1`=-0.0807028, `rotation2`=-0.879606, `rotation3`=0.444263 WHERE `guid`=62212;
+UPDATE `gameobject` SET `rotation0`=0.0538278, `rotation1`=-0.0377436, `rotation2`=0.759027, `rotation3`=0.647732 WHERE `guid`=62213;
+UPDATE `gameobject` SET `rotation0`=-0.126301, `rotation1`=0.0268679, `rotation2`=-0.963754, `rotation3`=0.233463 WHERE `guid`=62214;
+UPDATE `gameobject` SET `rotation0`=-0.0738959, `rotation1`=0.0277271, `rotation2`=0.986376, `rotation3`=0.144338 WHERE `guid`=62218;
+UPDATE `gameobject` SET `rotation0`=0.0124745, `rotation1`=0.0353851, `rotation2`=-0.706221, `rotation3`=0.706997 WHERE `guid`=62221;
+UPDATE `gameobject` SET `rotation0`=-0.00383759, `rotation1`=-0.0591726, `rotation2`=0.299043, `rotation3`=0.952396 WHERE `guid`=62276;
+UPDATE `gameobject` SET `rotation0`=-0.0719967, `rotation1`=0.0297947, `rotation2`=0.786651, `rotation3`=0.612462 WHERE `guid`=62299;
+UPDATE `gameobject` SET `rotation0`=-0.0790567, `rotation1`=0.0276194, `rotation2`=0.945269, `rotation3`=0.315364 WHERE `guid`=62302;
+UPDATE `gameobject` SET `rotation0`=-0.0700746, `rotation1`=-0.0305157, `rotation2`=0.296399, `rotation3`=0.952001 WHERE `guid`=62344;
+UPDATE `gameobject` SET `rotation0`=-0.054544, `rotation1`=-0.0291481, `rotation2`=0.562613, `rotation3`=0.824404 WHERE `guid`=62346;
+UPDATE `gameobject` SET `rotation0`=-0.0337057, `rotation1`=-0.0518045, `rotation2`=0.0559473, `rotation3`=0.996519 WHERE `guid`=62348;
+UPDATE `gameobject` SET `rotation0`=0.295899, `rotation1`=0.0340376, `rotation2`=0.329922, `rotation3`=0.895788 WHERE `guid`=62350;
+UPDATE `gameobject` SET `rotation0`=-0.0818739, `rotation1`=0.267369, `rotation2`=0.863095, `rotation3`=0.420567 WHERE `guid`=62352;
+UPDATE `gameobject` SET `rotation0`=0.0104589, `rotation1`=0.0212154, `rotation2`=-0.729574, `rotation3`=0.683492 WHERE `guid`=62353;
+UPDATE `gameobject` SET `rotation0`=0.307564, `rotation1`=0.347115, `rotation2`=-0.125055, `rotation3`=0.877084 WHERE `guid`=62355;
+UPDATE `gameobject` SET `rotation0`=0.00250769, `rotation1`=-0.013567, `rotation2`=0.88282, `rotation3`=0.469508 WHERE `guid`=62356;
+UPDATE `gameobject` SET `rotation0`=-0.215984, `rotation1`=0.256128, `rotation2`=0.85913, `rotation3`=0.38684 WHERE `guid`=62358;
+UPDATE `gameobject` SET `rotation0`=0.341446, `rotation1`=-0.304326, `rotation2`=0.602724, `rotation3`=0.653853 WHERE `guid`=62362;
+UPDATE `gameobject` SET `rotation0`=0.120763, `rotation1`=-0.236484, `rotation2`=-0.909652, `rotation3`=0.319414 WHERE `guid`=62364;
+UPDATE `gameobject` SET `rotation0`=-0.244493, `rotation1`=-0.195951, `rotation2`=0.949099, `rotation3`=0.0322192 WHERE `guid`=62369;
+UPDATE `gameobject` SET `rotation0`=0.175162, `rotation1`=-0.601875, `rotation2`=0.694636, `rotation3`=0.352909 WHERE `guid`=62374;
+UPDATE `gameobject` SET `rotation0`=0.0800338, `rotation1`=-0.00780964, `rotation2`=-0.987558, `rotation3`=0.135137 WHERE `guid`=62375;
+UPDATE `gameobject` SET `rotation0`=0.0362339, `rotation1`=-0.0262403, `rotation2`=-0.94461, `rotation3`=0.325133 WHERE `guid`=62376;
+UPDATE `gameobject` SET `rotation0`=-0.00289059, `rotation1`=-0.0755463, `rotation2`=-0.55819, `rotation3`=0.826261 WHERE `guid`=62377;
+UPDATE `gameobject` SET `rotation0`=-0.0657239, `rotation1`=0.0171518, `rotation2`=0.896297, `rotation3`=0.43822 WHERE `guid`=62379;
+UPDATE `gameobject` SET `rotation0`=-0.062573, `rotation1`=0.0657063, `rotation2`=0.994164, `rotation3`=0.0583465 WHERE `guid`=62380;
+UPDATE `gameobject` SET `rotation0`=-0.103618, `rotation1`=0.0230484, `rotation2`=0.909678, `rotation3`=0.401521 WHERE `guid`=62382;
+UPDATE `gameobject` SET `rotation0`=-0.0568237, `rotation1`=0.0413055, `rotation2`=0.996267, `rotation3`=0.050163 WHERE `guid`=62383;
+UPDATE `gameobject` SET `rotation0`=-0.134973, `rotation1`=-0.13683, `rotation2`=-0.929156, `rotation3`=0.315798 WHERE `guid`=62384;
+UPDATE `gameobject` SET `rotation0`=0.0177789, `rotation1`=-0.0288286, `rotation2`=-0.784378, `rotation3`=0.619358 WHERE `guid`=62385;
+UPDATE `gameobject` SET `rotation0`=-0.078877, `rotation1`=-0.00378895, `rotation2`=0.914302, `rotation3`=0.397261 WHERE `guid`=62386;
+UPDATE `gameobject` SET `rotation0`=-0.0624537, `rotation1`=0.0621939, `rotation2`=0.996101, `rotation3`=0.00367024 WHERE `guid`=62420;
+UPDATE `gameobject` SET `rotation0`=0.496306, `rotation1`=0.0242853, `rotation2`=-0.867702, `rotation3`=0.0135888 WHERE `guid`=62421;
+UPDATE `gameobject` SET `rotation0`=-0.0650849, `rotation1`=0.0319777, `rotation2`=0.997365, `rotation3`=0.00211432 WHERE `guid`=62422;
+UPDATE `gameobject` SET `rotation0`=0.0176468, `rotation1`=-0.0565901, `rotation2`=-0.678891, `rotation3`=0.731842 WHERE `guid`=62423;
+UPDATE `gameobject` SET `rotation0`=-0.0446796, `rotation1`=-0.00412178, `rotation2`=0.528811, `rotation3`=0.847553 WHERE `guid`=62427;
+UPDATE `gameobject` SET `rotation0`=-0.0496626, `rotation1`=0.0201645, `rotation2`=0.826765, `rotation3`=0.559988 WHERE `guid`=62429;
+UPDATE `gameobject` SET `rotation0`=-0.0713949, `rotation1`=0.0128832, `rotation2`=0.997364, `rotation3`=0.00131474 WHERE `guid`=62431;
+UPDATE `gameobject` SET `rotation0`=0.0647397, `rotation1`=0.00320148, `rotation2`=-0.997896, `rotation3`=0.00131474 WHERE `guid`=62433;
+UPDATE `gameobject` SET `rotation0`=-0.622238, `rotation1`=0.170283, `rotation2`=0.610718, `rotation3`=0.459182 WHERE `guid`=62438;
+UPDATE `gameobject` SET `rotation0`=0.152232, `rotation1`=0.111365, `rotation2`=-0.901051, `rotation3`=0.390552 WHERE `guid`=62440;
+UPDATE `gameobject` SET `rotation0`=-0.0765719, `rotation1`=0.0206394, `rotation2`=0.989102, `rotation3`=0.124046 WHERE `guid`=62442;
+UPDATE `gameobject` SET `rotation0`=-0.0628777, `rotation1`=0.0141687, `rotation2`=0.971451, `rotation3`=0.228318 WHERE `guid`=62443;
+UPDATE `gameobject` SET `rotation0`=0.241684, `rotation1`=0.120824, `rotation2`=-0.52985, `rotation3`=0.803896 WHERE `guid`=62444;
+UPDATE `gameobject` SET `rotation0`=0.453855, `rotation1`=-0.520619, `rotation2`=0.477769, `rotation3`=0.54287 WHERE `guid`=62445;
+UPDATE `gameobject` SET `rotation0`=-0.0516787, `rotation1`=0.0323219, `rotation2`=0.992534, `rotation3`=0.105648 WHERE `guid`=62450;
+UPDATE `gameobject` SET `rotation0`=0.131849, `rotation1`=-0.683728, `rotation2`=-0.0452547, `rotation3`=0.716299 WHERE `guid`=62451;
+UPDATE `gameobject` SET `rotation0`=0.476533, `rotation1`=-0.52781, `rotation2`=0.490279, `rotation3`=0.503944 WHERE `guid`=62452;
+UPDATE `gameobject` SET `rotation0`=-0.0410066, `rotation1`=0.0257225, `rotation2`=0.922812, `rotation3`=0.382199 WHERE `guid`=62454;
+UPDATE `gameobject` SET `rotation0`=-0.0262136, `rotation1`=-0.0292301, `rotation2`=0.954082, `rotation3`=0.296963 WHERE `guid`=62456;
+UPDATE `gameobject` SET `rotation0`=0.05055, `rotation1`=-0.00258732, `rotation2`=-0.939903, `rotation3`=0.337668 WHERE `guid`=62457;
+UPDATE `gameobject` SET `rotation0`=-0.0494318, `rotation1`=-0.00887966, `rotation2`=0.62317, `rotation3`=0.780472 WHERE `guid`=62458;
+UPDATE `gameobject` SET `rotation0`=-0.000944614, `rotation1`=-0.040988, `rotation2`=-0.265645, `rotation3`=0.963199 WHERE `guid`=62462;
+UPDATE `gameobject` SET `rotation0`=-0.0274858, `rotation1`=0.731253, `rotation2`=0.680927, `rotation3`=0.0291899 WHERE `guid`=62463;
+UPDATE `gameobject` SET `rotation0`=-0.0713949, `rotation1`=0.0128832, `rotation2`=0.997364, `rotation3`=0.00131474 WHERE `guid`=62464;
+UPDATE `gameobject` SET `rotation0`=-0.0986266, `rotation1`=-0.0312767, `rotation2`=0.69349, `rotation3`=0.712998 WHERE `guid`=62466;
+UPDATE `gameobject` SET `rotation0`=-0.053257, `rotation1`=-0.0238132, `rotation2`=0.584893, `rotation3`=0.80901 WHERE `guid`=62467;
+UPDATE `gameobject` SET `rotation0`=0.00172186, `rotation1`=0.496897, `rotation2`=-0.0318861, `rotation3`=0.867222 WHERE `guid`=62468;
+UPDATE `gameobject` SET `rotation0`=-0.012682, `rotation1`=0.00324059, `rotation2`=-0.309, `rotation3`=0.950972 WHERE `guid`=62581;
+UPDATE `gameobject` SET `rotation0`=-0.0216508, `rotation1`=0.0327387, `rotation2`=0.931026, `rotation3`=0.362837 WHERE `guid`=62591;
+UPDATE `gameobject` SET `rotation0`=-0.00178766, `rotation1`=-0.00762177, `rotation2`=-0.00873852, `rotation3`=0.999931 WHERE `guid`=62593;
+UPDATE `gameobject` SET `rotation0`=-0.0352879, `rotation1`=0.0307655, `rotation2`=0.736506, `rotation3`=0.67481 WHERE `guid`=62595;
+UPDATE `gameobject` SET `rotation0`=-0.00647497, `rotation1`=0.0345688, `rotation2`=0.00893497, `rotation3`=0.999341 WHERE `guid`=62600;
+UPDATE `gameobject` SET `rotation0`=0.0312877, `rotation1`=-0.0662994, `rotation2`=-0.82378, `rotation3`=0.562149 WHERE `guid`=62706;
+UPDATE `gameobject` SET `rotation0`=0.0912547, `rotation1`=-0.0740461, `rotation2`=-0.973655, `rotation3`=0.195413 WHERE `guid`=62733;
+UPDATE `gameobject` SET `rotation0`=-0.00413465, `rotation1`=0.00457954, `rotation2`=-0.0479574, `rotation3`=0.99883 WHERE `guid`=62734;
+UPDATE `gameobject` SET `rotation0`=-0.101369, `rotation1`=0.0590372, `rotation2`=0.970378, `rotation3`=0.211201 WHERE `guid`=62746;
+UPDATE `gameobject` SET `rotation0`=0.00691795, `rotation1`=-0.0743694, `rotation2`=-0.354098, `rotation3`=0.932221 WHERE `guid`=62754;
+UPDATE `gameobject` SET `rotation0`=0.469189, `rotation1`=0.839209, `rotation2`=0.120181, `rotation3`=0.24728 WHERE `guid`=62755;
+UPDATE `gameobject` SET `rotation0`=0.0654626, `rotation1`=-0.00331974, `rotation2`=-0.997606, `rotation3`=0.0220309 WHERE `guid`=62756;
+UPDATE `gameobject` SET `rotation0`=0.0552759, `rotation1`=0.0188112, `rotation2`=-0.998293, `rotation3`=0.00140248 WHERE `guid`=62758;
+UPDATE `gameobject` SET `rotation0`=0.0383778, `rotation1`=-0.0295868, `rotation2`=-0.915912, `rotation3`=0.398444 WHERE `guid`=62759;
+UPDATE `gameobject` SET `rotation0`=-0.0766449, `rotation1`=0.025178, `rotation2`=0.947197, `rotation3`=0.310338 WHERE `guid`=62760;
+UPDATE `gameobject` SET `rotation0`=0.0328836, `rotation1`=0.334789, `rotation2`=0.832582, `rotation3`=0.440047 WHERE `guid`=62761;
+UPDATE `gameobject` SET `rotation0`=0.256151, `rotation1`=0.237044, `rotation2`=-0.923361, `rotation3`=0.160005 WHERE `guid`=62762;
+UPDATE `gameobject` SET `rotation0`=-0.135204, `rotation1`=0.156828, `rotation2`=0.891665, `rotation3`=0.402566 WHERE `guid`=62763;
+UPDATE `gameobject` SET `rotation0`=0.223603, `rotation1`=0.59363, `rotation2`=-0.256003, `rotation3`=0.72943 WHERE `guid`=62764;
+UPDATE `gameobject` SET `rotation0`=0.060257, `rotation1`=0.680447, `rotation2`=-0.728232, `rotation3`=0.0551277 WHERE `guid`=62794;
+UPDATE `gameobject` SET `rotation0`=0.60732, `rotation1`=0.432161, `rotation2`=-0.341002, `rotation3`=0.572815 WHERE `guid`=62795;
+UPDATE `gameobject` SET `rotation0`=0.513972, `rotation1`=0.452635, `rotation2`=0.00952148, `rotation3`=0.728604 WHERE `guid`=62796;
+UPDATE `gameobject` SET `rotation0`=0.611201, `rotation1`=-0.187566, `rotation2`=-0.147256, `rotation3`=0.754698 WHERE `guid`=62798;
+UPDATE `gameobject` SET `rotation0`=0.0864978, `rotation1`=-0.766595, `rotation2`=-0.627791, `rotation3`=0.103578 WHERE `guid`=62800;
+UPDATE `gameobject` SET `rotation0`=0.453995, `rotation1`=-0.54534, `rotation2`=-0.489407, `rotation3`=0.506927 WHERE `guid`=62802;
+UPDATE `gameobject` SET `rotation0`=-0.11008, `rotation1`=-0.0325861, `rotation2`=0.971985, `rotation3`=0.2051 WHERE `guid`=62806;
+UPDATE `gameobject` SET `rotation0`=-0.0574207, `rotation1`=-0.0667448, `rotation2`=0.803014, `rotation3`=0.589421 WHERE `guid`=62982;
+UPDATE `gameobject` SET `rotation0`=-0.0617466, `rotation1`=-0.0747061, `rotation2`=0.240547, `rotation3`=0.965786 WHERE `guid`=63020;
+UPDATE `gameobject` SET `rotation0`=-0.0421896, `rotation1`=-0.0416889, `rotation2`=0.747766, `rotation3`=0.661308 WHERE `guid`=63043;
+UPDATE `gameobject` SET `rotation0`=-0.0131726, `rotation1`=-0.0648012, `rotation2`=0.134588, `rotation3`=0.988693 WHERE `guid`=63045;
+UPDATE `gameobject` SET `rotation0`=-0.0740328, `rotation1`=0.00929928, `rotation2`=0.997211, `rotation3`=0.00142357 WHERE `guid`=63048;
+UPDATE `gameobject` SET `rotation0`=-0.481176, `rotation1`=-0.0713978, `rotation2`=0.267664, `rotation3`=0.831702 WHERE `guid`=63049;
+UPDATE `gameobject` SET `rotation0`=0.511276, `rotation1`=-0.266282, `rotation2`=0.778645, `rotation3`=0.247797 WHERE `guid`=63050;
+UPDATE `gameobject` SET `rotation0`=0.0494189, `rotation1`=-0.263665, `rotation2`=0.470602, `rotation3`=0.840578 WHERE `guid`=63053;
+UPDATE `gameobject` SET `rotation0`=0.0871148, `rotation1`=-0.0726948, `rotation2`=-0.45024, `rotation3`=0.885669 WHERE `guid`=63060;
+UPDATE `gameobject` SET `rotation0`=-0.0000157356, `rotation1`=0.0079174, `rotation2`=0.992514, `rotation3`=0.121877 WHERE `guid`=65653;
+UPDATE `gameobject` SET `rotation0`=-0.0263157, `rotation1`=0.0369759, `rotation2`=0.998969, `rotation3`=0.00100662 WHERE `guid`=65654;
+UPDATE `gameobject` SET `rotation0`=-0.00622797, `rotation1`=0.00750923, `rotation2`=-0.414639, `rotation3`=0.909934 WHERE `guid`=65655;
+UPDATE `gameobject` SET `rotation0`=-0.305481, `rotation1`=0.637715, `rotation2`=0.305481, `rotation3`=0.637716 WHERE `guid`=65857;
+UPDATE `gameobject` SET `rotation0`=0.0129037, `rotation1`=-0.0371256, `rotation2`=0.312944, `rotation3`=0.948958 WHERE `guid`=65911;
+UPDATE `gameobject` SET `rotation0`=-0.0407338, `rotation1`=-0.0906858, `rotation2`=0.957691, `rotation3`=0.270082 WHERE `guid`=65974;
+UPDATE `gameobject` SET `rotation0`=0.0829248, `rotation1`=-0.210616, `rotation2`=0.47683, `rotation3`=0.849351 WHERE `guid`=65975;
+UPDATE `gameobject` SET `rotation0`=0.0284739, `rotation1`=0.0860357, `rotation2`=-0.995881, `rotation3`=0.00281557 WHERE `guid`=65976;
+UPDATE `gameobject` SET `rotation0`=0.0476589, `rotation1`=0.110981, `rotation2`=-0.992664, `rotation3`=0.0054153 WHERE `guid`=65977;
+UPDATE `gameobject` SET `rotation0`=-0.0104766, `rotation1`=-0.0470209, `rotation2`=0.927595, `rotation3`=0.370468 WHERE `guid`=65978;
+UPDATE `gameobject` SET `rotation0`=-0.0519929, `rotation1`=-0.00577831, `rotation2`=0.842955, `rotation3`=0.535435 WHERE `guid`=65982;
+UPDATE `gameobject` SET `rotation0`=-0.00524759, `rotation1`=-0.0166445, `rotation2`=0.927033, `rotation3`=0.374572 WHERE `guid`=65985;
+UPDATE `gameobject` SET `rotation0`=-0.0151815, `rotation1`=-0.0217628, `rotation2`=0.998057, `rotation3`=0.0563685 WHERE `guid`=65988;
+UPDATE `gameobject` SET `rotation0`=0.146786, `rotation1`=-0.305458, `rotation2`=0.379759, `rotation3`=0.860774 WHERE `guid`=65992;
+UPDATE `gameobject` SET `rotation0`=-0.0181217, `rotation1`=-0.116454, `rotation2`=0.978609, `rotation3`=0.168625 WHERE `guid`=65993;
+UPDATE `gameobject` SET `rotation0`=-0.213069, `rotation1`=0.177652, `rotation2`=0.864994, `rotation3`=0.418123 WHERE `guid`=65994;
+UPDATE `gameobject` SET `rotation0`=0.422521, `rotation1`=-0.0203085, `rotation2`=-0.134406, `rotation3`=0.896102 WHERE `guid`=65995;
+UPDATE `gameobject` SET `rotation0`=-0.0131168, `rotation1`=-0.0416002, `rotation2`=0.944602, `rotation3`=0.325307 WHERE `guid`=65996;
+UPDATE `gameobject` SET `rotation0`=0.000907898, `rotation1`=0.0157042, `rotation2`=-0.999266, `rotation3`=0.0349386 WHERE `guid`=65997;
+UPDATE `gameobject` SET `rotation0`=-0.0140967, `rotation1`=-0.0684423, `rotation2`=0.921273, `rotation3`=0.382587 WHERE `guid`=65998;
+UPDATE `gameobject` SET `rotation0`=0.016243, `rotation1`=-0.0696001, `rotation2`=0.981966, `rotation3`=0.175028 WHERE `guid`=66000;
+UPDATE `gameobject` SET `rotation0`=0.0421166, `rotation1`=0.0615225, `rotation2`=-0.997213, `rotation3`=0.00258374 WHERE `guid`=66001;
+UPDATE `gameobject` SET `rotation0`=0.100891, `rotation1`=0.0733604, `rotation2`=-0.95587, `rotation3`=0.265993 WHERE `guid`=66003;
+UPDATE `gameobject` SET `rotation0`=-0.0622897, `rotation1`=-0.0891228, `rotation2`=0.982732, `rotation3`=0.149717 WHERE `guid`=66004;
+UPDATE `gameobject` SET `rotation0`=-0.0458646, `rotation1`=-0.122612, `rotation2`=0.986681, `rotation3`=0.0965575 WHERE `guid`=66007;
+UPDATE `gameobject` SET `rotation0`=0.063015, `rotation1`=-0.264695, `rotation2`=0.473343, `rotation3`=0.837802 WHERE `guid`=66013;
+UPDATE `gameobject` SET `rotation0`=-0.160909, `rotation1`=0.156031, `rotation2`=0.449443, `rotation3`=0.864733 WHERE `guid`=66014;
+UPDATE `gameobject` SET `rotation0`=-0.0372086, `rotation1`=-0.0788364, `rotation2`=0.991509, `rotation3`=0.0964853 WHERE `guid`=66017;
+UPDATE `gameobject` SET `rotation0`=-0.061204, `rotation1`=-0.0995245, `rotation2`=-0.992772, `rotation3`=0.0274319 WHERE `guid`=66019;
+UPDATE `gameobject` SET `rotation0`=-0.0430837, `rotation1`=-0.0871992, `rotation2`=0.892773, `rotation3`=0.439883 WHERE `guid`=66022;
+UPDATE `gameobject` SET `rotation0`=-0.0744286, `rotation1`=-0.0784407, `rotation2`=0.956942, `rotation3`=0.269389 WHERE `guid`=66026;
+UPDATE `gameobject` SET `rotation0`=-0.532122, `rotation1`=0.436562, `rotation2`=0.67231, `rotation3`=0.272507 WHERE `guid`=66028;
+UPDATE `gameobject` SET `rotation0`=0.330425, `rotation1`=-0.255406, `rotation2`=-0.350611, `rotation3`=0.838248 WHERE `guid`=66030;
+UPDATE `gameobject` SET `rotation0`=0.0748539, `rotation1`=0.0447206, `rotation2`=-0.892179, `rotation3`=0.443185 WHERE `guid`=66032;
+UPDATE `gameobject` SET `rotation0`=0.134146, `rotation1`=-0.29005, `rotation2`=0.477654, `rotation3`=0.818366 WHERE `guid`=66034;
+UPDATE `gameobject` SET `rotation0`=0.0793948, `rotation1`=-0.0132055, `rotation2`=-0.277456, `rotation3`=0.957361 WHERE `guid`=66036;
+UPDATE `gameobject` SET `rotation0`=-0.0776229, `rotation1`=-0.225336, `rotation2`=0.951262, `rotation3`=0.195699 WHERE `guid`=66041;
+UPDATE `gameobject` SET `rotation0`=-0.227892, `rotation1`=-0.129869, `rotation2`=0.894956, `rotation3`=0.360907 WHERE `guid`=66042;
+UPDATE `gameobject` SET `rotation0`=-0.135084, `rotation1`=-0.206245, `rotation2`=0.939968, `rotation3`=0.235956 WHERE `guid`=66043;
+UPDATE `gameobject` SET `rotation0`=-0.0180907, `rotation1`=-0.137054, `rotation2`=0.974839, `rotation3`=0.174864 WHERE `guid`=66044;
+UPDATE `gameobject` SET `rotation0`=-0.0368748, `rotation1`=-0.0735445, `rotation2`=0.932367, `rotation3`=0.352026 WHERE `guid`=66045;
+UPDATE `gameobject` SET `rotation0`=-0.0445237, `rotation1`=-0.104994, `rotation2`=0.993466, `rotation3`=0.00429854 WHERE `guid`=66046;
+UPDATE `gameobject` SET `rotation0`=-0.0406528, `rotation1`=-0.150936, `rotation2`=0.906446, `rotation3`=0.392327 WHERE `guid`=66049;
+UPDATE `gameobject` SET `rotation0`=-0.016573, `rotation1`=-0.0207224, `rotation2`=0.992234, `rotation3`=0.12152 WHERE `guid`=66051;
+UPDATE `gameobject` SET `rotation0`=0.0159388, `rotation1`=-0.0696707, `rotation2`=0.981193, `rotation3`=0.179313 WHERE `guid`=66055;
+UPDATE `gameobject` SET `rotation0`=0.0182266, `rotation1`=-0.116857, `rotation2`=0.992917, `rotation3`=0.0113151 WHERE `guid`=66057;
+UPDATE `gameobject` SET `rotation0`=-0.0114007, `rotation1`=-0.115683, `rotation2`=0.981917, `rotation3`=0.149418 WHERE `guid`=66059;
+UPDATE `gameobject` SET `rotation0`=-0.001297, `rotation1`=0.00416565, `rotation2`=0.329686, `rotation3`=0.94408 WHERE `guid`=66065;
+UPDATE `gameobject` SET `rotation0`=-0.00108576, `rotation1`=-0.0292311, `rotation2`=0.766356, `rotation3`=0.64175 WHERE `guid`=66230;
+UPDATE `gameobject` SET `rotation0`=-0.163696, `rotation1`=-0.0698996, `rotation2`=0.384427, `rotation3`=0.905833 WHERE `guid`=66259;
+UPDATE `gameobject` SET `rotation0`=0.00430059, `rotation1`=0.00416565, `rotation2`=0.390713, `rotation3`=0.920493 WHERE `guid`=66260;
+UPDATE `gameobject` SET `rotation0`=-0.00366974, `rotation1`=-0.00235939, `rotation2`=0.998839, `rotation3`=0.0479673 WHERE `guid`=66261;
+UPDATE `gameobject` SET `rotation0`=-0.0187707, `rotation1`=-0.0138149, `rotation2`=0.544464, `rotation3`=0.83846 WHERE `guid`=66292;
+UPDATE `gameobject` SET `rotation0`=0.0881805, `rotation1`=0.10418, `rotation2`=-0.501834, `rotation3`=0.854127 WHERE `guid`=66294;
+UPDATE `gameobject` SET `rotation0`=0.0342517, `rotation1`=0.161542, `rotation2`=-0.986255, `rotation3`=0.00571519 WHERE `guid`=66295;
+UPDATE `gameobject` SET `rotation0`=0.0212288, `rotation1`=0.0050211, `rotation2`=-0.999762, `rotation3`=0 WHERE `guid`=66296;
+UPDATE `gameobject` SET `rotation0`=0.0207849, `rotation1`=0.00662231, `rotation2`=-0.999762, `rotation3`=0 WHERE `guid`=66297;
+UPDATE `gameobject` SET `rotation0`=0.0415297, `rotation1`=0.0674372, `rotation2`=-0.27634, `rotation3`=0.957791 WHERE `guid`=66298;
+UPDATE `gameobject` SET `rotation0`=0.0253768, `rotation1`=0.0393915, `rotation2`=-0.558539, `rotation3`=0.828153 WHERE `guid`=66299;
+UPDATE `gameobject` SET `rotation0`=0.00339794, `rotation1`=0.0219831, `rotation2`=-0.876394, `rotation3`=0.48108 WHERE `guid`=66300;
+UPDATE `gameobject` SET `rotation0`=-0.000585556, `rotation1`=-0.00614262, `rotation2`=-0.731327, `rotation3`=0.681999 WHERE `guid`=66301;
+UPDATE `gameobject` SET `rotation0`=0.0589747, `rotation1`=0.0545664, `rotation2`=0.516011, `rotation3`=0.852805 WHERE `guid`=66302;
+UPDATE `gameobject` SET `rotation0`=-0.0773177, `rotation1`=-0.035183, `rotation2`=0.572569, `rotation3`=0.815444 WHERE `guid`=66306;
+UPDATE `gameobject` SET `rotation0`=0.0761347, `rotation1`=-0.0631371, `rotation2`=-0.989244, `rotation3`=0.107771 WHERE `guid`=66307;
+UPDATE `gameobject` SET `rotation0`=0.00338888, `rotation1`=-0.0142326, `rotation2`=-0.913431, `rotation3`=0.40673 WHERE `guid`=66345;
+UPDATE `gameobject` SET `rotation0`=-0.00172472, `rotation1`=-0.0225382, `rotation2`=-0.913224, `rotation3`=0.40683 WHERE `guid`=66347;
+UPDATE `gameobject` SET `rotation0`=-0.00615454, `rotation1`=-0.00928211, `rotation2`=-0.722301, `rotation3`=0.69149 WHERE `guid`=66349;
+UPDATE `gameobject` SET `rotation0`=-0.00608587, `rotation1`=-0.0101986, `rotation2`=-0.913453, `rotation3`=0.406771 WHERE `guid`=66354;
+UPDATE `gameobject` SET `rotation0`=0.0448937, `rotation1`=-0.154575, `rotation2`=0.502752, `rotation3`=0.849312 WHERE `guid`=66355;
+UPDATE `gameobject` SET `rotation0`=0.014133, `rotation1`=-0.00137234, `rotation2`=-0.931943, `rotation3`=0.362327 WHERE `guid`=66357;
+UPDATE `gameobject` SET `rotation0`=-0.0129566, `rotation1`=0.00283623, `rotation2`=0.350251, `rotation3`=0.936562 WHERE `guid`=66366;
+UPDATE `gameobject` SET `rotation0`=0.00392294, `rotation1`=0.00371265, `rotation2`=0.922192, `rotation3`=0.386696 WHERE `guid`=66375;
+UPDATE `gameobject` SET `rotation0`=0.0300908, `rotation1`=-0.0217514, `rotation2`=0.99931, `rotation3`=0.00135932 WHERE `guid`=66406;
+UPDATE `gameobject` SET `rotation0`=0.0405688, `rotation1`=0.0204649, `rotation2`=0.966308, `rotation3`=0.253347 WHERE `guid`=66407;
+UPDATE `gameobject` SET `rotation0`=0.0554385, `rotation1`=0.0817881, `rotation2`=-0.129504, `rotation3`=0.986644 WHERE `guid`=66408;
+UPDATE `gameobject` SET `rotation0`=-0.00613165, `rotation1`=0.0583906, `rotation2`=-0.707772, `rotation3`=0.703997 WHERE `guid`=66409;
+UPDATE `gameobject` SET `rotation0`=-0.464443, `rotation1`=0.499267, `rotation2`=-0.661067, `rotation3`=0.313075 WHERE `guid`=66412;
+UPDATE `gameobject` SET `rotation0`=-0.0148516, `rotation1`=0.0269852, `rotation2`=-0.926785, `rotation3`=0.374326 WHERE `guid`=66413;
+UPDATE `gameobject` SET `rotation0`=-0.00749159, `rotation1`=0.0298777, `rotation2`=-0.991548, `rotation3`=0.126034 WHERE `guid`=66414;
+UPDATE `gameobject` SET `rotation0`=0.031075, `rotation1`=-0.0419874, `rotation2`=0.998633, `rotation3`=0.00167374 WHERE `guid`=66415;
+UPDATE `gameobject` SET `rotation0`=-0.0140429, `rotation1`=-0.00888062, `rotation2`=0.998916, `rotation3`=0.0434899 WHERE `guid`=66620;
+UPDATE `gameobject` SET `rotation0`=0.00558281, `rotation1`=0.0118389, `rotation2`=0.845644, `rotation3`=0.533587 WHERE `guid`=66621;
+UPDATE `gameobject` SET `rotation0`=-0.00416994, `rotation1`=-0.000220299, `rotation2`=0.998126, `rotation3`=0.0610488 WHERE `guid`=66622;
+UPDATE `gameobject` SET `rotation0`=-0.00070858, `rotation1`=-0.00169086, `rotation2`=-0.740215, `rotation3`=0.672367 WHERE `guid`=66633;
+UPDATE `gameobject` SET `rotation0`=-0.00752497, `rotation1`=-0.0114594, `rotation2`=-0.710091, `rotation3`=0.703977 WHERE `guid`=66634;
+UPDATE `gameobject` SET `rotation0`=0.0395589, `rotation1`=-0.0160465, `rotation2`=-0.537083, `rotation3`=0.842449 WHERE `guid`=66807;
+UPDATE `gameobject` SET `rotation0`=-0.00543785, `rotation1`=0.00140572, `rotation2`=-0.424541, `rotation3`=0.905391 WHERE `guid`=67445;
+UPDATE `gameobject` SET `rotation0`=0.0245037, `rotation1`=0.0558653, `rotation2`=-0.984365, `rotation3`=0.165237 WHERE `guid`=67824;
+UPDATE `gameobject` SET `rotation0`=0.457502, `rotation1`=0.879879, `rotation2`=-0.128418, `rotation3`=0.00371864 WHERE `guid`=67825;
+UPDATE `gameobject` SET `rotation0`=0.00501299, `rotation1`=-0.00453663, `rotation2`=-0.177918, `rotation3`=0.984022 WHERE `guid`=67827;
+UPDATE `gameobject` SET `rotation0`=-0.00782394, `rotation1`=0.00386524, `rotation2`=0.894899, `rotation3`=0.446183 WHERE `guid`=67968;
+UPDATE `gameobject` SET `rotation0`=0.0222769, `rotation1`=-0.035924, `rotation2`=-0.82086, `rotation3`=0.569563 WHERE `guid`=71411;
+UPDATE `gameobject` SET `rotation0`=0.0167089, `rotation1`=0.0073185, `rotation2`=0.337838, `rotation3`=0.941027 WHERE `guid`=71412;
+UPDATE `gameobject` SET `rotation0`=0.895853, `rotation1`=0.375089, `rotation2`=-0.234593, `rotation3`=0.0414939 WHERE `guid`=71429;
+UPDATE `gameobject` SET `rotation0`=0.0133057, `rotation1`=0.00767422, `rotation2`=-0.894822, `rotation3`=0.446159 WHERE `guid`=71431;
+UPDATE `gameobject` SET `rotation0`=0.107768, `rotation1`=-0.24586, `rotation2`=0.963281, `rotation3`=0.00540979 WHERE `guid`=71432;
+UPDATE `gameobject` SET `rotation0`=-0.0531387, `rotation1`=0.608887, `rotation2`=-0.606519, `rotation3`=0.508496 WHERE `guid`=71433;
+UPDATE `gameobject` SET `rotation0`=0.217795, `rotation1`=0.271523, `rotation2`=0.450282, `rotation3`=0.822245 WHERE `guid`=76924;
+UPDATE `gameobject` SET `rotation0`=-0.0121818, `rotation1`=-0.00647736, `rotation2`=-0.0524149, `rotation3`=0.99853 WHERE `guid`=76935;
+UPDATE `gameobject` SET `rotation0`=-0.0568476, `rotation1`=0.0184574, `rotation2`=0.759868, `rotation3`=0.647324 WHERE `guid`=76963;
+UPDATE `gameobject` SET `rotation0`=0.0264506, `rotation1`=-0.0387974, `rotation2`=0.794722, `rotation3`=0.605155 WHERE `guid`=76980;
+UPDATE `gameobject` SET `rotation0`=0.00446081, `rotation1`=0.00867653, `rotation2`=0.958778, `rotation3`=0.283987 WHERE `guid`=76990;
+UPDATE `gameobject` SET `rotation0`=-0.00244474, `rotation1`=-0.0307484, `rotation2`=0.0704784, `rotation3`=0.997036 WHERE `guid`=76994;
+UPDATE `gameobject` SET `rotation0`=0.301799, `rotation1`=0.559454, `rotation2`=0.663756, `rotation3`=0.394152 WHERE `guid`=77005;
+UPDATE `gameobject` SET `rotation0`=0.0638885, `rotation1`=-0.00834465, `rotation2`=0.871384, `rotation3`=0.486353 WHERE `guid`=77006;
+UPDATE `gameobject` SET `rotation0`=0.529439, `rotation1`=-0.0826683, `rotation2`=-0.282406, `rotation3`=0.79568 WHERE `guid`=77007;
+UPDATE `gameobject` SET `rotation0`=0.0796647, `rotation1`=0.0144062, `rotation2`=-0.000888824, `rotation3`=0.996717 WHERE `guid`=77008;
+UPDATE `gameobject` SET `rotation0`=0.0790286, `rotation1`=-0.017458, `rotation2`=-0.418527, `rotation3`=0.904591 WHERE `guid`=77009;
+UPDATE `gameobject` SET `rotation0`=0.0258098, `rotation1`=0.0587788, `rotation2`=0.790161, `rotation3`=0.609528 WHERE `guid`=77010;
+UPDATE `gameobject` SET `rotation0`=-0.000017643, `rotation1`=0.000310898, `rotation2`=0.465845, `rotation3`=0.884866 WHERE `guid`=77011;
+UPDATE `gameobject` SET `rotation0`=-0.00913286, `rotation1`=-0.0617018, `rotation2`=0.944452, `rotation3`=0.322675 WHERE `guid`=77012;
+UPDATE `gameobject` SET `rotation0`=-0.0715327, `rotation1`=-0.0109978, `rotation2`=0.860805, `rotation3`=0.503763 WHERE `guid`=77013;
+UPDATE `gameobject` SET `rotation0`=0.0488257, `rotation1`=0.0519066, `rotation2`=0.704068, `rotation3`=0.706548 WHERE `guid`=77014;
+UPDATE `gameobject` SET `rotation0`=0.0600896, `rotation1`=-0.0089817, `rotation2`=-0.643221, `rotation3`=0.763266 WHERE `guid`=77015;
+UPDATE `gameobject` SET `rotation0`=0.117878, `rotation1`=0.0288877, `rotation2`=-0.852855, `rotation3`=0.507847 WHERE `guid`=77016;
+UPDATE `gameobject` SET `rotation0`=0.175502, `rotation1`=-0.0696192, `rotation2`=-0.835915, `rotation3`=0.515363 WHERE `guid`=77017;
+UPDATE `gameobject` SET `rotation0`=-0.10428, `rotation1`=0.0728397, `rotation2`=0.523499, `rotation3`=0.842478 WHERE `guid`=77018;
+UPDATE `gameobject` SET `rotation0`=-0.146883, `rotation1`=0.106271, `rotation2`=-0.919187, `rotation3`=0.349611 WHERE `guid`=77019;
+UPDATE `gameobject` SET `rotation0`=-0.0967536, `rotation1`=0.0623951, `rotation2`=-0.112823, `rotation3`=0.986923 WHERE `guid`=77020;
+UPDATE `gameobject` SET `rotation0`=0.121423, `rotation1`=0.0109167, `rotation2`=-0.951202, `rotation3`=0.283463 WHERE `guid`=77021;
+UPDATE `gameobject` SET `rotation0`=0.0474486, `rotation1`=-0.0568333, `rotation2`=-0.225662, `rotation3`=0.971388 WHERE `guid`=77022;
+UPDATE `gameobject` SET `rotation0`=-0.0137296, `rotation1`=0.00334263, `rotation2`=-0.985821, `rotation3`=0.167206 WHERE `guid`=77023;
+UPDATE `gameobject` SET `rotation0`=-0.0574636, `rotation1`=-0.0339718, `rotation2`=-0.0337629, `rotation3`=0.997198 WHERE `guid`=77024;
+UPDATE `gameobject` SET `rotation0`=0.119032, `rotation1`=-0.042861, `rotation2`=-0.775682, `rotation3`=0.618313 WHERE `guid`=77025;
+UPDATE `gameobject` SET `rotation0`=0.013063, `rotation1`=0.123156, `rotation2`=0.888981, `rotation3`=0.44088 WHERE `guid`=77026;
+UPDATE `gameobject` SET `rotation0`=-0.0474277, `rotation1`=0.038497, `rotation2`=0.904352, `rotation3`=0.422393 WHERE `guid`=77027;
+UPDATE `gameobject` SET `rotation0`=-0.0808988, `rotation1`=0.00173664, `rotation2`=0.666332, `rotation3`=0.741251 WHERE `guid`=77028;
+UPDATE `gameobject` SET `rotation0`=0.00607967, `rotation1`=-0.0487633, `rotation2`=0.0698023, `rotation3`=0.99635 WHERE `guid`=77029;
+UPDATE `gameobject` SET `rotation0`=0.0470619, `rotation1`=0.0384197, `rotation2`=-0.997312, `rotation3`=0.040972 WHERE `guid`=77030;
+UPDATE `gameobject` SET `rotation0`=0.176649, `rotation1`=-0.0290623, `rotation2`=-0.343566, `rotation3`=0.921907 WHERE `guid`=77031;
+UPDATE `gameobject` SET `rotation0`=0.0263929, `rotation1`=0.121001, `rotation2`=0.8357, `rotation3`=0.53504 WHERE `guid`=77032;
+UPDATE `gameobject` SET `rotation0`=-0.0216947, `rotation1`=-0.022048, `rotation2`=0.748631, `rotation3`=0.662265 WHERE `guid`=77033;
+UPDATE `gameobject` SET `rotation0`=0.0561199, `rotation1`=-0.110401, `rotation2`=-0.985682, `rotation3`=0.114429 WHERE `guid`=77034;
+UPDATE `gameobject` SET `rotation0`=-0.0579057, `rotation1`=0.0194483, `rotation2`=0.995007, `rotation3`=0.0789345 WHERE `guid`=77035;
+UPDATE `gameobject` SET `rotation0`=0.107849, `rotation1`=0.0608816, `rotation2`=0.157308, `rotation3`=0.979753 WHERE `guid`=77036;
+UPDATE `gameobject` SET `rotation0`=-0.0570979, `rotation1`=0.0217075, `rotation2`=0.99114, `rotation3`=0.117938 WHERE `guid`=77037;
+UPDATE `gameobject` SET `rotation0`=0.0903859, `rotation1`=-0.0419741, `rotation2`=-0.412563, `rotation3`=0.905461 WHERE `guid`=77038;
+UPDATE `gameobject` SET `rotation0`=0.104919, `rotation1`=0.0612249, `rotation2`=-0.685961, `rotation3`=0.717427 WHERE `guid`=77039;
+UPDATE `gameobject` SET `rotation0`=0.105379, `rotation1`=0.0258522, `rotation2`=-0.58182, `rotation3`=0.806047 WHERE `guid`=77040;
+UPDATE `gameobject` SET `rotation0`=-0.0350347, `rotation1`=-0.007514, `rotation2`=0.840987, `rotation3`=0.539867 WHERE `guid`=77041;
+UPDATE `gameobject` SET `rotation0`=0.0236607, `rotation1`=0.0528755, `rotation2`=-0.892694, `rotation3`=0.446924 WHERE `guid`=77042;
+UPDATE `gameobject` SET `rotation0`=-0.0387049, `rotation1`=-0.120429, `rotation2`=-0.273579, `rotation3`=0.953495 WHERE `guid`=77045;
+UPDATE `gameobject` SET `rotation0`=-0.0990119, `rotation1`=-0.0587473, `rotation2`=0.83289, `rotation3`=0.541332 WHERE `guid`=77047;
+UPDATE `gameobject` SET `rotation0`=0.0436177, `rotation1`=0.0427647, `rotation2`=-0.522051, `rotation3`=0.850724 WHERE `guid`=77048;
+UPDATE `gameobject` SET `rotation0`=0.0664639, `rotation1`=-0.0326204, `rotation2`=0.188945, `rotation3`=0.979193 WHERE `guid`=77049;
+UPDATE `gameobject` SET `rotation0`=-0.0246377, `rotation1`=-0.0620403, `rotation2`=0.583806, `rotation3`=0.809144 WHERE `guid`=77050;
+UPDATE `gameobject` SET `rotation0`=0.0298905, `rotation1`=-0.0326824, `rotation2`=0.791899, `rotation3`=0.609044 WHERE `guid`=77051;
+UPDATE `gameobject` SET `rotation0`=0.0402436, `rotation1`=-0.0483112, `rotation2`=0.956863, `rotation3`=0.283653 WHERE `guid`=77052;
+UPDATE `gameobject` SET `rotation0`=0.063242, `rotation1`=0.0197554, `rotation2`=-0.162605, `rotation3`=0.984464 WHERE `guid`=77053;
+UPDATE `gameobject` SET `rotation0`=0.0239267, `rotation1`=0.0582066, `rotation2`=-0.92025, `rotation3`=0.386238 WHERE `guid`=77054;
+UPDATE `gameobject` SET `rotation0`=0.0541716, `rotation1`=0.0323639, `rotation2`=-0.245821, `rotation3`=0.967259 WHERE `guid`=77055;
+UPDATE `gameobject` SET `rotation0`=-0.00713873, `rotation1`=-0.0216646, `rotation2`=-0.243133, `rotation3`=0.969725 WHERE `guid`=77056;
+UPDATE `gameobject` SET `rotation0`=-0.126151, `rotation1`=0.0901117, `rotation2`=-0.923634, `rotation3`=0.350524 WHERE `guid`=77057;
+UPDATE `gameobject` SET `rotation0`=-0.0150366, `rotation1`=-0.0171528, `rotation2`=-0.602707, `rotation3`=0.797637 WHERE `guid`=77058;
+UPDATE `gameobject` SET `rotation0`=0.00825453, `rotation1`=-0.0623331, `rotation2`=0.657885, `rotation3`=0.750489 WHERE `guid`=77059;
+UPDATE `gameobject` SET `rotation0`=-0.000444889, `rotation1`=-0.0317888, `rotation2`=0.999405, `rotation3`=0.0133833 WHERE `guid`=77061;
+UPDATE `gameobject` SET `rotation0`=-0.0266786, `rotation1`=-0.0172901, `rotation2`=0.544106, `rotation3`=0.838414 WHERE `guid`=77062;
+UPDATE `gameobject` SET `rotation0`=0.0752997, `rotation1`=-0.0983257, `rotation2`=-0.948325, `rotation3`=0.292132 WHERE `guid`=77063;
+UPDATE `gameobject` SET `rotation0`=0.0610685, `rotation1`=-0.00140285, `rotation2`=-0.973658, `rotation3`=0.219681 WHERE `guid`=77064;
+UPDATE `gameobject` SET `rotation0`=0.10274, `rotation1`=0.0691566, `rotation2`=0.233692, `rotation3`=0.964391 WHERE `guid`=77065;
+UPDATE `gameobject` SET `rotation0`=-0.00709391, `rotation1`=0.0064373, `rotation2`=-0.337871, `rotation3`=0.941144 WHERE `guid`=77066;
+UPDATE `gameobject` SET `rotation0`=-0.00249577, `rotation1`=-0.00319576, `rotation2`=-0.374365, `rotation3`=0.927273 WHERE `guid`=77067;
+UPDATE `gameobject` SET `rotation0`=-0.0212216, `rotation1`=-0.00836372, `rotation2`=-0.901033, `rotation3`=0.43315 WHERE `guid`=77068;
+UPDATE `gameobject` SET `rotation0`=-0.0304646, `rotation1`=-0.00535011, `rotation2`=0.224893, `rotation3`=0.973893 WHERE `guid`=77069;
+UPDATE `gameobject` SET `rotation0`=0.0292087, `rotation1`=0.0536489, `rotation2`=-0.250513, `rotation3`=0.966184 WHERE `guid`=77070;
+UPDATE `gameobject` SET `rotation0`=0.0301409, `rotation1`=0.0531301, `rotation2`=-0.267338, `rotation3`=0.961665 WHERE `guid`=77071;
+UPDATE `gameobject` SET `rotation0`=0.00539398, `rotation1`=0.0608454, `rotation2`=0.155528, `rotation3`=0.985941 WHERE `guid`=77072;
+UPDATE `gameobject` SET `rotation0`=-0.030252, `rotation1`=0.00645065, `rotation2`=-0.156309, `rotation3`=0.987224 WHERE `guid`=77073;
+UPDATE `gameobject` SET `rotation0`=-0.0722237, `rotation1`=-0.103849, `rotation2`=-0.5404, `rotation3`=0.831846 WHERE `guid`=77074;
+UPDATE `gameobject` SET `rotation0`=-0.111862, `rotation1`=-0.0272312, `rotation2`=0.638226, `rotation3`=0.761192 WHERE `guid`=77075;
+UPDATE `gameobject` SET `rotation0`=0.0662546, `rotation1`=0.000401497, `rotation2`=-0.44333, `rotation3`=0.893906 WHERE `guid`=77076;
+UPDATE `gameobject` SET `rotation0`=0.0209198, `rotation1`=-0.00909042, `rotation2`=0.943409, `rotation3`=0.330846 WHERE `guid`=77077;
+UPDATE `gameobject` SET `rotation0`=0.0432615, `rotation1`=-0.116046, `rotation2`=-0.992298, `rotation3`=0.00248976 WHERE `guid`=77078;
+UPDATE `gameobject` SET `rotation0`=-0.017314, `rotation1`=-0.0256319, `rotation2`=0.856783, `rotation3`=0.514749 WHERE `guid`=77079;
+UPDATE `gameobject` SET `rotation0`=0.0752997, `rotation1`=-0.0983257, `rotation2`=-0.948325, `rotation3`=0.292132 WHERE `guid`=77080;
+UPDATE `gameobject` SET `rotation0`=-0.0569057, `rotation1`=0.0222044, `rotation2`=0.990073, `rotation3`=0.126585 WHERE `guid`=77081;
+UPDATE `gameobject` SET `rotation0`=-0.0347595, `rotation1`=0.0502291, `rotation2`=0.750026, `rotation3`=0.658582 WHERE `guid`=77082;
+UPDATE `gameobject` SET `rotation0`=0.054215, `rotation1`=0.0281439, `rotation2`=-0.747968, `rotation3`=0.660918 WHERE `guid`=77084;
+UPDATE `gameobject` SET `rotation0`=-0.0417008, `rotation1`=-0.0521269, `rotation2`=0.321725, `rotation3`=0.944477 WHERE `guid`=77085;
+UPDATE `gameobject` SET `rotation0`=0.0398989, `rotation1`=0.0486679, `rotation2`=-0.992964, `rotation3`=0.100311 WHERE `guid`=77086;
+UPDATE `gameobject` SET `rotation0`=0.0630999, `rotation1`=0.000666618, `rotation2`=-0.699629, `rotation3`=0.711714 WHERE `guid`=77087;
+UPDATE `gameobject` SET `rotation0`=-0.0131607, `rotation1`=-0.018631, `rotation2`=-0.516029, `rotation3`=0.856267 WHERE `guid`=77088;
+UPDATE `gameobject` SET `rotation0`=-0.0579896, `rotation1`=0.0191956, `rotation2`=0.995341, `rotation3`=0.0745953 WHERE `guid`=77089;
+UPDATE `gameobject` SET `rotation0`=0.122504, `rotation1`=0.0181885, `rotation2`=-0.204252, `rotation3`=0.971053 WHERE `guid`=77090;
+UPDATE `gameobject` SET `rotation0`=-0.00862169, `rotation1`=-0.0253086, `rotation2`=0.382218, `rotation3`=0.923685 WHERE `guid`=77091;
+UPDATE `gameobject` SET `rotation0`=-0.00204277, `rotation1`=0.12383, `rotation2`=0.936084, `rotation3`=0.329255 WHERE `guid`=77092;
+UPDATE `gameobject` SET `rotation0`=-0.0325356, `rotation1`=0.0516987, `rotation2`=0.720584, `rotation3`=0.690672 WHERE `guid`=77093;
+UPDATE `gameobject` SET `rotation0`=0.117485, `rotation1`=0.0391846, `rotation2`=-0.0325279, `rotation3`=0.991768 WHERE `guid`=77094;
+UPDATE `gameobject` SET `rotation0`=-0.0286865, `rotation1`=-0.0115671, `rotation2`=0.422462, `rotation3`=0.905853 WHERE `guid`=77095;
+UPDATE `gameobject` SET `rotation0`=-0.0347595, `rotation1`=0.0502291, `rotation2`=0.750026, `rotation3`=0.658582 WHERE `guid`=77096;
+UPDATE `gameobject` SET `rotation0`=0.115664, `rotation1`=0.0442724, `rotation2`=0.0107622, `rotation3`=0.992243 WHERE `guid`=77098;
+UPDATE `gameobject` SET `rotation0`=0.0202045, `rotation1`=0.0576458, `rotation2`=-0.0919485, `rotation3`=0.993888 WHERE `guid`=77100;
+UPDATE `gameobject` SET `rotation0`=-0.0240259, `rotation1`=0.0194817, `rotation2`=-0.587462, `rotation3`=0.80866 WHERE `guid`=77101;
+UPDATE `gameobject` SET `rotation0`=0.104515, `rotation1`=0.0664425, `rotation2`=0.208368, `rotation3`=0.970178 WHERE `guid`=77102;
+UPDATE `gameobject` SET `rotation0`=-0.0216928, `rotation1`=-0.00705242, `rotation2`=-0.925796, `rotation3`=0.377336 WHERE `guid`=77103;
+UPDATE `gameobject` SET `rotation0`=-0.0108008, `rotation1`=0.0601225, `rotation2`=0.409385, `rotation3`=0.910315 WHERE `guid`=77104;
+UPDATE `gameobject` SET `rotation0`=0.0947957, `rotation1`=-0.0796976, `rotation2`=-0.862617, `rotation3`=0.490464 WHERE `guid`=77105;
+UPDATE `gameobject` SET `rotation0`=-0.0227056, `rotation1`=-0.00477314, `rotation2`=-0.902395, `rotation3`=0.430284 WHERE `guid`=77106;
+UPDATE `gameobject` SET `rotation0`=0.112294, `rotation1`=0.0522327, `rotation2`=0.0799513, `rotation3`=0.989075 WHERE `guid`=77107;
+UPDATE `gameobject` SET `rotation0`=-0.056201, `rotation1`=0.0239315, `rotation2`=0.985746, `rotation3`=0.156757 WHERE `guid`=77108;
+UPDATE `gameobject` SET `rotation0`=-0.0557747, `rotation1`=0.02491, `rotation2`=0.982861, `rotation3`=0.173936 WHERE `guid`=77109;
+UPDATE `gameobject` SET `rotation0`=0.0610828, `rotation1`=0.000462532, `rotation2`=-0.966495, `rotation3`=0.249313 WHERE `guid`=77110;
+UPDATE `gameobject` SET `rotation0`=-0.00352192, `rotation1`=-0.0307302, `rotation2`=0.99766, `rotation3`=0.0609785 WHERE `guid`=77111;
+UPDATE `gameobject` SET `rotation0`=0.00512791, `rotation1`=0.0608683, `rotation2`=0.159828, `rotation3`=0.985253 WHERE `guid`=77112;
+UPDATE `gameobject` SET `rotation0`=-0.012002, `rotation1`=0.00661659, `rotation2`=-0.896828, `rotation3`=0.442168 WHERE `guid`=77113;
+UPDATE `gameobject` SET `rotation0`=0.123432, `rotation1`=0.0101376, `rotation2`=-0.267324, `rotation3`=0.955615 WHERE `guid`=77115;
+UPDATE `gameobject` SET `rotation0`=0.0494599, `rotation1`=0.0358477, `rotation2`=-0.642063, `rotation3`=0.764214 WHERE `guid`=77116;
+UPDATE `gameobject` SET `rotation0`=0.0607848, `rotation1`=0.00604916, `rotation2`=-0.939628, `rotation3`=0.336702 WHERE `guid`=77117;
+UPDATE `gameobject` SET `rotation0`=0.018436, `rotation1`=0.0582361, `rotation2`=-0.0615549, `rotation3`=0.996233 WHERE `guid`=77118;
+UPDATE `gameobject` SET `rotation0`=0.0467849, `rotation1`=-0.11467, `rotation2`=-0.991772, `rotation3`=0.0324174 WHERE `guid`=77119;
+UPDATE `gameobject` SET `rotation0`=-0.00744295, `rotation1`=0.123623, `rotation2`=0.949555, `rotation3`=0.288109 WHERE `guid`=77120;
+UPDATE `gameobject` SET `rotation0`=-0.00286865, `rotation1`=0.0480499, `rotation2`=-0.0607004, `rotation3`=0.996995 WHERE `guid`=77121;
+UPDATE `gameobject` SET `rotation0`=0.0481787, `rotation1`=0.0375519, `rotation2`=-0.615001, `rotation3`=0.786157 WHERE `guid`=77122;
+UPDATE `gameobject` SET `rotation0`=0.0488267, `rotation1`=0.036706, `rotation2`=-0.628628, `rotation3`=0.775304 WHERE `guid`=77123;
+UPDATE `gameobject` SET `rotation0`=0.0292087, `rotation1`=0.0536489, `rotation2`=-0.250513, `rotation3`=0.966184 WHERE `guid`=77124;
+UPDATE `gameobject` SET `rotation0`=-0.013176, `rotation1`=0.0279846, `rotation2`=-0.880445, `rotation3`=0.473139 WHERE `guid`=77125;
+UPDATE `gameobject` SET `rotation0`=-0.0131526, `rotation1`=0.0596514, `rotation2`=0.444809, `rotation3`=0.89354 WHERE `guid`=77126;
+UPDATE `gameobject` SET `rotation0`=0.0433717, `rotation1`=0.0282393, `rotation2`=-0.960958, `rotation3`=0.271813 WHERE `guid`=77127;
+UPDATE `gameobject` SET `rotation0`=0.0501857, `rotation1`=-0.00143909, `rotation2`=-0.956716, `rotation3`=0.286661 WHERE `guid`=77128;
+UPDATE `gameobject` SET `rotation0`=0.0460067, `rotation1`=0.0250292, `rotation2`=-0.89929, `rotation3`=0.434205 WHERE `guid`=77129;
+UPDATE `gameobject` SET `rotation0`=-0.0043478, `rotation1`=-0.0223913, `rotation2`=-0.118811, `rotation3`=0.992655 WHERE `guid`=77130;
+UPDATE `gameobject` SET `rotation0`=-0.0251698, `rotation1`=0.0179787, `rotation2`=-0.537, `rotation3`=0.843015 WHERE `guid`=77131;
+UPDATE `gameobject` SET `rotation0`=-0.0507507, `rotation1`=0.0339947, `rotation2`=0.939208, `rotation3`=0.337871 WHERE `guid`=77132;
+UPDATE `gameobject` SET `rotation0`=-0.0164309, `rotation1`=0.0143499, `rotation2`=-0.612422, `rotation3`=0.79023 WHERE `guid`=77133;
+UPDATE `gameobject` SET `rotation0`=0.150003, `rotation1`=-0.0637999, `rotation2`=-0.505119, `rotation3`=0.847516 WHERE `guid`=77134;
+UPDATE `gameobject` SET `rotation0`=0.00594473, `rotation1`=-0.00461292, `rotation2`=-0.170579, `rotation3`=0.985315 WHERE `guid`=77135;
+UPDATE `gameobject` SET `rotation0`=0.0518498, `rotation1`=0.0100574, `rotation2`=-0.229643, `rotation3`=0.971841 WHERE `guid`=77136;
+UPDATE `gameobject` SET `rotation0`=-0.00587082, `rotation1`=-0.0157957, `rotation2`=0.394556, `rotation3`=0.918717 WHERE `guid`=77137;
+UPDATE `gameobject` SET `rotation0`=0.0170288, `rotation1`=0.0472221, `rotation2`=0.659506, `rotation3`=0.750021 WHERE `guid`=77138;
+UPDATE `gameobject` SET `rotation0`=0.030128, `rotation1`=0.027483, `rotation2`=0.0691519, `rotation3`=0.996772 WHERE `guid`=77139;
+UPDATE `gameobject` SET `rotation0`=0.0950837, `rotation1`=0.0810518, `rotation2`=-0.0570211, `rotation3`=0.990524 WHERE `guid`=77140;
+UPDATE `gameobject` SET `rotation0`=0.0844626, `rotation1`=-0.139417, `rotation2`=-0.905103, `rotation3`=0.392706 WHERE `guid`=77141;
+UPDATE `gameobject` SET `rotation0`=0.151325, `rotation1`=-0.118515, `rotation2`=-0.150674, `rotation3`=0.969718 WHERE `guid`=77142;
+UPDATE `gameobject` SET `rotation0`=-0.0991616, `rotation1`=-0.199687, `rotation2`=0.920929, `rotation3`=0.319659 WHERE `guid`=77143;
+UPDATE `gameobject` SET `rotation0`=0.207263, `rotation1`=-0.123673, `rotation2`=-0.118627, `rotation3`=0.963159 WHERE `guid`=77144;
+UPDATE `gameobject` SET `rotation0`=0.0850377, `rotation1`=-0.117254, `rotation2`=0.617311, `rotation3`=0.773271 WHERE `guid`=77145;
+UPDATE `gameobject` SET `rotation0`=0.111181, `rotation1`=-0.132936, `rotation2`=0.250117, `rotation3`=0.95258 WHERE `guid`=77146;
+UPDATE `gameobject` SET `rotation0`=-0.0618968, `rotation1`=-0.172729, `rotation2`=0.751708, `rotation3`=0.633458 WHERE `guid`=77147;
+UPDATE `gameobject` SET `rotation0`=0.329918, `rotation1`=-0.0781288, `rotation2`=-0.556777, `rotation3`=0.75832 WHERE `guid`=77148;
+UPDATE `gameobject` SET `rotation0`=0.100191, `rotation1`=-0.175282, `rotation2`=0.773164, `rotation3`=0.601212 WHERE `guid`=77149;
+UPDATE `gameobject` SET `rotation0`=0.206481, `rotation1`=0.0967264, `rotation2`=-0.923958, `rotation3`=0.307102 WHERE `guid`=77150;
+UPDATE `gameobject` SET `rotation0`=0.254753, `rotation1`=0.0382614, `rotation2`=-0.822841, `rotation3`=0.506528 WHERE `guid`=77151;
+UPDATE `gameobject` SET `rotation0`=-0.0221047, `rotation1`=-0.302703, `rotation2`=0.907742, `rotation3`=0.289634 WHERE `guid`=77152;
+UPDATE `gameobject` SET `rotation0`=-0.0450306, `rotation1`=0.244809, `rotation2`=-0.821506, `rotation3`=0.513 WHERE `guid`=77157;
+UPDATE `gameobject` SET `rotation0`=-0.0161185, `rotation1`=0.160583, `rotation2`=-0.973068, `rotation3`=0.164595 WHERE `guid`=77158;
+UPDATE `gameobject` SET `rotation0`=-0.0171127, `rotation1`=-0.0166779, `rotation2`=-0.997555, `rotation3`=0.065677 WHERE `guid`=77159;
+UPDATE `gameobject` SET `rotation0`=-0.00719595, `rotation1`=-0.0719738, `rotation2`=0.1419, `rotation3`=0.987235 WHERE `guid`=77160;
+UPDATE `gameobject` SET `rotation0`=-0.00724554, `rotation1`=-0.0421524, `rotation2`=0.532355, `rotation3`=0.84544 WHERE `guid`=77161;
+UPDATE `gameobject` SET `rotation0`=-0.0255208, `rotation1`=0.0302401, `rotation2`=-0.189908, `rotation3`=0.981004 WHERE `guid`=77162;
+UPDATE `gameobject` SET `rotation0`=0.0435467, `rotation1`=-0.011776, `rotation2`=-0.852303, `rotation3`=0.5211 WHERE `guid`=77163;
+UPDATE `gameobject` SET `rotation0`=-0.0274987, `rotation1`=0.0110216, `rotation2`=0.675546, `rotation3`=0.736723 WHERE `guid`=77164;
+UPDATE `gameobject` SET `rotation0`=0.0167489, `rotation1`=-0.000976563, `rotation2`=0.457918, `rotation3`=0.888836 WHERE `guid`=77165;
+UPDATE `gameobject` SET `rotation0`=0.0871139, `rotation1`=0.0415649, `rotation2`=0.890839, `rotation3`=0.443948 WHERE `guid`=77167;
+UPDATE `gameobject` SET `rotation0`=0.0360966, `rotation1`=-0.0301628, `rotation2`=-0.845136, `rotation3`=0.532478 WHERE `guid`=77168;
+UPDATE `gameobject` SET `rotation0`=0.089571, `rotation1`=-0.177974, `rotation2`=0.654187, `rotation3`=0.729617 WHERE `guid`=77174;
+UPDATE `gameobject` SET `rotation0`=0.014946, `rotation1`=0.0937176, `rotation2`=0.917232, `rotation3`=0.386885 WHERE `guid`=77176;
+UPDATE `gameobject` SET `rotation0`=0.107347, `rotation1`=-0.11599, `rotation2`=-0.80059, `rotation3`=0.577996 WHERE `guid`=77177;
+UPDATE `gameobject` SET `rotation0`=0.0979347, `rotation1`=-0.0203876, `rotation2`=-0.907374, `rotation3`=0.408246 WHERE `guid`=77178;
+UPDATE `gameobject` SET `rotation0`=0.0107517, `rotation1`=0.0785532, `rotation2`=0.764607, `rotation3`=0.639601 WHERE `guid`=77179;
+UPDATE `gameobject` SET `rotation0`=0.0792899, `rotation1`=0.0916252, `rotation2`=0.283839, `rotation3`=0.951185 WHERE `guid`=77181;
+UPDATE `gameobject` SET `rotation0`=-0.0802469, `rotation1`=0.152781, `rotation2`=0.968978, `rotation3`=0.176919 WHERE `guid`=77182;
+UPDATE `gameobject` SET `rotation0`=0.00961256, `rotation1`=0.117995, `rotation2`=0.961841, `rotation3`=0.246673 WHERE `guid`=77183;
+UPDATE `gameobject` SET `rotation0`=0.104968, `rotation1`=0.15615, `rotation2`=-0.58289, `rotation3`=0.790467 WHERE `guid`=77184;
+UPDATE `gameobject` SET `rotation0`=0.0362058, `rotation1`=0.120889, `rotation2`=-0.777025, `rotation3`=0.61669 WHERE `guid`=77185;
+UPDATE `gameobject` SET `rotation0`=0.0951447, `rotation1`=-0.0871191, `rotation2`=-0.991632, `rotation3`=0.00477168 WHERE `guid`=77186;
+UPDATE `gameobject` SET `rotation0`=0.0418429, `rotation1`=0.0310535, `rotation2`=0.994143, `rotation3`=0.094686 WHERE `guid`=77188;
+UPDATE `gameobject` SET `rotation0`=-0.019105, `rotation1`=0.0849142, `rotation2`=0.25337, `rotation3`=0.963446 WHERE `guid`=77189;
+UPDATE `gameobject` SET `rotation0`=0.00263071, `rotation1`=0.0212584, `rotation2`=0.99977, `rotation3`=0 WHERE `guid`=87974;
+UPDATE `gameobject` SET `rotation0`=-0.00499153, `rotation1`=-0.0433273, `rotation2`=-0.976177, `rotation3`=0.212546 WHERE `guid`=100099;
+UPDATE `gameobject` SET `rotation0`=-0.0704336, `rotation1`=-0.0118895, `rotation2`=0.615775, `rotation3`=0.784678 WHERE `guid`=100111;
+UPDATE `gameobject` SET `rotation0`=0.0625167, `rotation1`=0.0988617, `rotation2`=0.0627174, `rotation3`=0.991153 WHERE `guid`=100113;
+UPDATE `gameobject` SET `rotation0`=-0.0152206, `rotation1`=0.015625, `rotation2`=-0.156172, `rotation3`=0.987489 WHERE `guid`=100130;
+UPDATE `gameobject` SET `rotation0`=-0.00867891, `rotation1`=0.000911713, `rotation2`=0.659348, `rotation3`=0.751787 WHERE `guid`=100131;
+UPDATE `gameobject` SET `rotation0`=-0.00436258, `rotation1`=0.00755692, `rotation2`=0.0654306, `rotation3`=0.997819 WHERE `guid`=100133;
+UPDATE `gameobject` SET `rotation0`=-0.00864697, `rotation1`=0.00117683, `rotation2`=0.636083, `rotation3`=0.771572 WHERE `guid`=100134;
+UPDATE `gameobject` SET `rotation0`=0.0196276, `rotation1`=0.00951958, `rotation2`=-0.971087, `rotation3`=0.237725 WHERE `guid`=100136;
+UPDATE `gameobject` SET `rotation0`=0.161899, `rotation1`=-0.411941, `rotation2`=0.241236, `rotation3`=0.863655 WHERE `guid`=100137;
+UPDATE `gameobject` SET `rotation0`=0.644176, `rotation1`=-0.0210094, `rotation2`=0.761547, `rotation3`=0.0681314 WHERE `guid`=100141;
+UPDATE `gameobject` SET `rotation0`=-0.0734706, `rotation1`=-0.56757, `rotation2`=-0.0934219, `rotation3`=0.814702 WHERE `guid`=100142;
+UPDATE `gameobject` SET `rotation0`=-0.630999, `rotation1`=-0.218625, `rotation2`=-0.702788, `rotation3`=0.245218 WHERE `guid`=100144;
+UPDATE `gameobject` SET `rotation0`=-0.107858, `rotation1`=-0.0487566, `rotation2`=-0.101926, `rotation3`=0.987725 WHERE `guid`=100450;
+UPDATE `gameobject` SET `rotation0`=-0.0390229, `rotation1`=0.111322, `rotation2`=0.748832, `rotation3`=0.652178 WHERE `guid`=100451;
+UPDATE `gameobject` SET `rotation0`=-0.0379386, `rotation1`=-0.156926, `rotation2`=-0.957411, `rotation3`=0.239373 WHERE `guid`=100452;
+UPDATE `gameobject` SET `rotation0`=-0.180747, `rotation1`=0.0777254, `rotation2`=-0.015399, `rotation3`=0.980333 WHERE `guid`=100453;
+UPDATE `gameobject` SET `rotation0`=-0.139477, `rotation1`=-0.0323668, `rotation2`=-0.199125, `rotation3`=0.969457 WHERE `guid`=100454;
+UPDATE `gameobject` SET `rotation0`=-0.097249, `rotation1`=-0.0870361, `rotation2`=-0.955737, `rotation3`=0.263693 WHERE `guid`=100455;
+UPDATE `gameobject` SET `rotation0`=0.072156, `rotation1`=-0.202436, `rotation2`=-0.864216, `rotation3`=0.454911 WHERE `guid`=100456;
+UPDATE `gameobject` SET `rotation0`=-0.105731, `rotation1`=-0.0683603, `rotation2`=-0.0585232, `rotation3`=0.990315 WHERE `guid`=100457;
+UPDATE `gameobject` SET `rotation0`=0.00770569, `rotation1`=0.0736351, `rotation2`=-0.67674, `rotation3`=0.73249 WHERE `guid`=100458;
+UPDATE `gameobject` SET `rotation0`=-0.11402, `rotation1`=-0.16656, `rotation2`=0.159782, `rotation3`=0.966295 WHERE `guid`=100459;
+UPDATE `gameobject` SET `rotation0`=-0.0164127, `rotation1`=-0.0513248, `rotation2`=0.0741091, `rotation3`=0.995793 WHERE `guid`=100461;
+UPDATE `gameobject` SET `rotation0`=0.137686, `rotation1`=-0.0460796, `rotation2`=-0.409542, `rotation3`=0.900663 WHERE `guid`=100462;
+UPDATE `gameobject` SET `rotation0`=0.00110674, `rotation1`=0.0625811, `rotation2`=0.691717, `rotation3`=0.719451 WHERE `guid`=100463;
+UPDATE `gameobject` SET `rotation0`=-0.136161, `rotation1`=0.0206881, `rotation2`=-0.976232, `rotation3`=0.167344 WHERE `guid`=100464;
+UPDATE `gameobject` SET `rotation0`=-0.151397, `rotation1`=0.19665, `rotation2`=-0.201186, `rotation3`=0.947593 WHERE `guid`=100465;
+UPDATE `gameobject` SET `rotation0`=-0.0643306, `rotation1`=0.0673084, `rotation2`=-0.461115, `rotation3`=0.882442 WHERE `guid`=100466;
+UPDATE `gameobject` SET `rotation0`=0.171546, `rotation1`=0.0245619, `rotation2`=-0.0352268, `rotation3`=0.98424 WHERE `guid`=100467;
+UPDATE `gameobject` SET `rotation0`=-0.0134768, `rotation1`=-0.0521717, `rotation2`=0.130445, `rotation3`=0.98999 WHERE `guid`=100468;
+UPDATE `gameobject` SET `rotation0`=-0.00244284, `rotation1`=0.0625439, `rotation2`=0.731393, `rotation3`=0.679078 WHERE `guid`=100469;
+UPDATE `gameobject` SET `rotation0`=-0.162303, `rotation1`=0.187751, `rotation2`=-0.147141, `rotation3`=0.957474 WHERE `guid`=100470;
+UPDATE `gameobject` SET `rotation0`=0.169878, `rotation1`=0.0342474, `rotation2`=0.0206289, `rotation3`=0.984654 WHERE `guid`=100471;
+UPDATE `gameobject` SET `rotation0`=0.0185976, `rotation1`=0.0620785, `rotation2`=-0.88506, `rotation3`=0.460943 WHERE `guid`=100473;
+UPDATE `gameobject` SET `rotation0`=0.0269089, `rotation1`=0.00610161, `rotation2`=-0.999321, `rotation3`=0.0244177 WHERE `guid`=151140;
+UPDATE `gameobject` SET `rotation0`=-0.0320468, `rotation1`=-0.0343475, `rotation2`=0.725892, `rotation3`=0.686203 WHERE `guid`=151141;
+UPDATE `gameobject` SET `rotation0`=0.021595, `rotation1`=-0.0220261, `rotation2`=0.904034, `rotation3`=0.426347 WHERE `guid`=151142;
+UPDATE `gameobject` SET `rotation0`=0.0010438, `rotation1`=0.0539341, `rotation2`=-0.0478249, `rotation3`=0.997398 WHERE `guid`=151293;
+UPDATE `gameobject` SET `rotation0`=0.0864091, `rotation1`=0.0250797, `rotation2`=-0.416438, `rotation3`=0.904701 WHERE `guid`=151893;
+UPDATE `gameobject` SET `rotation0`=-0.0144057, `rotation1`=0.0048542, `rotation2`=-0.459116, `rotation3`=0.888246 WHERE `guid`=151894;
diff --git a/sql/updates/world/3.3.5/2016_07_31_00_world_335.sql b/sql/updates/world/3.3.5/2016_07_31_00_world_335.sql
new file mode 100644
index 00000000000..9a87de56977
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_31_00_world_335.sql
@@ -0,0 +1,47 @@
+-- SmartAI script for creature entry 9528 Arathandris Silversky and 9529 Maybess Riverbreeze
+SET @Arathandris := 9528;
+SET @Riverbreeze := 9529;
+
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`= '' WHERE `entry` IN (@Arathandris,@Riverbreeze);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@Arathandris,@Riverbreeze) AND `source_type`= 0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Arathandris,0, 0,1, 62,0,100,0, 2208,0,0,0, 72, 0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Arathandris Silversky - On Gossip 2208 Option 0 selected - Close Gossip'),
+(@Arathandris,0, 1,2, 61,0,100,0, 0,0,0,0, 11,15120,0,0,0,0,0,7,0,0,0,0,0,0,0,"Arathandris Silversky - On Gossip 2208 Option 0 selected - Cast 'Cenarion Beacon'"),
+(@Arathandris,0, 2,0, 61,0,100,0, 0,0,0,0, 1, 0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Arathandris Silversky - On Gossip 2208 Option 0 Selected - Say Line 0'),
+(@Riverbreeze,0, 0,1, 62,0,100,0,21400,0,0,0, 72, 0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Maybess Riverbreeze - On Gossip 21400 Option 0 Selected - Close Gossip'),
+(@Riverbreeze,0, 1,2, 61,0,100,0, 0,0,0,0, 11,15120,0,0,0,0,0,7,0,0,0,0,0,0,0,"Maybess Riverbreeze - On Gossip 21400 Option 0 Selected - Cast 'Cenarion Beacon'"),
+(@Riverbreeze,0, 2,0, 61,0,100,0, 0,0,0,0, 1, 0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Maybess Riverbreeze - On Gossip 21400 Option 0 Selected - Say Line 0');
+
+-- insert missing gossip_menu entries
+DELETE FROM `gossip_menu` WHERE `entry` IN (2209, 21401) AND `text_id` IN (3046, 3047);
+INSERT INTO `gossip_menu` (`entry`,`text_id`,`VerifiedBuild`) VALUES
+(2209, 3046, 0),
+(21401, 3047, 0);
+
+UPDATE `gossip_menu_option` SET `action_menu_id` = 2209 WHERE `menu_id` = 2208 AND `OptionBroadcastTextID`= 5384;
+UPDATE `gossip_menu_option` SET `action_menu_id`= 21401 WHERE `menu_id`= 21400 AND `OptionBroadcastTextID`= 5384;
+
+DELETE FROM `creature_text` WHERE `entry` IN (@Arathandris,@Riverbreeze);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(@Riverbreeze,0,0,'Here is a beacon for you, $n. You must keep it in your possession if you are to find the corrupted items we will need.',12,1,100,25,5000,0,5244,0,'Arathandris Silversky - SAY_BEACON'),
+(@Arathandris,0,0,'Here is a beacon for you, $n. You must keep it in your possession if you are to find the corrupted items we will need.',12,7,100,25,5000,0,5245,0,'Arathandris Silversky - SAY_BEACON');
+
+-- conditions for Arathandris Silversky's and Maybess Riverbreeze's gossip menus
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 14 AND `SourceGroup`= 21400 AND `SourceEntry` IN (2842,2843,2849);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(14, 21400, 2842, 0, 0, 8, 0, 4102, 0, 0, 1, 0, 0, '', 'Maybess Riverbreeze - Show gossip text if player has not been rewarded quest 4102'),
+(14, 21400, 2843, 0, 0, 6, 0, 469, 0, 0, 0, 0, 0, '', 'Maybess Riverbreeze - Show gossip text if player is alliance'),
+(14, 21400, 2849, 0, 0, 8, 0, 4102, 0, 0, 0, 0, 0, '', 'Maybess Riverbreeze - Show gossip text if player has been rewarded quest 4102');
+
+-- Correct some wrong quest IDs and NPC texts
+UPDATE `conditions` SET `ConditionValue1`= 4101 WHERE `SourceGroup`= 2208 AND `ConditionValue1`= 3781;
+UPDATE `conditions` SET `ConditionValue1`= 4102 WHERE `SourceGroup`= 21400 AND `ConditionValue1`= 3781;
+UPDATE `conditions` SET `SourceEntry`= 2845 WHERE `SourceTypeOrReferenceId`= 14 AND `SourceGroup`= 2208 AND `SourceEntry`= 2848;
+UPDATE `conditions` SET `SourceEntry`= 2848 WHERE `SourceTypeOrReferenceId`= 14 AND `SourceGroup`= 2208 AND `SourceEntry`= 2845 AND `ConditionValue1`= 4101;
+
+-- Condition for source GOSSIP MENU OPTION condition type ITEM, item 11511 Cenarion Beacon
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup` IN (2208,21400) AND `SourceEntry`= 0 AND `SourceId`= 0 AND `NegativeCondition`= 1;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15, 2208,0,0,0, 2,0, 11511,1, 0,1,0,0,'','Do not show gossip menu 2208 option id 0 if player has 1 of Cenarion Beacon in bags or bank.'),
+(15,21400,0,0,0, 2,0, 11511,1, 0,1,0,0,'','Do not show gossip menu 21400 option id 0 if player has 1 of Cenarion Beacon in bags or bank.');
diff --git a/sql/updates/world/3.3.5/2016_07_31_01_world.sql b/sql/updates/world/3.3.5/2016_07_31_01_world.sql
new file mode 100644
index 00000000000..3fb22dfd09f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_07_31_01_world.sql
@@ -0,0 +1,2 @@
+-- Pristine Glowbear Pelt
+UPDATE `item_template` SET `DisenchantID`=54 WHERE `entry`=51958;
diff --git a/sql/updates/world/3.3.5/2016_08_01_01_world.sql b/sql/updates/world/3.3.5/2016_08_01_01_world.sql
new file mode 100644
index 00000000000..327e58bf5c9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_08_01_01_world.sql
@@ -0,0 +1,88 @@
+DELETE FROM `creature_summon_groups` WHERE `summonerId`=22841; -- Shade of Akama
+INSERT INTO `creature_summon_groups` (`summonerId`,`summonerType`,`groupId`,`entry`,`position_x`,`position_y`,`position_z`,`orientation`,`summonType`,`summonTime`) VALUES
+(22841,0,1,23421,443.495,413.973,118.621,5.13127 ,6,6000),-- Ashtongue Channeler
+(22841,0,1,23421,456.694,414.117,118.621,4.2586 ,6,6000),
+(22841,0,1,23421,457.763,390.117,118.621,2.25148 ,6,6000),
+(22841,0,1,23421,444.153,389.214,118.621,1.0821 ,6,6000),
+(22841,0,1,23421,438.279,401.258,118.621,0.017453,6,6000),
+(22841,0,1,23421,463.186,401.64 ,118.621,3.19395 ,6,6000),
+(22841,0,1,23191,547.186,400.534,112.867,3.12414 ,8, 0); -- Akama
+
+DELETE FROM `creature` WHERE `id` IN (23191,23421);
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_shade_soul_channel_serverside','spell_shade_soul_channel');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(40401,'spell_shade_soul_channel_serverside'),
+(40520,'spell_shade_soul_channel');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=40902;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13,2,40902,0,1,31,0,3,22841,0,0,0,0,'','Effect_1 - Hits Shade of Akama'),
+(13,4,40902,0,2,31,0,3,23351,0,0,0,0,'','Effect_2 - Hits Trigger');
+
+UPDATE `creature_template` SET `mechanic_immune_mask`=618610687 WHERE `entry`=23215; -- Ashtongue Sorcerer Immunity
+UPDATE `creature_template` SET `ScriptName`='npc_ashtongue_broken' WHERE `entry`=23319;
+UPDATE `creature_template` SET `speed_run`=0.571429 WHERE `entry`=22841;
+
+DELETE FROM `creature_text` WHERE `entry`=23191 AND `groupid` IN (3,4);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(23191,3,0,'I will not last much longer!',14,0,100,0,0,11385,21784,0,'Akama SAY_LOW_HEALTH'),
+(23191,4,0,'No! Not yet!',14,0,100,0,0,11386,21785,0,'Akama SAY_DEAD');
+
+-- Waypoints
+
+-- Middle Creatures
+SET @NPC := 12806;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=489.6115,`position_y`=407.0968,`position_z`=112.7839 WHERE `guid`=@NPC;
+UPDATE `creature` SET `MovementType`=0, `spawndist`=0 WHERE `guid`=12805;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,489.6115,407.0968,112.7839,0,0,0,0,100,0),
+(@PATH,2,521.2068,407.0993,112.7837,0,0,0,0,100,0);
+DELETE FROM `creature_formations` WHERE `leaderGUID`=@NPC;
+INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
+(@NPC,@NPC ,0, 0,1,0,0),
+(@NPC,12805,6,90,2,1,2);
+
+-- Side Creatures
+SET @NPC := 12780;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=528.3928,`position_y`=429.879,`position_z`=113.0337 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,528.3928, 429.879,113.0337,0,0,0,0,100,0),
+(@PATH,2, 506.946,432.0048,113.0337,0,0,0,0,100,0),
+(@PATH,3,500.5693,414.4586,113.0338,0,0,0,0,100,0),
+(@PATH,4, 506.946,432.0048,113.0337,0,0,0,0,100,0);
+
+SET @NPC := 12782;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=516.83,`position_y`=368.9177,`position_z`=113.0337 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1, 501.718,381.9136,113.0337,0,0,0,0,100,0),
+(@PATH,2, 507.699,369.5598,113.0337,0,0,0,0,100,0),
+(@PATH,3,527.0941,372.4955,113.0337,0,0,0,0,100,0),
+(@PATH,4, 507.699,369.5598,113.0337,0,0,0,0,100,0);
+
+UPDATE `creature` SET `MovementType`=0, `spawndist`=0 WHERE `guid` IN (12804,12814,12791,12807,12815,12793);
+DELETE FROM `creature_formations` WHERE `leaderGUID` IN (12780,12782);
+INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
+(12780,12780,0, 0,1,0,0),
+(12780,12804,5, 30,1,3,1),
+(12780,12814,8, 45,1,3,1),
+(12780,12791,5,315,1,3,1),
+(12782,12782,0, 0,1,0,0),
+(12782,12807,5,290,1,1,3),
+(12782,12815,8,315,1,1,3),
+(12782,12793,5, 45,1,1,3);
diff --git a/sql/updates/world/3.3.5/2016_08_02_00_world.sql b/sql/updates/world/3.3.5/2016_08_02_00_world.sql
new file mode 100644
index 00000000000..a5fe8c29c3e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_08_02_00_world.sql
@@ -0,0 +1,82 @@
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`IN(25769,24730,25456,25457,25458);
+UPDATE `creature_template` SET `unit_flags`=33555200 WHERE `entry`=25769;
+UPDATE `creature_template` SET `unit_flags`=33587968 WHERE `entry`IN(25456,25457);
+UPDATE `creature_template` SET `unit_flags`=33555200 WHERE `entry`IN(25458);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(25769,24730,25456,25457,25458) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`IN(2574201,2473000,2545600,2545800) AND `source_type`=9;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(25769,24730) AND `source_type`=0;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` =25742 AND `source_type`=0 AND `id`=2;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(24730, 0, 0, 0, 20, 0, 100, 0, 11695, 0, 0, 0, 80, 2473000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wind Tamer Barah - On Quest Reward (The Horn of Elemental Fury) - Run Script'),
+(25769, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 45979, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Small Elemental - On Just Summoned - Cast Elemental Beam'),
+(25769, 0, 1, 2, 1, 0, 100, 1, 8000, 8000, 0, 0, 28, 45979, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Small Elemental - OOC (8 Sec) - Remove Aura'),
+(25769, 0, 2, 0, 61, 0, 100, 1, 0, 0, 0, 0, 90, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Small Elemental - OOC (8 Sec) - Set Bytes 1'),
+(25742, 0, 2, 0, 54, 0, 100, 1, 0, 0, 0, 0, 80, 2574201, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Alluvius - On Just Summoned - Run Script 2'),
+(2574201, 9, 0, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Alluvius - Script 2 - Play emote OneShotAttackUnarmed'),
+(2574201, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 24730, 0, 0, 0, 0, 0, 0, 'Alluvius - Script 2 - Say Line 0'),
+(2473000, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wind Tamer Barah - Script - Set NPC Flags'),
+(2473000, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 11, 43320, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wind Tamer Barah - Script - Cast Windwarden Channeling'),
+(2473000, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25771, 1, 12000, 0, 0, 0, 8, 0, 0, 0, 3526.857, 4215.892, 16.89778, 0.9599311, 'Wind Tamer Barah - Script - Summon Ice Elemental Target'),
+(2473000, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3526.76, 4208.782, 12.51583, 0.9599311, 'Wind Tamer Barah - Script - Summon Small Elemental'),
+(2473000, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3530.082, 4210.271, 12.5575, 1.029744, 'Wind Tamer Barah - Script - Summon Small Elemental'),
+(2473000, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3533.227, 4213.772, 12.55055, 2.80998, 'Wind Tamer Barah - Script - Summon Small Elemental'),
+(2473000, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3531.661, 4218.423, 12.57833, 0.9250245, 'Wind Tamer Barah - Script - Summon Small Elemental'),
+(2473000, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3528.847, 4221.306, 12.52278, 2.75762, 'Wind Tamer Barah - Script - Summon Small Elemental'),
+(2473000, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3524.509, 4220.787, 12.59916, 3.630285, 'Wind Tamer Barah - Script - Summon Small Elemental'),
+(2473000, 9, 9, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 12, 25742, 1, 7000, 0, 0, 0, 8, 0, 0, 0, 3526.815, 4215.751, 13.3075, 3.752458, 'Wind Tamer Barah - Script - Summon Alluvius'),
+(2473000, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 92,0, 43320, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wind Tamer Barah - Script - Remove Aura'),
+(2473000, 9, 11, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wind Tamer Barah - Script - Set NPC Flags'),
+(25458, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 53, 0, 25458, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - On Just Summoned - Start WP'),
+(25458, 0, 1, 0, 40, 0, 100, 0, 2, 25458, 0, 0, 80, 2545800, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - On Reached WP2 - Run Script'),
+(25457, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 11, 45581, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Magmoth Shaman - On Data Set - Cast Spirit Shackle'),
+(25456, 0, 0, 2, 54, 0, 100, 0, 0, 0, 0, 0, 53, 0, 25456, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Kaganishu - On Just Summoned - Start WP'),
+(25456, 0, 1, 0, 40, 0, 100, 0, 2, 25456, 0, 0, 80, 2545600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Kaganishu - On Reached WP2 - Run Script'),
+(25456, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 50, 187679, 14, 0, 0, 0, 0, 8, 0, 0, 0, 4528.167, 5678.6, 82.23339, 0.6283169, 'Vision of Kaganishu - On Just Summoned - Spawn Blue aura, short column, scale 6'),
+(2545600, 9, 0, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 11, 45595, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Kaganishu - Script - Cast Fireball'),
+(2545600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Kaganishu - Script - Say'),
+(2545800, 9, 0, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 9, 25457, 0, 40, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - Script - Set Data on Vision of Magmoth Shaman'), -- 21:09:47.563
+(2545800, 9, 1, 0, 0, 0, 100, 0, 500, 500, 0, 0, 17, 383, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - Script - Set Emote State'), -- 21:09:47.563
+(2545800, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 25339, 0, 0, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - Script - Say Line 0'), -- 21:09:44.297
+(2545800, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 45605, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - Script - Cast Vision of Air: Kill Credit'); -- 21:09:57.953
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`IN(45979,45581);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=30886 AND `source_type`=0 AND `id`=1;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(30886, 0, 1, 0, 54, 0, 100, 0, 0, 0, 0, 0, 29, 0, 0, 30232, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Subjugated Iskalder - Out of Combat - Start Follow Invoker');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=25742;
+
+DELETE FROM `creature_text` WHERE `entry`IN(24730,25339,25456);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `comment`) VALUES
+(24730, 0, 0, 'With the power of the horn, I bind you to its wielder''s will!', 12, 0, 100, 0, 0, 0, 24963, 'Wind Tamer Barah to Player'),
+(25339, 0, 0, 'Oh no... they''ve shackled his spirit!', 12, 1, 100, 5, 0, 0, 24683, 'Spirit Talker Snarlfang'),
+(25456, 0, 0, 'KAGANISHU!', 12, 0, 100, 0, 0, 0, 24658, 'Vision of Kaganishu');
+
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 45979, 0, 0, 31, 0, 3, 25771, 0, 0, 0, 0, '', 'Elemental Beam only targets Ice Elemental Target'),
+(13, 1, 45581, 0, 0, 31, 0, 3, 25458, 0, 0, 0, 0, '', 'Spirit Shackle only targets Vision of Farseer Grimwalkers Spirit'),
+(22, 1, 25742, 0, 0, 23, 1, 4037, 0, 0, 1, 0, 0, '', 'Alluvius - Only Run SAI if not summoned in Taunka le village'),
+(22, 4, 25742, 0, 0, 23, 1, 4037, 0, 0, 0, 0, 0, '', 'Alluvius - Only Run SAI if summoned in Taunka le village');
+
+
+DELETE FROM `waypoints` WHERE `entry`IN(25456,25458);
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(25456, 1, 4525.928, 5677.233, 81.70667, 'Vision of Kaganishu'),
+(25456, 2, 4527.502, 5678.359, 81.88042, 'Vision of Kaganishu'),
+(25458, 1, 4528.928, 5679.599, 81.99405, 'Vision of Farseer Grimwalkers Spirit'),
+(25458, 2, 4528.823, 5679.591, 83.10519, 'Vision of Farseer Grimwalkers Spirit');
+
+DELETE FROM `event_scripts` WHERE `id`=16716;
+INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES
+(16716, 5, 10, 25424, 16000, 0, 4529.002, 5679.642, 82.36562, 3.769911),
+(16716, 6, 10, 25457, 15000, 0, 4528.024, 5680.72, 82.29639, 5.497787),
+(16716, 6, 10, 25457, 15000, 0, 4530.323, 5680.649, 82.45662, 3.769911),
+(16716, 6, 10, 25457, 15000, 0, 4529.922, 5678.596, 82.38788, 2.286381),
+(16716, 7, 10, 25456, 14000, 0, 4525.962, 5677.239, 82.14642, 0.6290413),
+(16716, 12, 10,25458, 9000, 0, 4528.883, 5679.529, 82.23911, 0.6290413);
diff --git a/sql/updates/world/3.3.5/2016_08_03_00_world.sql b/sql/updates/world/3.3.5/2016_08_03_00_world.sql
new file mode 100644
index 00000000000..ee9a582d083
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_08_03_00_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `creature_addon` WHERE `guid`=84716;
diff --git a/sql/updates/world/3.3.5/2016_08_03_01_world.sql b/sql/updates/world/3.3.5/2016_08_03_01_world.sql
new file mode 100644
index 00000000000..e535f2e786f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_08_03_01_world.sql
@@ -0,0 +1,9 @@
+DELETE FROM `areatrigger_involvedrelation` WHERE `id`=4950;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=4950 AND `source_type`=2 AND `id`=1;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(4950, 2, 1, 0, 46, 0, 100, 0, 4950, 0, 0, 0, 15, 12036, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'On Trigger - Complete quest');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=4950 AND `SourceId`=2;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(22, 2, 4950, 2, 0, 9, 0, 12036, 0, 0, 0, 0, 0, '', 'Trigger - requires From the Depths of Azjol-Nerub');
diff --git a/sql/updates/world/3.3.5/2016_08_03_02_world.sql b/sql/updates/world/3.3.5/2016_08_03_02_world.sql
new file mode 100644
index 00000000000..0179449e6cc
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_08_03_02_world.sql
@@ -0,0 +1,303 @@
+SET @OGUID:=74772;
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+26;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
+(@OGUID+0 , 188691, 571, 1, 1, 4049.076, -3725.035, 222.8353, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) -- Vordrassil's Seed
+(@OGUID+1 , 188691, 571, 1, 1, 4001.214, -3765.898, 114.5079, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+2 , 188691, 571, 1, 1, 4039.253, -3717, 144.1972, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+3 , 188691, 571, 1, 1, 4060.134, -3802.432, 122.2398, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+4 , 188691, 571, 1, 1, 4034.984, -3799.606, 114.0969, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+5 , 188691, 571, 1, 1, 4089.661, -3676.995, 178.8947, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+6 , 188691, 571, 1, 1, 4111.052, -3677.905, 179.8427, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+7 , 188691, 571, 1, 1, 4127.012, -3665.212, 179.5133, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+8 , 188691, 571, 1, 1, 4184.179, -3762.825, 126.697, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+9 , 188691, 571, 1, 1, 4224.181, -3778.01, 183.52, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+10, 188691, 571, 1, 1, 4208.241, -3747.861, 124.9824, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+11, 188691, 571, 1, 1, 4209.658, -3755.583, 181.8647, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+12, 188691, 571, 1, 1, 4204.343, -3851.42, 181.1544, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+13, 188691, 571, 1, 1, 3890.3, -3731.524, 177.5446, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+14, 188691, 571, 1, 1, 3888.587, -3787.781, 181.266, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+15, 188691, 571, 1, 1, 3850.862, -3841.207, 178.9151, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+16, 188691, 571, 1, 1, 3865.623, -3868.439, 178.9035, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+17, 188691, 571, 1, 1, 3910.82, -3863.681, 179.8728, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+18, 188691, 571, 1, 1, 3882.307, -3897.07, 177.2399, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+19, 188691, 571, 1, 1, 3902.865, -3893.974, 177.7818, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+20, 188691, 571, 1, 1, 4198.049, -3876.462, 178.5676, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+21, 188691, 571, 1, 1, 4109.072, -3910.161, 174.2324, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+22, 188691, 571, 1, 1, 4198.53, -3916.613, 177.4275, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+23, 188691, 571, 1, 1, 4087.799, -3926.196, 175.3997, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+24, 188691, 571, 1, 1, 4018.979, -3980.839, 168.2293, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+25, 188691, 571, 1, 1, 4061.722, -3963.128, 168.4298, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395)
+(@OGUID+26, 188691, 571, 1, 1, 4006.32, -3979.95, 168.1229, 5.811947, 0, 0, 0, 1, 120, 255, 1); -- 188691 (Area: 395)
+
+SET @CGUID:=145573;
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+82;
+INSERT INTO `creature` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `curhealth`) VALUES
+(@CGUID+0 , 26357, 571, 3879.237, -3760.305, 176.7235, 2.193023, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) -- Frostpaw Warrior
+(@CGUID+1 , 26357, 571, 3869.679, -3756.928, 176.3351, 0.1116352, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+2 , 26357, 571, 3821.76, -3761.004, 173.5642, 0.3028143, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+3 , 26357, 571, 3877.058, -3859.821, 178.8136, 4.25889, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+4 , 26357, 571, 3878.248, -3861.027, 178.8644, 3.807764, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+5 , 26357, 571, 3864.086, -3845.099, 179.0016, 4.779684, 120, 10, 0), -- 26357 (Area: 395) (possible waypoints or random movement)
+(@CGUID+6 , 26357, 571, 3897.301, -3881.822, 179.0855, 0.1410686, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+7 , 26357, 571, 3971.117, -3830.09, 224.0997, 6.256703, 120, 10, 0), -- 26357 (Area: 395) (possible waypoints or random movement)
+(@CGUID+8 , 26357, 571, 3971, -3901.663, 190.3317, 2.752203, 120, 0, 0), -- 26357 (Area: 395)
+(@CGUID+9 , 26357, 571, 3977.379, -4022.655, 176.8455, 3.264833, 120, 0, 0), -- 26357 (Area: 395)
+(@CGUID+10, 26357, 571, 3982.721, -4016.198, 174.7489, 5.433867, 120, 0, 0), -- 26357 (Area: 395)
+(@CGUID+11, 26357, 571, 4045.729, -3912.388, 203.9128, 3.565682, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+12, 26357, 571, 4001.404, -4028.513, 175.833, 3.631839, 120, 0, 0), -- 26357 (Area: 395)
+(@CGUID+13, 26357, 571, 4096.433, -3906.757, 176.4102, 2.377615, 120, 10, 0), -- 26357 (Area: 395) (possible waypoints or random movement)
+(@CGUID+14, 26357, 571, 4080.8, -4039.988, 172.2695, 2.539905, 120, 0, 0), -- 26357 (Area: 395)
+(@CGUID+15, 26357, 571, 4198.01, -3910.091, 178.1277, 2.479687, 120, 0, 0), -- 26357 (Area: 395)
+(@CGUID+16, 26357, 571, 4145.057, -3789.465, 195.275, 1.812423, 120, 10, 0), -- 26357 (Area: 395) (possible waypoints or random movement)
+(@CGUID+17, 26357, 571, 4213.179, -3781.989, 182.7321, 6.008373, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+18, 26357, 571, 4170.634, -3704.126, 179.8536, 5.658669, 120, 0, 0), -- 26357 (Area: 395)
+(@CGUID+19, 26357, 571, 4073.11, -3775.6, 223.8053, 3.455384, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+20, 26357, 571, 4025.165, -3837.161, 222.9081, 4.105071, 120, 0, 0), -- 26357 (Area: 395)
+(@CGUID+21, 26357, 571, 3900.035, -3757.717, 172.328, 3.56418, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+22, 26357, 571, 3861.08, -3730.731, 174.6297, 0.8339269, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+23, 26357, 571, 3799.124, -3783.812, 178.2991, 3.918704, 120, 0, 0), -- 26357 (Area: 395) (Auras: )
+(@CGUID+24, 26357, 571, 3691.749, -3849.967, 183.1454, 5.951573, 120, 0, 0), -- 26357 (Area: 0)
+(@CGUID+25, 26357, 571, 3661.865, -3861.654, 191.6324, 0.541052, 120, 0, 0), -- 26357 (Area: 0)
+(@CGUID+26, 26357, 571, 3593.146, -3971.567, 199.1834, 1.53589, 120, 0, 0), -- 26357 (Area: 4215)
+(@CGUID+27, 26357, 571, 3497.097, -3657.63, 242.7636, 5.183628, 120, 0, 0), -- 26357 (Area: 4215)
+(@CGUID+28, 26357, 571, 3477.05, -3671.698, 242.31, 5.410521, 120, 0, 0), -- 26357 (Area: 4215)
+(@CGUID+29, 26357, 571, 3799.059, -3783.835, 178.3111, 3.915259, 120, 0, 0), -- 26357 (Area: 4215) (Auras: )
+(@CGUID+30, 26357, 571, 3796.123, -3822.649, 174.0334, 0.3137422, 120, 0, 0), -- 26357 (Area: 4215)
+(@CGUID+31, 26357, 571, 3820.662, -3751.43, 173.4701, 0.0339255, 120, 0, 0), -- 26357 (Area: 0) (Auras: )
+(@CGUID+32, 26357, 571, 3855.45, -3818.902, 179.0332, 1.499981, 120, 0, 0), -- 26357 (Area: 0)
+(@CGUID+33, 26356, 571, 4103.722, -3719.238, 213.3612, 2.808078, 120, 10, 0), -- 26356 (Area: 0) (Auras: ) (possible waypoints or random movement) -- Redfang Hunter
+(@CGUID+34, 26356, 571, 4026.025, -3729.962, 222.1561, 4.505303, 120, 10, 0), -- 26356 (Area: 395) (Auras: ) (possible waypoints or random movement)
+(@CGUID+35, 26356, 571, 4072.582, -3770.402, 223.6467, 4.213392, 120, 10, 0), -- 26356 (Area: 395) (Auras: ) (possible waypoints or random movement)
+(@CGUID+36, 26356, 571, 3892.886, -3768.199, 174.3011, 3.430619, 120, 10, 0), -- 26356 (Area: 395) (possible waypoints or random movement)
+(@CGUID+37, 26356, 571, 3905.209, -3759.375, 169.9874, 2.698826, 120, 10, 0), -- 26356 (Area: 395) (possible waypoints or random movement)
+(@CGUID+38, 26356, 571, 3873.323, -3756.52, 176.2863, 3.253347, 120, 0, 0), -- 26356 (Area: 395) (Auras: )
+(@CGUID+39, 26356, 571, 3876.145, -3755.855, 176.2065, 0.07042629, 120, 0, 0), -- 26356 (Area: 395) (Auras: )
+(@CGUID+40, 26356, 571, 3820.561, -3771.664, 173.4297, 5.888169, 120, 10, 0), -- 26356 (Area: 395) (Auras: ) (possible waypoints or random movement)
+(@CGUID+41, 26356, 571, 3818.421, -3750.936, 173.5778, 4.735462, 120, 10, 0), -- 26356 (Area: 395) (Auras: ) (possible waypoints or random movement)
+(@CGUID+42, 26356, 571, 3895.245, -3886.765, 178.4925, 5.070431, 120, 10, 0), -- 26356 (Area: 395) (Auras: ) (possible waypoints or random movement)
+(@CGUID+43, 26356, 571, 3930.054, -3910.088, 183.4956, 4.152149, 120, 10, 0), -- 26356 (Area: 395) (possible waypoints or random movement)
+(@CGUID+44, 26356, 571, 3875.366, -3863.293, 178.6655, 0.6662612, 120, 0, 0), -- 26356 (Area: 395)
+(@CGUID+45, 26356, 571, 3995.784, -3952.801, 171.0737, 4.834562, 120, 0, 0), -- 26356 (Area: 395)
+(@CGUID+46, 26356, 571, 3978.649, -3942.981, 170.1882, 4.223697, 120, 0, 0), -- 26356 (Area: 395)
+(@CGUID+47, 26356, 571, 4007.814, -3959.805, 172.7155, 5.529015, 120, 0, 0), -- 26356 (Area: 395) (Auras: )
+(@CGUID+48, 26356, 571, 4042.443, -3913.872, 203.2461, 0.0267967, 120, 0, 0), -- 26356 (Area: 395) (Auras: )
+(@CGUID+49, 26356, 571, 4176.536, -4007.584, 167.01, 1.487265, 120, 0, 0), -- 26356 (Area: 395)
+(@CGUID+50, 26356, 571, 4149.791, -4016.912, 166.9085, 0.7246146, 120, 0, 0), -- 26356 (Area: 395)
+(@CGUID+51, 26356, 571, 4216.706, -3782.983, 182.8609, 0.8818134, 120, 0, 0), -- 26356 (Area: 395) (Auras: )
+(@CGUID+52, 26356, 571, 4028.722, -3833.599, 222.7841, 3.872888, 120, 0, 0), -- 26356 (Area: 395)
+(@CGUID+53, 26356, 571, 3886.695, -3837.735, 179.1514, 4.593853, 120, 0, 0), -- 26356 (Area: 395) (Auras: )
+(@CGUID+54, 24042, 571, 3850.287, -3810.284, 178.9985, 3.682645, 120, 0, 0), -- 24042 (Area: 395) -- Generic Trigger LAB
+(@CGUID+55, 24042, 571, 3851.408, -3798.338, 185.194, 6.248279, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+56, 24042, 571, 3847.807, -3791.891, 185.1802, 4.817109, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+57, 24042, 571, 3840.402, -3799.909, 181.5622, 4.921828, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+58, 24042, 571, 3837.816, -3800.208, 178.2815, 2.234021, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+59, 24042, 571, 3827.984, -3809.152, 175.7139, 4.153883, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+60, 24042, 571, 3835.792, -3816.849, 177.7749, 2.426008, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+61, 24042, 571, 3909.943, -3885.461, 181.1191, 4.607669, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+62, 24042, 571, 3865.56, -3888.845, 177.7284, 1.884956, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+63, 24042, 571, 3871.915, -3875.688, 180.7031, 5.427974, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+64, 24042, 571, 3886.949, -3891.863, 178.0842, 0.6806784, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+65, 24042, 571, 3880.724, -3882.395, 178.8988, 0.418879, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+66, 24042, 571, 3901.444, -3902.951, 177.6381, 1.53589, 120, 0, 0), -- 24042 (Area: 395)
+(@CGUID+67, 26436, 571, 3874.801, -3792.651, 178.9906, 2.949606, 120, 10, 0), -- 26436 (Area: 395) (Auras: ) (possible waypoints or random movement) -- Redfang Elder
+(@CGUID+68, 26436, 571, 3822.412, -3779.1, 173.4248, 2.600541, 120, 10, 0), -- 26436 (Area: 395) (Auras: ) (possible waypoints or random movement)
+(@CGUID+69, 26436, 571, 4084.101, -4017.483, 170.1538, 2.368356, 120, 0, 0), -- 26436 (Area: 395) (Auras: )
+(@CGUID+70, 26428, 571, 3807.165, -3809.847, 173.2943, 0.7853982, 120, 0, 0), -- 26428 (Area: 395) -- Frostpaw Shaman
+(@CGUID+71, 26428, 571, 3762.819, -3785.132, 187.2933, 6.230825, 120, 0, 0), -- 26428 (Area: 395)
+(@CGUID+72, 26428, 571, 3785.312, -3870.198, 179.0041, 0.6283185, 120, 0, 0), -- 26428 (Area: 395)
+(@CGUID+73, 26428, 571, 4068.647, -3811.453, 223.3654, 2.653818, 120, 0, 0), -- 26428 (Area: 395)
+(@CGUID+74, 26428, 571, 3670.685, -3835.09, 190.7745, 5.272768, 120, 10, 0), -- 26428 (Area: 0) (possible waypoints or random movement)
+(@CGUID+75, 26357, 571, 3638.573, -3958.29, 184.6026, 0.6283185, 120, 0, 0), -- 26357 (Area: 0) -- Frostpaw Warrior
+(@CGUID+76, 26434, 571, 3794.211, -3796.299, 177.9795, 6.195919, 120, 0, 0), -- 26434 (Area: 395) -- Frostpaw Trapper
+(@CGUID+77, 26434, 571, 3792.02, -3823.878, 174.353, 0.3316126, 120, 0, 0), -- 26434 (Area: 395)
+(@CGUID+78, 26434, 571, 3787.88, -3778.618, 180.399, 5.916666, 120, 0, 0), -- 26434 (Area: 395)
+(@CGUID+79, 26434, 571, 3822.915, -3883.725, 177.7764, 0.1570796, 120, 0, 0), -- 26434 (Area: 395)
+(@CGUID+80, 26434, 571, 3831.866, -3931.298, 180.3725, 0.8028514, 120, 0, 0), -- 26434 (Area: 395)
+(@CGUID+81, 26434, 571, 3854.642, -3941.627, 182.1573, 1.186824, 120, 0, 0), -- 26434 (Area: 395)
+(@CGUID+82, 26434, 571, 3868.795, -3952.046, 180.4138, 1.37881, 120, 0, 0); -- 26434 (Area: 395)
+
+-- Update spawn distance & movementype so they move around randomly
+UPDATE `creature` SET `spawndist`=5, `MovementType`=1 WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+26;
+UPDATE `creature` SET `spawndist`=5, `MovementType`=1 WHERE `guid` BETWEEN @CGUID+29 AND @CGUID+53;
+UPDATE `creature` SET `spawndist`=5, `MovementType`=1 WHERE `guid` BETWEEN @CGUID+67 AND @CGUID+82;
+
+-- Pathing for Frostpaw Shaman Entry: 26428 'TDB FORMAT'
+SET @NPC := 101659;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3588.338,`position_y`=-3912.43,`position_z`=196.6769 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3588.338,-3912.43,196.6769,0,0,0,0,100,0), -- 09:55:20
+(@PATH,2,3588.173,-3912.414,196.4898,0,0,0,0,100,0), -- 09:55:26
+(@PATH,3,3580.502,-3912.278,197.8292,0,0,0,0,100,0), -- 09:55:29
+(@PATH,4,3569.688,-3912.361,199.2898,0,0,0,0,100,0), -- 09:55:34
+(@PATH,5,3568.212,-3912.104,199.2802,0,0,0,0,100,0), -- 09:55:41
+(@PATH,6,3562.38,-3906.169,199.7104,0,0,0,0,100,0), -- 09:55:46
+(@PATH,7,3560.485,-3895.428,200.3166,0,0,0,0,100,0), -- 09:55:51
+(@PATH,8,3539.613,-3890.547,205.4668,0,0,0,0,100,0), -- 09:55:54
+(@PATH,9,3528.841,-3882.14,208.4974,0,0,0,0,100,0), -- 09:56:08
+(@PATH,10,3524.06,-3863.459,214.6403,0,0,0,0,100,0), -- 09:56:16
+(@PATH,11,3525.18,-3848.973,217.9511,0,0,0,0,100,0), -- 09:56:28
+(@PATH,12,3528.96,-3837.769,220.407,0,0,0,0,100,0), -- 09:56:37
+(@PATH,13,3530.571,-3804.345,224.4586,0,0,0,0,100,0), -- 09:56:47
+(@PATH,14,3527.41,-3780.331,225.1916,0,0,0,0,100,0), -- 09:57:06
+(@PATH,15,3525.282,-3756.282,228.4059,0,0,0,0,100,0), -- 09:57:20
+(@PATH,16,3510.197,-3744.293,230.4912,0,0,0,0,100,0), -- 09:57:34
+(@PATH,17,3500.498,-3732.984,231.0331,0,0,0,0,100,0), -- 09:57:47
+(@PATH,18,3494.976,-3718.273,232.0333,0,0,0,0,100,0), -- 09:57:57
+(@PATH,19,3494.382,-3715.592,232.0598,0,0,0,0,100,0), -- 09:58:05
+(@PATH,20,3495.405,-3699.1,231.7552,0,0,0,0,100,0), -- 09:58:15
+(@PATH,21,3501.611,-3689.164,231.9368,0,0,0,0,100,0), -- 09:58:22
+(@PATH,22,3511.642,-3684.653,231.8804,0,0,0,0,100,0), -- 09:58:28
+(@PATH,23,3525.416,-3684.77,231.6663,0,0,0,0,100,0), -- 09:58:37
+(@PATH,24,3525.127,-3684.767,231.6062,0,0,0,0,100,0), -- 09:58:46
+(@PATH,25,3525.148,-3684.727,231.8664,0,0,0,0,100,0), -- 09:58:53
+(@PATH,26,3511.393,-3684.857,231.6934,0,0,0,0,100,0), -- 09:59:01
+(@PATH,27,3501.216,-3689.363,231.9671,0,0,0,0,100,0), -- 09:59:07
+(@PATH,28,3495.221,-3699.442,231.8276,0,0,0,0,100,0), -- 09:59:15
+(@PATH,29,3497.122,-3726.3,231.5606,0,0,0,0,100,0), -- 09:59:24
+(@PATH,30,3504.481,-3738.602,230.8245,0,0,0,0,100,0), -- 09:59:34
+(@PATH,31,3510.197,-3744.293,230.4912,0,0,0,0,100,0), -- 09:57:34
+(@PATH,32,3524.331,-3754.838,228.9258,0,0,0,0,100,0), -- 09:59:43
+(@PATH,33,3526.505,-3775.408,225.6859,0,0,0,0,100,0), -- 09:59:56
+(@PATH,34,3530.599,-3800.592,224.8364,0,0,0,0,100,0), -- 10:00:09
+(@PATH,35,3530.5,-3830.635,221.5797,0,0,0,0,100,0), -- 10:00:24
+(@PATH,36,3526.106,-3846.375,219.0367,0,0,0,0,100,0), -- 10:00:43
+(@PATH,37,3524.411,-3859.844,215.7675,0,0,0,0,100,0), -- 10:00:52
+(@PATH,38,3527.364,-3880.439,209.3438,0,0,0,0,100,0), -- 10:01:01
+(@PATH,39,3538.28,-3889.869,205.931,0,0,0,0,100,0), -- 10:01:12
+(@PATH,40,3558.303,-3894.219,200.8895,0,0,0,0,100,0), -- 10:01:22
+(@PATH,41,3560.166,-3894.849,200.1797,0,0,0,0,100,0), -- 10:01:35
+(@PATH,42,3562.815,-3898.638,199.7,0,0,0,0,100,0), -- 10:01:38
+(@PATH,43,3562.38,-3906.169,199.7104,0,0,0,0,100,0), -- 09:55:46
+(@PATH,44,3567.723,-3911.692,199.3717,0,0,0,0,100,0), -- 10:01:43
+(@PATH,45,3578.139,-3912.183,198.1925,0,0,0,0,100,0), -- 10:01:48
+(@PATH,46,3583.498,-3912.365,197.4213,0,0,0,0,100,0), -- 10:01:55
+(@PATH,47,3588.46,-3912.435,196.6265,0,0,0,0,100,0); -- 10:02:00
+-- 0x203930476019CF0000030D00000C69EF .go 3588.338 -3912.43 196.6769
+
+-- Pathing for Frostpaw Shaman Entry: 26428 'TDB FORMAT'
+SET @NPC := 101658;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3633.149,`position_y`=-3857.641,`position_z`=191.463 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3633.149,-3857.641,191.463,0,0,0,0,100,0), -- 09:51:31
+(@PATH,2,3633.018,-3857.819,191.1933,0,0,0,0,100,0), -- 09:51:41
+(@PATH,3,3631.676,-3872.631,190.7729,0,0,0,0,100,0), -- 09:51:49
+(@PATH,4,3631.376,-3874.811,190.6524,0,0,0,0,100,0), -- 09:51:59
+(@PATH,5,3625.465,-3884.832,190.824,0,0,0,0,100,0), -- 09:53:09
+(@PATH,6,3624.28,-3885.842,191.2049,0,0,0,0,100,0), -- 09:52:57
+(@PATH,7,3613.153,-3893.728,193.0957,0,0,0,0,100,0), -- 09:52:06
+(@PATH,8,3606.48,-3897.225,194.7092,0,0,0,0,100,0), -- 09:52:50
+(@PATH,9,3601.187,-3898.144,195.6989,0,0,0,0,100,0), -- 09:52:18
+(@PATH,10,3596.7,-3899.317,196.3635,0,0,0,0,100,0), -- 09:52:27
+(@PATH,11,3591.105,-3897.377,196.9956,0,0,0,0,100,0), -- 09:52:46
+(@PATH,12,3587.069,-3893.888,197.4965,0,0,0,0,100,0), -- 09:52:30
+(@PATH,13,3588.063,-3894.848,197.3372,0,0,0,0,100,0), -- 09:52:39
+(@PATH,14,3591.105,-3897.377,196.9956,0,0,0,0,100,0), -- 09:52:46
+(@PATH,15,3596.7,-3899.317,196.3635,0,0,0,0,100,0), -- 09:52:27
+(@PATH,16,3601.187,-3898.144,195.6989,0,0,0,0,100,0), -- 09:52:18
+(@PATH,17,3606.48,-3897.225,194.7092,0,0,0,0,100,0), -- 09:52:50
+(@PATH,18,3613.153,-3893.728,193.0957,0,0,0,0,100,0), -- 09:52:06
+(@PATH,19,3624.28,-3885.842,191.2049,0,0,0,0,100,0), -- 09:52:57
+(@PATH,20,3625.465,-3884.832,190.824,0,0,0,0,100,0), -- 09:53:09
+(@PATH,21,3631.376,-3874.811,190.6524,0,0,0,0,100,0), -- 09:51:59
+(@PATH,22,3631.676,-3872.631,190.7729,0,0,0,0,100,0), -- 09:51:49
+(@PATH,23,3632.195,-3866.898,191.0448,0,0,0,0,100,0), -- 09:53:17
+(@PATH,24,3633.313,-3857.507,191.4412,0,0,0,0,100,0); -- 09:53:26
+-- 0x203930476019CF0000030D00000C6A80 .go 3633.149 -3857.641 191.463
+
+-- Pathing for Frostpaw Shaman Entry: 26428 'TDB FORMAT'
+SET @NPC := 145647;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3648.541,`position_y`=-3814.498,`position_z`=190.925 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3648.541,-3814.498,190.925,0,0,0,0,100,0), -- 09:52:02
+(@PATH,2,3652.493,-3822.352,191.1677,0,0,0,0,100,0), -- 09:52:12
+(@PATH,3,3671.021,-3835.209,191.0056,0,0,0,0,100,0), -- 09:52:32
+(@PATH,4,3675.492,-3846.821,191.0968,0,0,0,0,100,0), -- 09:52:39
+(@PATH,5,3676.12,-3845.173,191.1244,0,0,0,0,100,0), -- 09:52:51
+(@PATH,6,3672.284,-3837.276,190.8509,0,0,0,0,100,0), -- 09:53:02
+(@PATH,7,3670.633,-3834.835,190.8977,0,0,0,0,100,0), -- 09:53:08
+(@PATH,8,3652.493,-3822.352,191.1677,0,0,0,0,100,0), -- 09:52:12
+(@PATH,9,3648.31,-3814.437,190.9192,0,0,0,0,100,0); -- 09:53:21
+-- 0x203930476019CF000002D600008C3941 .go 3648.541 -3814.498 190.925
+
+-- Pathing for Frostpaw Warrior Entry: 26357 'TDB FORMAT'
+SET @NPC := 145580;
+SET @PATH := @NPC * 10;
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3985.092,`position_y`=-3842.579,`position_z`=223.7648 WHERE `guid`=@NPC;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3985.092,-3842.579,223.7648,0,0,0,0,100,0), -- 09:46:46
+(@PATH,2,3983.845,-3838.281,223.705,0,0,0,0,100,0), -- 09:46:48
+(@PATH,3,3982.509,-3835.532,224.0413,0,0,0,0,100,0), -- 09:46:49
+(@PATH,4,3970.937,-3830.248,224.1597,0,0,0,0,100,0), -- 09:46:50
+(@PATH,5,3963.993,-3831.297,224.1532,0,0,0,0,100,0), -- 09:46:55
+(@PATH,6,3963.007,-3831.464,224.1532,0,0,0,0,100,0), -- 09:46:55
+(@PATH,7,3968.315,-3830.015,224.1386,0,0,0,0,100,0), -- 09:46:55
+(@PATH,8,3970.55,-3830.074,224.0992,0,0,0,0,100,0), -- 09:46:55
+(@PATH,9,3976.947,-3830.244,224.1054,0,0,0,0,100,0), -- 09:46:55
+(@PATH,10,3986.181,-3833.333,224.1631,0,0,0,0,100,0), -- 09:46:56
+(@PATH,11,3985.167,-3842.387,223.7295,0,0,0,0,100,0); -- 09:46:57
+-- 0x203930476019BD400002D600018C3943 .go 3985.092 -3842.579 223.7648
+
+-- Frostpaw Shaman SAI
+SET @ENTRY := 26428;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,1,0,100,1,0,0,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Out of Combat - Enable Combat Movement (No Repeat)"),
+(@ENTRY,0,2,3,4,0,100,1,0,0,0,0,11,12058,0,0,0,0,0,2,0,0,0,0,0,0,0,"Frostpaw Shaman - On Aggro - Cast 'Chain Lightning' (No Repeat)"),
+(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - On Aggro - Increment Phase By 1 (No Repeat)"),
+(@ENTRY,0,4,0,9,2,100,0,0,30,6000,7000,11,12058,0,0,0,0,0,2,0,0,0,0,0,0,0,"Frostpaw Shaman - Within 0-30 Range - Cast 'Chain Lightning' (No Repeat)"),
+(@ENTRY,0,5,6,3,2,100,1,0,7,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Between 0-7% Mana - Enable Combat Movement (Phase 2) (No Repeat)"),
+(@ENTRY,0,6,0,61,2,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Between 0-7% Mana - Increment Phase By 1 (Phase 2) (No Repeat)"),
+(@ENTRY,0,7,0,9,2,100,1,25,80,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Within 25-80 Range - Enable Combat Movement (Phase 2) (No Repeat)"),
+(@ENTRY,0,8,0,9,2,100,1,5,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Within 5-15 Range - Disable Combat Movement (Phase 2) (No Repeat)"),
+(@ENTRY,0,9,0,9,2,100,1,0,5,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Within 0-5 Range - Enable Combat Movement (Phase 2) (No Repeat)"),
+(@ENTRY,0,10,0,3,2,100,0,15,100,100,100,23,0,1,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Between 15-100% Mana - Decrement Phase By 1 (Phase 2) (No Repeat)"),
+(@ENTRY,0,11,0,14,0,100,0,2000,40,15000,20000,11,25420,1,0,0,0,0,7,0,0,0,0,0,0,0,"Frostpaw Shaman - Friendly At 2000 Health - Cast 'Lesser Healing Wave' (Phase 2) (No Repeat)"),
+(@ENTRY,0,12,0,6,0,100,1,0,0,0,0,11,47033,39,0,0,0,0,2,0,0,0,0,0,0,0,"Frostpaw Shaman - On Just Died - Cast 'Redfang Ally' (Phase 2) (No Repeat)");
+
+-- Redfang Hunter SAI
+SET @ENTRY := 26356;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,1,1,0,100,1,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Out of Combat - Enable Combat Movement (No Repeat)"),
+(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Out of Combat - Stop Attacking (No Repeat)"),
+(@ENTRY,0,2,3,4,0,100,1,0,0,0,0,11,6660,0,0,0,0,0,2,0,0,0,0,0,0,0,"Redfang Hunter - On Aggro - Cast 'Shoot' (No Repeat)"),
+(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - On Aggro - Increment Phase (No Repeat)"),
+(@ENTRY,0,4,5,9,1,100,0,5,30,2300,3900,11,6660,0,0,0,0,0,2,0,0,0,0,0,0,0,"Redfang Hunter - Within 5-30 Range - Cast 'Shoot' (Phase 1)"),
+(@ENTRY,0,5,0,61,1,100,0,5,30,2300,3900,40,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 5-30 Range - Set Sheath Ranged (Phase 1)"),
+(@ENTRY,0,6,7,9,1,100,0,25,80,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 25-80 Range - Enable Combat Movement (Phase 1)"),
+(@ENTRY,0,7,0,61,1,100,0,25,80,0,0,20,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 25-80 Range - Start Attacking (Phase 1)"),
+(@ENTRY,0,8,9,9,1,100,0,0,5,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 0-5 Range - Enable Combat Movement (Phase 1)"),
+(@ENTRY,0,9,10,61,1,100,0,0,5,0,0,40,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 0-5 Range - Set Sheath Melee (Phase 1)"),
+(@ENTRY,0,10,0,61,1,100,0,0,5,0,0,20,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 0-5 Range - Start Attacking (Phase 1)"),
+(@ENTRY,0,11,12,9,1,100,0,5,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 5-15 Range - Disable Combat Movement (Phase 1)"),
+(@ENTRY,0,12,0,61,1,100,0,5,15,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 5-15 Range - Stop Attacking (Phase 1)"),
+(@ENTRY,0,13,0,9,0,100,0,0,20,11000,16000,11,12024,1,0,0,0,0,2,0,0,0,0,0,0,0,"Redfang Hunter - Within 0-20 Range - Cast 'Net'"),
+(@ENTRY,0,14,0,9,0,100,0,0,5,4000,7000,11,30639,0,0,0,0,0,2,0,0,0,0,0,0,0,"Redfang Hunter - Within 0-5 Range - Cast 'Carnivorous Bite'"),
+(@ENTRY,0,15,0,7,0,100,1,0,0,0,0,40,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - On Evade - Set Sheath Melee (No Repeat)"),
+(@ENTRY,0,16,0,6,0,100,1,0,0,0,0,11,47034,39,0,0,0,0,2,0,0,0,0,0,0,0,"Redfang Hunter - On Just Died - Cast 'Frostpaw Ally' (No Repeat)");
+
+-- Generic Trigger LAB SAI
+SET @ENTRY := 24042;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,1,38,0,100,0,1,1,0,0,11,60484,0,0,0,0,0,1,0,0,0,0,0,0,0,"Generic Trigger LAB - On Data Set 1 1 - Cast 'Heart Explosion'"),
+(@ENTRY,0,1,0,61,0,100,0,1,1,0,0,11,60532,0,0,0,0,0,1,0,0,0,0,0,0,0,"Generic Trigger LAB - On Data Set 1 1 - Cast 'Heart Explosion Effects'"),
+(@ENTRY,0,2,1,38,0,100,0,2,1,0,0,11,42532,0,0,0,0,0,1,0,0,0,0,0,0,0,"Generic Trigger LAB - On Data Set 2 1 - Cast 'Explosion'");
diff --git a/sql/updates/world/3.3.5/2016_08_04_00_world_335.sql b/sql/updates/world/3.3.5/2016_08_04_00_world_335.sql
new file mode 100644
index 00000000000..09f5768c7a1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_08_04_00_world_335.sql
@@ -0,0 +1,63 @@
+-- NPC ID 9021 Kharan Mighthammer, Quest ID 4001 'What Is Going On?' and 4342 'Kharan's Tale'
+SET @Kharan := 9021;
+
+UPDATE `creature_template` SET `AIName`= 'SmartAI', `ScriptName`= '' WHERE `entry` = @Kharan;
+
+DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = @Kharan);
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@Kharan,0,0,0, 10,0,100,0, 0,20,0,0, 1, 0,3000,0,0,0,0,7,0,0,0,0,0,0,0,'Kharan Mighthammer - Within 0-20 Range Out of Combat LoS - Say Line 0'),
+(@Kharan,0,1,2, 62,0,100,0,1823, 0,0,0, 72, 0, 0,0,0,0,0,7,0,0,0,0,0,0,0,'Kharan Mighthammer - on Gossip option 0 selected - Close Gossip'),
+(@Kharan,0,2,0, 61,0,100,0, 0, 0,0,0, 15,4342, 0,0,0,0,0,7,0,0,0,0,0,0,0,"Kharan Mighthammer - on Gossip option 0 selected - Quest Credit 'Kharan's Tale'"),
+(@Kharan,0,3,4, 62,0,100,0,1839, 0,0,0, 72, 0, 0,0,0,0,0,7,0,0,0,0,0,0,0,'Kharan Mighthammer - on Gossip option 0 selected - Close Gossip'),
+(@Kharan,0,4,0, 61,0,100,0, 0, 0,0,0, 15,4001, 0,0,0,0,0,7,0,0,0,0,0,0,0,"Kharan Mighthammer - on Gossip option 0 selected - Credit Quest 'What Is Going On?'");
+
+DELETE FROM `creature_text` WHERE `entry` = @Kharan;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
+(@Kharan,0,0,'Key... get the key... Gerstahn has... key.', 12,0,100,0,0,0,4723,0,'Kharan Mighthammer'),
+(@Kharan,0,1,'Try and make yourself useful, $r. GET ME OUT OF HERE! The High Interrogator has the key.',12,0,100,0,0,0,4724,0,'Kharan Mighthammer'),
+(@Kharan,0,2,'HEY! HEY YOU! $R! Get me out of here!', 12,0,100,0,0,0,4725,0,'Kharan Mighthammer'),
+(@Kharan,0,3,'%s groans.', 16,0,100,0,0,0,4726,0,'Kharan Mighthammer');
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 1821 AND 1839;
+INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
+(1822,0,0,"All is not lost, Kharan!", 4734,1,1,1828,0,0,0,'',0),
+(1828,1,0,"Continue...", 5256,1,1,1827,0,0,0,'',0),
+(1827,0,0,"So what happened?", 4742,1,1,1826,0,0,0,'',0),
+(1826,0,0,"So you suspect that someone on the inside was involved? That they were tipped off?", 4744,1,1,1825,0,0,0,'',0),
+(1825,0,0,"Continue with your story please.", 4746,1,1,1824,0,0,0,'',0),
+(1824,0,0,"Indeed.", 4748,1,1,1823,0,0,0,'',0),
+(1823,0,0,"The door is open, Kharan. You are a free man.", 5257,1,1, 0,0,0,0,'',0),
+(1822,1,0,"I am not here to harm you, Kharan. Gor'shak sent me. He told me that you would speak to me about the Princess.", 4732,1,1,1831,0,0,0,'',0),
+(1831,0,0,"All is not lost, Kharan!", 4734,1,1,1832,0,0,0,'',0),
+(1832,0,0,"Because you are still alive and my hands aren't gripped firmly around your stubby little neck.", 4736,1,1,1833,0,0,0,'',0),
+(1833,0,0,"Nothing. My orders were to speak with you and then speak with Thrall. All I know is that Thrall is interested in saving your princess.",4738,1,1,1834,0,0,0,'',0),
+(1834,0,0,"Which would explain why you're sitting in a jail cell at the bottom of a mountain, right, dwarf?", 4740,1,1,1835,0,0,0,'',0),
+(1835,0,0,"So what happened?", 4742,1,1,1836,0,0,0,'',0),
+(1836,0,0,"So you suspect that someone on the inside was involved? That they were tipped off?", 4744,1,1,1837,0,0,0,'',0),
+(1837,0,0,"Continue with your story please.", 4746,1,1,1838,0,0,0,'',0),
+(1838,0,0,"Indeed.", 4748,1,1,1839,0,0,0,'',0),
+(1839,0,0,"If it's any consolation, I'll be leaving the cell door open. How you get out is your problem. Good bye, Kharan.", 4750,1,1, 0,0,0,0,'',0);
+
+DELETE FROM `gossip_menu` WHERE `entry`= 1822 AND `text_id`= 2473 OR `entry` BETWEEN 1831 AND 1839;
+INSERT INTO `gossip_menu` (`entry`,`text_id`,`VerifiedBuild`) VALUES
+(1822, 2473, 0),
+(1831, 2474, 0),
+(1832, 2475, 0),
+(1833, 2476, 0),
+(1834, 2477, 0),
+(1835, 2478, 0),
+(1836, 2479, 0),
+(1837, 2480, 0),
+(1838, 2481, 0),
+(1839, 2482, 0);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`= 1822 AND `SourceEntry` IN (0,1,2473,2474) AND `SourceId`= 0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(14,1822,2473,0,1, 9,0,4001,0,0,0,0,0,'', "Show gossip menu 1822 text id 2473 if quest 'What Is Going On?' has been taken. -OR-"),
+(14,1822,2474,0,2,14,0,4001,0,0,0,0,0,'', "Show gossip menu 1822 text id 2474 if quest 'What Is Going On?' has not been taken. -OR-"),
+(14,1822,2474,0,3,28,0,4001,0,0,0,0,0,'', "Show gossip menu 1822 text id 2474 if quest 'What Is Going On?' has been completed. -OR-"),
+(15,1822, 1,0,0, 9,0,4001,0,0,0,0,0,'', "Show gossip menu 1822 option id 1 if quest 'What Is Going On?' has been taken."),
+(14,1822,2474,0,4, 9,0,4342,0,0,0,0,0,'', "Show gossip menu 1822 text id 2474 if quest 'Kharan's Tale' has been taken. -OR-"),
+(14,1822,2474,0,5,14,0,4342,0,0,0,0,0,'', "Show gossip menu 1822 text id 2474 if quest 'Kharan's Tale' has not been taken. -OR-"),
+(14,1822,2474,0,6,28,0,4342,0,0,0,0,0,'', "Show gossip menu 1822 text id 2474 if quest 'Kharan's Tale' has been completed. -OR-"),
+(15,1822, 0,0,0, 9,0,4342,0,0,0,0,0,'', "Show gossip menu 1822 option id 0 if quest 'Kharan's Tale' has been taken.");
diff --git a/sql/updates/world/2016_02_12_13_world_335.sql b/sql/updates/world/3.3.5/2016_08_04_01_world.sql
index 4871f6de86a..4871f6de86a 100644
--- a/sql/updates/world/2016_02_12_13_world_335.sql
+++ b/sql/updates/world/3.3.5/2016_08_04_01_world.sql
diff --git a/sql/updates/world/3.3.5/dummy b/sql/updates/world/3.3.5/dummy
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/sql/updates/world/3.3.5/dummy
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 8dee99c65e7..0428738f2dd 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -8,42 +8,33 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-if( USE_COREPCH )
- include_directories(${CMAKE_CURRENT_BINARY_DIR})
-endif()
-
-file(GLOB_RECURSE sources_Common Common.cpp Common.h)
-file(GLOB_RECURSE sources_Collision Collision/*.cpp Collision/*.h)
-file(GLOB_RECURSE sources_Threading Threading/*.cpp Threading/*.h)
-file(GLOB_RECURSE sources_Utilities Utilities/*.cpp Utilities/*.h)
-file(GLOB_RECURSE sources_Configuration Configuration/*.cpp Configuration/*.h)
-file(GLOB_RECURSE sources_Logging Logging/*.cpp Logging/*.h)
-if (SERVERS)
- file(GLOB_RECURSE sources_Cryptography Cryptography/*.cpp Cryptography/*.h)
-endif (SERVERS)
+CollectSourceFiles(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE_SOURCES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/Debugging
+ ${CMAKE_CURRENT_SOURCE_DIR}/Platform
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
# Manually set sources for Debugging directory as we don't want to include WheatyExceptionReport in common project
# It needs to be included both in authserver and worldserver for the static global variable to be properly initialized
# and to handle crash logs on windows
-set(sources_Debugging Debugging/Errors.cpp Debugging/Errors.h)
-file(GLOB sources_localdir *.cpp *.h)
+list(APPEND PRIVATE_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/Debugging/Errors.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Debugging/Errors.h)
if (USE_COREPCH)
- set(common_STAT_PCH_HDR PrecompiledHeaders/commonPCH.h)
- set(common_STAT_PCH_SRC PrecompiledHeaders/commonPCH.cpp)
+ set(PRIVATE_PCH_HEADER PrecompiledHeaders/commonPCH.h)
+ set(PRIVATE_PCH_SOURCE PrecompiledHeaders/commonPCH.cpp)
endif (USE_COREPCH)
-set(common_STAT_SRCS
- ${common_STAT_SRCS}
- ${sources_Common}
- ${sources_Collision}
- ${sources_Threading}
- ${sources_Utilities}
- ${sources_Debugging}
- ${sources_Configuration}
- ${sources_Logging}
- ${sources_Cryptography}
- ${sources_localdir}
+GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
+
+add_definitions(-DTRINITY_API_EXPORT_COMMON)
+
+add_library(common
+ ${PRIVATE_PCH_SOURCE}
+ ${PRIVATE_SOURCES}
)
# Do NOT add any extra include directory here, as we don't want the common
@@ -55,37 +46,55 @@ set(common_STAT_SRCS
# linkage (enums, defines...) it is discouraged to do so unless necessary, as it will pullute
# include_directories leading to further unnoticed dependency aditions
# Linker Depencency requirements: none
-include_directories(
- ${CMAKE_BINARY_DIR}
+CollectIncludeDirectories(
${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/Collision
- ${CMAKE_CURRENT_SOURCE_DIR}/Collision/Management
- ${CMAKE_CURRENT_SOURCE_DIR}/Collision/Maps
- ${CMAKE_CURRENT_SOURCE_DIR}/Collision/Models
- ${CMAKE_CURRENT_SOURCE_DIR}/Configuration
- ${CMAKE_CURRENT_SOURCE_DIR}/Cryptography
- ${CMAKE_CURRENT_SOURCE_DIR}/Debugging
- ${CMAKE_CURRENT_SOURCE_DIR}/Logging
- ${CMAKE_CURRENT_SOURCE_DIR}/Utilities
- ${CMAKE_SOURCE_DIR}/dep/cppformat
- ${CMAKE_SOURCE_DIR}/dep/g3dlite/include
- ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour/Include
- ${CMAKE_SOURCE_DIR}/dep/SFMT
- ${CMAKE_SOURCE_DIR}/dep/utf8cpp
- ${OPENSSL_INCLUDE_DIR}
- ${VALGRIND_INCLUDE_DIR}
-)
+ PUBLIC_INCLUDES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
-GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
+target_include_directories(common
+ PUBLIC
+ # Provide the binary dir for all child targets
+ ${CMAKE_BINARY_DIR}
+ ${PUBLIC_INCLUDES}
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR})
-add_library(common STATIC
- ${common_STAT_SRCS}
- ${common_STAT_PCH_SRC}
-)
+target_link_libraries(common
+ PUBLIC
+ boost
+ cppformat
+ g3dlib
+ Detour
+ sfmt
+ utf8cpp
+ openssl
+ valgrind
+ threads
+ jemalloc
+ PRIVATE
+ process)
add_dependencies(common revision_data.h)
+set_target_properties(common
+ PROPERTIES
+ FOLDER
+ "server")
+
+if( BUILD_SHARED_LIBS )
+ if( UNIX )
+ install(TARGETS common
+ LIBRARY
+ DESTINATION lib)
+ elseif( WIN32 )
+ install(TARGETS common
+ RUNTIME
+ DESTINATION "${CMAKE_INSTALL_PREFIX}")
+ endif()
+endif()
+
# Generate precompiled header
if (USE_COREPCH)
- add_cxx_pch(common ${common_STAT_PCH_HDR} ${common_STAT_PCH_SRC})
+ add_cxx_pch(common ${PRIVATE_PCH_HEADER} ${PRIVATE_PCH_SOURCE})
endif ()
diff --git a/src/common/Collision/BoundingIntervalHierarchy.h b/src/common/Collision/BoundingIntervalHierarchy.h
index 0b15bd2d92f..d84ee3f6bf3 100644
--- a/src/common/Collision/BoundingIntervalHierarchy.h
+++ b/src/common/Collision/BoundingIntervalHierarchy.h
@@ -67,7 +67,7 @@ struct AABound
Copyright (c) 2003-2007 Christopher Kulla
*/
-class BIH
+class TC_COMMON_API BIH
{
private:
void init_empty()
@@ -91,7 +91,7 @@ class BIH
buildData dat;
dat.maxPrims = leafSize;
- dat.numPrims = primitives.size();
+ dat.numPrims = uint32(primitives.size());
dat.indices = new uint32[dat.numPrims];
dat.primBound = new G3D::AABox[dat.numPrims];
getBounds(primitives[0], bounds);
@@ -115,7 +115,7 @@ class BIH
delete[] dat.primBound;
delete[] dat.indices;
}
- uint32 primCount() const { return objects.size(); }
+ uint32 primCount() const { return uint32(objects.size()); }
template<typename RayCallback>
void intersectRay(const G3D::Ray &r, RayCallback& intersectCallback, float &maxDist, bool stopAtFirst=false) const
diff --git a/src/common/Collision/DynamicTree.cpp b/src/common/Collision/DynamicTree.cpp
index 5d2e18b1a2e..111606644de 100644
--- a/src/common/Collision/DynamicTree.cpp
+++ b/src/common/Collision/DynamicTree.cpp
@@ -248,7 +248,7 @@ bool DynamicMapTree::isInLineOfSight(float x1, float y1, float z1, float x2, flo
float DynamicMapTree::getHeight(float x, float y, float z, float maxSearchDist, uint32 phasemask) const
{
- G3D::Vector3 v(x, y, z);
+ G3D::Vector3 v(x, y, z + 0.5f);
G3D::Ray r(v, G3D::Vector3(0, 0, -1));
DynamicTreeIntersectionCallback callback(phasemask);
impl->intersectZAllignedRay(r, callback, maxSearchDist);
diff --git a/src/common/Collision/DynamicTree.h b/src/common/Collision/DynamicTree.h
index 0f18bb265f8..85707efebd2 100644
--- a/src/common/Collision/DynamicTree.h
+++ b/src/common/Collision/DynamicTree.h
@@ -31,7 +31,7 @@ namespace G3D
class GameObjectModel;
struct DynTreeImpl;
-class DynamicMapTree
+class TC_COMMON_API DynamicMapTree
{
DynTreeImpl *impl;
diff --git a/src/common/Collision/Management/IVMapManager.h b/src/common/Collision/Management/IVMapManager.h
index 1e64551956c..35437b7b816 100644
--- a/src/common/Collision/Management/IVMapManager.h
+++ b/src/common/Collision/Management/IVMapManager.h
@@ -42,7 +42,7 @@ namespace VMAP
#define VMAP_INVALID_HEIGHT_VALUE -200000.0f // real assigned value in unknown height case
//===========================================================
- class IVMapManager
+ class TC_COMMON_API IVMapManager
{
private:
bool iEnableLineOfSightCalc;
diff --git a/src/common/Collision/Management/MMapFactory.h b/src/common/Collision/Management/MMapFactory.h
index edd074fc93d..f89f44ba4df 100644
--- a/src/common/Collision/Management/MMapFactory.h
+++ b/src/common/Collision/Management/MMapFactory.h
@@ -38,12 +38,11 @@ namespace MMAP
// static class
// holds all mmap global data
// access point to MMapManager singleton
- class MMapFactory
+ class TC_COMMON_API MMapFactory
{
public:
static MMapManager* createOrGetMMapManager();
static void clear();
- static bool IsPathfindingEnabled(uint32 mapId);
};
}
diff --git a/src/common/Collision/Management/MMapManager.cpp b/src/common/Collision/Management/MMapManager.cpp
index 04b1e62399b..66808e08e34 100644
--- a/src/common/Collision/Management/MMapManager.cpp
+++ b/src/common/Collision/Management/MMapManager.cpp
@@ -23,6 +23,9 @@
namespace MMAP
{
+ static char const* const MAP_FILE_NAME_FORMAT = "%s/mmaps/%03i.mmap";
+ static char const* const TILE_FILE_NAME_FORMAT = "%s/mmaps/%03i%02i%02i.mmtile";
+
// ######################## MMapManager ########################
MMapManager::~MMapManager()
{
@@ -70,26 +73,20 @@ namespace MMAP
}
// load and init dtNavMesh - read parameters from file
- std::string dataDir = sConfigMgr->GetStringDefault("DataDir", "./");
- uint32 pathLen = dataDir.length() + strlen("/mmaps/%03i.mmap") + 1;
- char *fileName = new char[pathLen];
- snprintf(fileName, pathLen, (dataDir + "/mmaps/%03i.mmap").c_str(), mapId);
-
- FILE* file = fopen(fileName, "rb");
+ std::string fileName = Trinity::StringFormat(MAP_FILE_NAME_FORMAT, sConfigMgr->GetStringDefault("DataDir", ".").c_str(), mapId);
+ FILE* file = fopen(fileName.c_str(), "rb");
if (!file)
{
- TC_LOG_DEBUG("maps", "MMAP:loadMapData: Error: Could not open mmap file '%s'", fileName);
- delete [] fileName;
+ TC_LOG_DEBUG("maps", "MMAP:loadMapData: Error: Could not open mmap file '%s'", fileName.c_str());
return false;
}
dtNavMeshParams params;
- int count = fread(&params, sizeof(dtNavMeshParams), 1, file);
+ uint32 count = uint32(fread(&params, sizeof(dtNavMeshParams), 1, file));
fclose(file);
if (count != 1)
{
- TC_LOG_DEBUG("maps", "MMAP:loadMapData: Error: Could not read params from file '%s'", fileName);
- delete [] fileName;
+ TC_LOG_DEBUG("maps", "MMAP:loadMapData: Error: Could not read params from file '%s'", fileName.c_str());
return false;
}
@@ -98,18 +95,14 @@ namespace MMAP
if (dtStatusFailed(mesh->init(&params)))
{
dtFreeNavMesh(mesh);
- TC_LOG_ERROR("maps", "MMAP:loadMapData: Failed to initialize dtNavMesh for mmap %03u from file %s", mapId, fileName);
- delete [] fileName;
+ TC_LOG_ERROR("maps", "MMAP:loadMapData: Failed to initialize dtNavMesh for mmap %03u from file %s", mapId, fileName.c_str());
return false;
}
- delete [] fileName;
-
TC_LOG_DEBUG("maps", "MMAP:loadMapData: Loaded %03i.mmap", mapId);
// store inside our map list
MMapData* mmap_data = new MMapData(mesh);
- mmap_data->mmapLoadedTiles.clear();
itr->second = mmap_data;
return true;
@@ -120,7 +113,7 @@ namespace MMAP
return uint32(x << 16 | y);
}
- bool MMapManager::loadMap(const std::string& basePath, uint32 mapId, int32 x, int32 y)
+ bool MMapManager::loadMap(const std::string& /*basePath*/, uint32 mapId, int32 x, int32 y)
{
// make sure the mmap is loaded and ready to load tiles
if (!loadMapData(mapId))
@@ -132,23 +125,17 @@ namespace MMAP
// check if we already have this tile loaded
uint32 packedGridPos = packTileID(x, y);
- if (mmap->mmapLoadedTiles.find(packedGridPos) != mmap->mmapLoadedTiles.end())
+ if (mmap->loadedTileRefs.find(packedGridPos) != mmap->loadedTileRefs.end())
return false;
// load this tile :: mmaps/MMMXXYY.mmtile
- uint32 pathLen = basePath.length() + strlen("/%03i%02i%02i.mmtile") + 1;
- char *fileName = new char[pathLen];
-
- snprintf(fileName, pathLen, (basePath + "/%03i%02i%02i.mmtile").c_str(), mapId, x, y);
-
- FILE* file = fopen(fileName, "rb");
+ std::string fileName = Trinity::StringFormat(TILE_FILE_NAME_FORMAT, sConfigMgr->GetStringDefault("DataDir", ".").c_str(), mapId, x, y);
+ FILE* file = fopen(fileName.c_str(), "rb");
if (!file)
{
- TC_LOG_DEBUG("maps", "MMAP:loadMap: Could not open mmtile file '%s'", fileName);
- delete [] fileName;
+ TC_LOG_DEBUG("maps", "MMAP:loadMap: Could not open mmtile file '%s'", fileName.c_str());
return false;
}
- delete [] fileName;
// read header
MmapTileHeader fileHeader;
@@ -186,7 +173,7 @@ namespace MMAP
// memory allocated for data is now managed by detour, and will be deallocated when the tile is removed
if (dtStatusSucceed(mmap->navMesh->addTile(data, fileHeader.size, DT_TILE_FREE_DATA, 0, &tileRef)))
{
- mmap->mmapLoadedTiles.insert(std::pair<uint32, dtTileRef>(packedGridPos, tileRef));
+ mmap->loadedTileRefs.insert(std::pair<uint32, dtTileRef>(packedGridPos, tileRef));
++loadedTiles;
TC_LOG_DEBUG("maps", "MMAP:loadMap: Loaded mmtile %03i[%02i, %02i] into %03i[%02i, %02i]", mapId, x, y, mapId, header->x, header->y);
return true;
@@ -214,14 +201,14 @@ namespace MMAP
// check if we have this tile loaded
uint32 packedGridPos = packTileID(x, y);
- if (mmap->mmapLoadedTiles.find(packedGridPos) == mmap->mmapLoadedTiles.end())
+ if (mmap->loadedTileRefs.find(packedGridPos) == mmap->loadedTileRefs.end())
{
// file may not exist, therefore not loaded
TC_LOG_DEBUG("maps", "MMAP:unloadMap: Asked to unload not loaded navmesh tile. %03u%02i%02i.mmtile", mapId, x, y);
return false;
}
- dtTileRef tileRef = mmap->mmapLoadedTiles[packedGridPos];
+ dtTileRef tileRef = mmap->loadedTileRefs[packedGridPos];
// unload, and mark as non loaded
if (dtStatusFailed(mmap->navMesh->removeTile(tileRef, NULL, NULL)))
@@ -234,7 +221,7 @@ namespace MMAP
}
else
{
- mmap->mmapLoadedTiles.erase(packedGridPos);
+ mmap->loadedTileRefs.erase(packedGridPos);
--loadedTiles;
TC_LOG_DEBUG("maps", "MMAP:unloadMap: Unloaded mmtile %03i[%02i, %02i] from %03i", mapId, x, y, mapId);
return true;
@@ -255,7 +242,7 @@ namespace MMAP
// unload all tiles from given map
MMapData* mmap = itr->second;
- for (MMapTileSet::iterator i = mmap->mmapLoadedTiles.begin(); i != mmap->mmapLoadedTiles.end(); ++i)
+ for (MMapTileSet::iterator i = mmap->loadedTileRefs.begin(); i != mmap->loadedTileRefs.end(); ++i)
{
uint32 x = (i->first >> 16);
uint32 y = (i->first & 0x0000FFFF);
diff --git a/src/common/Collision/Management/MMapManager.h b/src/common/Collision/Management/MMapManager.h
index 1a502a916dd..0b85351f6a5 100644
--- a/src/common/Collision/Management/MMapManager.h
+++ b/src/common/Collision/Management/MMapManager.h
@@ -22,7 +22,6 @@
#include "Define.h"
#include "DetourNavMesh.h"
#include "DetourNavMeshQuery.h"
-
#include <string>
#include <unordered_map>
#include <vector>
@@ -46,11 +45,11 @@ namespace MMAP
dtFreeNavMesh(navMesh);
}
- dtNavMesh* navMesh;
-
// we have to use single dtNavMeshQuery for every instance, since those are not thread safe
NavMeshQuerySet navMeshQueries; // instanceId to query
- MMapTileSet mmapLoadedTiles; // maps [map grid coords] to [dtTile]
+
+ dtNavMesh* navMesh;
+ MMapTileSet loadedTileRefs; // maps [map grid coords] to [dtTile]
};
@@ -58,7 +57,7 @@ namespace MMAP
// singleton class
// holds all all access to mmap loading unloading and meshes
- class MMapManager
+ class TC_COMMON_API MMapManager
{
public:
MMapManager() : loadedTiles(0), thread_safe_environment(true) {}
@@ -75,7 +74,7 @@ namespace MMAP
dtNavMesh const* GetNavMesh(uint32 mapId);
uint32 getLoadedTilesCount() const { return loadedTiles; }
- uint32 getLoadedMapsCount() const { return loadedMMaps.size(); }
+ uint32 getLoadedMapsCount() const { return uint32(loadedMMaps.size()); }
private:
bool loadMapData(uint32 mapId);
uint32 packTileID(int32 x, int32 y);
diff --git a/src/common/Collision/Management/VMapFactory.h b/src/common/Collision/Management/VMapFactory.h
index 1a45bd5094b..a730fa12ef2 100644
--- a/src/common/Collision/Management/VMapFactory.h
+++ b/src/common/Collision/Management/VMapFactory.h
@@ -29,7 +29,7 @@ namespace VMAP
{
//===========================================================
- class VMapFactory
+ class TC_COMMON_API VMapFactory
{
public:
static IVMapManager* createOrGetVMapManager();
diff --git a/src/common/Collision/Management/VMapManager2.h b/src/common/Collision/Management/VMapManager2.h
index 722ac4935c6..61c5025e41f 100644
--- a/src/common/Collision/Management/VMapManager2.h
+++ b/src/common/Collision/Management/VMapManager2.h
@@ -51,7 +51,7 @@ namespace VMAP
class StaticMapTree;
class WorldModel;
- class ManagedModel
+ class TC_COMMON_API ManagedModel
{
public:
ManagedModel() : iModel(nullptr), iRefCount(0) { }
@@ -75,7 +75,7 @@ namespace VMAP
VMAP_DISABLE_LIQUIDSTATUS = 0x8
};
- class VMapManager2 : public IVMapManager
+ class TC_COMMON_API VMapManager2 : public IVMapManager
{
protected:
// Tree to check collision
diff --git a/src/common/Collision/Maps/MapDefines.h b/src/common/Collision/Maps/MapDefines.h
index 538a78a38d4..a523b0c0186 100644
--- a/src/common/Collision/Maps/MapDefines.h
+++ b/src/common/Collision/Maps/MapDefines.h
@@ -33,4 +33,4 @@ enum NavTerrain
// we only have 8 bits
};
-#endif
+#endif /* _MAPDEFINES_H */
diff --git a/src/common/Collision/Maps/MapTree.cpp b/src/common/Collision/Maps/MapTree.cpp
index 4d0996e1961..5907971efb9 100644
--- a/src/common/Collision/Maps/MapTree.cpp
+++ b/src/common/Collision/Maps/MapTree.cpp
@@ -22,6 +22,7 @@
#include "VMapDefinitions.h"
#include "Log.h"
#include "Errors.h"
+#include "Metric.h"
#include <string>
#include <sstream>
@@ -415,6 +416,8 @@ namespace VMAP
}
else
iLoadedTiles[packTileID(tileX, tileY)] = false;
+ TC_METRIC_EVENT("map_events", "LoadMapTile",
+ "Map: " + std::to_string(iMapID) + " TileX: " + std::to_string(tileX) + " TileY: " + std::to_string(tileY));
return result;
}
@@ -473,6 +476,8 @@ namespace VMAP
}
}
iLoadedTiles.erase(tile);
+ TC_METRIC_EVENT("map_events", "UnloadMapTile",
+ "Map: " + std::to_string(iMapID) + " TileX: " + std::to_string(tileX) + " TileY: " + std::to_string(tileY));
}
void StaticMapTree::getModelInstances(ModelInstance* &models, uint32 &count)
diff --git a/src/common/Collision/Maps/MapTree.h b/src/common/Collision/Maps/MapTree.h
index 63d542754c1..0227a982b4c 100644
--- a/src/common/Collision/Maps/MapTree.h
+++ b/src/common/Collision/Maps/MapTree.h
@@ -29,7 +29,7 @@ namespace VMAP
class GroupModel;
class VMapManager2;
- struct LocationInfo
+ struct TC_COMMON_API LocationInfo
{
LocationInfo(): hitInstance(nullptr), hitModel(nullptr), ground_Z(-G3D::finf()) { }
const ModelInstance* hitInstance;
@@ -37,7 +37,7 @@ namespace VMAP
float ground_Z;
};
- class StaticMapTree
+ class TC_COMMON_API StaticMapTree
{
typedef std::unordered_map<uint32, bool> loadedTileMap;
typedef std::unordered_map<uint32, uint32> loadedSpawnMap;
@@ -79,7 +79,7 @@ namespace VMAP
bool LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
bool isTiled() const { return iIsTiled; }
- uint32 numLoadedTiles() const { return iLoadedTiles.size(); }
+ uint32 numLoadedTiles() const { return uint32(iLoadedTiles.size()); }
void getModelInstances(ModelInstance* &models, uint32 &count);
private:
@@ -87,7 +87,7 @@ namespace VMAP
StaticMapTree& operator=(StaticMapTree const& right) = delete;
};
- struct AreaInfo
+ struct TC_COMMON_API AreaInfo
{
AreaInfo(): result(false), ground_Z(-G3D::finf()), flags(0), adtId(0),
rootId(0), groupId(0) { }
diff --git a/src/common/Collision/Maps/TileAssembler.cpp b/src/common/Collision/Maps/TileAssembler.cpp
index 3f58b8f3516..7ee9125a5c5 100644
--- a/src/common/Collision/Maps/TileAssembler.cpp
+++ b/src/common/Collision/Maps/TileAssembler.cpp
@@ -355,10 +355,13 @@ namespace VMAP
uint32 name_length, displayId;
char buff[500];
- while (!feof(model_list))
+ while (true)
{
- if (fread(&displayId, sizeof(uint32), 1, model_list) != 1
- || fread(&name_length, sizeof(uint32), 1, model_list) != 1
+ if (fread(&displayId, sizeof(uint32), 1, model_list) != 1)
+ if (feof(model_list)) // EOF flag is only set after failed reading attempt
+ break;
+
+ if (fread(&name_length, sizeof(uint32), 1, model_list) != 1
|| name_length >= sizeof(buff)
|| fread(&buff, sizeof(char), name_length, model_list) != name_length)
{
@@ -369,7 +372,7 @@ namespace VMAP
std::string model_name(buff, name_length);
WorldModel_Raw raw_model;
- if ( !raw_model.Read((iSrcDir + "/" + model_name).c_str()) )
+ if (!raw_model.Read((iSrcDir + "/" + model_name).c_str()) )
continue;
spawnedModelFiles.insert(model_name);
@@ -412,13 +415,14 @@ namespace VMAP
fclose(model_list);
fclose(model_list_copy);
}
- // temporary use defines to simplify read/check code (close file and return at fail)
- #define READ_OR_RETURN(V, S) if (fread((V), (S), 1, rf) != 1) { \
- fclose(rf); printf("readfail, op = %i\n", readOperation); return(false); }
- #define READ_OR_RETURN_WITH_DELETE(V, S) if (fread((V), (S), 1, rf) != 1) { \
- fclose(rf); printf("readfail, op = %i\n", readOperation); delete[] V; return(false); };
- #define CMP_OR_RETURN(V, S) if (strcmp((V), (S)) != 0) { \
- fclose(rf); printf("cmpfail, %s!=%s\n", V, S);return(false); }
+
+// temporary use defines to simplify read/check code (close file and return at fail)
+#define READ_OR_RETURN(V, S) if (fread((V), (S), 1, rf) != 1) { \
+ fclose(rf); printf("readfail, op = %i\n", readOperation); return(false); }
+#define READ_OR_RETURN_WITH_DELETE(V, S) if (fread((V), (S), 1, rf) != 1) { \
+ fclose(rf); printf("readfail, op = %i\n", readOperation); delete[] V; return(false); };
+#define CMP_OR_RETURN(V, S) if (strcmp((V), (S)) != 0) { \
+ fclose(rf); printf("cmpfail, %s!=%s\n", V, S);return(false); }
bool GroupModel_Raw::Read(FILE* rf)
{
diff --git a/src/common/Collision/Maps/TileAssembler.h b/src/common/Collision/Maps/TileAssembler.h
index 1e2dc1924f1..74111f69910 100644
--- a/src/common/Collision/Maps/TileAssembler.h
+++ b/src/common/Collision/Maps/TileAssembler.h
@@ -35,7 +35,7 @@ namespace VMAP
*/
//===============================================
- class ModelPosition
+ class TC_COMMON_API ModelPosition
{
private:
G3D::Matrix3 iRotation;
@@ -55,7 +55,7 @@ namespace VMAP
typedef std::map<uint32, ModelSpawn> UniqueEntryMap;
typedef std::multimap<uint32, uint32> TileMap;
- struct MapSpawns
+ struct TC_COMMON_API MapSpawns
{
UniqueEntryMap UniqueEntries;
TileMap TileEntries;
@@ -64,7 +64,7 @@ namespace VMAP
typedef std::map<uint32, MapSpawns*> MapData;
//===============================================
- struct GroupModel_Raw
+ struct TC_COMMON_API GroupModel_Raw
{
uint32 mogpflags;
uint32 GroupWMOID;
@@ -82,7 +82,7 @@ namespace VMAP
bool Read(FILE* f);
};
- struct WorldModel_Raw
+ struct TC_COMMON_API WorldModel_Raw
{
uint32 RootWMOID;
std::vector<GroupModel_Raw> groupsArray;
@@ -90,7 +90,7 @@ namespace VMAP
bool Read(const char * path);
};
- class TileAssembler
+ class TC_COMMON_API TileAssembler
{
private:
std::string iDestDir;
diff --git a/src/common/Collision/Models/GameObjectModel.h b/src/common/Collision/Models/GameObjectModel.h
index 9d8687233c1..37f11af20ac 100644
--- a/src/common/Collision/Models/GameObjectModel.h
+++ b/src/common/Collision/Models/GameObjectModel.h
@@ -35,7 +35,7 @@ namespace VMAP
class GameObject;
struct GameObjectDisplayInfoEntry;
-class GameObjectModelOwnerBase
+class TC_COMMON_API GameObjectModelOwnerBase
{
public:
virtual bool IsSpawned() const { return false; }
@@ -47,7 +47,7 @@ public:
virtual void DebugVisualizeCorner(G3D::Vector3 const& /*corner*/) const { }
};
-class GameObjectModel /*, public Intersectable*/
+class TC_COMMON_API GameObjectModel /*, public Intersectable*/
{
GameObjectModel() : phasemask(0), iInvScale(0), iScale(0), iModel(NULL) { }
public:
@@ -84,4 +84,6 @@ private:
std::unique_ptr<GameObjectModelOwnerBase> owner;
};
+TC_COMMON_API void LoadGameObjectModelList(std::string const& dataPath);
+
#endif // _GAMEOBJECT_MODEL_H
diff --git a/src/common/Collision/Models/ModelInstance.h b/src/common/Collision/Models/ModelInstance.h
index d101630d1e9..84a41b15ce6 100644
--- a/src/common/Collision/Models/ModelInstance.h
+++ b/src/common/Collision/Models/ModelInstance.h
@@ -39,7 +39,7 @@ namespace VMAP
MOD_HAS_BOUND = 1<<2
};
- class ModelSpawn
+ class TC_COMMON_API ModelSpawn
{
public:
//mapID, tileX, tileY, Flags, ID, Pos, Rot, Scale, Bound_lo, Bound_hi, name
@@ -60,7 +60,7 @@ namespace VMAP
static bool writeToFile(FILE* rw, const ModelSpawn &spawn);
};
- class ModelInstance: public ModelSpawn
+ class TC_COMMON_API ModelInstance: public ModelSpawn
{
public:
ModelInstance(): iInvScale(0.0f), iModel(nullptr) { }
diff --git a/src/common/Collision/Models/WorldModel.h b/src/common/Collision/Models/WorldModel.h
index 39787f6c664..bfc0367627f 100644
--- a/src/common/Collision/Models/WorldModel.h
+++ b/src/common/Collision/Models/WorldModel.h
@@ -33,7 +33,7 @@ namespace VMAP
struct AreaInfo;
struct LocationInfo;
- class MeshTriangle
+ class TC_COMMON_API MeshTriangle
{
public:
MeshTriangle() : idx0(0), idx1(0), idx2(0) { }
@@ -44,7 +44,7 @@ namespace VMAP
uint32 idx2;
};
- class WmoLiquid
+ class TC_COMMON_API WmoLiquid
{
public:
WmoLiquid(uint32 width, uint32 height, const G3D::Vector3 &corner, uint32 type);
@@ -70,7 +70,7 @@ namespace VMAP
};
/*! holding additional info for WMO group files */
- class GroupModel
+ class TC_COMMON_API GroupModel
{
public:
GroupModel() : iBound(), iMogpFlags(0), iGroupWMOID(0), iLiquid(NULL) { }
@@ -103,7 +103,7 @@ namespace VMAP
};
/*! Holds a model (converted M2 or WMO) in its original coordinate space */
- class WorldModel
+ class TC_COMMON_API WorldModel
{
public:
WorldModel(): RootWMOID(0) { }
diff --git a/src/common/Collision/RegularGrid.h b/src/common/Collision/RegularGrid.h
index 6a2a07968ad..2f3819c872c 100644
--- a/src/common/Collision/RegularGrid.h
+++ b/src/common/Collision/RegularGrid.h
@@ -20,7 +20,7 @@ class NodeCreatorFunc = NodeCreator<Node>,
/*class BoundsFunc = BoundsTrait<T>,*/
class PositionFunc = PositionTrait<T>
>
-class RegularGrid2D
+class TC_COMMON_API RegularGrid2D
{
public:
@@ -71,7 +71,7 @@ public:
}
bool contains(const T& value) const { return memberTable.containsKey(&value); }
- int size() const { return memberTable.size(); }
+ int size() const { return uint32(memberTable.size()); }
struct Cell
{
diff --git a/src/common/Common.h b/src/common/Common.h
index e8adc55d20d..aa04abacd30 100644
--- a/src/common/Common.h
+++ b/src/common/Common.h
@@ -21,28 +21,31 @@
#include "Define.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <cmath>
-#include <errno.h>
-#include <signal.h>
-#include <assert.h>
-
-#include <set>
-#include <unordered_set>
+#include <algorithm>
+#include <array>
+#include <exception>
#include <list>
-#include <string>
#include <map>
-#include <unordered_map>
+#include <memory>
#include <queue>
+#include <set>
#include <sstream>
-#include <algorithm>
-#include <memory>
+#include <string>
+#include <type_traits>
+#include <unordered_map>
+#include <unordered_set>
#include <vector>
-#include <array>
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <cerrno>
+#include <csignal>
+
+#include <boost/optional.hpp>
+#include <boost/utility/in_place_factory.hpp>
#include <boost/functional/hash.hpp>
#include "Debugging/Errors.h"
@@ -130,9 +133,9 @@ enum LocaleConstant
#define MAX_LOCALES 8
#define MAX_ACCOUNT_TUTORIAL_VALUES 8
-extern char const* localeNames[TOTAL_LOCALES];
+TC_COMMON_API extern char const* localeNames[TOTAL_LOCALES];
-LocaleConstant GetLocaleByName(const std::string& name);
+TC_COMMON_API LocaleConstant GetLocaleByName(const std::string& name);
typedef std::vector<std::string> StringVector;
@@ -151,6 +154,10 @@ typedef std::vector<std::string> StringVector;
#define MAX_QUERY_LEN 32*1024
+//! Optional helper class to wrap optional values within.
+template <typename T>
+using Optional = boost::optional<T>;
+
namespace Trinity
{
//! std::make_unique implementation (TODO: remove this once C++14 is supported)
diff --git a/src/common/Configuration/BuiltInConfig.cpp b/src/common/Configuration/BuiltInConfig.cpp
new file mode 100644
index 00000000000..c2fc3b91766
--- /dev/null
+++ b/src/common/Configuration/BuiltInConfig.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "BuiltInConfig.h"
+#include "Config.h"
+#include "GitRevision.h"
+
+template<typename Fn>
+static std::string GetStringWithDefaultValueFromFunction(
+ std::string const& key, Fn getter)
+{
+ std::string const value = sConfigMgr->GetStringDefault(key, "");
+ return value.empty() ? getter() : value;
+}
+
+std::string BuiltInConfig::GetCMakeCommand()
+{
+ return GetStringWithDefaultValueFromFunction(
+ "CMakeCommand", GitRevision::GetCMakeCommand);
+}
+
+std::string BuiltInConfig::GetBuildDirectory()
+{
+ return GetStringWithDefaultValueFromFunction(
+ "BuildDirectory", GitRevision::GetBuildDirectory);
+}
+
+std::string BuiltInConfig::GetSourceDirectory()
+{
+ return GetStringWithDefaultValueFromFunction(
+ "SourceDirectory", GitRevision::GetSourceDirectory);
+}
+
+std::string BuiltInConfig::GetMySQLExecutable()
+{
+ return GetStringWithDefaultValueFromFunction(
+ "MySQLExecutable", GitRevision::GetMySQLExecutable);
+}
diff --git a/src/common/Configuration/BuiltInConfig.h b/src/common/Configuration/BuiltInConfig.h
new file mode 100644
index 00000000000..0ffa059bc41
--- /dev/null
+++ b/src/common/Configuration/BuiltInConfig.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef BUILT_IN_CONFIG_H
+#define BUILT_IN_CONFIG_H
+
+#include <string>
+#include "Define.h"
+
+/// Provides helper functions to access built-in values
+/// which can be overwritten in config
+namespace BuiltInConfig
+{
+ /// Returns the CMake command when any is specified in the config,
+ /// returns the built-in path otherwise
+ TC_COMMON_API std::string GetCMakeCommand();
+ /// Returns the build directory path when any is specified in the config,
+ /// returns the built-in one otherwise
+ TC_COMMON_API std::string GetBuildDirectory();
+ /// Returns the source directory path when any is specified in the config,
+ /// returns the built-in one otherwise
+ TC_COMMON_API std::string GetSourceDirectory();
+ /// Returns the path to the mysql executable (`mysql`) when any is specified
+ /// in the config, returns the built-in one otherwise
+ TC_COMMON_API std::string GetMySQLExecutable();
+
+} // namespace BuiltInConfig
+
+#endif // BUILT_IN_CONFIG_H
diff --git a/src/common/Configuration/Config.cpp b/src/common/Configuration/Config.cpp
index 6ac04615315..888aa6ecef3 100644
--- a/src/common/Configuration/Config.cpp
+++ b/src/common/Configuration/Config.cpp
@@ -21,14 +21,17 @@
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include "Config.h"
+#include "Log.h"
using namespace boost::property_tree;
-bool ConfigMgr::LoadInitial(std::string const& file, std::string& error)
+bool ConfigMgr::LoadInitial(std::string const& file, std::vector<std::string> args,
+ std::string& error)
{
std::lock_guard<std::mutex> lock(_configLock);
_filename = file;
+ _args = args;
try
{
@@ -56,42 +59,81 @@ bool ConfigMgr::LoadInitial(std::string const& file, std::string& error)
return true;
}
-bool ConfigMgr::Reload(std::string& error)
+ConfigMgr* ConfigMgr::instance()
{
- return LoadInitial(_filename, error);
+ static ConfigMgr instance;
+ return &instance;
}
-std::string ConfigMgr::GetStringDefault(std::string const& name, const std::string& def)
+bool ConfigMgr::Reload(std::string& error)
{
- std::string value = _config.get<std::string>(ptree::path_type(name, '/'), def);
+ return LoadInitial(_filename, std::move(_args), error);
+}
- value.erase(std::remove(value.begin(), value.end(), '"'), value.end());
+template<class T>
+T ConfigMgr::GetValueDefault(std::string const& name, T def) const
+{
+ try
+ {
+ return _config.get<T>(ptree::path_type(name, '/'));
+ }
+ catch (boost::property_tree::ptree_bad_path)
+ {
+ TC_LOG_WARN("server.loading", "Missing name %s in config file %s, add \"%s = %s\" to this file",
+ name.c_str(), _filename.c_str(), name.c_str(), std::to_string(def).c_str());
+ }
+ catch (boost::property_tree::ptree_bad_data)
+ {
+ TC_LOG_ERROR("server.loading", "Bad value defined for name %s in config file %s, going to use %s instead",
+ name.c_str(), _filename.c_str(), std::to_string(def).c_str());
+ }
- return value;
+ return def;
}
-bool ConfigMgr::GetBoolDefault(std::string const& name, bool def)
+template<>
+std::string ConfigMgr::GetValueDefault<std::string>(std::string const& name, std::string def) const
{
try
{
- std::string val = _config.get<std::string>(ptree::path_type(name, '/'));
- val.erase(std::remove(val.begin(), val.end(), '"'), val.end());
- return (val == "true" || val == "TRUE" || val == "yes" || val == "YES" || val == "1");
+ return _config.get<std::string>(ptree::path_type(name, '/'));
+ }
+ catch (boost::property_tree::ptree_bad_path)
+ {
+ TC_LOG_WARN("server.loading", "Missing name %s in config file %s, add \"%s = %s\" to this file",
+ name.c_str(), _filename.c_str(), name.c_str(), def.c_str());
}
- catch (std::exception const& /*ex*/)
+ catch (boost::property_tree::ptree_bad_data)
{
- return def;
+ TC_LOG_ERROR("server.loading", "Bad value defined for name %s in config file %s, going to use %s instead",
+ name.c_str(), _filename.c_str(), def.c_str());
}
+
+ return def;
+}
+
+std::string ConfigMgr::GetStringDefault(std::string const& name, const std::string& def) const
+{
+ std::string val = GetValueDefault(name, def);
+ val.erase(std::remove(val.begin(), val.end(), '"'), val.end());
+ return val;
+}
+
+bool ConfigMgr::GetBoolDefault(std::string const& name, bool def) const
+{
+ std::string val = GetValueDefault(name, std::string(def ? "1" : "0"));
+ val.erase(std::remove(val.begin(), val.end(), '"'), val.end());
+ return (val == "1" || val == "true" || val == "TRUE" || val == "yes" || val == "YES");
}
-int ConfigMgr::GetIntDefault(std::string const& name, int def)
+int ConfigMgr::GetIntDefault(std::string const& name, int def) const
{
- return _config.get<int>(ptree::path_type(name, '/'), def);
+ return GetValueDefault(name, def);
}
-float ConfigMgr::GetFloatDefault(std::string const& name, float def)
+float ConfigMgr::GetFloatDefault(std::string const& name, float def) const
{
- return _config.get<float>(ptree::path_type(name, '/'), def);
+ return GetValueDefault(name, def);
}
std::string const& ConfigMgr::GetFilename()
diff --git a/src/common/Configuration/Config.h b/src/common/Configuration/Config.h
index 5b04212ed7c..573bc7b4a15 100644
--- a/src/common/Configuration/Config.h
+++ b/src/common/Configuration/Config.h
@@ -19,43 +19,47 @@
#ifndef CONFIG_H
#define CONFIG_H
+#include "Define.h"
+
#include <string>
#include <list>
+#include <vector>
#include <mutex>
#include <boost/property_tree/ptree.hpp>
-class ConfigMgr
+class TC_COMMON_API ConfigMgr
{
- ConfigMgr() { }
- ~ConfigMgr() { }
+ ConfigMgr() = default;
+ ConfigMgr(ConfigMgr const&) = delete;
+ ConfigMgr& operator=(ConfigMgr const&) = delete;
+ ~ConfigMgr() = default;
public:
/// Method used only for loading main configuration files (authserver.conf and worldserver.conf)
- bool LoadInitial(std::string const& file, std::string& error);
+ bool LoadInitial(std::string const& file, std::vector<std::string> args,
+ std::string& error);
- static ConfigMgr* instance()
- {
- static ConfigMgr instance;
- return &instance;
- }
+ static ConfigMgr* instance();
bool Reload(std::string& error);
- std::string GetStringDefault(std::string const& name, const std::string& def);
- bool GetBoolDefault(std::string const& name, bool def);
- int GetIntDefault(std::string const& name, int def);
- float GetFloatDefault(std::string const& name, float def);
+ std::string GetStringDefault(std::string const& name, const std::string& def) const;
+ bool GetBoolDefault(std::string const& name, bool def) const;
+ int GetIntDefault(std::string const& name, int def) const;
+ float GetFloatDefault(std::string const& name, float def) const;
std::string const& GetFilename();
+ std::vector<std::string> const& GetArguments() const { return _args; }
std::list<std::string> GetKeysByString(std::string const& name);
private:
std::string _filename;
+ std::vector<std::string> _args;
boost::property_tree::ptree _config;
std::mutex _configLock;
- ConfigMgr(ConfigMgr const&);
- ConfigMgr& operator=(ConfigMgr const&);
+ template<class T>
+ T GetValueDefault(std::string const& name, T def) const;
};
#define sConfigMgr ConfigMgr::instance()
diff --git a/src/common/Cryptography/ARC4.cpp b/src/common/Cryptography/ARC4.cpp
index eea523a2090..ead85a18e67 100644
--- a/src/common/Cryptography/ARC4.cpp
+++ b/src/common/Cryptography/ARC4.cpp
@@ -18,14 +18,14 @@
#include "ARC4.h"
-ARC4::ARC4(uint8 len) : m_ctx()
+ARC4::ARC4(uint32 len) : m_ctx()
{
EVP_CIPHER_CTX_init(&m_ctx);
EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
EVP_CIPHER_CTX_set_key_length(&m_ctx, len);
}
-ARC4::ARC4(uint8 *seed, uint8 len) : m_ctx()
+ARC4::ARC4(uint8 *seed, uint32 len) : m_ctx()
{
EVP_CIPHER_CTX_init(&m_ctx);
EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL);
diff --git a/src/common/Cryptography/ARC4.h b/src/common/Cryptography/ARC4.h
index f39e662e295..df412944ef6 100644
--- a/src/common/Cryptography/ARC4.h
+++ b/src/common/Cryptography/ARC4.h
@@ -22,11 +22,11 @@
#include <openssl/evp.h>
#include "Define.h"
-class ARC4
+class TC_COMMON_API ARC4
{
public:
- ARC4(uint8 len);
- ARC4(uint8 *seed, uint8 len);
+ ARC4(uint32 len);
+ ARC4(uint8 *seed, uint32 len);
~ARC4();
void Init(uint8 *seed);
void UpdateData(int len, uint8 *data);
diff --git a/src/common/Cryptography/Authentication/AuthCrypt.h b/src/common/Cryptography/Authentication/AuthCrypt.h
index 878391e3ce8..db4de8a7bd1 100644
--- a/src/common/Cryptography/Authentication/AuthCrypt.h
+++ b/src/common/Cryptography/Authentication/AuthCrypt.h
@@ -23,7 +23,7 @@
class BigNumber;
-class AuthCrypt
+class TC_COMMON_API AuthCrypt
{
public:
AuthCrypt();
diff --git a/src/common/Cryptography/BigNumber.cpp b/src/common/Cryptography/BigNumber.cpp
index 3b85122ebab..0d5dafc336b 100644
--- a/src/common/Cryptography/BigNumber.cpp
+++ b/src/common/Cryptography/BigNumber.cpp
@@ -163,11 +163,16 @@ uint32 BigNumber::AsDword()
return (uint32)BN_get_word(_bn);
}
-bool BigNumber::isZero() const
+bool BigNumber::IsZero() const
{
return BN_is_zero(_bn);
}
+bool BigNumber::IsNegative() const
+{
+ return BN_is_negative(_bn);
+}
+
std::unique_ptr<uint8[]> BigNumber::AsByteArray(int32 minSize, bool littleEndian)
{
int numBytes = GetNumBytes();
@@ -189,13 +194,19 @@ std::unique_ptr<uint8[]> BigNumber::AsByteArray(int32 minSize, bool littleEndian
return ret;
}
-char * BigNumber::AsHexStr() const
+std::string BigNumber::AsHexStr() const
{
- return BN_bn2hex(_bn);
+ char* ch = BN_bn2hex(_bn);
+ std::string ret = ch;
+ OPENSSL_free(ch);
+ return ret;
}
-char * BigNumber::AsDecStr() const
+std::string BigNumber::AsDecStr() const
{
- return BN_bn2dec(_bn);
+ char* ch = BN_bn2dec(_bn);
+ std::string ret = ch;
+ OPENSSL_free(ch);
+ return ret;
}
diff --git a/src/common/Cryptography/BigNumber.h b/src/common/Cryptography/BigNumber.h
index a5bda50dc72..baf338552d0 100644
--- a/src/common/Cryptography/BigNumber.h
+++ b/src/common/Cryptography/BigNumber.h
@@ -21,10 +21,11 @@
#include <memory>
#include "Define.h"
+#include <string>
struct bignum_st;
-class BigNumber
+class TC_COMMON_API BigNumber
{
public:
BigNumber();
@@ -76,7 +77,8 @@ class BigNumber
return t %= bn;
}
- bool isZero() const;
+ bool IsZero() const;
+ bool IsNegative() const;
BigNumber ModExp(BigNumber const& bn1, BigNumber const& bn2);
BigNumber Exp(BigNumber const&);
@@ -89,8 +91,8 @@ class BigNumber
std::unique_ptr<uint8[]> AsByteArray(int32 minSize = 0, bool littleEndian = true);
- char * AsHexStr() const;
- char * AsDecStr() const;
+ std::string AsHexStr() const;
+ std::string AsDecStr() const;
private:
struct bignum_st *_bn;
diff --git a/src/common/Cryptography/HMACSHA1.h b/src/common/Cryptography/HMACSHA1.h
index 29a926d5b16..049847489a6 100644
--- a/src/common/Cryptography/HMACSHA1.h
+++ b/src/common/Cryptography/HMACSHA1.h
@@ -28,7 +28,7 @@ class BigNumber;
#define SEED_KEY_SIZE 16
-class HmacHash
+class TC_COMMON_API HmacHash
{
public:
HmacHash(uint32 len, uint8 *seed);
diff --git a/src/common/Cryptography/OpenSSLCrypto.h b/src/common/Cryptography/OpenSSLCrypto.h
index df1b14b5eda..65155df9af8 100644
--- a/src/common/Cryptography/OpenSSLCrypto.h
+++ b/src/common/Cryptography/OpenSSLCrypto.h
@@ -18,6 +18,8 @@
#ifndef OPENSSL_CRYPTO_H
#define OPENSSL_CRYPTO_H
+#include "Define.h"
+
/**
* A group of functions which setup openssl crypto module to work properly in multithreaded enviroment
* If not setup properly - it will crash
@@ -25,9 +27,9 @@
namespace OpenSSLCrypto
{
/// Needs to be called before threads using openssl are spawned
- void threadsSetup();
+ TC_COMMON_API void threadsSetup();
/// Needs to be called after threads using openssl are despawned
- void threadsCleanup();
+ TC_COMMON_API void threadsCleanup();
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/common/Cryptography/SHA1.cpp b/src/common/Cryptography/SHA1.cpp
index a01bd7844ee..aed4a069827 100644
--- a/src/common/Cryptography/SHA1.cpp
+++ b/src/common/Cryptography/SHA1.cpp
@@ -18,6 +18,7 @@
#include "SHA1.h"
#include "BigNumber.h"
+#include "Util.h"
#include <cstring>
#include <stdarg.h>
@@ -67,3 +68,10 @@ void SHA1Hash::Finalize(void)
SHA1_Final(mDigest, &mC);
}
+std::string CalculateSHA1Hash(std::string const& content)
+{
+ unsigned char digest[SHA_DIGEST_LENGTH];
+ SHA1((unsigned char*)content.c_str(), content.length(), (unsigned char*)&digest);
+
+ return ByteArrayToHexStr(digest, SHA_DIGEST_LENGTH);
+}
diff --git a/src/common/Cryptography/SHA1.h b/src/common/Cryptography/SHA1.h
index ffa02176a2d..37ac2cc0166 100644
--- a/src/common/Cryptography/SHA1.h
+++ b/src/common/Cryptography/SHA1.h
@@ -25,7 +25,7 @@
class BigNumber;
-class SHA1Hash
+class TC_COMMON_API SHA1Hash
{
public:
SHA1Hash();
@@ -46,5 +46,8 @@ class SHA1Hash
SHA_CTX mC;
uint8 mDigest[SHA_DIGEST_LENGTH];
};
-#endif
+/// Returns the SHA1 hash of the given content as hex string.
+TC_COMMON_API std::string CalculateSHA1Hash(std::string const& content);
+
+#endif
diff --git a/src/common/Debugging/Errors.cpp b/src/common/Debugging/Errors.cpp
index 1ec66ff6d59..2ce00229e53 100644
--- a/src/common/Debugging/Errors.cpp
+++ b/src/common/Debugging/Errors.cpp
@@ -96,4 +96,11 @@ void Abort(char const* file, int line, char const* function)
exit(1);
}
+void AbortHandler(int /*sigval*/)
+{
+ // nothing useful to log here, no way to pass args
+ *((volatile int*)NULL) = 0;
+ exit(1);
+}
+
} // namespace Trinity
diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h
index 38e311a6b13..e4b3563ca96 100644
--- a/src/common/Debugging/Errors.h
+++ b/src/common/Debugging/Errors.h
@@ -23,16 +23,18 @@
namespace Trinity
{
- DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
- DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, char const* message, char const* format, ...) ATTR_NORETURN ATTR_PRINTF(5, 6);
+ DECLSPEC_NORETURN TC_COMMON_API void Assert(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
+ DECLSPEC_NORETURN TC_COMMON_API void Assert(char const* file, int line, char const* function, char const* message, char const* format, ...) ATTR_NORETURN ATTR_PRINTF(5, 6);
- DECLSPEC_NORETURN void Fatal(char const* file, int line, char const* function, char const* message, ...) ATTR_NORETURN ATTR_PRINTF(4, 5);
+ DECLSPEC_NORETURN TC_COMMON_API void Fatal(char const* file, int line, char const* function, char const* message, ...) ATTR_NORETURN ATTR_PRINTF(4, 5);
- DECLSPEC_NORETURN void Error(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
+ DECLSPEC_NORETURN TC_COMMON_API void Error(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
- DECLSPEC_NORETURN void Abort(char const* file, int line, char const* function) ATTR_NORETURN;
+ DECLSPEC_NORETURN TC_COMMON_API void Abort(char const* file, int line, char const* function) ATTR_NORETURN;
- void Warning(char const* file, int line, char const* function, char const* message);
+ TC_COMMON_API void Warning(char const* file, int line, char const* function, char const* message);
+
+ DECLSPEC_NORETURN TC_COMMON_API void AbortHandler(int sigval) ATTR_NORETURN;
} // namespace Trinity
diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp
index 5b9a1b1bd6c..72abec161b9 100644
--- a/src/common/Debugging/WheatyExceptionReport.cpp
+++ b/src/common/Debugging/WheatyExceptionReport.cpp
@@ -901,7 +901,7 @@ unsigned /*cbBuffer*/)
// will return true.
bool bHandled;
pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, pSym->ModBase, pSym->TypeIndex,
- 0, pVariable, bHandled, pSym->Name, "", false, true);
+ pVariable, bHandled, pSym->Name, "", false, true);
if (!bHandled)
{
@@ -934,7 +934,6 @@ char * WheatyExceptionReport::DumpTypeIndex(
char * pszCurrBuffer,
DWORD64 modBase,
DWORD dwTypeIndex,
-unsigned nestingLevel,
DWORD_PTR offset,
bool & bHandled,
const char* Name,
@@ -1022,14 +1021,14 @@ bool logChildren)
FormatOutputValue(buffer, btVoid, sizeof(PVOID), (PVOID)offset, sizeof(buffer));
symbolDetails.top().Value = buffer;
- if (nestingLevel >= WER_MAX_NESTING_LEVEL)
+ if (symbolDetails.size() >= WER_MAX_NESTING_LEVEL)
logChildren = false;
// no need to log any children since the address is invalid anyway
if (address == NULL || address == DWORD_PTR(-1))
logChildren = false;
- pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1,
+ pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID,
address, bHandled, Name, addressStr, false, logChildren);
if (!bHandled)
@@ -1074,19 +1073,19 @@ bool logChildren)
switch (innerTypeTag)
{
case SymTagUDT:
- if (nestingLevel >= WER_MAX_NESTING_LEVEL)
+ if (symbolDetails.size() >= WER_MAX_NESTING_LEVEL)
logChildren = false;
- pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1,
+ pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID,
offset, bHandled, symbolDetails.top().Name.c_str(), "", false, logChildren);
break;
case SymTagPointerType:
if (Name != NULL && Name[0] != '\0')
symbolDetails.top().Name = Name;
- pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1,
+ pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID,
offset, bHandled, symbolDetails.top().Name.c_str(), "", false, logChildren);
break;
case SymTagArrayType:
- pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1,
+ pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID,
offset, bHandled, symbolDetails.top().Name.c_str(), "", false, logChildren);
break;
default:
@@ -1100,7 +1099,7 @@ bool logChildren)
symbolDetails.top().HasChildren = true;
BasicType basicType = btNoType;
- pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1,
+ pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID,
offset, bHandled, Name, "", false, false);
// Set Value back to an empty string since the Array object itself has no value, only its elements have
@@ -1222,7 +1221,7 @@ bool logChildren)
DWORD_PTR dwFinalOffset = offset + dwMemberOffset;
pszCurrBuffer = DumpTypeIndex(pszCurrBuffer, modBase,
- children.ChildId[i], nestingLevel+1,
+ children.ChildId[i],
dwFinalOffset, bHandled2, ""/*Name */, "", true, true);
// If the child wasn't a UDT, format it appropriately
diff --git a/src/common/Debugging/WheatyExceptionReport.h b/src/common/Debugging/WheatyExceptionReport.h
index eb62d8bceef..34919b19e01 100644
--- a/src/common/Debugging/WheatyExceptionReport.h
+++ b/src/common/Debugging/WheatyExceptionReport.h
@@ -13,7 +13,7 @@
#define countof _countof
#define WER_MAX_ARRAY_ELEMENTS_COUNT 10
-#define WER_MAX_NESTING_LEVEL 5
+#define WER_MAX_NESTING_LEVEL 4
#define WER_LARGE_BUFFER_SIZE 1024 * 128
enum BasicType // Stolen from CVCONST.H in the DIA 2.0 SDK
@@ -173,7 +173,7 @@ class WheatyExceptionReport
static bool FormatSymbolValue(PSYMBOL_INFO, STACKFRAME64 *, char * pszBuffer, unsigned cbBuffer);
- static char * DumpTypeIndex(char *, DWORD64, DWORD, unsigned, DWORD_PTR, bool &, const char*, char*, bool, bool);
+ static char * DumpTypeIndex(char *, DWORD64, DWORD, DWORD_PTR, bool &, const char*, char*, bool, bool);
static void FormatOutputValue(char * pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress, size_t bufferSize, size_t countOverride = 0);
diff --git a/src/common/Define.h b/src/common/Define.h
index b34edb6a549..d03d26ad780 100644
--- a/src/common/Define.h
+++ b/src/common/Define.h
@@ -95,6 +95,45 @@
#endif
#endif //COMPILER == COMPILER_GNU
+#ifdef TRINITY_API_USE_DYNAMIC_LINKING
+# if COMPILER == COMPILER_MICROSOFT
+# define TC_API_EXPORT __declspec(dllexport)
+# define TC_API_IMPORT __declspec(dllimport)
+# elif COMPILER == COMPILER_GNU
+# define TC_API_EXPORT __attribute__((visibility("default")))
+# define TC_API_IMPORT
+# else
+# error compiler not supported!
+# endif
+#else
+# define TC_API_EXPORT
+# define TC_API_IMPORT
+#endif
+
+#ifdef TRINITY_API_EXPORT_COMMON
+# define TC_COMMON_API TC_API_EXPORT
+#else
+# define TC_COMMON_API TC_API_IMPORT
+#endif
+
+#ifdef TRINITY_API_EXPORT_DATABASE
+# define TC_DATABASE_API TC_API_EXPORT
+#else
+# define TC_DATABASE_API TC_API_IMPORT
+#endif
+
+#ifdef TRINITY_API_EXPORT_SHARED
+# define TC_SHARED_API TC_API_EXPORT
+#else
+# define TC_SHARED_API TC_API_IMPORT
+#endif
+
+#ifdef TRINITY_API_EXPORT_GAME
+# define TC_GAME_API TC_API_EXPORT
+#else
+# define TC_GAME_API TC_API_IMPORT
+#endif
+
#define UI64FMTD "%" PRIu64
#define UI64LIT(N) UINT64_C(N)
diff --git a/src/common/GitRevision.cpp b/src/common/GitRevision.cpp
index d0719c09959..702cd01d84b 100644
--- a/src/common/GitRevision.cpp
+++ b/src/common/GitRevision.cpp
@@ -1,5 +1,4 @@
#include "GitRevision.h"
-#include "CompilerDefs.h"
#include "revision_data.h"
char const* GitRevision::GetHash()
@@ -17,6 +16,16 @@ char const* GitRevision::GetBranch()
return _BRANCH;
}
+char const* GitRevision::GetCMakeCommand()
+{
+ return _CMAKE_COMMAND;
+}
+
+char const* GitRevision::GetBuildDirectory()
+{
+ return _BUILD_DIRECTORY;
+}
+
char const* GitRevision::GetSourceDirectory()
{
return _SOURCE_DIRECTORY;
@@ -32,19 +41,30 @@ char const* GitRevision::GetFullDatabase()
return _FULL_DATABASE;
}
-#define _PACKAGENAME "TrinityCore"
-
-char const* GitRevision::GetFullVersion()
-{
#if PLATFORM == PLATFORM_WINDOWS
-# ifdef _WIN64
- return _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Win64, " _BUILD_DIRECTIVE ")";
-# else
- return _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Win32, " _BUILD_DIRECTIVE ")";
-# endif
+# ifdef _WIN64
+# define TRINITY_PLATFORM_STR "Win64"
+# else
+# define TRINITY_PLATFORM_STR "Win32"
+# endif
+#elif PLATFORM == PLATFORM_APPLE
+# define TRINITY_PLATFORM_STR "MacOSX"
+#elif PLATFORM == PLATFORM_INTEL
+# define TRINITY_PLATFORM_STR "Intel"
+#else // PLATFORM_UNIX
+# define TRINITY_PLATFORM_STR "Unix"
+#endif
+
+#ifndef TRINITY_API_USE_DYNAMIC_LINKING
+# define TRINITY_LINKAGE_TYPE_STR "Static"
#else
- return _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Unix, " _BUILD_DIRECTIVE ")";
+# define TRINITY_LINKAGE_TYPE_STR "Dynamic"
#endif
+
+char const* GitRevision::GetFullVersion()
+{
+ return "TrinityCore rev. " VER_PRODUCTVERSION_STR
+ " (" TRINITY_PLATFORM_STR ", " _BUILD_DIRECTIVE ", " TRINITY_LINKAGE_TYPE_STR ")";
}
char const* GitRevision::GetCompanyNameStr()
@@ -66,13 +86,3 @@ char const* GitRevision::GetProductVersionStr()
{
return VER_PRODUCTVERSION_STR;
}
-
-char const* GitRevision::GetCompilerCFlags()
-{
- return COMPILER_C_FLAGS;
-}
-
-char const* GitRevision::GetCompilerCXXFlags()
-{
- return COMPILER_CXX_FLAGS;
-}
diff --git a/src/common/GitRevision.h b/src/common/GitRevision.h
index 8d2764ba861..aace8ad2076 100644
--- a/src/common/GitRevision.h
+++ b/src/common/GitRevision.h
@@ -19,22 +19,23 @@
#define __GITREVISION_H__
#include <string>
+#include "Define.h"
namespace GitRevision
{
- char const* GetHash();
- char const* GetDate();
- char const* GetBranch();
- char const* GetSourceDirectory();
- char const* GetMySQLExecutable();
- char const* GetFullDatabase();
- char const* GetFullVersion();
- char const* GetCompanyNameStr();
- char const* GetLegalCopyrightStr();
- char const* GetFileVersionStr();
- char const* GetProductVersionStr();
- char const* GetCompilerCFlags();
- char const* GetCompilerCXXFlags();
+ TC_COMMON_API char const* GetHash();
+ TC_COMMON_API char const* GetDate();
+ TC_COMMON_API char const* GetBranch();
+ TC_COMMON_API char const* GetCMakeCommand();
+ TC_COMMON_API char const* GetBuildDirectory();
+ TC_COMMON_API char const* GetSourceDirectory();
+ TC_COMMON_API char const* GetMySQLExecutable();
+ TC_COMMON_API char const* GetFullDatabase();
+ TC_COMMON_API char const* GetFullVersion();
+ TC_COMMON_API char const* GetCompanyNameStr();
+ TC_COMMON_API char const* GetLegalCopyrightStr();
+ TC_COMMON_API char const* GetFileVersionStr();
+ TC_COMMON_API char const* GetProductVersionStr();
}
#endif
diff --git a/src/common/Logging/Appender.h b/src/common/Logging/Appender.h
index f0bfe423a66..d24daa2b60d 100644
--- a/src/common/Logging/Appender.h
+++ b/src/common/Logging/Appender.h
@@ -41,7 +41,7 @@ enum LogLevel
const uint8 MaxLogLevels = 6;
-enum AppenderType
+enum AppenderType : uint8
{
APPENDER_NONE,
APPENDER_CONSOLE,
@@ -59,7 +59,7 @@ enum AppenderFlags
APPENDER_FLAGS_MAKE_FILE_BACKUP = 0x10 // only used by FileAppender
};
-struct LogMessage
+struct TC_COMMON_API LogMessage
{
LogMessage(LogLevel _level, std::string const& _type, std::string&& _text)
: level(_level), type(_type), text(std::forward<std::string>(_text)), mtime(time(NULL))
@@ -85,7 +85,7 @@ struct LogMessage
}
};
-class Appender
+class TC_COMMON_API Appender
{
public:
Appender(uint8 _id, std::string const& name, LogLevel level = LOG_LEVEL_DISABLED, AppenderFlags flags = APPENDER_FLAGS_NONE);
@@ -123,7 +123,7 @@ Appender* CreateAppender(uint8 id, std::string const& name, LogLevel level, Appe
return new AppenderImpl(id, name, level, flags, std::forward<ExtraAppenderArgs>(extraArgs));
}
-class InvalidAppenderArgsException : public std::length_error
+class TC_COMMON_API InvalidAppenderArgsException : public std::length_error
{
public:
explicit InvalidAppenderArgsException(std::string const& message) : std::length_error(message) { }
diff --git a/src/common/Logging/AppenderConsole.h b/src/common/Logging/AppenderConsole.h
index 5d7eae36b40..96d17207158 100644
--- a/src/common/Logging/AppenderConsole.h
+++ b/src/common/Logging/AppenderConsole.h
@@ -42,7 +42,7 @@ enum ColorTypes
const uint8 MaxColors = uint8(WHITE) + 1;
-class AppenderConsole : public Appender
+class TC_COMMON_API AppenderConsole : public Appender
{
public:
typedef std::integral_constant<AppenderType, APPENDER_CONSOLE>::type TypeIndex;
diff --git a/src/common/Logging/AppenderFile.h b/src/common/Logging/AppenderFile.h
index 9ba5d59259c..956b7a70b93 100644
--- a/src/common/Logging/AppenderFile.h
+++ b/src/common/Logging/AppenderFile.h
@@ -21,7 +21,7 @@
#include <atomic>
#include "Appender.h"
-class AppenderFile : public Appender
+class TC_COMMON_API AppenderFile : public Appender
{
public:
typedef std::integral_constant<AppenderType, APPENDER_FILE>::type TypeIndex;
diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp
index 4bd0487343d..f7a84fb8b47 100644
--- a/src/common/Logging/Log.cpp
+++ b/src/common/Logging/Log.cpp
@@ -214,13 +214,13 @@ void Log::ReadLoggersFromConfig()
AppenderConsole* appender = new AppenderConsole(NextAppenderId(), "Console", LOG_LEVEL_DEBUG, APPENDER_FLAGS_NONE, ExtraAppenderArgs());
appenders[appender->getId()] = appender;
- Logger& logger = loggers[LOGGER_ROOT];
- logger.Create(LOGGER_ROOT, LOG_LEVEL_ERROR);
- logger.addAppender(appender->getId(), appender);
+ Logger& rootLogger = loggers[LOGGER_ROOT];
+ rootLogger.Create(LOGGER_ROOT, LOG_LEVEL_ERROR);
+ rootLogger.addAppender(appender->getId(), appender);
- logger = loggers["server"];
- logger.Create("server", LOG_LEVEL_ERROR);
- logger.addAppender(appender->getId(), appender);
+ Logger& serverLogger = loggers["server"];
+ serverLogger.Create("server", LOG_LEVEL_INFO);
+ serverLogger.addAppender(appender->getId(), appender);
}
}
@@ -320,6 +320,12 @@ void Log::Close()
appenders.clear();
}
+Log* Log::instance()
+{
+ static Log instance;
+ return &instance;
+}
+
void Log::Initialize(boost::asio::io_service* ioService)
{
if (ioService)
@@ -331,6 +337,13 @@ void Log::Initialize(boost::asio::io_service* ioService)
LoadFromConfig();
}
+void Log::SetSynchronous()
+{
+ delete _strand;
+ _strand = nullptr;
+ _ioService = nullptr;
+}
+
void Log::LoadFromConfig()
{
Close();
diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h
index a90481ad5d2..6460e404c90 100644
--- a/src/common/Logging/Log.h
+++ b/src/common/Logging/Log.h
@@ -34,7 +34,7 @@
#define LOGGER_ROOT "root"
-class Log
+class TC_COMMON_API Log
{
typedef std::unordered_map<std::string, Logger> LoggerMap;
@@ -44,13 +44,10 @@ class Log
public:
- static Log* instance()
- {
- static Log instance;
- return &instance;
- }
+ static Log* instance();
void Initialize(boost::asio::io_service* ioService);
+ void SetSynchronous(); // Not threadsafe - should only be called from main() after all threads are joined
void LoadFromConfig();
void Close();
bool ShouldLog(std::string const& type, LogLevel level) const;
diff --git a/src/common/Logging/LogOperation.h b/src/common/Logging/LogOperation.h
index 618629b5423..56e2307d492 100644
--- a/src/common/Logging/LogOperation.h
+++ b/src/common/Logging/LogOperation.h
@@ -19,11 +19,12 @@
#define LOGOPERATION_H
#include <memory>
+#include "Define.h"
class Logger;
struct LogMessage;
-class LogOperation
+class TC_COMMON_API LogOperation
{
public:
LogOperation(Logger const* _logger, std::unique_ptr<LogMessage>&& _msg)
diff --git a/src/common/Logging/Logger.h b/src/common/Logging/Logger.h
index 67eab4295a4..4ac2e4494cc 100644
--- a/src/common/Logging/Logger.h
+++ b/src/common/Logging/Logger.h
@@ -20,7 +20,7 @@
#include "Appender.h"
-class Logger
+class TC_COMMON_API Logger
{
public:
Logger();
diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp
new file mode 100644
index 00000000000..9484cebcc72
--- /dev/null
+++ b/src/common/Metric/Metric.cpp
@@ -0,0 +1,235 @@
+/*
+* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation; either version 2 of the License, or (at your
+* option) any later version.
+*
+* This program is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+* more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "Metric.h"
+#include "Log.h"
+#include "Config.h"
+#include "Util.h"
+
+void Metric::Initialize(std::string const& realmName, boost::asio::io_service& ioService, std::function<void()> overallStatusLogger)
+{
+ _realmName = realmName;
+ _batchTimer = Trinity::make_unique<boost::asio::deadline_timer>(ioService);
+ _overallStatusTimer = Trinity::make_unique<boost::asio::deadline_timer>(ioService);
+ _overallStatusLogger = overallStatusLogger;
+ LoadFromConfigs();
+}
+
+bool Metric::Connect()
+{
+ _dataStream.connect(_hostname, _port);
+ auto error = _dataStream.error();
+ if (error)
+ {
+ TC_LOG_ERROR("metric", "Error connecting to '%s:%s', disabling Metric. Error message : %s",
+ _hostname.c_str(), _port.c_str(), error.message().c_str());
+ _enabled = false;
+ return false;
+ }
+ _dataStream.clear();
+ return true;
+}
+
+void Metric::LoadFromConfigs()
+{
+ bool previousValue = _enabled;
+ _enabled = sConfigMgr->GetBoolDefault("Metric.Enable", false);
+ _updateInterval = sConfigMgr->GetIntDefault("Metric.Interval", 10);
+ if (_updateInterval < 1)
+ {
+ TC_LOG_ERROR("metric", "'Metric.Interval' config set to %d, overriding to 1.", _updateInterval);
+ _updateInterval = 1;
+ }
+
+ _overallStatusTimerInterval = sConfigMgr->GetIntDefault("Metric.OverallStatusInterval", 1);
+ if (_overallStatusTimerInterval < 1)
+ {
+ TC_LOG_ERROR("metric", "'Metric.OverallStatusInterval' config set to %d, overriding to 1.", _overallStatusTimerInterval);
+ _overallStatusTimerInterval = 1;
+ }
+
+ // Schedule a send at this point only if the config changed from Disabled to Enabled.
+ // Cancel any scheduled operation if the config changed from Enabled to Disabled.
+ if (_enabled && !previousValue)
+ {
+ std::string connectionInfo = sConfigMgr->GetStringDefault("Metric.ConnectionInfo", "");
+ if (connectionInfo.empty())
+ {
+ TC_LOG_ERROR("metric", "'Metric.ConnectionInfo' not specified in configuration file.");
+ return;
+ }
+
+ Tokenizer tokens(connectionInfo, ';');
+ if (tokens.size() != 3)
+ {
+ TC_LOG_ERROR("metric", "'Metric.ConnectionInfo' specified with wrong format in configuration file.");
+ return;
+ }
+
+ _hostname.assign(tokens[0]);
+ _port.assign(tokens[1]);
+ _databaseName.assign(tokens[2]);
+ Connect();
+
+ ScheduleSend();
+ ScheduleOverallStatusLog();
+ }
+}
+
+void Metric::Update()
+{
+ if (_overallStatusTimerTriggered)
+ {
+ _overallStatusTimerTriggered = false;
+ _overallStatusLogger();
+ }
+}
+
+void Metric::LogEvent(std::string const& category, std::string const& title, std::string const& description)
+{
+ using namespace std::chrono;
+
+ MetricData* data = new MetricData;
+ data->Category = category;
+ data->Timestamp = system_clock::now();
+ data->Type = METRIC_DATA_EVENT;
+ data->Title = title;
+ data->Text = description;
+
+ _queuedData.Enqueue(data);
+}
+
+void Metric::SendBatch()
+{
+ using namespace std::chrono;
+
+ std::stringstream batchedData;
+ MetricData* data;
+ bool firstLoop = true;
+ while (_queuedData.Dequeue(data))
+ {
+ if (!firstLoop)
+ batchedData << "\n";
+
+ batchedData << data->Category;
+ if (!_realmName.empty())
+ batchedData << ",realm=" << _realmName;
+
+ batchedData << " ";
+
+ switch (data->Type)
+ {
+ case METRIC_DATA_VALUE:
+ batchedData << "value=" << data->Value;
+ break;
+ case METRIC_DATA_EVENT:
+ batchedData << "title=\"" << data->Title << "\",text=\"" << data->Text << "\"";
+ break;
+ }
+
+ batchedData << " ";
+
+ batchedData << std::to_string(duration_cast<nanoseconds>(data->Timestamp.time_since_epoch()).count());
+
+ firstLoop = false;
+ delete data;
+ }
+
+ // Check if there's any data to send
+ if (batchedData.tellp() == std::streampos(0))
+ {
+ ScheduleSend();
+ return;
+ }
+
+ if (!_dataStream.good() && !Connect())
+ return;
+
+ _dataStream << "POST " << "/write?db=" << _databaseName << " HTTP/1.1\r\n";
+ _dataStream << "Host: " << _hostname << ":" << _port << "\r\n";
+ _dataStream << "Accept: */*\r\n";
+ _dataStream << "Content-Type: application/octet-stream\r\n";
+ _dataStream << "Content-Transfer-Encoding: binary\r\n";
+
+ _dataStream << "Content-Length: " << std::to_string(batchedData.tellp()) << "\r\n\r\n";
+ _dataStream << batchedData.rdbuf();
+
+ std::string http_version;
+ _dataStream >> http_version;
+ unsigned int status_code = 0;
+ _dataStream >> status_code;
+ if (status_code != 204)
+ {
+ TC_LOG_ERROR("metric", "Error sending data, returned HTTP code: %u", status_code);
+ }
+
+ // Read and ignore the status description
+ std::string status_description;
+ std::getline(_dataStream, status_description);
+ // Read headers
+ std::string header;
+ while (std::getline(_dataStream, header) && header != "\r")
+ {
+ if (header == "Connection: close\r")
+ _dataStream.close();
+ }
+
+ ScheduleSend();
+}
+
+void Metric::ScheduleSend()
+{
+ if (_enabled)
+ {
+ _batchTimer->expires_from_now(boost::posix_time::seconds(_updateInterval));
+ _batchTimer->async_wait(std::bind(&Metric::SendBatch, this));
+ }
+ else
+ {
+ _dataStream.close();
+ MetricData* data;
+ // Clear the queue
+ while (_queuedData.Dequeue(data))
+ ;
+ }
+}
+
+void Metric::ForceSend()
+{
+ // Send what's queued only if io_service is stopped (so only on shutdown)
+ if (_enabled && _batchTimer->get_io_service().stopped())
+ SendBatch();
+}
+
+void Metric::ScheduleOverallStatusLog()
+{
+ if (_enabled)
+ {
+ _overallStatusTimer->expires_from_now(boost::posix_time::seconds(_overallStatusTimerInterval));
+ _overallStatusTimer->async_wait([this](const boost::system::error_code&)
+ {
+ _overallStatusTimerTriggered = true;
+ ScheduleOverallStatusLog();
+ });
+ }
+}
+
+Metric* Metric::instance()
+{
+ static Metric instance;
+ return &instance;
+}
diff --git a/src/common/Metric/Metric.h b/src/common/Metric/Metric.h
new file mode 100644
index 00000000000..1855e1d0098
--- /dev/null
+++ b/src/common/Metric/Metric.h
@@ -0,0 +1,141 @@
+/*
+* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation; either version 2 of the License, or (at your
+* option) any later version.
+*
+* This program is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+* more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef METRIC_H__
+#define METRIC_H__
+
+#include "Common.h"
+#include "Threading/MPSCQueue.h"
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/algorithm/string.hpp>
+#include <type_traits>
+
+enum MetricDataType
+{
+ METRIC_DATA_VALUE,
+ METRIC_DATA_EVENT
+};
+
+struct MetricData
+{
+ std::string Category;
+ std::chrono::time_point<std::chrono::system_clock> Timestamp;
+ MetricDataType Type;
+
+ // LogValue-specific fields
+ std::string Value;
+
+ // LogEvent-specific fields
+ std::string Title;
+ std::string Text;
+};
+
+class TC_COMMON_API Metric
+{
+private:
+ boost::asio::ip::tcp::iostream _dataStream;
+ MPSCQueue<MetricData> _queuedData;
+ std::unique_ptr<boost::asio::deadline_timer> _batchTimer;
+ std::unique_ptr<boost::asio::deadline_timer> _overallStatusTimer;
+ int32 _updateInterval = 0;
+ int32 _overallStatusTimerInterval = 0;
+ bool _enabled = false;
+ bool _overallStatusTimerTriggered = false;
+ std::string _hostname;
+ std::string _port;
+ std::string _databaseName;
+ std::function<void()> _overallStatusLogger;
+ std::string _realmName;
+
+ bool Connect();
+ void SendBatch();
+ void ScheduleSend();
+ void ScheduleOverallStatusLog();
+
+ template<class T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
+ static std::string FormatInfluxDBValue(T value) { return std::to_string(value) + 'i'; }
+
+ static std::string FormatInfluxDBValue(std::string const& value)
+ {
+ return '"' + boost::replace_all_copy(value, "\"", "\\\"") + '"';
+ }
+
+ static std::string FormatInfluxDBValue(bool value) { return value ? "t" : "f"; }
+ static std::string FormatInfluxDBValue(const char* value) { return FormatInfluxDBValue(std::string(value)); }
+ static std::string FormatInfluxDBValue(double value) { return std::to_string(value); }
+ static std::string FormatInfluxDBValue(float value) { return FormatInfluxDBValue(double(value)); }
+
+public:
+ static Metric* instance();
+
+ void Initialize(std::string const& realmName, boost::asio::io_service& ioService, std::function<void()> overallStatusLogger = [](){});
+ void LoadFromConfigs();
+ void Update();
+
+ template<class T>
+ void LogValue(std::string const& category, T value)
+ {
+ using namespace std::chrono;
+
+ MetricData* data = new MetricData;
+ data->Category = category;
+ data->Timestamp = system_clock::now();
+ data->Type = METRIC_DATA_VALUE;
+ data->Value = FormatInfluxDBValue(value);
+
+ _queuedData.Enqueue(data);
+ }
+
+ void LogEvent(std::string const& category, std::string const& title, std::string const& description);
+
+ void ForceSend();
+ bool IsEnabled() const { return _enabled; }
+};
+
+#define sMetric Metric::instance()
+
+#if PLATFORM != PLATFORM_WINDOWS
+#define TC_METRIC_EVENT(category, title, description) \
+ do { \
+ if (sMetric->IsEnabled()) \
+ sMetric->LogEvent(category, title, description); \
+ } while (0)
+#define TC_METRIC_VALUE(category, value) \
+ do { \
+ if (sMetric->IsEnabled()) \
+ sMetric->LogValue(category, value); \
+ } while (0)
+#else
+#define TC_METRIC_EVENT(category, title, description) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable:4127)) \
+ do { \
+ if (sMetric->IsEnabled()) \
+ sMetric->LogEvent(category, title, description); \
+ } while (0) \
+ __pragma(warning(pop))
+#define TC_METRIC_VALUE(category, value) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable:4127)) \
+ do { \
+ if (sMetric->IsEnabled()) \
+ sMetric->LogValue(category, value); \
+ } while (0) \
+ __pragma(warning(pop))
+#endif
+
+#endif // METRIC_H__
diff --git a/src/server/shared/Service/ServiceWin32.cpp b/src/common/Platform/ServiceWin32.cpp
index b6a1682993b..3c34f3e322c 100644
--- a/src/server/shared/Service/ServiceWin32.cpp
+++ b/src/common/Platform/ServiceWin32.cpp
@@ -261,4 +261,3 @@ bool WinServiceRun()
return true;
}
#endif
-
diff --git a/src/server/shared/Service/ServiceWin32.h b/src/common/Platform/ServiceWin32.h
index 3d67bfe5445..b892ba4e3b6 100644
--- a/src/server/shared/Service/ServiceWin32.h
+++ b/src/common/Platform/ServiceWin32.h
@@ -26,4 +26,3 @@ bool WinServiceRun();
#endif // _WIN32_SERVICE_
#endif // _WIN32
-
diff --git a/src/common/Threading/LockedQueue.h b/src/common/Threading/LockedQueue.h
index c6faaaf81ca..21a29d7e53b 100644
--- a/src/common/Threading/LockedQueue.h
+++ b/src/common/Threading/LockedQueue.h
@@ -57,6 +57,14 @@ public:
unlock();
}
+ //! Adds items back to front of the queue
+ template<class Iterator>
+ void readd(Iterator begin, Iterator end)
+ {
+ std::lock_guard<std::mutex> lock(_lock);
+ _queue.insert(_queue.begin(), begin, end);
+ }
+
//! Gets the next result in the queue, if any.
bool next(T& result)
{
diff --git a/src/common/Threading/MPSCQueue.h b/src/common/Threading/MPSCQueue.h
new file mode 100644
index 00000000000..09648b844be
--- /dev/null
+++ b/src/common/Threading/MPSCQueue.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MPSCQueue_h__
+#define MPSCQueue_h__
+
+#include <atomic>
+#include <utility>
+
+// C++ implementation of Dmitry Vyukov's lock free MPSC queue
+// http://www.1024cores.net/home/lock-free-algorithms/queues/non-intrusive-mpsc-node-based-queue
+template<typename T>
+class MPSCQueue
+{
+public:
+ MPSCQueue() : _head(new Node()), _tail(_head.load(std::memory_order_relaxed))
+ {
+ Node* front = _head.load(std::memory_order_relaxed);
+ front->Next.store(nullptr, std::memory_order_relaxed);
+ }
+
+ ~MPSCQueue()
+ {
+ T* output;
+ while (this->Dequeue(output))
+ ;
+
+ Node* front = _head.load(std::memory_order_relaxed);
+ delete front;
+ }
+
+ void Enqueue(T* input)
+ {
+ Node* node = new Node(input);
+ Node* prevHead = _head.exchange(node, std::memory_order_acq_rel);
+ prevHead->Next.store(node, std::memory_order_release);
+ }
+
+ bool Dequeue(T*& result)
+ {
+ Node* tail = _tail.load(std::memory_order_relaxed);
+ Node* next = tail->Next.load(std::memory_order_acquire);
+ if (!next)
+ return false;
+
+ result = next->Data;
+ _tail.store(next, std::memory_order_release);
+ delete tail;
+ return true;
+ }
+
+private:
+ struct Node
+ {
+ Node() = default;
+ explicit Node(T* data) : Data(data) { Next.store(nullptr, std::memory_order_relaxed); }
+
+ T* Data;
+ std::atomic<Node*> Next;
+ };
+
+ std::atomic<Node*> _head;
+ std::atomic<Node*> _tail;
+
+ MPSCQueue(MPSCQueue const&) = delete;
+ MPSCQueue& operator=(MPSCQueue const&) = delete;
+};
+
+#endif // MPSCQueue_h__
diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h
index f3e9432ca4c..5edb245fd87 100644
--- a/src/common/Utilities/Containers.h
+++ b/src/common/Utilities/Containers.h
@@ -20,6 +20,7 @@
#include "Define.h"
#include "Random.h"
+#include "Util.h"
#include <algorithm>
#include <functional>
#include <list>
@@ -30,9 +31,9 @@ namespace Trinity
namespace Containers
{
template<class T>
- void RandomResizeList(std::list<T> &list, uint32 size)
+ void RandomResizeList(std::list<T>& list, uint32 size)
{
- size_t list_size = list.size();
+ uint32 list_size = uint32(list.size());
while (list_size > size)
{
@@ -55,7 +56,7 @@ namespace Trinity
if (size)
RandomResizeList(listCopy, size);
- list = listCopy;
+ list = std::move(listCopy);
}
/*
@@ -67,7 +68,7 @@ namespace Trinity
typename C::value_type const& SelectRandomContainerElement(C const& container)
{
typename C::const_iterator it = container.begin();
- std::advance(it, urand(0, container.size() - 1));
+ std::advance(it, urand(0, uint32(container.size()) - 1));
return *it;
}
@@ -117,6 +118,19 @@ namespace Trinity
}
/**
+ * @fn void Trinity::Containers::RandomShuffle(C& container)
+ *
+ * @brief Reorder the elements of the container randomly.
+ *
+ * @param container Container to reorder
+ */
+ template <class C>
+ void RandomShuffle(C& container)
+ {
+ std::shuffle(container.begin(), container.end(), SFMTEngine::Instance());
+ }
+
+ /**
* @fn bool Trinity::Containers::Intersects(Iterator first1, Iterator last1, Iterator first2, Iterator last2)
*
* @brief Checks if two SORTED containers have a common element
@@ -156,7 +170,6 @@ namespace Trinity
++itr;
}
}
-
}
//! namespace Containers
}
diff --git a/src/common/Utilities/EventMap.h b/src/common/Utilities/EventMap.h
index a1aaa9af269..6a314a9e633 100644
--- a/src/common/Utilities/EventMap.h
+++ b/src/common/Utilities/EventMap.h
@@ -22,7 +22,7 @@
#include "Duration.h"
#include "Util.h"
-class EventMap
+class TC_COMMON_API EventMap
{
/**
* Internal storage type.
@@ -122,7 +122,7 @@ public:
*/
void ScheduleEvent(uint32 eventId, Milliseconds const& time, uint32 group = 0, uint8 phase = 0)
{
- ScheduleEvent(eventId, time.count(), group, phase);
+ ScheduleEvent(eventId, uint32(time.count()), group, phase);
}
/**
@@ -145,7 +145,7 @@ public:
*/
void RescheduleEvent(uint32 eventId, Milliseconds const& time, uint32 group = 0, uint8 phase = 0)
{
- RescheduleEvent(eventId, time.count(), group, phase);
+ RescheduleEvent(eventId, uint32(time.count()), group, phase);
}
/**
@@ -169,7 +169,7 @@ public:
*/
void Repeat(Milliseconds const& time)
{
- Repeat(time.count());
+ Repeat(uint32(time.count()));
}
/**
@@ -190,7 +190,7 @@ public:
*/
void Repeat(Milliseconds const& minTime, Milliseconds const& maxTime)
{
- Repeat(minTime.count(), maxTime.count());
+ Repeat(uint32(minTime.count()), uint32(maxTime.count()));
}
/**
@@ -218,7 +218,7 @@ public:
*/
void DelayEvents(Milliseconds const& delay)
{
- DelayEvents(delay.count());
+ DelayEvents(uint32(delay.count()));
}
/**
@@ -239,7 +239,7 @@ public:
*/
void DelayEvents(Milliseconds const& delay, uint32 group)
{
- DelayEvents(delay.count(), group);
+ DelayEvents(uint32(delay.count()), group);
}
/**
diff --git a/src/common/Utilities/EventProcessor.cpp b/src/common/Utilities/EventProcessor.cpp
index be74d58b790..2341d0a0872 100644
--- a/src/common/Utilities/EventProcessor.cpp
+++ b/src/common/Utilities/EventProcessor.cpp
@@ -17,11 +17,20 @@
*/
#include "EventProcessor.h"
+#include "Errors.h"
-EventProcessor::EventProcessor()
+void BasicEvent::ScheduleAbort()
{
- m_time = 0;
- m_aborting = false;
+ ASSERT(IsRunning()
+ && "Tried to scheduled the abortion of an event twice!");
+ m_abortState = AbortState::STATE_ABORT_SCHEDULED;
+}
+
+void BasicEvent::SetAborted()
+{
+ ASSERT(!IsAborted()
+ && "Tried to abort an already aborted event!");
+ m_abortState = AbortState::STATE_ABORTED;
}
EventProcessor::~EventProcessor()
@@ -39,55 +48,73 @@ void EventProcessor::Update(uint32 p_time)
while (((i = m_events.begin()) != m_events.end()) && i->first <= m_time)
{
// get and remove event from queue
- BasicEvent* Event = i->second;
+ BasicEvent* event = i->second;
m_events.erase(i);
- if (!Event->to_Abort)
+ if (event->IsRunning())
{
- if (Event->Execute(m_time, p_time))
+ if (event->Execute(m_time, p_time))
{
// completely destroy event if it is not re-added
- delete Event;
+ delete event;
}
+ continue;
}
- else
+
+ if (event->IsAbortScheduled())
{
- Event->Abort(m_time);
- delete Event;
+ event->Abort(m_time);
+ // Mark the event as aborted
+ event->SetAborted();
}
+
+ if (event->IsDeletable())
+ {
+ delete event;
+ continue;
+ }
+
+ // Reschedule non deletable events to be checked at
+ // the next update tick
+ AddEvent(event, CalculateTime(1), false);
}
}
void EventProcessor::KillAllEvents(bool force)
{
- // prevent event insertions
- m_aborting = true;
-
- // first, abort all existing events
- for (EventList::iterator i = m_events.begin(); i != m_events.end();)
+ for (auto itr = m_events.begin(); itr != m_events.end();)
{
- EventList::iterator i_old = i;
- ++i;
-
- i_old->second->to_Abort = true;
- i_old->second->Abort(m_time);
- if (force || i_old->second->IsDeletable())
+ // Abort events which weren't aborted already
+ if (!itr->second->IsAborted())
{
- delete i_old->second;
+ itr->second->SetAborted();
+ itr->second->Abort(m_time);
+ }
- if (!force) // need per-element cleanup
- m_events.erase (i_old);
+ // Skip non-deletable events when we are
+ // not forcing the event cancellation.
+ if (!force && !itr->second->IsDeletable())
+ {
+ ++itr;
+ continue;
}
+
+ delete itr->second;
+
+ if (force)
+ ++itr; // Clear the whole container when forcing
+ else
+ itr = m_events.erase(itr);
}
- // fast clear event list (in force case)
if (force)
m_events.clear();
}
void EventProcessor::AddEvent(BasicEvent* Event, uint64 e_time, bool set_addtime)
{
- if (set_addtime) Event->m_addTime = m_time;
+ if (set_addtime)
+ Event->m_addTime = m_time;
Event->m_execTime = e_time;
m_events.insert(std::pair<uint64, BasicEvent*>(e_time, Event));
}
@@ -96,4 +123,3 @@ uint64 EventProcessor::CalculateTime(uint64 t_offset) const
{
return(m_time + t_offset);
}
-
diff --git a/src/common/Utilities/EventProcessor.h b/src/common/Utilities/EventProcessor.h
index e5eafed79b9..57f3065f323 100644
--- a/src/common/Utilities/EventProcessor.h
+++ b/src/common/Utilities/EventProcessor.h
@@ -20,20 +20,27 @@
#define __EVENTPROCESSOR_H
#include "Define.h"
-
#include <map>
+class EventProcessor;
+
// Note. All times are in milliseconds here.
-class BasicEvent
+class TC_COMMON_API BasicEvent
{
+ friend class EventProcessor;
+
+ enum class AbortState : uint8
+ {
+ STATE_RUNNING,
+ STATE_ABORT_SCHEDULED,
+ STATE_ABORTED
+ };
+
public:
BasicEvent()
- {
- to_Abort = false;
- m_addTime = 0;
- m_execTime = 0;
- }
+ : m_abortState(AbortState::STATE_RUNNING), m_addTime(0), m_execTime(0) { }
+
virtual ~BasicEvent() { } // override destructor to perform some actions on event removal
// this method executes when the event is triggered
@@ -45,8 +52,16 @@ class BasicEvent
virtual void Abort(uint64 /*e_time*/) { } // this method executes when the event is aborted
- bool to_Abort; // set by externals when the event is aborted, aborted events don't execute
- // and get Abort call when deleted
+ // Aborts the event at the next update tick
+ void ScheduleAbort();
+
+ private:
+ void SetAborted();
+ bool IsRunning() const { return (m_abortState == AbortState::STATE_RUNNING); }
+ bool IsAbortScheduled() const { return (m_abortState == AbortState::STATE_ABORT_SCHEDULED); }
+ bool IsAborted() const { return (m_abortState == AbortState::STATE_ABORTED); }
+
+ AbortState m_abortState; // set by externals when the event is aborted, aborted events don't execute
// these can be used for time offset control
uint64 m_addTime; // time when the event was added to queue, filled by event handler
@@ -55,19 +70,20 @@ class BasicEvent
typedef std::multimap<uint64, BasicEvent*> EventList;
-class EventProcessor
+class TC_COMMON_API EventProcessor
{
public:
- EventProcessor();
+ EventProcessor() : m_time(0) { }
~EventProcessor();
void Update(uint32 p_time);
void KillAllEvents(bool force);
void AddEvent(BasicEvent* Event, uint64 e_time, bool set_addtime = true);
uint64 CalculateTime(uint64 t_offset) const;
+
protected:
uint64 m_time;
EventList m_events;
- bool m_aborting;
};
+
#endif
diff --git a/src/server/shared/Networking/MessageBuffer.h b/src/common/Utilities/MessageBuffer.h
index 189a56f18b6..d08c4b25bab 100644
--- a/src/server/shared/Networking/MessageBuffer.h
+++ b/src/common/Utilities/MessageBuffer.h
@@ -20,6 +20,7 @@
#include "Define.h"
#include <vector>
+#include <cstring>
class MessageBuffer
{
@@ -105,7 +106,7 @@ public:
return std::move(_storage);
}
- MessageBuffer& operator=(MessageBuffer& right)
+ MessageBuffer& operator=(MessageBuffer const& right)
{
if (this != &right)
{
diff --git a/src/common/Utilities/Random.cpp b/src/common/Utilities/Random.cpp
index cc013110b01..31318e8f52d 100644
--- a/src/common/Utilities/Random.cpp
+++ b/src/common/Utilities/Random.cpp
@@ -61,6 +61,14 @@ float frand(float min, float max)
return float(GetRng()->Random() * (max - min) + min);
}
+Milliseconds randtime(Milliseconds const& min, Milliseconds const& max)
+{
+ long long diff = max.count() - min.count();
+ ASSERT(diff >= 0);
+ ASSERT(diff <= (uint32)-1);
+ return min + Milliseconds(urand(0, diff));
+}
+
uint32 rand32()
{
return GetRng()->BRandom();
diff --git a/src/common/Utilities/Random.h b/src/common/Utilities/Random.h
index 5610651a83b..b3ca00219ef 100644
--- a/src/common/Utilities/Random.h
+++ b/src/common/Utilities/Random.h
@@ -19,29 +19,33 @@
#define Random_h__
#include "Define.h"
+#include "Duration.h"
#include <limits>
#include <random>
/* Return a random number in the range min..max. */
-int32 irand(int32 min, int32 max);
+TC_COMMON_API int32 irand(int32 min, int32 max);
/* Return a random number in the range min..max (inclusive). */
-uint32 urand(uint32 min, uint32 max);
+TC_COMMON_API uint32 urand(uint32 min, uint32 max);
/* Return a random millisecond value between min and max seconds. Functionally equivalent to urand(min*IN_MILLISECONDS, max*IN_MILLISECONDS). */
-uint32 urandms(uint32 min, uint32 max);
+TC_COMMON_API uint32 urandms(uint32 min, uint32 max);
/* Return a random number in the range 0 .. UINT32_MAX. */
-uint32 rand32();
+TC_COMMON_API uint32 rand32();
+
+/* Return a random time in the range min..max (up to millisecond precision). Only works for values where millisecond difference is a valid uint32. */
+TC_COMMON_API Milliseconds randtime(Milliseconds const& min, Milliseconds const& max);
/* Return a random number in the range min..max */
-float frand(float min, float max);
+TC_COMMON_API float frand(float min, float max);
/* Return a random double from 0.0 to 1.0 (exclusive). */
-double rand_norm();
+TC_COMMON_API double rand_norm();
/* Return a random double from 0.0 to 100.0 (exclusive). */
-double rand_chance();
+TC_COMMON_API double rand_chance();
/* Return true if a random roll fits in the specified chance (range 0-100). */
inline bool roll_chance_f(float chance)
@@ -58,7 +62,7 @@ inline bool roll_chance_i(int chance)
/*
* SFMT wrapper satisfying UniformRandomNumberGenerator concept for use in <random> algorithms
*/
-class SFMTEngine
+class TC_COMMON_API SFMTEngine
{
public:
typedef uint32 result_type;
diff --git a/src/common/Utilities/StartProcess.cpp b/src/common/Utilities/StartProcess.cpp
new file mode 100644
index 00000000000..f35c6de3b5c
--- /dev/null
+++ b/src/common/Utilities/StartProcess.cpp
@@ -0,0 +1,269 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "StartProcess.h"
+
+#include <atomic>
+#include <thread>
+#include <functional>
+
+#include <boost/algorithm/string/join.hpp>
+#include <boost/iostreams/stream.hpp>
+#include <boost/iostreams/copy.hpp>
+#include <boost/iostreams/concepts.hpp>
+#include <boost/iostreams/device/file_descriptor.hpp>
+#include <boost/process.hpp>
+#include <boost/system/system_error.hpp>
+
+#include "Common.h"
+#include "Log.h"
+
+using namespace boost::process;
+using namespace boost::process::initializers;
+using namespace boost::iostreams;
+
+namespace Trinity {
+
+template<typename T>
+class TCLogSink
+{
+ T callback_;
+
+public:
+ typedef char char_type;
+ typedef sink_tag category;
+
+ // Requires a callback type which has a void(std::string) signature
+ TCLogSink(T callback)
+ : callback_(std::move(callback)) { }
+
+ std::streamsize write(const char* str, std::streamsize size)
+ {
+ callback_(std::string(str, size));
+ return size;
+ }
+};
+
+template<typename T>
+auto MakeTCLogSink(T&& callback)
+ -> TCLogSink<typename std::decay<T>::type>
+{
+ return { std::forward<T>(callback) };
+}
+
+template<typename T>
+static int CreateChildProcess(T waiter, std::string const& executable,
+ std::vector<std::string> const& args,
+ std::string const& logger, std::string const& input,
+ bool secure)
+{
+ auto outPipe = create_pipe();
+ auto errPipe = create_pipe();
+
+ Optional<file_descriptor_source> inputSource;
+
+ if (!secure)
+ {
+ TC_LOG_TRACE(logger, "Starting process \"%s\" with arguments: \"%s\".",
+ executable.c_str(), boost::algorithm::join(args, " ").c_str());
+ }
+
+ // Start the child process
+ child c = [&]
+ {
+ if (!input.empty())
+ {
+ inputSource = file_descriptor_source(input);
+
+ // With binding stdin
+ return execute(run_exe(boost::filesystem::absolute(executable)),
+ set_args(args),
+ inherit_env(),
+ bind_stdin(*inputSource),
+ bind_stdout(file_descriptor_sink(outPipe.sink, close_handle)),
+ bind_stderr(file_descriptor_sink(errPipe.sink, close_handle)));
+ }
+ else
+ {
+ // Without binding stdin
+ return execute(run_exe(boost::filesystem::absolute(executable)),
+ set_args(args),
+ inherit_env(),
+ bind_stdout(file_descriptor_sink(outPipe.sink, close_handle)),
+ bind_stderr(file_descriptor_sink(errPipe.sink, close_handle)));
+ }
+ }();
+
+ file_descriptor_source outFd(outPipe.source, close_handle);
+ file_descriptor_source errFd(errPipe.source, close_handle);
+
+ auto outInfo = MakeTCLogSink([&](std::string msg)
+ {
+ TC_LOG_INFO(logger, "%s", msg.c_str());
+ });
+
+ auto outError = MakeTCLogSink([&](std::string msg)
+ {
+ TC_LOG_ERROR(logger, "%s", msg.c_str());
+ });
+
+ copy(outFd, outInfo);
+ copy(errFd, outError);
+
+ // Call the waiter in the current scope to prevent
+ // the streams from closing too early on leaving the scope.
+ int const result = waiter(c);
+
+ if (!secure)
+ {
+ TC_LOG_TRACE(logger, ">> Process \"%s\" finished with return value %i.",
+ executable.c_str(), result);
+ }
+
+ if (inputSource)
+ inputSource->close();
+
+ return result;
+}
+
+int StartProcess(std::string const& executable, std::vector<std::string> const& args,
+ std::string const& logger, std::string input_file, bool secure)
+{
+ return CreateChildProcess([](child& c) -> int
+ {
+ try
+ {
+ return wait_for_exit(c);
+ }
+ catch (...)
+ {
+ return EXIT_FAILURE;
+ }
+ }, executable, args, logger, input_file, secure);
+}
+
+class AsyncProcessResultImplementation
+ : public AsyncProcessResult
+{
+ std::string const executable;
+ std::vector<std::string> const args;
+ std::string const logger;
+ std::string const input_file;
+ bool const is_secure;
+
+ std::atomic<bool> was_terminated;
+
+ // Workaround for missing move support in boost < 1.57
+ Optional<std::shared_ptr<std::future<int>>> result;
+ Optional<std::reference_wrapper<child>> my_child;
+
+public:
+ explicit AsyncProcessResultImplementation(std::string executable_, std::vector<std::string> args_,
+ std::string logger_, std::string input_file_,
+ bool secure)
+ : executable(std::move(executable_)), args(std::move(args_)),
+ logger(std::move(logger_)), input_file(input_file_),
+ is_secure(secure), was_terminated(false) { }
+
+ AsyncProcessResultImplementation(AsyncProcessResultImplementation const&) = delete;
+ AsyncProcessResultImplementation& operator= (AsyncProcessResultImplementation const&) = delete;
+ AsyncProcessResultImplementation(AsyncProcessResultImplementation&&) = delete;
+ AsyncProcessResultImplementation& operator= (AsyncProcessResultImplementation&&) = delete;
+
+ int StartProcess()
+ {
+ ASSERT(!my_child, "Process started already!");
+
+ return CreateChildProcess([&](child& c) -> int
+ {
+ int result;
+ my_child = std::reference_wrapper<child>(c);
+
+ try
+ {
+ result = wait_for_exit(c);
+ }
+ catch (...)
+ {
+ result = EXIT_FAILURE;
+ }
+
+ my_child.reset();
+ return was_terminated ? EXIT_FAILURE : result;
+
+ }, executable, args, logger, input_file, is_secure);
+ }
+
+ void SetFuture(std::future<int> result_)
+ {
+ result = std::make_shared<std::future<int>>(std::move(result_));
+ }
+
+ /// Returns the future which contains the result of the process
+ /// as soon it is finished.
+ std::future<int>& GetFutureResult() override
+ {
+ ASSERT(*result, "The process wasn't started!");
+ return **result;
+ }
+
+ /// Tries to terminate the process
+ void Terminate() override
+ {
+ if (!my_child)
+ {
+ was_terminated = true;
+ try
+ {
+ terminate(my_child->get());
+ }
+ catch(...)
+ {
+ // Do nothing
+ }
+ }
+ }
+};
+
+std::shared_ptr<AsyncProcessResult>
+ StartAsyncProcess(std::string executable, std::vector<std::string> args,
+ std::string logger, std::string input_file, bool secure)
+{
+ auto handle = std::make_shared<AsyncProcessResultImplementation>(
+ std::move(executable), std::move(args), std::move(logger), std::move(input_file), secure);
+
+ handle->SetFuture(std::async(std::launch::async, [handle] { return handle->StartProcess(); }));
+ return handle;
+}
+
+Optional<std::string> SearchExecutableInPath(std::string const& filename)
+{
+ try
+ {
+ auto result = search_path(filename);
+ if (result.empty())
+ return boost::none;
+ else
+ return result;
+ }
+ catch (...)
+ {
+ return boost::none;
+ }
+}
+
+} // namespace Trinity
diff --git a/src/common/Utilities/StartProcess.h b/src/common/Utilities/StartProcess.h
new file mode 100644
index 00000000000..3b380bd4f4e
--- /dev/null
+++ b/src/common/Utilities/StartProcess.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef Process_h__
+#define Process_h__
+
+#include <future>
+#include <memory>
+#include "Common.h"
+
+namespace Trinity {
+
+/// Starts a process with the given arguments and parameters and will block
+/// until the process is finished.
+/// When an input path is given, the file will be routed to the processes stdin.
+/// When the process is marked as secure no arguments are leaked to logs.
+/// Note that most executables expect it's name as the first argument.
+TC_COMMON_API int StartProcess(std::string const& executable, std::vector<std::string> const& args,
+ std::string const& logger, std::string input_file = "",
+ bool secure = false);
+
+/// Platform and library independent representation
+/// of asynchronous process results
+class AsyncProcessResult
+{
+public:
+ virtual ~AsyncProcessResult() { }
+
+ /// Returns the future which contains the result of the process
+ /// as soon it is finished.
+ virtual std::future<int>& GetFutureResult() = 0;
+
+ /// Tries to terminate the process
+ virtual void Terminate() = 0;
+};
+
+/// Starts a process asynchronously with the given arguments and parameters and
+/// returns an AsyncProcessResult immediately which is set, when the process exits.
+/// When an input path is given, the file will be routed to the processes stdin.
+/// When the process is marked as secure no arguments are leaked to logs.
+/// Note that most executables expect it's name as the first argument.
+TC_COMMON_API std::shared_ptr<AsyncProcessResult>
+ StartAsyncProcess(std::string executable, std::vector<std::string> args,
+ std::string logger, std::string input_file = "",
+ bool secure = false);
+
+/// Searches for the given executable in the PATH variable
+/// and returns a present optional when it was found.
+TC_COMMON_API Optional<std::string> SearchExecutableInPath(std::string const& filename);
+
+} // namespace Trinity
+
+#endif // Process_h__
diff --git a/src/common/Utilities/StringFormat.h b/src/common/Utilities/StringFormat.h
index d85523bc11f..e21b1024e87 100644
--- a/src/common/Utilities/StringFormat.h
+++ b/src/common/Utilities/StringFormat.h
@@ -19,7 +19,7 @@
#ifndef TRINITYCORE_STRING_FORMAT_H
#define TRINITYCORE_STRING_FORMAT_H
-#include "format.h"
+#include "cppformat/format.h"
namespace Trinity
{
diff --git a/src/common/Utilities/TaskScheduler.h b/src/common/Utilities/TaskScheduler.h
index 8cf5d914128..6784c968683 100644
--- a/src/common/Utilities/TaskScheduler.h
+++ b/src/common/Utilities/TaskScheduler.h
@@ -46,7 +46,7 @@ class TaskContext;
/// with the same duration or a new one.
/// It also provides access to the repeat counter which is useful for task that repeat itself often
/// but behave different every time (spoken event dialogs for example).
-class TaskScheduler
+class TC_COMMON_API TaskScheduler
{
friend class TaskContext;
@@ -131,7 +131,7 @@ class TaskScheduler
};
};
- class TaskQueue
+ class TC_COMMON_API TaskQueue
{
std::multiset<TaskContainer, Compare> container;
@@ -401,14 +401,14 @@ private:
auto const milli_max = std::chrono::duration_cast<std::chrono::milliseconds>(max);
// TC specific: use SFMT URandom
- return std::chrono::milliseconds(urand(milli_min.count(), milli_max.count()));
+ return std::chrono::milliseconds(urand(uint32(milli_min.count()), uint32(milli_max.count())));
}
/// Dispatch remaining tasks
void Dispatch(success_t const& callback);
};
-class TaskContext
+class TC_COMMON_API TaskContext
{
friend class TaskScheduler;
diff --git a/src/common/Utilities/Timer.h b/src/common/Utilities/Timer.h
index cdce08caaf0..f66bb90c98e 100644
--- a/src/common/Utilities/Timer.h
+++ b/src/common/Utilities/Timer.h
@@ -25,9 +25,9 @@ inline uint32 getMSTime()
{
using namespace std::chrono;
- static const system_clock::time_point ApplicationStartTime = system_clock::now();
+ static const steady_clock::time_point ApplicationStartTime = steady_clock::now();
- return uint32(duration_cast<milliseconds>(system_clock::now() - ApplicationStartTime).count());
+ return uint32(duration_cast<milliseconds>(steady_clock::now() - ApplicationStartTime).count());
}
inline uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp
index 1360253294f..3d8cda66d48 100644
--- a/src/common/Utilities/Util.cpp
+++ b/src/common/Utilities/Util.cpp
@@ -22,6 +22,7 @@
#include "utf8.h"
#include "Errors.h" // for ASSERT
#include <stdarg.h>
+#include <boost/algorithm/string/case_conv.hpp>
#if COMPILER == COMPILER_GNU
#include <sys/socket.h>
@@ -218,22 +219,29 @@ bool IsIPAddress(char const* ipaddress)
}
/// create PID file
-uint32 CreatePIDFile(const std::string& filename)
+uint32 CreatePIDFile(std::string const& filename)
{
- FILE* pid_file = fopen (filename.c_str(), "w" );
+ FILE* pid_file = fopen(filename.c_str(), "w");
if (pid_file == NULL)
return 0;
+ uint32 pid = GetPID();
+
+ fprintf(pid_file, "%u", pid);
+ fclose(pid_file);
+
+ return pid;
+}
+
+uint32 GetPID()
+{
#ifdef _WIN32
DWORD pid = GetCurrentProcessId();
#else
pid_t pid = getpid();
#endif
- fprintf(pid_file, "%u", pid );
- fclose(pid_file);
-
- return (uint32)pid;
+ return uint32(pid);
}
size_t utf8length(std::string& utf8str)
@@ -418,7 +426,7 @@ bool utf8ToConsole(const std::string& utf8str, std::string& conStr)
return false;
conStr.resize(wstr.size());
- CharToOemBuffW(&wstr[0], &conStr[0], wstr.size());
+ CharToOemBuffW(&wstr[0], &conStr[0], uint32(wstr.size()));
#else
// not implemented yet
conStr = utf8str;
@@ -432,7 +440,7 @@ bool consoleToUtf8(const std::string& conStr, std::string& utf8str)
#if PLATFORM == PLATFORM_WINDOWS
std::wstring wstr;
wstr.resize(conStr.size());
- OemToCharBuffW(&conStr[0], &wstr[0], conStr.size());
+ OemToCharBuffW(&conStr[0], &wstr[0], uint32(conStr.size()));
return WStrToUtf8(wstr, utf8str);
#else
@@ -450,7 +458,7 @@ bool Utf8FitTo(const std::string& str, std::wstring const& search)
return false;
// converting to lower case
- wstrToLower( temp );
+ wstrToLower(temp);
if (temp.find(search) == std::wstring::npos)
return false;
@@ -469,10 +477,10 @@ void utf8printf(FILE* out, const char *str, ...)
void vutf8printf(FILE* out, const char *str, va_list* ap)
{
#if PLATFORM == PLATFORM_WINDOWS
- char temp_buf[32*1024];
- wchar_t wtemp_buf[32*1024];
+ char temp_buf[32 * 1024];
+ wchar_t wtemp_buf[32 * 1024];
- size_t temp_len = vsnprintf(temp_buf, 32*1024, str, *ap);
+ size_t temp_len = vsnprintf(temp_buf, 32 * 1024, str, *ap);
//vsnprintf returns -1 if the buffer is too small
if (temp_len == size_t(-1))
temp_len = 32*1024-1;
@@ -480,13 +488,24 @@ void vutf8printf(FILE* out, const char *str, va_list* ap)
size_t wtemp_len = 32*1024-1;
Utf8toWStr(temp_buf, temp_len, wtemp_buf, wtemp_len);
- CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_len+1);
+ CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], uint32(wtemp_len + 1));
fprintf(out, "%s", temp_buf);
#else
vfprintf(out, str, *ap);
#endif
}
+bool Utf8ToUpperOnlyLatin(std::string& utf8String)
+{
+ std::wstring wstr;
+ if (!Utf8toWStr(utf8String, wstr))
+ return false;
+
+ std::transform(wstr.begin(), wstr.end(), wstr.begin(), wcharToUpperOnlyLatin);
+
+ return WStrToUtf8(wstr, utf8String);
+}
+
std::string ByteArrayToHexStr(uint8 const* bytes, uint32 arrayLen, bool reverse /* = false */)
{
int32 init = 0;
@@ -510,3 +529,34 @@ std::string ByteArrayToHexStr(uint8 const* bytes, uint32 arrayLen, bool reverse
return ss.str();
}
+
+void HexStrToByteArray(std::string const& str, uint8* out, bool reverse /*= false*/)
+{
+ // string must have even number of characters
+ if (str.length() & 1)
+ return;
+
+ int32 init = 0;
+ int32 end = int32(str.length());
+ int8 op = 1;
+
+ if (reverse)
+ {
+ init = int32(str.length() - 2);
+ end = -2;
+ op = -1;
+ }
+
+ uint32 j = 0;
+ for (int32 i = init; i != end; i += 2 * op)
+ {
+ char buffer[3] = { str[i], str[i + 1], '\0' };
+ out[j++] = uint8(strtoul(buffer, NULL, 16));
+ }
+}
+
+bool StringToBool(std::string const& str)
+{
+ std::string lowerStr = boost::algorithm::to_lower_copy(str);
+ return lowerStr == "1" || lowerStr == "true" || lowerStr == "yes";
+}
diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h
index ab5cabca8d2..cc68f3b2237 100644
--- a/src/common/Utilities/Util.h
+++ b/src/common/Utilities/Util.h
@@ -40,7 +40,7 @@ template<typename T, class S> struct Finder
bool operator()(const std::pair<int, S> &obj) { return obj.second.*idMember_ == val_; }
};
-class Tokenizer
+class TC_COMMON_API Tokenizer
{
public:
typedef std::vector<char const*> StorageType;
@@ -68,15 +68,15 @@ private:
StorageType m_storage;
};
-void stripLineInvisibleChars(std::string &src);
+TC_COMMON_API void stripLineInvisibleChars(std::string &src);
-int32 MoneyStringToMoney(const std::string& moneyString);
+TC_COMMON_API int32 MoneyStringToMoney(const std::string& moneyString);
-struct tm* localtime_r(const time_t* time, struct tm *result);
+TC_COMMON_API struct tm* localtime_r(const time_t* time, struct tm *result);
-std::string secsToTimeString(uint64 timeInSecs, bool shortText = false, bool hoursOnly = false);
-uint32 TimeStringToSecs(const std::string& timestring);
-std::string TimeToTimestampStr(time_t t);
+TC_COMMON_API std::string secsToTimeString(uint64 timeInSecs, bool shortText = false, bool hoursOnly = false);
+TC_COMMON_API uint32 TimeStringToSecs(const std::string& timestring);
+TC_COMMON_API std::string TimeToTimestampStr(time_t t);
inline void ApplyPercentModFloatVar(float& var, float val, bool apply)
{
@@ -111,20 +111,20 @@ inline T RoundToInterval(T& num, T floor, T ceil)
}
// UTF8 handling
-bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr);
+TC_COMMON_API bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr);
// in wsize==max size of buffer, out wsize==real string size
-bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize);
+TC_COMMON_API bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize);
inline bool Utf8toWStr(const std::string& utf8str, wchar_t* wstr, size_t& wsize)
{
return Utf8toWStr(utf8str.c_str(), utf8str.size(), wstr, wsize);
}
-bool WStrToUtf8(std::wstring const& wstr, std::string& utf8str);
+TC_COMMON_API bool WStrToUtf8(std::wstring const& wstr, std::string& utf8str);
// size==real string size
-bool WStrToUtf8(wchar_t* wstr, size_t size, std::string& utf8str);
+TC_COMMON_API bool WStrToUtf8(wchar_t* wstr, size_t size, std::string& utf8str);
-size_t utf8length(std::string& utf8str); // set string to "" if invalid utf8 sequence
-void utf8truncate(std::string& utf8str, size_t len);
+TC_COMMON_API size_t utf8length(std::string& utf8str); // set string to "" if invalid utf8 sequence
+TC_COMMON_API void utf8truncate(std::string& utf8str, size_t len);
inline bool isBasicLatinCharacter(wchar_t wchar)
{
@@ -303,19 +303,24 @@ inline void wstrToLower(std::wstring& str)
std::transform( str.begin(), str.end(), str.begin(), wcharToLower );
}
-std::wstring GetMainPartOfName(std::wstring const& wname, uint32 declension);
+TC_COMMON_API std::wstring GetMainPartOfName(std::wstring const& wname, uint32 declension);
-bool utf8ToConsole(const std::string& utf8str, std::string& conStr);
-bool consoleToUtf8(const std::string& conStr, std::string& utf8str);
-bool Utf8FitTo(const std::string& str, std::wstring const& search);
-void utf8printf(FILE* out, const char *str, ...);
-void vutf8printf(FILE* out, const char *str, va_list* ap);
+TC_COMMON_API bool utf8ToConsole(const std::string& utf8str, std::string& conStr);
+TC_COMMON_API bool consoleToUtf8(const std::string& conStr, std::string& utf8str);
+TC_COMMON_API bool Utf8FitTo(const std::string& str, std::wstring const& search);
+TC_COMMON_API void utf8printf(FILE* out, const char *str, ...);
+TC_COMMON_API void vutf8printf(FILE* out, const char *str, va_list* ap);
+TC_COMMON_API bool Utf8ToUpperOnlyLatin(std::string& utf8String);
-bool IsIPAddress(char const* ipaddress);
+TC_COMMON_API bool IsIPAddress(char const* ipaddress);
-uint32 CreatePIDFile(const std::string& filename);
+TC_COMMON_API uint32 CreatePIDFile(std::string const& filename);
+TC_COMMON_API uint32 GetPID();
-std::string ByteArrayToHexStr(uint8 const* bytes, uint32 length, bool reverse = false);
+TC_COMMON_API std::string ByteArrayToHexStr(uint8 const* bytes, uint32 length, bool reverse = false);
+TC_COMMON_API void HexStrToByteArray(std::string const& str, uint8* out, bool reverse = false);
+
+TC_COMMON_API bool StringToBool(std::string const& str);
// simple class for not-modifyable list
template <typename T>
diff --git a/src/genrev/CMakeLists.txt b/src/genrev/CMakeLists.txt
index 91a13609037..355e2043b51 100644
--- a/src/genrev/CMakeLists.txt
+++ b/src/genrev/CMakeLists.txt
@@ -13,3 +13,8 @@ add_custom_target(revision_data.h ALL
COMMAND "${CMAKE_COMMAND}" -DBUILDDIR="${CMAKE_BINARY_DIR}" -P "${CMAKE_SOURCE_DIR}/cmake/genrev.cmake" "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
)
+
+set_target_properties(revision_data.h
+ PROPERTIES
+ FOLDER
+ "server")
diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt
index 9a454696ca8..2c7a4773e88 100644
--- a/src/server/CMakeLists.txt
+++ b/src/server/CMakeLists.txt
@@ -12,16 +12,19 @@
# This to stop a few silly crashes that could have been avoided IF people
# weren't doing some -O3 psychooptimizations etc.
-find_package(MySQL REQUIRED)
-
if(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW)
add_definitions(-fno-delete-null-pointer-checks)
endif()
-set(sources_windows_Debugging
- ${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.cpp
- ${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.h
-)
+if(WIN32)
+ set(sources_windows
+ ${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.h
+ ${CMAKE_SOURCE_DIR}/src/common/Platform/ServiceWin32.cpp
+ ${CMAKE_SOURCE_DIR}/src/common/Platform/ServiceWin32.h
+ )
+endif(WIN32)
+
add_subdirectory(database)
add_subdirectory(shared)
add_subdirectory(game)
diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt
index c11deec39bb..d1f0e4460e9 100644
--- a/src/server/authserver/CMakeLists.txt
+++ b/src/server/authserver/CMakeLists.txt
@@ -10,66 +10,29 @@
########### authserver ###############
-file(GLOB_RECURSE sources_authentication Authentication/*.cpp Authentication/*.h)
-file(GLOB_RECURSE sources_realms Realms/*.cpp Realms/*.h)
-file(GLOB_RECURSE sources_server Server/*.cpp Server/*.h)
-file(GLOB sources_localdir *.cpp *.h)
-
-if (USE_COREPCH)
- set(authserver_PCH_HDR PrecompiledHeaders/authPCH.h)
- set(authserver_PCH_SRC PrecompiledHeaders/authPCH.cpp)
-endif()
-
-set(authserver_SRCS
- ${authserver_SRCS}
- ${sources_authentication}
- ${sources_realms}
- ${sources_server}
- ${sources_localdir}
-)
+CollectSourceFiles(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE_SOURCES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if( WIN32 )
- set(authserver_SRCS
- ${authserver_SRCS}
- ${sources_windows_Debugging}
- )
+ list(APPEND PRIVATE_SOURCES ${sources_windows})
if ( MSVC )
- set(authserver_SRCS
- ${authserver_SRCS}
- authserver.rc
- )
- endif ()
+ list(APPEND PRIVATE_SOURCES authserver.rc)
+ endif()
endif()
-include_directories(
- ${CMAKE_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/Authentication
- ${CMAKE_CURRENT_SOURCE_DIR}/Realms
- ${CMAKE_CURRENT_SOURCE_DIR}/Server
- ${CMAKE_SOURCE_DIR}/dep/cppformat
- ${CMAKE_SOURCE_DIR}/src/common/
- ${CMAKE_SOURCE_DIR}/src/common/Configuration
- ${CMAKE_SOURCE_DIR}/src/common/Cryptography
- ${CMAKE_SOURCE_DIR}/src/common/Debugging
- ${CMAKE_SOURCE_DIR}/src/common/Logging
- ${CMAKE_SOURCE_DIR}/src/common/Threading
- ${CMAKE_SOURCE_DIR}/src/common/Utilities
- ${CMAKE_SOURCE_DIR}/src/server/database
- ${CMAKE_SOURCE_DIR}/src/server/database/Database
- ${CMAKE_SOURCE_DIR}/src/server/database/Logging
- ${CMAKE_SOURCE_DIR}/src/server/shared/Networking
- ${CMAKE_SOURCE_DIR}/src/server/shared/Packets
- ${CMAKE_SOURCE_DIR}/src/server/shared/Service
- ${MYSQL_INCLUDE_DIR}
- ${OPENSSL_INCLUDE_DIR}
- ${VALGRIND_INCLUDE_DIR}
-)
+if (USE_COREPCH)
+ set(PRIVATE_PCH_HEADER PrecompiledHeaders/authPCH.h)
+ set(PRIVATE_PCH_SOURCE PrecompiledHeaders/authPCH.cpp)
+endif()
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(authserver
- ${authserver_SRCS}
- ${authserver_PCH_SRC}
+ ${PRIVATE_PCH_SOURCE}
+ ${PRIVATE_SOURCES}
)
if( NOT WIN32 )
@@ -79,15 +42,25 @@ if( NOT WIN32 )
endif()
target_link_libraries(authserver
- common
- shared
- format
- database
- ${MYSQL_LIBRARY}
- ${OPENSSL_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
- ${Boost_LIBRARIES}
-)
+ PUBLIC
+ shared)
+
+CollectIncludeDirectories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC_INCLUDES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
+
+target_include_directories(authserver
+ PUBLIC
+ ${PUBLIC_INCLUDES}
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR})
+
+set_target_properties(authserver
+ PROPERTIES
+ FOLDER
+ "server")
if( WIN32 )
if ( MSVC )
@@ -113,5 +86,5 @@ endif()
# Generate precompiled header
if (USE_COREPCH)
- add_cxx_pch(authserver ${authserver_PCH_HDR} ${authserver_PCH_SRC})
+ add_cxx_pch(authserver ${PRIVATE_PCH_HEADER} ${PRIVATE_PCH_SOURCE})
endif()
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index 0c812ebd494..1392900fb9a 100644
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -36,12 +36,14 @@
#include "GitRevision.h"
#include "Util.h"
#include <iostream>
+#include <boost/filesystem/path.hpp>
#include <boost/program_options.hpp>
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
using boost::asio::ip::tcp;
using namespace boost::program_options;
+namespace fs = boost::filesystem;
#ifndef _TRINITY_REALM_CONFIG
# define _TRINITY_REALM_CONFIG "authserver.conf"
@@ -68,16 +70,20 @@ bool StartDB();
void StopDB();
void SignalHandler(const boost::system::error_code& error, int signalNumber);
void KeepDatabaseAliveHandler(const boost::system::error_code& error);
-variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile, std::string& configService);
+void BanExpiryHandler(boost::system::error_code const& error);
+variables_map GetConsoleArguments(int argc, char** argv, fs::path& configFile, std::string& configService);
boost::asio::io_service* _ioService;
boost::asio::deadline_timer* _dbPingTimer;
uint32 _dbPingInterval;
-LoginDatabaseWorkerPool LoginDatabase;
+boost::asio::deadline_timer* _banExpiryCheckTimer;
+uint32 _banExpiryCheckInterval;
int main(int argc, char** argv)
{
- std::string configFile = _TRINITY_REALM_CONFIG;
+ signal(SIGABRT, &Trinity::AbortHandler);
+
+ auto configFile = fs::absolute(_TRINITY_REALM_CONFIG);
std::string configService;
auto vm = GetConsoleArguments(argc, argv, configFile, configService);
// exit if help or version is enabled
@@ -94,7 +100,9 @@ int main(int argc, char** argv)
#endif
std::string configError;
- if (!sConfigMgr->LoadInitial(configFile, configError))
+ if (!sConfigMgr->LoadInitial(configFile.generic_string(),
+ std::vector<std::string>(argv, argv + argc),
+ configError))
{
printf("Error in config file: %s\n", configError.c_str());
return 1;
@@ -105,7 +113,7 @@ int main(int argc, char** argv)
TC_LOG_INFO("server.authserver", "%s (authserver)", GitRevision::GetFullVersion());
TC_LOG_INFO("server.authserver", "<Ctrl-C> to stop.\n");
- TC_LOG_INFO("server.authserver", "Using configuration file %s.", configFile.c_str());
+ TC_LOG_INFO("server.authserver", "Using configuration file %s.", sConfigMgr->GetFilename().c_str());
TC_LOG_INFO("server.authserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
TC_LOG_INFO("server.authserver", "Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
@@ -131,7 +139,7 @@ int main(int argc, char** argv)
// Get the list of realms for the server
sRealmList->Initialize(*_ioService, sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 20));
- if (sRealmList->size() == 0)
+ if (sRealmList->GetRealms().empty())
{
TC_LOG_ERROR("server.authserver", "No valid realms specified.");
StopDB();
@@ -169,6 +177,11 @@ int main(int argc, char** argv)
_dbPingTimer->expires_from_now(boost::posix_time::minutes(_dbPingInterval));
_dbPingTimer->async_wait(KeepDatabaseAliveHandler);
+ _banExpiryCheckInterval = sConfigMgr->GetIntDefault("BanExpiryCheckInterval", 60);
+ _banExpiryCheckTimer = new boost::asio::deadline_timer(*_ioService);
+ _banExpiryCheckTimer->expires_from_now(boost::posix_time::seconds(_banExpiryCheckInterval));
+ _banExpiryCheckTimer->async_wait(BanExpiryHandler);
+
#if PLATFORM == PLATFORM_WINDOWS
if (m_ServiceStatus != -1)
{
@@ -181,10 +194,13 @@ int main(int argc, char** argv)
// Start the io service worker loop
_ioService->run();
+ _banExpiryCheckTimer->cancel();
_dbPingTimer->cancel();
sAuthSocketMgr.StopNetwork();
+ sRealmList->Close();
+
// Close the Database Pool and library
StopDB();
@@ -192,6 +208,7 @@ int main(int argc, char** argv)
signals.cancel();
+ delete _banExpiryCheckTimer;
delete _dbPingTimer;
delete _ioService;
return 0;
@@ -242,6 +259,18 @@ void KeepDatabaseAliveHandler(const boost::system::error_code& error)
}
}
+void BanExpiryHandler(boost::system::error_code const& error)
+{
+ if (!error)
+ {
+ LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS));
+ LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS));
+
+ _banExpiryCheckTimer->expires_from_now(boost::posix_time::seconds(_banExpiryCheckInterval));
+ _banExpiryCheckTimer->async_wait(BanExpiryHandler);
+ }
+}
+
#if PLATFORM == PLATFORM_WINDOWS
void ServiceStatusWatcher(boost::system::error_code const& error)
{
@@ -261,13 +290,14 @@ void ServiceStatusWatcher(boost::system::error_code const& error)
}
#endif
-variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile, std::string& configService)
+variables_map GetConsoleArguments(int argc, char** argv, fs::path& configFile, std::string& configService)
{
options_description all("Allowed options");
all.add_options()
("help,h", "print usage message")
("version,v", "print version build info")
- ("config,c", value<std::string>(&configFile)->default_value(_TRINITY_REALM_CONFIG), "use <arg> as configuration file")
+ ("config,c", value<fs::path>(&configFile)->default_value(fs::absolute(_TRINITY_REALM_CONFIG)),
+ "use <arg> as configuration file")
;
#if PLATFORM == PLATFORM_WINDOWS
options_description win("Windows platform specific options");
diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h
deleted file mode 100644
index cc5c88c01f2..00000000000
--- a/src/server/authserver/Realms/RealmList.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _REALMLIST_H
-#define _REALMLIST_H
-
-#include <boost/asio/ip/address.hpp>
-#include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/io_service.hpp>
-#include "Common.h"
-
-using namespace boost::asio;
-
-enum RealmFlags
-{
- REALM_FLAG_NONE = 0x00,
- REALM_FLAG_INVALID = 0x01,
- REALM_FLAG_OFFLINE = 0x02,
- REALM_FLAG_SPECIFYBUILD = 0x04,
- REALM_FLAG_UNK1 = 0x08,
- REALM_FLAG_UNK2 = 0x10,
- REALM_FLAG_RECOMMENDED = 0x20,
- REALM_FLAG_NEW = 0x40,
- REALM_FLAG_FULL = 0x80
-};
-
-// Storage object for a realm
-struct Realm
-{
- ip::address ExternalAddress;
- ip::address LocalAddress;
- ip::address LocalSubnetMask;
- uint16 port;
- std::string name;
- uint8 icon;
- RealmFlags flag;
- uint8 timezone;
- uint32 m_ID;
- AccountTypes allowedSecurityLevel;
- float populationLevel;
- uint32 gamebuild;
-};
-
-/// Storage object for the list of realms on the server
-class RealmList
-{
-public:
- typedef std::map<std::string, Realm> RealmMap;
-
- static RealmList* instance()
- {
- static RealmList instance;
- return &instance;
- }
-
- ~RealmList();
-
- void Initialize(boost::asio::io_service& ioService, uint32 updateInterval);
-
- void UpdateIfNeed();
-
- void AddRealm(const Realm& NewRealm) { m_realms[NewRealm.name] = NewRealm; }
-
- RealmMap::const_iterator begin() const { return m_realms.begin(); }
- RealmMap::const_iterator end() const { return m_realms.end(); }
- uint32 size() const { return m_realms.size(); }
-
-private:
- RealmList();
-
- void UpdateRealms(bool init = false);
- void UpdateRealm(uint32 id, const std::string& name, ip::address const& address, ip::address const& localAddr,
- ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population, uint32 build);
-
- RealmMap m_realms;
- uint32 m_UpdateInterval;
- time_t m_NextUpdateTime;
- boost::asio::ip::tcp::resolver* _resolver;
-};
-
-#define sRealmList RealmList::instance()
-#endif
diff --git a/src/server/authserver/Server/AuthSession.cpp b/src/server/authserver/Server/AuthSession.cpp
index 60e9b734b13..ec72651ecb7 100644
--- a/src/server/authserver/Server/AuthSession.cpp
+++ b/src/server/authserver/Server/AuthSession.cpp
@@ -43,12 +43,6 @@ enum eAuthCmd
XFER_CANCEL = 0x34
};
-enum eStatus
-{
- STATUS_CONNECTED = 0,
- STATUS_AUTHED
-};
-
#pragma pack(push, 1)
typedef struct AUTH_LOGON_CHALLENGE_C
@@ -115,11 +109,10 @@ enum class BufferSizes : uint32
SRP_6_S = 0x20,
};
+#define MAX_ACCEPTED_CHALLENGE_SIZE (sizeof(AUTH_LOGON_CHALLENGE_C) + 16)
+
#define AUTH_LOGON_CHALLENGE_INITIAL_SIZE 4
#define REALM_LIST_PACKET_SIZE 5
-#define XFER_ACCEPT_SIZE 1
-#define XFER_RESUME_SIZE 9
-#define XFER_CANCEL_SIZE 1
std::unordered_map<uint8, AuthHandler> AuthSession::InitHandlers()
{
@@ -130,15 +123,103 @@ std::unordered_map<uint8, AuthHandler> AuthSession::InitHandlers()
handlers[AUTH_RECONNECT_CHALLENGE] = { STATUS_CONNECTED, AUTH_LOGON_CHALLENGE_INITIAL_SIZE, &AuthSession::HandleReconnectChallenge };
handlers[AUTH_RECONNECT_PROOF] = { STATUS_CONNECTED, sizeof(AUTH_RECONNECT_PROOF_C), &AuthSession::HandleReconnectProof };
handlers[REALM_LIST] = { STATUS_AUTHED, REALM_LIST_PACKET_SIZE, &AuthSession::HandleRealmList };
- handlers[XFER_ACCEPT] = { STATUS_AUTHED, XFER_ACCEPT_SIZE, &AuthSession::HandleXferAccept };
- handlers[XFER_RESUME] = { STATUS_AUTHED, XFER_RESUME_SIZE, &AuthSession::HandleXferResume };
- handlers[XFER_CANCEL] = { STATUS_AUTHED, XFER_CANCEL_SIZE, &AuthSession::HandleXferCancel };
return handlers;
}
std::unordered_map<uint8, AuthHandler> const Handlers = AuthSession::InitHandlers();
+void AccountInfo::LoadResult(Field* fields)
+{
+ // 0 1 2 3 4 5 6
+ //SELECT a.id, a.username, a.locked, a.lock_country, a.last_ip, a.failed_logins, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate,
+ // 7 8 9 10 11 12
+ // ab.unbandate = ab.bandate, aa.gmlevel, a.token_key, a.sha_pass_hash, a.v, a.s
+ //FROM account a LEFT JOIN account_access aa ON a.id = aa.id LEFT JOIN account_banned ab ON ab.id = a.id AND ab.active = 1 WHERE a.username = ?
+
+ Id = fields[0].GetUInt32();
+ Login = fields[1].GetString();
+ IsLockedToIP = fields[2].GetBool();
+ LockCountry = fields[3].GetString();
+ LastIP = fields[4].GetString();
+ FailedLogins = fields[5].GetUInt32();
+ IsBanned = fields[6].GetUInt64() != 0;
+ IsPermanenetlyBanned = fields[7].GetUInt64() != 0;
+ SecurityLevel = AccountTypes(fields[8].GetUInt8());
+
+ // Use our own uppercasing of the account name instead of using UPPER() in mysql query
+ // This is how the account was created in the first place and changing it now would result in breaking
+ // login for all accounts having accented characters in their name
+ Utf8ToUpperOnlyLatin(Login);
+}
+
+AuthSession::AuthSession(tcp::socket&& socket) : Socket(std::move(socket)),
+_sentChallenge(false), _sentProof(false),
+_status(STATUS_CONNECTED), _build(0), _expversion(0)
+{
+ N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7");
+ g.SetDword(7);
+}
+
+void AuthSession::Start()
+{
+ std::string ip_address = GetRemoteIpAddress().to_string();
+ TC_LOG_TRACE("session", "Accepted connection from %s", ip_address.c_str());
+
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_INFO);
+ stmt->setString(0, ip_address);
+ stmt->setUInt32(1, inet_addr(ip_address.c_str()));
+
+ _queryCallback = std::bind(&AuthSession::CheckIpCallback, this, std::placeholders::_1);
+ _queryFuture = LoginDatabase.AsyncQuery(stmt);
+}
+
+bool AuthSession::Update()
+{
+ if (!AuthSocket::Update())
+ return false;
+
+ if (_queryFuture.valid() && _queryFuture.wait_for(std::chrono::seconds(0)) == std::future_status::ready)
+ {
+ auto callback = _queryCallback;
+ _queryCallback = nullptr;
+ callback(_queryFuture.get());
+ }
+
+ return true;
+}
+
+void AuthSession::CheckIpCallback(PreparedQueryResult result)
+{
+ if (result)
+ {
+ bool banned = false;
+ do
+ {
+ Field* fields = result->Fetch();
+ if (fields[0].GetUInt64() != 0)
+ banned = true;
+
+ if (!fields[1].GetString().empty())
+ _ipCountry = fields[1].GetString();
+
+ } while (result->NextRow());
+
+ if (banned)
+ {
+ ByteBuffer pkt;
+ pkt << uint8(AUTH_LOGON_CHALLENGE);
+ pkt << uint8(0x00);
+ pkt << uint8(WOW_FAIL_BANNED);
+ SendPacket(pkt);
+ TC_LOG_DEBUG("session", "[AuthSession::CheckIpCallback] Banned ip '%s:%d' tries to login!", GetRemoteIpAddress().to_string().c_str(), GetRemotePort());
+ return;
+ }
+ }
+
+ AsyncRead();
+}
+
void AuthSession::ReadHandler()
{
MessageBuffer& packet = GetReadBuffer();
@@ -153,6 +234,12 @@ void AuthSession::ReadHandler()
break;
}
+ if (_status != itr->second.status)
+ {
+ CloseSocket();
+ return;
+ }
+
uint16 size = uint16(itr->second.packetSize);
if (packet.GetActiveSize() < size)
break;
@@ -161,12 +248,17 @@ void AuthSession::ReadHandler()
{
sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(packet.GetReadPointer());
size += challenge->size;
+ if (size > MAX_ACCEPTED_CHALLENGE_SIZE)
+ {
+ CloseSocket();
+ return;
+ }
}
if (packet.GetActiveSize() < size)
break;
- if (!(*this.*Handlers.at(cmd).handler)())
+ if (!(*this.*itr->second.handler)())
{
CloseSocket();
return;
@@ -187,233 +279,209 @@ void AuthSession::SendPacket(ByteBuffer& packet)
{
MessageBuffer buffer;
buffer.Write(packet.contents(), packet.size());
-
- std::unique_lock<std::mutex> guard(_writeLock);
-
- QueuePacket(std::move(buffer), guard);
+ QueuePacket(std::move(buffer));
}
}
bool AuthSession::HandleLogonChallenge()
{
+ if (_sentChallenge)
+ return false;
+
+ _sentChallenge = true;
+
sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(GetReadBuffer().GetReadPointer());
+ if (challenge->size - (sizeof(sAuthLogonChallenge_C) - AUTH_LOGON_CHALLENGE_INITIAL_SIZE - 1) != challenge->I_len)
+ return false;
- //TC_LOG_DEBUG("server.authserver", "[AuthChallenge] got full packet, %#04x bytes", challenge->size);
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] name(%d): '%s'", challenge->I_len, challenge->I);
+ std::string login((const char*)challenge->I, challenge->I_len);
+ TC_LOG_DEBUG("server.authserver", "[AuthChallenge] '%s'", login.c_str());
- ByteBuffer pkt;
+ if (_queryCallback)
+ {
+ ByteBuffer pkt;
+ pkt << uint8(AUTH_LOGON_CHALLENGE);
+ pkt << uint8(0x00);
+ pkt << uint8(WOW_FAIL_DB_BUSY);
+ SendPacket(pkt);
+
+ TC_LOG_DEBUG("server.authserver", "[AuthChallenge] %s attempted to log too quick after previous attempt!", login.c_str());
+ return true;
+ }
- _login.assign((const char*)challenge->I, challenge->I_len);
_build = challenge->build;
_expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG));
- _os = (const char*)challenge->os;
-
- if (_os.size() > 4)
- return false;
+ std::array<char, 5> os;
+ os.fill('\0');
+ memcpy(os.data(), challenge->os, sizeof(challenge->os));
+ _os = os.data();
// Restore string order as its byte order is reversed
std::reverse(_os.begin(), _os.end());
+ _localizationName.resize(4);
+ for (int i = 0; i < 4; ++i)
+ _localizationName[i] = challenge->country[4 - i - 1];
+
+ // Get the account details from the account table
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGONCHALLENGE);
+ stmt->setString(0, login);
+
+ _queryCallback = std::bind(&AuthSession::LogonChallengeCallback, this, std::placeholders::_1);
+ _queryFuture = LoginDatabase.AsyncQuery(stmt);
+ return true;
+}
+
+void AuthSession::LogonChallengeCallback(PreparedQueryResult result)
+{
+ ByteBuffer pkt;
pkt << uint8(AUTH_LOGON_CHALLENGE);
pkt << uint8(0x00);
- // Verify that this IP is not in the ip_banned table
- LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS));
+ if (!result)
+ {
+ pkt << uint8(WOW_FAIL_UNKNOWN_ACCOUNT);
+ SendPacket(pkt);
+ return;
+ }
+
+ Field* fields = result->Fetch();
+
+ _accountInfo.LoadResult(fields);
std::string ipAddress = GetRemoteIpAddress().to_string();
uint16 port = GetRemotePort();
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED);
- stmt->setString(0, ipAddress);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
- if (result)
+ // If the IP is 'locked', check that the player comes indeed from the correct IP address
+ if (_accountInfo.IsLockedToIP)
{
- pkt << uint8(WOW_FAIL_BANNED);
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Banned ip tries to login!", ipAddress.c_str(), port);
+ TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to IP - '%s' is logging in from '%s'", _accountInfo.Login.c_str(), _accountInfo.LastIP.c_str(), ipAddress.c_str());
+ if (_accountInfo.LastIP != ipAddress)
+ {
+ pkt << uint8(WOW_FAIL_LOCKED_ENFORCED);
+ SendPacket(pkt);
+ return;
+ }
}
else
{
- // Get the account details from the account table
- // No SQL injection (prepared statement)
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGONCHALLENGE);
- stmt->setString(0, _login);
-
- PreparedQueryResult res2 = LoginDatabase.Query(stmt);
- if (res2)
+ TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to ip", _accountInfo.Login.c_str());
+ if (_accountInfo.LockCountry.empty() || _accountInfo.LockCountry == "00")
+ TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to country", _accountInfo.Login.c_str());
+ else if (!_accountInfo.LockCountry.empty() && !_ipCountry.empty())
{
- Field* fields = res2->Fetch();
-
- // If the IP is 'locked', check that the player comes indeed from the correct IP address
- bool locked = false;
- if (fields[2].GetUInt8() == 1) // if ip is locked
+ TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to country: '%s' Player country is '%s'", _accountInfo.Login.c_str(), _accountInfo.LockCountry.c_str(), _ipCountry.c_str());
+ if (_ipCountry != _accountInfo.LockCountry)
{
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[4].GetCString());
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Player address is '%s'", ipAddress.c_str());
-
- if (strcmp(fields[4].GetCString(), ipAddress.c_str()) != 0)
- {
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account IP differs");
- pkt << uint8(WOW_FAIL_LOCKED_ENFORCED);
- locked = true;
- }
- else
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account IP matches");
- }
- else
- {
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to ip", _login.c_str());
- std::string accountCountry = fields[3].GetString();
- if (accountCountry.empty() || accountCountry == "00")
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to country", _login.c_str());
- else if (!accountCountry.empty())
- {
- uint32 ip = inet_addr(ipAddress.c_str());
- EndianConvertReverse(ip);
-
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGON_COUNTRY);
- stmt->setUInt32(0, ip);
- if (PreparedQueryResult sessionCountryQuery = LoginDatabase.Query(stmt))
- {
- std::string loginCountry = (*sessionCountryQuery)[0].GetString();
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to country: '%s' Player country is '%s'", _login.c_str(),
- accountCountry.c_str(), loginCountry.c_str());
-
- if (loginCountry != accountCountry)
- {
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account country differs.");
- pkt << uint8(WOW_FAIL_UNLOCKABLE_LOCK);
- locked = true;
- }
- else
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account country matches");
- }
- else
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] IP2NATION Table empty");
- }
+ pkt << uint8(WOW_FAIL_UNLOCKABLE_LOCK);
+ SendPacket(pkt);
+ return;
}
+ }
+ }
- if (!locked)
- {
- //set expired bans to inactive
- LoginDatabase.DirectExecute(LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS));
-
- // If the account is banned, reject the logon attempt
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED);
- stmt->setUInt32(0, fields[1].GetUInt32());
- PreparedQueryResult banresult = LoginDatabase.Query(stmt);
- if (banresult)
- {
- if ((*banresult)[0].GetUInt32() == (*banresult)[1].GetUInt32())
- {
- pkt << uint8(WOW_FAIL_BANNED);
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Banned account %s tried to login!", ipAddress.c_str(),
- port, _login.c_str());
- }
- else
- {
- pkt << uint8(WOW_FAIL_SUSPENDED);
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!",
- ipAddress.c_str(), port, _login.c_str());
- }
- }
- else
- {
- // Get the password from the account table, upper it, and make the SRP6 calculation
- std::string rI = fields[0].GetString();
-
- // Don't calculate (v, s) if there are already some in the database
- std::string databaseV = fields[6].GetString();
- std::string databaseS = fields[7].GetString();
-
- TC_LOG_DEBUG("network", "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str());
-
- // multiply with 2 since bytes are stored as hexstring
- if (databaseV.size() != size_t(BufferSizes::SRP_6_V) * 2 || databaseS.size() != size_t(BufferSizes::SRP_6_S) * 2)
- SetVSFields(rI);
- else
- {
- s.SetHexStr(databaseS.c_str());
- v.SetHexStr(databaseV.c_str());
- }
-
- b.SetRand(19 * 8);
- BigNumber gmod = g.ModExp(b, N);
- B = ((v * 3) + gmod) % N;
-
- ASSERT(gmod.GetNumBytes() <= 32);
-
- BigNumber unk3;
- unk3.SetRand(16 * 8);
-
- // Fill the response packet with the result
- if (AuthHelper::IsAcceptedClientBuild(_build))
- pkt << uint8(WOW_SUCCESS);
- else
- pkt << uint8(WOW_FAIL_VERSION_INVALID);
-
- // B may be calculated < 32B so we force minimal length to 32B
- pkt.append(B.AsByteArray(32).get(), 32); // 32 bytes
- pkt << uint8(1);
- pkt.append(g.AsByteArray(1).get(), 1);
- pkt << uint8(32);
- pkt.append(N.AsByteArray(32).get(), 32);
- pkt.append(s.AsByteArray(int32(BufferSizes::SRP_6_S)).get(), size_t(BufferSizes::SRP_6_S)); // 32 bytes
- pkt.append(unk3.AsByteArray(16).get(), 16);
- uint8 securityFlags = 0;
-
- // Check if token is used
- _tokenKey = fields[8].GetString();
- if (!_tokenKey.empty())
- securityFlags = 4;
-
- pkt << uint8(securityFlags); // security flags (0x0...0x04)
-
- if (securityFlags & 0x01) // PIN input
- {
- pkt << uint32(0);
- pkt << uint64(0) << uint64(0); // 16 bytes hash?
- }
-
- if (securityFlags & 0x02) // Matrix input
- {
- pkt << uint8(0);
- pkt << uint8(0);
- pkt << uint8(0);
- pkt << uint8(0);
- pkt << uint64(0);
- }
-
- if (securityFlags & 0x04) // Security token input
- pkt << uint8(1);
-
- uint8 secLevel = fields[5].GetUInt8();
- _accountSecurityLevel = secLevel <= SEC_ADMINISTRATOR ? AccountTypes(secLevel) : SEC_ADMINISTRATOR;
-
- _localizationName.resize(4);
- for (int i = 0; i < 4; ++i)
- _localizationName[i] = challenge->country[4 - i - 1];
-
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)",
- ipAddress.c_str(), port, _login.c_str(),
- challenge->country[3], challenge->country[2], challenge->country[1], challenge->country[0],
- GetLocaleByName(_localizationName)
- );
- }
- }
+ // If the account is banned, reject the logon attempt
+ if (_accountInfo.IsBanned)
+ {
+ if (_accountInfo.IsPermanenetlyBanned)
+ {
+ pkt << uint8(WOW_FAIL_BANNED);
+ SendPacket(pkt);
+ TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Banned account %s tried to login!", ipAddress.c_str(), port, _accountInfo.Login.c_str());
+ return;
+ }
+ else
+ {
+ pkt << uint8(WOW_FAIL_SUSPENDED);
+ SendPacket(pkt);
+ TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", ipAddress.c_str(), port, _accountInfo.Login.c_str());
+ return;
}
- else //no account
- pkt << uint8(WOW_FAIL_UNKNOWN_ACCOUNT);
}
+ // Get the password from the account table, upper it, and make the SRP6 calculation
+ std::string rI = fields[10].GetString();
+
+ // Don't calculate (v, s) if there are already some in the database
+ std::string databaseV = fields[11].GetString();
+ std::string databaseS = fields[12].GetString();
+
+ TC_LOG_DEBUG("network", "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str());
+
+ // multiply with 2 since bytes are stored as hexstring
+ if (databaseV.size() != size_t(BufferSizes::SRP_6_V) * 2 || databaseS.size() != size_t(BufferSizes::SRP_6_S) * 2)
+ SetVSFields(rI);
+ else
+ {
+ s.SetHexStr(databaseS.c_str());
+ v.SetHexStr(databaseV.c_str());
+ }
+
+ b.SetRand(19 * 8);
+ BigNumber gmod = g.ModExp(b, N);
+ B = ((v * 3) + gmod) % N;
+
+ ASSERT(gmod.GetNumBytes() <= 32);
+
+ BigNumber unk3;
+ unk3.SetRand(16 * 8);
+
+ // Fill the response packet with the result
+ if (AuthHelper::IsAcceptedClientBuild(_build))
+ pkt << uint8(WOW_SUCCESS);
+ else
+ pkt << uint8(WOW_FAIL_VERSION_INVALID);
+
+ // B may be calculated < 32B so we force minimal length to 32B
+ pkt.append(B.AsByteArray(32).get(), 32); // 32 bytes
+ pkt << uint8(1);
+ pkt.append(g.AsByteArray(1).get(), 1);
+ pkt << uint8(32);
+ pkt.append(N.AsByteArray(32).get(), 32);
+ pkt.append(s.AsByteArray(int32(BufferSizes::SRP_6_S)).get(), size_t(BufferSizes::SRP_6_S)); // 32 bytes
+ pkt.append(unk3.AsByteArray(16).get(), 16);
+ uint8 securityFlags = 0;
+
+ // Check if token is used
+ _tokenKey = fields[9].GetString();
+ if (!_tokenKey.empty())
+ securityFlags = 4;
+
+ pkt << uint8(securityFlags); // security flags (0x0...0x04)
+
+ if (securityFlags & 0x01) // PIN input
+ {
+ pkt << uint32(0);
+ pkt << uint64(0) << uint64(0); // 16 bytes hash?
+ }
+
+ if (securityFlags & 0x02) // Matrix input
+ {
+ pkt << uint8(0);
+ pkt << uint8(0);
+ pkt << uint8(0);
+ pkt << uint8(0);
+ pkt << uint64(0);
+ }
+
+ if (securityFlags & 0x04) // Security token input
+ pkt << uint8(1);
+
+ TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s is using '%s' locale (%u)",
+ ipAddress.c_str(), port, _accountInfo.Login.c_str(), _localizationName.c_str(), GetLocaleByName(_localizationName));
+
SendPacket(pkt);
- return true;
}
// Logon Proof command handler
bool AuthSession::HandleLogonProof()
{
-
TC_LOG_DEBUG("server.authserver", "Entering _HandleLogonProof");
+ if (_sentProof)
+ return false;
+
+ _sentProof = true;
+
// Read the packet
sAuthLogonProof_C *logonProof = reinterpret_cast<sAuthLogonProof_C*>(GetReadBuffer().GetReadPointer());
@@ -431,7 +499,7 @@ bool AuthSession::HandleLogonProof()
A.SetBinary(logonProof->A, 32);
// SRP safeguard: abort if A == 0
- if (A.isZero())
+ if (A.IsZero())
{
return false;
}
@@ -487,7 +555,7 @@ bool AuthSession::HandleLogonProof()
t3.SetBinary(hash, 20);
sha.Initialize();
- sha.UpdateData(_login);
+ sha.UpdateData(_accountInfo.Login);
sha.Finalize();
uint8 t4[SHA_DIGEST_LENGTH];
memcpy(t4, sha.GetDigest(), SHA_DIGEST_LENGTH);
@@ -503,22 +571,19 @@ bool AuthSession::HandleLogonProof()
// Check if SRP6 results match (password is correct), else send an error
if (!memcmp(M.AsByteArray(sha.GetLength()).get(), logonProof->M1, 20))
{
- TC_LOG_DEBUG("server.authserver", "'%s:%d' User '%s' successfully authenticated", GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str());
+ TC_LOG_DEBUG("server.authserver", "'%s:%d' User '%s' successfully authenticated", GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str());
// Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account
// No SQL injection (escaped user name) and IP address as received by socket
- const char *K_hex = K.AsHexStr();
PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGONPROOF);
- stmt->setString(0, K_hex);
+ stmt->setString(0, K.AsHexStr());
stmt->setString(1, GetRemoteIpAddress().to_string().c_str());
stmt->setUInt32(2, GetLocaleByName(_localizationName));
stmt->setString(3, _os);
- stmt->setString(4, _login);
+ stmt->setString(4, _accountInfo.Login);
LoginDatabase.DirectExecute(stmt);
- OPENSSL_free((void*)K_hex);
-
// Finish SRP6 and send the final result to the client
sha.Initialize();
sha.UpdateBigNumbers(&A, &M, &K, NULL);
@@ -531,6 +596,7 @@ bool AuthSession::HandleLogonProof()
std::string token(reinterpret_cast<char*>(GetReadBuffer().GetReadPointer() + sizeof(sAuthLogonProof_C) + sizeof(size)), size);
GetReadBuffer().ReadCompleted(sizeof(size) + size);
uint32 validToken = TOTP::GenerateToken(_tokenKey.c_str());
+ _tokenKey.clear();
uint32 incomingToken = atoi(token.c_str());
if (validToken != incomingToken)
{
@@ -571,7 +637,7 @@ bool AuthSession::HandleLogonProof()
}
SendPacket(packet);
- _isAuthenticated = true;
+ _status = STATUS_AUTHED;
}
else
{
@@ -583,7 +649,7 @@ bool AuthSession::HandleLogonProof()
SendPacket(packet);
TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!",
- GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str());
+ GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str());
uint32 MaxWrongPassCount = sConfigMgr->GetIntDefault("WrongPass.MaxCount", 0);
@@ -591,7 +657,7 @@ bool AuthSession::HandleLogonProof()
if (sConfigMgr->GetBoolDefault("WrongPass.Logging", false))
{
PreparedStatement* logstmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_FALP_IP_LOGGING);
- logstmt->setString(0, _login);
+ logstmt->setString(0, _accountInfo.Login);
logstmt->setString(1, GetRemoteIpAddress().to_string());
logstmt->setString(2, "Logged on failed AccountLogin due wrong password");
@@ -602,42 +668,33 @@ bool AuthSession::HandleLogonProof()
{
//Increment number of failed logins by one and if it reaches the limit temporarily ban that account or IP
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_FAILEDLOGINS);
- stmt->setString(0, _login);
+ stmt->setString(0, _accountInfo.Login);
LoginDatabase.Execute(stmt);
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_FAILEDLOGINS);
- stmt->setString(0, _login);
-
- if (PreparedQueryResult loginfail = LoginDatabase.Query(stmt))
+ if (_accountInfo.FailedLogins >= MaxWrongPassCount)
{
- uint32 failed_logins = (*loginfail)[1].GetUInt32();
+ uint32 WrongPassBanTime = sConfigMgr->GetIntDefault("WrongPass.BanTime", 600);
+ bool WrongPassBanType = sConfigMgr->GetBoolDefault("WrongPass.BanType", false);
- if (failed_logins >= MaxWrongPassCount)
+ if (WrongPassBanType)
{
- uint32 WrongPassBanTime = sConfigMgr->GetIntDefault("WrongPass.BanTime", 600);
- bool WrongPassBanType = sConfigMgr->GetBoolDefault("WrongPass.BanType", false);
-
- if (WrongPassBanType)
- {
- uint32 acc_id = (*loginfail)[0].GetUInt32();
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED);
- stmt->setUInt32(0, acc_id);
- stmt->setUInt32(1, WrongPassBanTime);
- LoginDatabase.Execute(stmt);
-
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times",
- GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins);
- }
- else
- {
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_AUTO_BANNED);
- stmt->setString(0, GetRemoteIpAddress().to_string());
- stmt->setUInt32(1, WrongPassBanTime);
- LoginDatabase.Execute(stmt);
-
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] IP got banned for '%u' seconds because account %s failed to authenticate '%u' times",
- GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), WrongPassBanTime, _login.c_str(), failed_logins);
- }
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED);
+ stmt->setUInt32(0, _accountInfo.Id);
+ stmt->setUInt32(1, WrongPassBanTime);
+ LoginDatabase.Execute(stmt);
+
+ TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times",
+ GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str(), WrongPassBanTime, _accountInfo.FailedLogins);
+ }
+ else
+ {
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_AUTO_BANNED);
+ stmt->setString(0, GetRemoteIpAddress().to_string());
+ stmt->setUInt32(1, WrongPassBanTime);
+ LoginDatabase.Execute(stmt);
+
+ TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] IP got banned for '%u' seconds because account %s failed to authenticate '%u' times",
+ GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), WrongPassBanTime, _accountInfo.Login.c_str(), _accountInfo.FailedLogins);
}
}
}
@@ -648,61 +705,88 @@ bool AuthSession::HandleLogonProof()
bool AuthSession::HandleReconnectChallenge()
{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleReconnectChallenge");
- sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(GetReadBuffer().GetReadPointer());
+ if (_sentChallenge)
+ return false;
- //TC_LOG_DEBUG("server.authserver", "[AuthChallenge] got full packet, %#04x bytes", challenge->size);
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] name(%d): '%s'", challenge->I_len, challenge->I);
+ _sentChallenge = true;
- _login.assign((const char*)challenge->I, challenge->I_len);
+ sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(GetReadBuffer().GetReadPointer());
+ if (challenge->size - (sizeof(sAuthLogonChallenge_C) - AUTH_LOGON_CHALLENGE_INITIAL_SIZE - 1) != challenge->I_len)
+ return false;
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_SESSIONKEY);
- stmt->setString(0, _login);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
+ std::string login((const char*)challenge->I, challenge->I_len);
+ TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] '%s'", login.c_str());
- // Stop if the account is not found
- if (!result)
+ if (_queryCallback)
{
- TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login and we cannot find his session key in the database.",
- GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str());
- return false;
+ ByteBuffer pkt;
+ pkt << uint8(AUTH_RECONNECT_CHALLENGE);
+ pkt << uint8(WOW_FAIL_DB_BUSY);
+ SendPacket(pkt);
+
+ TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] %s attempted to log too quick after previous attempt!", login.c_str());
+ return true;
}
- // Reinitialize build, expansion and the account securitylevel
_build = challenge->build;
_expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG));
- _os = (const char*)challenge->os;
-
- if (_os.size() > 4)
- return false;
+ std::array<char, 5> os;
+ os.fill('\0');
+ memcpy(os.data(), challenge->os, sizeof(challenge->os));
+ _os = os.data();
// Restore string order as its byte order is reversed
std::reverse(_os.begin(), _os.end());
- Field* fields = result->Fetch();
- uint8 secLevel = fields[2].GetUInt8();
- _accountSecurityLevel = secLevel <= SEC_ADMINISTRATOR ? AccountTypes(secLevel) : SEC_ADMINISTRATOR;
+ _localizationName.resize(4);
+ for (int i = 0; i < 4; ++i)
+ _localizationName[i] = challenge->country[4 - i - 1];
- K.SetHexStr((*result)[0].GetCString());
+ // Get the account details from the account table
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_RECONNECTCHALLENGE);
+ stmt->setString(0, login);
- // Sending response
+ _queryCallback = std::bind(&AuthSession::ReconnectChallengeCallback, this, std::placeholders::_1);
+ _queryFuture = LoginDatabase.AsyncQuery(stmt);
+ return true;
+}
+
+void AuthSession::ReconnectChallengeCallback(PreparedQueryResult result)
+{
ByteBuffer pkt;
pkt << uint8(AUTH_RECONNECT_CHALLENGE);
- pkt << uint8(0x00);
+
+ if (!result)
+ {
+ pkt << uint8(WOW_FAIL_UNKNOWN_ACCOUNT);
+ SendPacket(pkt);
+ return;
+ }
+
+ Field* fields = result->Fetch();
+
+ _accountInfo.LoadResult(fields);
+ K.SetHexStr(fields[9].GetCString());
_reconnectProof.SetRand(16 * 8);
- pkt.append(_reconnectProof.AsByteArray(16).get(), 16); // 16 bytes random
+
+ pkt << uint8(WOW_SUCCESS);
+ pkt.append(_reconnectProof.AsByteArray(16).get(), 16); // 16 bytes random
pkt << uint64(0x00) << uint64(0x00); // 16 bytes zeros
SendPacket(pkt);
-
- return true;
}
+
bool AuthSession::HandleReconnectProof()
{
TC_LOG_DEBUG("server.authserver", "Entering _HandleReconnectProof");
+ if (_sentProof)
+ return false;
+
+ _sentProof = true;
+
sAuthReconnectProof_C *reconnectProof = reinterpret_cast<sAuthReconnectProof_C*>(GetReadBuffer().GetReadPointer());
- if (_login.empty() || !_reconnectProof.GetNumBytes() || !K.GetNumBytes())
+ if (_accountInfo.Login.empty() || !_reconnectProof.GetNumBytes() || !K.GetNumBytes())
return false;
BigNumber t1;
@@ -710,7 +794,7 @@ bool AuthSession::HandleReconnectProof()
SHA1Hash sha;
sha.Initialize();
- sha.UpdateData(_login);
+ sha.UpdateData(_accountInfo.Login);
sha.UpdateBigNumbers(&t1, &_reconnectProof, &K, NULL);
sha.Finalize();
@@ -722,87 +806,60 @@ bool AuthSession::HandleReconnectProof()
pkt << uint8(0x00);
pkt << uint16(0x00); // 2 bytes zeros
SendPacket(pkt);
- _isAuthenticated = true;
+ _status = STATUS_AUTHED;
return true;
}
else
{
TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login, but session is invalid.", GetRemoteIpAddress().to_string().c_str(),
- GetRemotePort(), _login.c_str());
+ GetRemotePort(), _accountInfo.Login.c_str());
return false;
}
}
-tcp::endpoint const GetAddressForClient(Realm const& realm, ip::address const& clientAddr)
+bool AuthSession::HandleRealmList()
{
- ip::address realmIp;
+ TC_LOG_DEBUG("server.authserver", "Entering _HandleRealmList");
- // Attempt to send best address for client
- if (clientAddr.is_loopback())
+ if (_queryCallback)
{
- // Try guessing if realm is also connected locally
- if (realm.LocalAddress.is_loopback() || realm.ExternalAddress.is_loopback())
- realmIp = clientAddr;
- else
- {
- // Assume that user connecting from the machine that authserver is located on
- // has all realms available in his local network
- realmIp = realm.LocalAddress;
- }
- }
- else
- {
- if (clientAddr.is_v4() &&
- (clientAddr.to_v4().to_ulong() & realm.LocalSubnetMask.to_v4().to_ulong()) ==
- (realm.LocalAddress.to_v4().to_ulong() & realm.LocalSubnetMask.to_v4().to_ulong()))
- {
- realmIp = realm.LocalAddress;
- }
- else
- realmIp = realm.ExternalAddress;
+ TC_LOG_DEBUG("server.authserver", "[RealmList] %s attempted to get realmlist too quick after previous attempt!", _accountInfo.Login.c_str());
+ return false;
}
- tcp::endpoint endpoint(realmIp, realm.port);
+ PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALM_CHARACTER_COUNTS);
+ stmt->setUInt32(0, _accountInfo.Id);
- // Return external IP
- return endpoint;
+ _queryCallback = std::bind(&AuthSession::RealmListCallback, this, std::placeholders::_1);
+ _queryFuture = LoginDatabase.AsyncQuery(stmt);
+ return true;
}
-bool AuthSession::HandleRealmList()
+void AuthSession::RealmListCallback(PreparedQueryResult result)
{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleRealmList");
-
- // Get the user id (else close the connection)
- // No SQL injection (prepared statement)
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
- stmt->setString(0, _login);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
- if (!result)
+ std::map<uint32, uint8> characterCounts;
+ if (result)
{
- TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login but we cannot find him in the database.", GetRemoteIpAddress().to_string().c_str(),
- GetRemotePort(), _login.c_str());
- return false;
+ do
+ {
+ Field* fields = result->Fetch();
+ characterCounts[fields[0].GetUInt32()] = fields[1].GetUInt8();
+ } while (result->NextRow());
}
- Field* fields = result->Fetch();
- uint32 id = fields[0].GetUInt32();
-
- // Update realm list if need
- sRealmList->UpdateIfNeed();
-
// Circle through realms in the RealmList and construct the return packet (including # of user characters in each realm)
ByteBuffer pkt;
size_t RealmListSize = 0;
- for (RealmList::RealmMap::const_iterator i = sRealmList->begin(); i != sRealmList->end(); ++i)
+ for (RealmList::RealmMap::value_type const& i : sRealmList->GetRealms())
{
- const Realm &realm = i->second;
+ const Realm &realm = i.second;
// don't work with realms which not compatible with the client
- bool okBuild = ((_expversion & POST_BC_EXP_FLAG) && realm.gamebuild == _build) || ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(realm.gamebuild));
+ bool okBuild = ((_expversion & POST_BC_EXP_FLAG) && realm.Build == _build) || ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(realm.Build));
// No SQL injection. id of realm is controlled by the database.
- uint32 flag = realm.flag;
- RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(realm.gamebuild);
+ uint32 flag = realm.Flags;
+ RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(realm.Build);
if (!okBuild)
{
if (!buildInfo)
@@ -814,7 +871,7 @@ bool AuthSession::HandleRealmList()
if (!buildInfo)
flag &= ~REALM_FLAG_SPECIFYBUILD;
- std::string name = i->first;
+ std::string name = realm.Name;
if (_expversion & PRE_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD)
{
std::ostringstream ss;
@@ -822,27 +879,19 @@ bool AuthSession::HandleRealmList()
name = ss.str();
}
- uint8 lock = (realm.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0;
-
- uint8 AmountOfCharacters = 0;
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_NUM_CHARS_ON_REALM);
- stmt->setUInt32(0, realm.m_ID);
- stmt->setUInt32(1, id);
- result = LoginDatabase.Query(stmt);
- if (result)
- AmountOfCharacters = (*result)[0].GetUInt8();
+ uint8 lock = (realm.AllowedSecurityLevel > _accountInfo.SecurityLevel) ? 1 : 0;
- pkt << realm.icon; // realm type
+ pkt << uint8(realm.Type); // realm type
if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients
- pkt << lock; // if 1, then realm locked
+ pkt << uint8(lock); // if 1, then realm locked
pkt << uint8(flag); // RealmFlags
pkt << name;
- pkt << boost::lexical_cast<std::string>(GetAddressForClient(realm, GetRemoteIpAddress()));
- pkt << realm.populationLevel;
- pkt << AmountOfCharacters;
- pkt << realm.timezone; // realm category
+ pkt << boost::lexical_cast<std::string>(realm.GetAddressForClient(GetRemoteIpAddress()));
+ pkt << float(realm.PopulationLevel);
+ pkt << uint8(characterCounts[realm.Id.Realm]);
+ pkt << uint8(realm.Timezone); // realm category
if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
- pkt << uint8(realm.m_ID);
+ pkt << uint8(realm.Id.Realm);
else
pkt << uint8(0x0); // 1.12.1 and 1.12.2 clients
@@ -882,32 +931,6 @@ bool AuthSession::HandleRealmList()
hdr.append(RealmListSizeBuffer); // append RealmList's size buffer
hdr.append(pkt); // append realms in the realmlist
SendPacket(hdr);
- return true;
-}
-
-// Resume patch transfer
-bool AuthSession::HandleXferResume()
-{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleXferResume");
- //uint8
- //uint64
- return true;
-}
-
-// Cancel patch transfer
-bool AuthSession::HandleXferCancel()
-{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleXferCancel");
- //uint8
- return false;
-}
-
-// Accept patch transfer
-bool AuthSession::HandleXferAccept()
-{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleXferAccept");
- //uint8
- return true;
}
// Make the SRP6 calculation from hash in dB
@@ -933,16 +956,9 @@ void AuthSession::SetVSFields(const std::string& rI)
v = g.ModExp(x, N);
// No SQL injection (username escaped)
- char *v_hex, *s_hex;
- v_hex = v.AsHexStr();
- s_hex = s.AsHexStr();
-
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_VS);
- stmt->setString(0, v_hex);
- stmt->setString(1, s_hex);
- stmt->setString(2, _login);
+ stmt->setString(0, v.AsHexStr());
+ stmt->setString(1, s.AsHexStr());
+ stmt->setString(2, _accountInfo.Login);
LoginDatabase.Execute(stmt);
-
- OPENSSL_free(v_hex);
- OPENSSL_free(s_hex);
}
diff --git a/src/server/authserver/Server/AuthSession.h b/src/server/authserver/Server/AuthSession.h
index d40e0852b57..027011629eb 100644
--- a/src/server/authserver/Server/AuthSession.h
+++ b/src/server/authserver/Server/AuthSession.h
@@ -23,29 +23,48 @@
#include "ByteBuffer.h"
#include "Socket.h"
#include "BigNumber.h"
+#include "QueryCallback.h"
#include <memory>
#include <boost/asio/ip/tcp.hpp>
using boost::asio::ip::tcp;
+class Field;
struct AuthHandler;
+enum AuthStatus
+{
+ STATUS_CONNECTED = 0,
+ STATUS_AUTHED
+};
+
+struct AccountInfo
+{
+ void LoadResult(Field* fields);
+
+ uint32 Id = 0;
+ std::string Login;
+ bool IsLockedToIP = false;
+ std::string LockCountry;
+ std::string LastIP;
+ uint32 FailedLogins = 0;
+ bool IsBanned = false;
+ bool IsPermanenetlyBanned = false;
+ AccountTypes SecurityLevel = SEC_PLAYER;
+ std::string TokenKey;
+};
+
class AuthSession : public Socket<AuthSession>
{
+ typedef Socket<AuthSession> AuthSocket;
+
public:
static std::unordered_map<uint8, AuthHandler> InitHandlers();
- AuthSession(tcp::socket&& socket) : Socket(std::move(socket)),
- _isAuthenticated(false), _build(0), _expversion(0), _accountSecurityLevel(SEC_PLAYER)
- {
- N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7");
- g.SetDword(7);
- }
+ AuthSession(tcp::socket&& socket);
- void Start() override
- {
- AsyncRead();
- }
+ void Start() override;
+ bool Update() override;
void SendPacket(ByteBuffer& packet);
@@ -59,10 +78,10 @@ private:
bool HandleReconnectProof();
bool HandleRealmList();
- //data transfer handle for patch
- bool HandleXferResume();
- bool HandleXferCancel();
- bool HandleXferAccept();
+ void CheckIpCallback(PreparedQueryResult result);
+ void LogonChallengeCallback(PreparedQueryResult result);
+ void ReconnectChallengeCallback(PreparedQueryResult result);
+ void RealmListCallback(PreparedQueryResult result);
void SetVSFields(const std::string& rI);
@@ -71,22 +90,27 @@ private:
BigNumber K;
BigNumber _reconnectProof;
- bool _isAuthenticated;
+ bool _sentChallenge;
+ bool _sentProof;
+
+ AuthStatus _status;
+ AccountInfo _accountInfo;
std::string _tokenKey;
- std::string _login;
std::string _localizationName;
std::string _os;
+ std::string _ipCountry;
uint16 _build;
uint8 _expversion;
- AccountTypes _accountSecurityLevel;
+ PreparedQueryResultFuture _queryFuture;
+ std::function<void(PreparedQueryResult)> _queryCallback;
};
#pragma pack(push, 1)
struct AuthHandler
{
- uint32 status;
+ AuthStatus status;
size_t packetSize;
bool (AuthSession::*handler)();
};
diff --git a/src/server/authserver/Server/AuthSocketMgr.h b/src/server/authserver/Server/AuthSocketMgr.h
index fa96502663f..9923f2b2f11 100644
--- a/src/server/authserver/Server/AuthSocketMgr.h
+++ b/src/server/authserver/Server/AuthSocketMgr.h
@@ -21,8 +21,6 @@
#include "SocketMgr.h"
#include "AuthSession.h"
-void OnSocketAccept(tcp::socket&& sock);
-
class AuthSocketMgr : public SocketMgr<AuthSession>
{
typedef SocketMgr<AuthSession> BaseSocketMgr;
@@ -34,12 +32,12 @@ public:
return instance;
}
- bool StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port) override
+ bool StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port, int threadCount = 1) override
{
- if (!BaseSocketMgr::StartNetwork(service, bindIp, port))
+ if (!BaseSocketMgr::StartNetwork(service, bindIp, port, threadCount))
return false;
- _acceptor->AsyncAcceptManaged(&OnSocketAccept);
+ _acceptor->AsyncAcceptWithCallback<&AuthSocketMgr::OnSocketAccept>();
return true;
}
@@ -48,14 +46,13 @@ protected:
{
return new NetworkThread<AuthSession>[1];
}
+
+ static void OnSocketAccept(tcp::socket&& sock, uint32 threadIndex)
+ {
+ Instance().OnSocketOpen(std::forward<tcp::socket>(sock), threadIndex);
+ }
};
#define sAuthSocketMgr AuthSocketMgr::Instance()
-void OnSocketAccept(tcp::socket&& sock)
-{
- sAuthSocketMgr.OnSocketOpen(std::forward<tcp::socket>(sock));
-}
-
-
#endif // AuthSocketMgr_h__
diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist
index 604988d62e5..1d3b48839a8 100644
--- a/src/server/authserver/authserver.conf.dist
+++ b/src/server/authserver/authserver.conf.dist
@@ -131,6 +131,33 @@ WrongPass.BanType = 0
WrongPass.Logging = 0
#
+# BanExpiryCheckInterval
+# Description: Time (in seconds) between checks for expired bans
+# Default: 60
+
+BanExpiryCheckInterval = 60
+
+#
+# SourceDirectory
+# Description: The path to your TrinityCore source directory.
+# If the path is left empty, the built-in CMAKE_SOURCE_DIR is used.
+# Example: "../TrinityCore"
+# Default: ""
+
+SourceDirectory = ""
+
+#
+# MySQLExecutable
+# Description: The path to your mysql cli binary.
+# If the path is left empty, built-in path from cmake is used.
+# Example: "C:/Program Files/MySQL/MySQL Server 5.6/bin/mysql.exe"
+# "mysql.exe"
+# "/usr/bin/mysql"
+# Default: ""
+
+MySQLExecutable = ""
+
+#
###################################################################################################
###################################################################################################
@@ -152,11 +179,19 @@ LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth"
# LoginDatabase.WorkerThreads
# Description: The amount of worker threads spawned to handle asynchronous (delayed) MySQL
# statements. Each worker thread is mirrored with its own connection to the
+# MySQL server and their own thread on the MySQL server.
# Default: 1
LoginDatabase.WorkerThreads = 1
#
+# LoginDatabase.SynchThreads
+# Description: The amount of MySQL connections spawned to handle.
+# Default: 1 - (LoginDatabase.WorkerThreads)
+
+LoginDatabase.SynchThreads = 1
+
+#
###################################################################################################
###################################################################################################
@@ -174,26 +209,6 @@ LoginDatabase.WorkerThreads = 1
Updates.EnableDatabases = 0
#
-# Updates.SourcePath
-# Description: The path to your TrinityCore source directory.
-# If the path is left empty, built-in CMAKE_SOURCE_DIR is used.
-# Example: "../TrinityCore"
-# Default: ""
-
-Updates.SourcePath = ""
-
-#
-# Updates.MySqlCLIPath
-# Description: The path to your mysql cli binary.
-# If the path is left empty, built-in path from cmake is used.
-# Example: "C:/Program Files/MySQL/MySQL Server 5.6/bin/mysql.exe"
-# "mysql.exe"
-# "/usr/bin/mysql"
-# Default: ""
-
-Updates.MySqlCLIPath = ""
-
-#
# Updates.AutoSetup
# Description: Auto populate empty databases.
# Default: 1 - (Enabled)
diff --git a/src/server/database/CMakeLists.txt b/src/server/database/CMakeLists.txt
index 5a53899f4cb..bd2fa280ad6 100644
--- a/src/server/database/CMakeLists.txt
+++ b/src/server/database/CMakeLists.txt
@@ -8,34 +8,22 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-if (NOT MYSQL_FOUND)
- message(SEND_ERROR "MySQL wasn't found on your system but it's required to build the servers!")
-endif()
-
-if( USE_COREPCH )
- include_directories(${CMAKE_CURRENT_BINARY_DIR})
-endif()
-
-file(GLOB_RECURSE sources_Database Database/*.cpp Database/*.h)
-file(GLOB_RECURSE sources_Logging Logging/*.cpp Logging/*.h)
-file(GLOB_RECURSE sources_Updater Updater/*.cpp Updater/*.h)
-
-file(GLOB sources_localdir *.cpp *.h)
-
-#
-# Build shared sourcelist
-#
+CollectSourceFiles(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE_SOURCES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if (USE_COREPCH)
- set(database_STAT_PCH_HDR PrecompiledHeaders/databasePCH.h)
- set(database_STAT_PCH_SRC PrecompiledHeaders/databasePCH.cpp)
+ set(PRIVATE_PCH_HEADER PrecompiledHeaders/databasePCH.h)
+ set(PRIVATE_PCH_SOURCE PrecompiledHeaders/databasePCH.cpp)
endif()
-set(database_STAT_SRCS
- ${database_STAT_SRCS}
- ${sources_Database}
- ${sources_Logging}
- ${sources_Updater}
+GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
+
+add_library(database
+ ${PRIVATE_PCH_SOURCE}
+ ${PRIVATE_SOURCES}
)
# Do NOT add any extra include directory unless it does not create unneeded extra dependencies,
@@ -47,31 +35,43 @@ set(database_STAT_SRCS
# linkage (enums, defines...) it is discouraged to do so unless necessary, as it will pullute
# include_directories leading to further unnoticed dependency aditions
# Linker Depencency requirements: common
-include_directories(
+CollectIncludeDirectories(
${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/Database
- ${CMAKE_CURRENT_SOURCE_DIR}/Updater
- ${CMAKE_SOURCE_DIR}/dep/cppformat
- ${CMAKE_SOURCE_DIR}/dep/process
- ${CMAKE_SOURCE_DIR}/src/common/
- ${CMAKE_SOURCE_DIR}/src/common/Configuration
- ${CMAKE_SOURCE_DIR}/src/common/Debugging
- ${CMAKE_SOURCE_DIR}/src/common/Logging
- ${CMAKE_SOURCE_DIR}/src/common/Threading
- ${CMAKE_SOURCE_DIR}/src/common/Utilities
- ${MYSQL_INCLUDE_DIR}
- ${OPENSSL_INCLUDE_DIR}
- ${VALGRIND_INCLUDE_DIR}
-)
+ PUBLIC_INCLUDES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
-GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
+target_include_directories(database
+ PUBLIC
+ ${PUBLIC_INCLUDES}
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR})
-add_library(database STATIC
- ${database_STAT_SRCS}
- ${database_STAT_PCH_SRC}
-)
+add_definitions(-DTRINITY_API_EXPORT_DATABASE)
+
+target_link_libraries(database
+ PUBLIC
+ common
+ mysql)
+
+set_target_properties(database
+ PROPERTIES
+ FOLDER
+ "server")
+
+if( BUILD_SHARED_LIBS )
+ if( UNIX )
+ install(TARGETS database
+ LIBRARY
+ DESTINATION lib)
+ elseif( WIN32 )
+ install(TARGETS database
+ RUNTIME
+ DESTINATION "${CMAKE_INSTALL_PREFIX}")
+ endif()
+endif()
# Generate precompiled header
if (USE_COREPCH)
- add_cxx_pch(database ${database_STAT_PCH_HDR} ${database_STAT_PCH_SRC})
+ add_cxx_pch(database ${PRIVATE_PCH_HEADER} ${PRIVATE_PCH_SOURCE})
endif ()
diff --git a/src/server/database/Database/AdhocStatement.h b/src/server/database/Database/AdhocStatement.h
index ab85493a14e..9315038bce1 100644
--- a/src/server/database/Database/AdhocStatement.h
+++ b/src/server/database/Database/AdhocStatement.h
@@ -25,7 +25,7 @@ typedef std::future<QueryResult> QueryResultFuture;
typedef std::promise<QueryResult> QueryResultPromise;
/*! Raw, ad-hoc query. */
-class BasicStatementTask : public SQLOperation
+class TC_DATABASE_API BasicStatementTask : public SQLOperation
{
public:
BasicStatementTask(const char* sql, bool async = false);
diff --git a/src/server/database/Database/DatabaseEnv.cpp b/src/server/database/Database/DatabaseEnv.cpp
new file mode 100644
index 00000000000..3b2e632e4fb
--- /dev/null
+++ b/src/server/database/Database/DatabaseEnv.cpp
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "DatabaseEnv.h"
+
+WorldDatabaseWorkerPool WorldDatabase;
+CharacterDatabaseWorkerPool CharacterDatabase;
+LoginDatabaseWorkerPool LoginDatabase;
diff --git a/src/server/database/Database/DatabaseEnv.h b/src/server/database/Database/DatabaseEnv.h
index cc8355a1302..05a4d5aad75 100644
--- a/src/server/database/Database/DatabaseEnv.h
+++ b/src/server/database/Database/DatabaseEnv.h
@@ -38,9 +38,11 @@
#include "Implementation/CharacterDatabase.h"
#include "Implementation/WorldDatabase.h"
-extern WorldDatabaseWorkerPool WorldDatabase;
-extern CharacterDatabaseWorkerPool CharacterDatabase;
-extern LoginDatabaseWorkerPool LoginDatabase;
+/// Accessor to the world database
+TC_DATABASE_API extern WorldDatabaseWorkerPool WorldDatabase;
+/// Accessor to the character database
+TC_DATABASE_API extern CharacterDatabaseWorkerPool CharacterDatabase;
+/// Accessor to the realm/login database
+TC_DATABASE_API extern LoginDatabaseWorkerPool LoginDatabase;
#endif
-
diff --git a/src/server/database/Database/DatabaseLoader.cpp b/src/server/database/Database/DatabaseLoader.cpp
index 92d8730cd12..f358bdd54b4 100644
--- a/src/server/database/Database/DatabaseLoader.cpp
+++ b/src/server/database/Database/DatabaseLoader.cpp
@@ -32,7 +32,7 @@ DatabaseLoader& DatabaseLoader::AddDatabase(DatabaseWorkerPool<T>& pool, std::st
{
bool const updatesEnabledForThis = DBUpdater<T>::IsEnabled(_updateFlags);
- _open.push(std::make_pair([this, name, updatesEnabledForThis, &pool]() -> bool
+ _open.push([this, name, updatesEnabledForThis, &pool]() -> bool
{
std::string const dbString = sConfigMgr->GetStringDefault(name + "DatabaseInfo", "");
if (dbString.empty())
@@ -71,12 +71,13 @@ DatabaseLoader& DatabaseLoader::AddDatabase(DatabaseWorkerPool<T>& pool, std::st
return false;
}
}
+ // Add the close operation
+ _close.push([&pool]
+ {
+ pool.Close();
+ });
return true;
- },
- [&pool]()
- {
- pool.Close();
- }));
+ });
// Populate and update only if updates are enabled for this pool
if (updatesEnabledForThis)
@@ -137,38 +138,7 @@ bool DatabaseLoader::Load()
bool DatabaseLoader::OpenDatabases()
{
- while (!_open.empty())
- {
- std::pair<Predicate, std::function<void()>> const load = _open.top();
- if (load.first())
- _close.push(load.second);
- else
- {
- // Close all loaded databases
- while (!_close.empty())
- {
- _close.top()();
- _close.pop();
- }
- return false;
- }
-
- _open.pop();
- }
- return true;
-}
-
-// Processes the elements of the given stack until a predicate returned false.
-bool DatabaseLoader::Process(std::stack<Predicate>& stack)
-{
- while (!stack.empty())
- {
- if (!stack.top()())
- return false;
-
- stack.pop();
- }
- return true;
+ return Process(_open);
}
bool DatabaseLoader::PopulateDatabases()
@@ -186,9 +156,30 @@ bool DatabaseLoader::PrepareStatements()
return Process(_prepare);
}
-template
-DatabaseLoader& DatabaseLoader::AddDatabase<LoginDatabaseConnection>(DatabaseWorkerPool<LoginDatabaseConnection>& pool, std::string const& name);
-template
-DatabaseLoader& DatabaseLoader::AddDatabase<WorldDatabaseConnection>(DatabaseWorkerPool<WorldDatabaseConnection>& pool, std::string const& name);
-template
-DatabaseLoader& DatabaseLoader::AddDatabase<CharacterDatabaseConnection>(DatabaseWorkerPool<CharacterDatabaseConnection>& pool, std::string const& name);
+bool DatabaseLoader::Process(std::queue<Predicate>& queue)
+{
+ while (!queue.empty())
+ {
+ if (!queue.front()())
+ {
+ // Close all open databases which have a registered close operation
+ while (!_close.empty())
+ {
+ _close.top()();
+ _close.pop();
+ }
+
+ return false;
+ }
+
+ queue.pop();
+ }
+ return true;
+}
+
+template TC_DATABASE_API
+DatabaseLoader& DatabaseLoader::AddDatabase<LoginDatabaseConnection>(LoginDatabaseWorkerPool&, std::string const&);
+template TC_DATABASE_API
+DatabaseLoader& DatabaseLoader::AddDatabase<CharacterDatabaseConnection>(CharacterDatabaseWorkerPool&, std::string const&);
+template TC_DATABASE_API
+DatabaseLoader& DatabaseLoader::AddDatabase<WorldDatabaseConnection>(WorldDatabaseWorkerPool&, std::string const&);
diff --git a/src/server/database/Database/DatabaseLoader.h b/src/server/database/Database/DatabaseLoader.h
index da92cf85a9f..647c1e113e3 100644
--- a/src/server/database/Database/DatabaseLoader.h
+++ b/src/server/database/Database/DatabaseLoader.h
@@ -19,14 +19,15 @@
#define DatabaseLoader_h__
#include "DatabaseWorkerPool.h"
-#include "DatabaseEnv.h"
+#include "DBUpdater.h"
-#include <stack>
#include <functional>
+#include <stack>
+#include <queue>
// A helper class to initiate all database worker pools,
// handles updating, delays preparing of statements and cleans up on failure.
-class DatabaseLoader
+class TC_DATABASE_API DatabaseLoader
{
public:
DatabaseLoader(std::string const& logger, uint32 const defaultUpdateMask);
@@ -56,16 +57,18 @@ private:
bool PrepareStatements();
using Predicate = std::function<bool()>;
+ using Closer = std::function<void()>;
- static bool Process(std::stack<Predicate>& stack);
+ // Invokes all functions in the given queue and closes the databases on errors.
+ // Returns false when there was an error.
+ bool Process(std::queue<Predicate>& queue);
std::string const _logger;
bool const _autoSetup;
uint32 const _updateFlags;
- std::stack<std::pair<Predicate, std::function<void()>>> _open;
- std::stack<std::function<void()>> _close;
- std::stack<Predicate> _populate, _update, _prepare;
+ std::queue<Predicate> _open, _populate, _update, _prepare;
+ std::stack<Closer> _close;
};
#endif // DatabaseLoader_h__
diff --git a/src/server/database/Database/DatabaseWorker.h b/src/server/database/Database/DatabaseWorker.h
index c21a3d2a343..d6b43943f7d 100644
--- a/src/server/database/Database/DatabaseWorker.h
+++ b/src/server/database/Database/DatabaseWorker.h
@@ -24,7 +24,7 @@
class MySQLConnection;
class SQLOperation;
-class DatabaseWorker
+class TC_DATABASE_API DatabaseWorker
{
public:
DatabaseWorker(ProducerConsumerQueue<SQLOperation*>* newQueue, MySQLConnection* connection);
diff --git a/src/server/database/Database/DatabaseWorkerPool.cpp b/src/server/database/Database/DatabaseWorkerPool.cpp
new file mode 100644
index 00000000000..6fc4dc21a51
--- /dev/null
+++ b/src/server/database/Database/DatabaseWorkerPool.cpp
@@ -0,0 +1,322 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "DatabaseWorkerPool.h"
+#include "DatabaseEnv.h"
+
+#define MIN_MYSQL_SERVER_VERSION 50100u
+#define MIN_MYSQL_CLIENT_VERSION 50100u
+
+template <class T>
+DatabaseWorkerPool<T>::DatabaseWorkerPool()
+ : _queue(new ProducerConsumerQueue<SQLOperation*>()),
+ _async_threads(0), _synch_threads(0)
+{
+ WPFatal(mysql_thread_safe(), "Used MySQL library isn't thread-safe.");
+ WPFatal(mysql_get_client_version() >= MIN_MYSQL_CLIENT_VERSION, "TrinityCore does not support MySQL versions below 5.1");
+ WPFatal(mysql_get_client_version() == MYSQL_VERSION_ID, "Used MySQL library version (%s) does not match the version used to compile TrinityCore (%s). Search on forum for TCE00011.",
+ mysql_get_client_info(), MYSQL_SERVER_VERSION);
+}
+
+template <class T>
+void DatabaseWorkerPool<T>::SetConnectionInfo(std::string const& infoString,
+ uint8 const asyncThreads, uint8 const synchThreads)
+{
+ _connectionInfo = Trinity::make_unique<MySQLConnectionInfo>(infoString);
+
+ _async_threads = asyncThreads;
+ _synch_threads = synchThreads;
+}
+
+template <class T>
+uint32 DatabaseWorkerPool<T>::Open()
+{
+ WPFatal(_connectionInfo.get(), "Connection info was not set!");
+
+ TC_LOG_INFO("sql.driver", "Opening DatabasePool '%s'. "
+ "Asynchronous connections: %u, synchronous connections: %u.",
+ GetDatabaseName(), _async_threads, _synch_threads);
+
+ uint32 error = OpenConnections(IDX_ASYNC, _async_threads);
+
+ if (error)
+ return error;
+
+ error = OpenConnections(IDX_SYNCH, _synch_threads);
+
+ if (!error)
+ {
+ TC_LOG_INFO("sql.driver", "DatabasePool '%s' opened successfully. " SZFMTD
+ " total connections running.", GetDatabaseName(),
+ (_connections[IDX_SYNCH].size() + _connections[IDX_ASYNC].size()));
+ }
+
+ return error;
+}
+
+template <class T>
+void DatabaseWorkerPool<T>::Close()
+{
+ TC_LOG_INFO("sql.driver", "Closing down DatabasePool '%s'.", GetDatabaseName());
+
+ //! Closes the actualy MySQL connection.
+ _connections[IDX_ASYNC].clear();
+
+ TC_LOG_INFO("sql.driver", "Asynchronous connections on DatabasePool '%s' terminated. "
+ "Proceeding with synchronous connections.",
+ GetDatabaseName());
+
+ //! Shut down the synchronous connections
+ //! There's no need for locking the connection, because DatabaseWorkerPool<>::Close
+ //! should only be called after any other thread tasks in the core have exited,
+ //! meaning there can be no concurrent access at this point.
+ _connections[IDX_SYNCH].clear();
+
+ TC_LOG_INFO("sql.driver", "All connections on DatabasePool '%s' closed.", GetDatabaseName());
+}
+
+template <class T>
+bool DatabaseWorkerPool<T>::PrepareStatements()
+{
+ for (auto& connections : _connections)
+ for (auto& connection : connections)
+ {
+ connection->LockIfReady();
+ if (!connection->PrepareStatements())
+ {
+ connection->Unlock();
+ Close();
+ return false;
+ }
+ else
+ connection->Unlock();
+ }
+
+ return true;
+}
+
+template <class T>
+QueryResult DatabaseWorkerPool<T>::Query(const char* sql, T* connection /*= nullptr*/)
+{
+ if (!connection)
+ connection = GetFreeConnection();
+
+ ResultSet* result = connection->Query(sql);
+ connection->Unlock();
+ if (!result || !result->GetRowCount() || !result->NextRow())
+ {
+ delete result;
+ return QueryResult(NULL);
+ }
+
+ return QueryResult(result);
+}
+
+template <class T>
+PreparedQueryResult DatabaseWorkerPool<T>::Query(PreparedStatement* stmt)
+{
+ auto connection = GetFreeConnection();
+ PreparedResultSet* ret = connection->Query(stmt);
+ connection->Unlock();
+
+ //! Delete proxy-class. Not needed anymore
+ delete stmt;
+
+ if (!ret || !ret->GetRowCount())
+ {
+ delete ret;
+ return PreparedQueryResult(NULL);
+ }
+
+ return PreparedQueryResult(ret);
+}
+
+template <class T>
+QueryResultFuture DatabaseWorkerPool<T>::AsyncQuery(const char* sql)
+{
+ BasicStatementTask* task = new BasicStatementTask(sql, true);
+ // Store future result before enqueueing - task might get already processed and deleted before returning from this method
+ QueryResultFuture result = task->GetFuture();
+ Enqueue(task);
+ return result;
+}
+
+template <class T>
+PreparedQueryResultFuture DatabaseWorkerPool<T>::AsyncQuery(PreparedStatement* stmt)
+{
+ PreparedStatementTask* task = new PreparedStatementTask(stmt, true);
+ // Store future result before enqueueing - task might get already processed and deleted before returning from this method
+ PreparedQueryResultFuture result = task->GetFuture();
+ Enqueue(task);
+ return result;
+}
+
+template <class T>
+QueryResultHolderFuture DatabaseWorkerPool<T>::DelayQueryHolder(SQLQueryHolder* holder)
+{
+ SQLQueryHolderTask* task = new SQLQueryHolderTask(holder);
+ // Store future result before enqueueing - task might get already processed and deleted before returning from this method
+ QueryResultHolderFuture result = task->GetFuture();
+ Enqueue(task);
+ return result;
+}
+
+template <class T>
+void DatabaseWorkerPool<T>::CommitTransaction(SQLTransaction transaction)
+{
+#ifdef TRINITY_DEBUG
+ //! Only analyze transaction weaknesses in Debug mode.
+ //! Ideally we catch the faults in Debug mode and then correct them,
+ //! so there's no need to waste these CPU cycles in Release mode.
+ switch (transaction->GetSize())
+ {
+ case 0:
+ TC_LOG_DEBUG("sql.driver", "Transaction contains 0 queries. Not executing.");
+ return;
+ case 1:
+ TC_LOG_DEBUG("sql.driver", "Warning: Transaction only holds 1 query, consider removing Transaction context in code.");
+ break;
+ default:
+ break;
+ }
+#endif // TRINITY_DEBUG
+
+ Enqueue(new TransactionTask(transaction));
+}
+
+template <class T>
+void DatabaseWorkerPool<T>::DirectCommitTransaction(SQLTransaction& transaction)
+{
+ T* connection = GetFreeConnection();
+ int errorCode = connection->ExecuteTransaction(transaction);
+ if (!errorCode)
+ {
+ connection->Unlock(); // OK, operation succesful
+ return;
+ }
+
+ //! Handle MySQL Errno 1213 without extending deadlock to the core itself
+ /// @todo More elegant way
+ if (errorCode == ER_LOCK_DEADLOCK)
+ {
+ uint8 loopBreaker = 5;
+ for (uint8 i = 0; i < loopBreaker; ++i)
+ {
+ if (!connection->ExecuteTransaction(transaction))
+ break;
+ }
+ }
+
+ //! Clean up now.
+ transaction->Cleanup();
+
+ connection->Unlock();
+}
+
+template <class T>
+void DatabaseWorkerPool<T>::EscapeString(std::string& str)
+{
+ if (str.empty())
+ return;
+
+ char* buf = new char[str.size() * 2 + 1];
+ EscapeString(buf, str.c_str(), uint32(str.size()));
+ str = buf;
+ delete[] buf;
+}
+
+template <class T>
+void DatabaseWorkerPool<T>::KeepAlive()
+{
+ //! Ping synchronous connections
+ for (auto& connection : _connections[IDX_SYNCH])
+ {
+ if (connection->LockIfReady())
+ {
+ connection->Ping();
+ connection->Unlock();
+ }
+ }
+
+ //! Assuming all worker threads are free, every worker thread will receive 1 ping operation request
+ //! If one or more worker threads are busy, the ping operations will not be split evenly, but this doesn't matter
+ //! as the sole purpose is to prevent connections from idling.
+ auto const count = _connections[IDX_ASYNC].size();
+ for (uint8 i = 0; i < count; ++i)
+ Enqueue(new PingOperation);
+}
+
+template <class T>
+uint32 DatabaseWorkerPool<T>::OpenConnections(InternalIndex type, uint8 numConnections)
+{
+ for (uint8 i = 0; i < numConnections; ++i)
+ {
+ // Create the connection
+ auto connection = [&] {
+ switch (type)
+ {
+ case IDX_ASYNC:
+ return Trinity::make_unique<T>(_queue.get(), *_connectionInfo);
+ case IDX_SYNCH:
+ return Trinity::make_unique<T>(*_connectionInfo);
+ default:
+ ABORT();
+ }
+ }();
+
+ if (uint32 error = connection->Open())
+ {
+ // Failed to open a connection or invalid version, abort and cleanup
+ _connections[type].clear();
+ return error;
+ }
+ else if (mysql_get_server_version(connection->GetHandle()) < MIN_MYSQL_SERVER_VERSION)
+ {
+ TC_LOG_ERROR("sql.driver", "TrinityCore does not support MySQL versions below 5.1");
+ return 1;
+ }
+ else
+ {
+ _connections[type].push_back(std::move(connection));
+ }
+ }
+
+ // Everything is fine
+ return 0;
+}
+
+template <class T>
+T* DatabaseWorkerPool<T>::GetFreeConnection()
+{
+ uint8 i = 0;
+ auto const num_cons = _connections[IDX_SYNCH].size();
+ T* connection = nullptr;
+ //! Block forever until a connection is free
+ for (;;)
+ {
+ connection = _connections[IDX_SYNCH][++i % num_cons].get();
+ //! Must be matched with t->Unlock() or you will get deadlocks
+ if (connection->LockIfReady())
+ break;
+ }
+
+ return connection;
+}
+
+template class TC_DATABASE_API DatabaseWorkerPool<LoginDatabaseConnection>;
+template class TC_DATABASE_API DatabaseWorkerPool<WorldDatabaseConnection>;
+template class TC_DATABASE_API DatabaseWorkerPool<CharacterDatabaseConnection>;
diff --git a/src/server/database/Database/DatabaseWorkerPool.h b/src/server/database/Database/DatabaseWorkerPool.h
index d5a254647eb..ffdde91c0a6 100644
--- a/src/server/database/Database/DatabaseWorkerPool.h
+++ b/src/server/database/Database/DatabaseWorkerPool.h
@@ -19,7 +19,7 @@
#define _DATABASEWORKERPOOL_H
#include "Common.h"
-#include "Callback.h"
+#include "QueryCallback.h"
#include "MySQLConnection.h"
#include "Transaction.h"
#include "DatabaseWorker.h"
@@ -32,9 +32,7 @@
#include <mysqld_error.h>
#include <memory>
-
-#define MIN_MYSQL_SERVER_VERSION 50100u
-#define MIN_MYSQL_CLIENT_VERSION 50100u
+#include <array>
class PingOperation : public SQLOperation
{
@@ -59,97 +57,21 @@ class DatabaseWorkerPool
public:
/* Activity state */
- DatabaseWorkerPool() : _queue(new ProducerConsumerQueue<SQLOperation*>()),
- _async_threads(0), _synch_threads(0)
- {
- memset(_connectionCount, 0, sizeof(_connectionCount));
- _connections.resize(IDX_SIZE);
-
- WPFatal(mysql_thread_safe(), "Used MySQL library isn't thread-safe.");
- WPFatal(mysql_get_client_version() >= MIN_MYSQL_CLIENT_VERSION, "TrinityCore does not support MySQL versions below 5.1");
- WPFatal(mysql_get_client_version() == MYSQL_VERSION_ID, "Used MySQL library version (%s) does not match the version used to compile TrinityCore (%s).",
- mysql_get_client_info(), MYSQL_SERVER_VERSION);
- }
+ DatabaseWorkerPool();
~DatabaseWorkerPool()
{
_queue->Cancel();
}
- void SetConnectionInfo(std::string const& infoString, uint8 const asyncThreads, uint8 const synchThreads)
- {
- _connectionInfo.reset(new MySQLConnectionInfo(infoString));
-
- _async_threads = asyncThreads;
- _synch_threads = synchThreads;
- }
+ void SetConnectionInfo(std::string const& infoString, uint8 const asyncThreads, uint8 const synchThreads);
- uint32 Open()
- {
- WPFatal(_connectionInfo.get(), "Connection info was not set!");
+ uint32 Open();
- TC_LOG_INFO("sql.driver", "Opening DatabasePool '%s'. Asynchronous connections: %u, synchronous connections: %u.",
- GetDatabaseName(), _async_threads, _synch_threads);
-
- uint32 error = OpenConnections(IDX_ASYNC, _async_threads);
-
- if (error)
- return error;
-
- error = OpenConnections(IDX_SYNCH, _synch_threads);
-
- if (!error)
- {
- TC_LOG_INFO("sql.driver", "DatabasePool '%s' opened successfully. %u total connections running.", GetDatabaseName(),
- (_connectionCount[IDX_SYNCH] + _connectionCount[IDX_ASYNC]));
- }
-
- return error;
- }
-
- void Close()
- {
- TC_LOG_INFO("sql.driver", "Closing down DatabasePool '%s'.", GetDatabaseName());
-
- for (uint8 i = 0; i < _connectionCount[IDX_ASYNC]; ++i)
- {
- T* t = _connections[IDX_ASYNC][i];
- t->Close(); //! Closes the actualy MySQL connection.
- }
-
- TC_LOG_INFO("sql.driver", "Asynchronous connections on DatabasePool '%s' terminated. Proceeding with synchronous connections.",
- GetDatabaseName());
-
- //! Shut down the synchronous connections
- //! There's no need for locking the connection, because DatabaseWorkerPool<>::Close
- //! should only be called after any other thread tasks in the core have exited,
- //! meaning there can be no concurrent access at this point.
- for (uint8 i = 0; i < _connectionCount[IDX_SYNCH]; ++i)
- _connections[IDX_SYNCH][i]->Close();
-
- TC_LOG_INFO("sql.driver", "All connections on DatabasePool '%s' closed.", GetDatabaseName());
- }
+ void Close();
//! Prepares all prepared statements
- bool PrepareStatements()
- {
- for (uint8 i = 0; i < IDX_SIZE; ++i)
- for (uint32 c = 0; c < _connectionCount[i]; ++c)
- {
- T* t = _connections[i][c];
- t->LockIfReady();
- if (!t->PrepareStatements())
- {
- t->Unlock();
- Close();
- return false;
- }
- else
- t->Unlock();
- }
-
- return true;
- }
+ bool PrepareStatements();
inline MySQLConnectionInfo const* GetConnectionInfo() const
{
@@ -198,12 +120,12 @@ class DatabaseWorkerPool
//! This method should only be used for queries that are only executed once, e.g during startup.
void DirectExecute(const char* sql)
{
- if (!sql)
+ if (Trinity::IsFormatEmptyOrNull(sql))
return;
- T* t = GetFreeConnection();
- t->Execute(sql);
- t->Unlock();
+ T* connection = GetFreeConnection();
+ connection->Execute(sql);
+ connection->Unlock();
}
//! Directly executes a one-way SQL operation in string format -with variable args-, that will block the calling thread until finished.
@@ -221,9 +143,9 @@ class DatabaseWorkerPool
//! Statement must be prepared with the CONNECTION_SYNCH flag.
void DirectExecute(PreparedStatement* stmt)
{
- T* t = GetFreeConnection();
- t->Execute(stmt);
- t->Unlock();
+ T* connection = GetFreeConnection();
+ connection->Execute(stmt);
+ connection->Unlock();
//! Delete proxy-class. Not needed anymore
delete stmt;
@@ -235,21 +157,7 @@ class DatabaseWorkerPool
//! Directly executes an SQL query in string format that will block the calling thread until finished.
//! Returns reference counted auto pointer, no need for manual memory management in upper level code.
- QueryResult Query(const char* sql, T* conn = nullptr)
- {
- if (!conn)
- conn = GetFreeConnection();
-
- ResultSet* result = conn->Query(sql);
- conn->Unlock();
- if (!result || !result->GetRowCount() || !result->NextRow())
- {
- delete result;
- return QueryResult(NULL);
- }
-
- return QueryResult(result);
- }
+ QueryResult Query(const char* sql, T* connection = nullptr);
//! Directly executes an SQL query in string format -with variable args- that will block the calling thread until finished.
//! Returns reference counted auto pointer, no need for manual memory management in upper level code.
@@ -267,7 +175,7 @@ class DatabaseWorkerPool
template<typename Format, typename... Args>
QueryResult PQuery(Format&& sql, Args&&... args)
{
- if (!sql)
+ if (Trinity::IsFormatEmptyOrNull(sql))
return QueryResult(nullptr);
return Query(Trinity::StringFormat(std::forward<Format>(sql), std::forward<Args>(args)...).c_str());
@@ -276,23 +184,7 @@ class DatabaseWorkerPool
//! Directly executes an SQL query in prepared format that will block the calling thread until finished.
//! Returns reference counted auto pointer, no need for manual memory management in upper level code.
//! Statement must be prepared with CONNECTION_SYNCH flag.
- PreparedQueryResult Query(PreparedStatement* stmt)
- {
- T* t = GetFreeConnection();
- PreparedResultSet* ret = t->Query(stmt);
- t->Unlock();
-
- //! Delete proxy-class. Not needed anymore
- delete stmt;
-
- if (!ret || !ret->GetRowCount())
- {
- delete ret;
- return PreparedQueryResult(NULL);
- }
-
- return PreparedQueryResult(ret);
- }
+ PreparedQueryResult Query(PreparedStatement* stmt);
/**
Asynchronous query (with resultset) methods.
@@ -300,14 +192,7 @@ class DatabaseWorkerPool
//! Enqueues a query in string format that will set the value of the QueryResultFuture return object as soon as the query is executed.
//! The return value is then processed in ProcessQueryCallback methods.
- QueryResultFuture AsyncQuery(const char* sql)
- {
- BasicStatementTask* task = new BasicStatementTask(sql, true);
- // Store future result before enqueueing - task might get already processed and deleted before returning from this method
- QueryResultFuture result = task->GetFuture();
- Enqueue(task);
- return result;
- }
+ QueryResultFuture AsyncQuery(const char* sql);
//! Enqueues a query in string format -with variable args- that will set the value of the QueryResultFuture return object as soon as the query is executed.
//! The return value is then processed in ProcessQueryCallback methods.
@@ -320,27 +205,13 @@ class DatabaseWorkerPool
//! Enqueues a query in prepared format that will set the value of the PreparedQueryResultFuture return object as soon as the query is executed.
//! The return value is then processed in ProcessQueryCallback methods.
//! Statement must be prepared with CONNECTION_ASYNC flag.
- PreparedQueryResultFuture AsyncQuery(PreparedStatement* stmt)
- {
- PreparedStatementTask* task = new PreparedStatementTask(stmt, true);
- // Store future result before enqueueing - task might get already processed and deleted before returning from this method
- PreparedQueryResultFuture result = task->GetFuture();
- Enqueue(task);
- return result;
- }
+ PreparedQueryResultFuture AsyncQuery(PreparedStatement* stmt);
//! Enqueues a vector of SQL operations (can be both adhoc and prepared) that will set the value of the QueryResultHolderFuture
//! return object as soon as the query is executed.
//! The return value is then processed in ProcessQueryCallback methods.
//! Any prepared statements added to this holder need to be prepared with the CONNECTION_ASYNC flag.
- QueryResultHolderFuture DelayQueryHolder(SQLQueryHolder* holder)
- {
- SQLQueryHolderTask* task = new SQLQueryHolderTask(holder);
- // Store future result before enqueueing - task might get already processed and deleted before returning from this method
- QueryResultHolderFuture result = task->GetFuture();
- Enqueue(task);
- return result;
- }
+ QueryResultHolderFuture DelayQueryHolder(SQLQueryHolder* holder);
/**
Transaction context methods.
@@ -354,57 +225,11 @@ class DatabaseWorkerPool
//! Enqueues a collection of one-way SQL operations (can be both adhoc and prepared). The order in which these operations
//! were appended to the transaction will be respected during execution.
- void CommitTransaction(SQLTransaction transaction)
- {
- #ifdef TRINITY_DEBUG
- //! Only analyze transaction weaknesses in Debug mode.
- //! Ideally we catch the faults in Debug mode and then correct them,
- //! so there's no need to waste these CPU cycles in Release mode.
- switch (transaction->GetSize())
- {
- case 0:
- TC_LOG_DEBUG("sql.driver", "Transaction contains 0 queries. Not executing.");
- return;
- case 1:
- TC_LOG_DEBUG("sql.driver", "Warning: Transaction only holds 1 query, consider removing Transaction context in code.");
- break;
- default:
- break;
- }
- #endif // TRINITY_DEBUG
-
- Enqueue(new TransactionTask(transaction));
- }
+ void CommitTransaction(SQLTransaction transaction);
//! Directly executes a collection of one-way SQL operations (can be both adhoc and prepared). The order in which these operations
//! were appended to the transaction will be respected during execution.
- void DirectCommitTransaction(SQLTransaction& transaction)
- {
- T* con = GetFreeConnection();
- int errorCode = con->ExecuteTransaction(transaction);
- if (!errorCode)
- {
- con->Unlock(); // OK, operation succesful
- return;
- }
-
- //! Handle MySQL Errno 1213 without extending deadlock to the core itself
- /// @todo More elegant way
- if (errorCode == ER_LOCK_DEADLOCK)
- {
- uint8 loopBreaker = 5;
- for (uint8 i = 0; i < loopBreaker; ++i)
- {
- if (!con->ExecuteTransaction(transaction))
- break;
- }
- }
-
- //! Clean up now.
- transaction->Cleanup();
-
- con->Unlock();
- }
+ void DirectCommitTransaction(SQLTransaction& transaction);
//! Method used to execute prepared statements in a diverse context.
//! Will be wrapped in a transaction if valid object is present, otherwise executed standalone.
@@ -441,90 +266,21 @@ class DatabaseWorkerPool
}
//! Apply escape string'ing for current collation. (utf8)
- void EscapeString(std::string& str)
- {
- if (str.empty())
- return;
-
- char* buf = new char[str.size() * 2 + 1];
- EscapeString(buf, str.c_str(), str.size());
- str = buf;
- delete[] buf;
- }
+ void EscapeString(std::string& str);
//! Keeps all our MySQL connections alive, prevent the server from disconnecting us.
- void KeepAlive()
- {
- //! Ping synchronous connections
- for (uint8 i = 0; i < _connectionCount[IDX_SYNCH]; ++i)
- {
- T* t = _connections[IDX_SYNCH][i];
- if (t->LockIfReady())
- {
- t->Ping();
- t->Unlock();
- }
- }
-
- //! Assuming all worker threads are free, every worker thread will receive 1 ping operation request
- //! If one or more worker threads are busy, the ping operations will not be split evenly, but this doesn't matter
- //! as the sole purpose is to prevent connections from idling.
- for (size_t i = 0; i < _connections[IDX_ASYNC].size(); ++i)
- Enqueue(new PingOperation);
- }
+ void KeepAlive();
private:
- uint32 OpenConnections(InternalIndex type, uint8 numConnections)
- {
- _connections[type].resize(numConnections);
- for (uint8 i = 0; i < numConnections; ++i)
- {
- T* t;
-
- if (type == IDX_ASYNC)
- t = new T(_queue.get(), *_connectionInfo);
- else if (type == IDX_SYNCH)
- t = new T(*_connectionInfo);
- else
- ABORT();
-
- _connections[type][i] = t;
- ++_connectionCount[type];
-
- uint32 error = t->Open();
-
- if (!error)
- {
- if (mysql_get_server_version(t->GetHandle()) < MIN_MYSQL_SERVER_VERSION)
- {
- TC_LOG_ERROR("sql.driver", "TrinityCore does not support MySQL versions below 5.1");
- error = 1;
- }
- }
-
- // Failed to open a connection or invalid version, abort and cleanup
- if (error)
- {
- while (_connectionCount[type] != 0)
- {
- t = _connections[type][i--];
- delete t;
- --_connectionCount[type];
- }
- return error;
- }
- }
-
- // Everything is fine
- return 0;
- }
+ uint32 OpenConnections(InternalIndex type, uint8 numConnections);
unsigned long EscapeString(char *to, const char *from, unsigned long length)
{
if (!to || !from || !length)
return 0;
- return mysql_real_escape_string(_connections[IDX_SYNCH][0]->GetHandle(), to, from, length);
+ return mysql_real_escape_string(
+ _connections[IDX_SYNCH].front()->GetHandle(), to, from, length);
}
void Enqueue(SQLOperation* op)
@@ -534,22 +290,7 @@ class DatabaseWorkerPool
//! Gets a free connection in the synchronous connection pool.
//! Caller MUST call t->Unlock() after touching the MySQL context to prevent deadlocks.
- T* GetFreeConnection()
- {
- uint8 i = 0;
- size_t num_cons = _connectionCount[IDX_SYNCH];
- T* t = NULL;
- //! Block forever until a connection is free
- for (;;)
- {
- t = _connections[IDX_SYNCH][++i % num_cons];
- //! Must be matched with t->Unlock() or you will get deadlocks
- if (t->LockIfReady())
- break;
- }
-
- return t;
- }
+ T* GetFreeConnection();
char const* GetDatabaseName() const
{
@@ -558,9 +299,7 @@ class DatabaseWorkerPool
//! Queue shared by async worker threads.
std::unique_ptr<ProducerConsumerQueue<SQLOperation*>> _queue;
- std::vector<std::vector<T*>> _connections;
- //! Counter of MySQL connections;
- uint32 _connectionCount[IDX_SIZE];
+ std::array<std::vector<std::unique_ptr<T>>, IDX_SIZE> _connections;
std::unique_ptr<MySQLConnectionInfo> _connectionInfo;
uint8 _async_threads, _synch_threads;
};
diff --git a/src/server/database/Database/Field.h b/src/server/database/Database/Field.h
index ec9e626ee1b..123e25dbbf3 100644
--- a/src/server/database/Database/Field.h
+++ b/src/server/database/Database/Field.h
@@ -53,7 +53,7 @@
| SUM, AVG | DECIMAL |
| COUNT | BIGINT |
*/
-class Field
+class TC_DATABASE_API Field
{
friend class ResultSet;
friend class PreparedResultSet;
@@ -323,7 +323,7 @@ class Field
data.value = NULL;
}
- static size_t SizeForType(MYSQL_FIELD* field)
+ static uint32 SizeForType(MYSQL_FIELD* field)
{
switch (field->type)
{
diff --git a/src/server/database/Database/Implementation/CharacterDatabase.cpp b/src/server/database/Database/Implementation/CharacterDatabase.cpp
index ab68aca2a8c..bb0e2bb09d4 100644
--- a/src/server/database/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/database/Database/Implementation/CharacterDatabase.cpp
@@ -42,11 +42,11 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_SEL_MAIL_LIST_INFO, "SELECT id, sender, (SELECT name FROM characters WHERE guid = sender) AS sendername, receiver, (SELECT name FROM characters WHERE guid = receiver) AS receivername, "
"subject, deliver_time, expire_time, money, has_items FROM mail WHERE receiver = ? ", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_MAIL_LIST_ITEMS, "SELECT itemEntry,count FROM item_instance WHERE guid = ?", CONNECTION_SYNCH);
- PrepareStatement(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, "
+ PrepareStatement(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.skin, c.face, c.hairStyle, c.hairColor, c.facialStyle, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, "
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid "
"FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid "
"LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? AND c.deleteInfos_Name IS NULL ORDER BY c.guid", CONNECTION_ASYNC);
- PrepareStatement(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, "
+ PrepareStatement(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.skin, c.face, c.hairStyle, c.hairColor, c.facialStyle, c.level, c.zone, c.map, "
"c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, "
"cb.guid, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? "
"LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid "
@@ -56,7 +56,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_SEL_CHAR_RACE, "SELECT race FROM characters WHERE guid = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_CHAR_LEVEL, "SELECT level FROM characters WHERE guid = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_CHAR_ZONE, "SELECT zone FROM characters WHERE guid = ?", CONNECTION_SYNCH);
- PrepareStatement(CHAR_SEL_CHARACTER_NAME_DATA, "SELECT race, class, gender, level FROM characters WHERE guid = ?", CONNECTION_SYNCH);
+ PrepareStatement(CHAR_SEL_CHARACTER_NAME_DATA, "SELECT race, class, gender, level, name FROM characters WHERE guid = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_CHAR_POSITION_XYZ, "SELECT map, position_x, position_y, position_z FROM characters WHERE guid = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_CHAR_POSITION, "SELECT position_x, position_y, position_z, orientation, map, taxi_path FROM characters WHERE guid = ?", CONNECTION_SYNCH);
@@ -64,7 +64,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_BATTLEGROUND_RANDOM, "DELETE FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_BATTLEGROUND_RANDOM, "INSERT INTO character_battleground_random (guid) VALUES (?)", CONNECTION_ASYNC);
- PrepareStatement(CHAR_SEL_CHARACTER, "SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, "
+ PrepareStatement(CHAR_SEL_CHARACTER, "SELECT guid, account, name, race, class, gender, level, xp, money, skin, face, hairStyle, hairColor, facialStyle, bankSlots, restState, playerFlags, "
"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, "
"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, "
"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, "
@@ -157,11 +157,9 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_GIFT, "DELETE FROM character_gifts WHERE item_guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM, "SELECT entry, flags FROM character_gifts WHERE item_guid = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_ACCOUNT_BY_NAME, "SELECT account FROM characters WHERE name = ?", CONNECTION_SYNCH);
- PrepareStatement(CHAR_SEL_CHARACTER_DATA_BY_GUID, "SELECT account, name, level FROM characters WHERE guid = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES, "DELETE FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_ACCOUNT_INSTANCE_LOCK_TIMES, "INSERT INTO account_instance_times (accountId, instanceId, releaseTime) VALUES (?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHARACTER_NAME_CLASS, "SELECT name, class FROM characters WHERE guid = ?", CONNECTION_SYNCH);
- PrepareStatement(CHAR_SEL_CHARACTER_NAME, "SELECT name FROM characters WHERE guid = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_MATCH_MAKER_RATING, "SELECT matchMakerRating FROM character_arena_stats WHERE guid = ? AND slot = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_CHARACTER_COUNT, "SELECT account, COUNT(guid) FROM characters WHERE account = ? GROUP BY account", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_NAME, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC);
@@ -351,7 +349,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_LFG_DATA, "DELETE FROM lfg_data WHERE guid = ?", CONNECTION_ASYNC);
// Player saving
- PrepareStatement(CHAR_INS_CHARACTER, "INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, "
+ PrepareStatement(CHAR_INS_CHARACTER, "INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, skin, face, hairStyle, hairColor, facialStyle, bankSlots, restState, playerFlags, "
"map, instance_id, instance_mode_mask, position_x, position_y, position_z, orientation, trans_x, trans_y, trans_z, trans_o, transguid, "
"taximask, cinematic, "
"totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, "
@@ -359,8 +357,8 @@ void CharacterDatabaseConnection::DoPrepareStatements()
"death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, "
"todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, "
"power4, power5, power6, power7, latency, talentGroupsCount, activeTalentGroup, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels) VALUES "
- "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC);
- PrepareStatement(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,playerBytes=?,playerBytes2=?,playerFlags=?,"
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC);
+ PrepareStatement(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,skin=?,face=?,hairStyle=?,hairColor=?,facialStyle=?,bankSlots=?,restState=?,playerFlags=?,"
"map=?,instance_id=?,instance_mode_mask=?,position_x=?,position_y=?,position_z=?,orientation=?,trans_x=?,trans_y=?,trans_z=?,trans_o=?,transguid=?,taximask=?,cinematic=?,totaltime=?,leveltime=?,rest_bonus=?,"
"logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?,"
"arenaPoints=?,totalHonorPoints=?,todayHonorPoints=?,yesterdayHonorPoints=?,totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?,knownCurrencies=?,"
@@ -407,7 +405,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID, "DELETE FROM character_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_CHAR_INSTANCE, "UPDATE character_instance SET instance = ?, permanent = ?, extendState = ? WHERE guid = ? AND instance = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_CHAR_INSTANCE, "INSERT INTO character_instance (guid, instance, permanent, extendState) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC);
- PrepareStatement(CHAR_UPD_GENDER_PLAYERBYTES, "UPDATE characters SET gender = ?, playerBytes = ?, playerBytes2 = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PrepareStatement(CHAR_UPD_GENDER_AND_APPEARANCE, "UPDATE characters SET gender = ?, skin = ?, face = ?, hairStyle = ?, hairColor = ?, facialStyle = ? WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_CHARACTER_SKILL, "DELETE FROM character_skills WHERE guid = ? AND skill = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS, "UPDATE character_social SET flags = flags | ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS, "UPDATE character_social SET flags = flags & ~ ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC);
@@ -440,7 +438,6 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_SEL_CHAR_OLD_CHARS, "SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID, "SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid = ? AND type = ? LIMIT 1", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_MAIL, "SELECT id, messageType, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked, stationery, mailTemplateId FROM mail WHERE receiver = ? ORDER BY id DESC", CONNECTION_SYNCH);
- PrepareStatement(CHAR_SEL_CHAR_PLAYERBYTES2, "SELECT playerBytes2 FROM characters WHERE guid = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_CHAR_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_DEL_CHAR_AURA_FROZEN, "DELETE FROM character_aura WHERE spell = 9454 AND guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM character_inventory ci INNER JOIN item_instance ii ON ii.guid = ci.item WHERE itemEntry = ?", CONNECTION_SYNCH);
diff --git a/src/server/database/Database/Implementation/CharacterDatabase.h b/src/server/database/Database/Implementation/CharacterDatabase.h
index 19d4a609e77..0cac6d35b55 100644
--- a/src/server/database/Database/Implementation/CharacterDatabase.h
+++ b/src/server/database/Database/Implementation/CharacterDatabase.h
@@ -146,13 +146,11 @@ enum CharacterDatabaseStatements
CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES,
CHAR_INS_ACCOUNT_INSTANCE_LOCK_TIMES,
CHAR_SEL_CHARACTER_NAME_CLASS,
- CHAR_SEL_CHARACTER_NAME,
CHAR_SEL_MATCH_MAKER_RATING,
CHAR_SEL_CHARACTER_COUNT,
CHAR_UPD_NAME,
CHAR_UPD_NAME_BY_GUID,
CHAR_DEL_DECLINED_NAME,
- CHAR_SEL_CHARACTER_DATA_BY_GUID,
CHAR_INS_GUILD,
CHAR_DEL_GUILD,
@@ -334,7 +332,7 @@ enum CharacterDatabaseStatements
CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID,
CHAR_UPD_CHAR_INSTANCE,
CHAR_INS_CHAR_INSTANCE,
- CHAR_UPD_GENDER_PLAYERBYTES,
+ CHAR_UPD_GENDER_AND_APPEARANCE,
CHAR_DEL_CHARACTER_SKILL,
CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS,
CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS,
@@ -371,7 +369,6 @@ enum CharacterDatabaseStatements
CHAR_SEL_CHAR_OLD_CHARS,
CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID,
CHAR_SEL_MAIL,
- CHAR_SEL_CHAR_PLAYERBYTES2,
CHAR_SEL_CHAR_GUID_BY_NAME,
CHAR_DEL_CHAR_AURA_FROZEN,
CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM,
@@ -538,7 +535,7 @@ enum CharacterDatabaseStatements
MAX_CHARACTERDATABASE_STATEMENTS
};
-class CharacterDatabaseConnection : public MySQLConnection
+class TC_DATABASE_API CharacterDatabaseConnection : public MySQLConnection
{
public:
typedef CharacterDatabaseStatements Statements;
diff --git a/src/server/database/Database/Implementation/LoginDatabase.cpp b/src/server/database/Database/Implementation/LoginDatabase.cpp
index 66847f0a6a0..4f056e2686d 100644
--- a/src/server/database/Database/Implementation/LoginDatabase.cpp
+++ b/src/server/database/Database/Implementation/LoginDatabase.cpp
@@ -24,33 +24,34 @@ void LoginDatabaseConnection::DoPrepareStatements()
PrepareStatement(LOGIN_SEL_REALMLIST, "SELECT id, name, address, localAddress, localSubnetMask, port, icon, flag, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE flag <> 3 ORDER BY name", CONNECTION_SYNCH);
PrepareStatement(LOGIN_DEL_EXPIRED_IP_BANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC);
- PrepareStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_SYNCH);
+ PrepareStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC);
PrepareStatement(LOGIN_SEL_IP_INFO, "(SELECT unbandate > UNIX_TIMESTAMP() OR unbandate = bandate AS banned, NULL as country FROM ip_banned WHERE ip = ?) "
"UNION "
"(SELECT NULL AS banned, country FROM ip2nation WHERE INET_NTOA(ip) = ?)", CONNECTION_ASYNC);
- PrepareStatement(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban')", CONNECTION_ASYNC);
PrepareStatement(LOGIN_SEL_IP_BANNED_ALL, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) ORDER BY unbandate", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_IP_BANNED_BY_IP, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) AND ip LIKE CONCAT('%%', ?, '%%') ORDER BY unbandate", CONNECTION_SYNCH);
- PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED, "SELECT bandate, unbandate FROM account_banned WHERE id = ? AND active = 1", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED_ALL, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 AND username LIKE CONCAT('%%', ?, '%%') GROUP BY account.id", CONNECTION_SYNCH);
PrepareStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban', 1)", CONNECTION_ASYNC);
PrepareStatement(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC);
- PrepareStatement(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC);
PrepareStatement(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_SYNCH);
- PrepareStatement(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.lock_country, a.last_ip, aa.gmlevel, a.v, a.s, a.token_key FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH);
+ PrepareStatement(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.id, a.username, a.locked, a.lock_country, a.last_ip, a.failed_logins, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, "
+ "ab.unbandate = ab.bandate, aa.gmlevel, a.token_key, a.sha_pass_hash, a.v, a.s "
+ "FROM account a LEFT JOIN account_access aa ON a.id = aa.id LEFT JOIN account_banned ab ON ab.id = a.id AND ab.active = 1 WHERE a.username = ?", CONNECTION_ASYNC);
+ PrepareStatement(LOGIN_SEL_RECONNECTCHALLENGE, "SELECT a.id, UPPER(a.username), a.locked, a.lock_country, a.last_ip, a.failed_logins, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, "
+ "ab.unbandate = ab.bandate, aa.gmlevel, a.sessionKey "
+ "FROM account a LEFT JOIN account_access aa ON a.id = aa.id LEFT JOIN account_banned ab ON ab.id = a.id AND ab.active = 1 WHERE a.username = ?", CONNECTION_ASYNC);
PrepareStatement(LOGIN_SEL_LOGON_COUNTRY, "SELECT country FROM ip2nation WHERE ip < ? ORDER BY ip DESC LIMIT 0,1", CONNECTION_SYNCH);
PrepareStatement(LOGIN_UPD_FAILEDLOGINS, "UPDATE account SET failed_logins = failed_logins + 1 WHERE username = ?", CONNECTION_ASYNC);
- PrepareStatement(LOGIN_SEL_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME, "SELECT id, username FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME, "SELECT a.id, a.sessionkey, a.last_ip, a.locked, a.lock_country, a.expansion, a.mutetime, a.locale, a.recruiter, a.os, aa.gmLevel, "
"ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, r.id FROM account a LEFT JOIN account_access aa ON a.id = aa.id AND aa.RealmID IN (-1, ?) "
"LEFT JOIN account_banned ab ON a.id = ab.id AND ab.active = 1 LEFT JOIN account r ON a.id = r.recruiter WHERE a.username = ? ORDER BY aa.RealmID DESC LIMIT 1", CONNECTION_ASYNC);
PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, "SELECT id, username FROM account WHERE email = ?", CONNECTION_SYNCH);
- PrepareStatement(LOGIN_SEL_NUM_CHARS_ON_REALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?", CONNECTION_SYNCH);
+ PrepareStatement(LOGIN_SEL_REALM_CHARACTER_COUNTS, "SELECT realmid, numchars FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC);
PrepareStatement(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id, username FROM account WHERE last_ip = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_BY_ID, "SELECT 1 FROM account WHERE id = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_INS_IP_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?)", CONNECTION_ASYNC);
diff --git a/src/server/database/Database/Implementation/LoginDatabase.h b/src/server/database/Database/Implementation/LoginDatabase.h
index 69c2e758551..e206be16d73 100644
--- a/src/server/database/Database/Implementation/LoginDatabase.h
+++ b/src/server/database/Database/Implementation/LoginDatabase.h
@@ -33,25 +33,22 @@ enum LoginDatabaseStatements
LOGIN_DEL_EXPIRED_IP_BANS,
LOGIN_UPD_EXPIRED_ACCOUNT_BANS,
LOGIN_SEL_IP_INFO,
- LOGIN_SEL_IP_BANNED,
LOGIN_INS_IP_AUTO_BANNED,
- LOGIN_SEL_ACCOUNT_BANNED,
LOGIN_SEL_ACCOUNT_BANNED_ALL,
LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME,
LOGIN_INS_ACCOUNT_AUTO_BANNED,
LOGIN_DEL_ACCOUNT_BANNED,
- LOGIN_SEL_SESSIONKEY,
LOGIN_UPD_VS,
LOGIN_UPD_LOGONPROOF,
LOGIN_SEL_LOGONCHALLENGE,
+ LOGIN_SEL_RECONNECTCHALLENGE,
LOGIN_SEL_LOGON_COUNTRY,
LOGIN_UPD_FAILEDLOGINS,
- LOGIN_SEL_FAILEDLOGINS,
LOGIN_SEL_ACCOUNT_ID_BY_NAME,
LOGIN_SEL_ACCOUNT_LIST_BY_NAME,
LOGIN_SEL_ACCOUNT_INFO_BY_NAME,
LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL,
- LOGIN_SEL_NUM_CHARS_ON_REALM,
+ LOGIN_SEL_REALM_CHARACTER_COUNTS,
LOGIN_SEL_ACCOUNT_BY_IP,
LOGIN_INS_IP_BANNED,
LOGIN_DEL_IP_NOT_BANNED,
@@ -119,7 +116,7 @@ enum LoginDatabaseStatements
MAX_LOGINDATABASE_STATEMENTS
};
-class LoginDatabaseConnection : public MySQLConnection
+class TC_DATABASE_API LoginDatabaseConnection : public MySQLConnection
{
public:
typedef LoginDatabaseStatements Statements;
diff --git a/src/server/database/Database/Implementation/WorldDatabase.cpp b/src/server/database/Database/Implementation/WorldDatabase.cpp
index 7a183d5bf78..83720c1a996 100644
--- a/src/server/database/Database/Implementation/WorldDatabase.cpp
+++ b/src/server/database/Database/Implementation/WorldDatabase.cpp
@@ -30,8 +30,8 @@ void WorldDatabaseConnection::DoPrepareStatements()
PrepareStatement(WORLD_SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH);
PrepareStatement(WORLD_DEL_GAMEOBJECT, "DELETE FROM gameobject WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_DEL_EVENT_GAMEOBJECT, "DELETE FROM game_event_gameobject WHERE guid = ?", CONNECTION_ASYNC);
- PrepareStatement(WORLD_INS_GRAVEYARD_ZONE, "INSERT INTO game_graveyard_zone (id, ghost_zone, faction) VALUES (?, ?, ?)", CONNECTION_ASYNC);
- PrepareStatement(WORLD_DEL_GRAVEYARD_ZONE, "DELETE FROM game_graveyard_zone WHERE id = ? AND ghost_zone = ? AND faction = ?", CONNECTION_ASYNC);
+ PrepareStatement(WORLD_INS_GRAVEYARD_ZONE, "INSERT INTO graveyard_zone (ID, GhostZone, Faction) VALUES (?, ?, ?)", CONNECTION_ASYNC);
+ PrepareStatement(WORLD_DEL_GRAVEYARD_ZONE, "DELETE FROM graveyard_zone WHERE ID = ? AND GhostZone = ? AND Faction = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_INS_GAME_TELE, "INSERT INTO game_tele (id, position_x, position_y, position_z, orientation, map, name) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(WORLD_DEL_GAME_TELE, "DELETE FROM game_tele WHERE name = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_INS_NPC_VENDOR, "INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC);
diff --git a/src/server/database/Database/Implementation/WorldDatabase.h b/src/server/database/Database/Implementation/WorldDatabase.h
index 6ac4ce589e3..e0a02423446 100644
--- a/src/server/database/Database/Implementation/WorldDatabase.h
+++ b/src/server/database/Database/Implementation/WorldDatabase.h
@@ -103,7 +103,7 @@ enum WorldDatabaseStatements
MAX_WORLDDATABASE_STATEMENTS
};
-class WorldDatabaseConnection : public MySQLConnection
+class TC_DATABASE_API WorldDatabaseConnection : public MySQLConnection
{
public:
typedef WorldDatabaseStatements Statements;
diff --git a/src/server/database/Database/MySQLConnection.cpp b/src/server/database/Database/MySQLConnection.cpp
index 41dd61d3c3a..93d2a35f310 100644
--- a/src/server/database/Database/MySQLConnection.cpp
+++ b/src/server/database/Database/MySQLConnection.cpp
@@ -37,7 +37,6 @@ MySQLConnection::MySQLConnection(MySQLConnectionInfo& connInfo) :
m_reconnecting(false),
m_prepareError(false),
m_queue(NULL),
-m_worker(NULL),
m_Mysql(NULL),
m_connectionInfo(connInfo),
m_connectionFlags(CONNECTION_SYNCH) { }
@@ -50,24 +49,26 @@ m_Mysql(NULL),
m_connectionInfo(connInfo),
m_connectionFlags(CONNECTION_ASYNC)
{
- m_worker = new DatabaseWorker(m_queue, this);
+ m_worker = Trinity::make_unique<DatabaseWorker>(m_queue, this);
}
MySQLConnection::~MySQLConnection()
{
- delete m_worker;
-
- for (size_t i = 0; i < m_stmts.size(); ++i)
- delete m_stmts[i];
-
- if (m_Mysql)
- mysql_close(m_Mysql);
+ Close();
}
void MySQLConnection::Close()
{
- /// Only close us if we're not operating
- delete this;
+ // Stop the worker thread before the statements are cleared
+ m_worker.reset();
+
+ m_stmts.clear();
+
+ if (m_Mysql)
+ {
+ mysql_close(m_Mysql);
+ m_Mysql = nullptr;
+ }
}
uint32 MySQLConnection::Open()
@@ -412,7 +413,7 @@ int MySQLConnection::ExecuteTransaction(SQLTransaction& transaction)
MySQLPreparedStatement* MySQLConnection::GetPreparedStatement(uint32 index)
{
ASSERT(index < m_stmts.size());
- MySQLPreparedStatement* ret = m_stmts[index];
+ MySQLPreparedStatement* ret = m_stmts[index].get();
if (!ret)
TC_LOG_ERROR("sql.sql", "Could not fetch prepared statement %u on database `%s`, connection type: %s.",
index, m_connectionInfo.database.c_str(), (m_connectionFlags & CONNECTION_ASYNC) ? "asynchronous" : "synchronous");
@@ -424,16 +425,12 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, Connection
{
m_queries.insert(PreparedStatementMap::value_type(index, std::make_pair(sql, flags)));
- // For reconnection case
- if (m_reconnecting)
- delete m_stmts[index];
-
// Check if specified query should be prepared on this connection
// i.e. don't prepare async statements on synchronous connections
// to save memory that will not be used.
if (!(m_connectionFlags & flags))
{
- m_stmts[index] = NULL;
+ m_stmts[index].reset();
return;
}
@@ -455,8 +452,7 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, Connection
}
else
{
- MySQLPreparedStatement* mStmt = new MySQLPreparedStatement(stmt);
- m_stmts[index] = mStmt;
+ m_stmts[index] = Trinity::make_unique<MySQLPreparedStatement>(stmt);
}
}
}
@@ -477,7 +473,7 @@ PreparedResultSet* MySQLConnection::Query(PreparedStatement* stmt)
return new PreparedResultSet(stmt->m_stmt->GetSTMT(), result, rowCount, fieldCount);
}
-bool MySQLConnection::_HandleMySQLErrno(uint32 errNo)
+bool MySQLConnection::_HandleMySQLErrno(uint32 errNo, uint8 attempts /*= 5*/)
{
switch (errNo)
{
@@ -486,9 +482,21 @@ bool MySQLConnection::_HandleMySQLErrno(uint32 errNo)
case CR_INVALID_CONN_HANDLE:
case CR_SERVER_LOST_EXTENDED:
{
+ if (m_Mysql)
+ {
+ TC_LOG_ERROR("sql.sql", "Lost the connection to the MySQL server!");
+
+ mysql_close(GetHandle());
+ m_Mysql = nullptr;
+ }
+
+ /*no break*/
+ }
+ case CR_CONN_HOST_ERROR:
+ {
+ TC_LOG_INFO("sql.sql", "Attempting to reconnect to the MySQL server...");
+
m_reconnecting = true;
- uint64 oldThreadId = mysql_thread_id(GetHandle());
- mysql_close(GetHandle());
uint32 const lErrno = Open();
if (!lErrno)
@@ -496,24 +504,37 @@ bool MySQLConnection::_HandleMySQLErrno(uint32 errNo)
// Don't remove 'this' pointer unless you want to skip loading all prepared statements...
if (!this->PrepareStatements())
{
- TC_LOG_ERROR("sql.sql", "Could not re-prepare statements!");
- Close();
- return false;
+ TC_LOG_FATAL("sql.sql", "Could not re-prepare statements!");
+ std::this_thread::sleep_for(std::chrono::seconds(10));
+ std::abort();
}
- TC_LOG_INFO("sql.sql", "Connection to the MySQL server is active.");
- if (oldThreadId != mysql_thread_id(GetHandle()))
- TC_LOG_INFO("sql.sql", "Successfully reconnected to %s @%s:%s (%s).",
- m_connectionInfo.database.c_str(), m_connectionInfo.host.c_str(), m_connectionInfo.port_or_socket.c_str(),
- (m_connectionFlags & CONNECTION_ASYNC) ? "asynchronous" : "synchronous");
+ TC_LOG_INFO("sql.sql", "Successfully reconnected to %s @%s:%s (%s).",
+ m_connectionInfo.database.c_str(), m_connectionInfo.host.c_str(), m_connectionInfo.port_or_socket.c_str(),
+ (m_connectionFlags & CONNECTION_ASYNC) ? "asynchronous" : "synchronous");
m_reconnecting = false;
return true;
}
- // It's possible this attempted reconnect throws 2006 at us. To prevent crazy recursive calls, sleep here.
- std::this_thread::sleep_for(std::chrono::seconds(3)); // Sleep 3 seconds
- return _HandleMySQLErrno(lErrno); // Call self (recursive)
+ if ((--attempts) == 0)
+ {
+ // Shut down the server when the mysql server isn't
+ // reachable for some time
+ TC_LOG_FATAL("sql.sql", "Failed to reconnect to the MySQL server, "
+ "terminating the server to prevent data corruption!");
+
+ // We could also initiate a shutdown through using std::raise(SIGTERM)
+ std::this_thread::sleep_for(std::chrono::seconds(10));
+ std::abort();
+ }
+ else
+ {
+ // It's possible this attempted reconnect throws 2006 at us.
+ // To prevent crazy recursive calls, sleep here.
+ std::this_thread::sleep_for(std::chrono::seconds(3)); // Sleep 3 seconds
+ return _HandleMySQLErrno(lErrno, attempts); // Call self (recursive)
+ }
}
case ER_LOCK_DEADLOCK:
diff --git a/src/server/database/Database/MySQLConnection.h b/src/server/database/Database/MySQLConnection.h
index a981caa607e..566995988c0 100644
--- a/src/server/database/Database/MySQLConnection.h
+++ b/src/server/database/Database/MySQLConnection.h
@@ -35,7 +35,7 @@ enum ConnectionFlags
CONNECTION_BOTH = CONNECTION_ASYNC | CONNECTION_SYNCH
};
-struct MySQLConnectionInfo
+struct TC_DATABASE_API MySQLConnectionInfo
{
explicit MySQLConnectionInfo(std::string const& infoString)
{
@@ -62,7 +62,7 @@ struct MySQLConnectionInfo
typedef std::map<uint32 /*index*/, std::pair<std::string /*query*/, ConnectionFlags /*sync/async*/> > PreparedStatementMap;
-class MySQLConnection
+class TC_DATABASE_API MySQLConnection
{
template <class T> friend class DatabaseWorkerPool;
friend class PingOperation;
@@ -116,18 +116,18 @@ class MySQLConnection
virtual void DoPrepareStatements() = 0;
protected:
- std::vector<MySQLPreparedStatement*> m_stmts; //! PreparedStatements storage
+ std::vector<std::unique_ptr<MySQLPreparedStatement>> m_stmts; //! PreparedStatements storage
PreparedStatementMap m_queries; //! Query storage
bool m_reconnecting; //! Are we reconnecting?
bool m_prepareError; //! Was there any error while preparing statements?
private:
- bool _HandleMySQLErrno(uint32 errNo);
+ bool _HandleMySQLErrno(uint32 errNo, uint8 attempts = 5);
private:
ProducerConsumerQueue<SQLOperation*>* m_queue; //! Queue shared with other asynchronous connections.
- DatabaseWorker* m_worker; //! Core worker task.
- MYSQL * m_Mysql; //! MySQL Handle.
+ std::unique_ptr<DatabaseWorker> m_worker; //! Core worker task.
+ MYSQL* m_Mysql; //! MySQL Handle.
MySQLConnectionInfo& m_connectionInfo; //! Connection info (used for logging)
ConnectionFlags m_connectionFlags; //! Connection flags (for preparing relevant statements)
std::mutex m_Mutex;
diff --git a/src/server/database/Database/MySQLThreading.h b/src/server/database/Database/MySQLThreading.h
index 1cfa11d7e5b..b6083500989 100644
--- a/src/server/database/Database/MySQLThreading.h
+++ b/src/server/database/Database/MySQLThreading.h
@@ -20,7 +20,7 @@
#include "Log.h"
-class MySQL
+class TC_DATABASE_API MySQL
{
public:
static void Library_Init()
diff --git a/src/server/database/Database/PreparedStatement.cpp b/src/server/database/Database/PreparedStatement.cpp
index 848a923c75d..119f1d4c93b 100644
--- a/src/server/database/Database/PreparedStatement.cpp
+++ b/src/server/database/Database/PreparedStatement.cpp
@@ -344,7 +344,7 @@ void MySQLPreparedStatement::setString(const uint8 index, const char* value)
CheckValidIndex(index);
m_paramsSet[index] = true;
MYSQL_BIND* param = &m_bind[index];
- size_t len = strlen(value) + 1;
+ uint32 len = uint32(strlen(value) + 1);
param->buffer_type = MYSQL_TYPE_VAR_STRING;
delete [] static_cast<char *>(param->buffer);
param->buffer = new char[len];
diff --git a/src/server/database/Database/PreparedStatement.h b/src/server/database/Database/PreparedStatement.h
index 7d6c98463d0..faaec27014f 100644
--- a/src/server/database/Database/PreparedStatement.h
+++ b/src/server/database/Database/PreparedStatement.h
@@ -70,7 +70,7 @@ struct PreparedStatementData
class MySQLPreparedStatement;
//- Upper-level class that is used in code
-class PreparedStatement
+class TC_DATABASE_API PreparedStatement
{
friend class PreparedStatementTask;
friend class MySQLPreparedStatement;
@@ -109,7 +109,7 @@ class PreparedStatement
//- Class of which the instances are unique per MySQLConnection
//- access to these class objects is only done when a prepared statement task
//- is executed.
-class MySQLPreparedStatement
+class TC_DATABASE_API MySQLPreparedStatement
{
friend class MySQLConnection;
friend class PreparedStatement;
@@ -157,7 +157,7 @@ typedef std::future<PreparedQueryResult> PreparedQueryResultFuture;
typedef std::promise<PreparedQueryResult> PreparedQueryResultPromise;
//- Lower-level class, enqueuable operation
-class PreparedStatementTask : public SQLOperation
+class TC_DATABASE_API PreparedStatementTask : public SQLOperation
{
public:
PreparedStatementTask(PreparedStatement* stmt, bool async = false);
diff --git a/src/common/Threading/Callback.h b/src/server/database/Database/QueryCallback.h
index f7eab57ddda..5f6ae74da4f 100644
--- a/src/common/Threading/Callback.h
+++ b/src/server/database/Database/QueryCallback.h
@@ -15,8 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _CALLBACK_H
-#define _CALLBACK_H
+#ifndef _QUERY_CALLBACK_H
+#define _QUERY_CALLBACK_H
#include <future>
#include "QueryResult.h"
@@ -206,4 +206,4 @@ class QueryCallback_2
QueryCallback_2& operator=(QueryCallback_2 const& right) = delete;
};
-#endif
+#endif // _QUERY_CALLBACK_H
diff --git a/src/server/database/Database/QueryHolder.h b/src/server/database/Database/QueryHolder.h
index 9a5a03fda42..2446a4db2bd 100644
--- a/src/server/database/Database/QueryHolder.h
+++ b/src/server/database/Database/QueryHolder.h
@@ -20,7 +20,7 @@
#include <future>
-class SQLQueryHolder
+class TC_DATABASE_API SQLQueryHolder
{
friend class SQLQueryHolderTask;
private:
@@ -46,7 +46,7 @@ class SQLQueryHolder
typedef std::future<SQLQueryHolder*> QueryResultHolderFuture;
typedef std::promise<SQLQueryHolder*> QueryResultHolderPromise;
-class SQLQueryHolderTask : public SQLOperation
+class TC_DATABASE_API SQLQueryHolderTask : public SQLOperation
{
private:
SQLQueryHolder* m_holder;
diff --git a/src/server/database/Database/QueryResult.cpp b/src/server/database/Database/QueryResult.cpp
index f02457f67ca..db9e737830c 100644
--- a/src/server/database/Database/QueryResult.cpp
+++ b/src/server/database/Database/QueryResult.cpp
@@ -76,7 +76,7 @@ m_length(NULL)
std::size_t rowSize = 0;
for (uint32 i = 0; i < m_fieldCount; ++i)
{
- size_t size = Field::SizeForType(&field[i]);
+ uint32 size = Field::SizeForType(&field[i]);
rowSize += size;
m_rBind[i].buffer_type = field[i].type;
diff --git a/src/server/database/Database/QueryResult.h b/src/server/database/Database/QueryResult.h
index d4d63b5ec85..3b1691db1a6 100644
--- a/src/server/database/Database/QueryResult.h
+++ b/src/server/database/Database/QueryResult.h
@@ -27,7 +27,7 @@
#endif
#include <mysql.h>
-class ResultSet
+class TC_DATABASE_API ResultSet
{
public:
ResultSet(MYSQL_RES* result, MYSQL_FIELD* fields, uint64 rowCount, uint32 fieldCount);
@@ -60,7 +60,7 @@ class ResultSet
typedef std::shared_ptr<ResultSet> QueryResult;
-class PreparedResultSet
+class TC_DATABASE_API PreparedResultSet
{
public:
PreparedResultSet(MYSQL_STMT* stmt, MYSQL_RES* result, uint64 rowCount, uint32 fieldCount);
diff --git a/src/server/database/Database/SQLOperation.h b/src/server/database/Database/SQLOperation.h
index f0500d1f232..5b3032eab87 100644
--- a/src/server/database/Database/SQLOperation.h
+++ b/src/server/database/Database/SQLOperation.h
@@ -53,7 +53,7 @@ union SQLResultSetUnion
class MySQLConnection;
-class SQLOperation
+class TC_DATABASE_API SQLOperation
{
public:
SQLOperation(): m_conn(NULL) { }
diff --git a/src/server/database/Database/Transaction.h b/src/server/database/Database/Transaction.h
index 5780c0363d9..7b5b6addfe4 100644
--- a/src/server/database/Database/Transaction.h
+++ b/src/server/database/Database/Transaction.h
@@ -25,7 +25,7 @@
class PreparedStatement;
/*! Transactions, high level class. */
-class Transaction
+class TC_DATABASE_API Transaction
{
friend class TransactionTask;
friend class MySQLConnection;
@@ -58,7 +58,7 @@ class Transaction
typedef std::shared_ptr<Transaction> SQLTransaction;
/*! Low level class*/
-class TransactionTask : public SQLOperation
+class TC_DATABASE_API TransactionTask : public SQLOperation
{
template <class T> friend class DatabaseWorkerPool;
friend class DatabaseWorker;
diff --git a/src/server/database/Logging/AppenderDB.h b/src/server/database/Logging/AppenderDB.h
index a6acc66b48c..225ae969802 100644
--- a/src/server/database/Logging/AppenderDB.h
+++ b/src/server/database/Logging/AppenderDB.h
@@ -20,7 +20,7 @@
#include "Appender.h"
-class AppenderDB: public Appender
+class TC_DATABASE_API AppenderDB: public Appender
{
public:
typedef std::integral_constant<AppenderType, APPENDER_DB>::type TypeIndex;
diff --git a/src/server/database/Updater/DBUpdater.cpp b/src/server/database/Updater/DBUpdater.cpp
index 170954a86f4..8515da9f6f8 100644
--- a/src/server/database/Updater/DBUpdater.cpp
+++ b/src/server/database/Updater/DBUpdater.cpp
@@ -21,57 +21,41 @@
#include "UpdateFetcher.h"
#include "DatabaseLoader.h"
#include "Config.h"
+#include "BuiltInConfig.h"
+#include "StartProcess.h"
#include <fstream>
#include <iostream>
#include <unordered_map>
-#include <boost/process.hpp>
-#include <boost/iostreams/stream.hpp>
-#include <boost/iostreams/copy.hpp>
-#include <boost/iostreams/device/file_descriptor.hpp>
-#include <boost/system/system_error.hpp>
-using namespace boost::process;
-using namespace boost::process::initializers;
-using namespace boost::iostreams;
-
-std::string DBUpdaterUtil::GetMySqlCli()
+std::string DBUpdaterUtil::GetCorrectedMySQLExecutable()
{
if (!corrected_path().empty())
return corrected_path();
else
- {
- std::string const entry = sConfigMgr->GetStringDefault("Updates.MySqlCLIPath", "");
- if (!entry.empty())
- return entry;
- else
- return GitRevision::GetMySQLExecutable();
- }
+ return BuiltInConfig::GetMySQLExecutable();
}
bool DBUpdaterUtil::CheckExecutable()
{
- boost::filesystem::path exe(GetMySqlCli());
+ boost::filesystem::path exe(GetCorrectedMySQLExecutable());
if (!exists(exe))
{
exe.clear();
- try
- {
- exe = search_path("mysql");
- }
- catch (std::runtime_error&)
+ if (auto path = Trinity::SearchExecutableInPath("mysql"))
{
- }
+ exe = std::move(*path);
- if (!exe.empty() && exists(exe))
- {
- // Correct the path to the cli
- corrected_path() = absolute(exe).generic_string();
- return true;
+ if (!exe.empty() && exists(exe))
+ {
+ // Correct the path to the cli
+ corrected_path() = absolute(exe).generic_string();
+ return true;
+ }
}
- TC_LOG_FATAL("sql.updates", "Didn't find executeable mysql binary at \'%s\' or in path, correct the path in the *.conf (\"Updates.MySqlCLIPath\").",
+ TC_LOG_FATAL("sql.updates", "Didn't find any executable MySQL binary at \'%s\' or in path, correct the path in the *.conf (\"MySQLExecutable\").",
absolute(exe).generic_string().c_str());
return false;
@@ -85,16 +69,6 @@ std::string& DBUpdaterUtil::corrected_path()
return path;
}
-template<class T>
-std::string DBUpdater<T>::GetSourceDirectory()
-{
- std::string const entry = sConfigMgr->GetStringDefault("Updates.SourcePath", "");
- if (!entry.empty())
- return entry;
- else
- return GitRevision::GetSourceDirectory();
-}
-
// Auth Database
template<>
std::string DBUpdater<LoginDatabaseConnection>::GetConfigEntry()
@@ -111,7 +85,8 @@ std::string DBUpdater<LoginDatabaseConnection>::GetTableName()
template<>
std::string DBUpdater<LoginDatabaseConnection>::GetBaseFile()
{
- return DBUpdater<LoginDatabaseConnection>::GetSourceDirectory() + "/sql/base/auth_database.sql";
+ return BuiltInConfig::GetSourceDirectory() +
+ "/sql/base/auth_database.sql";
}
template<>
@@ -169,7 +144,8 @@ std::string DBUpdater<CharacterDatabaseConnection>::GetTableName()
template<>
std::string DBUpdater<CharacterDatabaseConnection>::GetBaseFile()
{
- return DBUpdater<CharacterDatabaseConnection>::GetSourceDirectory() + "/sql/base/characters_database.sql";
+ return BuiltInConfig::GetSourceDirectory() +
+ "/sql/base/characters_database.sql";
}
template<>
@@ -202,7 +178,7 @@ bool DBUpdater<T>::Create(DatabaseWorkerPool<T>& pool)
// Path of temp file
static Path const temp("create_table.sql");
- // Create temporary query to use external mysql cli
+ // Create temporary query to use external MySQL CLi
std::ofstream file(temp.generic_string());
if (!file.is_open())
{
@@ -221,7 +197,7 @@ bool DBUpdater<T>::Create(DatabaseWorkerPool<T>& pool)
}
catch (UpdateException&)
{
- TC_LOG_FATAL("sql.updates", "Failed to create database %s! Has the user `CREATE` priviliges?", pool.GetConnectionInfo()->database.c_str());
+ TC_LOG_FATAL("sql.updates", "Failed to create database %s! Does the user (named in *.conf) have `CREATE` privileges on the MySQL server?", pool.GetConnectionInfo()->database.c_str());
boost::filesystem::remove(temp);
return false;
}
@@ -239,7 +215,7 @@ bool DBUpdater<T>::Update(DatabaseWorkerPool<T>& pool)
TC_LOG_INFO("sql.updates", "Updating %s database...", DBUpdater<T>::GetTableName().c_str());
- Path const sourceDirectory(GetSourceDirectory());
+ Path const sourceDirectory(BuiltInConfig::GetSourceDirectory());
if (!is_directory(sourceDirectory))
{
@@ -304,7 +280,7 @@ bool DBUpdater<T>::Populate(DatabaseWorkerPool<T>& pool)
{
case LOCATION_REPOSITORY:
{
- TC_LOG_ERROR("sql.updates", ">> Base file \"%s\" is missing, try to clone the source again.",
+ TC_LOG_ERROR("sql.updates", ">> Base file \"%s\" is missing. Try fixing it by cloning the source again.",
base.generic_string().c_str());
break;
@@ -312,7 +288,7 @@ bool DBUpdater<T>::Populate(DatabaseWorkerPool<T>& pool)
case LOCATION_DOWNLOAD:
{
TC_LOG_ERROR("sql.updates", ">> File \"%s\" is missing, download it from \"https://github.com/TrinityCore/TrinityCore/releases\"" \
- " and place it in your server directory.", base.filename().generic_string().c_str());
+ " uncompress it and place the file TDB_full_world_(a_variable_name).sql in your worldserver directory.", base.filename().generic_string().c_str());
break;
}
}
@@ -379,7 +355,7 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos
if (!std::isdigit(port_or_socket[0]))
{
- // We can't check here if host == "." because is named localhost if socket option is enabled
+ // We can't check if host == "." here, because it is named localhost if socket option is enabled
args.push_back("-P0");
args.push_back("--protocol=SOCKET");
args.push_back("-S" + port_or_socket);
@@ -400,55 +376,23 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos
if (!database.empty())
args.push_back(database);
- // ToDo: use the existing query in memory as virtual file if possible
- file_descriptor_source source(path);
-
- uint32 ret;
- try
- {
- boost::process::pipe outPipe = create_pipe();
- boost::process::pipe errPipe = create_pipe();
-
- child c = execute(run_exe(
- boost::filesystem::absolute(DBUpdaterUtil::GetMySqlCli()).generic_string()),
- set_args(args), bind_stdin(source), throw_on_error(),
- bind_stdout(file_descriptor_sink(outPipe.sink, close_handle)),
- bind_stderr(file_descriptor_sink(errPipe.sink, close_handle)));
-
- file_descriptor_source mysqlOutfd(outPipe.source, close_handle);
- file_descriptor_source mysqlErrfd(errPipe.source, close_handle);
-
- stream<file_descriptor_source> mysqlOutStream(mysqlOutfd);
- stream<file_descriptor_source> mysqlErrStream(mysqlErrfd);
-
- std::stringstream out;
- std::stringstream err;
-
- copy(mysqlOutStream, out);
- copy(mysqlErrStream, err);
-
- TC_LOG_INFO("sql.updates", "%s", out.str().c_str());
- TC_LOG_ERROR("sql.updates", "%s", err.str().c_str());
-
- ret = wait_for_exit(c);
- }
- catch (boost::system::system_error&)
- {
- ret = EXIT_FAILURE;
- }
-
- source.close();
+ // Invokes a mysql process which doesn't leak credentials to logs
+ int const ret = Trinity::StartProcess(DBUpdaterUtil::GetCorrectedMySQLExecutable(), args,
+ "sql.updates", path.generic_string(), true);
if (ret != EXIT_SUCCESS)
{
TC_LOG_FATAL("sql.updates", "Applying of file \'%s\' to database \'%s\' failed!" \
- " If you are an user pull the latest revision from the repository. If you are a developer fix your sql query.",
+ " If you are a user, please pull the latest revision from the repository. "
+ "Also make sure you have not applied any of the databases with your sql client. "
+ "You cannot use auto-update system and import sql files from TrinityCore repository with your sql client. "
+ "If you are a developer, please fix your sql query.",
path.generic_string().c_str(), pool.GetConnectionInfo()->database.c_str());
throw UpdateException("update failed");
}
}
-template class DBUpdater<LoginDatabaseConnection>;
-template class DBUpdater<WorldDatabaseConnection>;
-template class DBUpdater<CharacterDatabaseConnection>;
+template class TC_DATABASE_API DBUpdater<LoginDatabaseConnection>;
+template class TC_DATABASE_API DBUpdater<WorldDatabaseConnection>;
+template class TC_DATABASE_API DBUpdater<CharacterDatabaseConnection>;
diff --git a/src/server/database/Updater/DBUpdater.h b/src/server/database/Updater/DBUpdater.h
index c9792ffe060..cc5d3aad68b 100644
--- a/src/server/database/Updater/DBUpdater.h
+++ b/src/server/database/Updater/DBUpdater.h
@@ -23,7 +23,7 @@
#include <string>
#include <boost/filesystem.hpp>
-class UpdateException : public std::exception
+class TC_DATABASE_API UpdateException : public std::exception
{
public:
UpdateException(std::string const& msg) : _msg(msg) { }
@@ -41,7 +41,7 @@ enum BaseLocation
LOCATION_DOWNLOAD
};
-struct UpdateResult
+struct TC_DATABASE_API UpdateResult
{
UpdateResult()
: updated(0), recent(0), archived(0) { }
@@ -57,7 +57,7 @@ struct UpdateResult
class DBUpdaterUtil
{
public:
- static std::string GetMySqlCli();
+ static std::string GetCorrectedMySQLExecutable();
static bool CheckExecutable();
@@ -66,13 +66,11 @@ private:
};
template <class T>
-class DBUpdater
+class TC_DATABASE_API DBUpdater
{
public:
using Path = boost::filesystem::path;
- static std::string GetSourceDirectory();
-
static inline std::string GetConfigEntry();
static inline std::string GetTableName();
diff --git a/src/server/database/Updater/UpdateFetcher.cpp b/src/server/database/Updater/UpdateFetcher.cpp
index fd0dbdd4b5a..7dc0a307ca2 100644
--- a/src/server/database/Updater/UpdateFetcher.cpp
+++ b/src/server/database/Updater/UpdateFetcher.cpp
@@ -18,6 +18,7 @@
#include "UpdateFetcher.h"
#include "Log.h"
#include "Util.h"
+#include "SHA1.h"
#include <fstream>
#include <chrono>
@@ -25,7 +26,6 @@
#include <sstream>
#include <exception>
#include <unordered_map>
-#include <openssl/sha.h>
using namespace boost::filesystem;
@@ -137,24 +137,33 @@ UpdateFetcher::AppliedFileStorage UpdateFetcher::ReceiveAppliedFiles() const
return map;
}
-UpdateFetcher::SQLUpdate UpdateFetcher::ReadSQLUpdate(boost::filesystem::path const& file) const
+std::string UpdateFetcher::ReadSQLUpdate(boost::filesystem::path const& file) const
{
std::ifstream in(file.c_str());
- WPFatal(in.is_open(), "Could not read an update file.");
+ if (!in.is_open())
+ {
+ TC_LOG_FATAL("sql.updates", "Failed to open the sql update \"%s\" for reading! "
+ "Stopping the server to keep the database integrity, "
+ "try to identify and solve the issue or disabled the database updater.",
+ file.generic_string().c_str());
- auto const start_pos = in.tellg();
- in.ignore(std::numeric_limits<std::streamsize>::max());
- auto const char_count = in.gcount();
- in.seekg(start_pos);
+ throw UpdateException("Opening the sql update failed!");
+ }
- SQLUpdate const update(new std::string(char_count, char{}));
+ auto update = [&in] {
+ std::ostringstream ss;
+ ss << in.rdbuf();
+ return ss.str();
+ }();
- in.read(&(*update)[0], update->size());
in.close();
return update;
}
-UpdateResult UpdateFetcher::Update(bool const redundancyChecks, bool const allowRehash, bool const archivedRedundancy, int32 const cleanDeadReferencesMaxCount) const
+UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
+ bool const allowRehash,
+ bool const archivedRedundancy,
+ int32 const cleanDeadReferencesMaxCount) const
{
LocaleFileStorage const available = GetFileList();
AppliedFileStorage applied = ReceiveAppliedFiles();
@@ -200,11 +209,8 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks, bool const allow
}
}
- // Read update from file
- SQLUpdate const update = ReadSQLUpdate(availableQuery.first);
-
- // Calculate hash
- std::string const hash = CalculateHash(update);
+ // Calculate a Sha1 hash based on query content.
+ std::string const hash = CalculateSHA1Hash(ReadSQLUpdate(availableQuery.first));
UpdateMode mode = MODE_APPLY;
@@ -327,15 +333,6 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks, bool const allow
return UpdateResult(importedUpdates, countRecentUpdates, countArchivedUpdates);
}
-std::string UpdateFetcher::CalculateHash(SQLUpdate const& query) const
-{
- // Calculate a Sha1 hash based on query content.
- unsigned char digest[SHA_DIGEST_LENGTH];
- SHA1((unsigned char*)query->c_str(), query->length(), (unsigned char*)&digest);
-
- return ByteArrayToHexStr(digest, SHA_DIGEST_LENGTH);
-}
-
uint32 UpdateFetcher::Apply(Path const& path) const
{
using Time = std::chrono::high_resolution_clock;
@@ -347,7 +344,7 @@ uint32 UpdateFetcher::Apply(Path const& path) const
_applyFile(path);
// Return time the query took to apply
- return std::chrono::duration_cast<std::chrono::milliseconds>(Time::now() - begin).count();
+ return uint32(std::chrono::duration_cast<std::chrono::milliseconds>(Time::now() - begin).count());
}
void UpdateFetcher::UpdateEntry(AppliedFileEntry const& entry, uint32 const speed) const
diff --git a/src/server/database/Updater/UpdateFetcher.h b/src/server/database/Updater/UpdateFetcher.h
index 22a0d08c7f8..cabc3c2fce3 100644
--- a/src/server/database/Updater/UpdateFetcher.h
+++ b/src/server/database/Updater/UpdateFetcher.h
@@ -25,7 +25,7 @@
#include <memory>
#include <vector>
-class UpdateFetcher
+class TC_DATABASE_API UpdateFetcher
{
typedef boost::filesystem::path Path;
@@ -103,16 +103,15 @@ private:
typedef std::unordered_map<std::string, std::string> HashToFileNameStorage;
typedef std::unordered_map<std::string, AppliedFileEntry> AppliedFileStorage;
typedef std::vector<UpdateFetcher::DirectoryEntry> DirectoryStorage;
- typedef std::shared_ptr<std::string> SQLUpdate;
LocaleFileStorage GetFileList() const;
- void FillFileListRecursively(Path const& path, LocaleFileStorage& storage, State const state, uint32 const depth) const;
+ void FillFileListRecursively(Path const& path, LocaleFileStorage& storage,
+ State const state, uint32 const depth) const;
DirectoryStorage ReceiveIncludedDirectories() const;
AppliedFileStorage ReceiveAppliedFiles() const;
- SQLUpdate ReadSQLUpdate(Path const& file) const;
- std::string CalculateHash(SQLUpdate const& query) const;
+ std::string ReadSQLUpdate(Path const& file) const;
uint32 Apply(Path const& path) const;
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index 716ac13c666..4d0247d9fb5 100644
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -50,7 +50,7 @@ void AggressorAI::UpdateAI(uint32 /*diff*/)
void CombatAI::InitializeAI()
{
- for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ for (uint32 i = 0; i < MAX_CREATURE_SPELLS; ++i)
if (me->m_spells[i] && sSpellMgr->GetSpellInfo(me->m_spells[i]))
spells.push_back(me->m_spells[i]);
diff --git a/src/server/game/AI/CoreAI/CombatAI.h b/src/server/game/AI/CoreAI/CombatAI.h
index 55b91b6969e..f1718fbdb6a 100644
--- a/src/server/game/AI/CoreAI/CombatAI.h
+++ b/src/server/game/AI/CoreAI/CombatAI.h
@@ -25,7 +25,7 @@
class Creature;
-class AggressorAI : public CreatureAI
+class TC_GAME_API AggressorAI : public CreatureAI
{
public:
explicit AggressorAI(Creature* c) : CreatureAI(c) { }
@@ -36,7 +36,7 @@ class AggressorAI : public CreatureAI
typedef std::vector<uint32> SpellVct;
-class CombatAI : public CreatureAI
+class TC_GAME_API CombatAI : public CreatureAI
{
public:
explicit CombatAI(Creature* c) : CreatureAI(c) { }
@@ -55,7 +55,7 @@ class CombatAI : public CreatureAI
SpellVct spells;
};
-class CasterAI : public CombatAI
+class TC_GAME_API CasterAI : public CombatAI
{
public:
explicit CasterAI(Creature* c) : CombatAI(c) { m_attackDist = MELEE_RANGE; }
@@ -67,7 +67,7 @@ class CasterAI : public CombatAI
float m_attackDist;
};
-struct ArcherAI : public CreatureAI
+struct TC_GAME_API ArcherAI : public CreatureAI
{
public:
explicit ArcherAI(Creature* c);
@@ -80,7 +80,7 @@ struct ArcherAI : public CreatureAI
float m_minRange;
};
-struct TurretAI : public CreatureAI
+struct TC_GAME_API TurretAI : public CreatureAI
{
public:
explicit TurretAI(Creature* c);
@@ -97,7 +97,7 @@ struct TurretAI : public CreatureAI
#define VEHICLE_CONDITION_CHECK_TIME 1000
#define VEHICLE_DISMISS_TIME 5000
-struct VehicleAI : public CreatureAI
+struct TC_GAME_API VehicleAI : public CreatureAI
{
public:
explicit VehicleAI(Creature* creature);
diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h
index 4f256a5de31..7a2f23ac804 100644
--- a/src/server/game/AI/CoreAI/GameObjectAI.h
+++ b/src/server/game/AI/CoreAI/GameObjectAI.h
@@ -26,7 +26,7 @@
#include "GameObject.h"
#include "CreatureAI.h"
-class GameObjectAI
+class TC_GAME_API GameObjectAI
{
protected:
GameObject* const go;
@@ -63,7 +63,7 @@ class GameObjectAI
virtual void EventInform(uint32 /*eventId*/) { }
};
-class NullGameObjectAI : public GameObjectAI
+class TC_GAME_API NullGameObjectAI : public GameObjectAI
{
public:
explicit NullGameObjectAI(GameObject* g);
diff --git a/src/server/game/AI/CoreAI/GuardAI.h b/src/server/game/AI/CoreAI/GuardAI.h
index 63f2750a5d4..a6aa4b6624a 100644
--- a/src/server/game/AI/CoreAI/GuardAI.h
+++ b/src/server/game/AI/CoreAI/GuardAI.h
@@ -23,7 +23,7 @@
class Creature;
-class GuardAI : public ScriptedAI
+class TC_GAME_API GuardAI : public ScriptedAI
{
public:
explicit GuardAI(Creature* creature);
diff --git a/src/server/game/AI/CoreAI/PassiveAI.cpp b/src/server/game/AI/CoreAI/PassiveAI.cpp
index aafde3c1d9a..3ed2f927645 100644
--- a/src/server/game/AI/CoreAI/PassiveAI.cpp
+++ b/src/server/game/AI/CoreAI/PassiveAI.cpp
@@ -58,6 +58,12 @@ void PossessedAI::KilledUnit(Unit* victim)
victim->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
+void PossessedAI::OnCharmed(bool /*apply*/)
+{
+ me->NeedChangeAI = true;
+ me->IsAIEnabled = false;
+}
+
void CritterAI::DamageTaken(Unit* /*done_by*/, uint32&)
{
if (!me->HasUnitState(UNIT_STATE_FLEEING))
diff --git a/src/server/game/AI/CoreAI/PassiveAI.h b/src/server/game/AI/CoreAI/PassiveAI.h
index bd72cd7fbe7..9ca9e75bd9f 100644
--- a/src/server/game/AI/CoreAI/PassiveAI.h
+++ b/src/server/game/AI/CoreAI/PassiveAI.h
@@ -21,7 +21,7 @@
#include "CreatureAI.h"
-class PassiveAI : public CreatureAI
+class TC_GAME_API PassiveAI : public CreatureAI
{
public:
explicit PassiveAI(Creature* c);
@@ -33,7 +33,7 @@ class PassiveAI : public CreatureAI
static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
};
-class PossessedAI : public CreatureAI
+class TC_GAME_API PossessedAI : public CreatureAI
{
public:
explicit PossessedAI(Creature* c);
@@ -46,10 +46,12 @@ class PossessedAI : public CreatureAI
void JustDied(Unit*) override;
void KilledUnit(Unit* victim) override;
+ void OnCharmed(bool /*apply*/) override;
+
static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
};
-class NullCreatureAI : public CreatureAI
+class TC_GAME_API NullCreatureAI : public CreatureAI
{
public:
explicit NullCreatureAI(Creature* c);
@@ -63,7 +65,7 @@ class NullCreatureAI : public CreatureAI
static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
};
-class CritterAI : public PassiveAI
+class TC_GAME_API CritterAI : public PassiveAI
{
public:
explicit CritterAI(Creature* c) : PassiveAI(c) { }
@@ -72,7 +74,7 @@ class CritterAI : public PassiveAI
void EnterEvadeMode(EvadeReason why) override;
};
-class TriggerAI : public NullCreatureAI
+class TC_GAME_API TriggerAI : public NullCreatureAI
{
public:
explicit TriggerAI(Creature* c) : NullCreatureAI(c) { }
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp
index 8acf6b9c9dc..2abe20f0ae6 100644
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -150,14 +150,14 @@ void PetAI::UpdateAI(uint32 diff)
if (me->GetCharmInfo() && me->GetSpellHistory()->HasGlobalCooldown(spellInfo))
continue;
+ // check spell cooldown
+ if (!me->GetSpellHistory()->IsReady(spellInfo))
+ continue;
+
if (spellInfo->IsPositive())
{
if (spellInfo->CanBeUsedInCombat())
{
- // check spell cooldown & school lock
- if (!me->GetSpellHistory()->IsReady(spellInfo))
- continue;
-
// Check if we're in combat or commanded to attack
if (!me->IsInCombat() && !me->GetCharmInfo()->IsCommandAttack())
continue;
@@ -225,26 +225,17 @@ void PetAI::UpdateAI(uint32 diff)
//found units to cast on to
if (!targetSpellStore.empty())
{
- uint32 index = urand(0, targetSpellStore.size() - 1);
+ TargetSpellList::iterator it = targetSpellStore.begin();
+ std::advance(it, urand(0, targetSpellStore.size() - 1));
- Spell* spell = targetSpellStore[index].second;
- Unit* target = targetSpellStore[index].first;
+ Spell* spell = (*it).second;
+ Unit* target = (*it).first;
- targetSpellStore.erase(targetSpellStore.begin() + index);
+ targetSpellStore.erase(it);
SpellCastTargets targets;
targets.SetUnitTarget(target);
- if (!me->HasInArc(float(M_PI), target))
- {
- me->SetInFront(target);
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- me->SendUpdateToPlayer(target->ToPlayer());
-
- if (owner && owner->GetTypeId() == TYPEID_PLAYER)
- me->SendUpdateToPlayer(owner->ToPlayer());
- }
-
spell->prepare(&targets);
}
@@ -254,9 +245,9 @@ void PetAI::UpdateAI(uint32 diff)
}
// Update speed as needed to prevent dropping too far behind and despawning
- me->UpdateSpeed(MOVE_RUN, true);
- me->UpdateSpeed(MOVE_WALK, true);
- me->UpdateSpeed(MOVE_FLIGHT, true);
+ me->UpdateSpeed(MOVE_RUN);
+ me->UpdateSpeed(MOVE_WALK);
+ me->UpdateSpeed(MOVE_FLIGHT);
}
@@ -597,6 +588,12 @@ void PetAI::ReceiveEmote(Player* player, uint32 emote)
}
}
+void PetAI::OnCharmed(bool /*apply*/)
+{
+ me->NeedChangeAI = true;
+ me->IsAIEnabled = false;
+}
+
void PetAI::ClearCharmInfoFlags()
{
// Quick access to set all flags to FALSE
diff --git a/src/server/game/AI/CoreAI/PetAI.h b/src/server/game/AI/CoreAI/PetAI.h
index 9c33baa9a9f..93ee6c41ece 100644
--- a/src/server/game/AI/CoreAI/PetAI.h
+++ b/src/server/game/AI/CoreAI/PetAI.h
@@ -25,7 +25,7 @@
class Creature;
class Spell;
-class PetAI : public CreatureAI
+class TC_GAME_API PetAI : public CreatureAI
{
public:
@@ -49,6 +49,8 @@ class PetAI : public CreatureAI
void MoveInLineOfSight_Safe(Unit* /*who*/) { } // CreatureAI interferes with returning pets
void EnterEvadeMode(EvadeReason /*why*/) override { } // For fleeing, pets don't use this type of Evade mechanic
+ void OnCharmed(bool /*apply*/) override;
+
private:
bool _isVisible(Unit*) const;
bool _needToStop(void);
diff --git a/src/server/game/AI/CoreAI/ReactorAI.h b/src/server/game/AI/CoreAI/ReactorAI.h
index e5abaac2f00..d281ca11fdf 100644
--- a/src/server/game/AI/CoreAI/ReactorAI.h
+++ b/src/server/game/AI/CoreAI/ReactorAI.h
@@ -23,7 +23,7 @@
class Unit;
-class ReactorAI : public CreatureAI
+class TC_GAME_API ReactorAI : public CreatureAI
{
public:
diff --git a/src/server/game/AI/CoreAI/TotemAI.h b/src/server/game/AI/CoreAI/TotemAI.h
index e1d1618037f..a0e796ed7e0 100644
--- a/src/server/game/AI/CoreAI/TotemAI.h
+++ b/src/server/game/AI/CoreAI/TotemAI.h
@@ -25,7 +25,7 @@
class Creature;
class Totem;
-class TotemAI : public CreatureAI
+class TC_GAME_API TotemAI : public CreatureAI
{
public:
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index a3a5e7f7663..037d9e59cf2 100644
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -259,73 +259,67 @@ void UnitAI::FillAISpellInfo()
}
}
-//Enable PlayerAI when charmed
-void PlayerAI::OnCharmed(bool apply)
+SpellTargetSelector::SpellTargetSelector(Unit* caster, uint32 spellId) :
+ _caster(caster), _spellInfo(sSpellMgr->GetSpellForDifficultyFromSpell(sSpellMgr->GetSpellInfo(spellId), caster))
{
- me->IsAIEnabled = apply;
+ ASSERT(_spellInfo);
}
-void SimpleCharmedAI::UpdateAI(const uint32 /*diff*/)
+bool SpellTargetSelector::operator()(Unit const* target) const
{
- Creature* charmer = me->GetCharmer()->ToCreature();
+ if (!target || _spellInfo->CheckTarget(_caster, target) != SPELL_CAST_OK)
+ return false;
- //kill self if charm aura has infinite duration
- if (charmer->IsInEvadeMode())
+ // copypasta from Spell::CheckRange
+ float minRange = 0.0f;
+ float maxRange = 0.0f;
+ float rangeMod = 0.0f;
+ if (_spellInfo->RangeEntry)
{
- Unit::AuraEffectList const& auras = me->GetAuraEffectsByType(SPELL_AURA_MOD_CHARM);
- for (Unit::AuraEffectList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
- if ((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->GetBase()->IsPermanent())
+ if (_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE)
+ {
+ rangeMod = _caster->GetCombatReach() + 4.0f / 3.0f;
+ rangeMod += target->GetCombatReach();
+
+ rangeMod = std::max(rangeMod, NOMINAL_MELEE_RANGE);
+ }
+ else
+ {
+ float meleeRange = 0.0f;
+ if (_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED)
{
- charmer->Kill(me);
- return;
+ meleeRange = _caster->GetCombatReach() + 4.0f / 3.0f;
+ meleeRange += target->GetCombatReach();
+
+ meleeRange = std::max(meleeRange, NOMINAL_MELEE_RANGE);
}
- }
- if (!charmer->IsInCombat())
- me->GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, me->GetFollowAngle());
+ minRange = _caster->GetSpellMinRangeForTarget(target, _spellInfo) + meleeRange;
+ maxRange = _caster->GetSpellMaxRangeForTarget(target, _spellInfo);
- Unit* target = me->GetVictim();
- if (!target || !charmer->IsValidAttackTarget(target))
- AttackStart(charmer->SelectNearestTargetInAttackDistance());
-}
+ rangeMod = _caster->GetCombatReach();
+ rangeMod += target->GetCombatReach();
-SpellTargetSelector::SpellTargetSelector(Unit* caster, uint32 spellId) :
- _caster(caster), _spellInfo(sSpellMgr->GetSpellForDifficultyFromSpell(sSpellMgr->GetSpellInfo(spellId), caster))
-{
- ASSERT(_spellInfo);
-}
-
-bool SpellTargetSelector::operator()(Unit const* target) const
-{
- if (!target)
- return false;
+ if (minRange > 0.0f && !(_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED))
+ minRange += rangeMod;
+ }
- if (_spellInfo->CheckTarget(_caster, target) != SPELL_CAST_OK)
- return false;
+ if (_caster->isMoving() && target->isMoving() && !_caster->IsWalking() && !target->IsWalking() &&
+ (_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE || target->GetTypeId() == TYPEID_PLAYER))
+ rangeMod += 5.0f / 3.0f;
+ }
- // copypasta from Spell::CheckRange
- uint32 range_type = _spellInfo->RangeEntry ? _spellInfo->RangeEntry->type : 0;
- float max_range = _caster->GetSpellMaxRangeForTarget(target, _spellInfo);
- float min_range = _caster->GetSpellMinRangeForTarget(target, _spellInfo);
+ maxRange += rangeMod;
+ minRange *= minRange;
+ maxRange *= maxRange;
- if (target && target != _caster)
+ if (target != _caster)
{
- if (range_type == SPELL_RANGE_MELEE)
- {
- // Because of lag, we can not check too strictly here.
- if (!_caster->IsWithinMeleeRange(target, max_range))
- return false;
- }
- else if (!_caster->IsWithinCombatRange(target, max_range))
+ if (_caster->GetExactDistSq(target) > maxRange)
return false;
- if (range_type == SPELL_RANGE_RANGED)
- {
- if (_caster->IsWithinMeleeRange(target))
- return false;
- }
- else if (min_range && _caster->IsWithinCombatRange(target, min_range)) // skip this check if min_range = 0
+ if (minRange > 0.0f && _caster->GetExactDistSq(target) < minRange)
return false;
}
@@ -340,5 +334,8 @@ bool NonTankTargetSelector::operator()(Unit const* target) const
if (_playerOnly && target->GetTypeId() != TYPEID_PLAYER)
return false;
+ if (HostileReference* currentVictim = _source->getThreatManager().getCurrentVictim())
+ return target->GetGUID() != currentVictim->getUnitGuid();
+
return target != _source->GetVictim();
}
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h
index 5dc5946b226..0dd09bc8051 100644
--- a/src/server/game/AI/CoreAI/UnitAI.h
+++ b/src/server/game/AI/CoreAI/UnitAI.h
@@ -40,7 +40,7 @@ enum SelectAggroTarget
};
// default predicate function to select target based on distance, player and/or aura criteria
-struct DefaultTargetSelector : public std::unary_function<Unit*, bool>
+struct TC_GAME_API DefaultTargetSelector : public std::unary_function<Unit*, bool>
{
const Unit* me;
float m_dist;
@@ -90,7 +90,7 @@ struct DefaultTargetSelector : public std::unary_function<Unit*, bool>
// Target selector for spell casts checking range, auras and attributes
/// @todo Add more checks from Spell::CheckCast
-struct SpellTargetSelector : public std::unary_function<Unit*, bool>
+struct TC_GAME_API SpellTargetSelector : public std::unary_function<Unit*, bool>
{
public:
SpellTargetSelector(Unit* caster, uint32 spellId);
@@ -104,18 +104,18 @@ struct SpellTargetSelector : public std::unary_function<Unit*, bool>
// Very simple target selector, will just skip main target
// NOTE: When passing to UnitAI::SelectTarget remember to use 0 as position for random selection
// because tank will not be in the temporary list
-struct NonTankTargetSelector : public std::unary_function<Unit*, bool>
+struct TC_GAME_API NonTankTargetSelector : public std::unary_function<Unit*, bool>
{
public:
- NonTankTargetSelector(Creature* source, bool playerOnly = true) : _source(source), _playerOnly(playerOnly) { }
+ NonTankTargetSelector(Unit* source, bool playerOnly = true) : _source(source), _playerOnly(playerOnly) { }
bool operator()(Unit const* target) const;
private:
- Creature const* _source;
+ Unit* _source;
bool _playerOnly;
};
-class UnitAI
+class TC_GAME_API UnitAI
{
protected:
Unit* const me;
@@ -148,15 +148,29 @@ class UnitAI
{
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
if (position >= threatlist.size())
- return NULL;
+ return nullptr;
std::list<Unit*> targetList;
+ Unit* currentVictim = nullptr;
+ if (auto currentVictimReference = me->getThreatManager().getCurrentVictim())
+ {
+ currentVictim = currentVictimReference->getTarget();
+
+ // Current victim always goes first
+ if (currentVictim && predicate(currentVictim))
+ targetList.push_back(currentVictim);
+ }
+
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
- if (predicate((*itr)->getTarget()))
+ {
+ if (currentVictim != nullptr && (*itr)->getTarget() != currentVictim && predicate((*itr)->getTarget()))
+ targetList.push_back((*itr)->getTarget());
+ else if (currentVictim == nullptr && predicate((*itr)->getTarget()))
targetList.push_back((*itr)->getTarget());
+ }
if (position >= targetList.size())
- return NULL;
+ return nullptr;
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
targetList.sort(Trinity::ObjectDistanceOrderPred(me));
@@ -187,7 +201,7 @@ class UnitAI
break;
}
- return NULL;
+ return nullptr;
}
void SelectTargetList(std::list<Unit*>& targetList, uint32 num, SelectAggroTarget targetType, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
@@ -242,6 +256,7 @@ class UnitAI
void DoAddAuraToAllHostilePlayers(uint32 spellid);
void DoCast(uint32 spellId);
void DoCast(Unit* victim, uint32 spellId, bool triggered = false);
+ void DoCastSelf(uint32 spellId, bool triggered = false) { DoCast(me, spellId, triggered); }
void DoCastToAllHostilePlayers(uint32 spellid, bool triggered = false);
void DoCastVictim(uint32 spellId, bool triggered = false);
void DoCastAOE(uint32 spellId, bool triggered = false);
@@ -268,21 +283,4 @@ class UnitAI
UnitAI& operator=(UnitAI const& right) = delete;
};
-class PlayerAI : public UnitAI
-{
- protected:
- Player* const me;
- public:
- explicit PlayerAI(Player* player) : UnitAI((Unit*)player), me(player) { }
-
- void OnCharmed(bool apply) override;
-};
-
-class SimpleCharmedAI : public PlayerAI
-{
- public:
- void UpdateAI(uint32 diff) override;
- SimpleCharmedAI(Player* player): PlayerAI(player) { }
-};
-
#endif
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 44098586e5f..15bbff2793f 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -29,11 +29,13 @@
#include "Language.h"
//Disable CreatureAI when charmed
-void CreatureAI::OnCharmed(bool /*apply*/)
+void CreatureAI::OnCharmed(bool apply)
{
- //me->IsAIEnabled = !apply;*/
- me->NeedChangeAI = true;
- me->IsAIEnabled = false;
+ if (apply)
+ {
+ me->NeedChangeAI = true;
+ me->IsAIEnabled = false;
+ }
}
AISpellInfoType* UnitAI::AISpellInfo;
@@ -44,7 +46,7 @@ void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= nullptr*/)
sCreatureTextMgr->SendChat(me, id, whisperTarget);
}
-void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToNearestTarget /* = 50.0f*/)
+void CreatureAI::DoZoneInCombat(Creature* creature /*= nullptr*/, float maxRangeToNearestTarget /* = 250.0f*/)
{
if (!creature)
creature = me;
@@ -133,7 +135,7 @@ void CreatureAI::MoveInLineOfSight(Unit* who)
if (me->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET) // non-combat pets should just stand there and look good;)
return;
- if (me->CanStartAttack(who, false))
+ if (me->HasReactState(REACT_AGGRESSIVE) && me->CanStartAttack(who, false))
AttackStart(who);
//else if (who->GetVictim() && me->IsFriendlyTo(who)
// && me->IsWithinDistInMap(who, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))
@@ -257,17 +259,16 @@ bool CreatureAI::_EnterEvadeMode(EvadeReason /*why*/)
if (!me->IsAlive())
return false;
- // don't remove vehicle auras, passengers aren't supposed to drop off the vehicle
- // don't remove clone caster on evade (to be verified)
- me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE, SPELL_AURA_CLONE_CASTER);
+ me->RemoveAurasOnEvade();
// sometimes bosses stuck in combat?
me->DeleteThreatList();
me->CombatStop(true);
me->LoadCreaturesAddon();
- me->SetLootRecipient(NULL);
+ me->SetLootRecipient(nullptr);
me->ResetPlayerDamageReq();
me->SetLastDamagedTime(0);
+ me->SetCannotReachTarget(false);
if (me->IsInEvadeMode())
return false;
@@ -275,15 +276,15 @@ bool CreatureAI::_EnterEvadeMode(EvadeReason /*why*/)
return true;
}
-#define BOUNDARY_VISUALIZE_CREATURE 15425
-#define BOUNDARY_VISUALIZE_CREATURE_SCALE 0.25f
-#define BOUNDARY_VISUALIZE_STEP_SIZE 1
-#define BOUNDARY_VISUALIZE_FAILSAFE_LIMIT 750
-#define BOUNDARY_VISUALIZE_SPAWN_HEIGHT 5
+static const uint32 BOUNDARY_VISUALIZE_CREATURE = 15425;
+static const float BOUNDARY_VISUALIZE_CREATURE_SCALE = 0.25f;
+static const int8 BOUNDARY_VISUALIZE_STEP_SIZE = 1;
+static const int32 BOUNDARY_VISUALIZE_FAILSAFE_LIMIT = 750;
+static const float BOUNDARY_VISUALIZE_SPAWN_HEIGHT = 5.0f;
int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) const
{
typedef std::pair<int32, int32> coordinate;
-
+
if (!owner)
return -1;
@@ -293,15 +294,15 @@ int32 CreatureAI::VisualizeBoundary(uint32 duration, Unit* owner, bool fill) con
std::queue<coordinate> Q;
std::unordered_set<coordinate> alreadyChecked;
std::unordered_set<coordinate> outOfBounds;
-
+
Position startPosition = owner->GetPosition();
- if (!CheckBoundary(&startPosition)) // fall back to creature position
- {
+ if (!CheckBoundary(&startPosition))
+ { // fall back to creature position
startPosition = me->GetPosition();
if (!CheckBoundary(&startPosition))
- {
+ { // fall back to creature home position
startPosition = me->GetHomePosition();
- if (!CheckBoundary(&startPosition)) // fall back to creature home position
+ if (!CheckBoundary(&startPosition))
return LANG_CREATURE_NO_INTERIOR_POINT_FOUND;
}
}
diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h
index 239fda577a7..f8fa6ba532b 100644
--- a/src/server/game/AI/CreatureAI.h
+++ b/src/server/game/AI/CreatureAI.h
@@ -28,6 +28,7 @@ class WorldObject;
class Unit;
class Creature;
class Player;
+class PlayerAI;
class SpellInfo;
#define TIME_INTERVAL_LOOK 5000
@@ -65,7 +66,7 @@ enum SCEquip
};
typedef std::set<AreaBoundary const*> CreatureBoundary;
-class CreatureAI : public UnitAI
+class TC_GAME_API CreatureAI : public UnitAI
{
protected:
Creature* const me;
@@ -86,6 +87,7 @@ class CreatureAI : public UnitAI
{
EVADE_REASON_NO_HOSTILES, // the creature's threat list is empty
EVADE_REASON_BOUNDARY, // the creature has moved outside its evade boundary
+ EVADE_REASON_NO_PATH, // the creature was unable to reach its target for over 5 seconds
EVADE_REASON_SEQUENCE_BREAK, // this is a boss and the pre-requisite encounters for engaging it are not defeated yet
EVADE_REASON_OTHER
};
@@ -110,7 +112,7 @@ class CreatureAI : public UnitAI
// Called for reaction at stopping attack at no attackers or targets
virtual void EnterEvadeMode(EvadeReason why = EVADE_REASON_OTHER);
- // Called for reaction at enter to combat if not in combat yet (enemy can be NULL)
+ // Called for reaction at enter to combat if not in combat yet (enemy can be nullptr)
virtual void EnterCombat(Unit* /*victim*/) { }
// Called when the creature is killed
@@ -136,8 +138,8 @@ class CreatureAI : public UnitAI
virtual void AttackedBy(Unit* /*attacker*/) { }
virtual bool IsEscorted() const { return false; }
- // Called when creature is spawned or respawned (for reseting variables)
- virtual void JustRespawned() { Reset(); }
+ // Called when creature is spawned or respawned
+ virtual void JustRespawned() { }
// Called at waypoint reached or point movement finished
virtual void MovementInform(uint32 /*type*/, uint32 /*id*/) { }
@@ -147,7 +149,7 @@ class CreatureAI : public UnitAI
// Called at reaching home after evade
virtual void JustReachedHome() { }
- void DoZoneInCombat(Creature* creature = NULL, float maxRangeToNearestTarget = 50.0f);
+ void DoZoneInCombat(Creature* creature = nullptr, float maxRangeToNearestTarget = 250.0f);
// Called at text emote receive from player
virtual void ReceiveEmote(Player* /*player*/, uint32 /*emoteId*/) { }
@@ -186,6 +188,11 @@ class CreatureAI : public UnitAI
virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; }
+ // Called when a player is charmed by the creature
+ // If a PlayerAI* is returned, that AI is placed on the player instead of the default charm AI
+ // Object destruction is handled by Unit::RemoveCharmedBy
+ virtual PlayerAI* GetAIForCharmedPlayer(Player* /*who*/) { return nullptr; }
+
// intended for encounter design/debugging. do not use for other purposes. expensive.
int32 VisualizeBoundary(uint32 duration, Unit* owner=nullptr, bool fill=false) const;
virtual bool CheckInRoom();
diff --git a/src/server/game/AI/CreatureAISelector.h b/src/server/game/AI/CreatureAISelector.h
index 7c7bc705ade..0e3be1a8604 100644
--- a/src/server/game/AI/CreatureAISelector.h
+++ b/src/server/game/AI/CreatureAISelector.h
@@ -27,9 +27,9 @@ class GameObject;
namespace FactorySelector
{
- CreatureAI* selectAI(Creature*);
- MovementGenerator* selectMovementGenerator(Creature*);
- GameObjectAI* SelectGameObjectAI(GameObject*);
+ TC_GAME_API CreatureAI* selectAI(Creature*);
+ TC_GAME_API MovementGenerator* selectMovementGenerator(Creature*);
+ TC_GAME_API GameObjectAI* SelectGameObjectAI(GameObject*);
}
#endif
diff --git a/src/server/game/AI/PlayerAI/PlayerAI.cpp b/src/server/game/AI/PlayerAI/PlayerAI.cpp
new file mode 100644
index 00000000000..d5c17cce3ad
--- /dev/null
+++ b/src/server/game/AI/PlayerAI/PlayerAI.cpp
@@ -0,0 +1,1367 @@
+/*
+ * Copyright (C) 2016-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "PlayerAI.h"
+#include "SpellAuras.h"
+#include "SpellAuraEffects.h"
+
+static const uint8 NUM_TALENT_TREES = 3;
+static const uint8 NUM_SPEC_ICONICS = 3;
+
+enum Specs
+{
+ SPEC_WARRIOR_ARMS = 0,
+ SPEC_WARRIOR_FURY = 1,
+ SPEC_WARRIOR_PROTECTION = 2,
+
+ SPEC_PALADIN_HOLY = 0,
+ SPEC_PALADIN_PROTECTION = 1,
+ SPEC_PALADIN_RETRIBUTION = 2,
+
+ SPEC_HUNTER_BEAST_MASTERY = 0,
+ SPEC_HUNTER_MARKSMANSHIP = 1,
+ SPEC_HUNTER_SURVIVAL = 2,
+
+ SPEC_ROGUE_ASSASSINATION = 0,
+ SPEC_ROGUE_COMBAT = 1,
+ SPEC_ROGUE_SUBLETY = 2,
+
+ SPEC_PRIEST_DISCIPLINE = 0,
+ SPEC_PRIEST_HOLY = 1,
+ SPEC_PRIEST_SHADOW = 2,
+
+ SPEC_DEATH_KNIGHT_BLOOD = 0,
+ SPEC_DEATH_KNIGHT_FROST = 1,
+ SPEC_DEATH_KNIGHT_UNHOLY = 2,
+
+ SPEC_SHAMAN_ELEMENTAL = 0,
+ SPEC_SHAMAN_ENHANCEMENT = 1,
+ SPEC_SHAMAN_RESTORATION = 2,
+
+ SPEC_MAGE_ARCANE = 0,
+ SPEC_MAGE_FIRE = 1,
+ SPEC_MAGE_FROST = 2,
+
+ SPEC_WARLOCK_AFFLICTION = 0,
+ SPEC_WARLOCK_DEMONOLOGY = 1,
+ SPEC_WARLOCK_DESTRUCTION = 2,
+
+ SPEC_DRUID_BALANCE = 0,
+ SPEC_DRUID_FERAL = 1,
+ SPEC_DRUID_RESTORATION = 2
+};
+enum Spells
+{
+ /* Generic */
+ SPELL_AUTO_SHOT = 75,
+ SPELL_SHOOT = 3018,
+ SPELL_THROW = 2764,
+ SPELL_SHOOT_WAND = 5019,
+
+ /* Warrior - Generic */
+ SPELL_BATTLE_STANCE = 2457,
+ SPELL_BERSERKER_STANCE = 2458,
+ SPELL_DEFENSIVE_STANCE = 71,
+ SPELL_CHARGE = 11578,
+ SPELL_INTERCEPT = 20252,
+ SPELL_ENRAGED_REGEN = 55694,
+ SPELL_INTIMIDATING_SHOUT= 5246,
+ SPELL_PUMMEL = 6552,
+ SPELL_SHIELD_BASH = 72,
+ SPELL_BLOODRAGE = 2687,
+
+ /* Warrior - Arms */
+ SPELL_SWEEPING_STRIKES = 12328,
+ SPELL_MORTAL_STRIKE = 12294,
+ SPELL_BLADESTORM = 46924,
+ SPELL_REND = 47465,
+ SPELL_RETALIATION = 20230,
+ SPELL_SHATTERING_THROW = 64382,
+ SPELL_THUNDER_CLAP = 47502,
+
+ /* Warrior - Fury */
+ SPELL_DEATH_WISH = 12292,
+ SPELL_BLOODTHIRST = 23881,
+ PASSIVE_TITANS_GRIP = 46917,
+ SPELL_DEMO_SHOUT = 47437,
+ SPELL_EXECUTE = 47471,
+ SPELL_HEROIC_FURY = 60970,
+ SPELL_RECKLESSNESS = 1719,
+ SPELL_PIERCING_HOWL = 12323,
+
+ /* Warrior - Protection */
+ SPELL_VIGILANCE = 50720,
+ SPELL_DEVASTATE = 20243,
+ SPELL_SHOCKWAVE = 46968,
+ SPELL_CONCUSSION_BLOW = 12809,
+ SPELL_DISARM = 676,
+ SPELL_LAST_STAND = 12975,
+ SPELL_SHIELD_BLOCK = 2565,
+ SPELL_SHIELD_SLAM = 47488,
+ SPELL_SHIELD_WALL = 871,
+ SPELL_SPELL_REFLECTION = 23920,
+
+ /* Paladin - Generic */
+ SPELL_AURA_MASTERY = 31821,
+ SPELL_LAY_ON_HANDS = 48788,
+ SPELL_BLESSING_OF_MIGHT = 48932,
+ SPELL_AVENGING_WRATH = 31884,
+ SPELL_DIVINE_PROTECTION = 498,
+ SPELL_DIVINE_SHIELD = 642,
+ SPELL_HAMMER_OF_JUSTICE = 10308,
+ SPELL_HAND_OF_FREEDOM = 1044,
+ SPELL_HAND_OF_PROTECTION = 10278,
+ SPELL_HAND_OF_SACRIFICE = 6940,
+
+ /* Paladin - Holy*/
+ PASSIVE_ILLUMINATION = 20215,
+ SPELL_HOLY_SHOCK = 20473,
+ SPELL_BEACON_OF_LIGHT = 53563,
+ SPELL_CONSECRATION = 48819,
+ SPELL_FLASH_OF_LIGHT = 48785,
+ SPELL_HOLY_LIGHT = 48782,
+ SPELL_DIVINE_FAVOR = 20216,
+ SPELL_DIVINE_ILLUMINATION = 31842,
+
+ /* Paladin - Protection */
+ SPELL_BLESS_OF_SANC = 20911,
+ SPELL_HOLY_SHIELD = 20925,
+ SPELL_AVENGERS_SHIELD = 48827,
+ SPELL_DIVINE_SACRIFICE = 64205,
+ SPELL_HAMMER_OF_RIGHTEOUS = 53595,
+ SPELL_RIGHTEOUS_FURY = 25780,
+ SPELL_SHIELD_OF_RIGHTEOUS = 61411,
+
+ /* Paladin - Retribution */
+ SPELL_SEAL_OF_COMMAND = 20375,
+ SPELL_CRUSADER_STRIKE = 35395,
+ SPELL_DIVINE_STORM = 53385,
+ SPELL_JUDGEMENT = 20271,
+ SPELL_HAMMER_OF_WRATH = 48806,
+
+ /* Hunter - Generic */
+ SPELL_DETERRENCE = 19263,
+ SPELL_EXPLOSIVE_TRAP = 49067,
+ SPELL_FREEZING_ARROW = 60192,
+ SPELL_RAPID_FIRE = 3045,
+ SPELL_KILL_SHOT = 61006,
+ SPELL_MULTI_SHOT = 49048,
+ SPELL_VIPER_STING = 3034,
+
+ /* Hunter - Beast Mastery */
+ SPELL_BESTIAL_WRATH = 19574,
+ PASSIVE_BEAST_WITHIN = 34692,
+ PASSIVE_BEAST_MASTERY = 53270,
+
+ /* Hunter - Marksmanship */
+ SPELL_AIMED_SHOT = 19434,
+ PASSIVE_TRUESHOT_AURA = 19506,
+ SPELL_CHIMERA_SHOT = 53209,
+ SPELL_ARCANE_SHOT = 49045,
+ SPELL_STEADY_SHOT = 49052,
+ SPELL_READINESS = 23989,
+ SPELL_SILENCING_SHOT = 34490,
+
+ /* Hunter - Survival */
+ PASSIVE_LOCK_AND_LOAD = 56344,
+ SPELL_WYVERN_STING = 19386,
+ SPELL_EXPLOSIVE_SHOT = 53301,
+ SPELL_BLACK_ARROW = 3674,
+
+ /* Rogue - Generic */
+ SPELL_DISMANTLE = 51722,
+ SPELL_EVASION = 26669,
+ SPELL_KICK = 1766,
+ SPELL_VANISH = 26889,
+ SPELL_BLIND = 2094,
+ SPELL_CLOAK_OF_SHADOWS = 31224,
+
+ /* Rogue - Assassination */
+ SPELL_COLD_BLOOD = 14177,
+ SPELL_MUTILATE = 1329,
+ SPELL_HUNGER_FOR_BLOOD = 51662,
+ SPELL_ENVENOM = 57993,
+
+ /* Rogue - Combat */
+ SPELL_SINISTER_STRIKE = 48637,
+ SPELL_BLADE_FLURRY = 13877,
+ SPELL_ADRENALINE_RUSH = 13750,
+ SPELL_KILLING_SPREE = 51690,
+ SPELL_EVISCERATE = 48668,
+
+ /* Rogue - Sublety */
+ SPELL_HEMORRHAGE = 16511,
+ SPELL_PREMEDITATION = 14183,
+ SPELL_SHADOW_DANCE = 51713,
+ SPELL_PREPARATION = 14185,
+ SPELL_SHADOWSTEP = 36554,
+
+ /* Priest - Generic */
+ SPELL_FEAR_WARD = 6346,
+ SPELL_POWER_WORD_FORT = 48161,
+ SPELL_DIVINE_SPIRIT = 48073,
+ SPELL_SHADOW_PROTECTION = 48169,
+ SPELL_DIVINE_HYMN = 64843,
+ SPELL_HYMN_OF_HOPE = 64901,
+ SPELL_SHADOW_WORD_DEATH = 48158,
+ SPELL_PSYCHIC_SCREAM = 10890,
+
+ /* Priest - Discipline */
+ PASSIVE_SOUL_WARDING = 63574,
+ SPELL_POWER_INFUSION = 10060,
+ SPELL_PENANCE = 47540,
+ SPELL_PAIN_SUPPRESSION = 33206,
+ SPELL_INNER_FOCUS = 14751,
+ SPELL_POWER_WORD_SHIELD = 48066,
+
+ /* Priest - Holy */
+ PASSIVE_SPIRIT_REDEMPTION = 20711,
+ SPELL_DESPERATE_PRAYER = 19236,
+ SPELL_GUARDIAN_SPIRIT = 47788,
+ SPELL_FLASH_HEAL = 48071,
+ SPELL_RENEW = 48068,
+
+ /* Priest - Shadow */
+ SPELL_VAMPIRIC_EMBRACE = 15286,
+ SPELL_SHADOWFORM = 15473,
+ SPELL_VAMPIRIC_TOUCH = 34914,
+ SPELL_MIND_FLAY = 15407,
+ SPELL_MIND_BLAST = 48127,
+ SPELL_SHADOW_WORD_PAIN = 48125,
+ SPELL_DEVOURING_PLAGUE = 48300,
+ SPELL_DISPERSION = 47585,
+
+ /* Death Knight - Generic */
+ SPELL_DEATH_GRIP = 49576,
+ SPELL_STRANGULATE = 47476,
+ SPELL_EMPOWER_RUNE_WEAP = 47568,
+ SPELL_ICEBORN_FORTITUDE = 48792,
+ SPELL_ANTI_MAGIC_SHELL = 48707,
+ SPELL_DEATH_COIL_DK = 49895,
+ SPELL_MIND_FREEZE = 47528,
+ SPELL_ICY_TOUCH = 49909,
+ AURA_FROST_FEVER = 55095,
+ SPELL_PLAGUE_STRIKE = 49921,
+ AURA_BLOOD_PLAGUE = 55078,
+ SPELL_PESTILENCE = 50842,
+
+ /* Death Knight - Blood */
+ SPELL_RUNE_TAP = 48982,
+ SPELL_HYSTERIA = 49016,
+ SPELL_HEART_STRIKE = 55050,
+ SPELL_DEATH_STRIKE = 49924,
+ SPELL_BLOOD_STRIKE = 49930,
+ SPELL_MARK_OF_BLOOD = 49005,
+ SPELL_VAMPIRIC_BLOOD = 55233,
+
+ /* Death Knight - Frost */
+ PASSIVE_ICY_TALONS = 50887,
+ SPELL_FROST_STRIKE = 49143,
+ SPELL_HOWLING_BLAST = 49184,
+ SPELL_UNBREAKABLE_ARMOR = 51271,
+ SPELL_OBLITERATE = 51425,
+ SPELL_DEATHCHILL = 49796,
+
+ /* Death Knight - Unholy */
+ PASSIVE_UNHOLY_BLIGHT = 49194,
+ PASSIVE_MASTER_OF_GHOUL = 52143,
+ SPELL_SCOURGE_STRIKE = 55090,
+ SPELL_DEATH_AND_DECAY = 49938,
+ SPELL_ANTI_MAGIC_ZONE = 51052,
+ SPELL_SUMMON_GARGOYLE = 49206,
+
+ /* Shaman - Generic */
+ SPELL_HEROISM = 32182,
+ SPELL_BLOODLUST = 2825,
+ SPELL_GROUNDING_TOTEM = 8177,
+
+ /* Shaman - Elemental*/
+ PASSIVE_ELEMENTAL_FOCUS = 16164,
+ SPELL_TOTEM_OF_WRATH = 30706,
+ SPELL_THUNDERSTORM = 51490,
+ SPELL_LIGHTNING_BOLT = 49238,
+ SPELL_EARTH_SHOCK = 49231,
+ SPELL_FLAME_SHOCK = 49233,
+ SPELL_LAVA_BURST = 60043,
+ SPELL_CHAIN_LIGHTNING = 49271,
+ SPELL_ELEMENTAL_MASTERY = 16166,
+
+ /* Shaman - Enhancement */
+ PASSIVE_SPIRIT_WEAPONS = 16268,
+ SPELL_LAVA_LASH = 60103,
+ SPELL_FERAL_SPIRIT = 51533,
+ AURA_MAELSTROM_WEAPON = 53817,
+ SPELL_STORMSTRIKE = 17364,
+ SPELL_SHAMANISTIC_RAGE = 30823,
+
+ /* Shaman - Restoration*/
+ SPELL_SHA_NATURE_SWIFT = 591,
+ SPELL_MANA_TIDE_TOTEM = 590,
+ SPELL_EARTH_SHIELD = 49284,
+ SPELL_RIPTIDE = 61295,
+ SPELL_HEALING_WAVE = 49273,
+ SPELL_LESSER_HEAL_WAVE = 49276,
+ SPELL_TIDAL_FORCE = 55198,
+
+ /* Mage - Generic */
+ SPELL_DAMPEN_MAGIC = 43015,
+ SPELL_EVOCATION = 12051,
+ SPELL_MANA_SHIELD = 43020,
+ SPELL_MIRROR_IMAGE = 55342,
+ SPELL_SPELLSTEAL = 30449,
+ SPELL_COUNTERSPELL = 2139,
+ SPELL_ICE_BLOCK = 45438,
+
+ /* Mage - Arcane */
+ SPELL_FOCUS_MAGIC = 54646,
+ SPELL_ARCANE_POWER = 12042,
+ SPELL_ARCANE_BARRAGE = 44425,
+ SPELL_ARCANE_BLAST = 42897,
+ AURA_ARCANE_BLAST = 36032,
+ SPELL_ARCANE_MISSILES = 42846,
+ SPELL_PRESENCE_OF_MIND = 12043,
+
+ /* Mage - Fire */
+ SPELL_PYROBLAST = 11366,
+ SPELL_COMBUSTION = 11129,
+ SPELL_LIVING_BOMB = 44457,
+ SPELL_FIREBALL = 42833,
+ SPELL_FIRE_BLAST = 42873,
+ SPELL_DRAGONS_BREATH = 31661,
+ SPELL_BLAST_WAVE = 11113,
+
+ /* Mage - Frost */
+ SPELL_ICY_VEINS = 12472,
+ SPELL_ICE_BARRIER = 11426,
+ SPELL_DEEP_FREEZE = 44572,
+ SPELL_FROST_NOVA = 42917,
+ SPELL_FROSTBOLT = 42842,
+ SPELL_COLD_SNAP = 11958,
+ SPELL_ICE_LANCE = 42914,
+
+ /* Warlock - Generic */
+ SPELL_FEAR = 6215,
+ SPELL_HOWL_OF_TERROR = 17928,
+ SPELL_CORRUPTION = 47813,
+ SPELL_DEATH_COIL_W = 47860,
+ SPELL_SHADOW_BOLT = 47809,
+ SPELL_INCINERATE = 47838,
+ SPELL_IMMOLATE = 47811,
+ SPELL_SEED_OF_CORRUPTION = 47836,
+
+ /* Warlock - Affliction */
+ PASSIVE_SIPHON_LIFE = 63108,
+ SPELL_UNSTABLE_AFFLICTION = 30108,
+ SPELL_HAUNT = 48181,
+ SPELL_CURSE_OF_AGONY = 47864,
+ SPELL_DRAIN_SOUL = 47855,
+
+ /* Warlock - Demonology */
+ SPELL_SOUL_LINK = 19028,
+ SPELL_DEMONIC_EMPOWERMENT = 47193,
+ SPELL_METAMORPHOSIS = 59672,
+ SPELL_IMMOLATION_AURA = 50589,
+ SPELL_DEMON_CHARGE = 54785,
+ AURA_DECIMATION = 63167,
+ AURA_MOLTEN_CORE = 71165,
+ SPELL_SOUL_FIRE = 47825,
+
+ /* Warlock - Destruction */
+ SPELL_SHADOWBURN = 17877,
+ SPELL_CONFLAGRATE = 17962,
+ SPELL_CHAOS_BOLT = 50796,
+ SPELL_SHADOWFURY = 47847,
+
+ /* Druid - Generic */
+ SPELL_BARKSKIN = 22812,
+ SPELL_INNERVATE = 29166,
+
+ /* Druid - Balance */
+ SPELL_INSECT_SWARM = 5570,
+ SPELL_MOONKIN_FORM = 24858,
+ SPELL_STARFALL = 48505,
+ SPELL_TYPHOON = 61384,
+ AURA_ECLIPSE_LUNAR = 48518,
+ SPELL_MOONFIRE = 48463,
+ SPELL_STARFIRE = 48465,
+ SPELL_WRATH = 48461,
+
+ /* Druid - Feral */
+ SPELL_CAT_FORM = 768,
+ SPELL_SURVIVAL_INSTINCTS = 61336,
+ SPELL_MANGLE = 33917,
+ SPELL_BERSERK = 50334,
+ SPELL_MANGLE_CAT = 48566,
+ SPELL_FERAL_CHARGE_CAT = 49376,
+ SPELL_RAKE = 48574,
+ SPELL_RIP = 49800,
+ SPELL_SAVAGE_ROAR = 52610,
+ SPELL_TIGER_FURY = 50213,
+ SPELL_CLAW = 48570,
+ SPELL_DASH = 33357,
+ SPELL_MAIM = 49802,
+
+ /* Druid - Restoration */
+ SPELL_SWIFTMEND = 18562,
+ SPELL_TREE_OF_LIFE = 33891,
+ SPELL_WILD_GROWTH = 48438,
+ SPELL_NATURE_SWIFTNESS = 17116,
+ SPELL_TRANQUILITY = 48447,
+ SPELL_NOURISH = 50464,
+ SPELL_HEALING_TOUCH = 48378,
+ SPELL_REJUVENATION = 48441,
+ SPELL_REGROWTH = 48443,
+ SPELL_LIFEBLOOM = 48451
+};
+
+// As it turns out, finding out "how many points does the player have in spec X" is actually really expensive to do frequently
+// So instead, we just check for a handful of spells that, realistically, no spec is gonna go without (and "has spell" is cheap!)
+// Can players deliberately trick this check? Yes.
+// Is it worth doing? No.
+// Close enough.
+static const uint32 SPEC_ICONICS[MAX_CLASSES][NUM_TALENT_TREES][NUM_SPEC_ICONICS] = {
+ { // CLASS_NONE
+ {0,0,0},
+ {0,0,0},
+ {0,0,0}
+ },
+ { // CLASS_WARRIOR
+ {SPELL_BLADESTORM, SPELL_MORTAL_STRIKE, SPELL_SWEEPING_STRIKES}, // Arms
+ {PASSIVE_TITANS_GRIP, SPELL_BLOODTHIRST, SPELL_DEATH_WISH}, // Fury
+ {SPELL_SHOCKWAVE, SPELL_DEVASTATE, SPELL_VIGILANCE} // Protection
+ },
+ { // CLASS_PALADIN
+ {SPELL_BEACON_OF_LIGHT, SPELL_HOLY_SHOCK, PASSIVE_ILLUMINATION}, // Holy
+ {SPELL_HAMMER_OF_RIGHTEOUS, SPELL_HOLY_SHIELD, SPELL_BLESS_OF_SANC}, // Protection
+ {SPELL_DIVINE_STORM, SPELL_CRUSADER_STRIKE, SPELL_SEAL_OF_COMMAND} // Retribution
+ },
+ { // CLASS_HUNTER
+ {PASSIVE_BEAST_MASTERY, PASSIVE_BEAST_WITHIN, SPELL_BESTIAL_WRATH}, // Beast Mastery
+ {SPELL_CHIMERA_SHOT, PASSIVE_TRUESHOT_AURA, SPELL_AIMED_SHOT}, // Marksmanship
+ {SPELL_EXPLOSIVE_SHOT, SPELL_WYVERN_STING, PASSIVE_LOCK_AND_LOAD} // Survival
+ },
+ { // CLASS_ROGUE
+ {SPELL_HUNGER_FOR_BLOOD, SPELL_MUTILATE, SPELL_COLD_BLOOD}, // Assassination
+ {SPELL_KILLING_SPREE, SPELL_ADRENALINE_RUSH, SPELL_BLADE_FLURRY}, // Combat
+ {SPELL_SHADOW_DANCE, SPELL_PREMEDITATION, SPELL_HEMORRHAGE} // Sublety
+ },
+ { // CLASS_PRIEST
+ {SPELL_PENANCE, SPELL_POWER_INFUSION, PASSIVE_SOUL_WARDING}, // Discipline
+ {SPELL_GUARDIAN_SPIRIT, PASSIVE_SPIRIT_REDEMPTION, SPELL_DESPERATE_PRAYER}, // Holy
+ {SPELL_VAMPIRIC_TOUCH, SPELL_SHADOWFORM, SPELL_VAMPIRIC_EMBRACE} // Shadow
+ },
+ { // CLASS_DEATH_KNIGHT
+ {SPELL_HEART_STRIKE, SPELL_HYSTERIA, SPELL_RUNE_TAP}, // Blood
+ {SPELL_HOWLING_BLAST, SPELL_FROST_STRIKE, PASSIVE_ICY_TALONS}, // Frost
+ {SPELL_SCOURGE_STRIKE, PASSIVE_MASTER_OF_GHOUL, PASSIVE_UNHOLY_BLIGHT} // Unholy
+ },
+ { // CLASS_SHAMAN
+ {SPELL_THUNDERSTORM, SPELL_TOTEM_OF_WRATH, PASSIVE_ELEMENTAL_FOCUS}, // Elemental
+ {SPELL_FERAL_SPIRIT, SPELL_LAVA_LASH, PASSIVE_SPIRIT_WEAPONS}, // Enhancement
+ {SPELL_RIPTIDE, SPELL_MANA_TIDE_TOTEM, SPELL_SHA_NATURE_SWIFT} // Restoration
+ },
+ { // CLASS_MAGE
+ {SPELL_ARCANE_BARRAGE, SPELL_ARCANE_POWER, SPELL_FOCUS_MAGIC}, // Arcane
+ {SPELL_LIVING_BOMB, SPELL_COMBUSTION, SPELL_PYROBLAST}, // Fire
+ {SPELL_DEEP_FREEZE, SPELL_ICE_BARRIER, SPELL_ICY_VEINS} // Frost
+ },
+ { // CLASS_WARLOCK
+ {SPELL_HAUNT, SPELL_UNSTABLE_AFFLICTION, PASSIVE_SIPHON_LIFE}, // Affliction
+ {SPELL_METAMORPHOSIS, SPELL_DEMONIC_EMPOWERMENT, SPELL_SOUL_LINK}, // Demonology
+ {SPELL_CHAOS_BOLT, SPELL_CONFLAGRATE, SPELL_SHADOWBURN} // Destruction
+ },
+ { // CLASS_UNK
+ {0,0,0},
+ {0,0,0},
+ {0,0,0}
+ },
+ { // CLASS_DRUID
+ {SPELL_STARFALL, SPELL_MOONKIN_FORM, SPELL_INSECT_SWARM}, // Balance
+ {SPELL_BERSERK, SPELL_MANGLE, SPELL_SURVIVAL_INSTINCTS}, // Feral
+ {SPELL_WILD_GROWTH, SPELL_TREE_OF_LIFE, SPELL_SWIFTMEND} // Restoration
+ }
+};
+
+uint8 PlayerAI::GetPlayerSpec(Player const* who)
+{
+ if (!who)
+ return 0;
+
+ uint8 wClass = who->getClass();
+ for (uint8 tier = 0; tier < NUM_SPEC_ICONICS; ++tier)
+ for (uint8 tree = 0; tree < NUM_TALENT_TREES; ++tree)
+ if (SPEC_ICONICS[wClass][tree][tier] && who->HasSpell(SPEC_ICONICS[wClass][tree][tier]))
+ return tree;
+
+ return 0;
+}
+
+bool PlayerAI::IsPlayerHealer(Player const* who)
+{
+ if (!who)
+ return false;
+
+ switch (who->getClass())
+ {
+ case CLASS_WARRIOR:
+ case CLASS_HUNTER:
+ case CLASS_ROGUE:
+ case CLASS_DEATH_KNIGHT:
+ case CLASS_MAGE:
+ case CLASS_WARLOCK:
+ default:
+ return false;
+ case CLASS_PALADIN:
+ return (PlayerAI::GetPlayerSpec(who) == SPEC_PALADIN_HOLY);
+ case CLASS_PRIEST:
+ return (PlayerAI::GetPlayerSpec(who) != SPEC_PRIEST_SHADOW);
+ case CLASS_SHAMAN:
+ return (PlayerAI::GetPlayerSpec(who) == SPEC_SHAMAN_RESTORATION);
+ case CLASS_DRUID:
+ return (PlayerAI::GetPlayerSpec(who) == SPEC_DRUID_RESTORATION);
+ }
+}
+
+bool PlayerAI::IsPlayerRangedAttacker(Player const* who)
+{
+ if (!who)
+ return false;
+
+ switch (who->getClass())
+ {
+ case CLASS_WARRIOR:
+ case CLASS_PALADIN:
+ case CLASS_ROGUE:
+ case CLASS_DEATH_KNIGHT:
+ default:
+ return false;
+ case CLASS_MAGE:
+ case CLASS_WARLOCK:
+ return true;
+ case CLASS_HUNTER:
+ {
+ // check if we have a ranged weapon equipped
+ Item const* rangedSlot = who->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED);
+ if (ItemTemplate const* rangedTemplate = rangedSlot ? rangedSlot->GetTemplate() : nullptr)
+ if ((1 << rangedTemplate->SubClass) & ITEM_SUBCLASS_MASK_WEAPON_RANGED)
+ return true;
+ return false;
+ }
+ case CLASS_PRIEST:
+ return (PlayerAI::GetPlayerSpec(who) == SPEC_PRIEST_SHADOW);
+ case CLASS_SHAMAN:
+ return (PlayerAI::GetPlayerSpec(who) == SPEC_SHAMAN_ELEMENTAL);
+ case CLASS_DRUID:
+ return (PlayerAI::GetPlayerSpec(who) == SPEC_DRUID_BALANCE);
+ }
+}
+
+PlayerAI::TargetedSpell PlayerAI::VerifySpellCast(uint32 spellId, Unit* target)
+{
+ // Find highest spell rank that we know
+ uint32 knownRank, nextRank;
+ if (me->HasSpell(spellId))
+ {
+ // this will save us some lookups if the player has the highest rank (expected case)
+ knownRank = spellId;
+ nextRank = sSpellMgr->GetNextSpellInChain(spellId);
+ }
+ else
+ {
+ knownRank = 0;
+ nextRank = sSpellMgr->GetFirstSpellInChain(spellId);
+ }
+
+ while (nextRank && me->HasSpell(nextRank))
+ {
+ knownRank = nextRank;
+ nextRank = sSpellMgr->GetNextSpellInChain(knownRank);
+ }
+
+ if (!knownRank)
+ return {};
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(knownRank);
+ if (!spellInfo)
+ return {};
+
+ if (me->GetSpellHistory()->HasGlobalCooldown(spellInfo))
+ return {};
+
+ Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE);
+ if (spell->CanAutoCast(target))
+ return{ spell, target };
+
+ delete spell;
+ return {};
+}
+
+PlayerAI::TargetedSpell PlayerAI::VerifySpellCast(uint32 spellId, SpellTarget target)
+{
+ Unit* pTarget = nullptr;
+ switch (target)
+ {
+ case TARGET_NONE:
+ break;
+ case TARGET_VICTIM:
+ pTarget = me->GetVictim();
+ if (!pTarget)
+ return {};
+ break;
+ case TARGET_CHARMER:
+ pTarget = me->GetCharmer();
+ if (!pTarget)
+ return {};
+ break;
+ case TARGET_SELF:
+ pTarget = me;
+ break;
+ }
+
+ return VerifySpellCast(spellId, pTarget);
+}
+
+PlayerAI::TargetedSpell PlayerAI::SelectSpellCast(PossibleSpellVector& spells)
+{
+ uint32 totalWeights = 0;
+ for (PossibleSpell const& wSpell : spells)
+ totalWeights += wSpell.second;
+
+ TargetedSpell selected;
+ uint32 randNum = urand(0, totalWeights - 1);
+ for (PossibleSpell const& wSpell : spells)
+ {
+ if (selected)
+ {
+ delete wSpell.first.first;
+ continue;
+ }
+
+ if (randNum < wSpell.second)
+ selected = wSpell.first;
+ else
+ {
+ randNum -= wSpell.second;
+ delete wSpell.first.first;
+ }
+ }
+
+ spells.clear();
+ return selected;
+}
+
+void PlayerAI::DoRangedAttackIfReady()
+{
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ if (!me->isAttackReady(RANGED_ATTACK))
+ return;
+
+ Unit* victim = me->GetVictim();
+ if (!victim)
+ return;
+
+ uint32 rangedAttackSpell = 0;
+
+ Item const* rangedItem = me->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED);
+ if (ItemTemplate const* rangedTemplate = rangedItem ? rangedItem->GetTemplate() : nullptr)
+ {
+ switch (rangedTemplate->SubClass)
+ {
+ case ITEM_SUBCLASS_WEAPON_BOW:
+ case ITEM_SUBCLASS_WEAPON_GUN:
+ case ITEM_SUBCLASS_WEAPON_CROSSBOW:
+ rangedAttackSpell = SPELL_SHOOT;
+ break;
+ case ITEM_SUBCLASS_WEAPON_THROWN:
+ rangedAttackSpell = SPELL_THROW;
+ break;
+ case ITEM_SUBCLASS_WEAPON_WAND:
+ rangedAttackSpell = SPELL_SHOOT_WAND;
+ break;
+ }
+ }
+
+ if (!rangedAttackSpell)
+ return;
+
+ me->CastSpell(victim, rangedAttackSpell, TRIGGERED_CAST_DIRECTLY);
+ me->resetAttackTimer(RANGED_ATTACK);
+}
+
+void PlayerAI::DoAutoAttackIfReady()
+{
+ if (IsRangedAttacker())
+ DoRangedAttackIfReady();
+ else
+ DoMeleeAttackIfReady();
+}
+
+void PlayerAI::CancelAllShapeshifts()
+{
+ std::list<AuraEffect*> const& shapeshiftAuras = me->GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT);
+ std::set<Aura*> removableShapeshifts;
+ for (AuraEffect* auraEff : shapeshiftAuras)
+ {
+ Aura* aura = auraEff->GetBase();
+ if (!aura)
+ continue;
+ SpellInfo const* auraInfo = aura->GetSpellInfo();
+ if (!auraInfo)
+ continue;
+ if (auraInfo->HasAttribute(SPELL_ATTR0_CANT_CANCEL))
+ continue;
+ if (!auraInfo->IsPositive() || auraInfo->IsPassive())
+ continue;
+ removableShapeshifts.insert(aura);
+ }
+
+ for (Aura* aura : removableShapeshifts)
+ me->RemoveOwnedAura(aura, AURA_REMOVE_BY_CANCEL);
+}
+
+struct UncontrolledTargetSelectPredicate : public std::unary_function<Unit*, bool>
+{
+ bool operator()(Unit const* target) const
+ {
+ return !target->HasBreakableByDamageCrowdControlAura();
+ }
+};
+Unit* SimpleCharmedPlayerAI::SelectAttackTarget() const
+{
+ if (Unit* charmer = me->GetCharmer())
+ return charmer->IsAIEnabled ? charmer->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 0, UncontrolledTargetSelectPredicate()) : charmer->GetVictim();
+ return nullptr;
+}
+
+PlayerAI::TargetedSpell SimpleCharmedPlayerAI::SelectAppropriateCastForSpec()
+{
+ PossibleSpellVector spells;
+
+ switch (me->getClass())
+ {
+ case CLASS_WARRIOR:
+ if (!me->IsWithinMeleeRange(me->GetVictim()))
+ {
+ VerifyAndPushSpellCast(spells, SPELL_CHARGE, TARGET_VICTIM, 15);
+ VerifyAndPushSpellCast(spells, SPELL_INTERCEPT, TARGET_VICTIM, 10);
+ }
+ VerifyAndPushSpellCast(spells, SPELL_ENRAGED_REGEN, TARGET_NONE, 3);
+ VerifyAndPushSpellCast(spells, SPELL_INTIMIDATING_SHOUT, TARGET_VICTIM, 4);
+ if (me->GetVictim() && me->GetVictim()->HasUnitState(UNIT_STATE_CASTING))
+ {
+ VerifyAndPushSpellCast(spells, SPELL_PUMMEL, TARGET_VICTIM, 15);
+ VerifyAndPushSpellCast(spells, SPELL_SHIELD_BASH, TARGET_VICTIM, 15);
+ }
+ VerifyAndPushSpellCast(spells, SPELL_BLOODRAGE, TARGET_NONE, 5);
+ switch (GetSpec())
+ {
+ case SPEC_WARRIOR_PROTECTION:
+ VerifyAndPushSpellCast(spells, SPELL_SHOCKWAVE, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_CONCUSSION_BLOW, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_DISARM, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_LAST_STAND, TARGET_NONE, 5);
+ VerifyAndPushSpellCast(spells, SPELL_SHIELD_BLOCK, TARGET_NONE, 1);
+ VerifyAndPushSpellCast(spells, SPELL_SHIELD_SLAM, TARGET_VICTIM, 4);
+ VerifyAndPushSpellCast(spells, SPELL_SHIELD_WALL, TARGET_NONE, 5);
+ VerifyAndPushSpellCast(spells, SPELL_SPELL_REFLECTION, TARGET_NONE, 3);
+ VerifyAndPushSpellCast(spells, SPELL_DEVASTATE, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_REND, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_THUNDER_CLAP, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_DEMO_SHOUT, TARGET_VICTIM, 1);
+ break;
+ case SPEC_WARRIOR_ARMS:
+ VerifyAndPushSpellCast(spells, SPELL_SWEEPING_STRIKES, TARGET_NONE, 2);
+ VerifyAndPushSpellCast(spells, SPELL_MORTAL_STRIKE, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_BLADESTORM, TARGET_NONE, 10);
+ VerifyAndPushSpellCast(spells, SPELL_REND, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_RETALIATION, TARGET_NONE, 3);
+ VerifyAndPushSpellCast(spells, SPELL_SHATTERING_THROW, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_SWEEPING_STRIKES, TARGET_NONE, 5);
+ VerifyAndPushSpellCast(spells, SPELL_THUNDER_CLAP, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_EXECUTE, TARGET_VICTIM, 15);
+ break;
+ case SPEC_WARRIOR_FURY:
+ VerifyAndPushSpellCast(spells, SPELL_DEATH_WISH, TARGET_NONE, 10);
+ VerifyAndPushSpellCast(spells, SPELL_BLOODTHIRST, TARGET_VICTIM, 4);
+ VerifyAndPushSpellCast(spells, SPELL_DEMO_SHOUT, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_EXECUTE, TARGET_VICTIM, 15);
+ VerifyAndPushSpellCast(spells, SPELL_HEROIC_FURY, TARGET_NONE, 5);
+ VerifyAndPushSpellCast(spells, SPELL_RECKLESSNESS, TARGET_NONE, 8);
+ VerifyAndPushSpellCast(spells, SPELL_PIERCING_HOWL, TARGET_VICTIM, 2);
+ break;
+ }
+ break;
+ case CLASS_PALADIN:
+ VerifyAndPushSpellCast(spells, SPELL_AURA_MASTERY, TARGET_NONE, 3);
+ VerifyAndPushSpellCast(spells, SPELL_LAY_ON_HANDS, TARGET_CHARMER, 8);
+ VerifyAndPushSpellCast(spells, SPELL_BLESSING_OF_MIGHT, TARGET_CHARMER, 8);
+ VerifyAndPushSpellCast(spells, SPELL_AVENGING_WRATH, TARGET_NONE, 5);
+ VerifyAndPushSpellCast(spells, SPELL_DIVINE_PROTECTION, TARGET_NONE, 4);
+ VerifyAndPushSpellCast(spells, SPELL_DIVINE_SHIELD, TARGET_NONE, 2);
+ VerifyAndPushSpellCast(spells, SPELL_HAMMER_OF_JUSTICE, TARGET_VICTIM, 6);
+ VerifyAndPushSpellCast(spells, SPELL_HAND_OF_FREEDOM, TARGET_SELF, 3);
+ VerifyAndPushSpellCast(spells, SPELL_HAND_OF_PROTECTION, TARGET_SELF, 1);
+ if (Creature* creatureCharmer = ObjectAccessor::GetCreature(*me, me->GetCharmerGUID()))
+ {
+ if (creatureCharmer->IsDungeonBoss() || creatureCharmer->isWorldBoss())
+ VerifyAndPushSpellCast(spells, SPELL_HAND_OF_SACRIFICE, creatureCharmer, 10);
+ else
+ VerifyAndPushSpellCast(spells, SPELL_HAND_OF_PROTECTION, creatureCharmer, 3);
+ }
+
+ switch (GetSpec())
+ {
+ case SPEC_PALADIN_PROTECTION:
+ VerifyAndPushSpellCast(spells, SPELL_HAMMER_OF_RIGHTEOUS, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_DIVINE_SACRIFICE, TARGET_NONE, 2);
+ VerifyAndPushSpellCast(spells, SPELL_SHIELD_OF_RIGHTEOUS, TARGET_VICTIM, 4);
+ VerifyAndPushSpellCast(spells, SPELL_JUDGEMENT, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_CONSECRATION, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_HOLY_SHIELD, TARGET_NONE, 1);
+ break;
+ case SPEC_PALADIN_HOLY:
+ VerifyAndPushSpellCast(spells, SPELL_HOLY_SHOCK, TARGET_CHARMER, 3);
+ VerifyAndPushSpellCast(spells, SPELL_HOLY_SHOCK, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_FLASH_OF_LIGHT, TARGET_CHARMER, 4);
+ VerifyAndPushSpellCast(spells, SPELL_HOLY_LIGHT, TARGET_CHARMER, 3);
+ VerifyAndPushSpellCast(spells, SPELL_DIVINE_FAVOR, TARGET_NONE, 5);
+ VerifyAndPushSpellCast(spells, SPELL_DIVINE_ILLUMINATION, TARGET_NONE, 3);
+ break;
+ case SPEC_PALADIN_RETRIBUTION:
+ VerifyAndPushSpellCast(spells, SPELL_CRUSADER_STRIKE, TARGET_VICTIM, 4);
+ VerifyAndPushSpellCast(spells, SPELL_DIVINE_STORM, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_JUDGEMENT, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_HAMMER_OF_WRATH, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_RIGHTEOUS_FURY, TARGET_NONE, 2);
+ break;
+ }
+ break;
+ case CLASS_HUNTER:
+ VerifyAndPushSpellCast(spells, SPELL_DETERRENCE, TARGET_NONE, 3);
+ VerifyAndPushSpellCast(spells, SPELL_EXPLOSIVE_TRAP, TARGET_NONE, 1);
+ VerifyAndPushSpellCast(spells, SPELL_FREEZING_ARROW, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_RAPID_FIRE, TARGET_NONE, 10);
+ VerifyAndPushSpellCast(spells, SPELL_KILL_SHOT, TARGET_VICTIM, 10);
+ if (me->GetVictim() && me->GetVictim()->getPowerType() == POWER_MANA && !me->GetVictim()->GetAuraApplicationOfRankedSpell(SPELL_VIPER_STING, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_VIPER_STING, TARGET_VICTIM, 5);
+
+ switch (GetSpec())
+ {
+ case SPEC_HUNTER_BEAST_MASTERY:
+ VerifyAndPushSpellCast(spells, SPELL_AIMED_SHOT, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_ARCANE_SHOT, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_STEADY_SHOT, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_MULTI_SHOT, TARGET_VICTIM, 2);
+ break;
+ case SPEC_HUNTER_MARKSMANSHIP:
+ VerifyAndPushSpellCast(spells, SPELL_AIMED_SHOT, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_CHIMERA_SHOT, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_ARCANE_SHOT, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_STEADY_SHOT, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_READINESS, TARGET_NONE, 10);
+ VerifyAndPushSpellCast(spells, SPELL_SILENCING_SHOT, TARGET_VICTIM, 5);
+ break;
+ case SPEC_HUNTER_SURVIVAL:
+ VerifyAndPushSpellCast(spells, SPELL_EXPLOSIVE_SHOT, TARGET_VICTIM, 8);
+ VerifyAndPushSpellCast(spells, SPELL_BLACK_ARROW, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_MULTI_SHOT, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_STEADY_SHOT, TARGET_VICTIM, 1);
+ break;
+ }
+ break;
+ case CLASS_ROGUE:
+ {
+ VerifyAndPushSpellCast(spells, SPELL_DISMANTLE, TARGET_VICTIM, 8);
+ VerifyAndPushSpellCast(spells, SPELL_EVASION, TARGET_NONE, 8);
+ VerifyAndPushSpellCast(spells, SPELL_VANISH, TARGET_NONE, 4);
+ VerifyAndPushSpellCast(spells, SPELL_BLIND, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_CLOAK_OF_SHADOWS, TARGET_NONE, 2);
+
+ uint32 builder = 0, finisher = 0;
+ switch (GetSpec())
+ {
+ case SPEC_ROGUE_ASSASSINATION:
+ builder = SPELL_MUTILATE, finisher = SPELL_ENVENOM;
+ VerifyAndPushSpellCast(spells, SPELL_COLD_BLOOD, TARGET_NONE, 20);
+ break;
+ case SPEC_ROGUE_COMBAT:
+ builder = SPELL_SINISTER_STRIKE, finisher = SPELL_EVISCERATE;
+ VerifyAndPushSpellCast(spells, SPELL_ADRENALINE_RUSH, TARGET_NONE, 6);
+ VerifyAndPushSpellCast(spells, SPELL_BLADE_FLURRY, TARGET_NONE, 5);
+ VerifyAndPushSpellCast(spells, SPELL_KILLING_SPREE, TARGET_NONE, 25);
+ break;
+ case SPEC_ROGUE_SUBLETY:
+ builder = SPELL_HEMORRHAGE, finisher = SPELL_EVISCERATE;
+ VerifyAndPushSpellCast(spells, SPELL_PREPARATION, TARGET_NONE, 10);
+ if (!me->IsWithinMeleeRange(me->GetVictim()))
+ VerifyAndPushSpellCast(spells, SPELL_SHADOWSTEP, TARGET_VICTIM, 25);
+ VerifyAndPushSpellCast(spells, SPELL_SHADOW_DANCE, TARGET_NONE, 10);
+ break;
+ }
+
+ if (Unit* victim = me->GetVictim())
+ {
+ if (victim->HasUnitState(UNIT_STATE_CASTING))
+ VerifyAndPushSpellCast(spells, SPELL_KICK, TARGET_VICTIM, 25);
+
+ uint8 const cp = (me->GetComboTarget() == victim->GetGUID()) ? me->GetComboPoints() : 0;
+ if (cp >= 4)
+ VerifyAndPushSpellCast(spells, finisher, TARGET_VICTIM, 10);
+ if (cp <= 4)
+ VerifyAndPushSpellCast(spells, builder, TARGET_VICTIM, 5);
+ }
+ break;
+ }
+ case CLASS_PRIEST:
+ VerifyAndPushSpellCast(spells, SPELL_FEAR_WARD, TARGET_SELF, 2);
+ VerifyAndPushSpellCast(spells, SPELL_POWER_WORD_FORT, TARGET_CHARMER, 1);
+ VerifyAndPushSpellCast(spells, SPELL_DIVINE_SPIRIT, TARGET_CHARMER, 1);
+ VerifyAndPushSpellCast(spells, SPELL_SHADOW_PROTECTION, TARGET_CHARMER, 2);
+ VerifyAndPushSpellCast(spells, SPELL_DIVINE_HYMN, TARGET_NONE, 5);
+ VerifyAndPushSpellCast(spells, SPELL_HYMN_OF_HOPE, TARGET_NONE, 5);
+ VerifyAndPushSpellCast(spells, SPELL_SHADOW_WORD_DEATH, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_PSYCHIC_SCREAM, TARGET_VICTIM, 3);
+ switch (GetSpec())
+ {
+ case SPEC_PRIEST_DISCIPLINE:
+ VerifyAndPushSpellCast(spells, SPELL_POWER_WORD_SHIELD, TARGET_CHARMER, 3);
+ VerifyAndPushSpellCast(spells, SPELL_INNER_FOCUS, TARGET_NONE, 3);
+ VerifyAndPushSpellCast(spells, SPELL_PAIN_SUPPRESSION, TARGET_CHARMER, 15);
+ VerifyAndPushSpellCast(spells, SPELL_POWER_INFUSION, TARGET_CHARMER, 10);
+ VerifyAndPushSpellCast(spells, SPELL_PENANCE, TARGET_CHARMER, 3);
+ VerifyAndPushSpellCast(spells, SPELL_FLASH_HEAL, TARGET_CHARMER, 1);
+ break;
+ case SPEC_PRIEST_HOLY:
+ VerifyAndPushSpellCast(spells, SPELL_DESPERATE_PRAYER, TARGET_NONE, 3);
+ VerifyAndPushSpellCast(spells, SPELL_GUARDIAN_SPIRIT, TARGET_CHARMER, 5);
+ VerifyAndPushSpellCast(spells, SPELL_FLASH_HEAL, TARGET_CHARMER, 1);
+ VerifyAndPushSpellCast(spells, SPELL_RENEW, TARGET_CHARMER, 3);
+ break;
+ case SPEC_PRIEST_SHADOW:
+ if (!me->HasAura(SPELL_SHADOWFORM))
+ {
+ VerifyAndPushSpellCast(spells, SPELL_SHADOWFORM, TARGET_NONE, 100);
+ break;
+ }
+ if (Unit* victim = me->GetVictim())
+ {
+ if (!victim->GetAuraApplicationOfRankedSpell(SPELL_VAMPIRIC_TOUCH, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_VAMPIRIC_TOUCH, TARGET_VICTIM, 4);
+ if (!victim->GetAuraApplicationOfRankedSpell(SPELL_SHADOW_WORD_PAIN, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_SHADOW_WORD_PAIN, TARGET_VICTIM, 3);
+ if (!victim->GetAuraApplicationOfRankedSpell(SPELL_DEVOURING_PLAGUE, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_DEVOURING_PLAGUE, TARGET_VICTIM, 4);
+ }
+ VerifyAndPushSpellCast(spells, SPELL_MIND_BLAST, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_MIND_FLAY, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_DISPERSION, TARGET_NONE, 10);
+ break;
+ }
+ break;
+ case CLASS_DEATH_KNIGHT:
+ {
+ if (!me->IsWithinMeleeRange(me->GetVictim()))
+ VerifyAndPushSpellCast(spells, SPELL_DEATH_GRIP, TARGET_VICTIM, 25);
+ VerifyAndPushSpellCast(spells, SPELL_STRANGULATE, TARGET_VICTIM, 15);
+ VerifyAndPushSpellCast(spells, SPELL_EMPOWER_RUNE_WEAP, TARGET_NONE, 5);
+ VerifyAndPushSpellCast(spells, SPELL_ICEBORN_FORTITUDE, TARGET_NONE, 15);
+ VerifyAndPushSpellCast(spells, SPELL_ANTI_MAGIC_SHELL, TARGET_NONE, 10);
+
+ bool hasFF = false, hasBP = false;
+ if (Unit* victim = me->GetVictim())
+ {
+ if (victim->HasUnitState(UNIT_STATE_CASTING))
+ VerifyAndPushSpellCast(spells, SPELL_MIND_FREEZE, TARGET_VICTIM, 25);
+
+ hasFF = !!victim->GetAuraApplicationOfRankedSpell(AURA_FROST_FEVER, me->GetGUID()), hasBP = !!victim->GetAuraApplicationOfRankedSpell(AURA_BLOOD_PLAGUE, me->GetGUID());
+ if (hasFF && hasBP)
+ VerifyAndPushSpellCast(spells, SPELL_PESTILENCE, TARGET_VICTIM, 3);
+ if (!hasFF)
+ VerifyAndPushSpellCast(spells, SPELL_ICY_TOUCH, TARGET_VICTIM, 4);
+ if (!hasBP)
+ VerifyAndPushSpellCast(spells, SPELL_PLAGUE_STRIKE, TARGET_VICTIM, 4);
+ }
+ switch (GetSpec())
+ {
+ case SPEC_DEATH_KNIGHT_BLOOD:
+ VerifyAndPushSpellCast(spells, SPELL_RUNE_TAP, TARGET_NONE, 2);
+ VerifyAndPushSpellCast(spells, SPELL_HYSTERIA, TARGET_SELF, 5);
+ if (Creature* creatureCharmer = ObjectAccessor::GetCreature(*me, me->GetCharmerGUID()))
+ if (!creatureCharmer->IsDungeonBoss() && !creatureCharmer->isWorldBoss())
+ VerifyAndPushSpellCast(spells, SPELL_HYSTERIA, creatureCharmer, 15);
+ VerifyAndPushSpellCast(spells, SPELL_HEART_STRIKE, TARGET_VICTIM, 2);
+ if (hasFF && hasBP)
+ VerifyAndPushSpellCast(spells, SPELL_DEATH_STRIKE, TARGET_VICTIM, 8);
+ VerifyAndPushSpellCast(spells, SPELL_DEATH_COIL_DK, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_MARK_OF_BLOOD, TARGET_VICTIM, 20);
+ VerifyAndPushSpellCast(spells, SPELL_VAMPIRIC_BLOOD, TARGET_NONE, 10);
+ break;
+ case SPEC_DEATH_KNIGHT_FROST:
+ if (hasFF && hasBP)
+ VerifyAndPushSpellCast(spells, SPELL_OBLITERATE, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_HOWLING_BLAST, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_UNBREAKABLE_ARMOR, TARGET_NONE, 10);
+ VerifyAndPushSpellCast(spells, SPELL_DEATHCHILL, TARGET_NONE, 10);
+ VerifyAndPushSpellCast(spells, SPELL_FROST_STRIKE, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_BLOOD_STRIKE, TARGET_VICTIM, 1);
+ break;
+ case SPEC_DEATH_KNIGHT_UNHOLY:
+ if (hasFF && hasBP)
+ VerifyAndPushSpellCast(spells, SPELL_SCOURGE_STRIKE, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_DEATH_AND_DECAY, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_ANTI_MAGIC_ZONE, TARGET_NONE, 8);
+ VerifyAndPushSpellCast(spells, SPELL_SUMMON_GARGOYLE, TARGET_VICTIM, 7);
+ VerifyAndPushSpellCast(spells, SPELL_BLOOD_STRIKE, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_DEATH_COIL_DK, TARGET_VICTIM, 3);
+ break;
+ }
+ break;
+ }
+ case CLASS_SHAMAN:
+ VerifyAndPushSpellCast(spells, SPELL_HEROISM, TARGET_NONE, 25);
+ VerifyAndPushSpellCast(spells, SPELL_BLOODLUST, TARGET_NONE, 25);
+ VerifyAndPushSpellCast(spells, SPELL_GROUNDING_TOTEM, TARGET_NONE, 2);
+ switch (GetSpec())
+ {
+ case SPEC_SHAMAN_RESTORATION:
+ if (Unit* charmer = me->GetCharmer())
+ if (!charmer->GetAuraApplicationOfRankedSpell(SPELL_EARTH_SHIELD, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_EARTH_SHIELD, charmer, 2);
+ if (me->HasAura(SPELL_SHA_NATURE_SWIFT))
+ VerifyAndPushSpellCast(spells, SPELL_HEALING_WAVE, TARGET_CHARMER, 20);
+ else
+ VerifyAndPushSpellCast(spells, SPELL_LESSER_HEAL_WAVE, TARGET_CHARMER, 1);
+ VerifyAndPushSpellCast(spells, SPELL_TIDAL_FORCE, TARGET_NONE, 4);
+ VerifyAndPushSpellCast(spells, SPELL_SHA_NATURE_SWIFT, TARGET_NONE, 4);
+ VerifyAndPushSpellCast(spells, SPELL_MANA_TIDE_TOTEM, TARGET_NONE, 3);
+ break;
+ case SPEC_SHAMAN_ELEMENTAL:
+ if (Unit* victim = me->GetVictim())
+ {
+ if (victim->GetAuraOfRankedSpell(SPELL_FLAME_SHOCK, GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_LAVA_BURST, TARGET_VICTIM, 5);
+ else
+ VerifyAndPushSpellCast(spells, SPELL_FLAME_SHOCK, TARGET_VICTIM, 3);
+ }
+ VerifyAndPushSpellCast(spells, SPELL_CHAIN_LIGHTNING, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_LIGHTNING_BOLT, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_ELEMENTAL_MASTERY, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_THUNDERSTORM, TARGET_NONE, 3);
+ break;
+ case SPEC_SHAMAN_ENHANCEMENT:
+ if (Aura const* maelstrom = me->GetAura(AURA_MAELSTROM_WEAPON))
+ if (maelstrom->GetStackAmount() == 5)
+ VerifyAndPushSpellCast(spells, SPELL_LIGHTNING_BOLT, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_STORMSTRIKE, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_EARTH_SHOCK, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_LAVA_LASH, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_SHAMANISTIC_RAGE, TARGET_NONE, 10);
+ break;
+ }
+ break;
+ case CLASS_MAGE:
+ if (me->GetVictim() && me->GetVictim()->HasUnitState(UNIT_STATE_CASTING))
+ VerifyAndPushSpellCast(spells, SPELL_COUNTERSPELL, TARGET_VICTIM, 25);
+ VerifyAndPushSpellCast(spells, SPELL_DAMPEN_MAGIC, TARGET_CHARMER, 2);
+ VerifyAndPushSpellCast(spells, SPELL_EVOCATION, TARGET_NONE, 3);
+ VerifyAndPushSpellCast(spells, SPELL_MANA_SHIELD, TARGET_NONE, 1);
+ VerifyAndPushSpellCast(spells, SPELL_MIRROR_IMAGE, TARGET_NONE, 3);
+ VerifyAndPushSpellCast(spells, SPELL_SPELLSTEAL, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_ICE_BLOCK, TARGET_NONE, 1);
+ VerifyAndPushSpellCast(spells, SPELL_ICY_VEINS, TARGET_NONE, 3);
+ switch (GetSpec())
+ {
+ case SPEC_MAGE_ARCANE:
+ if (Aura* abAura = me->GetAura(AURA_ARCANE_BLAST))
+ if (abAura->GetStackAmount() >= 3)
+ VerifyAndPushSpellCast(spells, SPELL_ARCANE_MISSILES, TARGET_VICTIM, 7);
+ VerifyAndPushSpellCast(spells, SPELL_ARCANE_BLAST, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_ARCANE_BARRAGE, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_ARCANE_POWER, TARGET_NONE, 8);
+ VerifyAndPushSpellCast(spells, SPELL_PRESENCE_OF_MIND, TARGET_NONE, 7);
+ break;
+ case SPEC_MAGE_FIRE:
+ if (me->GetVictim() && !me->GetVictim()->GetAuraApplicationOfRankedSpell(SPELL_LIVING_BOMB))
+ VerifyAndPushSpellCast(spells, SPELL_LIVING_BOMB, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_COMBUSTION, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_FIREBALL, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_FIRE_BLAST, TARGET_VICTIM, 1);
+ VerifyAndPushSpellCast(spells, SPELL_DRAGONS_BREATH, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_BLAST_WAVE, TARGET_VICTIM, 1);
+ break;
+ case SPEC_MAGE_FROST:
+ VerifyAndPushSpellCast(spells, SPELL_DEEP_FREEZE, TARGET_VICTIM, 10);
+ VerifyAndPushSpellCast(spells, SPELL_FROST_NOVA, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_FROSTBOLT, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_COLD_SNAP, TARGET_VICTIM, 5);
+ if (me->GetVictim() && me->GetVictim()->HasAuraState(AURA_STATE_FROZEN, nullptr, me))
+ VerifyAndPushSpellCast(spells, SPELL_ICE_LANCE, TARGET_VICTIM, 5);
+ break;
+ }
+ break;
+ case CLASS_WARLOCK:
+ VerifyAndPushSpellCast(spells, SPELL_DEATH_COIL_W, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_FEAR, TARGET_VICTIM, 2);
+ VerifyAndPushSpellCast(spells, SPELL_SEED_OF_CORRUPTION, TARGET_VICTIM, 4);
+ VerifyAndPushSpellCast(spells, SPELL_HOWL_OF_TERROR, TARGET_NONE, 2);
+ if (me->GetVictim() && !me->GetVictim()->GetAuraApplicationOfRankedSpell(SPELL_CORRUPTION, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_CORRUPTION, TARGET_VICTIM, 10);
+ switch (GetSpec())
+ {
+ case SPEC_WARLOCK_AFFLICTION:
+ if (Unit* victim = me->GetVictim())
+ {
+ VerifyAndPushSpellCast(spells, SPELL_SHADOW_BOLT, TARGET_VICTIM, 7);
+ if (!victim->GetAuraApplicationOfRankedSpell(SPELL_UNSTABLE_AFFLICTION, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_UNSTABLE_AFFLICTION, TARGET_VICTIM, 8);
+ if (!victim->GetAuraApplicationOfRankedSpell(SPELL_HAUNT, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_HAUNT, TARGET_VICTIM, 8);
+ if (!victim->GetAuraApplicationOfRankedSpell(SPELL_CURSE_OF_AGONY, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_CURSE_OF_AGONY, TARGET_VICTIM, 4);
+ if (victim->HealthBelowPct(25))
+ VerifyAndPushSpellCast(spells, SPELL_DRAIN_SOUL, TARGET_VICTIM, 100);
+ }
+ break;
+ case SPEC_WARLOCK_DEMONOLOGY:
+ VerifyAndPushSpellCast(spells, SPELL_METAMORPHOSIS, TARGET_NONE, 15);
+ VerifyAndPushSpellCast(spells, SPELL_SHADOW_BOLT, TARGET_VICTIM, 7);
+ if (me->HasAura(AURA_DECIMATION))
+ VerifyAndPushSpellCast(spells, SPELL_SOUL_FIRE, TARGET_VICTIM, 100);
+ if (me->HasAura(SPELL_METAMORPHOSIS))
+ {
+ VerifyAndPushSpellCast(spells, SPELL_IMMOLATION_AURA, TARGET_NONE, 30);
+ if (!me->IsWithinMeleeRange(me->GetVictim()))
+ VerifyAndPushSpellCast(spells, SPELL_DEMON_CHARGE, TARGET_VICTIM, 20);
+ }
+ if (me->GetVictim() && !me->GetVictim()->GetAuraApplicationOfRankedSpell(SPELL_IMMOLATE, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_IMMOLATE, TARGET_VICTIM, 5);
+ if (me->HasAura(AURA_MOLTEN_CORE))
+ VerifyAndPushSpellCast(spells, SPELL_INCINERATE, TARGET_VICTIM, 10);
+ break;
+ case SPEC_WARLOCK_DESTRUCTION:
+ if (me->GetVictim() && !me->GetVictim()->GetAuraApplicationOfRankedSpell(SPELL_IMMOLATE, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_IMMOLATE, TARGET_VICTIM, 8);
+ if (me->GetVictim() && me->GetVictim()->GetAuraApplicationOfRankedSpell(SPELL_IMMOLATE, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_CONFLAGRATE, TARGET_VICTIM, 8);
+ VerifyAndPushSpellCast(spells, SPELL_SHADOWFURY, TARGET_VICTIM, 5);
+ VerifyAndPushSpellCast(spells, SPELL_CHAOS_BOLT, TARGET_VICTIM, 10);
+ VerifyAndPushSpellCast(spells, SPELL_SHADOWBURN, TARGET_VICTIM, 3);
+ VerifyAndPushSpellCast(spells, SPELL_INCINERATE, TARGET_VICTIM, 7);
+ break;
+ }
+ break;
+ case CLASS_DRUID:
+ VerifyAndPushSpellCast(spells, SPELL_INNERVATE, TARGET_CHARMER, 5);
+ VerifyAndPushSpellCast(spells, SPELL_BARKSKIN, TARGET_NONE, 5);
+ switch (GetSpec())
+ {
+ case SPEC_DRUID_RESTORATION:
+ if (!me->HasAura(SPELL_TREE_OF_LIFE))
+ {
+ CancelAllShapeshifts();
+ VerifyAndPushSpellCast(spells, SPELL_TREE_OF_LIFE, TARGET_NONE, 100);
+ break;
+ }
+ VerifyAndPushSpellCast(spells, SPELL_TRANQUILITY, TARGET_NONE, 10);
+ VerifyAndPushSpellCast(spells, SPELL_NATURE_SWIFTNESS, TARGET_NONE, 7);
+ if (Creature* creatureCharmer = ObjectAccessor::GetCreature(*me, me->GetCharmerGUID()))
+ {
+ VerifyAndPushSpellCast(spells, SPELL_NOURISH, creatureCharmer, 5);
+ VerifyAndPushSpellCast(spells, SPELL_WILD_GROWTH, creatureCharmer, 5);
+ if (!creatureCharmer->GetAuraApplicationOfRankedSpell(SPELL_REJUVENATION, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_REJUVENATION, creatureCharmer, 8);
+ if (!creatureCharmer->GetAuraApplicationOfRankedSpell(SPELL_REGROWTH, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_REGROWTH, creatureCharmer, 8);
+ uint8 lifebloomStacks = 0;
+ if (Aura const* lifebloom = creatureCharmer->GetAura(SPELL_LIFEBLOOM, me->GetGUID()))
+ lifebloomStacks = lifebloom->GetStackAmount();
+ if (lifebloomStacks < 3)
+ VerifyAndPushSpellCast(spells, SPELL_LIFEBLOOM, creatureCharmer, 5);
+ if (creatureCharmer->GetAuraApplicationOfRankedSpell(SPELL_REJUVENATION) ||
+ creatureCharmer->GetAuraApplicationOfRankedSpell(SPELL_REGROWTH))
+ VerifyAndPushSpellCast(spells, SPELL_SWIFTMEND, creatureCharmer, 10);
+ if (me->HasAura(SPELL_NATURE_SWIFTNESS))
+ VerifyAndPushSpellCast(spells, SPELL_HEALING_TOUCH, creatureCharmer, 100);
+ }
+ break;
+ case SPEC_DRUID_BALANCE:
+ {
+ if (!me->HasAura(SPELL_MOONKIN_FORM))
+ {
+ CancelAllShapeshifts();
+ VerifyAndPushSpellCast(spells, SPELL_MOONKIN_FORM, TARGET_NONE, 100);
+ break;
+ }
+ uint32 const mainAttackSpell = me->HasAura(AURA_ECLIPSE_LUNAR) ? SPELL_STARFIRE : SPELL_WRATH;
+ VerifyAndPushSpellCast(spells, SPELL_STARFALL, TARGET_NONE, 20);
+ VerifyAndPushSpellCast(spells, mainAttackSpell, TARGET_VICTIM, 10);
+ if (me->GetVictim() && !me->GetVictim()->GetAuraApplicationOfRankedSpell(SPELL_INSECT_SWARM, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_INSECT_SWARM, TARGET_VICTIM, 7);
+ if (me->GetVictim() && !me->GetVictim()->GetAuraApplicationOfRankedSpell(SPELL_MOONFIRE, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_MOONFIRE, TARGET_VICTIM, 5);
+ if (me->GetVictim() && me->GetVictim()->HasUnitState(UNIT_STATE_CASTING))
+ VerifyAndPushSpellCast(spells, SPELL_TYPHOON, TARGET_NONE, 15);
+ break;
+ }
+ case SPEC_DRUID_FERAL:
+ if (!me->HasAura(SPELL_CAT_FORM))
+ {
+ CancelAllShapeshifts();
+ VerifyAndPushSpellCast(spells, SPELL_CAT_FORM, TARGET_NONE, 100);
+ break;
+ }
+ VerifyAndPushSpellCast(spells, SPELL_BERSERK, TARGET_NONE, 20);
+ VerifyAndPushSpellCast(spells, SPELL_SURVIVAL_INSTINCTS, TARGET_NONE, 15);
+ VerifyAndPushSpellCast(spells, SPELL_TIGER_FURY, TARGET_NONE, 15);
+ VerifyAndPushSpellCast(spells, SPELL_DASH, TARGET_NONE, 5);
+ if (Unit* victim = me->GetVictim())
+ {
+ uint8 const cp = (me->GetComboTarget() == victim->GetGUID()) ? me->GetComboPoints() : 0;
+ if (victim->HasUnitState(UNIT_STATE_CASTING) && cp >= 1)
+ VerifyAndPushSpellCast(spells, SPELL_MAIM, TARGET_VICTIM, 25);
+ if (!me->IsWithinMeleeRange(victim))
+ VerifyAndPushSpellCast(spells, SPELL_FERAL_CHARGE_CAT, TARGET_VICTIM, 25);
+ if (cp >= 4)
+ VerifyAndPushSpellCast(spells, SPELL_RIP, TARGET_VICTIM, 50);
+ if (cp <= 4)
+ {
+ VerifyAndPushSpellCast(spells, SPELL_MANGLE_CAT, TARGET_VICTIM, 10);
+ VerifyAndPushSpellCast(spells, SPELL_CLAW, TARGET_VICTIM, 5);
+ if (!victim->GetAuraApplicationOfRankedSpell(SPELL_RAKE, me->GetGUID()))
+ VerifyAndPushSpellCast(spells, SPELL_RAKE, TARGET_VICTIM, 8);
+ if (!me->HasAura(SPELL_SAVAGE_ROAR))
+ VerifyAndPushSpellCast(spells, SPELL_SAVAGE_ROAR, TARGET_NONE, 15);
+ }
+ }
+ break;
+ }
+ break;
+ }
+
+ return SelectSpellCast(spells);
+}
+
+static const float CASTER_CHASE_DISTANCE = 28.0f;
+void SimpleCharmedPlayerAI::UpdateAI(const uint32 diff)
+{
+ Creature* charmer = me->GetCharmer() ? me->GetCharmer()->ToCreature() : nullptr;
+ if (!charmer)
+ return;
+
+ //kill self if charm aura has infinite duration
+ if (charmer->IsInEvadeMode())
+ {
+ Player::AuraEffectList const& auras = me->GetAuraEffectsByType(SPELL_AURA_MOD_CHARM);
+ for (Player::AuraEffectList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
+ if ((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->GetBase()->IsPermanent())
+ {
+ me->KillSelf();
+ return;
+ }
+ }
+
+ if (charmer->IsInCombat())
+ {
+ Unit* target = me->GetVictim();
+ if (!target || !charmer->IsValidAttackTarget(target) || target->HasBreakableByDamageCrowdControlAura())
+ {
+ target = SelectAttackTarget();
+ if (!target)
+ return;
+
+ if (IsRangedAttacker())
+ {
+ _chaseCloser = !me->IsWithinLOSInMap(target);
+ if (_chaseCloser)
+ AttackStart(target);
+ else
+ AttackStartCaster(target, CASTER_CHASE_DISTANCE);
+ }
+ else
+ AttackStart(target);
+ _forceFacing = true;
+ }
+
+ if (me->IsStopped() && !me->HasUnitState(UNIT_STATE_CANNOT_TURN))
+ {
+ float targetAngle = me->GetAngle(target);
+ if (_forceFacing || fabs(me->GetOrientation() - targetAngle) > 0.4f)
+ {
+ me->SetFacingTo(targetAngle);
+ _forceFacing = false;
+ }
+ }
+
+ if (_castCheckTimer <= diff)
+ {
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ _castCheckTimer = 0;
+ else
+ {
+ if (IsRangedAttacker())
+ { // chase to zero if the target isn't in line of sight
+ bool inLOS = me->IsWithinLOSInMap(target);
+ if (_chaseCloser != !inLOS)
+ {
+ _chaseCloser = !inLOS;
+ if (_chaseCloser)
+ AttackStart(target);
+ else
+ AttackStartCaster(target, CASTER_CHASE_DISTANCE);
+ }
+ }
+ if (TargetedSpell shouldCast = SelectAppropriateCastForSpec())
+ DoCastAtTarget(shouldCast);
+ _castCheckTimer = 500;
+ }
+ }
+ else
+ _castCheckTimer -= diff;
+
+ DoAutoAttackIfReady();
+ }
+ else
+ {
+ me->AttackStop();
+ me->CastStop();
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ }
+}
+
+void SimpleCharmedPlayerAI::OnCharmed(bool apply)
+{
+ if (apply)
+ {
+ me->CastStop();
+ me->AttackStop();
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(0, me->GetPosition(), false); // force re-sync of current position for all clients
+ }
+ else
+ {
+ me->CastStop();
+ me->AttackStop();
+ // @todo only voluntary movement (don't cancel stuff like death grip or charge mid-animation)
+ me->GetMotionMaster()->Clear();
+ me->StopMoving();
+ }
+}
diff --git a/src/server/game/AI/PlayerAI/PlayerAI.h b/src/server/game/AI/PlayerAI/PlayerAI.h
new file mode 100644
index 00000000000..18f65485161
--- /dev/null
+++ b/src/server/game/AI/PlayerAI/PlayerAI.h
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2016-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TRINITY_PLAYERAI_H
+#define TRINITY_PLAYERAI_H
+
+#include "UnitAI.h"
+#include "Player.h"
+#include "Spell.h"
+#include "Creature.h"
+
+class TC_GAME_API PlayerAI : public UnitAI
+{
+ public:
+ explicit PlayerAI(Player* player) : UnitAI(static_cast<Unit*>(player)), me(player), _selfSpec(PlayerAI::GetPlayerSpec(player)), _isSelfHealer(PlayerAI::IsPlayerHealer(player)), _isSelfRangedAttacker(PlayerAI::IsPlayerRangedAttacker(player)) { }
+
+ void OnCharmed(bool /*apply*/) override { } // charm AI application for players is handled by Unit::SetCharmedBy / Unit::RemoveCharmedBy
+
+ // helper functions to determine player info
+ // Return values range from 0 (left-most spec) to 2 (right-most spec). If two specs have the same number of talent points, the left-most of those specs is returned.
+ static uint8 GetPlayerSpec(Player const* who);
+ // Return values range from 0 (left-most spec) to 2 (right-most spec). If two specs have the same number of talent points, the left-most of those specs is returned.
+ uint8 GetSpec(Player const* who = nullptr) const { return (!who || who == me) ? _selfSpec : GetPlayerSpec(who); }
+ static bool IsPlayerHealer(Player const* who);
+ bool IsHealer(Player const* who = nullptr) const { return (!who || who == me) ? _isSelfHealer : IsPlayerHealer(who); }
+ static bool IsPlayerRangedAttacker(Player const* who);
+ bool IsRangedAttacker(Player const* who = nullptr) const { return (!who || who == me) ? _isSelfRangedAttacker : IsPlayerRangedAttacker(who); }
+
+ protected:
+ struct TargetedSpell : public std::pair<Spell*, Unit*>
+ {
+ TargetedSpell() : pair<Spell*, Unit*>() { }
+ TargetedSpell(Spell* first, Unit* second) : pair<Spell*, Unit*>(first, second) { }
+ explicit operator bool() { return !!first; }
+ };
+ typedef std::pair<TargetedSpell, uint32> PossibleSpell;
+ typedef std::vector<PossibleSpell> PossibleSpellVector;
+
+ Player* const me;
+ void SetIsRangedAttacker(bool state) { _isSelfRangedAttacker = state; } // this allows overriding of the default ranged attacker detection
+
+ enum SpellTarget
+ {
+ TARGET_NONE,
+ TARGET_VICTIM,
+ TARGET_CHARMER,
+ TARGET_SELF
+ };
+ /* Check if the specified spell can be cast on that target.
+ Caller is responsible for cleaning up created Spell object from pointer. */
+ TargetedSpell VerifySpellCast(uint32 spellId, Unit* target);
+ /* Check if the specified spell can be cast on that target.
+ Caller is responsible for cleaning up created Spell object from pointer. */
+ TargetedSpell VerifySpellCast(uint32 spellId, SpellTarget target);
+
+ /* Helper method - checks spell cast, then pushes it onto provided vector if valid. */
+ template<typename T> inline void VerifyAndPushSpellCast(PossibleSpellVector& spells, uint32 spellId, T target, uint32 weight)
+ {
+ if (TargetedSpell spell = VerifySpellCast(spellId, target))
+ spells.push_back({ spell,weight });
+ }
+
+ /* Helper method - selects one spell from the vector and returns it, while deleting everything else.
+ This invalidates the vector, and empties it to prevent accidental misuse. */
+ TargetedSpell SelectSpellCast(PossibleSpellVector& spells);
+ /* Helper method - casts the included spell at the included target */
+ inline void DoCastAtTarget(TargetedSpell spell)
+ {
+ SpellCastTargets targets;
+ targets.SetUnitTarget(spell.second);
+ spell.first->prepare(&targets);
+ }
+
+ virtual Unit* SelectAttackTarget() const { return me->GetCharmer() ? me->GetCharmer()->GetVictim() : nullptr; }
+ void DoRangedAttackIfReady();
+ void DoAutoAttackIfReady();
+
+ // Cancels all shapeshifts that the player could voluntarily cancel
+ void CancelAllShapeshifts();
+
+ private:
+ uint8 const _selfSpec;
+ bool const _isSelfHealer;
+ bool _isSelfRangedAttacker;
+};
+
+class SimpleCharmedPlayerAI : public PlayerAI
+{
+ public:
+ SimpleCharmedPlayerAI(Player* player) : PlayerAI(player), _castCheckTimer(500), _chaseCloser(false), _forceFacing(true) { }
+ void UpdateAI(uint32 diff) override;
+ void OnCharmed(bool apply) override;
+
+ protected:
+ Unit* SelectAttackTarget() const override;
+
+ private:
+ TargetedSpell SelectAppropriateCastForSpec();
+ uint32 _castCheckTimer;
+ bool _chaseCloser;
+ bool _forceFacing;
+};
+
+#endif
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index 8a1be33cc2b..316a9704cac 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -32,7 +32,7 @@ struct TSpellSummary
uint8 Effects; // set of enum SelectEffect
} extern* SpellSummary;
-void SummonList::DoZoneInCombat(uint32 entry)
+void SummonList::DoZoneInCombat(uint32 entry, float maxRangeToNearestTarget)
{
for (StorageType::iterator i = storage_.begin(); i != storage_.end();)
{
@@ -41,7 +41,7 @@ void SummonList::DoZoneInCombat(uint32 entry)
if (summon && summon->IsAIEnabled
&& (!entry || summon->GetEntry() == entry))
{
- summon->AI()->DoZoneInCombat();
+ summon->AI()->DoZoneInCombat(nullptr, maxRangeToNearestTarget);
}
}
}
@@ -183,22 +183,22 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
{
//No target so we can't cast
if (!target)
- return NULL;
+ return nullptr;
//Silenced so we can't cast
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
- return NULL;
+ return nullptr;
//Using the extended script system we first create a list of viable spells
- SpellInfo const* apSpell[CREATURE_MAX_SPELLS];
- memset(apSpell, 0, CREATURE_MAX_SPELLS * sizeof(SpellInfo*));
+ SpellInfo const* apSpell[MAX_CREATURE_SPELLS];
+ memset(apSpell, 0, MAX_CREATURE_SPELLS * sizeof(SpellInfo*));
uint32 spellCount = 0;
- SpellInfo const* tempSpell = NULL;
+ SpellInfo const* tempSpell = nullptr;
//Check if each spell is viable(set it to null if not)
- for (uint32 i = 0; i < CREATURE_MAX_SPELLS; i++)
+ for (uint32 i = 0; i < MAX_CREATURE_SPELLS; i++)
{
tempSpell = sSpellMgr->GetSpellInfo(me->m_spells[i]);
@@ -251,7 +251,7 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
//We got our usable spells so now lets randomly pick one
if (!spellCount)
- return NULL;
+ return nullptr;
return apSpell[urand(0, spellCount - 1)];
}
@@ -327,7 +327,7 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
{
- Unit* unit = NULL;
+ Unit* unit = nullptr;
Trinity::MostHPMissingInRange u_check(me, range, minHPDiff);
Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(me, unit, u_check);
me->VisitNearbyObject(range, searcher);
@@ -357,7 +357,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 u
Player* ScriptedAI::GetPlayerAtMinimumRange(float minimumRange)
{
- Player* player = NULL;
+ Player* player = nullptr;
CellCoord pair(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
@@ -507,6 +507,14 @@ void BossAI::_EnterCombat()
ScheduleTasks();
}
+bool BossAI::CanRespawn()
+{
+ if (instance && instance->GetBossState(_bossId) == DONE)
+ return false;
+
+ return true;
+}
+
void BossAI::TeleportCheaters()
{
float x, y, z;
@@ -547,6 +555,39 @@ void BossAI::UpdateAI(uint32 diff)
DoMeleeAttackIfReady();
}
+void BossAI::_DespawnAtEvade(uint32 delayToRespawn, Creature* who)
+{
+ if (delayToRespawn < 2)
+ {
+ TC_LOG_ERROR("scripts", "_DespawnAtEvade called with delay of %u seconds, defaulting to 2.", delayToRespawn);
+ delayToRespawn = 2;
+ }
+
+ if (!who)
+ who = me;
+
+ if (TempSummon* whoSummon = who->ToTempSummon())
+ {
+ TC_LOG_WARN("scripts", "_DespawnAtEvade called on a temporary summon.");
+ whoSummon->UnSummon();
+ return;
+ }
+
+ uint32 corpseDelay = who->GetCorpseDelay();
+ uint32 respawnDelay = who->GetRespawnDelay();
+
+ who->SetCorpseDelay(1);
+ who->SetRespawnDelay(delayToRespawn - 1);
+
+ who->DespawnOrUnsummon();
+
+ who->SetCorpseDelay(corpseDelay);
+ who->SetRespawnDelay(respawnDelay);
+
+ if (instance && who == me)
+ instance->SetBossState(_bossId, FAIL);
+}
+
// WorldBossAI - for non-instanced bosses
WorldBossAI::WorldBossAI(Creature* creature) :
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
index 5a3107cff5d..6a130d8f20f 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
@@ -38,7 +38,7 @@ T* EnsureAI(U* ai)
class InstanceScript;
-class SummonList
+class TC_GAME_API SummonList
{
public:
typedef GuidList StorageType;
@@ -114,7 +114,7 @@ public:
}
}
- void DoZoneInCombat(uint32 entry = 0);
+ void DoZoneInCombat(uint32 entry = 0, float maxRangeToNearestTarget = 250.0f);
void RemoveNotExisting();
bool HasEntry(uint32 entry) const;
@@ -123,7 +123,7 @@ private:
StorageType storage_;
};
-class EntryCheckPredicate
+class TC_GAME_API EntryCheckPredicate
{
public:
EntryCheckPredicate(uint32 entry) : _entry(entry) { }
@@ -133,13 +133,13 @@ class EntryCheckPredicate
uint32 _entry;
};
-class DummyEntryCheckPredicate
+class TC_GAME_API DummyEntryCheckPredicate
{
public:
bool operator()(ObjectGuid) { return true; }
};
-struct ScriptedAI : public CreatureAI
+struct TC_GAME_API ScriptedAI : public CreatureAI
{
explicit ScriptedAI(Creature* creature);
virtual ~ScriptedAI() { }
@@ -334,7 +334,7 @@ struct ScriptedAI : public CreatureAI
bool _isHeroic;
};
-class BossAI : public ScriptedAI
+class TC_GAME_API BossAI : public ScriptedAI
{
public:
BossAI(Creature* creature, uint32 bossId);
@@ -361,12 +361,15 @@ class BossAI : public ScriptedAI
void JustReachedHome() override { _JustReachedHome(); }
bool CanAIAttack(Unit const* target) const override { return CheckBoundary(target); }
+ bool CanRespawn() override;
protected:
void _Reset();
void _EnterCombat();
void _JustDied();
void _JustReachedHome() { me->setActive(false); }
+ void _DespawnAtEvade(uint32 delayToRespawn = 30, Creature* who = nullptr);
+ void _DespawnAtEvade(Seconds const& time, Creature* who = nullptr) { _DespawnAtEvade(uint32(time.count()), who); }
void TeleportCheaters();
@@ -378,7 +381,7 @@ class BossAI : public ScriptedAI
uint32 const _bossId;
};
-class WorldBossAI : public ScriptedAI
+class TC_GAME_API WorldBossAI : public ScriptedAI
{
public:
WorldBossAI(Creature* creature);
@@ -409,10 +412,10 @@ class WorldBossAI : public ScriptedAI
};
// SD2 grid searchers.
-Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive = true);
-GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange);
-void GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
-void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
-void GetPlayerListInGrid(std::list<Player*>& list, WorldObject* source, float maxSearchRange);
+TC_GAME_API Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive = true);
+TC_GAME_API GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange);
+TC_GAME_API void GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
+TC_GAME_API void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
+TC_GAME_API void GetPlayerListInGrid(std::list<Player*>& list, WorldObject* source, float maxSearchRange);
#endif // SCRIPTEDCREATURE_H_
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 68cb8d346d0..1b8b472b805 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -72,7 +72,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who)
return false;
//experimental (unknown) flag not present
- if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS))
+ if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_CAN_ASSIST))
return false;
//not a player
@@ -105,7 +105,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who)
void npc_escortAI::MoveInLineOfSight(Unit* who)
{
- if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
+ if (me->HasReactState(REACT_AGGRESSIVE) && !me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
{
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who))
return;
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
index 673f3e671a0..37a1464d812 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
@@ -49,7 +49,7 @@ enum eEscortState
STATE_ESCORT_PAUSED = 0x004 //will not proceed with waypoints before state is removed
};
-struct npc_escortAI : public ScriptedAI
+struct TC_GAME_API npc_escortAI : public ScriptedAI
{
public:
explicit npc_escortAI(Creature* creature);
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index dc9f6d2681e..bd07e688fb0 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -69,7 +69,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who)
return false;
//experimental (unknown) flag not present
- if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS))
+ if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_CAN_ASSIST))
return false;
//not a player
@@ -102,7 +102,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who)
void FollowerAI::MoveInLineOfSight(Unit* who)
{
- if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
+ if (me->HasReactState(REACT_AGGRESSIVE) && !me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
{
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who))
return;
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
index d1c976b45c8..e17fb7c8507 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
@@ -32,7 +32,7 @@ enum eFollowState
STATE_FOLLOW_POSTEVENT = 0x020 //can be set at complete and allow post event to run
};
-class FollowerAI : public ScriptedAI
+class TC_GAME_API FollowerAI : public ScriptedAI
{
public:
explicit FollowerAI(Creature* creature);
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index eca327e770e..e21f59fe582 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -413,15 +413,10 @@ void SmartAI::EnterEvadeMode(EvadeReason /*why*/)
if (!me->IsAlive() || me->IsInEvadeMode())
return;
- me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE, SPELL_AURA_CLONE_CASTER);
+ me->RemoveAurasOnEvade();
me->AddUnitState(UNIT_STATE_EVADE);
- me->DeleteThreatList();
- me->CombatStop(true);
- me->LoadCreaturesAddon();
- me->SetLootRecipient(NULL);
- me->ResetPlayerDamageReq();
- me->SetLastDamagedTime(0);
+ _EnterEvadeMode();
GetScript()->ProcessEventsFor(SMART_EVENT_EVADE);//must be after aura clear so we can cast spells from db
@@ -466,11 +461,14 @@ bool SmartAI::CanAIAttack(const Unit* /*who*/) const
bool SmartAI::AssistPlayerInCombat(Unit* who)
{
+ if (me->HasReactState(REACT_PASSIVE))
+ return false;
+
if (!who || !who->GetVictim())
return false;
//experimental (unknown) flag not present
- if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS))
+ if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_CAN_ASSIST))
return false;
//not a player
@@ -650,8 +648,8 @@ void SmartAI::OnCharmed(bool apply)
{
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply);
- if (!apply && !me->IsInEvadeMode() && me->GetCharmerGUID())
- if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetCharmerGUID()))
+ if (!apply && !me->IsInEvadeMode())
+ if (Unit* charmer = me->GetCharmer())
AttackStart(charmer);
}
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index 02c057247f6..aa7c9ace0b3 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -42,7 +42,7 @@ enum SmartEscortVars
SMART_MAX_AID_DIST = SMART_ESCORT_MAX_PLAYER_DIST / 2
};
-class SmartAI : public CreatureAI
+class TC_GAME_API SmartAI : public CreatureAI
{
public:
~SmartAI(){ }
@@ -230,7 +230,7 @@ class SmartAI : public CreatureAI
bool mJustReset;
};
-class SmartGameObjectAI : public GameObjectAI
+class TC_GAME_API SmartGameObjectAI : public GameObjectAI
{
public:
SmartGameObjectAI(GameObject* g) : GameObjectAI(g) { }
@@ -257,4 +257,8 @@ class SmartGameObjectAI : public GameObjectAI
private:
SmartScript mScript;
};
+
+/// Registers scripts required by the SAI scripting system
+void AddSC_SmartScripts();
+
#endif
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index c08d1508774..75b9752a193 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -489,7 +489,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
// unless target is outside spell range, out of mana, or LOS.
bool _allowMove = false;
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(e.action.cast.spell);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(e.action.cast.spell);
int32 mana = me->GetPower(POWER_MANA);
if (me->GetDistance(*itr) > spellInfo->GetMaxRange(true) ||
@@ -929,9 +929,21 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
}
- instance->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data);
- TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: Field: %u, data: %u",
- e.action.setInstanceData.field, e.action.setInstanceData.data);
+ switch (e.action.setInstanceData.type)
+ {
+ case 0:
+ instance->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data);
+ TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: SetData Field: %u, data: %u",
+ e.action.setInstanceData.field, e.action.setInstanceData.data);
+ break;
+ case 1:
+ instance->SetBossState(e.action.setInstanceData.field, static_cast<EncounterState>(e.action.setInstanceData.data));
+ TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: SetBossState BossId: %u, State: %u (%s)",
+ e.action.setInstanceData.field, e.action.setInstanceData.data, InstanceScript::GetBossStateName(e.action.setInstanceData.data).c_str());
+ break;
+ default: // Static analysis
+ break;
+ }
break;
}
case SMART_ACTION_SET_INST_DATA64:
@@ -1037,10 +1049,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
target->DespawnOrUnsummon(e.action.forceDespawn.delay);
}
else if (GameObject* goTarget = (*itr)->ToGameObject())
- {
- if (IsSmartGO(goTarget))
- goTarget->SetRespawnTime(e.action.forceDespawn.delay + 1);
- }
+ goTarget->SetRespawnTime(e.action.forceDespawn.delay + 1);
}
delete targets;
@@ -1126,22 +1135,29 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
delete targets;
break;
}
- case SMART_ACTION_MOVE_FORWARD:
+ case SMART_ACTION_MOVE_OFFSET:
{
- if (!me)
- break;
+ if (ObjectList* targets = GetTargets(e, unit))
+ {
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
+ {
+ if (!IsCreature(*itr))
+ continue;
- float x, y, z;
- me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)e.action.moveRandom.distance);
- me->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT, x, y, z);
- break;
- }
- case SMART_ACTION_RISE_UP:
- {
- if (!me)
- break;
+ Position pos = (*itr)->GetPosition();
+
+ // Use forward/backward/left/right cartesian plane movement
+ float x, y, z, o;
+ o = pos.GetOrientation();
+ x = pos.GetPositionX() + (std::cos(o - (M_PI / 2))*e.target.x) + (std::cos(o)*e.target.y);
+ y = pos.GetPositionY() + (std::sin(o - (M_PI / 2))*e.target.x) + (std::sin(o)*e.target.y);
+ z = pos.GetPositionZ() + e.target.z;
+ (*itr)->ToCreature()->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT, x, y, z);
+ }
+
+ delete targets;
+ }
- me->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + (float)e.action.moveRandom.distance);
break;
}
case SMART_ACTION_SET_VISIBILITY:
@@ -1215,18 +1231,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
ObjectList* targets = GetTargets(e, unit);
if (targets)
{
- float x, y, z, o;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
if (!IsUnit(*itr))
continue;
- (*itr)->GetPosition(x, y, z, o);
- x += e.target.x;
- y += e.target.y;
- z += e.target.z;
- o += e.target.o;
- GetBaseObject()->SummonGameObject(e.action.summonGO.entry, x, y, z, o, 0, 0, 0, 0, e.action.summonGO.despawnTime);
+ Position pos = (*itr)->GetPositionWithOffset(Position(e.target.x, e.target.y, e.target.z, e.target.o));
+ GetBaseObject()->SummonGameObject(e.action.summonGO.entry, pos, G3D::Quat(), e.action.summonGO.despawnTime);
}
delete targets;
@@ -1235,7 +1246,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (e.GetTargetType() != SMART_TARGET_POSITION)
break;
- GetBaseObject()->SummonGameObject(e.action.summonGO.entry, e.target.x, e.target.y, e.target.z, e.target.o, 0, 0, 0, 0, e.action.summonGO.despawnTime);
+ GetBaseObject()->SummonGameObject(e.action.summonGO.entry, Position(e.target.x, e.target.y, e.target.z, e.target.o), G3D::Quat(), e.action.summonGO.despawnTime);
break;
}
case SMART_ACTION_KILL_UNIT:
@@ -1483,10 +1494,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (TransportBase* trans = me->GetDirectTransport())
trans->CalculatePassengerPosition(dest.x, dest.y, dest.z);
- me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest.x, dest.y, dest.z);
+ me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest.x, dest.y, dest.z, e.action.MoveToPos.disablePathfinding == 0);
}
else
- me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
+ me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), e.action.MoveToPos.disablePathfinding == 0);
break;
}
case SMART_ACTION_RESPAWN_TARGET:
@@ -2330,6 +2341,21 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
}
}
+ case SMART_ACTION_SET_CORPSE_DELAY:
+ {
+ ObjectList* targets = GetTargets(e, unit);
+ if (!targets)
+ break;
+
+ for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
+ {
+ if (IsCreature(*itr))
+ (*itr)->ToCreature()->SetCorpseDelay(e.action.corpseDelay.timer);
+ }
+
+ delete targets;
+ break;
+ }
default:
TC_LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break;
@@ -2394,7 +2420,7 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e)
AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_SET_RUN, e.action.installTtemplate.param3, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0);
AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_SET_EVENT_PHASE, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0);
- AddEvent(SMART_EVENT_UPDATE, SMART_EVENT_FLAG_NOT_REPEATABLE, 1000, 1000, 0, 0, SMART_ACTION_MOVE_FORWARD, e.action.installTtemplate.param4, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1);
+ AddEvent(SMART_EVENT_UPDATE, SMART_EVENT_FLAG_NOT_REPEATABLE, 1000, 1000, 0, 0, SMART_ACTION_MOVE_OFFSET, 0, 0, 0, 0, 0, 0, SMART_TARGET_SELF, 0, e.action.installTtemplate.param4, 0, 1);
//phase 1: give quest credit on movepoint reached
AddEvent(SMART_EVENT_MOVEMENTINFORM, 0, POINT_MOTION_TYPE, SMART_RANDOM_POINT, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 1);
//phase 1: despawn after time on movepoint reached
@@ -3224,29 +3250,28 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
if (!me)
return;
- WorldObject* creature = NULL;
+ Creature* creature = nullptr;
if (e.event.distance.guid != 0)
{
creature = FindCreatureNear(me, e.event.distance.guid);
-
if (!creature)
return;
- if (!me->IsInRange(creature, 0, (float)e.event.distance.dist))
+ if (!me->IsInRange(creature, 0, static_cast<float>(e.event.distance.dist)))
return;
}
else if (e.event.distance.entry != 0)
{
std::list<Creature*> list;
- me->GetCreatureListWithEntryInGrid(list, e.event.distance.entry, (float)e.event.distance.dist);
+ me->GetCreatureListWithEntryInGrid(list, e.event.distance.entry, static_cast<float>(e.event.distance.dist));
if (!list.empty())
creature = list.front();
}
if (creature)
- ProcessTimedAction(e, e.event.distance.repeat, e.event.distance.repeat);
+ ProcessTimedAction(e, e.event.distance.repeat, e.event.distance.repeat, creature);
break;
}
@@ -3255,29 +3280,28 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
if (!me)
return;
- WorldObject* gameobject = NULL;
+ GameObject* gameobject = nullptr;
if (e.event.distance.guid != 0)
{
gameobject = FindGameObjectNear(me, e.event.distance.guid);
-
if (!gameobject)
return;
- if (!me->IsInRange(gameobject, 0, (float)e.event.distance.dist))
+ if (!me->IsInRange(gameobject, 0, static_cast<float>(e.event.distance.dist)))
return;
}
else if (e.event.distance.entry != 0)
{
std::list<GameObject*> list;
- me->GetGameObjectListWithEntryInGrid(list, e.event.distance.entry, (float)e.event.distance.dist);
+ me->GetGameObjectListWithEntryInGrid(list, e.event.distance.entry, static_cast<float>(e.event.distance.dist));
if (!list.empty())
gameobject = list.front();
}
if (gameobject)
- ProcessTimedAction(e, e.event.distance.repeat, e.event.distance.repeat);
+ ProcessTimedAction(e, e.event.distance.repeat, e.event.distance.repeat, nullptr, 0, 0, false, nullptr, gameobject);
break;
}
@@ -3346,6 +3370,16 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
}
}
+ // Delay flee for assist event if stunned or rooted
+ if (e.GetActionType() == SMART_ACTION_FLEE_FOR_ASSIST)
+ {
+ if (me && me->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
+ {
+ e.timer = 1;
+ return;
+ }
+ }
+
e.active = true;//activate events with cooldown
switch (e.GetEventType())//process ONLY timed events
{
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index e8b89a813b5..a28f2234860 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -28,7 +28,7 @@
#include "SmartScriptMgr.h"
//#include "SmartAI.h"
-class SmartScript
+class TC_GAME_API SmartScript
{
public:
SmartScript();
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index ef3357fa6ed..f0709eb9216 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -19,6 +19,7 @@
#include "ObjectMgr.h"
#include "GridDefines.h"
#include "GridNotifiers.h"
+#include "InstanceScript.h"
#include "SpellMgr.h"
#include "Cell.h"
#include "GameEventMgr.h"
@@ -27,6 +28,12 @@
#include "SmartScriptMgr.h"
+SmartWaypointMgr* SmartWaypointMgr::instance()
+{
+ static SmartWaypointMgr instance;
+ return &instance;
+}
+
void SmartWaypointMgr::LoadFromDB()
{
uint32 oldMSTime = getMSTime();
@@ -98,6 +105,12 @@ SmartWaypointMgr::~SmartWaypointMgr()
}
}
+SmartAIMgr* SmartAIMgr::instance()
+{
+ static SmartAIMgr instance;
+ return &instance;
+}
+
void SmartAIMgr::LoadSmartAIFromDB()
{
LoadHelperStores();
@@ -847,7 +860,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (!IsSpellValid(e, e.action.cast.spell))
return false;
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(e.action.cast.spell);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(e.action.cast.spell);
for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
if (spellInfo->Effects[j].IsEffect(SPELL_EFFECT_KILL_CREDIT) || spellInfo->Effects[j].IsEffect(SPELL_EFFECT_KILL_CREDIT2))
@@ -1144,6 +1157,23 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
}
+ case SMART_ACTION_SET_INST_DATA:
+ {
+ if (e.action.setInstanceData.type > 1)
+ {
+ TC_LOG_ERROR("sql.sql", "Entry %u SourceType %u Event %u Action %u uses invalid data type %u (value range 0-1), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setInstanceData.type);
+ return false;
+ }
+ else if (e.action.setInstanceData.type == 1)
+ {
+ if (e.action.setInstanceData.data > TO_BE_DECIDED)
+ {
+ TC_LOG_ERROR("sql.sql", "Entry %u SourceType %u Event %u Action %u uses invalid boss state %u (value range 0-5), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setInstanceData.data);
+ return false;
+ }
+ }
+ break;
+ }
case SMART_ACTION_START_CLOSEST_WAYPOINT:
case SMART_ACTION_FOLLOW:
case SMART_ACTION_SET_ORIENTATION:
@@ -1161,13 +1191,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_ATTACK_START:
case SMART_ACTION_THREAT_ALL_PCT:
case SMART_ACTION_THREAT_SINGLE_PCT:
- case SMART_ACTION_SET_INST_DATA:
case SMART_ACTION_SET_INST_DATA64:
case SMART_ACTION_AUTO_ATTACK:
case SMART_ACTION_ALLOW_COMBAT_MOVEMENT:
case SMART_ACTION_CALL_FOR_HELP:
case SMART_ACTION_SET_DATA:
- case SMART_ACTION_MOVE_FORWARD:
case SMART_ACTION_SET_VISIBILITY:
case SMART_ACTION_WP_PAUSE:
case SMART_ACTION_SET_FLY:
@@ -1213,7 +1241,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_ADD_GO_FLAG:
case SMART_ACTION_REMOVE_GO_FLAG:
case SMART_ACTION_SUMMON_CREATURE_GROUP:
- case SMART_ACTION_RISE_UP:
+ case SMART_ACTION_MOVE_OFFSET:
+ case SMART_ACTION_SET_CORPSE_DELAY:
break;
default:
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index c0ea648462d..8b55c3e138c 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -469,7 +469,7 @@ enum SMART_ACTION
SMART_ACTION_RANDOM_PHASE_RANGE = 31, // PhaseMin, PhaseMax
SMART_ACTION_RESET_GOBJECT = 32, //
SMART_ACTION_CALL_KILLEDMONSTER = 33, // CreatureId,
- SMART_ACTION_SET_INST_DATA = 34, // Field, Data
+ SMART_ACTION_SET_INST_DATA = 34, // Field, Data, Type (0 = SetData, 1 = SetBossState)
SMART_ACTION_SET_INST_DATA64 = 35, // Field,
SMART_ACTION_UPDATE_TEMPLATE = 36, // Entry
SMART_ACTION_DIE = 37, // No Params
@@ -481,7 +481,6 @@ enum SMART_ACTION
SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL = 43, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to dismount)
SMART_ACTION_SET_INGAME_PHASE_MASK = 44, // mask
SMART_ACTION_SET_DATA = 45, // Field, Data (only creature @todo)
- SMART_ACTION_MOVE_FORWARD = 46, // distance
SMART_ACTION_SET_VISIBILITY = 47, // on/off
SMART_ACTION_SET_ACTIVE = 48, // on/off
SMART_ACTION_ATTACK_START = 49, //
@@ -504,7 +503,7 @@ enum SMART_ACTION
SMART_ACTION_SET_ORIENTATION = 66, //
SMART_ACTION_CREATE_TIMED_EVENT = 67, // id, InitialMin, InitialMax, RepeatMin(only if it repeats), RepeatMax(only if it repeats), chance
SMART_ACTION_PLAYMOVIE = 68, // entry
- SMART_ACTION_MOVE_TO_POS = 69, // PointId, xyz
+ SMART_ACTION_MOVE_TO_POS = 69, // PointId, transport, disablePathfinding
SMART_ACTION_RESPAWN_TARGET = 70, //
SMART_ACTION_EQUIP = 71, // entry, slotmask slot1, slot2, slot3 , only slots with mask set will be sent to client, bits are 1, 2, 4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set
SMART_ACTION_CLOSE_GOSSIP = 72, // none
@@ -549,10 +548,11 @@ enum SMART_ACTION
SMART_ACTION_GAME_EVENT_STOP = 111, // GameEventId
SMART_ACTION_GAME_EVENT_START = 112, // GameEventId
SMART_ACTION_START_CLOSEST_WAYPOINT = 113, // wp1, wp2, wp3, wp4, wp5, wp6, wp7
- SMART_ACTION_RISE_UP = 114, // distance
+ SMART_ACTION_MOVE_OFFSET = 114,
SMART_ACTION_RANDOM_SOUND = 115, // soundId1, soundId2, soundId3, soundId4, soundId5, onlySelf
+ SMART_ACTION_SET_CORPSE_DELAY = 116, // timer
- SMART_ACTION_END = 116
+ SMART_ACTION_END = 117
};
struct SmartAction
@@ -715,6 +715,7 @@ struct SmartAction
{
uint32 field;
uint32 data;
+ uint32 type;
} setInstanceData;
struct
@@ -957,6 +958,7 @@ struct SmartAction
{
uint32 pointId;
uint32 transport;
+ uint32 disablePathfinding;
} MoveToPos;
struct
@@ -1034,6 +1036,11 @@ struct SmartAction
uint32 onlySelf;
} randomSound;
+ struct
+ {
+ uint32 timer;
+ } corpseDelay;
+
//! Note for any new future actions
//! All parameters must have type uint32
@@ -1434,18 +1441,14 @@ public:
};
typedef std::unordered_map<uint32, ObjectGuidList*> ObjectListMap;
-class SmartWaypointMgr
+class TC_GAME_API SmartWaypointMgr
{
private:
SmartWaypointMgr() { }
~SmartWaypointMgr();
public:
- static SmartWaypointMgr* instance()
- {
- static SmartWaypointMgr instance;
- return &instance;
- }
+ static SmartWaypointMgr* instance();
void LoadFromDB();
@@ -1470,18 +1473,14 @@ typedef std::unordered_map<int32, SmartAIEventList> SmartAIEventMap;
typedef std::map<uint32 /*entry*/, std::pair<uint32 /*spellId*/, SpellEffIndex /*effIndex*/> > CacheSpellContainer;
typedef std::pair<CacheSpellContainer::const_iterator, CacheSpellContainer::const_iterator> CacheSpellContainerBounds;
-class SmartAIMgr
+class TC_GAME_API SmartAIMgr
{
private:
SmartAIMgr() { }
~SmartAIMgr() { }
public:
- static SmartAIMgr* instance()
- {
- static SmartAIMgr instance;
- return &instance;
- }
+ static SmartAIMgr* instance();
void LoadSmartAIFromDB();
diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp
index 737e9f37195..fa3e8818fe0 100644
--- a/src/server/game/Accounts/AccountMgr.cpp
+++ b/src/server/game/Accounts/AccountMgr.cpp
@@ -33,17 +33,23 @@ AccountMgr::~AccountMgr()
ClearRBAC();
}
-AccountOpResult AccountMgr::CreateAccount(std::string username, std::string password, std::string email = "")
+AccountMgr* AccountMgr::instance()
+{
+ static AccountMgr instance;
+ return &instance;
+}
+
+AccountOpResult AccountMgr::CreateAccount(std::string username, std::string password, std::string email /*= ""*/)
{
if (utf8length(username) > MAX_ACCOUNT_STR)
- return AOR_NAME_TOO_LONG; // username's too long
+ return AccountOpResult::AOR_NAME_TOO_LONG; // username's too long
- normalizeString(username);
- normalizeString(password);
- normalizeString(email);
+ Utf8ToUpperOnlyLatin(username);
+ Utf8ToUpperOnlyLatin(password);
+ Utf8ToUpperOnlyLatin(email);
if (GetId(username))
- return AOR_NAME_ALREADY_EXIST; // username does already exist
+ return AccountOpResult::AOR_NAME_ALREADY_EXIST; // username does already exist
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT);
@@ -57,7 +63,7 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass
stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_REALM_CHARACTERS_INIT);
LoginDatabase.Execute(stmt);
- return AOR_OK; // everything's fine
+ return AccountOpResult::AOR_OK; // everything's fine
}
AccountOpResult AccountMgr::DeleteAccount(uint32 accountId)
@@ -68,7 +74,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accountId)
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (!result)
- return AOR_NAME_NOT_EXIST;
+ return AccountOpResult::AOR_NAME_NOT_EXIST;
// Obtain accounts characters
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARS_BY_ACCOUNT_ID);
@@ -128,7 +134,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accountId)
LoginDatabase.CommitTransaction(trans);
- return AOR_OK;
+ return AccountOpResult::AOR_OK;
}
AccountOpResult AccountMgr::ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword)
@@ -139,16 +145,16 @@ AccountOpResult AccountMgr::ChangeUsername(uint32 accountId, std::string newUser
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (!result)
- return AOR_NAME_NOT_EXIST;
+ return AccountOpResult::AOR_NAME_NOT_EXIST;
if (utf8length(newUsername) > MAX_ACCOUNT_STR)
- return AOR_NAME_TOO_LONG;
+ return AccountOpResult::AOR_NAME_TOO_LONG;
- if (utf8length(newPassword) > MAX_ACCOUNT_STR)
- return AOR_PASS_TOO_LONG;
+ if (utf8length(newPassword) > MAX_PASS_STR)
+ return AccountOpResult::AOR_PASS_TOO_LONG;
- normalizeString(newUsername);
- normalizeString(newPassword);
+ Utf8ToUpperOnlyLatin(newUsername);
+ Utf8ToUpperOnlyLatin(newPassword);
stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_USERNAME);
@@ -158,7 +164,7 @@ AccountOpResult AccountMgr::ChangeUsername(uint32 accountId, std::string newUser
LoginDatabase.Execute(stmt);
- return AOR_OK;
+ return AccountOpResult::AOR_OK;
}
AccountOpResult AccountMgr::ChangePassword(uint32 accountId, std::string newPassword)
@@ -168,17 +174,17 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accountId, std::string newPass
if (!GetName(accountId, username))
{
sScriptMgr->OnFailedPasswordChange(accountId);
- return AOR_NAME_NOT_EXIST; // account doesn't exist
+ return AccountOpResult::AOR_NAME_NOT_EXIST; // account doesn't exist
}
- if (utf8length(newPassword) > MAX_ACCOUNT_STR)
+ if (utf8length(newPassword) > MAX_PASS_STR)
{
sScriptMgr->OnFailedPasswordChange(accountId);
- return AOR_PASS_TOO_LONG;
+ return AccountOpResult::AOR_PASS_TOO_LONG;
}
- normalizeString(username);
- normalizeString(newPassword);
+ Utf8ToUpperOnlyLatin(username);
+ Utf8ToUpperOnlyLatin(newPassword);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_PASSWORD);
@@ -196,7 +202,7 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accountId, std::string newPass
LoginDatabase.Execute(stmt);
sScriptMgr->OnPasswordChange(accountId);
- return AOR_OK;
+ return AccountOpResult::AOR_OK;
}
AccountOpResult AccountMgr::ChangeEmail(uint32 accountId, std::string newEmail)
@@ -206,17 +212,17 @@ AccountOpResult AccountMgr::ChangeEmail(uint32 accountId, std::string newEmail)
if (!GetName(accountId, username))
{
sScriptMgr->OnFailedEmailChange(accountId);
- return AOR_NAME_NOT_EXIST; // account doesn't exist
+ return AccountOpResult::AOR_NAME_NOT_EXIST; // account doesn't exist
}
if (utf8length(newEmail) > MAX_EMAIL_STR)
{
sScriptMgr->OnFailedEmailChange(accountId);
- return AOR_EMAIL_TOO_LONG;
+ return AccountOpResult::AOR_EMAIL_TOO_LONG;
}
- normalizeString(username);
- normalizeString(newEmail);
+ Utf8ToUpperOnlyLatin(username);
+ Utf8ToUpperOnlyLatin(newEmail);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_EMAIL);
@@ -226,7 +232,7 @@ AccountOpResult AccountMgr::ChangeEmail(uint32 accountId, std::string newEmail)
LoginDatabase.Execute(stmt);
sScriptMgr->OnEmailChange(accountId);
- return AOR_OK;
+ return AccountOpResult::AOR_OK;
}
AccountOpResult AccountMgr::ChangeRegEmail(uint32 accountId, std::string newEmail)
@@ -236,17 +242,17 @@ AccountOpResult AccountMgr::ChangeRegEmail(uint32 accountId, std::string newEmai
if (!GetName(accountId, username))
{
sScriptMgr->OnFailedEmailChange(accountId);
- return AOR_NAME_NOT_EXIST; // account doesn't exist
+ return AccountOpResult::AOR_NAME_NOT_EXIST; // account doesn't exist
}
if (utf8length(newEmail) > MAX_EMAIL_STR)
{
sScriptMgr->OnFailedEmailChange(accountId);
- return AOR_EMAIL_TOO_LONG;
+ return AccountOpResult::AOR_EMAIL_TOO_LONG;
}
- normalizeString(username);
- normalizeString(newEmail);
+ Utf8ToUpperOnlyLatin(username);
+ Utf8ToUpperOnlyLatin(newEmail);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_REG_EMAIL);
@@ -256,7 +262,7 @@ AccountOpResult AccountMgr::ChangeRegEmail(uint32 accountId, std::string newEmai
LoginDatabase.Execute(stmt);
sScriptMgr->OnEmailChange(accountId);
- return AOR_OK;
+ return AccountOpResult::AOR_OK;
}
uint32 AccountMgr::GetId(std::string const& username)
@@ -324,8 +330,8 @@ bool AccountMgr::CheckPassword(uint32 accountId, std::string password)
if (!GetName(accountId, username))
return false;
- normalizeString(username);
- normalizeString(password);
+ Utf8ToUpperOnlyLatin(username);
+ Utf8ToUpperOnlyLatin(password);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD);
stmt->setUInt32(0, accountId);
@@ -343,8 +349,8 @@ bool AccountMgr::CheckEmail(uint32 accountId, std::string newEmail)
if (!GetEmail(accountId, oldEmail))
return false;
- normalizeString(oldEmail);
- normalizeString(newEmail);
+ Utf8ToUpperOnlyLatin(oldEmail);
+ Utf8ToUpperOnlyLatin(newEmail);
if (strcmp(oldEmail.c_str(), newEmail.c_str()) == 0)
return true;
@@ -362,19 +368,6 @@ uint32 AccountMgr::GetCharactersCount(uint32 accountId)
return (result) ? (*result)[0].GetUInt64() : 0;
}
-bool AccountMgr::normalizeString(std::string& utf8String)
-{
- wchar_t buffer[MAX_ACCOUNT_STR+1];
-
- size_t maxLength = MAX_ACCOUNT_STR;
- if (!Utf8toWStr(utf8String, buffer, maxLength))
- return false;
-
- std::transform(&buffer[0], buffer+maxLength, &buffer[0], wcharToUpperOnlyLatin);
-
- return WStrToUtf8(buffer, maxLength, utf8String);
-}
-
std::string AccountMgr::CalculateShaPassHash(std::string const& name, std::string const& password)
{
SHA1Hash sha;
@@ -462,7 +455,7 @@ void AccountMgr::LoadRBAC()
while (result->NextRow());
TC_LOG_DEBUG("rbac", "AccountMgr::LoadRBAC: Loading default permissions");
- result = LoginDatabase.PQuery("SELECT secId, permissionId FROM rbac_default_permissions WHERE (realmId = %u OR realmId = -1) ORDER BY secId ASC", realmID);
+ result = LoginDatabase.PQuery("SELECT secId, permissionId FROM rbac_default_permissions WHERE (realmId = %u OR realmId = -1) ORDER BY secId ASC", realm.Id.Realm);
if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 default permission definitions. DB table `rbac_default_permissions` is empty.");
@@ -494,19 +487,20 @@ void AccountMgr::UpdateAccountAccess(rbac::RBACData* rbac, uint32 accountId, uin
if (rbac && securityLevel == rbac->GetSecurityLevel())
rbac->SetSecurityLevel(securityLevel);
+ SQLTransaction trans = LoginDatabase.BeginTransaction();
// Delete old security level from DB
if (realmId == -1)
{
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS);
stmt->setUInt32(0, accountId);
- LoginDatabase.Execute(stmt);
+ trans->Append(stmt);
}
else
{
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM);
stmt->setUInt32(0, accountId);
stmt->setUInt32(1, realmId);
- LoginDatabase.Execute(stmt);
+ trans->Append(stmt);
}
// Add new security level
@@ -516,8 +510,10 @@ void AccountMgr::UpdateAccountAccess(rbac::RBACData* rbac, uint32 accountId, uin
stmt->setUInt32(0, accountId);
stmt->setUInt8(1, securityLevel);
stmt->setInt32(2, realmId);
- LoginDatabase.Execute(stmt);
+ trans->Append(stmt);
}
+
+ LoginDatabase.CommitTransaction(trans);
}
rbac::RBACPermission const* AccountMgr::GetRBACPermission(uint32 permissionId) const
diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h
index 40ccba1f8e5..f3bb1abe64e 100644
--- a/src/server/game/Accounts/AccountMgr.h
+++ b/src/server/game/Accounts/AccountMgr.h
@@ -21,7 +21,7 @@
#include "RBAC.h"
-enum AccountOpResult
+enum class AccountOpResult : uint8
{
AOR_OK,
AOR_NAME_TOO_LONG,
@@ -39,6 +39,7 @@ enum PasswordChangeSecurity
PW_RBAC
};
+#define MAX_PASS_STR 16
#define MAX_ACCOUNT_STR 16
#define MAX_EMAIL_STR 64
@@ -48,20 +49,16 @@ typedef std::map<uint32, rbac::RBACPermission*> RBACPermissionsContainer;
typedef std::map<uint8, rbac::RBACPermissionContainer> RBACDefaultPermissionsContainer;
}
-class AccountMgr
+class TC_GAME_API AccountMgr
{
private:
AccountMgr();
~AccountMgr();
public:
- static AccountMgr* instance()
- {
- static AccountMgr instance;
- return &instance;
- }
+ static AccountMgr* instance();
- AccountOpResult CreateAccount(std::string username, std::string password, std::string email);
+ AccountOpResult CreateAccount(std::string username, std::string password, std::string email = "");
static AccountOpResult DeleteAccount(uint32 accountId);
static AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword);
static AccountOpResult ChangePassword(uint32 accountId, std::string newPassword);
@@ -78,7 +75,6 @@ class AccountMgr
static uint32 GetCharactersCount(uint32 accountId);
static std::string CalculateShaPassHash(std::string const& name, std::string const& password);
- static bool normalizeString(std::string& utf8String);
static bool IsPlayerAccount(uint32 gmlevel);
static bool IsAdminAccount(uint32 gmlevel);
static bool IsConsoleAccount(uint32 gmlevel);
diff --git a/src/server/game/Accounts/RBAC.cpp b/src/server/game/Accounts/RBAC.cpp
index a8720b66df4..34d7687452c 100644
--- a/src/server/game/Accounts/RBAC.cpp
+++ b/src/server/game/Accounts/RBAC.cpp
@@ -236,10 +236,10 @@ void RBACData::AddPermissions(RBACPermissionContainer const& permsFrom, RBACPerm
permsTo.insert(*itr);
}
-void RBACData::RemovePermissions(RBACPermissionContainer const& permsFrom, RBACPermissionContainer& permsTo)
+void RBACData::RemovePermissions(RBACPermissionContainer& permsFrom, RBACPermissionContainer const& permsToRemove)
{
- for (RBACPermissionContainer::const_iterator itr = permsFrom.begin(); itr != permsFrom.end(); ++itr)
- permsTo.erase(*itr);
+ for (RBACPermissionContainer::const_iterator itr = permsToRemove.begin(); itr != permsToRemove.end(); ++itr)
+ permsFrom.erase(*itr);
}
void RBACData::ExpandPermissions(RBACPermissionContainer& permissions)
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h
index 4ebd3ae7042..741983431dd 100644
--- a/src/server/game/Accounts/RBAC.h
+++ b/src/server/game/Accounts/RBAC.h
@@ -59,9 +59,9 @@ enum RBACPermissions
// 7 - reuse
// 8 - reuse
// 9 - reuse
- // 10 - reuse
+ // 10 - 7.x only
RBAC_PERM_LOG_GM_TRADE = 11,
- // 12 - reuse
+ // 12 - 7.x only
RBAC_PERM_SKIP_CHECK_INSTANCE_REQUIRED_BOSSES = 13,
RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_TEAMMASK = 14,
RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_CLASSMASK = 15,
@@ -540,7 +540,7 @@ enum RBACPermissions
RBAC_PERM_COMMAND_RELOAD_DISENCHANT_LOOT_TEMPLATE = 642,
RBAC_PERM_COMMAND_RELOAD_EVENT_SCRIPTS = 643,
RBAC_PERM_COMMAND_RELOAD_FISHING_LOOT_TEMPLATE = 644,
- RBAC_PERM_COMMAND_RELOAD_GAME_GRAVEYARD_ZONE = 645,
+ RBAC_PERM_COMMAND_RELOAD_GRAVEYARD_ZONE = 645,
RBAC_PERM_COMMAND_RELOAD_GAME_TELE = 646,
RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUESTENDER = 647,
RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUEST_LOOT_TEMPLATE = 648,
@@ -670,8 +670,8 @@ enum RBACPermissions
RBAC_PERM_COMMAND_WP_UNLOAD = 772,
RBAC_PERM_COMMAND_WP_RELOAD = 773,
RBAC_PERM_COMMAND_WP_SHOW = 774,
- RBAC_PERM_COMMAND_MODIFY_CURRENCY = 775, // only 4.3.4
- RBAC_PERM_COMMAND_DEBUG_PHASE = 776, // only 4.3.4
+ RBAC_PERM_COMMAND_MODIFY_CURRENCY = 775, // only 6.x
+ RBAC_PERM_COMMAND_DEBUG_PHASE = 776, // only 6.x
RBAC_PERM_COMMAND_MAILBOX = 777,
RBAC_PERM_COMMAND_AHBOT = 778,
RBAC_PERM_COMMAND_AHBOT_ITEMS = 779,
@@ -697,6 +697,11 @@ enum RBACPermissions
// 799 - 834 6.x only
RBAC_PERM_COMMAND_DEBUG_LOADCELLS = 835,
RBAC_PERM_COMMAND_DEBUG_BOUNDARY = 836,
+ RBAC_PERM_COMMAND_NPC_EVADE = 837,
+ RBAC_PERM_COMMAND_PET_LEVEL = 838,
+ RBAC_PERM_COMMAND_SERVER_SHUTDOWN_FORCE = 839,
+ RBAC_PERM_COMMAND_SERVER_RESTART_FORCE = 840,
+ RBAC_PERM_COMMAND_NEARGRAVEYARD = 841,
// custom permissions 1000+
RBAC_PERM_MAX
@@ -714,7 +719,7 @@ enum RBACCommandResult
typedef std::set<uint32> RBACPermissionContainer;
-class RBACPermission
+class TC_GAME_API RBACPermission
{
public:
RBACPermission(uint32 id = 0, std::string const& name = ""):
@@ -749,7 +754,7 @@ class RBACPermission
* - Granted permissions: through linked permissions and directly assigned
* - Denied permissions: through linked permissions and directly assigned
*/
-class RBACData
+class TC_GAME_API RBACData
{
public:
RBACData(uint32 id, std::string const& name, int32 realmId, uint8 secLevel = 255):
@@ -938,8 +943,8 @@ class RBACData
/// Adds a list of permissions to another list
void AddPermissions(RBACPermissionContainer const& permsFrom, RBACPermissionContainer& permsTo);
- /// Removes a list of permissions to another list
- void RemovePermissions(RBACPermissionContainer const& permsFrom, RBACPermissionContainer& permsTo);
+ /// Removes a list of permissions from another list
+ void RemovePermissions(RBACPermissionContainer& permsFrom, RBACPermissionContainer const& permsToRemove);
/**
* @name ExpandPermissions
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp
index ac8e0298a44..11c2635da33 100644
--- a/src/server/game/Achievements/AchievementMgr.cpp
+++ b/src/server/game/Achievements/AchievementMgr.cpp
@@ -46,7 +46,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
{
if (dataType >= MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` for criteria (Entry: %u) has wrong data type (%u), ignored.", criteria->ID, dataType);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` for criteria (Entry: %u) contains a wrong data type (%u), ignored.", criteria->ID, dataType);
return false;
}
@@ -81,7 +81,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
default:
if (dataType != ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` has data for non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->requiredType);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` contains data for a non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->requiredType);
return false;
}
break;
@@ -96,7 +96,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE:
if (!creature.id || !sObjectMgr->GetCreatureTemplate(creature.id))
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing creature id in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) contains a non-existing creature id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, creature.id);
return false;
}
@@ -104,13 +104,13 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE:
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) contains a non-existing class in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.class_id);
return false;
}
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) contains a non-existing race in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.race_id);
return false;
}
@@ -118,7 +118,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH:
if (health.percent < 1 || health.percent > 100)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) has wrong percent value in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) contains a wrong percent value in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, health.percent);
return false;
}
@@ -126,7 +126,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD:
if (player_dead.own_team_flag > 1)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD (%u) has wrong boolean value1 (%u).",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD (%u) contains a wrong boolean value1 (%u).",
criteria->ID, criteria->requiredType, dataType, player_dead.own_team_flag);
return false;
}
@@ -137,19 +137,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(aura.spell_id);
if (!spellEntry)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell id in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) contains a wrong spell id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id);
return false;
}
if (aura.effect_idx >= 3)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell effect index in value2 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) contains a wrong spell effect index in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.effect_idx);
return false;
}
if (!spellEntry->Effects[aura.effect_idx].ApplyAuraName)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has non-aura spell effect (ID: %u Effect: %u), ignores.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) contains a non-aura spell effect (ID: %u Effect: %u), ignored.",
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id, aura.effect_idx);
return false;
}
@@ -158,7 +158,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA:
if (!sAreaTableStore.LookupEntry(area.id))
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA (%u) has wrong area id in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA (%u) contains a wrong area id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, area.id);
return false;
}
@@ -166,7 +166,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE:
if (value.compType >= COMP_TYPE_MAX)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE (%u) has wrong ComparisionType in value2 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE (%u) contains a wrong ComparisionType in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, value.compType);
return false;
}
@@ -174,7 +174,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL:
if (level.minlevel > STRONG_MAX_LEVEL)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL (%u) has wrong minlevel in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL (%u) contains a wrong minlevel in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, level.minlevel);
return false;
}
@@ -182,7 +182,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER:
if (gender.gender > GENDER_NONE)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER (%u) has wrong gender in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER (%u) contains a wrong gender value in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, gender.gender);
return false;
}
@@ -190,7 +190,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT:
if (!ScriptId)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT (%u) does not have ScriptName set, ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT (%u) does not have a ScriptName set, ignored.",
criteria->ID, criteria->requiredType, dataType);
return false;
}
@@ -198,7 +198,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY:
if (difficulty.difficulty >= MAX_DIFFICULTY)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) has wrong difficulty in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) contains a wrong difficulty value in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, difficulty.difficulty);
return false;
}
@@ -206,7 +206,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT:
if (map_players.maxcount <= 0)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT (%u) has wrong max players count in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT (%u) contains a wrong max players count in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, map_players.maxcount);
return false;
}
@@ -214,7 +214,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM:
if (team.team != ALLIANCE && team.team != HORDE)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) has unknown team in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) contains an unknown team value in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, team.team);
return false;
}
@@ -222,7 +222,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK:
if (drunk.state >= MAX_DRUNKEN)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) has unknown drunken state in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) contains an unknown drunken state value in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, drunk.state);
return false;
}
@@ -230,7 +230,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY:
if (!sHolidaysStore.LookupEntry(holiday.id))
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) has unknown holiday in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) contains an unknown holiday entry in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, holiday.id);
return false;
}
@@ -240,7 +240,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM:
if (equipped_item.item_quality >= MAX_ITEM_QUALITY)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM (%u) has unknown quality state in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM (%u) contains an unknown quality state value in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, equipped_item.item_quality);
return false;
}
@@ -248,7 +248,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID:
if (!sMapStore.LookupEntry(map_id.mapId))
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID (%u) has unknown map id in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID (%u) contains an unknown map id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, map_id.mapId);
return false;
}
@@ -256,19 +256,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE:
if (!classRace.class_id && !classRace.race_id)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) should not have 0 in either value field. Ignored.",
criteria->ID, criteria->requiredType, dataType);
return false;
}
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) contains a non-existing class entry in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.class_id);
return false;
}
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) contains a non-existing race entry in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.race_id);
return false;
}
@@ -276,13 +276,13 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE:
if (!sCharTitlesStore.LookupEntry(known_title.title_id))
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE (%u) have unknown title_id in value1 (%u), ignore.",
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE (%u) contains an unknown title_id in value1 (%u), ignore.",
criteria->ID, criteria->requiredType, dataType, known_title.title_id);
return false;
}
return true;
default:
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) contains data of a non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType);
return false;
}
}
@@ -377,14 +377,14 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
Map* map = source->GetMap();
if (!map->IsDungeon())
{
- TC_LOG_ERROR("achievement", "Achievement system call ACHIEVEMENT_CRITERIA_DATA_TYPE_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u",
+ TC_LOG_ERROR("achievement", "Achievement system call ACHIEVEMENT_CRITERIA_DATA_TYPE_INSTANCE_SCRIPT (%u) for achievement criteria %u in a non-dungeon/non-raid map %u",
dataType, criteria_id, map->GetId());
return false;
}
InstanceScript* instance = map->ToInstanceMap()->GetInstanceScript();
if (!instance)
{
- TC_LOG_ERROR("achievement", "Achievement system call ACHIEVEMENT_CRITERIA_DATA_TYPE_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script",
+ TC_LOG_ERROR("achievement", "Achievement system call ACHIEVEMENT_CRITERIA_DATA_TYPE_INSTANCE_SCRIPT (%u) for achievement criteria %u in map %u, but the map does not have an instance script.",
dataType, criteria_id, map->GetId());
return false;
}
@@ -601,8 +601,8 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ
AchievementCriteriaEntry const* criteria = sAchievementMgr->GetAchievementCriteria(id);
if (!criteria)
{
- // we will remove not existed criteria for all characters
- TC_LOG_ERROR("achievement", "Non-existing achievement criteria %u data removed from table `character_achievement_progress`.", id);
+ // Removing non-existing criteria data for all characters
+ TC_LOG_ERROR("achievement", "Non-existing achievement criteria %u data has been removed from the table `character_achievement_progress`.", id);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA);
@@ -646,13 +646,20 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH))
{
+ uint32 team = GetPlayer()->GetTeam();
+
// broadcast realm first reached
WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, GetPlayer()->GetName().size() + 1 + 8 + 4 + 4);
data << GetPlayer()->GetName();
data << uint64(GetPlayer()->GetGUID());
data << uint32(achievement->ID);
- data << uint32(0); // 1=link supplied string as player name, 0=display plain string
- sWorld->SendGlobalMessage(&data);
+
+ std::size_t linkTypePos = data.wpos();
+ data << uint32(1); // display name as clickable link in chat
+ sWorld->SendGlobalMessage(&data, nullptr, team);
+
+ data.put<uint32>(linkTypePos, 0); // display name as plain string in chat
+ sWorld->SendGlobalMessage(&data, nullptr, team == ALLIANCE ? HORDE : ALLIANCE);
}
// if player is in world he can tell his friends about new achievement
else if (GetPlayer()->IsInWorld())
@@ -1066,7 +1073,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
break;
}
- // std case: not exist in DBC, not triggered in code as result
+ // std case: does not exist in DBC, not triggered in code as result
case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH:
case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER:
case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR:
@@ -1404,7 +1411,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
if (entry->timeLimit)
{
- // has to exist else we wouldn't be here
+ // has to exist, otherwise we wouldn't be here
timedCompleted = IsCompletedCriteria(entry, sAchievementMgr->GetAchievement(entry->referredAchievement));
// Client expects this in packet
timeElapsed = entry->timeLimit - (timedIter->second/IN_MILLISECONDS);
@@ -1533,7 +1540,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
//! Since no common attributes were found, (not even in titleRewardFlags field)
//! we explicitly check by ID. Maybe in the future we could move the achievement_reward
//! condition fields to the condition system.
- if (uint32 titleId = reward->titleId[achievement->ID == 1793 ? GetPlayer()->GetByteValue(PLAYER_BYTES_3, 0) : (GetPlayer()->GetTeam() == ALLIANCE ? 0 : 1)])
+ if (uint32 titleId = reward->titleId[achievement->ID == 1793 ? GetPlayer()->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER) : (GetPlayer()->GetTeam() == ALLIANCE ? 0 : 1)])
if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId))
GetPlayer()->SetTitle(titleEntry);
@@ -1655,14 +1662,14 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria,
if (!RequirementsSatisfied(criteria, achievement, miscValue1, miscValue2, unit))
{
- TC_LOG_TRACE("achievement", "CanUpdateCriteria: (Id: %u Type %s) Requirements not satisfied",
+ TC_LOG_TRACE("achievement", "CanUpdateCriteria: (Id: %u Type %s) Requirements have not been satisfied",
criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->requiredType));
return false;
}
if (!ConditionsSatisfied(criteria))
{
- TC_LOG_TRACE("achievement", "CanUpdateCriteria: (Id: %u Type %s) Conditions not satisfied",
+ TC_LOG_TRACE("achievement", "CanUpdateCriteria: (Id: %u Type %s) Conditions have not been satisfied",
criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->requiredType));
return false;
}
@@ -2246,6 +2253,12 @@ char const* AchievementGlobalMgr::GetCriteriaTypeString(AchievementCriteriaTypes
return "MISSING_TYPE";
}
+AchievementGlobalMgr* AchievementGlobalMgr::instance()
+{
+ static AchievementGlobalMgr instance;
+ return &instance;
+}
+
//==========================================================
void AchievementGlobalMgr::LoadAchievementCriteriaList()
{
@@ -2273,7 +2286,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
++loaded;
}
- TC_LOG_INFO("server.loading", ">> Loaded %u achievement criteria in %u ms", loaded, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u achievement criteria in %u ms.", loaded, GetMSTimeDiffToNow(oldMSTime));
}
void AchievementGlobalMgr::LoadAchievementReferenceList()
@@ -2302,7 +2315,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
if (AchievementEntry const* achievement = sAchievementMgr->GetAchievement(4539))
const_cast<AchievementEntry*>(achievement)->mapID = 631; // Correct map requirement (currently has Ulduar)
- TC_LOG_INFO("server.loading", ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u achievement references in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
void AchievementGlobalMgr::LoadAchievementCriteriaData()
@@ -2330,7 +2343,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
if (!criteria)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` has data for non-existing criteria (Entry: %u), ignore.", criteria_id);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` contains data for non-existing criteria (Entry: %u). Ignored.", criteria_id);
continue;
}
@@ -2340,7 +2353,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
if (scriptName.length()) // not empty
{
if (dataType != ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT)
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` has ScriptName set for non-scripted data type (Entry: %u, type %u), useless data.", criteria_id, dataType);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` contains a ScriptName for non-scripted data type (Entry: %u, type %u), useless data.", criteria_id, dataType);
else
scriptId = sObjectMgr->GetScriptId(scriptName);
}
@@ -2396,7 +2409,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
if (!achievement)
continue;
- // exist many achievements with this criteria, use at this moment hardcoded check to skil simple case
+ // There are many achievements with these criteria, use hardcoded check at this moment to pick a simple case
if (achievement->ID == 1282)
break;
@@ -2433,7 +2446,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
}
if (!GetCriteriaDataSet(criteria) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, entryId, NULL))
- TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` does not have expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` does not contain expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement);
}
TC_LOG_INFO("server.loading", ">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -2459,8 +2472,8 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
const AchievementEntry* achievement = sAchievementMgr->GetAchievement(achievementId);
if (!achievement)
{
- // Remove non existent achievements from all characters
- TC_LOG_ERROR("achievement", "Non-existing achievement %u data removed from table `character_achievement`.", achievementId);
+ // Remove non-existing achievements from all characters
+ TC_LOG_ERROR("achievement", "Non-existing achievement %u data has been removed from the table `character_achievement`.", achievementId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEVMENT);
stmt->setUInt16(0, uint16(achievementId));
@@ -2473,7 +2486,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %lu realm first completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %lu realm first completed achievements in %u ms.", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime));
}
void AchievementGlobalMgr::LoadRewards()
@@ -2500,7 +2513,7 @@ void AchievementGlobalMgr::LoadRewards()
AchievementEntry const* achievement = GetAchievement(entry);
if (!achievement)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` has wrong achievement (Entry: %u), ignored.", entry);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` contains a wrong achievement entry (Entry: %u), ignored.", entry);
continue;
}
@@ -2516,19 +2529,19 @@ void AchievementGlobalMgr::LoadRewards()
// must be title or mail at least
if (!reward.titleId[0] && !reward.titleId[1] && !reward.sender)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) does not have title or item reward data, ignored.", entry);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) does not contain title or item reward data. Ignored.", entry);
continue;
}
if (achievement->requiredFaction == ACHIEVEMENT_FACTION_ANY && (!reward.titleId[0] ^ !reward.titleId[1]))
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) has title (A: %u H: %u) for only one team.", entry, reward.titleId[0], reward.titleId[1]);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) contains the title (A: %u H: %u) for only one team.", entry, reward.titleId[0], reward.titleId[1]);
if (reward.titleId[0])
{
CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(reward.titleId[0]);
if (!titleEntry)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_A`, set to 0", entry, reward.titleId[0]);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) contains an invalid title id (%u) in `title_A`, set to 0", entry, reward.titleId[0]);
reward.titleId[0] = 0;
}
}
@@ -2538,7 +2551,7 @@ void AchievementGlobalMgr::LoadRewards()
CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(reward.titleId[1]);
if (!titleEntry)
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_H`, set to 0", entry, reward.titleId[1]);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) contains an invalid title id (%u) in `title_H`, set to 0", entry, reward.titleId[1]);
reward.titleId[1] = 0;
}
}
@@ -2548,41 +2561,41 @@ void AchievementGlobalMgr::LoadRewards()
{
if (!sObjectMgr->GetCreatureTemplate(reward.sender))
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) has invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) contains an invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender);
reward.sender = 0;
}
}
else
{
if (reward.itemId)
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) does not have sender data but has item reward, item will not be rewarded.", entry);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) does not have sender data, but contains an item reward. Item will not be rewarded.", entry);
if (!reward.subject.empty())
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) does not have sender data but has mail subject.", entry);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) does not have sender data, but contains a mail subject.", entry);
if (!reward.text.empty())
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) does not have sender data but has mail text.", entry);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) does not have sender data, but contains mail text.", entry);
if (reward.mailTemplate)
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) does not have sender data but has mailTemplate.", entry);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) does not have sender data, but has a mailTemplate.", entry);
}
if (reward.mailTemplate)
{
if (!sMailTemplateStore.LookupEntry(reward.mailTemplate))
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) has invalid mailTemplate (%u).", entry, reward.mailTemplate);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) is using an invalid mailTemplate (%u).", entry, reward.mailTemplate);
reward.mailTemplate = 0;
}
else if (!reward.subject.empty() || !reward.text.empty())
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) has mailTemplate (%u) and mail subject/text.", entry, reward.mailTemplate);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) is using mailTemplate (%u) and mail subject/text.", entry, reward.mailTemplate);
}
if (reward.itemId)
{
if (!sObjectMgr->GetItemTemplate(reward.itemId))
{
- TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will not contain item.", entry, reward.itemId);
+ TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) contains an invalid item id %u, reward mail will not contain the rewarded item.", entry, reward.itemId);
reward.itemId = 0;
}
}
@@ -2592,7 +2605,7 @@ void AchievementGlobalMgr::LoadRewards()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u achievement rewards in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
void AchievementGlobalMgr::LoadRewardLocales()
@@ -2607,7 +2620,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
if (!result)
{
- TC_LOG_INFO("server.loading", ">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty");
+ TC_LOG_INFO("server.loading", ">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty.");
return;
}
@@ -2619,7 +2632,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
if (m_achievementRewards.find(entry) == m_achievementRewards.end())
{
- TC_LOG_ERROR("sql.sql", "Table `locales_achievement_reward` (Entry: %u) has locale strings for non-existing achievement reward.", entry);
+ TC_LOG_ERROR("sql.sql", "Table `locales_achievement_reward` (Entry: %u) contains locale strings for a non-existing achievement reward.", entry);
continue;
}
@@ -2634,7 +2647,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u achievement reward locale strings in %u ms", uint32(m_achievementRewardLocales.size()), GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u achievement reward locale strings in %u ms.", uint32(m_achievementRewardLocales.size()), GetMSTimeDiffToNow(oldMSTime));
}
AchievementEntry const* AchievementGlobalMgr::GetAchievement(uint32 achievementId) const
diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h
index cc3fd55bc3a..c4ac5f0e808 100644
--- a/src/server/game/Achievements/AchievementMgr.h
+++ b/src/server/game/Achievements/AchievementMgr.h
@@ -212,7 +212,7 @@ struct AchievementCriteriaData
bool Meets(uint32 criteria_id, Player const* source, Unit const* target, uint32 miscValue1 = 0) const;
};
-struct AchievementCriteriaDataSet
+struct TC_GAME_API AchievementCriteriaDataSet
{
AchievementCriteriaDataSet() : criteria_id(0) { }
typedef std::vector<AchievementCriteriaData> Storage;
@@ -262,7 +262,7 @@ enum ProgressType
PROGRESS_HIGHEST
};
-class AchievementMgr
+class TC_GAME_API AchievementMgr
{
public:
AchievementMgr(Player* player);
@@ -306,7 +306,7 @@ class AchievementMgr
TimedAchievementMap m_timedAchievements; // Criteria id/time left in MS
};
-class AchievementGlobalMgr
+class TC_GAME_API AchievementGlobalMgr
{
AchievementGlobalMgr() { }
~AchievementGlobalMgr() { }
@@ -315,11 +315,7 @@ class AchievementGlobalMgr
static char const* GetCriteriaTypeString(AchievementCriteriaTypes type);
static char const* GetCriteriaTypeString(uint32 type);
- static AchievementGlobalMgr* instance()
- {
- static AchievementGlobalMgr instance;
- return &instance;
- }
+ static AchievementGlobalMgr* instance();
AchievementCriteriaEntryList const& GetAchievementCriteriaByType(AchievementCriteriaTypes type) const
{
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
index 035d9af4369..d9f5388e3ce 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
@@ -44,6 +44,12 @@ AuctionHouseMgr::~AuctionHouseMgr()
delete itr->second;
}
+AuctionHouseMgr* AuctionHouseMgr::instance()
+{
+ static AuctionHouseMgr instance;
+ return &instance;
+}
+
AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId)
{
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
@@ -130,7 +136,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
else
{
bidderAccId = sObjectMgr->GetPlayerAccountIdByGUID(bidderGuid);
- logGmTrade = AccountMgr::HasPermission(bidderAccId, rbac::RBAC_PERM_LOG_GM_TRADE, realmID);
+ logGmTrade = AccountMgr::HasPermission(bidderAccId, rbac::RBAC_PERM_LOG_GM_TRADE, realm.Id.Realm);
if (logGmTrade && !sObjectMgr->GetPlayerNameByGUID(bidderGuid, bidderName))
bidderName = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h
index fe4b9ed07de..42322929a30 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.h
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h
@@ -70,7 +70,7 @@ enum AuctionHouses
AUCTIONHOUSE_NEUTRAL = 7
};
-struct AuctionEntry
+struct TC_GAME_API AuctionEntry
{
uint32 Id;
uint8 houseId;
@@ -101,7 +101,7 @@ struct AuctionEntry
};
//this class is used as auctionhouse instance
-class AuctionHouseObject
+class TC_GAME_API AuctionHouseObject
{
public:
~AuctionHouseObject()
@@ -146,18 +146,14 @@ class AuctionHouseObject
};
-class AuctionHouseMgr
+class TC_GAME_API AuctionHouseMgr
{
private:
AuctionHouseMgr();
~AuctionHouseMgr();
public:
- static AuctionHouseMgr* instance()
- {
- static AuctionHouseMgr instance;
- return &instance;
- }
+ static AuctionHouseMgr* instance();
typedef std::unordered_map<ObjectGuid::LowType, Item*> ItemMap;
typedef std::vector<AuctionEntry*> PlayerAuctions;
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
index e1ba9a64191..74f0aaf428a 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
@@ -24,6 +24,12 @@
#include "AuctionHouseBotBuyer.h"
#include "AuctionHouseBotSeller.h"
+AuctionBotConfig* AuctionBotConfig::instance()
+{
+ static AuctionBotConfig instance;
+ return &instance;
+}
+
bool AuctionBotConfig::Initialize()
{
GetConfigFromFile();
@@ -426,6 +432,12 @@ void AuctionHouseBot::Rebuild(bool all)
}
}
+AuctionHouseBot* AuctionHouseBot::instance()
+{
+ static AuctionHouseBot instance;
+ return &instance;
+}
+
void AuctionHouseBot::Update()
{
// nothing do...
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouseBot/AuctionHouseBot.h
index 87f76a17dcc..1a438e01cdb 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBot.h
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.h
@@ -196,7 +196,7 @@ enum AuctionBotConfigFloatValues
};
// All basic config data used by other AHBot classes for self-configure.
-class AuctionBotConfig
+class TC_GAME_API AuctionBotConfig
{
private:
AuctionBotConfig(): _itemsPerCycleBoost(1000), _itemsPerCycleNormal(20) {}
@@ -205,11 +205,7 @@ private:
AuctionBotConfig& operator=(const AuctionBotConfig&);
public:
- static AuctionBotConfig* instance()
- {
- static AuctionBotConfig instance;
- return &instance;
- }
+ static AuctionBotConfig* instance();
bool Initialize();
const std::string& GetAHBotIncludes() const { return _AHBotIncludes; }
@@ -274,7 +270,7 @@ typedef AuctionHouseBotStatusInfoPerType AuctionHouseBotStatusInfo[MAX_AUCTION_H
// This class handle both Selling and Buying method
// (holder of AuctionBotBuyer and AuctionBotSeller objects)
-class AuctionHouseBot
+class TC_GAME_API AuctionHouseBot
{
private:
AuctionHouseBot();
@@ -283,11 +279,7 @@ private:
AuctionHouseBot& operator=(const AuctionHouseBot&);
public:
- static AuctionHouseBot* instance()
- {
- static AuctionHouseBot instance;
- return &instance;
- }
+ static AuctionHouseBot* instance();
void Update();
void Initialize();
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
index 7f05cd2efd7..6b1dcb85bec 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
@@ -17,7 +17,7 @@
#include "Log.h"
#include "Item.h"
-#include "ItemPrototype.h"
+#include "ItemTemplate.h"
#include "AuctionHouseBotBuyer.h"
AuctionBotBuyer::AuctionBotBuyer() : _checkInterval(20 * MINUTE)
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.h b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.h
index e1b6b425c48..979f73c0099 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.h
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.h
@@ -67,7 +67,7 @@ private:
// This class handle all Buyer method
// (holder of AuctionBotConfig for each auction house type)
-class AuctionBotBuyer : public AuctionBotAgent
+class TC_GAME_API AuctionBotBuyer : public AuctionBotAgent
{
public:
AuctionBotBuyer();
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
index 5acb56b5173..17b104eb388 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
@@ -582,13 +582,13 @@ void AuctionBotSeller::LoadSellerValues(SellerConfiguration& config)
break;
}
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_GRAY, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_GRAY_PRICE_RATIO) / 100);
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_WHITE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_WHITE_PRICE_RATIO) / 100);
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_GREEN, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_GREEN_PRICE_RATIO) / 100);
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_BLUE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_BLUE_PRICE_RATIO) / 100);
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_PURPLE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_PURPLE_PRICE_RATIO) / 100);
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_ORANGE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_ORANGE_PRICE_RATIO) / 100);
- config.SetPriceRatioPerQuality(AUCTION_QUALITY_YELLOW, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_YELLOW_PRICE_RATIO) / 100);
+ config.SetPriceRatioPerQuality(AUCTION_QUALITY_GRAY, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_GRAY_PRICE_RATIO));
+ config.SetPriceRatioPerQuality(AUCTION_QUALITY_WHITE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_WHITE_PRICE_RATIO));
+ config.SetPriceRatioPerQuality(AUCTION_QUALITY_GREEN, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_GREEN_PRICE_RATIO));
+ config.SetPriceRatioPerQuality(AUCTION_QUALITY_BLUE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_BLUE_PRICE_RATIO));
+ config.SetPriceRatioPerQuality(AUCTION_QUALITY_PURPLE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_PURPLE_PRICE_RATIO));
+ config.SetPriceRatioPerQuality(AUCTION_QUALITY_ORANGE, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_ORANGE_PRICE_RATIO));
+ config.SetPriceRatioPerQuality(AUCTION_QUALITY_YELLOW, PriceRatio * sAuctionBotConfig->GetConfig(CONFIG_AHBOT_ITEM_YELLOW_PRICE_RATIO));
config.SetPriceRatioPerClass(ITEM_CLASS_CONSUMABLE, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONSUMABLE_PRICE_RATIO));
config.SetPriceRatioPerClass(ITEM_CLASS_CONTAINER, sAuctionBotConfig->GetConfig(CONFIG_AHBOT_CLASS_CONTAINER_PRICE_RATIO));
@@ -701,10 +701,10 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf
{
uint32 classRatio = config.GetPriceRatioPerClass(ItemClass(itemProto->Class));
uint32 qualityRatio = config.GetPriceRatioPerQuality(AuctionQuality(itemProto->Quality));
- uint32 priceRatio = (classRatio * qualityRatio) / 100;
+ float priceRatio = (classRatio * qualityRatio) / 10000.0f;
- uint32 buyPrice = itemProto->BuyPrice;
- uint32 sellPrice = itemProto->SellPrice;
+ float buyPrice = itemProto->BuyPrice;
+ float sellPrice = itemProto->SellPrice;
if (buyPrice == 0)
{
@@ -712,11 +712,11 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf
buyPrice = sellPrice * GetSellModifier(itemProto);
else
{
- uint32 divisor = ((itemProto->Class == 2 || itemProto->Class == 4) ? 284 : 80);
- uint32 tempLevel = (itemProto->ItemLevel == 0 ? 1 : itemProto->ItemLevel);
- uint32 tempQuality = (itemProto->Quality == 0 ? 1 : itemProto->Quality);
+ float divisor = ((itemProto->Class == ITEM_CLASS_WEAPON || itemProto->Class == ITEM_CLASS_ARMOR) ? 284.0f : 80.0f);
+ float tempLevel = (itemProto->ItemLevel == 0 ? 1.0f : itemProto->ItemLevel);
+ float tempQuality = (itemProto->Quality == 0 ? 1.0f : itemProto->Quality);
- buyPrice = tempLevel * tempQuality * GetBuyModifier(itemProto)* tempLevel / divisor;
+ buyPrice = tempLevel * tempQuality * static_cast<float>(GetBuyModifier(itemProto))* tempLevel / divisor;
}
}
@@ -726,14 +726,15 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf
if (sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BUYPRICE_SELLER))
buyPrice = sellPrice;
- uint32 basePrice = (buyPrice * stackCount * priceRatio) / (itemProto->Class == 6 ? 200 : itemProto->BuyCount) / 100;
- uint32 range = basePrice * 0.04;
+ float basePriceFloat = (buyPrice * stackCount * priceRatio) / (itemProto->Class == 6 ? 200.0f : static_cast<float>(itemProto->BuyCount)) / 100.0f;
+ float range = basePriceFloat * 0.04f;
- buyp = urand(basePrice - range, basePrice + range) + 1;
-
- basePrice = buyp * .5;
+ buyp = static_cast<uint32>(frand(basePriceFloat - range, basePriceFloat + range) + 0.5f);
+ if (buyp == 0)
+ buyp = 1;
+ uint32 basePrice = buyp * .5;
range = buyp * .4;
- bidp = urand(basePrice - range, basePrice + range) + 1;
+ bidp = urand(static_cast<uint32>(basePrice - range + 0.5f), static_cast<uint32>(basePrice + range + 0.5f)) + 1;
}
// Determines the stack size to use for the item
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h
index dd82b0f3dda..3e6f263707f 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.h
@@ -19,7 +19,7 @@
#define AUCTION_HOUSE_BOT_SELLER_H
#include "Define.h"
-#include "ItemPrototype.h"
+#include "ItemTemplate.h"
#include "AuctionHouseBot.h"
struct ItemToSell
@@ -115,7 +115,7 @@ private:
// This class handle all Selling method
// (holder of AHB_Seller_Config data for each auction house type)
-class AuctionBotSeller : public AuctionBotAgent
+class TC_GAME_API AuctionBotSeller : public AuctionBotAgent
{
public:
typedef std::vector<uint32> ItemPool;
diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp
index 34326d09e2f..f44099f6037 100644
--- a/src/server/game/Battlefield/Battlefield.cpp
+++ b/src/server/game/Battlefield/Battlefield.cpp
@@ -285,7 +285,7 @@ void Battlefield::InitStalker(uint32 entry, Position const& pos)
if (Creature* creature = SpawnCreature(entry, pos, TEAM_NEUTRAL))
StalkerGuid = creature->GetGUID();
else
- TC_LOG_ERROR("bg.battlefield", "Battlefield::InitStalker: could not spawn Stalker (Creature entry %u), zone messeges will be un-available", entry);
+ TC_LOG_ERROR("bg.battlefield", "Battlefield::InitStalker: Could not spawn Stalker (Creature entry %u), zone messages will be unavailable!", entry);
}
void Battlefield::KickAfkPlayers()
@@ -544,10 +544,10 @@ BfGraveyard* Battlefield::GetGraveyardById(uint32 id) const
if (BfGraveyard* graveyard = m_GraveyardList.at(id))
return graveyard;
else
- TC_LOG_ERROR("bg.battlefield", "Battlefield::GetGraveyardById Id:%u not existed", id);
+ TC_LOG_ERROR("bg.battlefield", "Battlefield::GetGraveyardById Id:%u does not exist.", id);
}
else
- TC_LOG_ERROR("bg.battlefield", "Battlefield::GetGraveyardById Id:%u cant be found", id);
+ TC_LOG_ERROR("bg.battlefield", "Battlefield::GetGraveyardById Id:%u could not be found.", id);
return NULL;
}
@@ -765,7 +765,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
Map* map = sMapMgr->CreateBaseMap(m_MapId);
if (!map)
{
- TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnCreature: Can't create creature entry: %u map not found", entry);
+ TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnCreature: Can't create creature entry: %u, map not found.", entry);
return nullptr;
}
@@ -782,7 +782,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
if (!cinfo)
{
- TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnCreature: entry %u does not exist.", entry);
+ TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnCreature: Entry %u does not exist.", entry);
return nullptr;
}
@@ -797,18 +797,21 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
GameObject* Battlefield::SpawnGameObject(uint32 entry, float x, float y, float z, float o)
{
// Get map object
- Map* map = sMapMgr->CreateBaseMap(571); // *vomits*
+ Map* map = sMapMgr->CreateBaseMap(m_MapId);
if (!map)
return 0;
+ // Calculate rotation
+ G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(o, 0.f, 0.f);
+
// Create gameobject
GameObject* go = new GameObject;
- if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, PHASEMASK_NORMAL, x, y, z, o, 0, 0, 0, 0, 100, GO_STATE_READY))
+ if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, PHASEMASK_NORMAL, Position(x, y, z, o), rot, 255, GO_STATE_READY))
{
- TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnGameObject: Gameobject template %u not found in database! Battlefield not created!", entry);
- TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnGameObject: Cannot create gameobject template %u! Battlefield not created!", entry);
+ TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnGameObject: Gameobject template %u could not be found in the database! Battlefield has not been created!", entry);
+ TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnGameObject: Could not create gameobject template %u! Battlefield has not been created!", entry);
delete go;
- return NULL;
+ return nullptr;
}
// Add to world
@@ -907,7 +910,7 @@ bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint)
GameObjectTemplate const* goinfo = capturePoint->GetGOInfo();
if (goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT)
{
- TC_LOG_ERROR("misc", "OutdoorPvP: GO %u is not capture point!", capturePoint->GetEntry());
+ TC_LOG_ERROR("misc", "OutdoorPvP: GO %u is not a capture point!", capturePoint->GetEntry());
return false;
}
diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h
index ade3e8c9699..6968e31c7bd 100644
--- a/src/server/game/Battlefield/Battlefield.h
+++ b/src/server/game/Battlefield/Battlefield.h
@@ -67,7 +67,7 @@ class BfGraveyard;
typedef std::vector<BfGraveyard*> GraveyardVect;
typedef std::map<ObjectGuid, time_t> PlayerTimerMap;
-class BfCapturePoint
+class TC_GAME_API BfCapturePoint
{
public:
BfCapturePoint(Battlefield* bf);
@@ -135,7 +135,7 @@ class BfCapturePoint
ObjectGuid m_capturePointGUID;
};
-class BfGraveyard
+class TC_GAME_API BfGraveyard
{
public:
BfGraveyard(Battlefield* Bf);
@@ -182,7 +182,7 @@ class BfGraveyard
Battlefield* m_Bf;
};
-class Battlefield : public ZoneScript
+class TC_GAME_API Battlefield : public ZoneScript
{
friend class BattlefieldMgr;
diff --git a/src/server/game/Battlefield/BattlefieldMgr.cpp b/src/server/game/Battlefield/BattlefieldMgr.cpp
index e4c10d64682..1df87fe1d6f 100644
--- a/src/server/game/Battlefield/BattlefieldMgr.cpp
+++ b/src/server/game/Battlefield/BattlefieldMgr.cpp
@@ -32,6 +32,12 @@ BattlefieldMgr::~BattlefieldMgr()
_battlefieldMap.clear();
}
+BattlefieldMgr* BattlefieldMgr::instance()
+{
+ static BattlefieldMgr instance;
+ return &instance;
+}
+
void BattlefieldMgr::InitBattlefield()
{
Battlefield* wg = new BattlefieldWG();
diff --git a/src/server/game/Battlefield/BattlefieldMgr.h b/src/server/game/Battlefield/BattlefieldMgr.h
index fabb33ae359..2f2af12927e 100644
--- a/src/server/game/Battlefield/BattlefieldMgr.h
+++ b/src/server/game/Battlefield/BattlefieldMgr.h
@@ -24,14 +24,10 @@ class Player;
class ZoneScript;
// class to handle player enter / leave / areatrigger / GO use events
-class BattlefieldMgr
+class TC_GAME_API BattlefieldMgr
{
public:
- static BattlefieldMgr* instance()
- {
- static BattlefieldMgr instance;
- return &instance;
- }
+ static BattlefieldMgr* instance();
// create battlefield events
void InitBattlefield();
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h
index e5cc392cef3..52789d38d8e 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.h
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h
@@ -266,7 +266,7 @@ class WintergraspCapturePoint : public BfCapturePoint
* WinterGrasp Battlefield *
* ######################### */
-class BattlefieldWG : public Battlefield
+class TC_GAME_API BattlefieldWG : public Battlefield
{
public:
~BattlefieldWG();
@@ -1098,7 +1098,7 @@ StaticWintergraspWorkshopInfo const WorkshopData[WG_MAX_WORKSHOP] =
// ********************************************************************
// Structure for different buildings that can be destroyed during battle
-struct BfWGGameObjectBuilding
+struct TC_GAME_API BfWGGameObjectBuilding
{
private:
// WG object
@@ -1150,7 +1150,7 @@ public:
};
// Structure for the 6 workshop
-struct WintergraspWorkshop
+struct TC_GAME_API WintergraspWorkshop
{
private:
BattlefieldWG* _wg; // Pointer to wintergrasp
diff --git a/src/server/game/Battlegrounds/Arena.h b/src/server/game/Battlegrounds/Arena.h
index 863f1fc8c6f..1fe99f1f414 100644
--- a/src/server/game/Battlegrounds/Arena.h
+++ b/src/server/game/Battlegrounds/Arena.h
@@ -36,7 +36,7 @@ enum ArenaWorldStates
ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD = 3601
};
-class Arena : public Battleground
+class TC_GAME_API Arena : public Battleground
{
protected:
Arena();
diff --git a/src/server/game/Battlegrounds/ArenaScore.h b/src/server/game/Battlegrounds/ArenaScore.h
index c2d9d18c00b..9427a108565 100644
--- a/src/server/game/Battlegrounds/ArenaScore.h
+++ b/src/server/game/Battlegrounds/ArenaScore.h
@@ -21,7 +21,7 @@
#include "BattlegroundScore.h"
#include "SharedDefines.h"
-struct ArenaScore : public BattlegroundScore
+struct TC_GAME_API ArenaScore : public BattlegroundScore
{
friend class Arena;
@@ -56,7 +56,7 @@ struct ArenaScore : public BattlegroundScore
uint8 TeamId; // BattlegroundTeamId
};
-struct ArenaTeamScore
+struct TC_GAME_API ArenaTeamScore
{
friend class Arena;
friend class Battleground;
diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h
index f27c3761bde..7e9f490bff9 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.h
+++ b/src/server/game/Battlegrounds/ArenaTeam.h
@@ -85,7 +85,7 @@ enum ArenaTeamTypes
ARENA_TEAM_5v5 = 5
};
-struct ArenaTeamMember
+struct TC_GAME_API ArenaTeamMember
{
ObjectGuid Guid;
std::string Name;
@@ -113,7 +113,7 @@ struct ArenaTeamStats
#define MAX_ARENA_SLOT 3 // 0..2 slots
-class ArenaTeam
+class TC_GAME_API ArenaTeam
{
public:
ArenaTeam();
diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
index b838131fd03..37e26d7e448 100644
--- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
@@ -35,6 +35,12 @@ ArenaTeamMgr::~ArenaTeamMgr()
delete itr->second;
}
+ArenaTeamMgr* ArenaTeamMgr::instance()
+{
+ static ArenaTeamMgr instance;
+ return &instance;
+}
+
// Arena teams collection
ArenaTeam* ArenaTeamMgr::GetArenaTeamById(uint32 arenaTeamId) const
{
@@ -93,7 +99,7 @@ void ArenaTeamMgr::LoadArenaTeams()
uint32 oldMSTime = getMSTime();
// Clean out the trash before loading anything
- CharacterDatabase.Execute("DELETE FROM arena_team_member WHERE arenaTeamId NOT IN (SELECT arenaTeamId FROM arena_team)"); // One-time query
+ CharacterDatabase.DirectExecute("DELETE FROM arena_team_member WHERE arenaTeamId NOT IN (SELECT arenaTeamId FROM arena_team)"); // One-time query
// 0 1 2 3 4 5 6 7 8
QueryResult result = CharacterDatabase.Query("SELECT arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor, "
diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.h b/src/server/game/Battlegrounds/ArenaTeamMgr.h
index 432a4ff598f..7f6800bd71b 100644
--- a/src/server/game/Battlegrounds/ArenaTeamMgr.h
+++ b/src/server/game/Battlegrounds/ArenaTeamMgr.h
@@ -20,18 +20,14 @@
#include "ArenaTeam.h"
-class ArenaTeamMgr
+class TC_GAME_API ArenaTeamMgr
{
private:
ArenaTeamMgr();
~ArenaTeamMgr();
public:
- static ArenaTeamMgr* instance()
- {
- static ArenaTeamMgr instance;
- return &instance;
- }
+ static ArenaTeamMgr* instance();
typedef std::unordered_map<uint32, ArenaTeam*> ArenaTeamContainer;
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 100e2e6c7cc..2e66c587e15 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -283,8 +283,12 @@ inline void Battleground::_CheckSafePositions(uint32 diff)
m_ValidStartPositionTimer = 0;
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
+ {
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
{
+ if (player->IsGameMaster())
+ continue;
+
Position pos = player->GetPosition();
Position const* startPos = GetTeamStartPosition(Battleground::GetTeamIndexByTeamId(player->GetBGTeam()));
if (pos.GetExactDistSq(startPos) > maxDist)
@@ -293,6 +297,7 @@ inline void Battleground::_CheckSafePositions(uint32 diff)
player->TeleportTo(GetMapId(), startPos->GetPositionX(), startPos->GetPositionY(), startPos->GetPositionZ(), startPos->GetOrientation());
}
}
+ }
}
}
@@ -1345,12 +1350,22 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
Map* map = FindBgMap();
if (!map)
return false;
+
+ G3D::Quat rot(rotation0, rotation1, rotation2, rotation3);
+ // Temporally add safety check for bad spawns and send log (object rotations need to be rechecked in sniff)
+ if (!rotation0 && !rotation1 && !rotation2 && !rotation3)
+ {
+ TC_LOG_DEBUG("bg.battleground", "Battleground::AddObject: gameoobject [entry: %u, object type: %u] for BG (map: %u) has zeroed rotation fields, "
+ "orientation used temporally, but please fix the spawn", entry, type, m_MapId);
+
+ rot = G3D::Matrix3::fromEulerAnglesZYX(o, 0.f, 0.f);
+ }
+
// Must be created this way, adding to godatamap would add it to the base map of the instance
// and when loading it (in go::LoadFromDB()), a new guid would be assigned to the object, and a new object would be created
// So we must create it specific for this instance
GameObject* go = new GameObject;
- if (!go->Create(GetBgMap()->GenerateLowGuid<HighGuid::GameObject>(), entry, GetBgMap(),
- PHASEMASK_NORMAL, x, y, z, o, rotation0, rotation1, rotation2, rotation3, 100, goState))
+ if (!go->Create(GetBgMap()->GenerateLowGuid<HighGuid::GameObject>(), entry, GetBgMap(), PHASEMASK_NORMAL, Position(x, y, z, o), rot, 255, goState))
{
TC_LOG_ERROR("bg.battleground", "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h
index 03f138a5a8b..bb6ae360536 100644
--- a/src/server/game/Battlegrounds/Battleground.h
+++ b/src/server/game/Battlegrounds/Battleground.h
@@ -221,7 +221,7 @@ This class is used to:
3. some certain cases, same for all battlegrounds
4. It has properties same for all battlegrounds
*/
-class Battleground
+class TC_GAME_API Battleground
{
public:
Battleground();
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index 062d4702d43..683547ef3fc 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -76,6 +76,12 @@ void BattlegroundMgr::DeleteAllBattlegrounds()
bgDataStore.clear();
}
+BattlegroundMgr* BattlegroundMgr::instance()
+{
+ static BattlegroundMgr instance;
+ return &instance;
+}
+
// used to update running battlegrounds, and delete finished ones
void BattlegroundMgr::Update(uint32 diff)
{
@@ -536,7 +542,7 @@ void BattlegroundMgr::LoadBattlegroundTemplates()
BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId);
if (!bl)
{
- TC_LOG_ERROR("bg.battleground", "Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeId);
+ TC_LOG_ERROR("bg.battleground", "Battleground ID %u could not be found in BattlemasterList.dbc. The battleground was not created.", bgTypeId);
continue;
}
@@ -554,14 +560,14 @@ void BattlegroundMgr::LoadBattlegroundTemplates()
if (bgTemplate.MaxPlayersPerTeam == 0 || bgTemplate.MinPlayersPerTeam > bgTemplate.MaxPlayersPerTeam)
{
- TC_LOG_ERROR("sql.sql", "Table `battleground_template` for id %u has bad values for MinPlayersPerTeam (%u) and MaxPlayersPerTeam(%u)",
+ TC_LOG_ERROR("sql.sql", "Table `battleground_template` for id %u contains bad values for MinPlayersPerTeam (%u) and MaxPlayersPerTeam(%u).",
bgTemplate.Id, bgTemplate.MinPlayersPerTeam, bgTemplate.MaxPlayersPerTeam);
continue;
}
if (bgTemplate.MinLevel == 0 || bgTemplate.MaxLevel == 0 || bgTemplate.MinLevel > bgTemplate.MaxLevel)
{
- TC_LOG_ERROR("sql.sql", "Table `battleground_template` for id %u has bad values for MinLevel (%u) and MaxLevel (%u)",
+ TC_LOG_ERROR("sql.sql", "Table `battleground_template` for id %u contains bad values for MinLevel (%u) and MaxLevel (%u).",
bgTemplate.Id, bgTemplate.MinLevel, bgTemplate.MaxLevel);
continue;
}
@@ -575,7 +581,7 @@ void BattlegroundMgr::LoadBattlegroundTemplates()
}
else
{
- TC_LOG_ERROR("sql.sql", "Table `battleground_template` for id %u has non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", bgTemplate.Id, startId);
+ TC_LOG_ERROR("sql.sql", "Table `battleground_template` for id %u contains a non-existing WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", bgTemplate.Id, startId);
continue;
}
@@ -586,7 +592,7 @@ void BattlegroundMgr::LoadBattlegroundTemplates()
}
else
{
- TC_LOG_ERROR("sql.sql", "Table `battleground_template` for id %u has non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", bgTemplate.Id, startId);
+ TC_LOG_ERROR("sql.sql", "Table `battleground_template` for id %u contains a non-existing WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", bgTemplate.Id, startId);
continue;
}
}
@@ -788,7 +794,7 @@ BattlegroundTypeId BattlegroundMgr::BGTemplateId(BattlegroundQueueTypeId bgQueue
case BATTLEGROUND_QUEUE_5v5:
return BATTLEGROUND_AA;
default:
- return BattlegroundTypeId(0); // used for unknown template (it existed and do nothing)
+ return BattlegroundTypeId(0); // used for unknown template (it exists and does nothing)
}
}
@@ -892,7 +898,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
uint32 bgTypeId = fields[1].GetUInt32();
if (!sBattlemasterListStore.LookupEntry(bgTypeId))
{
- TC_LOG_ERROR("sql.sql", "Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.", entry, bgTypeId);
+ TC_LOG_ERROR("sql.sql", "Table `battlemaster_entry` contains entry %u for a non-existing battleground type %u, ignored.", entry, bgTypeId);
continue;
}
@@ -912,7 +918,7 @@ void BattlegroundMgr::CheckBattleMasters()
{
if ((itr->second.npcflag & UNIT_NPC_FLAG_BATTLEMASTER) && mBattleMastersMap.find(itr->second.Entry) == mBattleMastersMap.end())
{
- TC_LOG_ERROR("sql.sql", "CreatureTemplate (Entry: %u) has UNIT_NPC_FLAG_BATTLEMASTER but no data in `battlemaster_entry` table. Removing flag!", itr->second.Entry);
+ TC_LOG_ERROR("sql.sql", "Creature_Template Entry: %u has UNIT_NPC_FLAG_BATTLEMASTER, but no data in the `battlemaster_entry` table. Removing flag.", itr->second.Entry);
const_cast<CreatureTemplate*>(&itr->second)->npcflag &= ~UNIT_NPC_FLAG_BATTLEMASTER;
}
}
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h
index 595745e53fb..dbba964d4b3 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.h
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.h
@@ -55,18 +55,14 @@ struct BattlegroundTemplate
bool IsArena() const { return BattlemasterEntry->type == MAP_ARENA; }
};
-class BattlegroundMgr
+class TC_GAME_API BattlegroundMgr
{
private:
BattlegroundMgr();
~BattlegroundMgr();
public:
- static BattlegroundMgr* instance()
- {
- static BattlegroundMgr instance;
- return &instance;
- }
+ static BattlegroundMgr* instance();
void Update(uint32 diff);
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index 34588c7e380..796afe472fe 100644
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -161,9 +161,9 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr
//announce world (this don't need mutex)
if (isRated && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
{
- ArenaTeam* Team = sArenaTeamMgr->GetArenaTeamById(arenateamid);
- if (Team)
- sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
+ ArenaTeam* team = sArenaTeamMgr->GetArenaTeamById(arenateamid);
+ if (team)
+ sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
}
//add players from group to ginfo
@@ -354,8 +354,8 @@ void BattlegroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
// announce to world if arena team left queue for rated match, show only once
if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
- if (ArenaTeam* Team = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId))
- sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating);
+ if (ArenaTeam* team = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId))
+ sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating);
// if player leaves queue and he is invited to rated arena match, then he have to lose
if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount)
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.h b/src/server/game/Battlegrounds/BattlegroundQueue.h
index 31f108053d9..f56ccb9bdbf 100644
--- a/src/server/game/Battlegrounds/BattlegroundQueue.h
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.h
@@ -72,7 +72,7 @@ enum BattlegroundQueueInvitationType
};
class Battleground;
-class BattlegroundQueue
+class TC_GAME_API BattlegroundQueue
{
public:
BattlegroundQueue();
@@ -142,7 +142,7 @@ class BattlegroundQueue
This class is used to invite player to BG again, when minute lasts from his first invitation
it is capable to solve all possibilities
*/
-class BGQueueInviteEvent : public BasicEvent
+class TC_GAME_API BGQueueInviteEvent : public BasicEvent
{
public:
BGQueueInviteEvent(ObjectGuid pl_guid, uint32 BgInstanceGUID, BattlegroundTypeId BgTypeId, uint8 arenaType, uint32 removeTime) :
@@ -165,7 +165,7 @@ class BGQueueInviteEvent : public BasicEvent
We must store removeInvite time in case player left queue and joined and is invited again
We must store bgQueueTypeId, because battleground can be deleted already, when player entered it
*/
-class BGQueueRemoveEvent : public BasicEvent
+class TC_GAME_API BGQueueRemoveEvent : public BasicEvent
{
public:
BGQueueRemoveEvent(ObjectGuid pl_guid, uint32 bgInstanceGUID, BattlegroundTypeId BgTypeId, BattlegroundQueueTypeId bgQueueTypeId, uint32 removeTime)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
index 626bcacbf27..e52106a8efe 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
@@ -171,7 +171,7 @@ void BattlegroundEY::CheckSomeoneJoinedPoint()
Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
if (!player)
{
- TC_LOG_ERROR("bg.battleground", "BattlegroundEY:CheckSomeoneJoinedPoint: Player (%s) not found!", m_PlayersNearPoint[EY_POINTS_MAX][j].ToString().c_str());
+ TC_LOG_ERROR("bg.battleground", "BattlegroundEY:CheckSomeoneJoinedPoint: Player (%s) could not be found!", m_PlayersNearPoint[EY_POINTS_MAX][j].ToString().c_str());
++j;
continue;
}
@@ -212,8 +212,8 @@ void BattlegroundEY::CheckSomeoneLeftPoint()
Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[i][j]);
if (!player)
{
- TC_LOG_ERROR("bg.battleground", "BattlegroundEY:CheckSomeoneLeftPoint Player (%s) not found!", m_PlayersNearPoint[i][j].ToString().c_str());
- //move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug
+ TC_LOG_ERROR("bg.battleground", "BattlegroundEY:CheckSomeoneLeftPoint Player (%s) could not be found!", m_PlayersNearPoint[i][j].ToString().c_str());
+ //move non-existing players to "free space" - this will cause many errors showing in log, but it is a very important bug
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
continue;
@@ -498,7 +498,7 @@ bool BattlegroundEY::SetupBattleground()
|| !AddObject(BG_EY_OBJECT_TOWER_CAP_MAGE_TOWER, BG_OBJECT_HU_TOWER_CAP_EY_ENTRY, 2282.121582f, 1760.006958f, 1189.707153f, 1.919862f, 0, 0, 0.819152f, 0.573576f, RESPAWN_ONE_DAY)
)
{
- TC_LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn some object Battleground not created!");
+ TC_LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn some objects. The battleground was not created.");
return false;
}
@@ -515,21 +515,21 @@ bool BattlegroundEY::SetupBattleground()
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
)
- TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Cannot spawn buff");
+ TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Could not spawn Speedbuff Fel Reaver.");
}
WorldSafeLocsEntry const* sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_ALLIANCE);
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE))
{
- TC_LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
+ TC_LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn spirit guide. The battleground was not created.");
return false;
}
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_HORDE);
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, TEAM_HORDE))
{
- TC_LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
+ TC_LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn spirit guide. The battleground was not created.");
return false;
}
@@ -595,7 +595,7 @@ void BattlegroundEY::RespawnFlagAfterDrop()
if (obj)
obj->Delete();
else
- TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Unknown dropped flag (%s)", GetDroppedFlagGUID().ToString().c_str());
+ TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Unknown dropped flag (%s).", GetDroppedFlagGUID().ToString().c_str());
SetDroppedFlagGUID(ObjectGuid::Empty);
}
@@ -767,7 +767,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point)
WorldSafeLocsEntry const* sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveYardId);
if (!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, GetTeamIndexByTeamId(Team)))
- TC_LOG_ERROR("bg.battleground", "BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
+ TC_LOG_ERROR("bg.battleground", "BatteGroundEY: Failed to spawn spirit guide. point: %u, team: %u, graveyard_id: %u",
Point, Team, m_CapturingPointTypes[Point].GraveYardId);
// SpawnBGCreature(Point, RESPAWN_IMMEDIATELY);
@@ -917,7 +917,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player)
if (!entry)
{
- TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Not found the main team graveyard. Graveyard system isn't working!");
+ TC_LOG_ERROR("bg.battleground", "BattlegroundEY: The main team graveyard could not be found. The graveyard system will not be operational!");
return NULL;
}
@@ -934,7 +934,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player)
{
entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId);
if (!entry)
- TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Not found graveyard: %u", m_CapturingPointTypes[i].GraveYardId);
+ TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Graveyard %u could not be found.", m_CapturingPointTypes[i].GraveYardId);
else
{
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
index 52e0deaf86f..8c144cbc8be 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
@@ -142,8 +142,8 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
{
if (siege->IsAlive())
{
- if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_IMMUNE_TO_PC))
- // following sniffs the vehicle always has UNIT_FLAG_UNK_14
+ if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_CANNOT_SWIM|UNIT_FLAG_IMMUNE_TO_PC))
+ // following sniffs the vehicle always has UNIT_FLAG_CANNOT_SWIM
siege->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_IMMUNE_TO_PC);
else
siege->SetHealth(siege->GetMaxHealth());
@@ -762,7 +762,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture)
if (Creature* siegeEngine = GetBGCreature(siegeType))
{
- siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_IMMUNE_TO_PC);
+ siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_CANNOT_SWIM|UNIT_FLAG_IMMUNE_TO_PC);
siegeEngine->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
}
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index 1942ac9d648..450f5cd9144 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -151,8 +151,8 @@ bool BattlegroundSA::ResetObjs()
}
// MAD props for Kiper for discovering those values - 4 hours of his work.
- GetBGObject(BG_SA_BOAT_ONE)->UpdateRotationFields(1.0f, 0.0002f);
- GetBGObject(BG_SA_BOAT_TWO)->UpdateRotationFields(1.0f, 0.00001f);
+ GetBGObject(BG_SA_BOAT_ONE)->SetParentRotation(G3D::Quat(0.f, 0.f, 1.0f, 0.0002f));
+ GetBGObject(BG_SA_BOAT_TWO)->SetParentRotation(G3D::Quat(0.f, 0.f, 1.0f, 0.00001f));
SpawnBGObject(BG_SA_BOAT_ONE, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_SA_BOAT_TWO, RESPAWN_IMMEDIATELY);
diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt
index aae5b4874d8..239e59d6dbb 100644
--- a/src/server/game/CMakeLists.txt
+++ b/src/server/game/CMakeLists.txt
@@ -8,206 +8,72 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-file(GLOB_RECURSE sources_Accounts Accounts/*.cpp Accounts/*.h)
-file(GLOB_RECURSE sources_Achievements Achievements/*.cpp Achievements/*.h)
-file(GLOB_RECURSE sources_Addons Addons/*.cpp Addons/*.h)
-file(GLOB_RECURSE sources_AI AI/*.cpp AI/*.h)
-file(GLOB_RECURSE sources_AuctionHouse AuctionHouse/*.cpp AuctionHouse/*.h)
-file(GLOB_RECURSE sources_AuctionHouseBot AuctionHouseBot/*.cpp AuctionHouseBot/*.h)
-file(GLOB_RECURSE sources_Battlefield Battlefield/*.cpp Battlefield/*.h)
-file(GLOB_RECURSE sources_Battlegrounds Battlegrounds/*.cpp Battlegrounds/*.h)
-file(GLOB_RECURSE sources_Calendar Calendar/*.cpp Calendar/*.h)
-file(GLOB_RECURSE sources_Chat Chat/*.cpp Chat/*.h)
-file(GLOB_RECURSE sources_Combat Combat/*.cpp Combat/*.h)
-file(GLOB_RECURSE sources_Conditions Conditions/*.cpp Conditions/*.h)
-file(GLOB_RECURSE sources_DataStores DataStores/*.cpp DataStores/*.h)
-file(GLOB_RECURSE sources_DungeonFinding DungeonFinding/*.cpp DungeonFinding/*.h)
-file(GLOB_RECURSE sources_Entities Entities/*.cpp Entities/*.h)
-file(GLOB_RECURSE sources_Events Events/*.cpp Events/*.h)
-file(GLOB_RECURSE sources_Globals Globals/*.cpp Globals/*.h)
-file(GLOB_RECURSE sources_Grids Grids/*.cpp Grids/*.h)
-file(GLOB_RECURSE sources_Groups Groups/*.cpp Groups/*.h)
-file(GLOB_RECURSE sources_Guilds Guilds/*.cpp Guilds/*.h)
-file(GLOB_RECURSE sources_Handlers Handlers/*.cpp Handlers/*.h)
-file(GLOB_RECURSE sources_Instances Instances/*.cpp Instances/*.h)
-file(GLOB_RECURSE sources_Loot Loot/*.cpp Loot/*.h)
-file(GLOB_RECURSE sources_Mails Mails/*.cpp Mails/*.h)
-file(GLOB_RECURSE sources_Maps Maps/*.cpp Maps/*.h)
-file(GLOB_RECURSE sources_Miscellaneous Miscellaneous/*.cpp Miscellaneous/*.h)
-file(GLOB_RECURSE sources_Movement Movement/*.cpp Movement/*.h)
-file(GLOB_RECURSE sources_OutdoorPvP OutdoorPvP/*.cpp OutdoorPvP/*.h)
-file(GLOB_RECURSE sources_Pools Pools/*.cpp Pools/*.h)
-file(GLOB_RECURSE sources_Quests Quests/*.cpp Quests/*.h)
-file(GLOB_RECURSE sources_Reputation Reputation/*.cpp Reputation/*.h)
-file(GLOB_RECURSE sources_Scripting Scripting/*.cpp Scripting/*.h)
-file(GLOB_RECURSE sources_Server Server/*.cpp Server/*.h)
-file(GLOB_RECURSE sources_Skills Skills/*.cpp Skills/*.h)
-file(GLOB_RECURSE sources_Spells Spells/*.cpp Spells/*.h)
-file(GLOB_RECURSE sources_Texts Texts/*.cpp Texts/*.h)
-file(GLOB_RECURSE sources_Tools Tools/*.cpp Tools/*.h)
-file(GLOB_RECURSE sources_Tickets Tickets/*.cpp Tickets/*.h)
-file(GLOB_RECURSE sources_Warden Warden/*.cpp Warden/*.h)
-file(GLOB_RECURSE sources_Weather Weather/*.cpp Weather/*.h)
-file(GLOB_RECURSE sources_World World/*.cpp World/*.h)
-
-# Create game-libary
+CollectSourceFiles(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE_SOURCES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if (USE_COREPCH)
- set(game_STAT_PCH_HDR PrecompiledHeaders/gamePCH.h)
- set(game_STAT_PCH_SRC PrecompiledHeaders/gamePCH.cpp)
+ set(PRIVATE_PCH_HEADER PrecompiledHeaders/gamePCH.h)
+ set(PRIVATE_PCH_SOURCE PrecompiledHeaders/gamePCH.cpp)
endif ()
-set(game_STAT_SRCS
- ${game_STAT_SRCS}
- ${sources_Accounts}
- ${sources_Achievements}
- ${sources_Addons}
- ${sources_AI}
- ${sources_AuctionHouse}
- ${sources_AuctionHouseBot}
- ${sources_Battlefield}
- ${sources_Battlegrounds}
- ${sources_Calendar}
- ${sources_Chat}
- ${sources_Combat}
- ${sources_Conditions}
- ${sources_DataStores}
- ${sources_DungeonFinding}
- ${sources_Entities}
- ${sources_Events}
- ${sources_Globals}
- ${sources_Grids}
- ${sources_Groups}
- ${sources_Guilds}
- ${sources_Handlers}
- ${sources_Instances}
- ${sources_Loot}
- ${sources_Mails}
- ${sources_Maps}
- ${sources_Miscellaneous}
- ${sources_Movement}
- ${sources_OutdoorPvP}
- ${sources_Pools}
- ${sources_Quests}
- ${sources_Reputation}
- ${sources_Scripting}
- ${sources_Server}
- ${sources_Skills}
- ${sources_Spells}
- ${sources_Texts}
- ${sources_Tools}
- ${sources_Tickets}
- ${sources_Warden}
- ${sources_Weather}
- ${sources_World}
-)
+GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}/Accounts
- ${CMAKE_CURRENT_SOURCE_DIR}/Achievements
- ${CMAKE_CURRENT_SOURCE_DIR}/Addons
- ${CMAKE_CURRENT_SOURCE_DIR}/AI
- ${CMAKE_CURRENT_SOURCE_DIR}/AI/CoreAI
- ${CMAKE_CURRENT_SOURCE_DIR}/AI/ScriptedAI
- ${CMAKE_CURRENT_SOURCE_DIR}/AI/SmartScripts
- ${CMAKE_CURRENT_SOURCE_DIR}/AuctionHouse
- ${CMAKE_CURRENT_SOURCE_DIR}/AuctionHouseBot
- ${CMAKE_CURRENT_SOURCE_DIR}/Battlefield
- ${CMAKE_CURRENT_SOURCE_DIR}/Battlefield/Zones
- ${CMAKE_CURRENT_SOURCE_DIR}/Battlegrounds
- ${CMAKE_CURRENT_SOURCE_DIR}/Battlegrounds/Zones
- ${CMAKE_CURRENT_SOURCE_DIR}/Calendar
- ${CMAKE_CURRENT_SOURCE_DIR}/Chat
- ${CMAKE_CURRENT_SOURCE_DIR}/Chat/Channels
- ${CMAKE_CURRENT_SOURCE_DIR}/Combat
- ${CMAKE_CURRENT_SOURCE_DIR}/Conditions
- ${CMAKE_CURRENT_SOURCE_DIR}/DataStores
- ${CMAKE_CURRENT_SOURCE_DIR}/DungeonFinding
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Corpse
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Creature
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/DynamicObject
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/GameObject
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Item
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Item/Container
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Object
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Object/Updates
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Pet
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Player
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Totem
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Transport
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Unit
- ${CMAKE_CURRENT_SOURCE_DIR}/Entities/Vehicle
- ${CMAKE_CURRENT_SOURCE_DIR}/Events
- ${CMAKE_CURRENT_SOURCE_DIR}/Globals
- ${CMAKE_CURRENT_SOURCE_DIR}/Grids
- ${CMAKE_CURRENT_SOURCE_DIR}/Grids/Cells
- ${CMAKE_CURRENT_SOURCE_DIR}/Grids/Notifiers
- ${CMAKE_CURRENT_SOURCE_DIR}/Groups
- ${CMAKE_CURRENT_SOURCE_DIR}/Guilds
- ${CMAKE_CURRENT_SOURCE_DIR}/Handlers
- ${CMAKE_CURRENT_SOURCE_DIR}/Instances
- ${CMAKE_CURRENT_SOURCE_DIR}/Loot
- ${CMAKE_CURRENT_SOURCE_DIR}/Mails
- ${CMAKE_CURRENT_SOURCE_DIR}/Maps
- ${CMAKE_CURRENT_SOURCE_DIR}/Miscellaneous
- ${CMAKE_CURRENT_SOURCE_DIR}/Movement
- ${CMAKE_CURRENT_SOURCE_DIR}/Movement/MovementGenerators
- ${CMAKE_CURRENT_SOURCE_DIR}/Movement/Spline
- ${CMAKE_CURRENT_SOURCE_DIR}/Movement/Waypoints
- ${CMAKE_CURRENT_SOURCE_DIR}/OutdoorPvP
- ${CMAKE_CURRENT_SOURCE_DIR}/Pools
- ${CMAKE_CURRENT_SOURCE_DIR}/Quests
- ${CMAKE_CURRENT_SOURCE_DIR}/Reputation
- ${CMAKE_CURRENT_SOURCE_DIR}/Scripting
- ${CMAKE_CURRENT_SOURCE_DIR}/Server
- ${CMAKE_CURRENT_SOURCE_DIR}/Server/Protocol
- ${CMAKE_CURRENT_SOURCE_DIR}/Skills
- ${CMAKE_CURRENT_SOURCE_DIR}/Spells
- ${CMAKE_CURRENT_SOURCE_DIR}/Spells/Auras
- ${CMAKE_CURRENT_SOURCE_DIR}/Texts
- ${CMAKE_CURRENT_SOURCE_DIR}/Tickets
- ${CMAKE_CURRENT_SOURCE_DIR}/Tools
- ${CMAKE_CURRENT_SOURCE_DIR}/Warden
- ${CMAKE_CURRENT_SOURCE_DIR}/Warden/Modules
- ${CMAKE_CURRENT_SOURCE_DIR}/Weather
- ${CMAKE_CURRENT_SOURCE_DIR}/World
- ${CMAKE_SOURCE_DIR}/dep/cppformat
- ${CMAKE_SOURCE_DIR}/dep/g3dlite/include
- ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour/Include
- ${CMAKE_SOURCE_DIR}/dep/zlib
- ${CMAKE_SOURCE_DIR}/src/common
- ${CMAKE_SOURCE_DIR}/src/common/Collision
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Management
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Maps
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Models
- ${CMAKE_SOURCE_DIR}/src/common/Configuration
- ${CMAKE_SOURCE_DIR}/src/common/Cryptography
- ${CMAKE_SOURCE_DIR}/src/common/Cryptography/Authentication
- ${CMAKE_SOURCE_DIR}/src/common/Debugging
- ${CMAKE_SOURCE_DIR}/src/common/Logging
- ${CMAKE_SOURCE_DIR}/src/common/Threading
- ${CMAKE_SOURCE_DIR}/src/common/Utilities
- ${CMAKE_SOURCE_DIR}/src/server/database
- ${CMAKE_SOURCE_DIR}/src/server/database/Database
- ${CMAKE_SOURCE_DIR}/src/server/shared
- ${CMAKE_SOURCE_DIR}/src/server/shared/DataStores
- ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic
- ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference
- ${CMAKE_SOURCE_DIR}/src/server/shared/Networking
- ${CMAKE_SOURCE_DIR}/src/server/shared/Packets
- ${MYSQL_INCLUDE_DIR}
- ${OPENSSL_INCLUDE_DIR}
- ${VALGRIND_INCLUDE_DIR}
-)
+add_definitions(-DTRINITY_API_EXPORT_GAME)
-GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
+CollectIncludeDirectories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC_INCLUDES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
+
+# Provide an interface target for the game project to allow
+# dependent projects to build meanwhile.
+add_library(game-interface INTERFACE)
+
+target_include_directories(game-interface
+ INTERFACE
+ ${PUBLIC_INCLUDES})
+
+target_link_libraries(game-interface
+ INTERFACE
+ shared
+ Detour)
+
+add_library(game
+ ${PRIVATE_PCH_SOURCE}
+ ${PRIVATE_SOURCES})
+
+target_include_directories(game
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR})
+
+target_link_libraries(game
+ PUBLIC
+ game-interface
+ PRIVATE
+ efsw)
+
+set_target_properties(game
+ PROPERTIES
+ FOLDER
+ "server")
-add_library(game STATIC
- ${game_STAT_SRCS}
- ${game_STAT_PCH_SRC}
-)
+if( BUILD_SHARED_LIBS )
+ if( UNIX )
+ install(TARGETS game
+ LIBRARY
+ DESTINATION lib)
+ elseif( WIN32 )
+ install(TARGETS game
+ RUNTIME
+ DESTINATION "${CMAKE_INSTALL_PREFIX}")
+ endif()
+endif()
# Generate precompiled header
if (USE_COREPCH)
- add_cxx_pch(game ${game_STAT_PCH_HDR} ${game_STAT_PCH_SRC})
+ add_cxx_pch(game ${PRIVATE_PCH_HEADER} ${PRIVATE_PCH_SOURCE})
endif ()
diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp
index 9d50b290c5e..b27aac7876a 100644
--- a/src/server/game/Calendar/CalendarMgr.cpp
+++ b/src/server/game/Calendar/CalendarMgr.cpp
@@ -45,6 +45,12 @@ CalendarMgr::~CalendarMgr()
delete *itr2;
}
+CalendarMgr* CalendarMgr::instance()
+{
+ static CalendarMgr instance;
+ return &instance;
+}
+
void CalendarMgr::LoadFromDB()
{
uint32 count = 0;
diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h
index 59303a18324..c282e3e202c 100644
--- a/src/server/game/Calendar/CalendarMgr.h
+++ b/src/server/game/Calendar/CalendarMgr.h
@@ -126,7 +126,7 @@ enum CalendarError
#define CALENDAR_MAX_GUILD_EVENTS 100
#define CALENDAR_MAX_INVITES 100
-struct CalendarInvite
+struct TC_GAME_API CalendarInvite
{
public:
CalendarInvite(CalendarInvite const& calendarInvite, uint64 inviteId, uint64 eventId)
@@ -186,7 +186,7 @@ struct CalendarInvite
std::string _text;
};
-struct CalendarEvent
+struct TC_GAME_API CalendarEvent
{
public:
CalendarEvent(CalendarEvent const& calendarEvent, uint64 eventId)
@@ -266,7 +266,7 @@ typedef std::vector<CalendarInvite*> CalendarInviteStore;
typedef std::set<CalendarEvent*> CalendarEventStore;
typedef std::map<uint64 /* eventId */, CalendarInviteStore > CalendarEventInviteStore;
-class CalendarMgr
+class TC_GAME_API CalendarMgr
{
private:
CalendarMgr();
@@ -281,11 +281,7 @@ class CalendarMgr
uint64 _maxInviteId;
public:
- static CalendarMgr* instance()
- {
- static CalendarMgr instance;
- return &instance;
- }
+ static CalendarMgr* instance();
void LoadFromDB();
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index 0875ceefff5..a34f0f4d9a2 100644
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -25,66 +25,66 @@
#include "AccountMgr.h"
#include "Player.h"
-Channel::Channel(std::string const& name, uint32 channelId, uint32 team):
- _announce(true),
- _ownership(true),
- _IsSaved(false),
- _flags(0),
+Channel::Channel(std::string const& name, uint32 channelId, uint32 team /*= 0*/):
+ _announceEnabled(true),
+ _ownershipEnabled(true),
+ _persistentChannel(false),
+ _channelFlags(0),
_channelId(channelId),
- _Team(team),
- _ownerGUID(),
- _name(name),
- _password("")
+ _channelTeam(team),
+ _ownerGuid(),
+ _channelName(name),
+ _channelPassword()
{
// set special flags if built-in channel
if (ChatChannelsEntry const* ch = sChatChannelsStore.LookupEntry(channelId)) // check whether it's a built-in channel
{
- _announce = false; // no join/leave announces
- _ownership = false; // no ownership handout
+ _announceEnabled = false; // no join/leave announces
+ _ownershipEnabled = false; // no ownership handout
- _flags |= CHANNEL_FLAG_GENERAL; // for all built-in channels
+ _channelFlags |= CHANNEL_FLAG_GENERAL; // for all built-in channels
if (ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
- _flags |= CHANNEL_FLAG_TRADE;
+ _channelFlags |= CHANNEL_FLAG_TRADE;
if (ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
- _flags |= CHANNEL_FLAG_CITY;
+ _channelFlags |= CHANNEL_FLAG_CITY;
if (ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
- _flags |= CHANNEL_FLAG_LFG;
+ _channelFlags |= CHANNEL_FLAG_LFG;
else // for all other channels
- _flags |= CHANNEL_FLAG_NOT_LFG;
+ _channelFlags |= CHANNEL_FLAG_NOT_LFG;
}
else // it's custom channel
{
- _flags |= CHANNEL_FLAG_CUSTOM;
+ _channelFlags |= CHANNEL_FLAG_CUSTOM;
// If storing custom channels in the db is enabled either load or save the channel
if (sWorld->getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS))
{
PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHANNEL);
stmt->setString(0, name);
- stmt->setUInt32(1, _Team);
+ stmt->setUInt32(1, _channelTeam);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (result) //load
{
Field* fields = result->Fetch();
- _announce = fields[0].GetBool();
- _ownership = fields[1].GetBool();
- _password = fields[2].GetString();
- const char* db_BannedList = fields[3].GetCString();
+ _announceEnabled = fields[0].GetBool();
+ _ownershipEnabled = fields[1].GetBool();
+ _channelPassword = fields[2].GetString();
+ char const* db_BannedList = fields[3].GetCString();
if (db_BannedList)
{
Tokenizer tokens(db_BannedList, ' ');
for (Tokenizer::const_iterator i = tokens.begin(); i != tokens.end(); ++i)
{
- ObjectGuid banned_guid(uint64(strtoull(*i, NULL, 10)));
+ ObjectGuid banned_guid(uint64(atoull(*i)));
if (banned_guid)
{
TC_LOG_DEBUG("chat.system", "Channel(%s) loaded bannedStore %s", name.c_str(), banned_guid.ToString().c_str());
- bannedStore.insert(banned_guid);
+ _bannedStore.insert(banned_guid);
}
}
}
@@ -93,45 +93,44 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 team):
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHANNEL);
stmt->setString(0, name);
- stmt->setUInt32(1, _Team);
+ stmt->setUInt32(1, _channelTeam);
CharacterDatabase.Execute(stmt);
TC_LOG_DEBUG("chat.system", "Channel(%s) saved in database", name.c_str());
}
- _IsSaved = true;
+ _persistentChannel = true;
}
}
}
void Channel::UpdateChannelInDB() const
{
- if (_IsSaved)
+ if (_persistentChannel)
{
std::ostringstream banlist;
- BannedContainer::const_iterator iter;
- for (iter = bannedStore.begin(); iter != bannedStore.end(); ++iter)
+ for (BannedContainer::const_iterator iter = _bannedStore.begin(); iter != _bannedStore.end(); ++iter)
banlist << iter->GetRawValue() << ' ';
std::string banListStr = banlist.str();
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL);
- stmt->setBool(0, _announce);
- stmt->setBool(1, _ownership);
- stmt->setString(2, _password);
+ stmt->setBool(0, _announceEnabled);
+ stmt->setBool(1, _ownershipEnabled);
+ stmt->setString(2, _channelPassword);
stmt->setString(3, banListStr);
- stmt->setString(4, _name);
- stmt->setUInt32(5, _Team);
+ stmt->setString(4, _channelName);
+ stmt->setUInt32(5, _channelTeam);
CharacterDatabase.Execute(stmt);
- TC_LOG_DEBUG("chat.system", "Channel(%s) updated in database", _name.c_str());
+ TC_LOG_DEBUG("chat.system", "Channel(%s) updated in database", _channelName.c_str());
}
}
void Channel::UpdateChannelUseageInDB() const
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_USAGE);
- stmt->setString(0, _name);
- stmt->setUInt32(1, _Team);
+ stmt->setString(0, _channelName);
+ stmt->setUInt32(1, _channelTeam);
CharacterDatabase.Execute(stmt);
}
@@ -170,7 +169,7 @@ void Channel::JoinChannel(Player* player, std::string const& pass)
return;
}
- if (!_password.empty() && pass != _password)
+ if (!_channelPassword.empty() && pass != _channelPassword)
{
WorldPacket data;
MakeWrongPassword(&data);
@@ -191,17 +190,15 @@ void Channel::JoinChannel(Player* player, std::string const& pass)
player->JoinedChannel(this);
- if (_announce && !player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL))
+ if (_announceEnabled && !player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL))
{
WorldPacket data;
MakeJoined(&data, guid);
SendToAll(&data);
}
- PlayerInfo pinfo;
- pinfo.player = guid;
+ PlayerInfo& pinfo = _playersStore[guid];
pinfo.flags = MEMBER_FLAG_NONE;
- playersStore[guid] = pinfo;
WorldPacket data;
MakeYouJoined(&data);
@@ -213,14 +210,13 @@ void Channel::JoinChannel(Player* player, std::string const& pass)
if (!IsConstant())
{
// Update last_used timestamp in db
- if (!playersStore.empty())
- UpdateChannelUseageInDB();
+ UpdateChannelUseageInDB();
// If the channel has no owner yet and ownership is allowed, set the new owner.
- if (!_ownerGUID && _ownership)
+ if (!_ownerGuid && _ownershipEnabled)
{
- SetOwner(guid, playersStore.size() > 1);
- playersStore[guid].SetModerator(true);
+ SetOwner(guid, _playersStore.size() > 1);
+ pinfo.SetModerator(true);
}
}
}
@@ -248,11 +244,11 @@ void Channel::LeaveChannel(Player* player, bool send)
data.clear();
}
- bool changeowner = playersStore[guid].IsOwner();
-
- playersStore.erase(guid);
+ PlayerInfo& info = _playersStore.at(guid);
+ bool changeowner = info.IsOwner();
+ _playersStore.erase(guid);
- if (_announce && !player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL))
+ if (_announceEnabled && !player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL))
{
WorldPacket data;
MakeLeft(&data, guid);
@@ -266,11 +262,12 @@ void Channel::LeaveChannel(Player* player, bool send)
// Update last_used timestamp in db
UpdateChannelUseageInDB();
- // If the channel owner left and there are still playersStore inside, pick a new owner
- if (changeowner && _ownership && !playersStore.empty())
+ // If the channel owner left and there are still players inside, pick a new owner
+ if (changeowner && _ownershipEnabled && !_playersStore.empty())
{
- ObjectGuid newowner = playersStore.begin()->second.player;
- playersStore[newowner].SetModerator(true);
+ auto itr = _playersStore.begin();
+ ObjectGuid newowner = itr->first;
+ itr->second.SetModerator(true);
SetOwner(newowner);
}
}
@@ -288,7 +285,8 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b
return;
}
- if (!playersStore[good].IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
+ PlayerInfo& info = _playersStore.at(good);
+ if (!info.IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
{
WorldPacket data;
MakeNotModerator(&data);
@@ -306,9 +304,9 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b
return;
}
- bool changeowner = _ownerGUID == victim;
+ bool changeowner = _ownerGuid == victim;
- if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR) && changeowner && good != _ownerGUID)
+ if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR) && changeowner && good != _ownerGuid)
{
WorldPacket data;
MakeNotOwner(&data);
@@ -318,7 +316,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b
if (ban && !IsBanned(victim))
{
- bannedStore.insert(victim);
+ _bannedStore.insert(victim);
UpdateChannelInDB();
if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL))
@@ -335,13 +333,13 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b
SendToAll(&data);
}
- playersStore.erase(victim);
+ _playersStore.erase(victim);
bad->LeftChannel(this);
- if (changeowner && _ownership && !playersStore.empty())
+ if (changeowner && _ownershipEnabled && !_playersStore.empty())
{
ObjectGuid newowner = good;
- playersStore[newowner].SetModerator(true);
+ info.SetModerator(true);
SetOwner(newowner);
}
}
@@ -358,7 +356,8 @@ void Channel::UnBan(Player const* player, std::string const& badname)
return;
}
- if (!playersStore[good].IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
+ PlayerInfo& info = _playersStore.at(good);
+ if (!info.IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
{
WorldPacket data;
MakeNotModerator(&data);
@@ -377,7 +376,7 @@ void Channel::UnBan(Player const* player, std::string const& badname)
return;
}
- bannedStore.erase(victim);
+ _bannedStore.erase(victim);
WorldPacket data;
MakePlayerUnbanned(&data, victim, good);
@@ -399,7 +398,8 @@ void Channel::Password(Player const* player, std::string const& pass)
return;
}
- if (!playersStore[guid].IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
+ PlayerInfo& info = _playersStore.at(guid);
+ if (!info.IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
{
WorldPacket data;
MakeNotModerator(&data);
@@ -407,7 +407,7 @@ void Channel::Password(Player const* player, std::string const& pass)
return;
}
- _password = pass;
+ _channelPassword = pass;
WorldPacket data;
MakePasswordChanged(&data, guid);
@@ -428,7 +428,8 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo
return;
}
- if (!playersStore[guid].IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
+ PlayerInfo& info = _playersStore.at(guid);
+ if (!info.IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
{
WorldPacket data;
MakeNotModerator(&data);
@@ -436,7 +437,7 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo
return;
}
- if (guid == _ownerGUID && std::string(p2n) == player->GetName() && mod)
+ if (guid == _ownerGuid && std::string(p2n) == player->GetName() && mod)
return;
Player* newp = ObjectAccessor::FindConnectedPlayerByName(p2n);
@@ -453,7 +454,7 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo
return;
}
- if (_ownerGUID == victim && _ownerGUID != guid)
+ if (_ownerGuid == victim && _ownerGuid != guid)
{
WorldPacket data;
MakeNotOwner(&data);
@@ -479,7 +480,7 @@ void Channel::SetOwner(Player const* player, std::string const& newname)
return;
}
- if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR) && guid != _ownerGUID)
+ if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR) && guid != _ownerGuid)
{
WorldPacket data;
MakeNotOwner(&data);
@@ -501,7 +502,8 @@ void Channel::SetOwner(Player const* player, std::string const& newname)
return;
}
- playersStore[victim].SetModerator(true);
+ PlayerInfo& info = _playersStore.at(victim);
+ info.SetModerator(true);
SetOwner(victim);
}
@@ -515,7 +517,7 @@ void Channel::SendWhoOwner(ObjectGuid guid)
SendToOne(&data, guid);
}
-void Channel::List(Player const* player)
+void Channel::List(Player const* player) const
{
ObjectGuid guid = player->GetGUID();
@@ -530,7 +532,7 @@ void Channel::List(Player const* player)
TC_LOG_DEBUG("chat.system", "SMSG_CHANNEL_LIST %s Channel: %s",
player->GetSession()->GetPlayerInfo().c_str(), GetName().c_str());
- WorldPacket data(SMSG_CHANNEL_LIST, 1+(GetName().size()+1)+1+4+playersStore.size()*(8+1));
+ WorldPacket data(SMSG_CHANNEL_LIST, 1+(GetName().size()+1)+1+4+_playersStore.size()*(8+1));
data << uint8(1); // channel type?
data << GetName(); // channel name
data << uint8(GetFlags()); // channel flags?
@@ -541,7 +543,7 @@ void Channel::List(Player const* player)
uint32 gmLevelInWhoList = sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
uint32 count = 0;
- for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i)
+ for (PlayerContainer::const_iterator i = _playersStore.begin(); i != _playersStore.end(); ++i)
{
Player* member = ObjectAccessor::FindConnectedPlayer(i->first);
@@ -575,7 +577,8 @@ void Channel::Announce(Player const* player)
return;
}
- if (!playersStore[guid].IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
+ PlayerInfo& info = _playersStore.at(guid);
+ if (!info.IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
{
WorldPacket data;
MakeNotModerator(&data);
@@ -583,10 +586,10 @@ void Channel::Announce(Player const* player)
return;
}
- _announce = !_announce;
+ _announceEnabled = !_announceEnabled;
WorldPacket data;
- if (_announce)
+ if (_announceEnabled)
MakeAnnouncementsOn(&data, guid);
else
MakeAnnouncementsOff(&data, guid);
@@ -595,7 +598,7 @@ void Channel::Announce(Player const* player)
UpdateChannelInDB();
}
-void Channel::Say(ObjectGuid guid, std::string const& what, uint32 lang)
+void Channel::Say(ObjectGuid guid, std::string const& what, uint32 lang) const
{
if (what.empty())
return;
@@ -612,7 +615,8 @@ void Channel::Say(ObjectGuid guid, std::string const& what, uint32 lang)
return;
}
- if (playersStore[guid].IsMuted())
+ PlayerInfo const& info = _playersStore.at(guid);
+ if (info.IsMuted())
{
WorldPacket data;
MakeMuted(&data);
@@ -622,11 +626,11 @@ void Channel::Say(ObjectGuid guid, std::string const& what, uint32 lang)
WorldPacket data;
if (Player* player = ObjectAccessor::FindConnectedPlayer(guid))
- ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, _name);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, _channelName);
else
- ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, 0, "", "", 0, false, _name);
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, 0, "", "", 0, false, _channelName);
- SendToAll(&data, !playersStore[guid].IsModerator() ? guid : ObjectGuid::Empty);
+ SendToAll(&data, !info.IsModerator() ? guid : ObjectGuid::Empty);
}
void Channel::Invite(Player const* player, std::string const& newname)
@@ -691,28 +695,31 @@ void Channel::Invite(Player const* player, std::string const& newname)
void Channel::SetOwner(ObjectGuid guid, bool exclaim)
{
- if (_ownerGUID)
+ if (_ownerGuid)
{
- // [] will re-add player after it possible removed
- PlayerContainer::iterator p_itr = playersStore.find(_ownerGUID);
- if (p_itr != playersStore.end())
- p_itr->second.SetOwner(false);
+ auto itr = _playersStore.find(_ownerGuid);
+ if (itr != _playersStore.end())
+ itr->second.SetOwner(false);
}
- _ownerGUID = guid;
- if (_ownerGUID)
+ _ownerGuid = guid;
+ if (_ownerGuid)
{
- uint8 oldFlag = GetPlayerFlags(_ownerGUID);
- playersStore[_ownerGUID].SetModerator(true);
- playersStore[_ownerGUID].SetOwner(true);
+ uint8 oldFlag = GetPlayerFlags(_ownerGuid);
+ auto itr = _playersStore.find(_ownerGuid);
+ if (itr == _playersStore.end())
+ return;
+
+ itr->second.SetModerator(true);
+ itr->second.SetOwner(true);
WorldPacket data;
- MakeModeChange(&data, _ownerGUID, oldFlag);
+ MakeModeChange(&data, _ownerGuid, oldFlag);
SendToAll(&data);
if (exclaim)
{
- MakeOwnerChanged(&data, _ownerGUID);
+ MakeOwnerChanged(&data, _ownerGuid);
SendToAll(&data);
}
@@ -720,58 +727,58 @@ void Channel::SetOwner(ObjectGuid guid, bool exclaim)
}
}
-void Channel::SendToAll(WorldPacket* data, ObjectGuid guid)
+void Channel::SendToAll(WorldPacket* data, ObjectGuid guid) const
{
- for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i)
+ for (PlayerContainer::const_iterator i = _playersStore.begin(); i != _playersStore.end(); ++i)
if (Player* player = ObjectAccessor::FindConnectedPlayer(i->first))
if (!guid || !player->GetSocial()->HasIgnore(guid.GetCounter()))
player->GetSession()->SendPacket(data);
}
-void Channel::SendToAllButOne(WorldPacket* data, ObjectGuid who)
+void Channel::SendToAllButOne(WorldPacket* data, ObjectGuid who) const
{
- for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i)
+ for (PlayerContainer::const_iterator i = _playersStore.begin(); i != _playersStore.end(); ++i)
if (i->first != who)
if (Player* player = ObjectAccessor::FindConnectedPlayer(i->first))
player->GetSession()->SendPacket(data);
}
-void Channel::SendToOne(WorldPacket* data, ObjectGuid who)
+void Channel::SendToOne(WorldPacket* data, ObjectGuid who) const
{
if (Player* player = ObjectAccessor::FindConnectedPlayer(who))
player->GetSession()->SendPacket(data);
}
-void Channel::Voice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/)
+void Channel::Voice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/) const
{
}
-void Channel::DeVoice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/)
+void Channel::DeVoice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/) const
{
}
-void Channel::MakeNotifyPacket(WorldPacket* data, uint8 notify_type)
+void Channel::MakeNotifyPacket(WorldPacket* data, uint8 notify_type) const
{
- data->Initialize(SMSG_CHANNEL_NOTIFY, 1 + _name.size());
+ data->Initialize(SMSG_CHANNEL_NOTIFY, 1 + _channelName.size());
*data << uint8(notify_type);
- *data << _name;
+ *data << _channelName;
}
-void Channel::MakeJoined(WorldPacket* data, ObjectGuid guid)
+void Channel::MakeJoined(WorldPacket* data, ObjectGuid guid) const
{
MakeNotifyPacket(data, CHAT_JOINED_NOTICE);
*data << uint64(guid);
}
-void Channel::MakeLeft(WorldPacket* data, ObjectGuid guid)
+void Channel::MakeLeft(WorldPacket* data, ObjectGuid guid) const
{
MakeNotifyPacket(data, CHAT_LEFT_NOTICE);
*data << uint64(guid);
}
-void Channel::MakeYouJoined(WorldPacket* data)
+void Channel::MakeYouJoined(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_YOU_JOINED_NOTICE);
*data << uint8(GetFlags());
@@ -779,63 +786,66 @@ void Channel::MakeYouJoined(WorldPacket* data)
*data << uint32(0);
}
-void Channel::MakeYouLeft(WorldPacket* data)
+void Channel::MakeYouLeft(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_YOU_LEFT_NOTICE);
*data << uint32(GetChannelId());
*data << uint8(IsConstant());
}
-void Channel::MakeWrongPassword(WorldPacket* data)
+void Channel::MakeWrongPassword(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_WRONG_PASSWORD_NOTICE);
}
-void Channel::MakeNotMember(WorldPacket* data)
+void Channel::MakeNotMember(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_NOT_MEMBER_NOTICE);
}
-void Channel::MakeNotModerator(WorldPacket* data)
+void Channel::MakeNotModerator(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_NOT_MODERATOR_NOTICE);
}
-void Channel::MakePasswordChanged(WorldPacket* data, ObjectGuid guid)
+void Channel::MakePasswordChanged(WorldPacket* data, ObjectGuid guid) const
{
MakeNotifyPacket(data, CHAT_PASSWORD_CHANGED_NOTICE);
*data << uint64(guid);
}
-void Channel::MakeOwnerChanged(WorldPacket* data, ObjectGuid guid)
+void Channel::MakeOwnerChanged(WorldPacket* data, ObjectGuid guid) const
{
MakeNotifyPacket(data, CHAT_OWNER_CHANGED_NOTICE);
*data << uint64(guid);
}
-void Channel::MakePlayerNotFound(WorldPacket* data, std::string const& name)
+void Channel::MakePlayerNotFound(WorldPacket* data, std::string const& name) const
{
MakeNotifyPacket(data, CHAT_PLAYER_NOT_FOUND_NOTICE);
*data << name;
}
-void Channel::MakeNotOwner(WorldPacket* data)
+void Channel::MakeNotOwner(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_NOT_OWNER_NOTICE);
}
-void Channel::MakeChannelOwner(WorldPacket* data)
+void Channel::MakeChannelOwner(WorldPacket* data) const
{
- std::string name = "";
+ std::string name;
- if (!sObjectMgr->GetPlayerNameByGUID(_ownerGUID, name) || name.empty())
+ CharacterInfo const* cInfo = sWorld->GetCharacterInfo(_ownerGuid);
+ if (!cInfo || cInfo->Name.empty())
name = "PLAYER_NOT_FOUND";
+ else
+ name = cInfo->Name;
MakeNotifyPacket(data, CHAT_CHANNEL_OWNER_NOTICE);
- *data << ((IsConstant() || !_ownerGUID) ? "Nobody" : name);
+ *data << ((IsConstant() || !_ownerGuid) ? "Nobody" : name);
}
-void Channel::MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags)
+void Channel::MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags) const
{
MakeNotifyPacket(data, CHAT_MODE_CHANGE_NOTICE);
*data << uint64(guid);
@@ -843,127 +853,127 @@ void Channel::MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags)
*data << uint8(GetPlayerFlags(guid));
}
-void Channel::MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid)
+void Channel::MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid) const
{
MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_ON_NOTICE);
*data << uint64(guid);
}
-void Channel::MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid)
+void Channel::MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid) const
{
MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_OFF_NOTICE);
*data << uint64(guid);
}
-void Channel::MakeMuted(WorldPacket* data)
+void Channel::MakeMuted(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_MUTED_NOTICE);
}
-void Channel::MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good)
+void Channel::MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const
{
MakeNotifyPacket(data, CHAT_PLAYER_KICKED_NOTICE);
*data << uint64(bad);
*data << uint64(good);
}
-void Channel::MakeBanned(WorldPacket* data)
+void Channel::MakeBanned(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_BANNED_NOTICE);
}
-void Channel::MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good)
+void Channel::MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const
{
MakeNotifyPacket(data, CHAT_PLAYER_BANNED_NOTICE);
*data << uint64(bad);
*data << uint64(good);
}
-void Channel::MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good)
+void Channel::MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const
{
MakeNotifyPacket(data, CHAT_PLAYER_UNBANNED_NOTICE);
*data << uint64(bad);
*data << uint64(good);
}
-void Channel::MakePlayerNotBanned(WorldPacket* data, const std::string &name)
+void Channel::MakePlayerNotBanned(WorldPacket* data, const std::string &name) const
{
MakeNotifyPacket(data, CHAT_PLAYER_NOT_BANNED_NOTICE);
*data << name;
}
-void Channel::MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid)
+void Channel::MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid) const
{
MakeNotifyPacket(data, CHAT_PLAYER_ALREADY_MEMBER_NOTICE);
*data << uint64(guid);
}
-void Channel::MakeInvite(WorldPacket* data, ObjectGuid guid)
+void Channel::MakeInvite(WorldPacket* data, ObjectGuid guid) const
{
MakeNotifyPacket(data, CHAT_INVITE_NOTICE);
*data << uint64(guid);
}
-void Channel::MakeInviteWrongFaction(WorldPacket* data)
+void Channel::MakeInviteWrongFaction(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_INVITE_WRONG_FACTION_NOTICE);
}
-void Channel::MakeWrongFaction(WorldPacket* data)
+void Channel::MakeWrongFaction(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_WRONG_FACTION_NOTICE);
}
-void Channel::MakeInvalidName(WorldPacket* data)
+void Channel::MakeInvalidName(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_INVALID_NAME_NOTICE);
}
-void Channel::MakeNotModerated(WorldPacket* data)
+void Channel::MakeNotModerated(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_NOT_MODERATED_NOTICE);
}
-void Channel::MakePlayerInvited(WorldPacket* data, const std::string& name)
+void Channel::MakePlayerInvited(WorldPacket* data, std::string const& name) const
{
MakeNotifyPacket(data, CHAT_PLAYER_INVITED_NOTICE);
*data << name;
}
-void Channel::MakePlayerInviteBanned(WorldPacket* data, const std::string& name)
+void Channel::MakePlayerInviteBanned(WorldPacket* data, std::string const& name) const
{
MakeNotifyPacket(data, CHAT_PLAYER_INVITE_BANNED_NOTICE);
*data << name;
}
-void Channel::MakeThrottled(WorldPacket* data)
+void Channel::MakeThrottled(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_THROTTLED_NOTICE);
}
-void Channel::MakeNotInArea(WorldPacket* data)
+void Channel::MakeNotInArea(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_NOT_IN_AREA_NOTICE);
}
-void Channel::MakeNotInLfg(WorldPacket* data)
+void Channel::MakeNotInLfg(WorldPacket* data) const
{
MakeNotifyPacket(data, CHAT_NOT_IN_LFG_NOTICE);
}
-void Channel::MakeVoiceOn(WorldPacket* data, ObjectGuid guid)
+void Channel::MakeVoiceOn(WorldPacket* data, ObjectGuid guid) const
{
MakeNotifyPacket(data, CHAT_VOICE_ON_NOTICE);
*data << uint64(guid);
}
-void Channel::MakeVoiceOff(WorldPacket* data, ObjectGuid guid)
+void Channel::MakeVoiceOff(WorldPacket* data, ObjectGuid guid) const
{
MakeNotifyPacket(data, CHAT_VOICE_OFF_NOTICE);
*data << uint64(guid);
}
-void Channel::JoinNotify(ObjectGuid guid)
+void Channel::JoinNotify(ObjectGuid guid) const
{
WorldPacket data(IsConstant() ? SMSG_USERLIST_ADD : SMSG_USERLIST_UPDATE, 8 + 1 + 1 + 4 + GetName().size());
data << uint64(guid);
@@ -978,7 +988,7 @@ void Channel::JoinNotify(ObjectGuid guid)
SendToAll(&data);
}
-void Channel::LeaveNotify(ObjectGuid guid)
+void Channel::LeaveNotify(ObjectGuid guid) const
{
WorldPacket data(SMSG_USERLIST_REMOVE, 8 + 1 + 4 + GetName().size());
data << uint64(guid);
diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h
index 26bc6989d07..23f9e5ae28f 100644
--- a/src/server/game/Chat/Channels/Channel.h
+++ b/src/server/game/Chat/Channels/Channel.h
@@ -19,10 +19,6 @@
#ifndef _CHANNEL_H
#define _CHANNEL_H
-#include <list>
-#include <map>
-#include <string>
-
#include "Common.h"
#include "WorldSession.h"
@@ -53,10 +49,10 @@ enum ChatNotify
CHAT_MODERATION_OFF_NOTICE = 0x10, //+ "[%s] Channel moderation disabled by %s.";
CHAT_MUTED_NOTICE = 0x11, //+ "[%s] You do not have permission to speak.";
CHAT_PLAYER_KICKED_NOTICE = 0x12, //? "[%s] Player %s kicked by %s.";
- CHAT_BANNED_NOTICE = 0x13, //+ "[%s] You are bannedStore from that channel.";
- CHAT_PLAYER_BANNED_NOTICE = 0x14, //? "[%s] Player %s bannedStore by %s.";
+ CHAT_BANNED_NOTICE = 0x13, //+ "[%s] You are banned from that channel.";
+ CHAT_PLAYER_BANNED_NOTICE = 0x14, //? "[%s] Player %s banned by %s.";
CHAT_PLAYER_UNBANNED_NOTICE = 0x15, //? "[%s] Player %s unbanned by %s.";
- CHAT_PLAYER_NOT_BANNED_NOTICE = 0x16, //+ "[%s] Player %s is not bannedStore.";
+ CHAT_PLAYER_NOT_BANNED_NOTICE = 0x16, //+ "[%s] Player %s is not banned.";
CHAT_PLAYER_ALREADY_MEMBER_NOTICE = 0x17, //+ "[%s] Player %s is already on the channel.";
CHAT_INVITE_NOTICE = 0x18, //+ "%2$s has invited you to join the channel '%1$s'.";
CHAT_INVITE_WRONG_FACTION_NOTICE = 0x19, //+ "Target is in the wrong alliance for %s.";
@@ -64,7 +60,7 @@ enum ChatNotify
CHAT_INVALID_NAME_NOTICE = 0x1B, //+ "Invalid channel name";
CHAT_NOT_MODERATED_NOTICE = 0x1C, //+ "%s is not moderated";
CHAT_PLAYER_INVITED_NOTICE = 0x1D, //+ "[%s] You invited %s to join the channel";
- CHAT_PLAYER_INVITE_BANNED_NOTICE = 0x1E, //+ "[%s] %s has been bannedStore.";
+ CHAT_PLAYER_INVITE_BANNED_NOTICE = 0x1E, //+ "[%s] %s has been banned.";
CHAT_THROTTLED_NOTICE = 0x1F, //+ "[%s] The number of messages that can be sent to this channel is limited, please wait to send another message.";
CHAT_NOT_IN_AREA_NOTICE = 0x20, //+ "[%s] You are not in the correct area for this channel."; -- The user is trying to send a chat to a zone specific channel, and they're not physically in that zone.
CHAT_NOT_IN_LFG_NOTICE = 0x21, //+ "[%s] You must be queued in looking for group before joining this channel."; -- The user must be in the looking for group system to join LFG chat channels.
@@ -85,7 +81,7 @@ enum ChannelFlags
CHANNEL_FLAG_VOICE = 0x80
// General 0x18 = 0x10 | 0x08
// Trade 0x3C = 0x20 | 0x10 | 0x08 | 0x04
- // LocalDefence 0x18 = 0x10 | 0x08
+ // LocalDefense 0x18 = 0x10 | 0x08
// GuildRecruitment 0x38 = 0x20 | 0x10 | 0x08
// LookingForGroup 0x50 = 0x40 | 0x10
};
@@ -118,27 +114,29 @@ enum ChannelMemberFlags
// 0x80
};
-class Channel
+class TC_GAME_API Channel
{
struct PlayerInfo
{
- ObjectGuid player;
uint8 flags;
bool HasFlag(uint8 flag) const { return (flags & flag) != 0; }
void SetFlag(uint8 flag) { flags |= flag; }
+
bool IsOwner() const { return (flags & MEMBER_FLAG_OWNER) != 0; }
void SetOwner(bool state)
{
if (state) flags |= MEMBER_FLAG_OWNER;
else flags &= ~MEMBER_FLAG_OWNER;
}
+
bool IsModerator() const { return (flags & MEMBER_FLAG_MODERATOR) != 0; }
void SetModerator(bool state)
{
if (state) flags |= MEMBER_FLAG_MODERATOR;
else flags &= ~MEMBER_FLAG_MODERATOR;
}
+
bool IsMuted() const { return (flags & MEMBER_FLAG_MUTED) != 0; }
void SetMuted(bool state)
{
@@ -148,106 +146,121 @@ class Channel
};
public:
- Channel(std::string const& name, uint32 channel_id, uint32 Team = 0);
- std::string const& GetName() const { return _name; }
+ Channel(std::string const& name, uint32 channel_id, uint32 team = 0);
+
+ std::string const& GetName() const { return _channelName; }
+
uint32 GetChannelId() const { return _channelId; }
bool IsConstant() const { return _channelId != 0; }
- bool IsAnnounce() const { return _announce; }
bool IsLFG() const { return (GetFlags() & CHANNEL_FLAG_LFG) != 0; }
- std::string const& GetPassword() const { return _password; }
- void SetPassword(std::string const& npassword) { _password = npassword; }
- void SetAnnounce(bool nannounce) { _announce = nannounce; }
- uint32 GetNumPlayers() const { return playersStore.size(); }
- uint8 GetFlags() const { return _flags; }
- bool HasFlag(uint8 flag) const { return (_flags & flag) != 0; }
+
+ bool IsAnnounce() const { return _announceEnabled; }
+ void SetAnnounce(bool nannounce) { _announceEnabled = nannounce; }
+
+ std::string const& GetPassword() const { return _channelPassword; }
+ void SetPassword(std::string const& npassword) { _channelPassword = npassword; }
+
+ uint32 GetNumPlayers() const { return _playersStore.size(); }
+
+ uint8 GetFlags() const { return _channelFlags; }
+ bool HasFlag(uint8 flag) const { return (_channelFlags & flag) != 0; }
void JoinChannel(Player* player, std::string const& pass);
void LeaveChannel(Player* player, bool send = true);
+
void KickOrBan(Player const* player, std::string const& badname, bool ban);
void Kick(Player const* player, std::string const& badname) { KickOrBan(player, badname, false); }
void Ban(Player const* player, std::string const& badname) { KickOrBan(player, badname, true); }
+
void UnBan(Player const* player, std::string const& badname);
void Password(Player const* player, std::string const& pass);
void SetMode(Player const* player, std::string const& p2n, bool mod, bool set);
- void SetOwner(ObjectGuid guid, bool exclaim = true);
- void SetOwner(Player const* player, std::string const& name);
- void SendWhoOwner(ObjectGuid guid);
+
void SetModerator(Player const* player, std::string const& newname) { SetMode(player, newname, true, true); }
void UnsetModerator(Player const* player, std::string const& newname) { SetMode(player, newname, true, false); }
void SetMute(Player const* player, std::string const& newname) { SetMode(player, newname, false, true); }
void UnsetMute(Player const* player, std::string const& newname) { SetMode(player, newname, false, false); }
- void List(Player const* player);
+
+ void SetOwner(ObjectGuid guid, bool exclaim = true);
+ void SetOwner(Player const* player, std::string const& name);
+ void SendWhoOwner(ObjectGuid guid);
+
+ void List(Player const* player) const;
void Announce(Player const* player);
- void Say(ObjectGuid guid, std::string const& what, uint32 lang);
+ void Say(ObjectGuid guid, std::string const& what, uint32 lang) const;
void Invite(Player const* player, std::string const& newp);
- void Voice(ObjectGuid guid1, ObjectGuid guid2);
- void DeVoice(ObjectGuid guid1, ObjectGuid guid2);
- void JoinNotify(ObjectGuid guid); // invisible notify
- void LeaveNotify(ObjectGuid guid); // invisible notify
- void SetOwnership(bool ownership) { _ownership = ownership; }
+ void Voice(ObjectGuid guid1, ObjectGuid guid2) const;
+ void DeVoice(ObjectGuid guid1, ObjectGuid guid2) const;
+ void JoinNotify(ObjectGuid guid) const; // invisible notify
+ void LeaveNotify(ObjectGuid guid) const; // invisible notify
+ void SetOwnership(bool ownership) { _ownershipEnabled = ownership; }
static void CleanOldChannelsInDB();
private:
// initial packet data (notify type and channel name)
- void MakeNotifyPacket(WorldPacket* data, uint8 notify_type);
+ void MakeNotifyPacket(WorldPacket* data, uint8 notify_type) const;
// type specific packet data
- void MakeJoined(WorldPacket* data, ObjectGuid guid); //+ 0x00
- void MakeLeft(WorldPacket* data, ObjectGuid guid); //+ 0x01
- void MakeYouJoined(WorldPacket* data); //+ 0x02
- void MakeYouLeft(WorldPacket* data); //+ 0x03
- void MakeWrongPassword(WorldPacket* data); //? 0x04
- void MakeNotMember(WorldPacket* data); //? 0x05
- void MakeNotModerator(WorldPacket* data); //? 0x06
- void MakePasswordChanged(WorldPacket* data, ObjectGuid guid); //+ 0x07
- void MakeOwnerChanged(WorldPacket* data, ObjectGuid guid); //? 0x08
- void MakePlayerNotFound(WorldPacket* data, std::string const& name); //+ 0x09
- void MakeNotOwner(WorldPacket* data); //? 0x0A
- void MakeChannelOwner(WorldPacket* data); //? 0x0B
- void MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags);//+ 0x0C
- void MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid); //+ 0x0D
- void MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid); //+ 0x0E
- void MakeMuted(WorldPacket* data); //? 0x11
- void MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good);//? 0x12
- void MakeBanned(WorldPacket* data); //? 0x13
- void MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good);//? 0x14
- void MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good);//? 0x15
- void MakePlayerNotBanned(WorldPacket* data, std::string const& name); //? 0x16
- void MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid); //+ 0x17
- void MakeInvite(WorldPacket* data, ObjectGuid guid); //? 0x18
- void MakeInviteWrongFaction(WorldPacket* data); //? 0x19
- void MakeWrongFaction(WorldPacket* data); //? 0x1A
- void MakeInvalidName(WorldPacket* data); //? 0x1B
- void MakeNotModerated(WorldPacket* data); //? 0x1C
- void MakePlayerInvited(WorldPacket* data, std::string const& name); //+ 0x1D
- void MakePlayerInviteBanned(WorldPacket* data, std::string const& name);//? 0x1E
- void MakeThrottled(WorldPacket* data); //? 0x1F
- void MakeNotInArea(WorldPacket* data); //? 0x20
- void MakeNotInLfg(WorldPacket* data); //? 0x21
- void MakeVoiceOn(WorldPacket* data, ObjectGuid guid); //+ 0x22
- void MakeVoiceOff(WorldPacket* data, ObjectGuid guid); //+ 0x23
-
- void SendToAll(WorldPacket* data, ObjectGuid guid = ObjectGuid::Empty);
- void SendToAllButOne(WorldPacket* data, ObjectGuid who);
- void SendToOne(WorldPacket* data, ObjectGuid who);
-
- bool IsOn(ObjectGuid who) const { return playersStore.find(who) != playersStore.end(); }
- bool IsBanned(ObjectGuid guid) const { return bannedStore.find(guid) != bannedStore.end(); }
+ void MakeJoined(WorldPacket* data, ObjectGuid guid) const; //+ 0x00
+ void MakeLeft(WorldPacket* data, ObjectGuid guid) const; //+ 0x01
+ void MakeYouJoined(WorldPacket* data) const; //+ 0x02
+ void MakeYouLeft(WorldPacket* data) const; //+ 0x03
+ void MakeWrongPassword(WorldPacket* data) const; //? 0x04
+ void MakeNotMember(WorldPacket* data) const; //? 0x05
+ void MakeNotModerator(WorldPacket* data) const; //? 0x06
+ void MakePasswordChanged(WorldPacket* data, ObjectGuid guid) const; //+ 0x07
+ void MakeOwnerChanged(WorldPacket* data, ObjectGuid guid) const; //? 0x08
+ void MakePlayerNotFound(WorldPacket* data, std::string const& name) const; //+ 0x09
+ void MakeNotOwner(WorldPacket* data) const; //? 0x0A
+ void MakeChannelOwner(WorldPacket* data) const; //? 0x0B
+ void MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags) const; //+ 0x0C
+ void MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid) const; //+ 0x0D
+ void MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid) const; //+ 0x0E
+ void MakeMuted(WorldPacket* data) const; //? 0x11
+ void MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const; //? 0x12
+ void MakeBanned(WorldPacket* data) const; //? 0x13
+ void MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const; //? 0x14
+ void MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const; //? 0x15
+ void MakePlayerNotBanned(WorldPacket* data, std::string const& name) const; //? 0x16
+ void MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid) const; //+ 0x17
+ void MakeInvite(WorldPacket* data, ObjectGuid guid) const; //? 0x18
+ void MakeInviteWrongFaction(WorldPacket* data) const; //? 0x19
+ void MakeWrongFaction(WorldPacket* data) const; //? 0x1A
+ void MakeInvalidName(WorldPacket* data) const; //? 0x1B
+ void MakeNotModerated(WorldPacket* data) const; //? 0x1C
+ void MakePlayerInvited(WorldPacket* data, std::string const& name) const; //+ 0x1D
+ void MakePlayerInviteBanned(WorldPacket* data, std::string const& name) const; //? 0x1E
+ void MakeThrottled(WorldPacket* data) const; //? 0x1F
+ void MakeNotInArea(WorldPacket* data) const; //? 0x20
+ void MakeNotInLfg(WorldPacket* data) const; //? 0x21
+ void MakeVoiceOn(WorldPacket* data, ObjectGuid guid) const; //+ 0x22
+ void MakeVoiceOff(WorldPacket* data, ObjectGuid guid) const; //+ 0x23
+
+ void SendToAll(WorldPacket* data, ObjectGuid guid = ObjectGuid::Empty) const;
+ void SendToAllButOne(WorldPacket* data, ObjectGuid who) const;
+ void SendToOne(WorldPacket* data, ObjectGuid who) const;
+
+ bool IsOn(ObjectGuid who) const { return _playersStore.count(who) != 0; }
+ bool IsBanned(ObjectGuid guid) const { return _bannedStore.count(guid) != 0; }
void UpdateChannelInDB() const;
void UpdateChannelUseageInDB() const;
uint8 GetPlayerFlags(ObjectGuid guid) const
{
- PlayerContainer::const_iterator itr = playersStore.find(guid);
- return itr != playersStore.end() ? itr->second.flags : 0;
+ PlayerContainer::const_iterator itr = _playersStore.find(guid);
+ return itr != _playersStore.end() ? itr->second.flags : 0;
}
void SetModerator(ObjectGuid guid, bool set)
{
- if (playersStore[guid].IsModerator() != set)
+ if (!IsOn(guid))
+ return;
+
+ PlayerInfo& playerInfo = _playersStore.at(guid);
+ if (playerInfo.IsModerator() != set)
{
uint8 oldFlag = GetPlayerFlags(guid);
- playersStore[guid].SetModerator(set);
+ playerInfo.SetModerator(set);
WorldPacket data;
MakeModeChange(&data, guid, oldFlag);
@@ -257,10 +270,14 @@ class Channel
void SetMute(ObjectGuid guid, bool set)
{
- if (playersStore[guid].IsMuted() != set)
+ if (!IsOn(guid))
+ return;
+
+ PlayerInfo& playerInfo = _playersStore.at(guid);
+ if (playerInfo.IsMuted() != set)
{
uint8 oldFlag = GetPlayerFlags(guid);
- playersStore[guid].SetMuted(set);
+ playerInfo.SetMuted(set);
WorldPacket data;
MakeModeChange(&data, guid, oldFlag);
@@ -269,19 +286,20 @@ class Channel
}
typedef std::map<ObjectGuid, PlayerInfo> PlayerContainer;
- typedef GuidSet BannedContainer;
+ typedef GuidUnorderedSet BannedContainer;
+
+ bool _announceEnabled; //< Whether we should broadcast a packet whenever a player joins/exits the channel
+ bool _ownershipEnabled; //< Whether the channel has to maintain an owner
+ bool _persistentChannel; //< Whether the channel is saved to DB
- bool _announce;
- bool _ownership;
- bool _IsSaved;
- uint8 _flags;
+ uint8 _channelFlags;
uint32 _channelId;
- uint32 _Team;
- ObjectGuid _ownerGUID;
- std::string _name;
- std::string _password;
- PlayerContainer playersStore;
- BannedContainer bannedStore;
+ uint32 _channelTeam;
+ ObjectGuid _ownerGuid;
+ std::string _channelName;
+ std::string _channelPassword;
+ PlayerContainer _playersStore;
+ BannedContainer _bannedStore;
};
#endif
diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp
index 3e9a633729a..043d4bdc2bc 100644
--- a/src/server/game/Chat/Channels/ChannelMgr.cpp
+++ b/src/server/game/Chat/Channels/ChannelMgr.cpp
@@ -39,14 +39,14 @@ ChannelMgr* ChannelMgr::forTeam(uint32 team)
if (team == HORDE)
return &hordeChannelMgr;
- return NULL;
+ return nullptr;
}
Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channelId)
{
std::wstring wname;
if (!Utf8toWStr(name, wname))
- return NULL;
+ return nullptr;
wstrToLower(wname);
@@ -66,7 +66,7 @@ Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pk
{
std::wstring wname;
if (!Utf8toWStr(name, wname))
- return NULL;
+ return nullptr;
wstrToLower(wname);
@@ -81,7 +81,7 @@ Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pk
player->GetSession()->SendPacket(&data);
}
- return NULL;
+ return nullptr;
}
return i->second;
diff --git a/src/server/game/Chat/Channels/ChannelMgr.h b/src/server/game/Chat/Channels/ChannelMgr.h
index 2cd4edc4fb1..abe45690997 100644
--- a/src/server/game/Chat/Channels/ChannelMgr.h
+++ b/src/server/game/Chat/Channels/ChannelMgr.h
@@ -28,7 +28,7 @@
#define MAX_CHANNEL_PASS_STR 31
-class ChannelMgr
+class TC_GAME_API ChannelMgr
{
typedef std::map<std::wstring, Channel*> ChannelMap;
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 8fe0810f3b9..27fa7ffb409 100644
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -32,18 +32,19 @@
#include "ScriptMgr.h"
#include "ChatLink.h"
-bool ChatHandler::load_command_table = true;
+// Lazy loading of the command table cache from commands and the
+// ScriptMgr should be thread safe since the player commands,
+// cli commands and ScriptMgr updates are all dispatched one after
+// one inside the world update loop.
+static Optional<std::vector<ChatCommand>> commandTableCache;
std::vector<ChatCommand> const& ChatHandler::getCommandTable()
{
- static std::vector<ChatCommand> commandTableCache;
-
- if (LoadCommandTable())
+ if (!commandTableCache)
{
- SetLoadCommandTable(false);
-
- std::vector<ChatCommand> cmds = sScriptMgr->GetChatCommands();
- commandTableCache.swap(cmds);
+ // We need to initialize this at top since SetDataForCommandInTable
+ // calls getCommandTable() recursively.
+ commandTableCache = sScriptMgr->GetChatCommands();
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_COMMANDS);
PreparedQueryResult result = WorldDatabase.Query(stmt);
@@ -54,13 +55,18 @@ std::vector<ChatCommand> const& ChatHandler::getCommandTable()
Field* fields = result->Fetch();
std::string name = fields[0].GetString();
- SetDataForCommandInTable(commandTableCache, name.c_str(), fields[1].GetUInt16(), fields[2].GetString(), name);
+ SetDataForCommandInTable(*commandTableCache, name.c_str(), fields[1].GetUInt16(), fields[2].GetString(), name);
}
while (result->NextRow());
}
}
- return commandTableCache;
+ return *commandTableCache;
+}
+
+void ChatHandler::invalidateCommandTable()
+{
+ commandTableCache.reset();
}
char const* ChatHandler::GetTrinityString(uint32 entry) const
@@ -75,7 +81,7 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const
bool ChatHandler::HasLowerSecurity(Player* target, ObjectGuid guid, bool strong)
{
- WorldSession* target_session = NULL;
+ WorldSession* target_session = nullptr;
uint32 target_account = 0;
if (target)
@@ -108,9 +114,9 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
if (target)
target_sec = target->GetSecurity();
else if (target_account)
- target_sec = AccountMgr::GetSecurity(target_account, realmID);
+ target_sec = AccountMgr::GetSecurity(target_account, realm.Id.Realm);
else
- return true; // caller must report error for (target == NULL && target_account == 0)
+ return true; // caller must report error for (target == nullptr && target_account == 0)
AccountTypes target_ac_sec = AccountTypes(target_sec);
if (m_session->GetSecurity() < target_ac_sec || (strong && m_session->GetSecurity() <= target_ac_sec))
@@ -123,7 +129,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
return false;
}
-bool ChatHandler::hasStringAbbr(const char* name, const char* part)
+bool ChatHandler::hasStringAbbr(char const* name, char const* part)
{
// non "" command
if (*name)
@@ -160,7 +166,7 @@ void ChatHandler::SendSysMessage(const char *str, bool escapeCharacters)
{
size_t startPos = 0;
std::ostringstream o;
- while (const char* charPos = strchr(str + startPos, '|'))
+ while (char const* charPos = strchr(str + startPos, '|'))
{
o.write(str + startPos, charPos - str - startPos);
o << "||";
@@ -178,7 +184,7 @@ void ChatHandler::SendSysMessage(const char *str, bool escapeCharacters)
while (char* line = LineFromMessage(pos))
{
- BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
+ BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
m_session->SendPacket(&data);
}
@@ -196,7 +202,7 @@ void ChatHandler::SendGlobalSysMessage(const char *str)
while (char* line = LineFromMessage(pos))
{
- BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
+ BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
sWorld->SendGlobalMessage(&data);
}
@@ -214,7 +220,7 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str)
while (char* line = LineFromMessage(pos))
{
- BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
+ BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
sWorld->SendGlobalGMMessage(&data);
}
@@ -226,7 +232,7 @@ void ChatHandler::SendSysMessage(uint32 entry)
SendSysMessage(GetTrinityString(entry));
}
-bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, const char* text, std::string const& fullcmd)
+bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, char const* text, std::string const& fullcmd)
{
char const* oldtext = text;
std::string cmd = "";
@@ -360,7 +366,7 @@ bool ChatHandler::SetDataForCommandInTable(std::vector<ChatCommand>& table, char
// expected subcommand by full name DB content
else if (*text)
{
- TC_LOG_ERROR("sql.sql", "Table `command` have unexpected subcommand '%s' in command '%s', skip.", text, fullcommand.c_str());
+ TC_LOG_ERROR("sql.sql", "Table `command` contains an unexpected subcommand '%s' in command '%s', skipped.", text, fullcommand.c_str());
return false;
}
@@ -376,9 +382,9 @@ bool ChatHandler::SetDataForCommandInTable(std::vector<ChatCommand>& table, char
if (!cmd.empty())
{
if (&table == &getCommandTable())
- TC_LOG_ERROR("sql.sql", "Table `command` have not existed command '%s', skip.", cmd.c_str());
+ TC_LOG_ERROR("sql.sql", "Table `command` contains a non-existing command '%s', skipped.", cmd.c_str());
else
- TC_LOG_ERROR("sql.sql", "Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str());
+ TC_LOG_ERROR("sql.sql", "Table `command` contains a non-existing subcommand '%s' in command '%s', skipped.", cmd.c_str(), fullcommand.c_str());
}
return false;
@@ -444,7 +450,7 @@ Valid examples:
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) < 3)
{
const char validSequence[6] = "cHhhr";
- const char* validSequenceIterator = validSequence;
+ char const* validSequenceIterator = validSequence;
const std::string validCommands = "cHhr|";
while (*message)
@@ -486,7 +492,7 @@ bool ChatHandler::ShowHelpForSubCommands(std::vector<ChatCommand> const& table,
std::string list;
for (uint32 i = 0; i < table.size(); ++i)
{
- // must be available (ignore handler existence for show command with possible available subcommands)
+ // must be available (ignore handler existence to show command with possible available subcommands)
if (!isAvailable(table[i]))
continue;
@@ -519,13 +525,13 @@ bool ChatHandler::ShowHelpForSubCommands(std::vector<ChatCommand> const& table,
return true;
}
-bool ChatHandler::ShowHelpForCommand(std::vector<ChatCommand> const& table, const char* cmd)
+bool ChatHandler::ShowHelpForCommand(std::vector<ChatCommand> const& table, char const* cmd)
{
if (*cmd)
{
for (uint32 i = 0; i < table.size(); ++i)
{
- // must be available (ignore handler existence for show command with possible available subcommands)
+ // must be available (ignore handler existence to show command with possible available subcommands)
if (!isAvailable(table[i]))
continue;
@@ -533,7 +539,7 @@ bool ChatHandler::ShowHelpForCommand(std::vector<ChatCommand> const& table, cons
continue;
// have subcommand
- char const* subcmd = (*cmd) ? strtok(NULL, " ") : "";
+ char const* subcmd = (*cmd) ? strtok(nullptr, " ") : "";
if (!table[i].ChildCommands.empty() && subcmd && *subcmd)
{
@@ -555,7 +561,7 @@ bool ChatHandler::ShowHelpForCommand(std::vector<ChatCommand> const& table, cons
{
for (uint32 i = 0; i < table.size(); ++i)
{
- // must be available (ignore handler existence for show command with possible available subcommands)
+ // must be available (ignore handler existence to show command with possible available subcommands)
if (!isAvailable(table[i]))
continue;
@@ -688,7 +694,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
Player* ChatHandler::getSelectedPlayer()
{
if (!m_session)
- return NULL;
+ return nullptr;
ObjectGuid selected = m_session->GetPlayer()->GetTarget();
if (!selected)
@@ -700,7 +706,7 @@ Player* ChatHandler::getSelectedPlayer()
Unit* ChatHandler::getSelectedUnit()
{
if (!m_session)
- return NULL;
+ return nullptr;
if (Unit* selected = m_session->GetPlayer()->GetSelectedUnit())
return selected;
@@ -711,7 +717,7 @@ Unit* ChatHandler::getSelectedUnit()
WorldObject* ChatHandler::getSelectedObject()
{
if (!m_session)
- return NULL;
+ return nullptr;
ObjectGuid guid = m_session->GetPlayer()->GetTarget();
@@ -724,7 +730,7 @@ WorldObject* ChatHandler::getSelectedObject()
Creature* ChatHandler::getSelectedCreature()
{
if (!m_session)
- return NULL;
+ return nullptr;
return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(), m_session->GetPlayer()->GetTarget());
}
@@ -732,7 +738,7 @@ Creature* ChatHandler::getSelectedCreature()
Player* ChatHandler::getSelectedPlayerOrSelf()
{
if (!m_session)
- return NULL;
+ return nullptr;
ObjectGuid selected = m_session->GetPlayer()->GetTarget();
if (!selected)
@@ -751,14 +757,14 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s
{
// skip empty
if (!text)
- return NULL;
+ return nullptr;
// skip spaces
while (*text == ' '||*text == '\t'||*text == '\b')
++text;
if (!*text)
- return NULL;
+ return nullptr;
// return non link case
if (text[0] != '|')
@@ -770,28 +776,28 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s
char* check = strtok(text, "|"); // skip color
if (!check)
- return NULL; // end of data
+ return nullptr; // end of data
- char* cLinkType = strtok(NULL, ":"); // linktype
+ char* cLinkType = strtok(nullptr, ":"); // linktype
if (!cLinkType)
- return NULL; // end of data
+ return nullptr; // end of data
if (strcmp(cLinkType, linkType) != 0)
{
- strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after retturn from function
+ strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after retturn from function
SendSysMessage(LANG_WRONG_LINK_TYPE);
- return NULL;
+ return nullptr;
}
- char* cKeys = strtok(NULL, "|"); // extract keys and values
- char* cKeysTail = strtok(NULL, "");
+ char* cKeys = strtok(nullptr, "|"); // extract keys and values
+ char* cKeysTail = strtok(nullptr, "");
char* cKey = strtok(cKeys, ":|"); // extract key
if (something1)
- *something1 = strtok(NULL, ":|"); // extract something
+ *something1 = strtok(nullptr, ":|"); // extract something
strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
- strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
+ strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
return cKey;
}
@@ -799,14 +805,14 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
{
// skip empty
if (!text)
- return NULL;
+ return nullptr;
// skip spaces
while (*text == ' '||*text == '\t'||*text == '\b')
++text;
if (!*text)
- return NULL;
+ return nullptr;
// return non link case
if (text[0] != '|')
@@ -824,48 +830,48 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
{
char* check = strtok(text, "|"); // skip color
if (!check)
- return NULL; // end of data
+ return nullptr; // end of data
- tail = strtok(NULL, ""); // tail
+ tail = strtok(nullptr, ""); // tail
}
else
tail = text+1; // skip first |
char* cLinkType = strtok(tail, ":"); // linktype
if (!cLinkType)
- return NULL; // end of data
+ return nullptr; // end of data
for (int i = 0; linkTypes[i]; ++i)
{
if (strcmp(cLinkType, linkTypes[i]) == 0)
{
- char* cKeys = strtok(NULL, "|"); // extract keys and values
- char* cKeysTail = strtok(NULL, "");
+ char* cKeys = strtok(nullptr, "|"); // extract keys and values
+ char* cKeysTail = strtok(nullptr, "");
char* cKey = strtok(cKeys, ":|"); // extract key
if (something1)
- *something1 = strtok(NULL, ":|"); // extract something
+ *something1 = strtok(nullptr, ":|"); // extract something
strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
- strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
+ strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
if (found_idx)
*found_idx = i;
return cKey;
}
}
- strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
+ strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
SendSysMessage(LANG_WRONG_LINK_TYPE);
- return NULL;
+ return nullptr;
}
GameObject* ChatHandler::GetNearbyGameObject()
{
if (!m_session)
- return NULL;
+ return nullptr;
Player* pl = m_session->GetPlayer();
- GameObject* obj = NULL;
+ GameObject* obj = nullptr;
Trinity::NearestGameObjectCheck check(*pl);
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectCheck> searcher(pl, obj, check);
pl->VisitNearbyGridObject(SIZE_OF_GRIDS, searcher);
@@ -875,7 +881,7 @@ GameObject* ChatHandler::GetNearbyGameObject()
GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(ObjectGuid::LowType lowguid, uint32 entry)
{
if (!m_session)
- return NULL;
+ return nullptr;
Player* pl = m_session->GetPlayer();
@@ -920,7 +926,7 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text)
// number or [name] Shift-click form |color|Htalent:talent_id, rank|h[name]|h|r
// number or [name] Shift-click form |color|Htrade:spell_id, skill_id, max_value, cur_value|h[name]|h|r
int type = 0;
- char* param1_str = NULL;
+ char* param1_str = nullptr;
char* idS = extractKeyFromLink(text, spellKeys, &type, &param1_str);
if (!idS)
return 0;
@@ -968,7 +974,7 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
char* cId = extractKeyFromLink(text, "Htele");
if (!cId)
- return NULL;
+ return nullptr;
// id case (explicit or from shift link)
if (cId[0] >= '0' || cId[0] >= '9')
@@ -1058,7 +1064,7 @@ std::string ChatHandler::extractPlayerNameFromLink(char* text)
return name;
}
-bool ChatHandler::extractPlayerTarget(char* args, Player** player, ObjectGuid* player_guid /*=NULL*/, std::string* player_name /*= NULL*/)
+bool ChatHandler::extractPlayerTarget(char* args, Player** player, ObjectGuid* player_guid /*=nullptr*/, std::string* player_name /*= nullptr*/)
{
if (args && *args)
{
@@ -1100,7 +1106,7 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, ObjectGuid* p
*player_name = pl ? pl->GetName() : "";
}
- // some from req. data must be provided (note: name is empty if player not exist)
+ // some from req. data must be provided (note: name is empty if player does not exist)
if ((!player || !*player) && (!player_guid || !*player_guid) && (!player_name || player_name->empty()))
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
@@ -1114,12 +1120,12 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, ObjectGuid* p
void ChatHandler::extractOptFirstArg(char* args, char** arg1, char** arg2)
{
char* p1 = strtok(args, " ");
- char* p2 = strtok(NULL, " ");
+ char* p2 = strtok(nullptr, " ");
if (!p2)
{
p2 = p1;
- p1 = NULL;
+ p1 = nullptr;
}
if (arg1)
@@ -1132,7 +1138,7 @@ void ChatHandler::extractOptFirstArg(char* args, char** arg1, char** arg2)
char* ChatHandler::extractQuotedArg(char* args)
{
if (!args || !*args)
- return NULL;
+ return nullptr;
if (*args == '"')
return strtok(args+1, "\"");
@@ -1145,9 +1151,9 @@ char* ChatHandler::extractQuotedArg(char* args)
continue;
}
- // return NULL if we reached the end of the string
+ // return nullptr if we reached the end of the string
if (!*args)
- return NULL;
+ return nullptr;
// since we skipped all spaces, we expect another token now
if (*args == '"')
@@ -1165,7 +1171,7 @@ char* ChatHandler::extractQuotedArg(char* args)
return strtok(args + 1, "\"");
}
else
- return NULL;
+ return nullptr;
}
}
@@ -1217,9 +1223,9 @@ bool CliHandler::needReportToTarget(Player* /*chr*/) const
return true;
}
-bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline)
+bool ChatHandler::GetPlayerGroupAndGUIDByName(char const* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline)
{
- player = NULL;
+ player = nullptr;
guid.Clear();
if (cname)
diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h
index 7ce0792cdf9..a700afdf97d 100644
--- a/src/server/game/Chat/Chat.h
+++ b/src/server/game/Chat/Chat.h
@@ -36,7 +36,7 @@ class WorldObject;
struct GameTele;
-class ChatCommand
+class TC_GAME_API ChatCommand
{
typedef bool(*pHandler)(ChatHandler*, char const*);
@@ -52,7 +52,7 @@ class ChatCommand
std::vector<ChatCommand> ChildCommands;
};
-class ChatHandler
+class TC_GAME_API ChatHandler
{
public:
WorldSession* GetSession() { return m_session; }
@@ -67,7 +67,7 @@ class ChatHandler
// Builds chat packet and returns receiver guid position in the packet to substitute in whisper builders
static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string const& message, uint32 achievementId = 0, std::string const& channelName = "", LocaleConstant locale = DEFAULT_LOCALE);
- static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = NULL; return start; }
+ static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = nullptr; return start; }
// function with different implementation for chat/console
virtual char const* GetTrinityString(uint32 entry) const;
@@ -76,7 +76,7 @@ class ChatHandler
void SendSysMessage(uint32 entry);
template<typename... Args>
- void PSendSysMessage(const char* fmt, Args&&... args)
+ void PSendSysMessage(char const* fmt, Args&&... args)
{
SendSysMessage(Trinity::StringFormat(fmt, std::forward<Args>(args)...).c_str());
}
@@ -93,14 +93,15 @@ class ChatHandler
return Trinity::StringFormat(GetTrinityString(entry), std::forward<Args>(args)...);
}
- bool ParseCommands(const char* text);
+ bool ParseCommands(char const* text);
static std::vector<ChatCommand> const& getCommandTable();
+ static void invalidateCommandTable();
- bool isValidChatMessage(const char* msg);
+ bool isValidChatMessage(char const* msg);
void SendGlobalSysMessage(const char *str);
- bool hasStringAbbr(const char* name, const char* part);
+ bool hasStringAbbr(char const* name, char const* part);
// function with different implementation for chat/console
virtual bool isAvailable(ChatCommand const& cmd) const;
@@ -121,20 +122,20 @@ class ChatHandler
// Returns either the selected player or self if there is no selected player
Player* getSelectedPlayerOrSelf();
- char* extractKeyFromLink(char* text, char const* linkType, char** something1 = NULL);
- char* extractKeyFromLink(char* text, char const* const* linkTypes, int* found_idx, char** something1 = NULL);
+ char* extractKeyFromLink(char* text, char const* linkType, char** something1 = nullptr);
+ char* extractKeyFromLink(char* text, char const* const* linkTypes, int* found_idx, char** something1 = nullptr);
- // if args have single value then it return in arg2 and arg1 == NULL
+ // if args have single value then it return in arg2 and arg1 == nullptr
void extractOptFirstArg(char* args, char** arg1, char** arg2);
char* extractQuotedArg(char* args);
uint32 extractSpellIdFromLink(char* text);
ObjectGuid extractGuidFromLink(char* text);
GameTele const* extractGameTeleFromLink(char* text);
- bool GetPlayerGroupAndGUIDByName(const char* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline = false);
+ bool GetPlayerGroupAndGUIDByName(char const* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline = false);
std::string extractPlayerNameFromLink(char* text);
// select by arg (name/link) or in-game selection online/offline player or self if a creature is selected
- bool extractPlayerTarget(char* args, Player** player, ObjectGuid* player_guid = NULL, std::string* player_name = NULL);
+ bool extractPlayerTarget(char* args, Player** player, ObjectGuid* player_guid = nullptr, std::string* player_name = nullptr);
std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; }
std::string GetNameLink(Player* chr) const;
@@ -143,25 +144,22 @@ class ChatHandler
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(ObjectGuid::LowType lowguid, uint32 entry);
bool HasSentErrorMessage() const { return sentErrorMessage; }
void SetSentErrorMessage(bool val){ sentErrorMessage = val; }
- static bool LoadCommandTable() { return load_command_table; }
- static void SetLoadCommandTable(bool val) { load_command_table = val; }
- bool ShowHelpForCommand(std::vector<ChatCommand> const& table, const char* cmd);
+ bool ShowHelpForCommand(std::vector<ChatCommand> const& table, char const* cmd);
protected:
- explicit ChatHandler() : m_session(NULL), sentErrorMessage(false) { } // for CLI subclass
- static bool SetDataForCommandInTable(std::vector<ChatCommand>& table, const char* text, uint32 permission, std::string const& help, std::string const& fullcommand);
- bool ExecuteCommandInTable(std::vector<ChatCommand> const& table, const char* text, std::string const& fullcmd);
+ explicit ChatHandler() : m_session(nullptr), sentErrorMessage(false) { } // for CLI subclass
+ static bool SetDataForCommandInTable(std::vector<ChatCommand>& table, char const* text, uint32 permission, std::string const& help, std::string const& fullcommand);
+ bool ExecuteCommandInTable(std::vector<ChatCommand> const& table, char const* text, std::string const& fullcmd);
bool ShowHelpForSubCommands(std::vector<ChatCommand> const& table, char const* cmd, char const* subcmd);
private:
- WorldSession* m_session; // != NULL for chat command call and NULL for CLI command
+ WorldSession* m_session; // != nullptr for chat command call and nullptr for CLI command
// common global flag
- static bool load_command_table;
bool sentErrorMessage;
};
-class CliHandler : public ChatHandler
+class TC_GAME_API CliHandler : public ChatHandler
{
public:
typedef void Print(void*, char const*);
diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp
index 3602b54bc44..92d69edb5e8 100644
--- a/src/server/game/Chat/ChatLink.cpp
+++ b/src/server/game/Chat/ChatLink.cpp
@@ -71,7 +71,7 @@ inline std::string ReadSkip(std::istringstream& iss, char term)
return res;
}
-inline bool CheckDelimiter(std::istringstream& iss, char delimiter, const char* context)
+inline bool CheckDelimiter(std::istringstream& iss, char delimiter, char const* context)
{
char c = iss.peek();
if (c != delimiter)
@@ -96,7 +96,7 @@ inline bool ReadHex(std::istringstream& iss, uint32& res, uint32 length)
#define DELIMITER ':'
#define PIPE_CHAR '|'
-bool ChatLink::ValidateName(char* buffer, const char* /*context*/)
+bool ChatLink::ValidateName(char* buffer, char const* /*context*/)
{
_name = buffer;
return true;
@@ -170,7 +170,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss)
inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const* locale, char* const* suffixStrings) const
{
std::stringstream ss;
- if (locale == NULL || index >= locale->Name.size())
+ if (locale == nullptr || index >= locale->Name.size())
ss << _item->Name1;
else
ss << locale->Name[index];
@@ -179,13 +179,13 @@ inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const* local
return ss.str();
}
-bool ItemChatLink::ValidateName(char* buffer, const char* context)
+bool ItemChatLink::ValidateName(char* buffer, char const* context)
{
ChatLink::ValidateName(buffer, context);
- char* const* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : NULL);
+ char* const* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : nullptr);
- bool res = (FormatName(LOCALE_enUS, NULL, suffixStrings) == buffer);
+ bool res = (FormatName(LOCALE_enUS, nullptr, suffixStrings) == buffer);
if (!res)
{
ItemLocale const* il = sObjectMgr->GetItemLocale(_item->ItemId);
@@ -239,7 +239,7 @@ bool QuestChatLink::Initialize(std::istringstream& iss)
return true;
}
-bool QuestChatLink::ValidateName(char* buffer, const char* context)
+bool QuestChatLink::ValidateName(char* buffer, char const* context)
{
ChatLink::ValidateName(buffer, context);
@@ -280,7 +280,7 @@ bool SpellChatLink::Initialize(std::istringstream& iss)
return true;
}
-bool SpellChatLink::ValidateName(char* buffer, const char* context)
+bool SpellChatLink::ValidateName(char* buffer, char const* context)
{
ChatLink::ValidateName(buffer, context);
@@ -373,7 +373,7 @@ bool AchievementChatLink::Initialize(std::istringstream& iss)
return true;
}
-bool AchievementChatLink::ValidateName(char* buffer, const char* context)
+bool AchievementChatLink::ValidateName(char* buffer, char const* context)
{
ChatLink::ValidateName(buffer, context);
@@ -537,7 +537,7 @@ bool GlyphChatLink::Initialize(std::istringstream& iss)
return true;
}
-LinkExtractor::LinkExtractor(const char* msg) : _iss(msg) { }
+LinkExtractor::LinkExtractor(char const* msg) : _iss(msg) { }
LinkExtractor::~LinkExtractor()
{
@@ -549,19 +549,19 @@ LinkExtractor::~LinkExtractor()
bool LinkExtractor::IsValidMessage()
{
const char validSequence[6] = "cHhhr";
- const char* validSequenceIterator = validSequence;
+ char const* validSequenceIterator = validSequence;
char buffer[256];
std::istringstream::pos_type startPos = 0;
uint32 color = 0;
- ChatLink* link = NULL;
+ ChatLink* link = nullptr;
while (!_iss.eof())
{
if (validSequence == validSequenceIterator)
{
- link = NULL;
+ link = nullptr;
_iss.ignore(255, PIPE_CHAR);
startPos = _iss.tellg() - std::istringstream::pos_type(1);
}
diff --git a/src/server/game/Chat/ChatLink.h b/src/server/game/Chat/ChatLink.h
index 4adb61bbbf1..32ea4b73698 100644
--- a/src/server/game/Chat/ChatLink.h
+++ b/src/server/game/Chat/ChatLink.h
@@ -34,7 +34,7 @@ class Quest;
///////////////////////////////////////////////////////////////////////////////////////////////////
// ChatLink - abstract base class for various links
-class ChatLink
+class TC_GAME_API ChatLink
{
public:
ChatLink() : _color(0), _startPos(0), _endPos(0) { }
@@ -44,7 +44,7 @@ public:
void SetBounds(std::istringstream::pos_type startPos, std::istringstream::pos_type endPos) { _startPos = startPos; _endPos = endPos; }
virtual bool Initialize(std::istringstream& iss) = 0;
- virtual bool ValidateName(char* buffer, const char* context) = 0;
+ virtual bool ValidateName(char* buffer, char const* context) = 0;
protected:
uint32 _color;
@@ -54,15 +54,15 @@ protected:
};
// ItemChatLink - link to item
-class ItemChatLink : public ChatLink
+class TC_GAME_API ItemChatLink : public ChatLink
{
public:
- ItemChatLink() : ChatLink(), _item(NULL), _suffix(NULL), _property(NULL)
+ ItemChatLink() : ChatLink(), _item(nullptr), _suffix(nullptr), _property(nullptr)
{
memset(_data, 0, sizeof(_data));
}
virtual bool Initialize(std::istringstream& iss) override;
- virtual bool ValidateName(char* buffer, const char* context) override;
+ virtual bool ValidateName(char* buffer, char const* context) override;
protected:
std::string FormatName(uint8 index, ItemLocale const* locale, char* const* suffixStrings) const;
@@ -74,12 +74,12 @@ protected:
};
// QuestChatLink - link to quest
-class QuestChatLink : public ChatLink
+class TC_GAME_API QuestChatLink : public ChatLink
{
public:
QuestChatLink() : ChatLink(), _quest(nullptr), _questLevel(0) { }
virtual bool Initialize(std::istringstream& iss) override;
- virtual bool ValidateName(char* buffer, const char* context) override;
+ virtual bool ValidateName(char* buffer, char const* context) override;
protected:
Quest const* _quest;
@@ -87,27 +87,27 @@ protected:
};
// SpellChatLink - link to quest
-class SpellChatLink : public ChatLink
+class TC_GAME_API SpellChatLink : public ChatLink
{
public:
SpellChatLink() : ChatLink(), _spell(nullptr) { }
virtual bool Initialize(std::istringstream& iss) override;
- virtual bool ValidateName(char* buffer, const char* context) override;
+ virtual bool ValidateName(char* buffer, char const* context) override;
protected:
SpellInfo const* _spell;
};
// AchievementChatLink - link to quest
-class AchievementChatLink : public ChatLink
+class TC_GAME_API AchievementChatLink : public ChatLink
{
public:
- AchievementChatLink() : ChatLink(), _guid(0), _achievement(NULL)
+ AchievementChatLink() : ChatLink(), _guid(0), _achievement(nullptr)
{
memset(_data, 0, sizeof(_data));
}
virtual bool Initialize(std::istringstream& iss) override;
- virtual bool ValidateName(char* buffer, const char* context) override;
+ virtual bool ValidateName(char* buffer, char const* context) override;
protected:
uint32 _guid;
@@ -116,7 +116,7 @@ protected:
};
// TradeChatLink - link to trade info
-class TradeChatLink : public SpellChatLink
+class TC_GAME_API TradeChatLink : public SpellChatLink
{
public:
TradeChatLink() : SpellChatLink(), _minSkillLevel(0), _maxSkillLevel(0), _guid(0) { }
@@ -129,7 +129,7 @@ private:
};
// TalentChatLink - link to talent
-class TalentChatLink : public SpellChatLink
+class TC_GAME_API TalentChatLink : public SpellChatLink
{
public:
TalentChatLink() : SpellChatLink(), _talentId(0), _rankId(0) { }
@@ -141,7 +141,7 @@ private:
};
// EnchantmentChatLink - link to enchantment
-class EnchantmentChatLink : public SpellChatLink
+class TC_GAME_API EnchantmentChatLink : public SpellChatLink
{
public:
EnchantmentChatLink() : SpellChatLink() { }
@@ -149,20 +149,20 @@ public:
};
// GlyphChatLink - link to glyph
-class GlyphChatLink : public SpellChatLink
+class TC_GAME_API GlyphChatLink : public SpellChatLink
{
public:
- GlyphChatLink() : SpellChatLink(), _slotId(0), _glyph(NULL) { }
+ GlyphChatLink() : SpellChatLink(), _slotId(0), _glyph(nullptr) { }
virtual bool Initialize(std::istringstream& iss) override;
private:
uint32 _slotId;
GlyphPropertiesEntry const* _glyph;
};
-class LinkExtractor
+class TC_GAME_API LinkExtractor
{
public:
- explicit LinkExtractor(const char* msg);
+ explicit LinkExtractor(char const* msg);
~LinkExtractor();
bool IsValidMessage();
diff --git a/src/server/game/Combat/HostileRefManager.h b/src/server/game/Combat/HostileRefManager.h
index 96152ed46f7..855f9e3d272 100644
--- a/src/server/game/Combat/HostileRefManager.h
+++ b/src/server/game/Combat/HostileRefManager.h
@@ -29,7 +29,7 @@ class SpellInfo;
//=================================================
-class HostileRefManager : public RefManager<Unit, ThreatManager>
+class TC_GAME_API HostileRefManager : public RefManager<Unit, ThreatManager>
{
private:
Unit* iOwner;
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index 588e7b1a93b..9767d69e2aa 100644
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -335,7 +335,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
{
// current victim is a second choice target, so don't compare threat with it below
if (currentRef == currentVictim)
- currentVictim = NULL;
+ currentVictim = nullptr;
++iter;
continue;
}
@@ -437,12 +437,15 @@ void ThreatManager::_addThreat(Unit* victim, float threat)
if (!ref) // there was no ref => create a new one
{
+ bool isFirst = iThreatContainer.empty();
// threat has to be 0 here
HostileReference* hostileRef = new HostileReference(victim, this, 0);
iThreatContainer.addReference(hostileRef);
hostileRef->addThreat(threat); // now we add the real threat
if (victim->GetTypeId() == TYPEID_PLAYER && victim->ToPlayer()->IsGameMaster())
hostileRef->setOnlineOfflineState(false); // GM is always offline
+ else if (isFirst)
+ setCurrentVictim(hostileRef);
}
}
diff --git a/src/server/game/Combat/ThreatManager.h b/src/server/game/Combat/ThreatManager.h
index 7d20e99c128..a68d803304d 100644
--- a/src/server/game/Combat/ThreatManager.h
+++ b/src/server/game/Combat/ThreatManager.h
@@ -39,14 +39,14 @@ class SpellInfo;
//==============================================================
// Class to calculate the real threat based
-struct ThreatCalcHelper
+struct TC_GAME_API ThreatCalcHelper
{
static float calcThreat(Unit* hatedUnit, Unit* hatingUnit, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
static bool isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellInfo const* threatSpell = NULL);
};
//==============================================================
-class HostileReference : public Reference<Unit, ThreatManager>
+class TC_GAME_API HostileReference : public Reference<Unit, ThreatManager>
{
public:
HostileReference(Unit* refUnit, ThreatManager* threatManager, float threat);
@@ -141,7 +141,7 @@ class HostileReference : public Reference<Unit, ThreatManager>
//==============================================================
class ThreatManager;
-class ThreatContainer
+class TC_GAME_API ThreatContainer
{
friend class ThreatManager;
@@ -169,7 +169,7 @@ class ThreatContainer
HostileReference* getMostHated() const
{
- return iThreatList.empty() ? NULL : iThreatList.front();
+ return iThreatList.empty() ? nullptr : iThreatList.front();
}
HostileReference* getReferenceByTarget(Unit* victim) const;
@@ -198,7 +198,7 @@ class ThreatContainer
//=================================================
-class ThreatManager
+class TC_GAME_API ThreatManager
{
public:
friend class HostileReference;
diff --git a/src/server/game/Combat/UnitEvents.h b/src/server/game/Combat/UnitEvents.h
index e501cdaa4a2..f50edcf3c7d 100644
--- a/src/server/game/Combat/UnitEvents.h
+++ b/src/server/game/Combat/UnitEvents.h
@@ -81,7 +81,7 @@ class UnitBaseEvent
//==============================================================
-class ThreatRefStatusChangeEvent : public UnitBaseEvent
+class TC_GAME_API ThreatRefStatusChangeEvent : public UnitBaseEvent
{
private:
HostileReference* iHostileReference;
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 4215a3a5d02..6317fae2767 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -55,7 +55,8 @@ char const* const ConditionMgr::StaticSourceTypeData[CONDITION_SOURCE_TYPE_MAX]
"SmartScript",
"Npc Vendor",
"Spell Proc",
- "Phase Def"
+ "Terrain Swap",
+ "Phase"
};
ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[CONDITION_MAX] =
@@ -100,7 +101,10 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND
{ "Health Value", true, true, false },
{ "Health Pct", true, true, false },
{ "Realm Achievement", true, false, false },
- { "In Water", false, false, false }
+ { "In Water", false, false, false },
+ { "Terrain Swap", false, false, false },
+ { "Sit/stand state", true, true, false },
+ { "Daily Quest Completed",true, false, false }
};
// Checks if object meets the condition
@@ -432,6 +436,25 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
condMeets = unit->IsInWater();
break;
}
+ case CONDITION_STAND_STATE:
+ {
+ if (Unit* unit = object->ToUnit())
+ {
+ if (ConditionValue1 == 0)
+ condMeets = (unit->GetStandState() == ConditionValue2);
+ else if (ConditionValue2 == 0)
+ condMeets = unit->IsStandState();
+ else if (ConditionValue2 == 1)
+ condMeets = unit->IsSitState();
+ }
+ break;
+ }
+ case CONDITION_DAILY_QUEST_DONE:
+ {
+ if (Player* player = object->ToPlayer())
+ condMeets = player->IsDailyQuestDone(ConditionValue1);
+ break;
+ }
default:
condMeets = false;
break;
@@ -602,6 +625,12 @@ uint32 Condition::GetSearcherTypeMaskForCondition() const
case CONDITION_IN_WATER:
mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER;
break;
+ case CONDITION_STAND_STATE:
+ mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER;
+ break;
+ case CONDITION_DAILY_QUEST_DONE:
+ mask |= GRID_MAP_TYPE_MASK_PLAYER;
+ break;
default:
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
break;
@@ -719,7 +748,7 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo,
//! If not found, add an entry in the store and set to true (placeholder)
if (itr == elseGroupStore.end())
elseGroupStore[condition->ElseGroup] = true;
- else if (!(*itr).second)
+ else if (!(*itr).second) //! If another condition in this group was unmatched before this, don't bother checking (the group is false anyway)
continue;
if (condition->ReferenceId)//handle reference
@@ -909,6 +938,12 @@ bool ConditionMgr::IsObjectMeetingVendorItemConditions(uint32 creatureId, uint32
return true;
}
+ConditionMgr* ConditionMgr::instance()
+{
+ static ConditionMgr instance;
+ return &instance;
+}
+
void ConditionMgr::LoadConditions(bool isReload)
{
uint32 oldMSTime = getMSTime();
@@ -1217,7 +1252,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond) const
bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond) const
{
uint32 conditionEffMask = cond->SourceGroup;
- SpellInfo* spellInfo = const_cast<SpellInfo*>(sSpellMgr->EnsureSpellInfo(cond->SourceEntry));
+ SpellInfo* spellInfo = const_cast<SpellInfo*>(sSpellMgr->AssertSpellInfo(cond->SourceEntry));
std::list<uint32> sharedMasks;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
@@ -1633,9 +1668,14 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
}
break;
}
- case CONDITION_SOURCE_TYPE_PHASE_DEFINITION:
+ case CONDITION_SOURCE_TYPE_TERRAIN_SWAP:
+ {
+ TC_LOG_ERROR("sql.sql", "CONDITION_SOURCE_TYPE_TERRAIN_SWAP: is only for 6.x branch, skipped");
+ return false;
+ }
+ case CONDITION_SOURCE_TYPE_PHASE:
{
- TC_LOG_ERROR("sql.sql", "CONDITION_SOURCE_TYPE_PHASE_DEFINITION:: is only for 4.3.4 branch, skipped");
+ TC_LOG_ERROR("sql.sql", "CONDITION_SOURCE_TYPE_PHASE: is only for 6.x branch, skipped");
return false;
}
case CONDITION_SOURCE_TYPE_GOSSIP_MENU:
@@ -1653,7 +1693,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
{
if (cond->ConditionType == CONDITION_NONE || cond->ConditionType >= CONDITION_MAX)
{
- TC_LOG_ERROR("sql.sql", "%s Invalid ConditionType in `condition` table, ignoring.", cond->ToString().c_str());
+ TC_LOG_ERROR("sql.sql", "%s Invalid ConditionType in `condition` table, ignoring.", cond->ToString(true).c_str());
return false;
}
@@ -1761,6 +1801,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
case CONDITION_QUESTTAKEN:
case CONDITION_QUEST_NONE:
case CONDITION_QUEST_COMPLETE:
+ case CONDITION_DAILY_QUEST_DONE:
{
if (!sObjectMgr->GetQuestTemplate(cond->ConditionValue1))
{
@@ -2090,6 +2131,31 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
}
case CONDITION_IN_WATER:
break;
+ case CONDITION_TERRAIN_SWAP:
+ TC_LOG_ERROR("sql.sql", "%s is not valid for this branch, skipped.", cond->ToString(true).c_str());
+ return false;
+ case CONDITION_STAND_STATE:
+ {
+ bool valid = false;
+ switch (cond->ConditionValue1)
+ {
+ case 0:
+ valid = cond->ConditionValue2 <= UNIT_STAND_STATE_SUBMERGED;
+ break;
+ case 1:
+ valid = cond->ConditionValue2 <= 1;
+ break;
+ default:
+ valid = false;
+ break;
+ }
+ if (!valid)
+ {
+ TC_LOG_ERROR("sql.sql", "%s has non-existing stand state (%u,%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1, cond->ConditionValue2);
+ return false;
+ }
+ break;
+ }
default:
break;
}
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index 35096ae18ff..4ec2be0753a 100644
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -71,7 +71,10 @@ enum ConditionTypes
CONDITION_HP_PCT = 38, // hpPct ComparisonType 0 true if unit's hp matches given pct
CONDITION_REALM_ACHIEVEMENT = 39, // achievement_id 0 0 true if realm achievement is complete
CONDITION_IN_WATER = 40, // 0 0 0 true if unit in water
- CONDITION_MAX = 41 // MAX
+ CONDITION_TERRAIN_SWAP = 41, // only for 6.x
+ CONDITION_STAND_STATE = 42, // stateType state 0 true if unit matches specified sitstate (0,x: has exactly state x; 1,0: any standing state; 1,1: any sitting state;)
+ CONDITION_DAILY_QUEST_DONE = 43, // quest id 0 0 true if daily quest has been completed for the day
+ CONDITION_MAX = 44 // MAX
};
/*! Documentation on implementing a new ConditionSourceType:
@@ -128,8 +131,9 @@ enum ConditionSourceType
CONDITION_SOURCE_TYPE_SMART_EVENT = 22,
CONDITION_SOURCE_TYPE_NPC_VENDOR = 23,
CONDITION_SOURCE_TYPE_SPELL_PROC = 24,
- CONDITION_SOURCE_TYPE_PHASE_DEFINITION = 25, // only 4.3.4
- CONDITION_SOURCE_TYPE_MAX = 26 // MAX
+ CONDITION_SOURCE_TYPE_TERRAIN_SWAP = 25, // only 6.x
+ CONDITION_SOURCE_TYPE_PHASE = 26, // only 6.x
+ CONDITION_SOURCE_TYPE_MAX = 27 // MAX
};
enum RelationType
@@ -156,7 +160,7 @@ enum MaxConditionTargets
MAX_CONDITION_TARGETS = 3
};
-struct ConditionSourceInfo
+struct TC_GAME_API ConditionSourceInfo
{
WorldObject* mConditionTargets[MAX_CONDITION_TARGETS]; // an array of targets available for conditions
Condition const* mLastFailedCondition;
@@ -169,7 +173,7 @@ struct ConditionSourceInfo
}
};
-struct Condition
+struct TC_GAME_API Condition
{
ConditionSourceType SourceType; //SourceTypeOrReferenceId
uint32 SourceGroup;
@@ -221,18 +225,14 @@ typedef std::unordered_map<uint32, ConditionsByEntryMap> ConditionEntriesByCreat
typedef std::unordered_map<std::pair<int32, uint32 /*SAI source_type*/>, ConditionsByEntryMap> SmartEventConditionContainer;
typedef std::unordered_map<uint32, ConditionContainer> ConditionReferenceContainer;//only used for references
-class ConditionMgr
+class TC_GAME_API ConditionMgr
{
private:
ConditionMgr();
~ConditionMgr();
public:
- static ConditionMgr* instance()
- {
- static ConditionMgr instance;
- return &instance;
- }
+ static ConditionMgr* instance();
void LoadConditions(bool isReload = false);
bool isConditionTypeValid(Condition* cond) const;
diff --git a/src/server/game/Conditions/DisableMgr.h b/src/server/game/Conditions/DisableMgr.h
index e74b7a9c319..cae1e0329e8 100644
--- a/src/server/game/Conditions/DisableMgr.h
+++ b/src/server/game/Conditions/DisableMgr.h
@@ -57,11 +57,11 @@ enum MMapDisableTypes
namespace DisableMgr
{
- void LoadDisables();
- bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags = 0);
- void CheckQuestDisables();
- bool IsVMAPDisabledFor(uint32 entry, uint8 flags);
- bool IsPathfindingEnabled(uint32 mapId);
+ TC_GAME_API void LoadDisables();
+ TC_GAME_API bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags = 0);
+ TC_GAME_API void CheckQuestDisables();
+ TC_GAME_API bool IsVMAPDisabledFor(uint32 entry, uint8 flags);
+ TC_GAME_API bool IsPathfindingEnabled(uint32 mapId);
}
#endif //TRINITY_DISABLEMGR_H
diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h
index f0ea5b4a5f1..cb2f26e567f 100644
--- a/src/server/game/DataStores/DBCEnums.h
+++ b/src/server/game/DataStores/DBCEnums.h
@@ -19,6 +19,22 @@
#ifndef DBCENUMS_H
#define DBCENUMS_H
+#pragma pack(push, 1)
+
+struct DBCPosition2D
+{
+ float X;
+ float Y;
+};
+
+struct DBCPosition3D
+{
+ float X;
+ float Y;
+ float Z;
+};
+
+#pragma pack(pop)
enum LevelLimit
{
// Client expected level limitation, like as used in DBC item max levels for "until max player level"
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 6c51c71fe7b..051b5e824bf 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -25,7 +25,7 @@
#include "Timer.h"
#include "ObjectDefines.h"
-#include <boost/regex.hpp>
+#include <regex>
#include <map>
typedef std::map<uint16, uint32> AreaFlagByAreaID;
@@ -73,6 +73,7 @@ DBCStorage <CharTitlesEntry> sCharTitlesStore(CharTitlesEntryfmt);
DBCStorage <ChatChannelsEntry> sChatChannelsStore(ChatChannelsEntryfmt);
DBCStorage <ChrClassesEntry> sChrClassesStore(ChrClassesEntryfmt);
DBCStorage <ChrRacesEntry> sChrRacesStore(ChrRacesEntryfmt);
+DBCStorage <CinematicCameraEntry> sCinematicCameraStore(CinematicCameraEntryfmt);
DBCStorage <CinematicSequencesEntry> sCinematicSequencesStore(CinematicSequencesEntryfmt);
DBCStorage <CreatureDisplayInfoEntry> sCreatureDisplayInfoStore(CreatureDisplayInfofmt);
DBCStorage <CreatureDisplayInfoExtraEntry> sCreatureDisplayInfoExtraStore(CreatureDisplayInfoExtrafmt);
@@ -144,7 +145,7 @@ DBCStorage <MovieEntry> sMovieStore(MovieEntryfmt);
DBCStorage<NamesProfanityEntry> sNamesProfanityStore(NamesProfanityEntryfmt);
DBCStorage<NamesReservedEntry> sNamesReservedStore(NamesReservedEntryfmt);
-typedef std::array<std::vector<boost::regex>, TOTAL_LOCALES> NameValidationRegexContainer;
+typedef std::array<std::vector<std::wregex>, TOTAL_LOCALES> NameValidationRegexContainer;
NameValidationRegexContainer NamesProfaneValidators;
NameValidationRegexContainer NamesReservedValidators;
@@ -263,7 +264,7 @@ inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCSt
if (FILE* f = fopen(dbcFilename.c_str(), "rb"))
{
std::ostringstream stream;
- stream << dbcFilename << " exists, and has " << storage.GetFieldCount() << " field(s) (expected " << strlen(storage.GetFormat()) << "). Extracted file might be from wrong client version or a database-update has been forgotten.";
+ stream << dbcFilename << " exists, and has " << storage.GetFieldCount() << " field(s) (expected " << strlen(storage.GetFormat()) << "). Extracted file might be from wrong client version or a database-update has been forgotten. Search on forum for TCE00008 for more info.";
std::string buf = stream.str();
errors.push_back(buf);
fclose(f);
@@ -311,6 +312,7 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sChrRacesStore, dbcPath, "ChrRaces.dbc");
+ LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicCameraStore, dbcPath, "CinematicCamera.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicSequencesStore, dbcPath, "CinematicSequences.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoStore, dbcPath, "CreatureDisplayInfo.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoExtraStore, dbcPath, "CreatureDisplayInfoExtra.dbc");
@@ -408,11 +410,14 @@ void LoadDBCStores(const std::string& dataPath)
continue;
ASSERT(namesProfanity->Language < TOTAL_LOCALES || namesProfanity->Language == -1);
+ std::wstring wname;
+ ASSERT(Utf8toWStr(namesProfanity->Name, wname));
+
if (namesProfanity->Language != -1)
- NamesProfaneValidators[namesProfanity->Language].emplace_back(namesProfanity->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
+ NamesProfaneValidators[namesProfanity->Language].emplace_back(wname, std::regex::icase | std::regex::optimize);
else
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
- NamesProfaneValidators[i].emplace_back(namesProfanity->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
+ NamesProfaneValidators[i].emplace_back(wname, std::regex::icase | std::regex::optimize);
}
for (uint32 i = 0; i < sNamesReservedStore.GetNumRows(); ++i)
@@ -422,11 +427,14 @@ void LoadDBCStores(const std::string& dataPath)
continue;
ASSERT(namesReserved->Language < TOTAL_LOCALES || namesReserved->Language == -1);
+ std::wstring wname;
+ ASSERT(Utf8toWStr(namesReserved->Name, wname));
+
if (namesReserved->Language != -1)
- NamesReservedValidators[namesReserved->Language].emplace_back(namesReserved->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
+ NamesReservedValidators[namesReserved->Language].emplace_back(wname, std::regex::icase | std::regex::optimize);
else
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
- NamesReservedValidators[i].emplace_back(namesReserved->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
+ NamesReservedValidators[i].emplace_back(wname, std::regex::icase | std::regex::optimize);
}
@@ -998,18 +1006,18 @@ SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, u
return NULL;
}
-ResponseCodes ValidateName(std::string const& name, LocaleConstant locale)
+ResponseCodes ValidateName(std::wstring const& name, LocaleConstant locale)
{
if (locale >= TOTAL_LOCALES)
return RESPONSE_FAILURE;
- for (boost::regex const& regex : NamesProfaneValidators[locale])
- if (boost::regex_search(name, regex))
+ for (std::wregex const& regex : NamesProfaneValidators[locale])
+ if (std::regex_search(name, regex))
return CHAR_NAME_PROFANE;
// regexes at TOTAL_LOCALES are loaded from NamesReserved which is not locale specific
- for (boost::regex const& regex : NamesReservedValidators[locale])
- if (boost::regex_search(name, regex))
+ for (std::wregex const& regex : NamesReservedValidators[locale])
+ if (std::regex_search(name, regex))
return CHAR_NAME_RESERVED;
return CHAR_NAME_SUCCESS;
@@ -1017,5 +1025,6 @@ ResponseCodes ValidateName(std::string const& name, LocaleConstant locale)
EmotesTextSoundEntry const* FindTextSoundEmoteFor(uint32 emote, uint32 race, uint32 gender)
{
- return sEmotesTextSoundMap[EmotesTextSoundKey(emote, race, gender)];
+ auto itr = sEmotesTextSoundMap.find(EmotesTextSoundKey(emote, race, gender));
+ return itr != sEmotesTextSoundMap.end() ? itr->second : nullptr;
}
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index 56ee1f618dd..128ff7ad1b8 100644
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -27,18 +27,18 @@
#include <list>
typedef std::list<uint32> SimpleFactionsList;
-SimpleFactionsList const* GetFactionTeamList(uint32 faction);
+TC_GAME_API SimpleFactionsList const* GetFactionTeamList(uint32 faction);
-char* GetPetName(uint32 petfamily, uint32 dbclang);
-uint32 GetTalentSpellCost(uint32 spellId);
-TalentSpellPos const* GetTalentSpellPos(uint32 spellId);
+TC_GAME_API char* GetPetName(uint32 petfamily, uint32 dbclang);
+TC_GAME_API uint32 GetTalentSpellCost(uint32 spellId);
+TC_GAME_API TalentSpellPos const* GetTalentSpellPos(uint32 spellId);
-char const* GetRaceName(uint8 race, uint8 locale);
-char const* GetClassName(uint8 class_, uint8 locale);
+TC_GAME_API char const* GetRaceName(uint8 race, uint8 locale);
+TC_GAME_API char const* GetClassName(uint8 class_, uint8 locale);
-WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid);
+TC_GAME_API WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid);
-uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId);
+TC_GAME_API uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId);
enum ContentLevels
{
@@ -46,154 +46,155 @@ enum ContentLevels
CONTENT_61_70,
CONTENT_71_80
};
-ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId);
+TC_GAME_API ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId);
-bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId);
+TC_GAME_API bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId);
-void Zone2MapCoordinates(float &x, float &y, uint32 zone);
-void Map2ZoneCoordinates(float &x, float &y, uint32 zone);
+TC_GAME_API void Zone2MapCoordinates(float &x, float &y, uint32 zone);
+TC_GAME_API void Map2ZoneCoordinates(float &x, float &y, uint32 zone);
typedef std::map<uint32/*pair32(map, diff)*/, MapDifficulty> MapDifficultyMap;
-MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty);
-MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty);
+TC_GAME_API MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty);
+TC_GAME_API MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty);
-uint32 const* /*[MAX_TALENT_TABS]*/ GetTalentTabPages(uint8 cls);
+TC_GAME_API uint32 const* /*[MAX_TALENT_TABS]*/ GetTalentTabPages(uint8 cls);
-uint32 GetLiquidFlags(uint32 liquidType);
+TC_GAME_API uint32 GetLiquidFlags(uint32 liquidType);
-PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
-PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
+TC_GAME_API PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
+TC_GAME_API PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
-CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender);
-CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color);
+TC_GAME_API CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender);
+TC_GAME_API CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType, uint8 gender, uint8 type, uint8 color);
-LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty);
+TC_GAME_API LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty);
-uint32 GetDefaultMapLight(uint32 mapId);
+TC_GAME_API uint32 GetDefaultMapLight(uint32 mapId);
typedef std::unordered_multimap<uint32, SkillRaceClassInfoEntry const*> SkillRaceClassInfoMap;
typedef std::pair<SkillRaceClassInfoMap::iterator, SkillRaceClassInfoMap::iterator> SkillRaceClassInfoBounds;
-SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, uint8 class_);
-
-ResponseCodes ValidateName(std::string const& name, LocaleConstant locale);
-
-EmotesTextSoundEntry const* FindTextSoundEmoteFor(uint32 emote, uint32 race, uint32 gender);
-
-extern DBCStorage <AchievementEntry> sAchievementStore;
-extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
-extern DBCStorage <AreaTableEntry> sAreaTableStore;
-extern DBCStorage <AreaGroupEntry> sAreaGroupStore;
-extern DBCStorage <AreaPOIEntry> sAreaPOIStore;
-extern DBCStorage <AreaTriggerEntry> sAreaTriggerStore;
-extern DBCStorage <AuctionHouseEntry> sAuctionHouseStore;
-extern DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore;
-extern DBCStorage <BannedAddOnsEntry> sBannedAddOnsStore;
-extern DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore;
-extern DBCStorage <BattlemasterListEntry> sBattlemasterListStore;
-extern DBCStorage <ChatChannelsEntry> sChatChannelsStore;
-extern DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore;
-extern DBCStorage <CharSectionsEntry> sCharSectionsStore;
-extern DBCStorage <CharTitlesEntry> sCharTitlesStore;
-extern DBCStorage <ChrClassesEntry> sChrClassesStore;
-extern DBCStorage <ChrRacesEntry> sChrRacesStore;
-extern DBCStorage <CinematicSequencesEntry> sCinematicSequencesStore;
-extern DBCStorage <CreatureDisplayInfoEntry> sCreatureDisplayInfoStore;
-extern DBCStorage <CreatureDisplayInfoExtraEntry> sCreatureDisplayInfoExtraStore;
-extern DBCStorage <CreatureFamilyEntry> sCreatureFamilyStore;
-extern DBCStorage <CreatureModelDataEntry> sCreatureModelDataStore;
-extern DBCStorage <CreatureSpellDataEntry> sCreatureSpellDataStore;
-extern DBCStorage <CreatureTypeEntry> sCreatureTypeStore;
-extern DBCStorage <CurrencyTypesEntry> sCurrencyTypesStore;
-extern DBCStorage <DestructibleModelDataEntry> sDestructibleModelDataStore;
-extern DBCStorage <DungeonEncounterEntry> sDungeonEncounterStore;
-extern DBCStorage <DurabilityCostsEntry> sDurabilityCostsStore;
-extern DBCStorage <DurabilityQualityEntry> sDurabilityQualityStore;
-extern DBCStorage <EmotesEntry> sEmotesStore;
-extern DBCStorage <EmotesTextEntry> sEmotesTextStore;
-extern DBCStorage <EmotesTextSoundEntry> sEmotesTextSoundStore;
-extern DBCStorage <FactionEntry> sFactionStore;
-extern DBCStorage <FactionTemplateEntry> sFactionTemplateStore;
-extern DBCStorage <GameObjectDisplayInfoEntry> sGameObjectDisplayInfoStore;
-extern DBCStorage <GemPropertiesEntry> sGemPropertiesStore;
-extern DBCStorage <GlyphPropertiesEntry> sGlyphPropertiesStore;
-extern DBCStorage <GlyphSlotEntry> sGlyphSlotStore;
-
-extern DBCStorage <GtBarberShopCostBaseEntry> sGtBarberShopCostBaseStore;
-extern DBCStorage <GtCombatRatingsEntry> sGtCombatRatingsStore;
-extern DBCStorage <GtChanceToMeleeCritBaseEntry> sGtChanceToMeleeCritBaseStore;
-extern DBCStorage <GtChanceToMeleeCritEntry> sGtChanceToMeleeCritStore;
-extern DBCStorage <GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore;
-extern DBCStorage <GtChanceToSpellCritEntry> sGtChanceToSpellCritStore;
-extern DBCStorage <GtNPCManaCostScalerEntry> sGtNPCManaCostScalerStore;
-extern DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore;
-extern DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore;
-//extern DBCStorage <GtOCTRegenMPEntry> sGtOCTRegenMPStore; -- not used currently
-extern DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore;
-extern DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore;
-extern DBCStorage <HolidaysEntry> sHolidaysStore;
-extern DBCStorage <ItemEntry> sItemStore;
-extern DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore;
-//extern DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore; -- not used currently
-extern DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore;
-extern DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore;
-extern DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore;
-extern DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore;
-extern DBCStorage <ItemSetEntry> sItemSetStore;
-extern DBCStorage <LFGDungeonEntry> sLFGDungeonStore;
-extern DBCStorage <LiquidTypeEntry> sLiquidTypeStore;
-extern DBCStorage <LockEntry> sLockStore;
-extern DBCStorage <MailTemplateEntry> sMailTemplateStore;
-extern DBCStorage <MapEntry> sMapStore;
-//extern DBCStorage <MapDifficultyEntry> sMapDifficultyStore; -- use GetMapDifficultyData insteed
-extern MapDifficultyMap sMapDifficultyMap;
-extern DBCStorage <MovieEntry> sMovieStore;
-extern DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore;
-extern DBCStorage <PowerDisplayEntry> sPowerDisplayStore;
-extern DBCStorage <QuestSortEntry> sQuestSortStore;
-extern DBCStorage <QuestXPEntry> sQuestXPStore;
-extern DBCStorage <QuestFactionRewEntry> sQuestFactionRewardStore;
-extern DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore;
-extern DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore;
-extern DBCStorage <ScalingStatValuesEntry> sScalingStatValuesStore;
-extern DBCStorage <SkillLineEntry> sSkillLineStore;
-extern DBCStorage <SkillLineAbilityEntry> sSkillLineAbilityStore;
-extern DBCStorage <SkillTiersEntry> sSkillTiersStore;
-extern DBCStorage <SoundEntriesEntry> sSoundEntriesStore;
-extern DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore;
-extern DBCStorage <SpellCategoryEntry> sSpellCategoryStore;
-extern DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore;
-extern DBCStorage <SpellDurationEntry> sSpellDurationStore;
-extern DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore;
-extern DBCStorage <SpellItemEnchantmentEntry> sSpellItemEnchantmentStore;
-extern DBCStorage <SpellItemEnchantmentConditionEntry> sSpellItemEnchantmentConditionStore;
-extern PetFamilySpellsStore sPetFamilySpellsStore;
-extern DBCStorage <SpellRadiusEntry> sSpellRadiusStore;
-extern DBCStorage <SpellRangeEntry> sSpellRangeStore;
-extern DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore;
-extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore;
-extern DBCStorage <SpellEntry> sSpellStore;
-extern DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore;
-extern DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore;
-extern DBCStorage <TalentEntry> sTalentStore;
-extern DBCStorage <TalentTabEntry> sTalentTabStore;
-extern DBCStorage <TaxiNodesEntry> sTaxiNodesStore;
-extern DBCStorage <TaxiPathEntry> sTaxiPathStore;
-extern TaxiMask sTaxiNodesMask;
-extern TaxiMask sOldContinentsNodesMask;
-extern TaxiMask sHordeTaxiNodesMask;
-extern TaxiMask sAllianceTaxiNodesMask;
-extern TaxiMask sDeathKnightTaxiNodesMask;
-extern TaxiPathSetBySource sTaxiPathSetBySource;
-extern TaxiPathNodesByPath sTaxiPathNodesByPath;
-extern DBCStorage <TeamContributionPointsEntry> sTeamContributionPointsStore;
-extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore;
-extern DBCStorage <VehicleEntry> sVehicleStore;
-extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
-extern DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore;
-//extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
-extern DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore;
-extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;
-
-void LoadDBCStores(const std::string& dataPath);
+TC_GAME_API SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, uint8 class_);
+
+TC_GAME_API ResponseCodes ValidateName(std::wstring const& name, LocaleConstant locale);
+
+TC_GAME_API EmotesTextSoundEntry const* FindTextSoundEmoteFor(uint32 emote, uint32 race, uint32 gender);
+
+TC_GAME_API extern DBCStorage <AchievementEntry> sAchievementStore;
+TC_GAME_API extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
+TC_GAME_API extern DBCStorage <AreaTableEntry> sAreaTableStore;
+TC_GAME_API extern DBCStorage <AreaGroupEntry> sAreaGroupStore;
+TC_GAME_API extern DBCStorage <AreaPOIEntry> sAreaPOIStore;
+TC_GAME_API extern DBCStorage <AreaTriggerEntry> sAreaTriggerStore;
+TC_GAME_API extern DBCStorage <AuctionHouseEntry> sAuctionHouseStore;
+TC_GAME_API extern DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore;
+TC_GAME_API extern DBCStorage <BannedAddOnsEntry> sBannedAddOnsStore;
+TC_GAME_API extern DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore;
+TC_GAME_API extern DBCStorage <BattlemasterListEntry> sBattlemasterListStore;
+TC_GAME_API extern DBCStorage <ChatChannelsEntry> sChatChannelsStore;
+TC_GAME_API extern DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore;
+TC_GAME_API extern DBCStorage <CharSectionsEntry> sCharSectionsStore;
+TC_GAME_API extern DBCStorage <CharTitlesEntry> sCharTitlesStore;
+TC_GAME_API extern DBCStorage <ChrClassesEntry> sChrClassesStore;
+TC_GAME_API extern DBCStorage <ChrRacesEntry> sChrRacesStore;
+TC_GAME_API extern DBCStorage <CinematicCameraEntry> sCinematicCameraStore;
+TC_GAME_API extern DBCStorage <CinematicSequencesEntry> sCinematicSequencesStore;
+TC_GAME_API extern DBCStorage <CreatureDisplayInfoEntry> sCreatureDisplayInfoStore;
+TC_GAME_API extern DBCStorage <CreatureDisplayInfoExtraEntry> sCreatureDisplayInfoExtraStore;
+TC_GAME_API extern DBCStorage <CreatureFamilyEntry> sCreatureFamilyStore;
+TC_GAME_API extern DBCStorage <CreatureModelDataEntry> sCreatureModelDataStore;
+TC_GAME_API extern DBCStorage <CreatureSpellDataEntry> sCreatureSpellDataStore;
+TC_GAME_API extern DBCStorage <CreatureTypeEntry> sCreatureTypeStore;
+TC_GAME_API extern DBCStorage <CurrencyTypesEntry> sCurrencyTypesStore;
+TC_GAME_API extern DBCStorage <DestructibleModelDataEntry> sDestructibleModelDataStore;
+TC_GAME_API extern DBCStorage <DungeonEncounterEntry> sDungeonEncounterStore;
+TC_GAME_API extern DBCStorage <DurabilityCostsEntry> sDurabilityCostsStore;
+TC_GAME_API extern DBCStorage <DurabilityQualityEntry> sDurabilityQualityStore;
+TC_GAME_API extern DBCStorage <EmotesEntry> sEmotesStore;
+TC_GAME_API extern DBCStorage <EmotesTextEntry> sEmotesTextStore;
+TC_GAME_API extern DBCStorage <EmotesTextSoundEntry> sEmotesTextSoundStore;
+TC_GAME_API extern DBCStorage <FactionEntry> sFactionStore;
+TC_GAME_API extern DBCStorage <FactionTemplateEntry> sFactionTemplateStore;
+TC_GAME_API extern DBCStorage <GameObjectDisplayInfoEntry> sGameObjectDisplayInfoStore;
+TC_GAME_API extern DBCStorage <GemPropertiesEntry> sGemPropertiesStore;
+TC_GAME_API extern DBCStorage <GlyphPropertiesEntry> sGlyphPropertiesStore;
+TC_GAME_API extern DBCStorage <GlyphSlotEntry> sGlyphSlotStore;
+
+TC_GAME_API extern DBCStorage <GtBarberShopCostBaseEntry> sGtBarberShopCostBaseStore;
+TC_GAME_API extern DBCStorage <GtCombatRatingsEntry> sGtCombatRatingsStore;
+TC_GAME_API extern DBCStorage <GtChanceToMeleeCritBaseEntry> sGtChanceToMeleeCritBaseStore;
+TC_GAME_API extern DBCStorage <GtChanceToMeleeCritEntry> sGtChanceToMeleeCritStore;
+TC_GAME_API extern DBCStorage <GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore;
+TC_GAME_API extern DBCStorage <GtChanceToSpellCritEntry> sGtChanceToSpellCritStore;
+TC_GAME_API extern DBCStorage <GtNPCManaCostScalerEntry> sGtNPCManaCostScalerStore;
+TC_GAME_API extern DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore;
+TC_GAME_API extern DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore;
+//TC_GAME_API extern DBCStorage <GtOCTRegenMPEntry> sGtOCTRegenMPStore; -- not used currently
+TC_GAME_API extern DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore;
+TC_GAME_API extern DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore;
+TC_GAME_API extern DBCStorage <HolidaysEntry> sHolidaysStore;
+TC_GAME_API extern DBCStorage <ItemEntry> sItemStore;
+TC_GAME_API extern DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore;
+//TC_GAME_API extern DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore; -- not used currently
+TC_GAME_API extern DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore;
+TC_GAME_API extern DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore;
+TC_GAME_API extern DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore;
+TC_GAME_API extern DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore;
+TC_GAME_API extern DBCStorage <ItemSetEntry> sItemSetStore;
+TC_GAME_API extern DBCStorage <LFGDungeonEntry> sLFGDungeonStore;
+TC_GAME_API extern DBCStorage <LiquidTypeEntry> sLiquidTypeStore;
+TC_GAME_API extern DBCStorage <LockEntry> sLockStore;
+TC_GAME_API extern DBCStorage <MailTemplateEntry> sMailTemplateStore;
+TC_GAME_API extern DBCStorage <MapEntry> sMapStore;
+//TC_GAME_API extern DBCStorage <MapDifficultyEntry> sMapDifficultyStore; -- use GetMapDifficultyData insteed
+TC_GAME_API extern MapDifficultyMap sMapDifficultyMap;
+TC_GAME_API extern DBCStorage <MovieEntry> sMovieStore;
+TC_GAME_API extern DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore;
+TC_GAME_API extern DBCStorage <PowerDisplayEntry> sPowerDisplayStore;
+TC_GAME_API extern DBCStorage <QuestSortEntry> sQuestSortStore;
+TC_GAME_API extern DBCStorage <QuestXPEntry> sQuestXPStore;
+TC_GAME_API extern DBCStorage <QuestFactionRewEntry> sQuestFactionRewardStore;
+TC_GAME_API extern DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore;
+TC_GAME_API extern DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore;
+TC_GAME_API extern DBCStorage <ScalingStatValuesEntry> sScalingStatValuesStore;
+TC_GAME_API extern DBCStorage <SkillLineEntry> sSkillLineStore;
+TC_GAME_API extern DBCStorage <SkillLineAbilityEntry> sSkillLineAbilityStore;
+TC_GAME_API extern DBCStorage <SkillTiersEntry> sSkillTiersStore;
+TC_GAME_API extern DBCStorage <SoundEntriesEntry> sSoundEntriesStore;
+TC_GAME_API extern DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore;
+TC_GAME_API extern DBCStorage <SpellCategoryEntry> sSpellCategoryStore;
+TC_GAME_API extern DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore;
+TC_GAME_API extern DBCStorage <SpellDurationEntry> sSpellDurationStore;
+TC_GAME_API extern DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore;
+TC_GAME_API extern DBCStorage <SpellItemEnchantmentEntry> sSpellItemEnchantmentStore;
+TC_GAME_API extern DBCStorage <SpellItemEnchantmentConditionEntry> sSpellItemEnchantmentConditionStore;
+TC_GAME_API extern PetFamilySpellsStore sPetFamilySpellsStore;
+TC_GAME_API extern DBCStorage <SpellRadiusEntry> sSpellRadiusStore;
+TC_GAME_API extern DBCStorage <SpellRangeEntry> sSpellRangeStore;
+TC_GAME_API extern DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore;
+TC_GAME_API extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore;
+TC_GAME_API extern DBCStorage <SpellEntry> sSpellStore;
+TC_GAME_API extern DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore;
+TC_GAME_API extern DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore;
+TC_GAME_API extern DBCStorage <TalentEntry> sTalentStore;
+TC_GAME_API extern DBCStorage <TalentTabEntry> sTalentTabStore;
+TC_GAME_API extern DBCStorage <TaxiNodesEntry> sTaxiNodesStore;
+TC_GAME_API extern DBCStorage <TaxiPathEntry> sTaxiPathStore;
+TC_GAME_API extern TaxiMask sTaxiNodesMask;
+TC_GAME_API extern TaxiMask sOldContinentsNodesMask;
+TC_GAME_API extern TaxiMask sHordeTaxiNodesMask;
+TC_GAME_API extern TaxiMask sAllianceTaxiNodesMask;
+TC_GAME_API extern TaxiMask sDeathKnightTaxiNodesMask;
+TC_GAME_API extern TaxiPathSetBySource sTaxiPathSetBySource;
+TC_GAME_API extern TaxiPathNodesByPath sTaxiPathNodesByPath;
+TC_GAME_API extern DBCStorage <TeamContributionPointsEntry> sTeamContributionPointsStore;
+TC_GAME_API extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore;
+TC_GAME_API extern DBCStorage <VehicleEntry> sVehicleStore;
+TC_GAME_API extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
+TC_GAME_API extern DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore;
+//TC_GAME_API extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
+TC_GAME_API extern DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore;
+TC_GAME_API extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;
+
+TC_GAME_API void LoadDBCStores(const std::string& dataPath);
#endif
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index b5dc4489148..13f0198a5e7 100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -725,24 +725,20 @@ struct ChrRacesEntry
uint32 expansion; // 68 (0 - original race, 1 - tbc addon, ...)
};
-/* not used
struct CinematicCameraEntry
{
- uint32 id; // 0 index
- char* filename; // 1
- uint32 soundid; // 2 in SoundEntries.dbc or 0
- float start_x; // 3
- float start_y; // 4
- float start_z; // 5
- float unk6; // 6 speed?
+ uint32 ID; // 0
+ char const* Model; // 1 Model filename (translate .mdx to .m2)
+ uint32 SoundID; // 2 Sound ID (voiceover for cinematic)
+ DBCPosition3D Origin; // 3-5 Position in map used for basis for M2 co-ordinates
+ float OriginFacing; // 6 Orientation in map used for basis for M2 co-ordinates
};
-*/
struct CinematicSequencesEntry
{
uint32 Id; // 0 index
//uint32 unk1; // 1 always 0
- //uint32 cinematicCamera; // 2 id in CinematicCamera.dbc
+ uint32 cinematicCamera; // 2 id in CinematicCamera.dbc
// 3-9 always 0
};
diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h
index c61ec997bc2..1accc81714b 100644
--- a/src/server/game/DataStores/DBCfmt.h
+++ b/src/server/game/DataStores/DBCfmt.h
@@ -38,7 +38,8 @@ char const CharTitlesEntryfmt[] = "nxssssssssssssssssxssssssssssssssssxi";
char const ChatChannelsEntryfmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxx";
char const ChrClassesEntryfmt[] = "nxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
char const ChrRacesEntryfmt[] = "niixiixixxxxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
-char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx";
+char const CinematicCameraEntryfmt[] = "nsiffff";
+char const CinematicSequencesEntryfmt[] = "nxixxxxxxx";
char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxx";
char const CreatureDisplayInfoExtrafmt[] = "diixxxxxxxxxxxxxxxxxx";
char const CreatureFamilyfmt[] = "nfifiiiiixssssssssssssssssxx";
diff --git a/src/server/game/DataStores/M2Stores.cpp b/src/server/game/DataStores/M2Stores.cpp
new file mode 100644
index 00000000000..69581f16549
--- /dev/null
+++ b/src/server/game/DataStores/M2Stores.cpp
@@ -0,0 +1,266 @@
+/*
+* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation; either version 2 of the License, or (at your
+* option) any later version.
+*
+* This program is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+* more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "DBCStores.h"
+#include "M2Structure.h"
+#include "M2Stores.h"
+#include "Common.h"
+#include "Containers.h"
+#include "Log.h"
+#include "World.h"
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <boost/filesystem/path.hpp>
+
+std::unordered_map<uint32, FlyByCameraCollection> sFlyByCameraStore;
+
+// Convert the geomoetry from a spline value, to an actual WoW XYZ
+G3D::Vector3 TranslateLocation(G3D::Vector4 const* DBCPosition, G3D::Vector3 const* basePosition, G3D::Vector3 const* splineVector)
+{
+ G3D::Vector3 work;
+ float x = basePosition->x + splineVector->x;
+ float y = basePosition->y + splineVector->y;
+ float z = basePosition->z + splineVector->z;
+ float const distance = sqrt((x * x) + (y * y));
+ float angle = std::atan2(x, y) - DBCPosition->w;
+
+ if (angle < 0)
+ angle += 2 * float(M_PI);
+
+ work.x = DBCPosition->x + (distance * sin(angle));
+ work.y = DBCPosition->y + (distance * cos(angle));
+ work.z = DBCPosition->z + z;
+ return work;
+}
+
+// Number of cameras not used. Multiple cameras never used in 3.3.5
+bool readCamera(M2Camera const* cam, uint32 buffSize, M2Header const* header, CinematicCameraEntry const* dbcentry)
+{
+ char const* buffer = reinterpret_cast<char const*>(header);
+
+ FlyByCameraCollection cameras;
+ FlyByCameraCollection targetcam;
+
+ G3D::Vector4 DBCData;
+ DBCData.x = dbcentry->Origin.X;
+ DBCData.y = dbcentry->Origin.Y;
+ DBCData.z = dbcentry->Origin.Z;
+ DBCData.w = dbcentry->OriginFacing;
+
+ // Read target locations, only so that we can calculate orientation
+ for (uint32 k = 0; k < cam->target_positions.timestamps.number; ++k)
+ {
+ // Extract Target positions
+ if (cam->target_positions.timestamps.offset_elements + sizeof(M2Array) > buffSize)
+ return false;
+ M2Array const* targTsArray = reinterpret_cast<M2Array const*>(buffer + cam->target_positions.timestamps.offset_elements);
+ if (targTsArray->offset_elements + sizeof(uint32) > buffSize || cam->target_positions.values.offset_elements + sizeof(M2Array) > buffSize)
+ return false;
+ uint32 const* targTimestamps = reinterpret_cast<uint32 const*>(buffer + targTsArray->offset_elements);
+ M2Array const* targArray = reinterpret_cast<M2Array const*>(buffer + cam->target_positions.values.offset_elements);
+
+ if (targArray->offset_elements + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
+ return false;
+ M2SplineKey<G3D::Vector3> const* targPositions = reinterpret_cast<M2SplineKey<G3D::Vector3> const*>(buffer + targArray->offset_elements);
+
+ // Read the data for this set
+ uint32 currPos = targArray->offset_elements;
+ for (uint32 i = 0; i < targTsArray->number; ++i)
+ {
+ if (currPos + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
+ return false;
+ // Translate co-ordinates
+ G3D::Vector3 newPos = TranslateLocation(&DBCData, &cam->target_position_base, &targPositions->p0);
+
+ // Add to vector
+ FlyByCamera thisCam;
+ thisCam.timeStamp = targTimestamps[i];
+ thisCam.locations.x = newPos.x;
+ thisCam.locations.y = newPos.y;
+ thisCam.locations.z = newPos.z;
+ thisCam.locations.w = 0.0f;
+ targetcam.push_back(thisCam);
+ targPositions++;
+ currPos += sizeof(M2SplineKey<G3D::Vector3>);
+ }
+ }
+
+ // Read camera positions and timestamps (translating first position of 3 only, we don't need to translate the whole spline)
+ for (uint32 k = 0; k < cam->positions.timestamps.number; ++k)
+ {
+ // Extract Camera positions for this set
+ if (cam->positions.timestamps.offset_elements + sizeof(M2Array) > buffSize)
+ return false;
+ M2Array const* posTsArray = reinterpret_cast<M2Array const*>(buffer + cam->positions.timestamps.offset_elements);
+ if (posTsArray->offset_elements + sizeof(uint32) > buffSize || cam->positions.values.offset_elements + sizeof(M2Array) > buffSize)
+ return false;
+ uint32 const* posTimestamps = reinterpret_cast<uint32 const*>(buffer + posTsArray->offset_elements);
+ M2Array const* posArray = reinterpret_cast<M2Array const*>(buffer + cam->positions.values.offset_elements);
+ if (posArray->offset_elements + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
+ return false;
+ M2SplineKey<G3D::Vector3> const* positions = reinterpret_cast<M2SplineKey<G3D::Vector3> const*>(buffer + posArray->offset_elements);
+
+ // Read the data for this set
+ uint32 currPos = posArray->offset_elements;
+ for (uint32 i = 0; i < posTsArray->number; ++i)
+ {
+ if (currPos + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
+ return false;
+ // Translate co-ordinates
+ G3D::Vector3 newPos = TranslateLocation(&DBCData, &cam->position_base, &positions->p0);
+
+ // Add to vector
+ FlyByCamera thisCam;
+ thisCam.timeStamp = posTimestamps[i];
+ thisCam.locations.x = newPos.x;
+ thisCam.locations.y = newPos.y;
+ thisCam.locations.z = newPos.z;
+
+ if (targetcam.size() > 0)
+ {
+ // Find the target camera before and after this camera
+ FlyByCamera lastTarget;
+ FlyByCamera nextTarget;
+
+ // Pre-load first item
+ lastTarget = targetcam[0];
+ nextTarget = targetcam[0];
+ for (uint32 j = 0; j < targetcam.size(); ++j)
+ {
+ nextTarget = targetcam[j];
+ if (targetcam[j].timeStamp > posTimestamps[i])
+ break;
+
+ lastTarget = targetcam[j];
+ }
+
+ float x = lastTarget.locations.x;
+ float y = lastTarget.locations.y;
+ float z = lastTarget.locations.z;
+
+ // Now, the timestamps for target cam and position can be different. So, if they differ we interpolate
+ if (lastTarget.timeStamp != posTimestamps[i])
+ {
+ uint32 timeDiffTarget = nextTarget.timeStamp - lastTarget.timeStamp;
+ uint32 timeDiffThis = posTimestamps[i] - lastTarget.timeStamp;
+ float xDiff = nextTarget.locations.x - lastTarget.locations.x;
+ float yDiff = nextTarget.locations.y - lastTarget.locations.y;
+ float zDiff = nextTarget.locations.z - lastTarget.locations.z;
+ x = lastTarget.locations.x + (xDiff * (float(timeDiffThis) / float(timeDiffTarget)));
+ y = lastTarget.locations.y + (yDiff * (float(timeDiffThis) / float(timeDiffTarget)));
+ z = lastTarget.locations.z + (zDiff * (float(timeDiffThis) / float(timeDiffTarget)));
+ }
+ float xDiff = x - thisCam.locations.x;
+ float yDiff = y - thisCam.locations.y;
+ thisCam.locations.w = std::atan2(yDiff, xDiff);
+
+ if (thisCam.locations.w < 0)
+ thisCam.locations.w += 2 * float(M_PI);
+ }
+
+ cameras.push_back(thisCam);
+ positions++;
+ currPos += sizeof(M2SplineKey<G3D::Vector3>);
+ }
+ }
+
+ sFlyByCameraStore[dbcentry->ID] = cameras;
+ return true;
+}
+
+void LoadM2Cameras(std::string const& dataPath)
+{
+ sFlyByCameraStore.clear();
+ TC_LOG_INFO("server.loading", ">> Loading Cinematic Camera files");
+
+ uint32 oldMSTime = getMSTime();
+ for (uint32 i = 0; i < sCinematicCameraStore.GetNumRows(); ++i)
+ {
+ if (CinematicCameraEntry const* dbcentry = sCinematicCameraStore.LookupEntry(i))
+ {
+ std::string filenameWork = dataPath;
+ filenameWork.append(dbcentry->Model);
+
+ // Replace slashes (always to forward slash, because boost!)
+ std::replace(filenameWork.begin(), filenameWork.end(), '\\', '/');
+
+ boost::filesystem::path filename = filenameWork;
+
+ // Convert to native format
+ filename.make_preferred();
+
+ // Replace mdx to .m2
+ filename.replace_extension("m2");
+
+ std::ifstream m2file(filename.string().c_str(), std::ios::in | std::ios::binary);
+ if (!m2file.is_open())
+ continue;
+
+ // Get file size
+ m2file.seekg(0, std::ios::end);
+ std::streamoff const fileSize = m2file.tellg();
+
+ // Reject if not at least the size of the header
+ if (static_cast<uint32 const>(fileSize) < sizeof(M2Header))
+ {
+ TC_LOG_ERROR("server.loading", "Camera file %s is damaged. File is smaller than header size", filename.string().c_str());
+ m2file.close();
+ continue;
+ }
+
+ // Read 4 bytes (signature)
+ m2file.seekg(0, std::ios::beg);
+ char fileCheck[5];
+ m2file.read(fileCheck, 4);
+ fileCheck[4] = 0;
+
+ // Check file has correct magic (MD20)
+ if (strcmp(fileCheck, "MD20"))
+ {
+ TC_LOG_ERROR("server.loading", "Camera file %s is damaged. File identifier not found", filename.string().c_str());
+ m2file.close();
+ continue;
+ }
+
+ // Now we have a good file, read it all into a vector of char's, then close the file.
+ std::vector<char> buffer(fileSize);
+ m2file.seekg(0, std::ios::beg);
+ if (!m2file.read(buffer.data(), fileSize))
+ {
+ m2file.close();
+ continue;
+ }
+ m2file.close();
+
+ // Read header
+ M2Header const* header = reinterpret_cast<M2Header const*>(buffer.data());
+
+ if (header->ofsCameras + sizeof(M2Camera) > static_cast<uint32 const>(fileSize))
+ {
+ TC_LOG_ERROR("server.loading", "Camera file %s is damaged. Camera references position beyond file end", filename.string().c_str());
+ continue;
+ }
+
+ // Get camera(s) - Main header, then dump them.
+ M2Camera const* cam = reinterpret_cast<M2Camera const*>(buffer.data() + header->ofsCameras);
+ if (!readCamera(cam, fileSize, header, dbcentry))
+ TC_LOG_ERROR("server.loading", "Camera file %s is damaged. Camera references position beyond file end", filename.string().c_str());
+ }
+ }
+ TC_LOG_INFO("server.loading", ">> Loaded %u cinematic waypoint sets in %u ms", (uint32)sFlyByCameraStore.size(), GetMSTimeDiffToNow(oldMSTime));
+}
diff --git a/src/server/game/DataStores/M2Stores.h b/src/server/game/DataStores/M2Stores.h
new file mode 100644
index 00000000000..97224475e5d
--- /dev/null
+++ b/src/server/game/DataStores/M2Stores.h
@@ -0,0 +1,36 @@
+/*
+* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation; either version 2 of the License, or (at your
+* option) any later version.
+*
+* This program is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+* more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef TRINITY_M2STORES_H
+#define TRINITY_M2STORES_H
+
+#include "SharedDefines.h"
+#include "Common.h"
+
+struct FlyByCamera
+{
+ uint32 timeStamp;
+ G3D::Vector4 locations;
+};
+
+typedef std::vector<FlyByCamera> FlyByCameraCollection;
+
+TC_GAME_API extern std::unordered_map<uint32, FlyByCameraCollection> sFlyByCameraStore;
+
+TC_GAME_API void LoadM2Cameras(std::string const& dataPath);
+
+#endif \ No newline at end of file
diff --git a/src/server/game/DataStores/M2Structure.h b/src/server/game/DataStores/M2Structure.h
new file mode 100644
index 00000000000..43e8d008b9f
--- /dev/null
+++ b/src/server/game/DataStores/M2Structure.h
@@ -0,0 +1,133 @@
+/*
+* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation; either version 2 of the License, or (at your
+* option) any later version.
+*
+* This program is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+* more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef TRINITY_M2STRUCTURE_H
+#define TRINITY_M2STRUCTURE_H
+
+#include <G3D/Vector3.h>
+#include <G3D/AABox.h>
+
+// Structures for M2 file. Source: https://wowdev.wiki
+#pragma pack(push, 1)
+template<typename T>
+struct M2SplineKey
+{
+ T p0;
+ T p1;
+ T p2;
+};
+
+struct M2Header
+{
+ char Magic[4]; // "MD20"
+ uint32 Version; // The version of the format.
+ uint32 lName; // Length of the model's name including the trailing \0
+ uint32 ofsName; // Offset to the name, it seems like models can get reloaded by this name.should be unique, i guess.
+ uint32 GlobalModelFlags; // 0x0001: tilt x, 0x0002: tilt y, 0x0008: add 2 fields in header, 0x0020: load .phys data (MoP+), 0x0080: has _lod .skin files (MoP?+), 0x0100: is camera related.
+ uint32 nGlobalSequences;
+ uint32 ofsGlobalSequences; // A list of timestamps.
+ uint32 nAnimations;
+ uint32 ofsAnimations; // Information about the animations in the model.
+ uint32 nAnimationLookup;
+ uint32 ofsAnimationLookup; // Mapping of global IDs to the entries in the Animation sequences block.
+ uint32 nBones; // MAX_BONES = 0x100
+ uint32 ofsBones; // Information about the bones in this model.
+ uint32 nKeyBoneLookup;
+ uint32 ofsKeyBoneLookup; // Lookup table for key skeletal bones.
+ uint32 nVertices;
+ uint32 ofsVertices; // Vertices of the model.
+ uint32 nViews; // Views (LOD) are now in .skins.
+ uint32 nSubmeshAnimations;
+ uint32 ofsSubmeshAnimations; // Submesh color and alpha animations definitions.
+ uint32 nTextures;
+ uint32 ofsTextures; // Textures of this model.
+ uint32 nTransparency;
+ uint32 ofsTransparency; // Transparency of textures.
+ uint32 nUVAnimation;
+ uint32 ofsUVAnimation;
+ uint32 nTexReplace;
+ uint32 ofsTexReplace; // Replaceable Textures.
+ uint32 nRenderFlags;
+ uint32 ofsRenderFlags; // Blending modes / render flags.
+ uint32 nBoneLookupTable;
+ uint32 ofsBoneLookupTable; // A bone lookup table.
+ uint32 nTexLookup;
+ uint32 ofsTexLookup; // The same for textures.
+ uint32 nTexUnits; // possibly removed with cata?!
+ uint32 ofsTexUnits; // And texture units. Somewhere they have to be too.
+ uint32 nTransLookup;
+ uint32 ofsTransLookup; // Everything needs its lookup. Here are the transparencies.
+ uint32 nUVAnimLookup;
+ uint32 ofsUVAnimLookup;
+ G3D::AABox BoundingBox; // min/max( [1].z, 2.0277779f ) - 0.16f seems to be the maximum camera height
+ float BoundingSphereRadius;
+ G3D::AABox CollisionBox;
+ float CollisionSphereRadius;
+ uint32 nBoundingTriangles;
+ uint32 ofsBoundingTriangles; // Our bounding volumes. Similar structure like in the old ofsViews.
+ uint32 nBoundingVertices;
+ uint32 ofsBoundingVertices;
+ uint32 nBoundingNormals;
+ uint32 ofsBoundingNormals;
+ uint32 nAttachments;
+ uint32 ofsAttachments; // Attachments are for weapons etc.
+ uint32 nAttachLookup;
+ uint32 ofsAttachLookup; // Of course with a lookup.
+ uint32 nEvents;
+ uint32 ofsEvents; // Used for playing sounds when dying and a lot else.
+ uint32 nLights;
+ uint32 ofsLights; // Lights are mainly used in loginscreens but in wands and some doodads too.
+ uint32 nCameras; // Format of Cameras changed with version 271!
+ uint32 ofsCameras; // The cameras are present in most models for having a model in the Character-Tab.
+ uint32 nCameraLookup;
+ uint32 ofsCameraLookup; // And lookup-time again.
+ uint32 nRibbonEmitters;
+ uint32 ofsRibbonEmitters; // Things swirling around. See the CoT-entrance for light-trails.
+ uint32 nParticleEmitters;
+ uint32 ofsParticleEmitters; // Spells and weapons, doodads and loginscreens use them. Blood dripping of a blade? Particles.
+ uint32 nBlendMaps; // This has to deal with blending. Exists IFF (flags & 0x8) != 0. When set, textures blending is overriden by the associated array. See M2/WotLK#Blend_mode_overrides
+ uint32 ofsBlendMaps; // Same as above. Points to an array of uint16 of nBlendMaps entries -- From WoD information.};
+};
+
+struct M2Array
+{
+ uint32_t number;
+ uint32 offset_elements;
+};
+struct M2Track
+{
+ uint16_t interpolation_type;
+ uint16_t global_sequence;
+ M2Array timestamps;
+ M2Array values;
+};
+
+struct M2Camera
+{
+ uint32_t type; // 0: portrait, 1: characterinfo; -1: else (flyby etc.); referenced backwards in the lookup table.
+ float fov; // No radians, no degrees. Multiply by 35 to get degrees.
+ float far_clip;
+ float near_clip;
+ M2Track positions; // How the camera's position moves. Should be 3*3 floats.
+ G3D::Vector3 position_base;
+ M2Track target_positions; // How the target moves. Should be 3*3 floats.
+ G3D::Vector3 target_position_base;
+ M2Track rolldata; // The camera can have some roll-effect. Its 0 to 2*Pi.
+};
+#pragma pack(pop)
+
+#endif \ No newline at end of file
diff --git a/src/server/game/DungeonFinding/LFG.h b/src/server/game/DungeonFinding/LFG.h
index 73c123723b1..b837a0df272 100644
--- a/src/server/game/DungeonFinding/LFG.h
+++ b/src/server/game/DungeonFinding/LFG.h
@@ -101,9 +101,9 @@ typedef std::map<ObjectGuid, LfgLockMap> LfgLockPartyMap;
typedef std::map<ObjectGuid, uint8> LfgRolesMap;
typedef std::map<ObjectGuid, ObjectGuid> LfgGroupsMap;
-std::string ConcatenateDungeons(LfgDungeonSet const& dungeons);
-std::string GetRolesString(uint8 roles);
-std::string GetStateString(LfgState state);
+TC_GAME_API std::string ConcatenateDungeons(LfgDungeonSet const& dungeons);
+TC_GAME_API std::string GetRolesString(uint8 roles);
+TC_GAME_API std::string GetStateString(LfgState state);
} // namespace lfg
diff --git a/src/server/game/DungeonFinding/LFGGroupData.h b/src/server/game/DungeonFinding/LFGGroupData.h
index 7ae4777cd4d..62a41b6b350 100644
--- a/src/server/game/DungeonFinding/LFGGroupData.h
+++ b/src/server/game/DungeonFinding/LFGGroupData.h
@@ -31,7 +31,7 @@ enum LfgGroupEnum
/**
Stores all lfg data needed about a group.
*/
-class LfgGroupData
+class TC_GAME_API LfgGroupData
{
public:
LfgGroupData();
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index b0a1777f19a..4ca1a68c048 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -40,8 +40,6 @@ namespace lfg
LFGMgr::LFGMgr(): m_QueueTimer(0), m_lfgProposalId(1),
m_options(sWorld->getIntConfig(CONFIG_LFG_OPTIONSMASK))
{
- new LFGPlayerScript();
- new LFGGroupScript();
}
LFGMgr::~LFGMgr()
@@ -84,19 +82,19 @@ void LFGMgr::_SaveToDB(ObjectGuid guid, uint32 db_guid)
if (!guid.IsGroup())
return;
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA);
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA);
stmt->setUInt32(0, db_guid);
-
- CharacterDatabase.Execute(stmt);
+ trans->Append(stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_LFG_DATA);
stmt->setUInt32(0, db_guid);
-
stmt->setUInt32(1, GetDungeon(guid));
stmt->setUInt32(2, GetState(guid));
+ trans->Append(stmt);
- CharacterDatabase.Execute(stmt);
+ CharacterDatabase.CommitTransaction(trans);
}
/// Load rewards for completing dungeons
@@ -261,6 +259,12 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
}
}
+LFGMgr* LFGMgr::instance()
+{
+ static LFGMgr instance;
+ return &instance;
+}
+
void LFGMgr::Update(uint32 diff)
{
if (!isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
@@ -1142,7 +1146,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
for (GuidList::const_iterator it = proposal.queues.begin(); it != proposal.queues.end(); ++it)
{
ObjectGuid guid = *it;
- queue.AddToQueue(guid);
+ queue.AddToQueue(guid, true);
}
ProposalsStore.erase(itProposal);
@@ -1900,8 +1904,16 @@ bool LFGMgr::AllQueued(GuidList const& check)
return false;
for (GuidList::const_iterator it = check.begin(); it != check.end(); ++it)
- if (GetState(*it) != LFG_STATE_QUEUED)
+ {
+ LfgState state = GetState(*it);
+ if (state != LFG_STATE_QUEUED)
+ {
+ if (state != LFG_STATE_PROPOSAL)
+ TC_LOG_DEBUG("lfg.allqueued", "Unexpected state found while trying to form new group. Guid: %s, State: %s", (*it).ToString().c_str(), GetStateString(state).c_str());
+
return false;
+ }
+ }
return true;
}
diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h
index 90a8d802f9d..c72c0a3cdab 100644
--- a/src/server/game/DungeonFinding/LFGMgr.h
+++ b/src/server/game/DungeonFinding/LFGMgr.h
@@ -289,18 +289,14 @@ struct LFGDungeonData
uint32 Entry() const { return id + (type << 24); }
};
-class LFGMgr
+class TC_GAME_API LFGMgr
{
private:
LFGMgr();
~LFGMgr();
public:
- static LFGMgr* instance()
- {
- static LFGMgr instance;
- return &instance;
- }
+ static LFGMgr* instance();
// Functions used outside lfg namespace
void Update(uint32 diff);
diff --git a/src/server/game/DungeonFinding/LFGPlayerData.h b/src/server/game/DungeonFinding/LFGPlayerData.h
index 859317ca956..91e4153a6d5 100644
--- a/src/server/game/DungeonFinding/LFGPlayerData.h
+++ b/src/server/game/DungeonFinding/LFGPlayerData.h
@@ -26,7 +26,7 @@ namespace lfg
/**
Stores all lfg data needed about the player.
*/
-class LfgPlayerData
+class TC_GAME_API LfgPlayerData
{
public:
LfgPlayerData();
diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp
index 314803d1602..d156158dee6 100644
--- a/src/server/game/DungeonFinding/LFGQueue.cpp
+++ b/src/server/game/DungeonFinding/LFGQueue.cpp
@@ -117,7 +117,7 @@ std::string LFGQueue::GetDetailedMatchRoles(GuidList const& check) const
return o.str();
}
-void LFGQueue::AddToQueue(ObjectGuid guid)
+void LFGQueue::AddToQueue(ObjectGuid guid, bool reAdd)
{
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(guid);
if (itQueue == QueueDataStore.end())
@@ -126,7 +126,10 @@ void LFGQueue::AddToQueue(ObjectGuid guid)
return;
}
- AddToNewQueue(guid);
+ if (reAdd)
+ AddToFrontCurrentQueue(guid);
+ else
+ AddToNewQueue(guid);
}
void LFGQueue::RemoveFromQueue(ObjectGuid guid)
@@ -171,6 +174,11 @@ void LFGQueue::AddToCurrentQueue(ObjectGuid guid)
currentQueueStore.push_back(guid);
}
+void LFGQueue::AddToFrontCurrentQueue(ObjectGuid guid)
+{
+ currentQueueStore.push_front(guid);
+}
+
void LFGQueue::RemoveFromCurrentQueue(ObjectGuid guid)
{
currentQueueStore.remove(guid);
diff --git a/src/server/game/DungeonFinding/LFGQueue.h b/src/server/game/DungeonFinding/LFGQueue.h
index ed8193ab605..32711e81468 100644
--- a/src/server/game/DungeonFinding/LFGQueue.h
+++ b/src/server/game/DungeonFinding/LFGQueue.h
@@ -83,13 +83,13 @@ typedef std::map<ObjectGuid, LfgQueueData> LfgQueueDataContainer;
/**
Stores all data related to queue
*/
-class LFGQueue
+class TC_GAME_API LFGQueue
{
public:
// Add/Remove from queue
std::string GetDetailedMatchRoles(GuidList const& check) const;
- void AddToQueue(ObjectGuid guid);
+ void AddToQueue(ObjectGuid guid, bool reAdd = false);
void RemoveFromQueue(ObjectGuid guid);
void AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap);
void RemoveQueueData(ObjectGuid guid);
@@ -116,6 +116,7 @@ class LFGQueue
void AddToNewQueue(ObjectGuid guid);
void AddToCurrentQueue(ObjectGuid guid);
+ void AddToFrontCurrentQueue(ObjectGuid guid);
void RemoveFromNewQueue(ObjectGuid guid);
void RemoveFromCurrentQueue(ObjectGuid guid);
diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp
index 79d36055870..1d2b963b254 100644
--- a/src/server/game/DungeonFinding/LFGScripts.cpp
+++ b/src/server/game/DungeonFinding/LFGScripts.cpp
@@ -241,4 +241,10 @@ void LFGGroupScript::OnInviteMember(Group* group, ObjectGuid guid)
sLFGMgr->LeaveLfg(leader);
}
+void AddSC_LFGScripts()
+{
+ new LFGPlayerScript();
+ new LFGGroupScript();
+}
+
} // namespace lfg
diff --git a/src/server/game/DungeonFinding/LFGScripts.h b/src/server/game/DungeonFinding/LFGScripts.h
index 377614bc55d..9f52668ea61 100644
--- a/src/server/game/DungeonFinding/LFGScripts.h
+++ b/src/server/game/DungeonFinding/LFGScripts.h
@@ -29,7 +29,7 @@ class Group;
namespace lfg
{
-class LFGPlayerScript : public PlayerScript
+class TC_GAME_API LFGPlayerScript : public PlayerScript
{
public:
LFGPlayerScript();
@@ -40,7 +40,7 @@ class LFGPlayerScript : public PlayerScript
void OnMapChanged(Player* player) override;
};
-class LFGGroupScript : public GroupScript
+class TC_GAME_API LFGGroupScript : public GroupScript
{
public:
LFGGroupScript();
@@ -53,4 +53,6 @@ class LFGGroupScript : public GroupScript
void OnInviteMember(Group* group, ObjectGuid guid) override;
};
+/*keep private*/ void AddSC_LFGScripts();
+
} // namespace lfg
diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp
index 8f700cc636f..22bb9bca712 100644
--- a/src/server/game/Entities/Corpse/Corpse.cpp
+++ b/src/server/game/Entities/Corpse/Corpse.cpp
@@ -147,7 +147,7 @@ bool Corpse::LoadCorpseFromDB(ObjectGuid::LowType guid, Field* fields)
SetObjectScale(1.0f);
SetUInt32Value(CORPSE_FIELD_DISPLAY_ID, fields[5].GetUInt32());
- _LoadIntoDataField(fields[6].GetCString(), CORPSE_FIELD_ITEM, EQUIPMENT_SLOT_END);
+ _LoadIntoDataField(fields[6].GetString(), CORPSE_FIELD_ITEM, EQUIPMENT_SLOT_END);
SetUInt32Value(CORPSE_FIELD_BYTES_1, fields[7].GetUInt32());
SetUInt32Value(CORPSE_FIELD_BYTES_2, fields[8].GetUInt32());
SetUInt32Value(CORPSE_FIELD_GUILD, fields[9].GetUInt32());
diff --git a/src/server/game/Entities/Corpse/Corpse.h b/src/server/game/Entities/Corpse/Corpse.h
index 5062645eac8..c9dd0b01509 100644
--- a/src/server/game/Entities/Corpse/Corpse.h
+++ b/src/server/game/Entities/Corpse/Corpse.h
@@ -46,7 +46,7 @@ enum CorpseFlags
CORPSE_FLAG_LOOTABLE = 0x20
};
-class Corpse : public WorldObject, public GridObject<Corpse>
+class TC_GAME_API Corpse : public WorldObject, public GridObject<Corpse>
{
public:
explicit Corpse(CorpseType type = CORPSE_BONES);
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 5d62b740947..4a5f70165fc 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -54,7 +54,7 @@ TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
if (itr != spellList.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
bool VendorItemData::RemoveItem(uint32 item_id)
@@ -78,7 +78,7 @@ VendorItem const* VendorItemData::FindItemCostPair(uint32 item_id, uint32 extend
for (VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i)
if ((*i)->item == item_id && (*i)->ExtendedCost == extendedCost)
return *i;
- return NULL;
+ return nullptr;
}
uint32 CreatureTemplate::GetRandomValidModelId() const
@@ -182,13 +182,13 @@ m_groupLootTimer(0), lootingGroupLowGUID(0), m_PlayerDamageReq(0),
m_lootRecipient(), m_lootRecipientGroup(0), _skinner(), _pickpocketLootRestore(0), m_corpseRemoveTime(0), m_respawnTime(0),
m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_boundaryCheckTime(2500), m_combatPulseTime(0), m_combatPulseDelay(0), m_reactState(REACT_AGGRESSIVE),
m_defaultMovementType(IDLE_MOTION_TYPE), m_spawnId(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false),
-m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
-m_originalEntry(0), m_homePosition(), m_transportHomePosition(), m_creatureInfo(NULL), m_creatureData(NULL), m_waypointID(0), m_path_id(0), m_formation(NULL)
+m_AlreadySearchedAssistance(false), m_regenHealth(true), m_cannotReachTarget(false), m_cannotReachTimer(0), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
+m_originalEntry(0), m_homePosition(), m_transportHomePosition(), m_creatureInfo(nullptr), m_creatureData(nullptr), m_waypointID(0), m_path_id(0), m_formation(nullptr), m_focusSpell(nullptr), m_focusDelay(0)
{
m_regenTimer = CREATURE_REGEN_INTERVAL;
m_valuesCount = UNIT_END;
- for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
m_spells[i] = 0;
DisableReputationGain = false;
@@ -197,16 +197,14 @@ m_originalEntry(0), m_homePosition(), m_transportHomePosition(), m_creatureInfo(
m_CombatDistance = 0;//MELEE_RANGE;
ResetLootMode(); // restore default loot mode
- TriggerJustRespawned = false;
+ m_TriggerJustRespawned = false;
m_isTempWorldObject = false;
- _focusSpell = NULL;
- _focusDelay = 0;
}
Creature::~Creature()
{
delete i_AI;
- i_AI = NULL;
+ i_AI = nullptr;
//if (m_uint32Values)
// TC_LOG_ERROR("entities.unit", "Deconstruct Creature Entry = %u", GetEntry());
@@ -344,10 +342,10 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
m_creatureInfo = cinfo; // map mode related always
// equal to player Race field, but creature does not have race
- SetByteValue(UNIT_FIELD_BYTES_0, 0, 0);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_RACE, 0);
// known valid are: CLASS_WARRIOR, CLASS_PALADIN, CLASS_ROGUE, CLASS_MAGE
- SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class));
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, uint8(cinfo->unit_class));
// Cancel load if no model defined
if (!(cinfo->GetFirstValidModelId()))
@@ -366,25 +364,25 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
SetDisplayId(displayID);
SetNativeDisplayId(displayID);
- SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
// Load creature equipment
- if (data && data->equipmentId != 0)
+ if (!data || data->equipmentId == 0)
+ LoadEquipment(); // use default equipment (if available)
+ else if (data && data->equipmentId != 0) // override, 0 means no equipment
{
m_originalEquipmentId = data->equipmentId;
LoadEquipment(data->equipmentId);
}
- else
- LoadEquipment(0, true);
SetName(normalInfo->Name); // at normal entry always
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
- SetSpeed(MOVE_WALK, cinfo->speed_walk);
- SetSpeed(MOVE_RUN, cinfo->speed_run);
- SetSpeed(MOVE_SWIM, 1.0f); // using 1.0 rate
- SetSpeed(MOVE_FLIGHT, 1.0f); // using 1.0 rate
+ SetSpeedRate(MOVE_WALK, cinfo->speed_walk);
+ SetSpeedRate(MOVE_RUN, cinfo->speed_run);
+ SetSpeedRate(MOVE_SWIM, 1.0f); // using 1.0 rate
+ SetSpeedRate(MOVE_FLIGHT, 1.0f); // using 1.0 rate
// Will set UNIT_FIELD_BOUNDINGRADIUS and UNIT_FIELD_COMBATREACH
SetObjectScale(cinfo->scale);
@@ -396,7 +394,7 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
if (!m_respawnradius && m_defaultMovementType == RANDOM_MOTION_TYPE)
m_defaultMovementType = IDLE_MOTION_TYPE;
- for (uint8 i=0; i < CREATURE_MAX_SPELLS; ++i)
+ for (uint8 i=0; i < MAX_CREATURE_SPELLS; ++i)
m_spells[i] = GetCreatureTemplate()->spells[i];
return true;
@@ -483,6 +481,9 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
}
+ if (cInfo->InhabitType & INHABIT_ROOT)
+ SetControlled(true, UNIT_STATE_ROOT);
+
UpdateMovementFlags();
LoadCreaturesAddon();
return true;
@@ -490,9 +491,9 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
void Creature::Update(uint32 diff)
{
- if (IsAIEnabled && TriggerJustRespawned)
+ if (IsAIEnabled && m_TriggerJustRespawned)
{
- TriggerJustRespawned = false;
+ m_TriggerJustRespawned = false;
AI()->JustRespawned();
if (m_vehicleKit)
m_vehicleKit->Reset();
@@ -578,7 +579,8 @@ void Creature::Update(uint32 diff)
IsAIEnabled = true;
if (!IsInEvadeMode() && LastCharmerGUID)
if (Unit* charmer = ObjectAccessor::GetUnit(*this, LastCharmerGUID))
- i_AI->AttackStart(charmer);
+ if (CanStartAttack(charmer, true))
+ i_AI->AttackStart(charmer);
LastCharmerGUID.Clear();
}
@@ -649,33 +651,32 @@ void Creature::Update(uint32 diff)
m_regenTimer -= diff;
}
- if (m_regenTimer != 0)
- break;
-
- bool bInCombat = IsInCombat() && (!GetVictim() || // if IsInCombat() is true and this has no victim
- !EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself() || // or the victim/owner/charmer is not a player
- !EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()->IsGameMaster()); // or the victim/owner/charmer is not a GameMaster
+ if (m_regenTimer == 0)
+ {
+ bool bInCombat = IsInCombat() && (!GetVictim() || // if IsInCombat() is true and this has no victim
+ !EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself() || // or the victim/owner/charmer is not a player
+ !EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()->IsGameMaster()); // or the victim/owner/charmer is not a GameMaster
- /*if (m_regenTimer <= diff)
- {*/
- if (!IsInEvadeMode() && (!bInCombat || IsPolymorphed())) // regenerate health if not in combat or if polymorphed
- RegenerateHealth();
+ if (!IsInEvadeMode() && (!bInCombat || IsPolymorphed() || CanNotReachTarget())) // regenerate health if not in combat or if polymorphed
+ RegenerateHealth();
- if (HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER))
- {
- if (getPowerType() == POWER_ENERGY)
- Regenerate(POWER_ENERGY);
- else
- RegenerateMana();
+ if (HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER))
+ {
+ if (getPowerType() == POWER_ENERGY)
+ Regenerate(POWER_ENERGY);
+ else
+ RegenerateMana();
+ }
+ m_regenTimer = CREATURE_REGEN_INTERVAL;
}
- /*if (!bIsPolymorphed) // only increase the timer if not polymorphed
- m_regenTimer += CREATURE_REGEN_INTERVAL - diff;
+ if (CanNotReachTarget() && !IsInEvadeMode() && !GetMap()->IsRaid())
+ {
+ m_cannotReachTimer += diff;
+ if (m_cannotReachTimer >= CREATURE_NOPATH_EVADE_TIME)
+ if (IsAIEnabled)
+ AI()->EnterEvadeMode(CreatureAI::EVADE_REASON_NO_PATH);
}
- else
- if (!bIsPolymorphed) // if polymorphed, skip the timer
- m_regenTimer -= diff;*/
- m_regenTimer = CREATURE_REGEN_INTERVAL;
break;
}
default:
@@ -768,7 +769,7 @@ void Creature::DoFleeToGetAssistance()
float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
if (radius >0)
{
- Creature* creature = NULL;
+ Creature* creature = nullptr;
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
@@ -781,7 +782,7 @@ void Creature::DoFleeToGetAssistance()
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
SetNoSearchAssistance(true);
- UpdateSpeed(MOVE_RUN, false);
+ UpdateSpeed(MOVE_RUN);
if (!creature)
//SetFeared(true, EnsureVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
@@ -792,6 +793,24 @@ void Creature::DoFleeToGetAssistance()
}
}
+bool Creature::AIM_Destroy()
+{
+ if (m_AI_locked)
+ {
+ TC_LOG_DEBUG("scripts", "AIM_Destroy: failed to destroy, locked.");
+ return false;
+ }
+
+ ASSERT(!i_disabledAI,
+ "The disabled AI wasn't cleared!");
+
+ delete i_AI;
+ i_AI = nullptr;
+
+ IsAIEnabled = false;
+ return true;
+}
+
bool Creature::AIM_Initialize(CreatureAI* ai)
{
// make sure nothing can change the AI during AI update
@@ -801,12 +820,12 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
return false;
}
- UnitAI* oldAI = i_AI;
+ AIM_Destroy();
Motion_Initialize();
i_AI = ai ? ai : FactorySelector::selectAI(this);
- delete oldAI;
+
IsAIEnabled = true;
i_AI->InitializeAI();
// Initialize vehicle
@@ -847,15 +866,17 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, u
//! returning correct zone id for selecting OutdoorPvP/Battlefield script
Relocate(x, y, z, ang);
- if (!CreateFromProto(guidlow, entry, data, vehId))
- return false;
-
+ // Check if the position is valid before calling CreateFromProto(), otherwise we might add Auras to Creatures at
+ // invalid position, triggering a crash about Auras not removed in the destructor
if (!IsPositionValid())
{
TC_LOG_ERROR("entities.unit", "Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, entry, x, y, z, ang);
return false;
}
+ if (!CreateFromProto(guidlow, entry, data, vehId))
+ return false;
+
switch (GetCreatureTemplate()->rank)
{
case CREATURE_ELITE_RARE:
@@ -890,7 +911,7 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, u
{
SetDisplayId(displayID);
SetNativeDisplayId(displayID);
- SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
}
LastUsedScriptID = GetCreatureTemplate()->ScriptID;
@@ -968,14 +989,14 @@ bool Creature::isCanTrainingAndResetTalentsOf(Player* player) const
Player* Creature::GetLootRecipient() const
{
if (!m_lootRecipient)
- return NULL;
+ return nullptr;
return ObjectAccessor::FindConnectedPlayer(m_lootRecipient);
}
Group* Creature::GetLootRecipientGroup() const
{
if (!m_lootRecipientGroup)
- return NULL;
+ return nullptr;
return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup);
}
@@ -983,7 +1004,7 @@ void Creature::SetLootRecipient(Unit* unit)
{
// set the player whose group should receive the right
// to loot the creature after it dies
- // should be set to NULL after the loot disappears
+ // should be set to nullptr after the loot disappears
if (!unit)
{
@@ -1356,8 +1377,8 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad
m_deathState = DEAD;
if (CanFly())
{
- float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, false);
- if (data->posZ - tz > 0.1f)
+ float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, true, MAX_FALL_DISTANCE);
+ if (data->posZ - tz > 0.1f && Trinity::IsValidMapCoord(tz))
Relocate(data->posX, data->posY, tz);
}
}
@@ -1607,7 +1628,7 @@ void Creature::setDeathState(DeathState s)
if (sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss())
SaveRespawnTime();
- ReleaseFocus(); // remove spellcast focus (this also clears unit target)
+ ReleaseFocus(nullptr, false); // remove spellcast focus
SetTarget(ObjectGuid::Empty); // drop target - dead mobs shouldn't ever target things
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
@@ -1619,7 +1640,7 @@ void Creature::setDeathState(DeathState s)
if (HasSearchedAssistance())
{
SetNoSearchAssistance(false);
- UpdateSpeed(MOVE_RUN, false);
+ UpdateSpeed(MOVE_RUN);
}
//Dismiss group if is leader
@@ -1636,7 +1657,7 @@ void Creature::setDeathState(DeathState s)
//if (IsPet())
// setActive(true);
SetFullHealth();
- SetLootRecipient(NULL);
+ SetLootRecipient(nullptr);
ResetPlayerDamageReq();
UpdateMovementFlags();
@@ -1706,7 +1727,7 @@ void Creature::Respawn(bool force)
{
SetDisplayId(displayID);
SetNativeDisplayId(displayID);
- SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
}
GetMotionMaster()->InitDefault();
@@ -1716,7 +1737,7 @@ void Creature::Respawn(bool force)
{
//reset the AI to be sure no dirty or uninitialized values will be used till next tick
AI()->Reset();
- TriggerJustRespawned = true;//delay event to next tick so all creatures are created on the map before processing
+ m_TriggerJustRespawned = true;//delay event to next tick so all creatures are created on the map before processing
}
uint32 poolid = GetSpawnId() ? sPoolMgr->IsPartOfAPool<Creature>(GetSpawnId()) : 0;
@@ -1807,15 +1828,15 @@ bool Creature::isWorldBoss() const
if (IsPet())
return false;
- return (GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_BOSS) != 0;
+ return (GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_BOSS_MOB) != 0;
}
SpellInfo const* Creature::reachWithSpellAttack(Unit* victim)
{
if (!victim)
- return NULL;
+ return nullptr;
- for (uint32 i=0; i < CREATURE_MAX_SPELLS; ++i)
+ for (uint32 i=0; i < MAX_CREATURE_SPELLS; ++i)
{
if (!m_spells[i])
continue;
@@ -1855,15 +1876,15 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* victim)
continue;
return spellInfo;
}
- return NULL;
+ return nullptr;
}
SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
{
if (!victim)
- return NULL;
+ return nullptr;
- for (uint32 i=0; i < CREATURE_MAX_SPELLS; ++i)
+ for (uint32 i=0; i < MAX_CREATURE_SPELLS; ++i)
{
if (!m_spells[i])
continue;
@@ -1902,7 +1923,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
continue;
return spellInfo;
}
- return NULL;
+ return nullptr;
}
// select nearest hostile unit within the given distance (regardless of threat list).
@@ -1912,7 +1933,7 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
Cell cell(p);
cell.SetNoCreate();
- Unit* target = NULL;
+ Unit* target = nullptr;
{
if (dist == 0.0f)
@@ -1938,7 +1959,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
Cell cell(p);
cell.SetNoCreate();
- Unit* target = NULL;
+ Unit* target = nullptr;
if (dist > MAX_VISIBILITY_DISTANCE)
{
@@ -1962,7 +1983,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
Player* Creature::SelectNearestPlayer(float distance) const
{
- Player* target = NULL;
+ Player* target = nullptr;
Trinity::NearestPlayerInObjectRangeCheck checker(this, distance);
Trinity::PlayerLastSearcher<Trinity::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
@@ -2259,7 +2280,7 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker)
WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4);
data << (uint32)GetAreaId();
- sWorld->SendGlobalMessage(&data, NULL, (enemy_team == ALLIANCE ? HORDE : ALLIANCE));
+ sWorld->SendGlobalMessage(&data, nullptr, (enemy_team == ALLIANCE ? HORDE : ALLIANCE));
}
void Creature::SetInCombatWithZone()
@@ -2308,10 +2329,10 @@ uint32 Creature::GetShieldBlockValue() const //dunno mob block
bool Creature::HasSpell(uint32 spellID) const
{
uint8 i;
- for (i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ for (i = 0; i < MAX_CREATURE_SPELLS; ++i)
if (spellID == m_spells[i])
break;
- return i < CREATURE_MAX_SPELLS; //broke before end of iteration of known spells
+ return i < MAX_CREATURE_SPELLS; //broke before end of iteration of known spells
}
time_t Creature::GetRespawnTimeEx() const
@@ -2756,13 +2777,13 @@ void Creature::SetTarget(ObjectGuid guid)
bool Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target)
{
// already focused
- if (_focusSpell)
+ if (m_focusSpell)
return false;
if ((!target || target == this) && !focusSpell->GetCastTime()) // instant cast, untargeted (or self-targeted) spell doesn't need any facing updates
return false;
- _focusSpell = focusSpell;
+ m_focusSpell = focusSpell;
// "instant" creature casts that require re-targeting will be delayed by a short moment to prevent facing bugs
bool shouldDelay = false;
@@ -2774,43 +2795,39 @@ bool Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target)
SetGuidValue(UNIT_FIELD_TARGET, newTarget);
if (target)
SetFacingToObject(target);
-
+
if ( // here we determine if the (relatively expensive) forced update is worth it, or whether we can afford to wait until the scheduled update tick
( // only require instant update for spells that actually have a visual
focusSpell->GetSpellInfo()->SpellVisual[0] ||
focusSpell->GetSpellInfo()->SpellVisual[1]
- ) && (
+ ) && (
!focusSpell->GetCastTime() || // if the spell is instant cast
focusSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST) // client gets confused if we attempt to turn at the regularly scheduled update packet
)
)
{
- const MapRefManager& mapPlayers = GetMap()->GetPlayers();
- for (MapRefManager::const_iterator it = mapPlayers.begin(); it != mapPlayers.end(); ++it)
- if (Player* player = (*it).GetSource())
+ std::list<Player*> playersNearby;
+ GetPlayerListInGrid(playersNearby, GetVisibilityRange());
+ for (Player* player : playersNearby)
+ {
+ // only update players that are known to the client (have already been created)
+ if (player->HaveAtClient(this))
{
- // only update players that can both see us, and are actually in combat with us (this is a performance tradeoff)
- if (player->CanSeeOrDetect(this, false, true) && IsInCombatWith(player))
- {
- SendUpdateToPlayer(player);
- shouldDelay = true;
- }
+ SendUpdateToPlayer(player);
+ shouldDelay = true;
}
+ }
if (shouldDelay)
shouldDelay = !(focusSpell->IsTriggered() || focusSpell->GetCastTime() || focusSpell->GetSpellInfo()->IsChanneled());
-
}
}
- // tell the creature that it should reacquire its current target after the cast is done (this is handled in ::Attack)
- MustReacquireTarget();
-
bool canTurnDuringCast = !focusSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST);
// Face the target - we need to do this before the unit state is modified for no-turn spells
if (target)
SetInFront(target);
else if (!canTurnDuringCast)
- if(Unit* victim = GetVictim())
+ if (Unit* victim = GetVictim())
SetInFront(victim); // ensure server-side orientation is correct at beginning of cast
if (!canTurnDuringCast)
@@ -2827,16 +2844,16 @@ bool Creature::IsFocusing(Spell const* focusSpell, bool withDelay)
return false;
}
- if (focusSpell && (focusSpell != _focusSpell))
+ if (focusSpell && (focusSpell != m_focusSpell))
return false;
- if (!_focusSpell)
+ if (!m_focusSpell)
{
- if (!withDelay || !_focusDelay)
+ if (!withDelay || !m_focusDelay)
return false;
- if (GetMSTimeDiffToNow(_focusDelay) > 1000) // @todo figure out if we can get rid of this magic number somehow
+ if (GetMSTimeDiffToNow(m_focusDelay) > 1000) // @todo figure out if we can get rid of this magic number somehow
{
- _focusDelay = 0; // save checks in the future
+ m_focusDelay = 0; // save checks in the future
return false;
}
}
@@ -2846,20 +2863,25 @@ bool Creature::IsFocusing(Spell const* focusSpell, bool withDelay)
void Creature::ReleaseFocus(Spell const* focusSpell, bool withDelay)
{
- if (!_focusSpell)
+ if (!m_focusSpell)
return;
// focused to something else
- if (focusSpell && focusSpell != _focusSpell)
+ if (focusSpell && focusSpell != m_focusSpell)
return;
- SetGuidValue(UNIT_FIELD_TARGET, ObjectGuid::Empty);
+ if (IsPet()) // player pets do not use delay system
+ SetGuidValue(UNIT_FIELD_TARGET, GetVictim() ? EnsureVictim()->GetGUID() : ObjectGuid::Empty);
+ else
+ // tell the creature that it should reacquire its actual target after the delay expires (this is handled in ::Attack)
+ // player pets don't need to do this, as they automatically reacquire their target on focus release
+ MustReacquireTarget();
- if (_focusSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST))
+ if (m_focusSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST))
ClearUnitState(UNIT_STATE_CANNOT_TURN);
- _focusSpell = nullptr;
- _focusDelay = withDelay ? getMSTime() : 0; // don't allow re-target right away to prevent visual bugs
+ m_focusSpell = nullptr;
+ m_focusDelay = (!IsPet() && withDelay) ? getMSTime() : 0; // don't allow re-target right away to prevent visual bugs
}
void Creature::StartPickPocketRefillTimer()
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 49bd854ef2f..cfe637c4b21 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -22,7 +22,7 @@
#include "Common.h"
#include "Unit.h"
#include "UpdateMask.h"
-#include "ItemPrototype.h"
+#include "ItemTemplate.h"
#include "LootMgr.h"
#include "DatabaseEnv.h"
#include "Cell.h"
@@ -67,15 +67,16 @@ enum CreatureFlagsExtra
CREATURE_FLAG_EXTRA_NO_SKILLGAIN | CREATURE_FLAG_EXTRA_TAUNT_DIMINISH | CREATURE_FLAG_EXTRA_ALL_DIMINISH | \
CREATURE_FLAG_EXTRA_GUARD | CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING | CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ | CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK)
-#define CREATURE_REGEN_INTERVAL 2 * IN_MILLISECONDS
+static const uint32 CREATURE_REGEN_INTERVAL = 2 * IN_MILLISECONDS;
+static const uint32 CREATURE_NOPATH_EVADE_TIME = 5 * IN_MILLISECONDS;
-#define MAX_KILL_CREDIT 2
-#define MAX_CREATURE_MODELS 4
-#define MAX_CREATURE_QUEST_ITEMS 6
-#define CREATURE_MAX_SPELLS 8
+static const uint8 MAX_KILL_CREDIT = 2;
+static const uint32 MAX_CREATURE_MODELS = 4;
+static const uint32 MAX_CREATURE_QUEST_ITEMS = 6;
+static const uint32 MAX_CREATURE_SPELLS = 8;
// from `creature_template` table
-struct CreatureTemplate
+struct TC_GAME_API CreatureTemplate
{
uint32 Entry;
uint32 DifficultyEntry[MAX_DIFFICULTY - 1];
@@ -106,7 +107,7 @@ struct CreatureTemplate
uint32 unit_flags; // enum UnitFlags mask values
uint32 unit_flags2; // enum UnitFlags2 mask values
uint32 dynamicflags;
- uint32 family; // enum CreatureFamily values (optional)
+ CreatureFamily family; // enum CreatureFamily values (optional)
uint32 trainer_type;
uint32 trainer_spell;
uint32 trainer_class;
@@ -117,7 +118,7 @@ struct CreatureTemplate
uint32 pickpocketLootId;
uint32 SkinLootId;
int32 resistance[MAX_SPELL_SCHOOL];
- uint32 spells[CREATURE_MAX_SPELLS];
+ uint32 spells[MAX_CREATURE_SPELLS];
uint32 PetSpellDataId;
uint32 VehicleId;
uint32 mingold;
@@ -145,11 +146,11 @@ struct CreatureTemplate
// helpers
SkillType GetRequiredLootSkill() const
{
- if (type_flags & CREATURE_TYPEFLAGS_HERBLOOT)
+ if (type_flags & CREATURE_TYPE_FLAG_HERB_SKINNING_SKILL)
return SKILL_HERBALISM;
- else if (type_flags & CREATURE_TYPEFLAGS_MININGLOOT)
+ else if (type_flags & CREATURE_TYPE_FLAG_MINING_SKINNING_SKILL)
return SKILL_MINING;
- else if (type_flags & CREATURE_TYPEFLAGS_ENGINEERLOOT)
+ else if (type_flags & CREATURE_TYPE_FLAG_ENGINEERING_SKINNING_SKILL)
return SKILL_ENGINEERING;
else
return SKILL_SKINNING; // normal case
@@ -157,12 +158,12 @@ struct CreatureTemplate
bool IsExotic() const
{
- return (type_flags & CREATURE_TYPEFLAGS_EXOTIC) != 0;
+ return (type_flags & CREATURE_TYPE_FLAG_EXOTIC_PET) != 0;
}
bool IsTameable(bool canTameExotic) const
{
- if (type != CREATURE_TYPE_BEAST || family == 0 || (type_flags & CREATURE_TYPEFLAGS_TAMEABLE) == 0)
+ if (type != CREATURE_TYPE_BEAST || family == CREATURE_FAMILY_NONE || (type_flags & CREATURE_TYPE_FLAG_TAMEABLE_PET) == 0)
return false;
// if can tame exotic then can tame any tameable
@@ -179,7 +180,7 @@ typedef std::unordered_map<uint32, CreatureTemplate> CreatureTemplateContainer;
#pragma pack(push, 1)
// Defines base stats for creatures (used to calculate HP/mana/armor/attackpower/rangedattackpower/all damage).
-struct CreatureBaseStats
+struct TC_GAME_API CreatureBaseStats
{
uint32 BaseHealth[MAX_EXPANSIONS];
uint32 BaseMana;
@@ -293,7 +294,8 @@ enum InhabitTypeValues
INHABIT_GROUND = 1,
INHABIT_WATER = 2,
INHABIT_AIR = 4,
- INHABIT_ANYWHERE = INHABIT_GROUND | INHABIT_WATER | INHABIT_AIR
+ INHABIT_ROOT = 8,
+ INHABIT_ANYWHERE = INHABIT_GROUND | INHABIT_WATER | INHABIT_AIR | INHABIT_ROOT
};
// Enums used by StringTextData::Type (CreatureEventAI)
@@ -401,7 +403,7 @@ struct TrainerSpell
typedef std::unordered_map<uint32 /*spellid*/, TrainerSpell> TrainerSpellMap;
-struct TrainerSpellData
+struct TC_GAME_API TrainerSpellData
{
TrainerSpellData() : trainerType(0) { }
~TrainerSpellData() { spellList.clear(); }
@@ -421,7 +423,7 @@ struct TrainerSpellData
typedef std::vector<uint8> CreatureTextRepeatIds;
typedef std::unordered_map<uint8, CreatureTextRepeatIds> CreatureTextRepeatGroup;
-class Creature : public Unit, public GridObject<Creature>, public MapObject
+class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public MapObject
{
public:
@@ -475,11 +477,13 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
uint8 getLevelForTarget(WorldObject const* target) const override; // overwrite Unit::getLevelForTarget for boss level support
bool IsInEvadeMode() const { return HasUnitState(UNIT_STATE_EVADE); }
+ bool IsEvadingAttacks() const { return IsInEvadeMode() || CanNotReachTarget(); }
+ bool AIM_Destroy();
bool AIM_Initialize(CreatureAI* ai = NULL);
void Motion_Initialize();
- CreatureAI* AI() const { return (CreatureAI*)i_AI; }
+ CreatureAI* AI() const { return reinterpret_cast<CreatureAI*>(i_AI); }
bool SetWalk(bool enable) override;
bool SetDisableGravity(bool disable, bool packetOnly = false) override;
@@ -566,7 +570,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
SpellInfo const* reachWithSpellAttack(Unit* victim);
SpellInfo const* reachWithSpellCure(Unit* victim);
- uint32 m_spells[CREATURE_MAX_SPELLS];
+ uint32 m_spells[MAX_CREATURE_SPELLS];
bool CanStartAttack(Unit const* u, bool force) const;
float GetAttackDistance(Unit const* player) const;
@@ -594,6 +598,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
void RemoveCorpse(bool setSpawnTime = true);
void DespawnOrUnsummon(uint32 msTimeToDespawn = 0);
+ void DespawnOrUnsummon(Milliseconds const& time) { DespawnOrUnsummon(uint32(time.count())); }
time_t const& GetRespawnTime() const { return m_respawnTime; }
time_t GetRespawnTimeEx() const;
@@ -631,6 +636,15 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
virtual uint8 GetPetAutoSpellSize() const { return MAX_SPELL_CHARM; }
virtual uint32 GetPetAutoSpellOnPos(uint8 pos) const;
+ void SetCannotReachTarget(bool cannotReach)
+ {
+ if (cannotReach == m_cannotReachTarget)
+ return;
+ m_cannotReachTarget = cannotReach;
+ m_cannotReachTimer = 0;
+ }
+ bool CanNotReachTarget() const { return m_cannotReachTarget; }
+
void SetPosition(float x, float y, float z, float o);
void SetPosition(const Position &pos) { SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); }
@@ -718,6 +732,8 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
bool m_AlreadyCallAssistance;
bool m_AlreadySearchedAssistance;
bool m_regenHealth;
+ bool m_cannotReachTarget;
+ uint32 m_cannotReachTimer;
bool m_AI_locked;
SpellSchoolMask m_meleeDamageSchoolMask;
@@ -746,15 +762,15 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
//Formation var
CreatureGroup* m_formation;
- bool TriggerJustRespawned;
+ bool m_TriggerJustRespawned;
- Spell const* _focusSpell; ///> Locks the target during spell cast for proper facing
- uint32 _focusDelay;
+ Spell const* m_focusSpell; ///> Locks the target during spell cast for proper facing
+ uint32 m_focusDelay;
CreatureTextRepeatGroup m_textRepeat;
};
-class AssistDelayEvent : public BasicEvent
+class TC_GAME_API AssistDelayEvent : public BasicEvent
{
public:
AssistDelayEvent(ObjectGuid victim, Unit& owner) : BasicEvent(), m_victim(victim), m_owner(owner) { }
@@ -769,7 +785,7 @@ class AssistDelayEvent : public BasicEvent
Unit& m_owner;
};
-class ForcedDespawnDelayEvent : public BasicEvent
+class TC_GAME_API ForcedDespawnDelayEvent : public BasicEvent
{
public:
ForcedDespawnDelayEvent(Creature& owner) : BasicEvent(), m_owner(owner) { }
diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp
index 9f26c927374..0c41089efce 100644
--- a/src/server/game/Entities/Creature/CreatureGroups.cpp
+++ b/src/server/game/Entities/Creature/CreatureGroups.cpp
@@ -30,6 +30,12 @@ FormationMgr::~FormationMgr()
delete itr->second;
}
+FormationMgr* FormationMgr::instance()
+{
+ static FormationMgr instance;
+ return &instance;
+}
+
void FormationMgr::AddCreatureToGroup(uint32 leaderGuid, Creature* creature)
{
Map* map = creature->FindMap();
diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h
index 7b16585a996..14472a30293 100644
--- a/src/server/game/Entities/Creature/CreatureGroups.h
+++ b/src/server/game/Entities/Creature/CreatureGroups.h
@@ -38,18 +38,14 @@ struct FormationInfo
typedef std::unordered_map<uint32/*memberDBGUID*/, FormationInfo*> CreatureGroupInfoType;
-class FormationMgr
+class TC_GAME_API FormationMgr
{
private:
FormationMgr() { }
~FormationMgr();
public:
- static FormationMgr* instance()
- {
- static FormationMgr instance;
- return &instance;
- }
+ static FormationMgr* instance();
void AddCreatureToGroup(uint32 group_id, Creature* creature);
void RemoveCreatureFromGroup(CreatureGroup* group, Creature* creature);
@@ -57,7 +53,7 @@ class FormationMgr
CreatureGroupInfoType CreatureGroupMap;
};
-class CreatureGroup
+class TC_GAME_API CreatureGroup
{
private:
Creature* m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D
diff --git a/src/server/game/Entities/Creature/GossipDef.h b/src/server/game/Entities/Creature/GossipDef.h
index 1e64e83c86a..01b27032286 100644
--- a/src/server/game/Entities/Creature/GossipDef.h
+++ b/src/server/game/Entities/Creature/GossipDef.h
@@ -157,7 +157,7 @@ struct QuestMenuItem
typedef std::vector<QuestMenuItem> QuestMenuItemList;
-class GossipMenu
+class TC_GAME_API GossipMenu
{
public:
GossipMenu();
@@ -222,7 +222,7 @@ class GossipMenu
LocaleConstant _locale;
};
-class QuestMenu
+class TC_GAME_API QuestMenu
{
public:
QuestMenu();
@@ -252,7 +252,7 @@ class QuestMenu
QuestMenuItemList _questMenuItems;
};
-class PlayerMenu
+class TC_GAME_API PlayerMenu
{
public:
explicit PlayerMenu(WorldSession* session);
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index 8bf3a1e2846..12e3af3c290 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -227,6 +227,11 @@ void TempSummon::InitSummon()
}
}
+void TempSummon::UpdateObjectVisibilityOnCreate()
+{
+ WorldObject::UpdateObjectVisibility(true);
+}
+
void TempSummon::SetTempSummonType(TempSummonType type)
{
m_type = type;
diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h
index 6d058f405a8..87cb883b261 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.h
+++ b/src/server/game/Entities/Creature/TemporarySummon.h
@@ -37,7 +37,7 @@ struct TempSummonData
uint32 time; ///< Despawn time, usable only with certain temp summon types
};
-class TempSummon : public Creature
+class TC_GAME_API TempSummon : public Creature
{
public:
explicit TempSummon(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject);
@@ -45,6 +45,7 @@ class TempSummon : public Creature
void Update(uint32 time) override;
virtual void InitStats(uint32 lifetime);
virtual void InitSummon();
+ void UpdateObjectVisibilityOnCreate() override;
virtual void UnSummon(uint32 msTime = 0);
void RemoveFromWorld() override;
void SetTempSummonType(TempSummonType type);
@@ -63,7 +64,7 @@ class TempSummon : public Creature
ObjectGuid m_summonerGUID;
};
-class Minion : public TempSummon
+class TC_GAME_API Minion : public TempSummon
{
public:
Minion(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject);
@@ -81,7 +82,7 @@ class Minion : public TempSummon
float m_followAngle;
};
-class Guardian : public Minion
+class TC_GAME_API Guardian : public Minion
{
public:
Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject);
@@ -105,7 +106,7 @@ class Guardian : public Minion
float m_statFromOwner[MAX_STATS];
};
-class Puppet : public Minion
+class TC_GAME_API Puppet : public Minion
{
public:
Puppet(SummonPropertiesEntry const* properties, Unit* owner);
@@ -115,7 +116,7 @@ class Puppet : public Minion
void RemoveFromWorld() override;
};
-class ForcedUnsummonDelayEvent : public BasicEvent
+class TC_GAME_API ForcedUnsummonDelayEvent : public BasicEvent
{
public:
ForcedUnsummonDelayEvent(TempSummon& owner) : BasicEvent(), m_owner(owner) { }
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h
index 9443a5b5b89..d7c1f0190fd 100644
--- a/src/server/game/Entities/DynamicObject/DynamicObject.h
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.h
@@ -32,7 +32,7 @@ enum DynamicObjectType
DYNAMIC_OBJECT_FARSIGHT_FOCUS = 0x2
};
-class DynamicObject : public WorldObject, public GridObject<DynamicObject>, public MapObject
+class TC_GAME_API DynamicObject : public WorldObject, public GridObject<DynamicObject>, public MapObject
{
public:
DynamicObject(bool isWorldObject);
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 1acfeacbf83..ba336303a35 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -34,7 +34,7 @@
#include "Transport.h"
GameObject::GameObject() : WorldObject(false), MapObject(),
- m_model(NULL), m_goValue(), m_AI(NULL)
+ m_model(nullptr), m_goValue(), m_AI(nullptr)
{
m_objectType |= TYPEMASK_GAMEOBJECT;
m_objectTypeId = TYPEID_GAMEOBJECT;
@@ -49,11 +49,11 @@ GameObject::GameObject() : WorldObject(false), MapObject(),
m_usetimes = 0;
m_spellId = 0;
m_cooldownTime = 0;
- m_goInfo = NULL;
- m_goData = NULL;
+ m_goInfo = nullptr;
+ m_goData = nullptr;
+ m_packedRotation = 0;
m_spawnId = 0;
- m_rotation = 0;
m_lootRecipientGroup = 0;
m_groupLootTimer = 0;
@@ -71,9 +71,15 @@ GameObject::~GameObject()
// CleanupsBeforeDelete();
}
-bool GameObject::AIM_Initialize()
+void GameObject::AIM_Destroy()
{
delete m_AI;
+ m_AI = nullptr;
+}
+
+bool GameObject::AIM_Initialize()
+{
+ AIM_Destroy();
m_AI = FactorySelector::SelectGameObjectAI(this);
@@ -167,16 +173,16 @@ void GameObject::RemoveFromWorld()
}
}
-bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit)
+bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, uint32 phaseMask, Position const& pos, G3D::Quat const& rotation, uint32 animprogress, GOState go_state, uint32 artKit /*= 0*/)
{
ASSERT(map);
SetMap(map);
- Relocate(x, y, z, ang);
- m_stationaryPosition.Relocate(x, y, z, ang);
+ Relocate(pos);
+ m_stationaryPosition.Relocate(pos);
if (!IsPositionValid())
{
- TC_LOG_ERROR("misc", "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
+ TC_LOG_ERROR("misc", "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, pos.GetPositionX(), pos.GetPositionY());
return false;
}
@@ -193,7 +199,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id);
if (!goinfo)
{
- TC_LOG_ERROR("sql.sql", "Gameobject (GUID: %u Entry: %u) not created: non-existing entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f)", guidlow, name_id, map->GetId(), x, y, z);
+ TC_LOG_ERROR("sql.sql", "Gameobject (GUID: %u Entry: %u) not created: non-existing entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f)", guidlow, name_id, map->GetId(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
return false;
}
@@ -216,10 +222,15 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
return false;
}
- SetFloatValue(GAMEOBJECT_PARENTROTATION+0, rotation0);
- SetFloatValue(GAMEOBJECT_PARENTROTATION+1, rotation1);
+ SetWorldRotation(rotation);
+ GameObjectAddon const* gameObjectAddon = sObjectMgr->GetGameObjectAddon(GetSpawnId());
+
+ // For most of gameobjects is (0, 0, 0, 1) quaternion, there are only some transports with not standard rotation
+ G3D::Quat parentRotation;
+ if (gameObjectAddon)
+ parentRotation = gameObjectAddon->ParentRotation;
- UpdateRotationFields(rotation2, rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3
+ SetParentRotation(parentRotation);
SetObjectScale(goinfo->size);
@@ -279,13 +290,10 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
break;
}
- if (GameObjectAddon const* addon = sObjectMgr->GetGameObjectAddon(GetSpawnId()))
+ if (gameObjectAddon && gameObjectAddon->InvisibilityValue)
{
- if (addon->InvisibilityValue)
- {
- m_invisibility.AddFlag(addon->invisibilityType);
- m_invisibility.AddValue(addon->invisibilityType, addon->InvisibilityValue);
- }
+ m_invisibility.AddFlag(gameObjectAddon->invisibilityType);
+ m_invisibility.AddValue(gameObjectAddon->invisibilityType, gameObjectAddon->InvisibilityValue);
}
LastUsedScriptID = GetGOInfo()->ScriptId;
@@ -490,7 +498,7 @@ void GameObject::Update(uint32 diff)
radius = goInfo->trap.diameter / 2.f;
// Pointer to appropriate target if found any
- Unit* target = NULL;
+ Unit* target = nullptr;
/// @todo this hack with search required until GO casting not implemented
if (Unit* owner = GetOwner())
@@ -505,7 +513,7 @@ void GameObject::Update(uint32 diff)
else
{
// Environmental trap: Any player
- Player* player = NULL;
+ Player* player = nullptr;
Trinity::AnyPlayerInObjectRangeCheck checker(this, radius);
Trinity::PlayerSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
VisitNearbyWorldObject(radius, searcher);
@@ -565,8 +573,8 @@ void GameObject::Update(uint32 diff)
GameObjectTemplate const* goInfo = GetGOInfo();
if (goInfo->trap.type == 2 && goInfo->trap.spellId)
{
- /// @todo NULL target won't work for target type 1
- CastSpell(NULL, goInfo->trap.spellId);
+ /// @todo nullptr target won't work for target type 1
+ CastSpell(nullptr, goInfo->trap.spellId);
SetLootState(GO_JUST_DEACTIVATED);
}
else if (Unit* target = ObjectAccessor::GetUnit(*this, m_lootStateUnitGUID))
@@ -774,10 +782,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
data.posY = GetPositionY();
data.posZ = GetPositionZ();
data.orientation = GetOrientation();
- data.rotation0 = GetFloatValue(GAMEOBJECT_PARENTROTATION+0);
- data.rotation1 = GetFloatValue(GAMEOBJECT_PARENTROTATION+1);
- data.rotation2 = GetFloatValue(GAMEOBJECT_PARENTROTATION+2);
- data.rotation3 = GetFloatValue(GAMEOBJECT_PARENTROTATION+3);
+ data.rotation = m_worldRotation;
data.spawntimesecs = m_spawnedByDefault ? m_respawnDelayTime : -(int32)m_respawnDelayTime;
data.animprogress = GetGoAnimProgress();
data.go_state = GetGoState();
@@ -803,10 +808,10 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
stmt->setFloat(index++, GetPositionY());
stmt->setFloat(index++, GetPositionZ());
stmt->setFloat(index++, GetOrientation());
- stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION));
- stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION+1));
- stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION+2));
- stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION+3));
+ stmt->setFloat(index++, m_worldRotation.x);
+ stmt->setFloat(index++, m_worldRotation.y);
+ stmt->setFloat(index++, m_worldRotation.z);
+ stmt->setFloat(index++, m_worldRotation.w);
stmt->setInt32(index++, int32(m_respawnDelayTime));
stmt->setUInt8(index++, GetGoAnimProgress());
stmt->setUInt8(index++, uint8(GetGoState()));
@@ -828,22 +833,14 @@ bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, boo
uint32 entry = data->id;
//uint32 map_id = data->mapid; // already used before call
uint32 phaseMask = data->phaseMask;
- float x = data->posX;
- float y = data->posY;
- float z = data->posZ;
- float ang = data->orientation;
-
- float rotation0 = data->rotation0;
- float rotation1 = data->rotation1;
- float rotation2 = data->rotation2;
- float rotation3 = data->rotation3;
+ Position pos(data->posX, data->posY, data->posZ, data->orientation);
uint32 animprogress = data->animprogress;
GOState go_state = data->go_state;
uint32 artKit = data->artKit;
m_spawnId = spawnId;
- if (!Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit))
+ if (!Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, phaseMask, pos, data->rotation, animprogress, go_state, artKit))
return false;
if (data->spawntimesecs >= 0)
@@ -862,7 +859,7 @@ bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, boo
m_respawnTime = GetMap()->GetGORespawnTime(m_spawnId);
// ready to respawn
- if (m_respawnTime && m_respawnTime <= time(NULL))
+ if (m_respawnTime && m_respawnTime <= time(nullptr))
{
m_respawnTime = 0;
GetMap()->RemoveGORespawnTime(m_spawnId);
@@ -1087,7 +1084,7 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
float range = float(target->GetSpellMaxRangeForTarget(GetOwner(), trapSpell));
// search nearest linked GO
- GameObject* trapGO = NULL;
+ GameObject* trapGO = nullptr;
{
// using original GO distance
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
@@ -1107,7 +1104,7 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
GameObject* GameObject::LookupFishingHoleAround(float range)
{
- GameObject* ok = NULL;
+ GameObject* ok = nullptr;
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
@@ -1130,7 +1127,7 @@ void GameObject::ResetDoorOrButton()
m_cooldownTime = 0;
}
-void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */, Unit* user /*=NULL*/)
+void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */, Unit* user /*=nullptr*/)
{
if (m_lootState != GO_READY)
return;
@@ -1154,7 +1151,7 @@ void GameObject::SetGoArtKit(uint8 kit)
void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, ObjectGuid::LowType lowguid)
{
- const GameObjectData* data = NULL;
+ const GameObjectData* data = nullptr;
if (go)
{
go->SetGoArtKit(artkit);
@@ -1282,8 +1279,8 @@ void GameObject::Use(Unit* user)
{
if (Player* ChairUser = ObjectAccessor::FindPlayer(itr->second))
{
- if (ChairUser->IsSitState() && ChairUser->getStandState() != UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f)
- continue; // This seat is already occupied by ChairUser. NOTE: Not sure if the ChairUser->getStandState() != UNIT_STAND_STATE_SIT check is required.
+ if (ChairUser->IsSitState() && ChairUser->GetStandState() != UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f)
+ continue; // This seat is already occupied by ChairUser. NOTE: Not sure if the ChairUser->GetStandState() != UNIT_STAND_STATE_SIT check is required.
else
itr->second.Clear(); // This seat is unoccupied.
}
@@ -1380,7 +1377,7 @@ void GameObject::Use(Unit* user)
// cast this spell later if provided
spellId = info->goober.spellId;
- spellCaster = NULL;
+ spellCaster = nullptr;
break;
}
@@ -1447,11 +1444,11 @@ void GameObject::Use(Unit* user)
TC_LOG_DEBUG("misc", "Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
- // but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
+ player->UpdateFishingSkill();
+
+ // but you will likely cause junk in areas that require a high fishing skill
if (chance >= roll)
{
- player->UpdateFishingSkill();
-
/// @todo I do not understand this hack. Need some explanation.
// prevent removing GO at spell cancel
RemoveFromOwner();
@@ -1499,7 +1496,7 @@ void GameObject::Use(Unit* user)
GameObjectTemplate const* info = GetGOInfo();
- Player* m_ritualOwner = NULL;
+ Player* m_ritualOwner = nullptr;
if (m_ritualOwnerGUID)
m_ritualOwner = ObjectAccessor::FindPlayer(m_ritualOwnerGUID);
@@ -1863,7 +1860,7 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const
&& dz < info->maxZ + radius && dz > info->minZ - radius;
}
-void GameObject::EventInform(uint32 eventId, WorldObject* invoker /*= NULL*/)
+void GameObject::EventInform(uint32 eventId, WorldObject* invoker /*= nullptr*/)
{
if (!eventId)
return;
@@ -1893,37 +1890,41 @@ std::string const & GameObject::GetNameForLocaleIdx(LocaleConstant loc_idx) cons
return GetName();
}
-void GameObject::UpdateRotationFields(float rotation2 /*=0.0f*/, float rotation3 /*=0.0f*/)
+void GameObject::UpdatePackedRotation()
{
- static double const atan_pow = atan(pow(2.0f, -20.0f));
-
- double f_rot1 = std::sin(GetOrientation() / 2.0f);
- double f_rot2 = std::cos(GetOrientation() / 2.0f);
+ static const int32 PACK_YZ = 1 << 20;
+ static const int32 PACK_X = PACK_YZ << 1;
- int64 i_rot1 = int64(f_rot1 / atan_pow *(f_rot2 >= 0 ? 1.0f : -1.0f));
- int64 rotation = (i_rot1 << 43 >> 43) & 0x00000000001FFFFF;
+ static const int32 PACK_YZ_MASK = (PACK_YZ << 1) - 1;
+ static const int32 PACK_X_MASK = (PACK_X << 1) - 1;
- //float f_rot2 = std::sin(0.0f / 2.0f);
- //int64 i_rot2 = f_rot2 / atan(pow(2.0f, -20.0f));
- //rotation |= (((i_rot2 << 22) >> 32) >> 11) & 0x000003FFFFE00000;
-
- //float f_rot3 = std::sin(0.0f / 2.0f);
- //int64 i_rot3 = f_rot3 / atan(pow(2.0f, -21.0f));
- //rotation |= (i_rot3 >> 42) & 0x7FFFFC0000000000;
+ int8 w_sign = (m_worldRotation.w >= 0.f ? 1 : -1);
+ int64 x = int32(m_worldRotation.x * PACK_X) * w_sign & PACK_X_MASK;
+ int64 y = int32(m_worldRotation.y * PACK_YZ) * w_sign & PACK_YZ_MASK;
+ int64 z = int32(m_worldRotation.z * PACK_YZ) * w_sign & PACK_YZ_MASK;
+ m_packedRotation = z | (y << 21) | (x << 42);
+}
- m_rotation = rotation;
+void GameObject::SetWorldRotation(G3D::Quat const& rot)
+{
+ m_worldRotation = rot.toUnit();
+ UpdatePackedRotation();
+}
- if (rotation2 == 0.0f && rotation3 == 0.0f)
- {
- rotation2 = (float)f_rot1;
- rotation3 = (float)f_rot2;
- }
+void GameObject::SetParentRotation(G3D::Quat const& rotation)
+{
+ SetFloatValue(GAMEOBJECT_PARENTROTATION + 0, rotation.x);
+ SetFloatValue(GAMEOBJECT_PARENTROTATION + 1, rotation.y);
+ SetFloatValue(GAMEOBJECT_PARENTROTATION + 2, rotation.z);
+ SetFloatValue(GAMEOBJECT_PARENTROTATION + 3, rotation.w);
+}
- SetFloatValue(GAMEOBJECT_PARENTROTATION+2, rotation2);
- SetFloatValue(GAMEOBJECT_PARENTROTATION+3, rotation3);
+void GameObject::SetWorldRotationAngles(float z_rot, float y_rot, float x_rot)
+{
+ SetWorldRotation(G3D::Quat(G3D::Matrix3::fromEulerAnglesZYX(z_rot, y_rot, x_rot)));
}
-void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, uint32 spellId /*= 0*/)
+void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= nullptr*/, uint32 spellId /*= 0*/)
{
if (!m_goValue.Building.MaxHealth || !change)
return;
@@ -1942,7 +1943,7 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, u
// Set the health bar, value = 255 * healthPct;
SetGoAnimProgress(m_goValue.Building.Health * 255 / m_goValue.Building.MaxHealth);
- Player* player = attackerOrHealer ? attackerOrHealer->GetCharmerOrOwnerPlayerOrPlayerItself() : NULL;
+ Player* player = attackerOrHealer ? attackerOrHealer->GetCharmerOrOwnerPlayerOrPlayerItself() : nullptr;
// dealing damage, send packet
if (player)
@@ -1973,7 +1974,7 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, u
SetDestructibleState(newState, player, false);
}
-void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker /*= NULL*/, bool setHealth /*= false*/)
+void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker /*= nullptr*/, bool setHealth /*= false*/)
{
// the user calling this must know he is already operating on destructible gameobject
ASSERT(GetGoType() == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING);
@@ -1998,7 +1999,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
- uint32 modelId = m_goInfo->building.damagedDisplayId;
+ uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->building.destructibleData))
if (modelData->DamagedDisplayId)
modelId = modelData->DamagedDisplayId;
@@ -2026,7 +2027,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
- uint32 modelId = m_goInfo->building.destroyedDisplayId;
+ uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->building.destructibleData))
if (modelData->DestroyedDisplayId)
modelId = modelData->DestroyedDisplayId;
@@ -2155,14 +2156,14 @@ void GameObject::UpdateModel()
Player* GameObject::GetLootRecipient() const
{
if (!m_lootRecipient)
- return NULL;
+ return nullptr;
return ObjectAccessor::FindConnectedPlayer(m_lootRecipient);
}
Group* GameObject::GetLootRecipientGroup() const
{
if (!m_lootRecipientGroup)
- return NULL;
+ return nullptr;
return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup);
}
@@ -2170,7 +2171,7 @@ void GameObject::SetLootRecipient(Unit* unit)
{
// set the player whose group should receive the right
// to loot the creature after it dies
- // should be set to NULL after the loot disappears
+ // should be set to nullptr after the loot disappears
if (!unit)
{
@@ -2289,7 +2290,7 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
data->append(fieldBuffer);
}
-void GameObject::GetRespawnPosition(float &x, float &y, float &z, float* ori /* = NULL*/) const
+void GameObject::GetRespawnPosition(float &x, float &y, float &z, float* ori /* = nullptr*/) const
{
if (m_spawnId)
{
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index 7be78556a50..a271512629b 100644
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -25,6 +25,7 @@
#include "Object.h"
#include "LootMgr.h"
#include "DatabaseEnv.h"
+#include <G3D/Quat.h>
class GameObjectAI;
class Group;
@@ -57,6 +58,7 @@ struct GameObjectTemplate
uint32 openTextID; //4 can be used to replace castBarCaption?
uint32 closeTextID; //5
uint32 ignoredByPathing; //6
+ uint32 conditionID1; //7
} door;
//1 GAMEOBJECT_TYPE_BUTTON
struct
@@ -70,6 +72,7 @@ struct GameObjectTemplate
uint32 openTextID; //6 can be used to replace castBarCaption?
uint32 closeTextID; //7
uint32 losOK; //8
+ uint32 conditionID1; //9
} button;
//2 GAMEOBJECT_TYPE_QUESTGIVER
struct
@@ -84,6 +87,7 @@ struct GameObjectTemplate
uint32 losOK; //7
uint32 allowMounted; //8 Is usable while on mount/vehicle. (0/1)
uint32 large; //9
+ uint32 conditionID1; //10
} questgiver;
//3 GAMEOBJECT_TYPE_CHEST
struct
@@ -105,6 +109,7 @@ struct GameObjectTemplate
uint32 openTextID; //14 can be used to replace castBarCaption?
uint32 groupLootRules; //15
uint32 floatingTooltip; //16
+ uint32 conditionID1; //17
} chest;
//4 GAMEOBJECT_TYPE_BINDER - empty
//5 GAMEOBJECT_TYPE_GENERIC
@@ -116,6 +121,7 @@ struct GameObjectTemplate
uint32 large; //3
uint32 floatOnWater; //4
int32 questID; //5
+ uint32 conditionID1; //6
} _generic;
//6 GAMEOBJECT_TYPE_TRAP
struct
@@ -135,6 +141,7 @@ struct GameObjectTemplate
uint32 openTextID; //12 can be used to replace castBarCaption?
uint32 closeTextID; //13
uint32 ignoreTotems; //14
+ uint32 conditionID1; //15
} trap;
//7 GAMEOBJECT_TYPE_CHAIR
struct
@@ -143,6 +150,7 @@ struct GameObjectTemplate
uint32 height; //1
uint32 onlyCreatorUse; //2
uint32 triggeredEvent; //3
+ uint32 conditionID1; //4
} chair;
//8 GAMEOBJECT_TYPE_SPELL_FOCUS
struct
@@ -154,6 +162,8 @@ struct GameObjectTemplate
uint32 questID; //4
uint32 large; //5
uint32 floatingTooltip; //6
+ uint32 floatOnWater; //7
+ uint32 conditionID1; //8
} spellFocus;
//9 GAMEOBJECT_TYPE_TEXT
struct
@@ -162,6 +172,7 @@ struct GameObjectTemplate
uint32 language; //1
uint32 pageMaterial; //2
uint32 allowMounted; //3 Is usable while on mount/vehicle. (0/1)
+ uint32 conditionID1; //4
} text;
//10 GAMEOBJECT_TYPE_GOOBER
struct
@@ -187,6 +198,8 @@ struct GameObjectTemplate
uint32 floatingTooltip; //18
uint32 gossipID; //19
uint32 WorldStateSetsState; //20
+ uint32 floatOnWater; //21
+ uint32 conditionID1; //22
} goober;
//11 GAMEOBJECT_TYPE_TRANSPORT
struct
@@ -196,6 +209,7 @@ struct GameObjectTemplate
uint32 autoCloseTime; //2 secs till autoclose = autoCloseTime / 0x10000
uint32 pause1EventID; //3
uint32 pause2EventID; //4
+ uint32 mapID; //5
} transport;
//12 GAMEOBJECT_TYPE_AREADAMAGE
struct
@@ -216,6 +230,7 @@ struct GameObjectTemplate
uint32 cinematicId; //1
uint32 eventID; //2
uint32 openTextID; //3 can be used to replace castBarCaption?
+ uint32 conditionID1; //4
} camera;
//14 GAMEOBJECT_TYPE_MAPOBJECT - empty
//15 GAMEOBJECT_TYPE_MO_TRANSPORT
@@ -244,9 +259,14 @@ struct GameObjectTemplate
uint32 casterTargetSpellTargets; //5
uint32 castersGrouped; //6
uint32 ritualNoTargetCheck; //7
+ uint32 conditionID1; //8
} summoningRitual;
- //19 GAMEOBJECT_TYPE_MAILBOX - empty
- //20 GAMEOBJECT_TYPE_DONOTUSE - empty
+ //19 GAMEOBJECT_TYPE_MAILBOX
+ struct
+ {
+ uint32 conditionID1; //0
+ } mailbox;
+ //20 GAMEOBJECT_TYPE_DO_NOT_USE - empty
//21 GAMEOBJECT_TYPE_GUARDPOST
struct
{
@@ -261,6 +281,7 @@ struct GameObjectTemplate
uint32 partyOnly; //2
uint32 allowMounted; //3 Is usable while on mount/vehicle. (0/1)
uint32 large; //4
+ uint32 conditionID1; //5
} spellcaster;
//23 GAMEOBJECT_TYPE_MEETINGSTONE
struct
@@ -280,6 +301,7 @@ struct GameObjectTemplate
uint32 noDamageImmune; //5
uint32 openTextID; //6
uint32 losOK; //7
+ uint32 conditionID1; //8
} flagstand;
//25 GAMEOBJECT_TYPE_FISHINGHOLE
struct
@@ -358,21 +380,21 @@ struct GameObjectTemplate
{
uint32 intactNumHits; //0
uint32 creditProxyCreature; //1
- uint32 state1Name; //2
+ uint32 empty1; //2
uint32 intactEvent; //3
- uint32 damagedDisplayId; //4
+ uint32 empty2; //4
uint32 damagedNumHits; //5
uint32 empty3; //6
uint32 empty4; //7
uint32 empty5; //8
uint32 damagedEvent; //9
- uint32 destroyedDisplayId; //10
+ uint32 empty6; //10
uint32 empty7; //11
uint32 empty8; //12
uint32 empty9; //13
uint32 destroyedEvent; //14
uint32 empty10; //15
- uint32 debuildingTimeSecs; //16
+ uint32 rebuildingTimeSecs; //16
uint32 empty11; //17
uint32 destructibleData; //18
uint32 rebuildingEvent; //19
@@ -381,7 +403,11 @@ struct GameObjectTemplate
uint32 damageEvent; //22
uint32 empty14; //23
} building;
- //34 GAMEOBJECT_TYPE_GUILDBANK - empty
+ //34 GAMEOBJECT_TYPE_GUILDBANK
+ struct
+ {
+ uint32 conditionID1; //0
+ } guildbank;
//35 GAMEOBJECT_TYPE_TRAPDOOR
struct
{
@@ -578,6 +604,7 @@ struct GameObjectLocale
// `gameobject_addon` table
struct GameObjectAddon
{
+ G3D::Quat ParentRotation;
InvisibilityType invisibilityType;
uint32 InvisibilityValue;
};
@@ -597,8 +624,7 @@ enum GOState
// from `gameobject`
struct GameObjectData
{
- explicit GameObjectData() : id(0), mapid(0), phaseMask(0), posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f),
- rotation0(0.0f), rotation1(0.0f), rotation2(0.0f), rotation3(0.0f), spawntimesecs(0),
+ explicit GameObjectData() : id(0), mapid(0), phaseMask(0), posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f), spawntimesecs(0),
animprogress(0), go_state(GO_STATE_ACTIVE), spawnMask(0), artKit(0), dbData(true) { }
uint32 id; // entry in gamobject_template
uint16 mapid;
@@ -607,10 +633,7 @@ struct GameObjectData
float posY;
float posZ;
float orientation;
- float rotation0;
- float rotation1;
- float rotation2;
- float rotation3;
+ G3D::Quat rotation;
int32 spawntimesecs;
uint32 animprogress;
GOState go_state;
@@ -640,7 +663,7 @@ class GameObjectModel;
// 5 sec for bobber catch
#define FISHING_BOBBER_READY_TIME 5
-class GameObject : public WorldObject, public GridObject<GameObject>, public MapObject
+class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>, public MapObject
{
public:
explicit GameObject();
@@ -652,7 +675,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
void RemoveFromWorld() override;
void CleanupsBeforeDelete(bool finalCleanup = true) override;
- bool Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0);
+ bool Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, uint32 phaseMask, Position const& pos, G3D::Quat const& rotation, uint32 animprogress, GOState go_state, uint32 artKit = 0);
void Update(uint32 p_time) override;
GameObjectTemplate const* GetGOInfo() const { return m_goInfo; }
GameObjectData const* GetGOData() const { return m_goData; }
@@ -664,7 +687,11 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
ObjectGuid::LowType GetSpawnId() const { return m_spawnId; }
- void UpdateRotationFields(float rotation2 = 0.0f, float rotation3 = 0.0f);
+ // z_rot, y_rot, x_rot - rotation angles around z, y and x axes
+ void SetWorldRotationAngles(float z_rot, float y_rot, float x_rot);
+ void SetWorldRotation(G3D::Quat const& rot);
+ void SetParentRotation(G3D::Quat const& rotation); // transforms(rotates) transport's path
+ int64 GetPackedWorldRotation() const { return m_packedRotation; }
// overwrite WorldObject function for proper name localization
std::string const& GetNameForLocaleIdx(LocaleConstant locale_idx) const override;
@@ -822,7 +849,6 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
void EventInform(uint32 eventId, WorldObject* invoker = NULL);
- uint64 GetRotation() const { return m_rotation; }
virtual uint32 GetScriptId() const { return GetGOInfo()->ScriptId; }
GameObjectAI* AI() const { return m_AI; }
@@ -849,8 +875,10 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
void UpdateModelPosition();
- protected:
+ void AIM_Destroy();
bool AIM_Initialize();
+
+ protected:
GameObjectModel* CreateModel();
void UpdateModel(); // updates model in case displayId were changed
uint32 m_spellId;
@@ -875,7 +903,8 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
GameObjectData const* m_goData;
GameObjectValue m_goValue;
- uint64 m_rotation;
+ int64 m_packedRotation;
+ G3D::Quat m_worldRotation;
Position m_stationaryPosition;
ObjectGuid m_lootRecipient;
@@ -884,6 +913,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
private:
void RemoveFromOwner();
void SwitchDoorOrButton(bool activate, bool alternative = false);
+ void UpdatePackedRotation();
//! Object distance/size - overridden from Object::_IsWithinDist. Needs to take in account proper GO size.
bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool /*is3D*/) const override
diff --git a/src/server/game/Entities/Item/Container/Bag.h b/src/server/game/Entities/Item/Container/Bag.h
index 5bfafa4238c..8f84dc3e5b3 100644
--- a/src/server/game/Entities/Item/Container/Bag.h
+++ b/src/server/game/Entities/Item/Container/Bag.h
@@ -23,9 +23,9 @@
#define MAX_BAG_SIZE 36 // 2.0.12
#include "Item.h"
-#include "ItemPrototype.h"
+#include "ItemTemplate.h"
-class Bag : public Item
+class TC_GAME_API Bag : public Item
{
public:
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 70fa4714547..a8dad0b2fbc 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -447,8 +447,7 @@ bool Item::LoadFromDB(ObjectGuid::LowType guid, ObjectGuid owner_guid, Field* fi
need_save = true;
}
- std::string enchants = fields[6].GetString();
- _LoadIntoDataField(enchants.c_str(), ITEM_FIELD_ENCHANTMENT_1_1, MAX_ENCHANTMENT_SLOT * MAX_ENCHANTMENT_OFFSET);
+ _LoadIntoDataField(fields[6].GetString(), ITEM_FIELD_ENCHANTMENT_1_1, MAX_ENCHANTMENT_SLOT * MAX_ENCHANTMENT_OFFSET);
SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID, fields[7].GetInt16());
// recalculate suffix factor
if (GetItemRandomPropertyId() < 0)
@@ -520,41 +519,11 @@ Player* Item::GetOwner()const
return ObjectAccessor::FindPlayer(GetOwnerGUID());
}
+// Just a "legacy shortcut" for proto->GetSkill()
uint32 Item::GetSkill()
{
- const static uint32 item_weapon_skills[MAX_ITEM_SUBCLASS_WEAPON] =
- {
- SKILL_AXES, SKILL_2H_AXES, SKILL_BOWS, SKILL_GUNS, SKILL_MACES,
- SKILL_2H_MACES, SKILL_POLEARMS, SKILL_SWORDS, SKILL_2H_SWORDS, 0,
- SKILL_STAVES, 0, 0, SKILL_FIST_WEAPONS, 0,
- SKILL_DAGGERS, SKILL_THROWN, SKILL_ASSASSINATION, SKILL_CROSSBOWS, SKILL_WANDS,
- SKILL_FISHING
- };
-
- const static uint32 item_armor_skills[MAX_ITEM_SUBCLASS_ARMOR] =
- {
- 0, SKILL_CLOTH, SKILL_LEATHER, SKILL_MAIL, SKILL_PLATE_MAIL, 0, SKILL_SHIELD, 0, 0, 0, 0
- };
-
ItemTemplate const* proto = GetTemplate();
-
- switch (proto->Class)
- {
- case ITEM_CLASS_WEAPON:
- if (proto->SubClass >= MAX_ITEM_SUBCLASS_WEAPON)
- return 0;
- else
- return item_weapon_skills[proto->SubClass];
-
- case ITEM_CLASS_ARMOR:
- if (proto->SubClass >= MAX_ITEM_SUBCLASS_ARMOR)
- return 0;
- else
- return item_armor_skills[proto->SubClass];
-
- default:
- return 0;
- }
+ return proto->GetSkill();
}
uint32 Item::GetSpell()
diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h
index 378d7f5e2e4..5e00a816cab 100644
--- a/src/server/game/Entities/Item/Item.h
+++ b/src/server/game/Entities/Item/Item.h
@@ -22,7 +22,7 @@
#include "Common.h"
#include "Object.h"
#include "LootMgr.h"
-#include "ItemPrototype.h"
+#include "ItemTemplate.h"
#include "DatabaseEnv.h"
class SpellInfo;
@@ -203,7 +203,7 @@ enum ItemUpdateState
bool ItemCanGoIntoBag(ItemTemplate const* proto, ItemTemplate const* pBagProto);
-class Item : public Object
+class TC_GAME_API Item : public Object
{
public:
static Item* CreateItem(uint32 itemEntry, uint32 count, Player const* player = NULL);
diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.h b/src/server/game/Entities/Item/ItemEnchantmentMgr.h
index 2d5c27177b1..8ce9ae780fe 100644
--- a/src/server/game/Entities/Item/ItemEnchantmentMgr.h
+++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.h
@@ -21,8 +21,9 @@
#include "Common.h"
-void LoadRandomEnchantmentsTable();
-uint32 GetItemEnchantMod(int32 entry);
-uint32 GenerateEnchSuffixFactor(uint32 item_id);
+TC_GAME_API void LoadRandomEnchantmentsTable();
+TC_GAME_API uint32 GetItemEnchantMod(int32 entry);
+TC_GAME_API uint32 GenerateEnchSuffixFactor(uint32 item_id);
+
#endif
diff --git a/src/server/game/Entities/Item/ItemTemplate.cpp b/src/server/game/Entities/Item/ItemTemplate.cpp
new file mode 100644
index 00000000000..1a8bc2291ae
--- /dev/null
+++ b/src/server/game/Entities/Item/ItemTemplate.cpp
@@ -0,0 +1,124 @@
+/*
+* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation; either version 2 of the License, or (at your
+* option) any later version.
+*
+* This program is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+* more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "ItemTemplate.h"
+
+bool ItemTemplate::CanChangeEquipStateInCombat() const
+{
+ switch (InventoryType)
+ {
+ case INVTYPE_RELIC:
+ case INVTYPE_SHIELD:
+ case INVTYPE_HOLDABLE:
+ return true;
+ }
+
+ switch (Class)
+ {
+ case ITEM_CLASS_WEAPON:
+ case ITEM_CLASS_PROJECTILE:
+ return true;
+ }
+
+ return false;
+}
+
+
+float ItemTemplate::getDPS() const
+{
+ if (!Delay)
+ return 0.f;
+
+ float temp = 0.f;
+ for (uint8 i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
+ temp += Damage[i].DamageMin + Damage[i].DamageMax;
+
+ return temp * 500.f / Delay;
+}
+
+int32 ItemTemplate::getFeralBonus(int32 extraDPS /*= 0*/) const
+{
+ // 0x02A5F3 - is mask for Melee weapon from ItemSubClassMask.dbc
+ if (Class == ITEM_CLASS_WEAPON && (1 << SubClass) & 0x02A5F3)
+ {
+ int32 bonus = int32((extraDPS + getDPS()) * 14.0f) - 767;
+ if (bonus < 0)
+ return 0;
+ return bonus;
+ }
+
+ return 0;
+}
+
+float ItemTemplate::GetItemLevelIncludingQuality() const
+{
+ float itemLevel(ItemLevel);
+ switch (Quality)
+ {
+ case ITEM_QUALITY_POOR:
+ case ITEM_QUALITY_NORMAL:
+ case ITEM_QUALITY_UNCOMMON:
+ case ITEM_QUALITY_ARTIFACT:
+ case ITEM_QUALITY_HEIRLOOM:
+ itemLevel -= 13.f; // leaving this as a separate statement since we do not know the real behavior in this case
+ break;
+ case ITEM_QUALITY_RARE:
+ itemLevel -= 13.f;
+ break;
+ case ITEM_QUALITY_EPIC:
+ case ITEM_QUALITY_LEGENDARY:
+ default:
+ break;
+ }
+
+ return std::max<float>(0.f, itemLevel);
+}
+
+uint32 ItemTemplate::GetSkill() const
+{
+ static uint32 const itemWeaponSkills[MAX_ITEM_SUBCLASS_WEAPON] =
+ {
+ SKILL_AXES, SKILL_2H_AXES, SKILL_BOWS, SKILL_GUNS, SKILL_MACES,
+ SKILL_2H_MACES, SKILL_POLEARMS, SKILL_SWORDS, SKILL_2H_SWORDS, 0,
+ SKILL_STAVES, 0, 0, SKILL_FIST_WEAPONS, 0,
+ SKILL_DAGGERS, SKILL_THROWN, SKILL_ASSASSINATION, SKILL_CROSSBOWS, SKILL_WANDS,
+ SKILL_FISHING
+ };
+
+ static uint32 const itemArmorSkills[MAX_ITEM_SUBCLASS_ARMOR] =
+ {
+ 0, SKILL_CLOTH, SKILL_LEATHER, SKILL_MAIL, SKILL_PLATE_MAIL, 0, SKILL_SHIELD, 0, 0, 0, 0
+ };
+
+ switch (Class)
+ {
+ case ITEM_CLASS_WEAPON:
+ if (SubClass >= MAX_ITEM_SUBCLASS_WEAPON)
+ return 0;
+ else
+ return itemWeaponSkills[SubClass];
+
+ case ITEM_CLASS_ARMOR:
+ if (SubClass >= MAX_ITEM_SUBCLASS_ARMOR)
+ return 0;
+ else
+ return itemArmorSkills[SubClass];
+
+ default:
+ return 0;
+ }
+}
diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemTemplate.h
index 48ef9e81016..0ff3f00a08b 100644
--- a/src/server/game/Entities/Item/ItemPrototype.h
+++ b/src/server/game/Entities/Item/ItemTemplate.h
@@ -107,20 +107,20 @@ enum ItemBondingType
enum ItemProtoFlags
{
- ITEM_PROTO_FLAG_UNK1 = 0x00000001, // ?
+ ITEM_PROTO_FLAG_NO_PICKUP = 0x00000001, // ?
ITEM_PROTO_FLAG_CONJURED = 0x00000002, // Conjured item
- ITEM_PROTO_FLAG_OPENABLE = 0x00000004, // Item can be right clicked to open for loot
+ ITEM_PROTO_FLAG_HAS_LOOT = 0x00000004, // Item can be right clicked to open for loot
ITEM_PROTO_FLAG_HEROIC = 0x00000008, // Makes green "Heroic" text appear on item
ITEM_PROTO_FLAG_DEPRECATED = 0x00000010, // Cannot equip or use
ITEM_PROTO_FLAG_INDESTRUCTIBLE = 0x00000020, // Item can not be destroyed, except by using spell (item can be reagent for spell)
- ITEM_PROTO_FLAG_UNK2 = 0x00000040, // ?
+ ITEM_PROTO_FLAG_PLAYER_CAST = 0x00000040, // Item's spells are castable by players
ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN = 0x00000080, // No default 30 seconds cooldown when equipped
- ITEM_PROTO_FLAG_UNK3 = 0x00000100, // ?
- ITEM_PROTO_FLAG_WRAPPER = 0x00000200, // Item can wrap other items
- ITEM_PROTO_FLAG_UNK4 = 0x00000400, // ?
- ITEM_PROTO_FLAG_PARTY_LOOT = 0x00000800, // Looting this item does not remove it from available loot
+ ITEM_PROTO_FLAG_INT_BONUS_INSTEAD = 0x00000100, // ?
+ ITEM_PROTO_FLAG_IS_WRAPPER = 0x00000200, // Item can wrap other items
+ ITEM_PROTO_FLAG_USES_RESOURCES = 0x00000400, // ?
+ ITEM_PROTO_FLAG_MULTI_DROP = 0x00000800, // Looting this item does not remove it from available loot
ITEM_PROTO_FLAG_REFUNDABLE = 0x00001000, // Item can be returned to vendor for its original cost (extended cost)
- ITEM_PROTO_FLAG_CHARTER = 0x00002000, // Item is guild or arena charter
+ ITEM_PROTO_FLAG_PETITION = 0x00002000, // Item is guild or arena charter
ITEM_PROTO_FLAG_UNK5 = 0x00004000, // Only readable items have this (but not all)
ITEM_PROTO_FLAG_UNK6 = 0x00008000, // ?
ITEM_PROTO_FLAG_UNK7 = 0x00010000, // ?
@@ -537,12 +537,7 @@ inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemS
return 0;
}
-// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
-#if defined(__GNUC__)
-#pragma pack(1)
-#else
#pragma pack(push, 1)
-#endif
struct _Damage
{
@@ -573,12 +568,7 @@ struct _Socket
uint32 Content;
};
-// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
-#if defined(__GNUC__)
-#pragma pack()
-#else
#pragma pack(pop)
-#endif
#define MAX_ITEM_PROTO_DAMAGES 2 // changed in 3.1.0
#define MAX_ITEM_PROTO_SOCKETS 3
@@ -664,25 +654,7 @@ struct ItemTemplate
uint32 FlagsCu;
// helpers
- bool CanChangeEquipStateInCombat() const
- {
- switch (InventoryType)
- {
- case INVTYPE_RELIC:
- case INVTYPE_SHIELD:
- case INVTYPE_HOLDABLE:
- return true;
- }
-
- switch (Class)
- {
- case ITEM_CLASS_WEAPON:
- case ITEM_CLASS_PROJECTILE:
- return true;
- }
-
- return false;
- }
+ bool CanChangeEquipStateInCombat() const;
bool IsCurrencyToken() const { return (BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) != 0; }
@@ -691,51 +663,13 @@ struct ItemTemplate
return (Stackable == 2147483647 || Stackable <= 0) ? uint32(0x7FFFFFFF-1) : uint32(Stackable);
}
- float getDPS() const
- {
- if (Delay == 0)
- return 0;
- float temp = 0;
- for (int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
- temp+=Damage[i].DamageMin + Damage[i].DamageMax;
- return temp*500/Delay;
- }
+ float getDPS() const;
- int32 getFeralBonus(int32 extraDPS = 0) const
- {
- // 0x02A5F3 - is mask for Melee weapon from ItemSubClassMask.dbc
- if (Class == ITEM_CLASS_WEAPON && (1<<SubClass)&0x02A5F3)
- {
- int32 bonus = int32((extraDPS + getDPS())*14.0f) - 767;
- if (bonus < 0)
- return 0;
- return bonus;
- }
- return 0;
- }
+ int32 getFeralBonus(int32 extraDPS = 0) const;
- float GetItemLevelIncludingQuality() const
- {
- float itemLevel = (float)ItemLevel;
- switch (Quality)
- {
- case ITEM_QUALITY_POOR:
- case ITEM_QUALITY_NORMAL:
- case ITEM_QUALITY_UNCOMMON:
- case ITEM_QUALITY_ARTIFACT:
- case ITEM_QUALITY_HEIRLOOM:
- itemLevel -= 13; // leaving this as a separate statement since we do not know the real behavior in this case
- break;
- case ITEM_QUALITY_RARE:
- itemLevel -= 13;
- break;
- case ITEM_QUALITY_EPIC:
- case ITEM_QUALITY_LEGENDARY:
- default:
- break;
- }
- return std::max<float>(0.f, itemLevel);
- }
+ float GetItemLevelIncludingQuality() const;
+
+ uint32 GetSkill() const;
bool IsPotion() const { return Class == ITEM_CLASS_CONSUMABLE && SubClass == ITEM_SUBCLASS_POTION; }
bool IsWeaponVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_WEAPON_ENCHANTMENT; }
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 4877ff094e1..20b88c5e3a9 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -221,7 +221,10 @@ void Object::SendUpdateToPlayer(Player* player)
UpdateData upd;
WorldPacket packet;
- BuildCreateUpdateBlockForPlayer(&upd, player);
+ if (player->HaveAtClient(this))
+ BuildValuesUpdateBlockForPlayer(&upd, player);
+ else
+ BuildCreateUpdateBlockForPlayer(&upd, player);
upd.BuildPacket(&packet);
player->GetSession()->SendPacket(&packet);
}
@@ -477,7 +480,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
// 0x200
if (flags & UPDATEFLAG_ROTATION)
- *data << int64(ToGameObject()->GetRotation());
+ *data << int64(ToGameObject()->GetPackedWorldRotation());
}
void Object::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) const
@@ -925,6 +928,11 @@ bool Object::HasByteFlag(uint16 index, uint8 offset, uint8 flag) const
return (((uint8*)&m_uint32Values[index])[offset] & flag) != 0;
}
+void Object::ApplyModByteFlag(uint16 index, uint8 offset, uint8 flag, bool apply)
+{
+ if (apply) SetByteFlag(index, offset, flag); else RemoveByteFlag(index, offset, flag);
+}
+
void Object::SetFlag64(uint16 index, uint64 newFlag)
{
uint64 oldval = GetUInt64Value(index);
@@ -1146,9 +1154,13 @@ bool WorldObject::IsWithinLOSInMap(const WorldObject* obj) const
if (!IsInMap(obj))
return false;
- float ox, oy, oz;
- obj->GetPosition(ox, oy, oz);
- return IsWithinLOS(ox, oy, oz);
+ float x, y, z;
+ if (obj->GetTypeId() == TYPEID_PLAYER)
+ obj->GetPosition(x, y, z);
+ else
+ obj->GetHitSpherePointFor(GetPosition(), x, y, z);
+
+ return IsWithinLOS(x, y, z);
}
float WorldObject::GetDistance(const WorldObject* obj) const
@@ -1232,11 +1244,36 @@ bool WorldObject::IsWithinLOS(float ox, float oy, float oz) const
VMAP::IVMapManager* vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
return vMapManager->isInLineOfSight(GetMapId(), x, y, z+2.0f, ox, oy, oz+2.0f);*/
if (IsInWorld())
- return GetMap()->isInLineOfSight(GetPositionX(), GetPositionY(), GetPositionZ()+2.f, ox, oy, oz+2.f, GetPhaseMask());
+ {
+ float x, y, z;
+ if (GetTypeId() == TYPEID_PLAYER)
+ GetPosition(x, y, z);
+ else
+ GetHitSpherePointFor({ ox, oy, oz }, x, y, z);
+
+ return GetMap()->isInLineOfSight(x, y, z + 2.0f, ox, oy, oz + 2.0f, GetPhaseMask());
+ }
return true;
}
+Position WorldObject::GetHitSpherePointFor(Position const& dest) const
+{
+ G3D::Vector3 vThis(GetPositionX(), GetPositionY(), GetPositionZ());
+ G3D::Vector3 vObj(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ());
+ G3D::Vector3 contactPoint = vThis + (vObj - vThis).directionOrZero() * GetObjectSize();
+
+ return Position(contactPoint.x, contactPoint.y, contactPoint.z, GetAngle(contactPoint.x, contactPoint.y));
+}
+
+void WorldObject::GetHitSpherePointFor(Position const& dest, float& x, float& y, float& z) const
+{
+ Position pos = GetHitSpherePointFor(dest);
+ x = pos.GetPositionX();
+ y = pos.GetPositionY();
+ z = pos.GetPositionZ();
+}
+
bool WorldObject::GetDistanceOrder(WorldObject const* obj1, WorldObject const* obj2, bool is3D /* = true */) const
{
float dx1 = GetPositionX() - obj1->GetPositionX();
@@ -1366,7 +1403,8 @@ void WorldObject::GetRandomPoint(const Position &pos, float distance, float &ran
// angle to face `obj` to `this`
float angle = (float)rand_norm()*static_cast<float>(2*M_PI);
- float new_dist = (float)rand_norm()*static_cast<float>(distance);
+ float new_dist = (float)rand_norm() + (float)rand_norm();
+ new_dist = distance * (new_dist > 1 ? new_dist - 2 : new_dist);
rand_x = pos.m_positionX + new_dist * std::cos(angle);
rand_y = pos.m_positionY + new_dist * std::sin(angle);
@@ -1408,7 +1446,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
bool canSwim = ToCreature()->CanSwim();
float ground_z = z;
float max_z = canSwim
- ? GetMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK))
+ ? GetMap()->GetWaterOrGroundLevel(GetPhaseMask(), x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK))
: ((ground_z = GetMap()->GetHeight(GetPhaseMask(), x, y, z, true)));
if (max_z > INVALID_HEIGHT)
{
@@ -1432,7 +1470,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
if (!ToPlayer()->CanFly())
{
float ground_z = z;
- float max_z = GetMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK));
+ float max_z = GetMap()->GetWaterOrGroundLevel(GetPhaseMask(), x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK));
if (max_z > INVALID_HEIGHT)
{
if (z > max_z)
@@ -1462,9 +1500,20 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
float WorldObject::GetGridActivationRange() const
{
if (ToPlayer())
+ {
+ if (ToPlayer()->GetCinematicMgr()->IsOnCinematic())
+ return DEFAULT_VISIBILITY_INSTANCE;
return GetMap()->GetVisibilityRange();
+ }
else if (ToCreature())
return ToCreature()->m_SightDistance;
+ else if (ToDynObject())
+ {
+ if (isActiveObject())
+ return GetMap()->GetVisibilityRange();
+ else
+ return 0.0f;
+ }
else
return 0.0f;
}
@@ -1485,6 +1534,8 @@ float WorldObject::GetSightRange(const WorldObject* target) const
{
if (target && target->isActiveObject() && !target->ToPlayer())
return MAX_VISIBILITY_DISTANCE;
+ else if (ToPlayer()->GetCinematicMgr()->IsOnCinematic())
+ return DEFAULT_VISIBILITY_INSTANCE;
else
return GetMap()->GetVisibilityRange();
}
@@ -1494,6 +1545,11 @@ float WorldObject::GetSightRange(const WorldObject* target) const
return SIGHT_RANGE_UNIT;
}
+ if (ToDynObject() && isActiveObject())
+ {
+ return GetMap()->GetVisibilityRange();
+ }
+
return 0.0f;
}
@@ -1878,7 +1934,9 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
AddToMap(summon->ToCreature());
summon->InitSummon();
- //ObjectAccessor::UpdateObjectVisibility(summon);
+ // call MoveInLineOfSight for nearby creatures
+ Trinity::AIRelocationNotifier notifier(*summon);
+ summon->VisitNearbyObject(GetVisibilityRange(), notifier);
return summon;
}
@@ -1923,7 +1981,7 @@ void WorldObject::ClearZoneScript()
m_zoneScript = NULL;
}
-TempSummon* WorldObject::SummonCreature(uint32 entry, const Position &pos, TempSummonType spwtype, uint32 duration, uint32 /*vehId*/) const
+TempSummon* WorldObject::SummonCreature(uint32 entry, Position const& pos, TempSummonType spwtype /*= TEMPSUMMON_MANUAL_DESPAWN*/, uint32 duration /*= 0*/, uint32 /*vehId = 0*/) const
{
if (Map* map = FindMap())
{
@@ -1934,7 +1992,7 @@ TempSummon* WorldObject::SummonCreature(uint32 entry, const Position &pos, TempS
}
}
- return NULL;
+ return nullptr;
}
TempSummon* WorldObject::SummonCreature(uint32 id, float x, float y, float z, float ang /*= 0*/, TempSummonType spwtype /*= TEMPSUMMON_MANUAL_DESPAWN*/, uint32 despwtime /*= 0*/) const
@@ -1944,29 +2002,30 @@ TempSummon* WorldObject::SummonCreature(uint32 id, float x, float y, float z, fl
GetClosePoint(x, y, z, GetObjectSize());
ang = GetOrientation();
}
+
Position pos;
pos.Relocate(x, y, z, ang);
return SummonCreature(id, pos, spwtype, despwtime, 0);
}
-GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime)
+GameObject* WorldObject::SummonGameObject(uint32 entry, Position const& pos, G3D::Quat const& rot, uint32 respawnTime)
{
if (!IsInWorld())
- return NULL;
+ return nullptr;
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
if (!goinfo)
{
TC_LOG_ERROR("sql.sql", "Gameobject template %u not found in database!", entry);
- return NULL;
+ return nullptr;
}
Map* map = GetMap();
GameObject* go = new GameObject();
- if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
+ if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, GetPhaseMask(), pos, rot, 255, GO_STATE_READY))
{
delete go;
- return NULL;
+ return nullptr;
}
go->SetRespawnTime(respawnTime);
@@ -1979,6 +2038,18 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
return go;
}
+GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float z, float ang, G3D::Quat const& rot, uint32 respawnTime)
+{
+ if (!x && !y && !z)
+ {
+ GetClosePoint(x, y, z, GetObjectSize());
+ ang = GetOrientation();
+ }
+
+ Position pos(x, y, z, ang);
+ return SummonGameObject(entry, pos, rot, respawnTime);
+}
+
Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint32 duration, CreatureAI* (*GetAI)(Creature*))
{
TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
@@ -2010,7 +2081,10 @@ void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list
std::vector<TempSummonData> const* data = sObjectMgr->GetSummonGroup(GetEntry(), GetTypeId() == TYPEID_GAMEOBJECT ? SUMMONER_TYPE_GAMEOBJECT : SUMMONER_TYPE_CREATURE, group);
if (!data)
+ {
+ TC_LOG_WARN("scripts", "%s (%s) tried to summon non-existing summon group %u.", GetName().c_str(), GetGUID().ToString().c_str(), group);
return;
+ }
for (std::vector<TempSummonData>::const_iterator itr = data->begin(); itr != data->end(); ++itr)
if (TempSummon* summon = SummonCreature(itr->entry, itr->pos, itr->type, itr->time))
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index 419044081e3..87b158ab81a 100644
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -90,7 +90,7 @@ class ZoneScript;
typedef std::unordered_map<Player*, UpdateData> UpdateDataMapType;
-class Object
+class TC_GAME_API Object
{
public:
virtual ~Object();
@@ -160,6 +160,7 @@ class Object
void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag);
void ToggleByteFlag(uint16 index, uint8 offset, uint8 flag);
bool HasByteFlag(uint16 index, uint8 offset, uint8 flag) const;
+ void ApplyModByteFlag(uint16 index, uint8 offset, uint8 flag, bool apply);
void SetFlag64(uint16 index, uint64 newFlag);
void RemoveFlag64(uint16 index, uint64 oldFlag);
@@ -397,7 +398,7 @@ enum MapObjectCellMoveState
MAP_OBJECT_CELL_MOVE_INACTIVE, //in move list but should not move
};
-class MapObject
+class TC_GAME_API MapObject
{
friend class Map; //map for moving creatures
friend class ObjectGridLoader; //grid loader for loading creatures
@@ -422,7 +423,7 @@ class MapObject
}
};
-class WorldObject : public Object, public WorldLocation
+class TC_GAME_API WorldObject : public Object, public WorldLocation
{
protected:
explicit WorldObject(bool isWorldObject); //note: here it means if it is in grid object list or world object list
@@ -487,6 +488,8 @@ class WorldObject : public Object, public WorldLocation
bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true) const;
bool IsWithinLOS(float x, float y, float z) const;
bool IsWithinLOSInMap(WorldObject const* obj) const;
+ Position GetHitSpherePointFor(Position const& dest) const;
+ void GetHitSpherePointFor(Position const& dest, float& x, float& y, float& z) const;
bool GetDistanceOrder(WorldObject const* obj1, WorldObject const* obj2, bool is3D = true) const;
bool IsInRange(WorldObject const* obj, float minRange, float maxRange, bool is3D = true) const;
bool IsInRange2d(float x, float y, float minRange, float maxRange) const;
@@ -539,9 +542,10 @@ class WorldObject : public Object, public WorldLocation
void ClearZoneScript();
ZoneScript* GetZoneScript() const { return m_zoneScript; }
- TempSummon* SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0) const;
+ TempSummon* SummonCreature(uint32 id, Position const& pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0) const;
TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0) const;
- GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime /* s */);
+ GameObject* SummonGameObject(uint32 entry, Position const& pos, G3D::Quat const& rot, uint32 respawnTime /* s */);
+ GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, G3D::Quat const& rot, uint32 respawnTime /* s */);
Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, CreatureAI* (*GetAI)(Creature*) = NULL);
void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = NULL);
@@ -549,12 +553,17 @@ class WorldObject : public Object, public WorldLocation
GameObject* FindNearestGameObject(uint32 entry, float range) const;
GameObject* FindNearestGameObjectOfType(GameobjectTypes type, float range) const;
- void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
- void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
+ void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry = 0, float fMaxSearchRange = 250.0f) const;
+ void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry = 0, float fMaxSearchRange = 250.0f) const;
void GetPlayerListInGrid(std::list<Player*>& lList, float fMaxSearchRange) const;
void DestroyForNearbyPlayers();
virtual void UpdateObjectVisibility(bool forced = true);
+ virtual void UpdateObjectVisibilityOnCreate()
+ {
+ UpdateObjectVisibility(true);
+ }
+
void BuildUpdate(UpdateDataMapType&) override;
void AddToObjectUpdate() override;
@@ -578,14 +587,6 @@ class WorldObject : public Object, public WorldLocation
template<class NOTIFIER> void VisitNearbyGridObject(float const& radius, NOTIFIER& notifier) const { if (IsInWorld()) GetMap()->VisitGrid(GetPositionX(), GetPositionY(), radius, notifier); }
template<class NOTIFIER> void VisitNearbyWorldObject(float const& radius, NOTIFIER& notifier) const { if (IsInWorld()) GetMap()->VisitWorld(GetPositionX(), GetPositionY(), radius, notifier); }
-#ifdef MAP_BASED_RAND_GEN
- int32 irand(int32 min, int32 max) const { return int32 (GetMap()->mtRand.randInt(max - min)) + min; }
- uint32 urand(uint32 min, uint32 max) const { return GetMap()->mtRand.randInt(max - min) + min;}
- int32 rand32() const { return GetMap()->mtRand.randInt();}
- double rand_norm() const { return GetMap()->mtRand.randExc();}
- double rand_chance() const { return GetMap()->mtRand.randExc(100.0);}
-#endif
-
uint32 LastUsedScriptID;
// Transports
diff --git a/src/server/game/Entities/Object/ObjectGuid.cpp b/src/server/game/Entities/Object/ObjectGuid.cpp
index 3e2bd000b6e..2fb766c5201 100644
--- a/src/server/game/Entities/Object/ObjectGuid.cpp
+++ b/src/server/game/Entities/Object/ObjectGuid.cpp
@@ -95,4 +95,19 @@ void ObjectGuidGeneratorBase::HandleCounterOverflow(HighGuid high)
{
TC_LOG_ERROR("misc", "%s guid overflow!! Can't continue, shutting down server. ", ObjectGuid::GetTypeName(high));
World::StopNow(ERROR_EXIT_CODE);
-} \ No newline at end of file
+}
+
+#define GUID_TRAIT_INSTANTIATE_GUID( HIGH_GUID ) \
+ template class TC_GAME_API ObjectGuidGenerator< HIGH_GUID >;
+
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::Container)
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::Player)
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::GameObject)
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::Transport)
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::Unit)
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::Pet)
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::Vehicle)
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::DynamicObject)
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::Mo_Transport)
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::Instance)
+GUID_TRAIT_INSTANTIATE_GUID(HighGuid::Group)
diff --git a/src/server/game/Entities/Object/ObjectGuid.h b/src/server/game/Entities/Object/ObjectGuid.h
index 44644421567..71c66622790 100644
--- a/src/server/game/Entities/Object/ObjectGuid.h
+++ b/src/server/game/Entities/Object/ObjectGuid.h
@@ -111,7 +111,7 @@ struct PackedGuidReader
ObjectGuid* GuidPtr;
};
-class ObjectGuid
+class TC_GAME_API ObjectGuid
{
public:
static ObjectGuid const Empty;
@@ -252,9 +252,9 @@ typedef std::unordered_set<ObjectGuid> GuidUnorderedSet;
// minimum buffer size for packed guid is 9 bytes
#define PACKED_GUID_MIN_BUFFER_SIZE 9
-class PackedGuid
+class TC_GAME_API PackedGuid
{
- friend ByteBuffer& operator<<(ByteBuffer& buf, PackedGuid const& guid);
+ friend TC_GAME_API ByteBuffer& operator<<(ByteBuffer& buf, PackedGuid const& guid);
public:
explicit PackedGuid() : _packedGuid(PACKED_GUID_MIN_BUFFER_SIZE) { _packedGuid.appendPackGUID(0); }
@@ -270,8 +270,7 @@ class PackedGuid
ByteBuffer _packedGuid;
};
-
-class ObjectGuidGeneratorBase
+class TC_GAME_API ObjectGuidGeneratorBase
{
public:
ObjectGuidGeneratorBase(ObjectGuid::LowType start = 1) : _nextGuid(start) { }
@@ -286,7 +285,7 @@ protected:
};
template<HighGuid high>
-class ObjectGuidGenerator : public ObjectGuidGeneratorBase
+class TC_GAME_API ObjectGuidGenerator : public ObjectGuidGeneratorBase
{
public:
explicit ObjectGuidGenerator(ObjectGuid::LowType start = 1) : ObjectGuidGeneratorBase(start) { }
@@ -299,11 +298,11 @@ public:
}
};
-ByteBuffer& operator<<(ByteBuffer& buf, ObjectGuid const& guid);
-ByteBuffer& operator>>(ByteBuffer& buf, ObjectGuid& guid);
+TC_GAME_API ByteBuffer& operator<<(ByteBuffer& buf, ObjectGuid const& guid);
+TC_GAME_API ByteBuffer& operator>>(ByteBuffer& buf, ObjectGuid& guid);
-ByteBuffer& operator<<(ByteBuffer& buf, PackedGuid const& guid);
-ByteBuffer& operator>>(ByteBuffer& buf, PackedGuidReader const& guid);
+TC_GAME_API ByteBuffer& operator<<(ByteBuffer& buf, PackedGuid const& guid);
+TC_GAME_API ByteBuffer& operator>>(ByteBuffer& buf, PackedGuidReader const& guid);
inline PackedGuid ObjectGuid::WriteAsPacked() const { return PackedGuid(*this); }
diff --git a/src/server/game/Entities/Object/ObjectPosSelector.h b/src/server/game/Entities/Object/ObjectPosSelector.h
index 26a23678009..84c694abf08 100644
--- a/src/server/game/Entities/Object/ObjectPosSelector.h
+++ b/src/server/game/Entities/Object/ObjectPosSelector.h
@@ -30,7 +30,7 @@ inline UsedPosType operator ~(UsedPosType uptype)
return uptype==USED_POS_PLUS ? USED_POS_MINUS : USED_POS_PLUS;
}
-struct ObjectPosSelector
+struct TC_GAME_API ObjectPosSelector
{
struct UsedPos
{
diff --git a/src/server/game/Entities/Object/Position.h b/src/server/game/Entities/Object/Position.h
index 18d356c28d4..6325cc51fe2 100644
--- a/src/server/game/Entities/Object/Position.h
+++ b/src/server/game/Entities/Object/Position.h
@@ -22,7 +22,7 @@
class ByteBuffer;
-struct Position
+struct TC_GAME_API Position
{
Position(float x = 0, float y = 0, float z = 0, float o = 0)
: m_positionX(x), m_positionY(y), m_positionZ(z), m_orientation(NormalizeOrientation(o)) { }
@@ -216,11 +216,11 @@ public:
}
};
-ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYStreamer const& streamer);
-ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYStreamer const& streamer);
-ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZStreamer const& streamer);
-ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYZStreamer const& streamer);
-ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer);
-ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer);
+TC_GAME_API ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYStreamer const& streamer);
+TC_GAME_API ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYStreamer const& streamer);
+TC_GAME_API ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZStreamer const& streamer);
+TC_GAME_API ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYZStreamer const& streamer);
+TC_GAME_API ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer);
+TC_GAME_API ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer);
#endif // Trinity_game_Position_h__
diff --git a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h
index 0b4e59f4f9b..8208a5e9894 100644
--- a/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h
+++ b/src/server/game/Entities/Object/Updates/UpdateFieldFlags.h
@@ -35,10 +35,10 @@ enum UpdatefieldFlags
UF_FLAG_DYNAMIC = 0x100
};
-extern uint32 ItemUpdateFieldFlags[CONTAINER_END];
-extern uint32 UnitUpdateFieldFlags[PLAYER_END];
-extern uint32 GameObjectUpdateFieldFlags[GAMEOBJECT_END];
-extern uint32 DynamicObjectUpdateFieldFlags[DYNAMICOBJECT_END];
-extern uint32 CorpseUpdateFieldFlags[CORPSE_END];
+TC_GAME_API extern uint32 ItemUpdateFieldFlags[CONTAINER_END];
+TC_GAME_API extern uint32 UnitUpdateFieldFlags[PLAYER_END];
+TC_GAME_API extern uint32 GameObjectUpdateFieldFlags[GAMEOBJECT_END];
+TC_GAME_API extern uint32 DynamicObjectUpdateFieldFlags[DYNAMICOBJECT_END];
+TC_GAME_API extern uint32 CorpseUpdateFieldFlags[CORPSE_END];
#endif // _UPDATEFIELDFLAGS_H
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 0da63c5e500..482fcb315f2 100644
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -213,12 +213,14 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
case SUMMON_PET:
petlevel = owner->getLevel();
- SetUInt32Value(UNIT_FIELD_BYTES_0, 0x800); // class = mage
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, uint8(CLASS_MAGE));
SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
// this enables popup window (pet dismiss, cancel)
break;
case HUNTER_PET:
- SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100); // class = warrior, gender = none, power = focus
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, CLASS_WARRIOR);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, GENDER_NONE);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE, POWER_FOCUS);
SetSheath(SHEATH_STATE_MELEE);
SetByteFlag(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_CAN_BE_ABANDONED : UNIT_CAN_BE_RENAMED | UNIT_CAN_BE_ABANDONED);
@@ -226,7 +228,6 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
// this enables popup window (pet abandon, cancel)
SetMaxPower(POWER_HAPPINESS, GetCreatePowers(POWER_HAPPINESS));
SetPower(POWER_HAPPINESS, fields[12].GetUInt32());
- setPowerType(POWER_FOCUS);
break;
default:
if (!IsPetGhoul())
@@ -328,6 +329,9 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
_LoadSpellCooldowns();
LearnPetPassives();
InitLevelupSpellsForLevel();
+ if (map->IsBattleArena())
+ RemoveArenaAuras();
+
CastPetAuras(current);
}
@@ -747,7 +751,7 @@ void Pet::GivePetLevel(uint8 level)
if (!level || level == getLevel())
return;
- if (getPetType()==HUNTER_PET)
+ if (getPetType() == HUNTER_PET)
{
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(level)*PET_XP_FACTOR));
@@ -822,7 +826,9 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phas
if (cinfo->type == CREATURE_TYPE_BEAST)
{
- SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, CLASS_WARRIOR);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, GENDER_NONE);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE, POWER_FOCUS);
SetSheath(SHEATH_STATE_MELEE);
SetByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED | UNIT_CAN_BE_ABANDONED);
}
diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h
index b0863a371e6..3a65fb44e04 100644
--- a/src/server/game/Entities/Pet/Pet.h
+++ b/src/server/game/Entities/Pet/Pet.h
@@ -37,7 +37,7 @@ typedef std::vector<uint32> AutoSpellList;
class Player;
-class Pet : public Guardian
+class TC_GAME_API Pet : public Guardian
{
public:
explicit Pet(Player* owner, PetType type = MAX_PET_TYPE);
diff --git a/src/server/game/Entities/Player/CinematicMgr.cpp b/src/server/game/Entities/Player/CinematicMgr.cpp
new file mode 100644
index 00000000000..cc5a62300ad
--- /dev/null
+++ b/src/server/game/Entities/Player/CinematicMgr.cpp
@@ -0,0 +1,174 @@
+/*
+* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation; either version 2 of the License, or (at your
+* option) any later version.
+*
+* This program is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+* more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "CinematicMgr.h"
+#include "Creature.h"
+#include "Player.h"
+#include "TemporarySummon.h"
+
+CinematicMgr::CinematicMgr(Player* playerref)
+{
+ player = playerref;
+ m_cinematicDiff = 0;
+ m_lastCinematicCheck = 0;
+ m_activeCinematicCameraId = 0;
+ m_cinematicLength = 0;
+ m_cinematicCamera = nullptr;
+ m_remoteSightPosition = Position(0.0f, 0.0f, 0.0f);
+ m_CinematicObject = nullptr;
+}
+
+CinematicMgr::~CinematicMgr()
+{
+ if (m_cinematicCamera && m_activeCinematicCameraId)
+ EndCinematic();
+}
+
+void CinematicMgr::BeginCinematic()
+{
+ // Sanity check for active camera set
+ if (m_activeCinematicCameraId == 0)
+ return;
+
+ auto itr = sFlyByCameraStore.find(m_activeCinematicCameraId);
+ if (itr != sFlyByCameraStore.end())
+ {
+ // Initialize diff, and set camera
+ m_cinematicDiff = 0;
+ m_cinematicCamera = &itr->second;
+
+ auto camitr = m_cinematicCamera->begin();
+ if (camitr != m_cinematicCamera->end())
+ {
+ Position pos(camitr->locations.x, camitr->locations.y, camitr->locations.z, camitr->locations.w);
+ if (!pos.IsPositionValid())
+ return;
+
+ player->GetMap()->LoadGrid(camitr->locations.x, camitr->locations.y);
+ m_CinematicObject = player->SummonCreature(VISUAL_WAYPOINT, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5 * MINUTE * IN_MILLISECONDS);
+ if (m_CinematicObject)
+ {
+ m_CinematicObject->setActive(true);
+ player->SetViewpoint(m_CinematicObject, true);
+ }
+
+ // Get cinematic length
+ FlyByCameraCollection::const_reverse_iterator camrevitr = m_cinematicCamera->rbegin();
+ if (camrevitr != m_cinematicCamera->rend())
+ m_cinematicLength = camrevitr->timeStamp;
+ else
+ m_cinematicLength = 0;
+ }
+ }
+}
+
+void CinematicMgr::EndCinematic()
+{
+ if (m_activeCinematicCameraId == 0)
+ return;
+
+ m_cinematicDiff = 0;
+ m_cinematicCamera = nullptr;
+ m_activeCinematicCameraId = 0;
+ if (m_CinematicObject)
+ {
+ if (WorldObject* vpObject = player->GetViewpoint())
+ if (vpObject == m_CinematicObject)
+ player->SetViewpoint(m_CinematicObject, false);
+
+ m_CinematicObject->AddObjectToRemoveList();
+ }
+}
+
+void CinematicMgr::UpdateCinematicLocation(uint32 /*diff*/)
+{
+ if (m_activeCinematicCameraId == 0 || !m_cinematicCamera || m_cinematicCamera->size() == 0)
+ return;
+
+ Position lastPosition;
+ uint32 lastTimestamp = 0;
+ Position nextPosition;
+ uint32 nextTimestamp = 0;
+
+ // Obtain direction of travel
+ for (FlyByCamera cam : *m_cinematicCamera)
+ {
+ if (cam.timeStamp > m_cinematicDiff)
+ {
+ nextPosition = Position(cam.locations.x, cam.locations.y, cam.locations.z, cam.locations.w);
+ nextTimestamp = cam.timeStamp;
+ break;
+ }
+ lastPosition = Position(cam.locations.x, cam.locations.y, cam.locations.z, cam.locations.w);
+ lastTimestamp = cam.timeStamp;
+ }
+ float angle = lastPosition.GetAngle(&nextPosition);
+ angle -= lastPosition.GetOrientation();
+ if (angle < 0)
+ angle += 2 * float(M_PI);
+
+ // Look for position around 2 second ahead of us.
+ int32 workDiff = m_cinematicDiff;
+
+ // Modify result based on camera direction (Humans for example, have the camera point behind)
+ workDiff += static_cast<int32>(float(CINEMATIC_LOOKAHEAD) * cos(angle));
+
+ // Get an iterator to the last entry in the cameras, to make sure we don't go beyond the end
+ FlyByCameraCollection::const_reverse_iterator endItr = m_cinematicCamera->rbegin();
+ if (endItr != m_cinematicCamera->rend() && workDiff > static_cast<int32>(endItr->timeStamp))
+ workDiff = endItr->timeStamp;
+
+ // Never try to go back in time before the start of cinematic!
+ if (workDiff < 0)
+ workDiff = m_cinematicDiff;
+
+ // Obtain the previous and next waypoint based on timestamp
+ for (FlyByCamera cam : *m_cinematicCamera)
+ {
+ if (static_cast<int32>(cam.timeStamp) >= workDiff)
+ {
+ nextPosition = Position(cam.locations.x, cam.locations.y, cam.locations.z, cam.locations.w);
+ nextTimestamp = cam.timeStamp;
+ break;
+ }
+ lastPosition = Position(cam.locations.x, cam.locations.y, cam.locations.z, cam.locations.w);
+ lastTimestamp = cam.timeStamp;
+ }
+
+ // Never try to go beyond the end of the cinematic
+ if (workDiff > static_cast<int32>(nextTimestamp))
+ workDiff = static_cast<int32>(nextTimestamp);
+
+ // Interpolate the position for this moment in time (or the adjusted moment in time)
+ uint32 timeDiff = nextTimestamp - lastTimestamp;
+ uint32 interDiff = workDiff - lastTimestamp;
+ float xDiff = nextPosition.m_positionX - lastPosition.m_positionX;
+ float yDiff = nextPosition.m_positionY - lastPosition.m_positionY;
+ float zDiff = nextPosition.m_positionZ - lastPosition.m_positionZ;
+ Position interPosition(lastPosition.m_positionX + (xDiff * (float(interDiff) / float(timeDiff))), lastPosition.m_positionY +
+ (yDiff * (float(interDiff) / float(timeDiff))), lastPosition.m_positionZ + (zDiff * (float(interDiff) / float(timeDiff))));
+
+ // Advance (at speed) to this position. The remote sight object is used
+ // to send update information to player in cinematic
+ if (m_CinematicObject && interPosition.IsPositionValid())
+ m_CinematicObject->MonsterMoveWithSpeed(interPosition.m_positionX, interPosition.m_positionY, interPosition.m_positionZ, 500.0f, false, true);
+
+ // If we never received an end packet 10 seconds after the final timestamp then force an end
+ if (m_cinematicDiff > m_cinematicLength + 10 * IN_MILLISECONDS)
+ EndCinematic();
+}
diff --git a/src/server/game/Entities/Player/CinematicMgr.h b/src/server/game/Entities/Player/CinematicMgr.h
new file mode 100644
index 00000000000..ab067afa042
--- /dev/null
+++ b/src/server/game/Entities/Player/CinematicMgr.h
@@ -0,0 +1,60 @@
+/*
+* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation; either version 2 of the License, or (at your
+* option) any later version.
+*
+* This program is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+* more details.
+*
+* You should have received a copy of the GNU General Public License along
+* with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CinematicMgr_h__
+#define CinematicMgr_h__
+
+#include "Define.h"
+#include "Object.h"
+#include "M2Stores.h"
+
+#define CINEMATIC_LOOKAHEAD (2 * IN_MILLISECONDS)
+#define CINEMATIC_UPDATEDIFF 500
+
+class Player;
+
+class TC_GAME_API CinematicMgr
+{
+ friend class Player;
+public:
+ explicit CinematicMgr(Player* playerref);
+ ~CinematicMgr();
+
+ // Cinematic camera data and remote sight functions
+ uint32 GetActiveCinematicCamera() const { return m_activeCinematicCameraId; }
+ void SetActiveCinematicCamera(uint32 cinematicCameraId = 0) { m_activeCinematicCameraId = cinematicCameraId; }
+ bool IsOnCinematic() const { return (m_cinematicCamera != nullptr); }
+ void BeginCinematic();
+ void EndCinematic();
+ void UpdateCinematicLocation(uint32 diff);
+
+private:
+ // Remote location information
+ Player* player;
+
+protected:
+ uint32 m_cinematicDiff;
+ uint32 m_lastCinematicCheck;
+ uint32 m_activeCinematicCameraId;
+ uint32 m_cinematicLength;
+ FlyByCameraCollection* m_cinematicCamera;
+ Position m_remoteSightPosition;
+ TempSummon* m_CinematicObject;
+};
+
+#endif \ No newline at end of file
diff --git a/src/server/game/Entities/Player/KillRewarder.h b/src/server/game/Entities/Player/KillRewarder.h
index 08530de900c..210e5ff0246 100644
--- a/src/server/game/Entities/Player/KillRewarder.h
+++ b/src/server/game/Entities/Player/KillRewarder.h
@@ -24,7 +24,7 @@ class Player;
class Unit;
class Group;
-class KillRewarder
+class TC_GAME_API KillRewarder
{
public:
KillRewarder(Player* killer, Unit* victim, bool isBattleGround);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index c7f674ec72c..bc95ea1107e 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -213,7 +213,7 @@ void PlayerTaxi::AppendTaximaskTo(ByteBuffer& data, bool all)
if (all)
{
for (uint8 i = 0; i < TaxiMaskSize; ++i)
- data << uint32(sTaxiNodesMask[i]); // all existed nodes
+ data << uint32(sTaxiNodesMask[i]); // all existing nodes
}
else
{
@@ -306,7 +306,7 @@ Player::Player(WorldSession* session): Unit(true)
m_ExtraFlags = 0;
- m_spellModTakingSpell = NULL;
+ m_spellModTakingSpell = nullptr;
//m_pad = 0;
// players always accept
@@ -332,19 +332,17 @@ Player::Player(WorldSession* session): Unit(true)
m_nextSave = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
- clearResurrectRequestData();
-
memset(m_items, 0, sizeof(Item*)*PLAYER_SLOTS_COUNT);
- m_social = NULL;
+ m_social = nullptr;
// group is initialized in the reference constructor
- SetGroupInvite(NULL);
+ SetGroupInvite(nullptr);
m_groupUpdateMask = 0;
m_auraRaidUpdateMask = 0;
m_bPassOnGroupLoot = false;
- duel = NULL;
+ duel = nullptr;
m_GuildIdInvited = 0;
m_ArenaTeamIdInvited = 0;
@@ -359,7 +357,7 @@ Player::Player(WorldSession* session): Unit(true)
m_bHasDelayedTeleport = false;
m_teleport_options = 0;
- m_trade = NULL;
+ m_trade = nullptr;
m_cinematic = 0;
@@ -394,7 +392,7 @@ Player::Player(WorldSession* session): Unit(true)
m_bgBattlegroundQueueID[j].invitedToInstance = 0;
}
- m_logintime = time(NULL);
+ m_logintime = time(nullptr);
m_Last_tick = m_logintime;
m_Played_time[PLAYED_TIME_TOTAL] = 0;
m_Played_time[PLAYED_TIME_LEVEL] = 0;
@@ -470,27 +468,17 @@ Player::Player(WorldSession* session): Unit(true)
m_spellPenetrationItemMod = 0;
// Honor System
- m_lastHonorUpdateTime = time(NULL);
+ m_lastHonorUpdateTime = time(nullptr);
m_IsBGRandomWinner = false;
// Player summoning
m_summon_expire = 0;
- m_summon_mapid = 0;
- m_summon_x = 0.0f;
- m_summon_y = 0.0f;
- m_summon_z = 0.0f;
m_mover = this;
m_movedPlayer = this;
m_seer = this;
- m_recallMap = 0;
- m_recallX = 0;
- m_recallY = 0;
- m_recallZ = 0;
- m_recallO = 0;
-
m_homebindMapId = 0;
m_homebindAreaId = 0;
m_homebindX = 0;
@@ -499,11 +487,11 @@ Player::Player(WorldSession* session): Unit(true)
m_contestedPvPTimer = 0;
- m_declinedname = NULL;
+ m_declinedname = nullptr;
m_isActive = true;
- m_runes = NULL;
+ m_runes = nullptr;
m_lastFallTime = 0;
m_lastFallZ = 0;
@@ -537,13 +525,16 @@ Player::Player(WorldSession* session): Unit(true)
_activeCheats = CHEAT_NONE;
healthBeforeDuel = 0;
manaBeforeDuel = 0;
+
+ _cinematicMgr = new CinematicMgr(this);
+
m_achievementMgr = new AchievementMgr(this);
m_reputationMgr = new ReputationMgr(this);
}
Player::~Player()
{
- // it must be unloaded already in PlayerLogout and accessed only for loggined player
+ // it must be unloaded already in PlayerLogout and accessed only for logged in player
//m_social = NULL;
// Note: buy back item already deleted from DB when player was saved
@@ -576,6 +567,7 @@ Player::~Player()
delete m_runes;
delete m_achievementMgr;
delete m_reputationMgr;
+ delete _cinematicMgr;
sWorld->DecreasePlayerCount();
}
@@ -605,20 +597,20 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(createInfo->Race, createInfo->Class);
if (!info)
{
- TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.",
+ TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking attempt: Account %u tried to create a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.",
GetSession()->GetAccountId(), m_name.c_str(), createInfo->Race, createInfo->Class);
return false;
}
for (uint8 i = 0; i < PLAYER_SLOTS_COUNT; i++)
- m_items[i] = NULL;
+ m_items[i] = nullptr;
Relocate(info->positionX, info->positionY, info->positionZ, info->orientation);
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(createInfo->Class);
if (!cEntry)
{
- TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid character class (%u) - refusing to do so (wrong DBC-files?)",
+ TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking attempt: Account %u tried to create a character named '%s' with an invalid character class (%u) - refusing to do so (wrong DBC-files?)",
GetSession()->GetAccountId(), m_name.c_str(), createInfo->Class);
return false;
}
@@ -633,21 +625,22 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
if (!IsValidGender(createInfo->Gender))
{
- TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid gender (%u) - refusing to do so",
+ TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking attempt: Account %u tried to create a character named '%s' with an invalid gender (%u) - refusing to do so",
GetSession()->GetAccountId(), m_name.c_str(), createInfo->Gender);
return false;
}
if (!ValidateAppearance(createInfo->Race, createInfo->Class, createInfo->Gender, createInfo->HairStyle, createInfo->HairColor, createInfo->Face, createInfo->FacialHair, createInfo->Skin, true))
{
- TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with invalid appearance attributes - refusing to do so",
+ TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking attempt: Account %u tried to create a character named '%s' with invalid appearance attributes - refusing to do so",
GetSession()->GetAccountId(), m_name.c_str());
return false;
}
- uint32 RaceClassGender = (createInfo->Race) | (createInfo->Class << 8) | (createInfo->Gender << 16);
-
- SetUInt32Value(UNIT_FIELD_BYTES_0, (RaceClassGender | (powertype << 24)));
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_RACE, createInfo->Race);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, createInfo->Class);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, createInfo->Gender);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE, powertype);
InitDisplayIds();
if (sWorld->getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || sWorld->getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP)
{
@@ -660,13 +653,14 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); // -1 is default value
- SetUInt32Value(PLAYER_BYTES, (createInfo->Skin | (createInfo->Face << 8) | (createInfo->HairStyle << 16) | (createInfo->HairColor << 24)));
- SetUInt32Value(PLAYER_BYTES_2, (createInfo->FacialHair |
- (0x00 << 8) |
- (0x00 << 16) |
- (((GetSession()->IsARecruiter() || GetSession()->GetRecruiterId() != 0) ? REST_STATE_RAF_LINKED : REST_STATE_NOT_RAF_LINKED) << 24)));
- SetByteValue(PLAYER_BYTES_3, 0, createInfo->Gender);
- SetByteValue(PLAYER_BYTES_3, 3, 0); // BattlefieldArenaFaction (0 or 1)
+ SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID, createInfo->Skin);
+ SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID, createInfo->Face);
+ SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID, createInfo->HairStyle);
+ SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID, createInfo->HairColor);
+ SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, createInfo->FacialHair);
+ SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, (GetSession()->IsARecruiter() || GetSession()->GetRecruiterId() != 0) ? REST_STATE_RAF_LINKED : REST_STATE_NOT_RAF_LINKED);
+ SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER, createInfo->Gender);
+ SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_ARENA_FACTION, 0);
SetUInt32Value(PLAYER_GUILDID, 0);
SetUInt32Value(PLAYER_GUILDRANK, 0);
@@ -752,7 +746,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
}
// Played time
- m_Last_tick = time(NULL);
+ m_Last_tick = time(nullptr);
m_Played_time[PLAYED_TIME_TOTAL] = 0;
m_Played_time[PLAYED_TIME_LEVEL] = 0;
@@ -851,7 +845,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
if (msg == EQUIP_ERR_OK)
{
RemoveItem(INVENTORY_SLOT_BAG_0, i, true);
- pItem = StoreItem(sDest, pItem, true);
+ StoreItem(sDest, pItem, true);
}
// if this is ammo then use it
@@ -868,7 +862,8 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount)
{
- TC_LOG_DEBUG("entities.player.items", "STORAGE: Creating initial item, itemId = %u, count = %u", titem_id, titem_amount);
+ TC_LOG_DEBUG("entities.player.items", "Player::StoreNewItemInBestSlots: Player '%s' (%s) creates initial item (ItemID: %u, Count: %u)",
+ GetName().c_str(), GetGUID().ToString().c_str(), titem_id, titem_amount);
// attempt equip by one
while (titem_amount > 0)
@@ -897,7 +892,8 @@ bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount)
}
// item can't be added
- TC_LOG_ERROR("entities.player.items", "STORAGE: Can't equip or store initial item %u for race %u class %u, error msg = %u", titem_id, getRace(), getClass(), msg);
+ TC_LOG_ERROR("entities.player.items", "Player::StoreNewItemInBestSlots: Player '%s' (%s) can't equip or store initial item (ItemID: %u, Race: %u, Class: %u, InventoryResult: %u)",
+ GetName().c_str(), GetGUID().ToString().c_str(), titem_id, getRace(), getClass(), msg);
return false;
}
@@ -927,10 +923,10 @@ void Player::StopMirrorTimer(MirrorTimerType Type)
GetSession()->SendPacket(&data);
}
-bool Player::IsImmuneToEnvironmentalDamage()
+bool Player::IsImmuneToEnvironmentalDamage() const
{
// check for GM and death state included in isAttackableByAOE
- return (!isTargetableForAttack(false));
+ return !isTargetableForAttack(false);
}
uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
@@ -958,13 +954,14 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
data << uint32(resist);
SendMessageToSet(&data, true);
- uint32 final_damage = DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ uint32 final_damage = DealDamage(this, damage, nullptr, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
if (!IsAlive())
{
- if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage
+ if (type == DAMAGE_FALL) // DealDamage does not apply item durability loss from self-induced damage.
{
- TC_LOG_DEBUG("entities.player", "We are fall to death, loosing 10 percents durability");
+ TC_LOG_DEBUG("entities.player", "Player::EnvironmentalDamage: Player '%s' (%s) fall to death, losing 10%% durability",
+ GetName().c_str(), GetGUID().ToString().c_str());
DurabilityLossAll(0.10f, false);
// durability lost message
WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0);
@@ -977,7 +974,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
return final_damage;
}
-int32 Player::getMaxTimer(MirrorTimerType timer)
+int32 Player::getMaxTimer(MirrorTimerType timer) const
{
switch (timer)
{
@@ -1018,7 +1015,7 @@ void Player::StopMirrorTimers()
StopMirrorTimer(FIRE_TIMER);
}
-bool Player::IsMirrorTimerActive(MirrorTimerType type)
+bool Player::IsMirrorTimerActive(MirrorTimerType type) const
{
return m_MirrorTimer[type] == getMaxTimer(type);
}
@@ -1178,7 +1175,7 @@ void Player::SetDrunkValue(uint8 newDrunkValue, uint32 itemId /*= 0*/)
m_invisibilityDetect.DelFlag(INVISIBILITY_DRUNK);
uint32 newDrunkenState = Player::GetDrunkenstateByValue(newDrunkValue);
- SetByteValue(PLAYER_BYTES_3, 1, newDrunkValue);
+ SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_INEBRIATION, newDrunkValue);
UpdateObjectVisibility();
if (!isSobering)
@@ -1200,7 +1197,7 @@ void Player::Update(uint32 p_time)
return;
// undelivered mail
- if (m_nextMailDelivereTime && m_nextMailDelivereTime <= time(NULL))
+ if (m_nextMailDelivereTime && m_nextMailDelivereTime <= time(nullptr))
{
SendNewMail();
++unReadMails;
@@ -1216,8 +1213,17 @@ void Player::Update(uint32 p_time)
{
//TC_LOG_FATAL("entities.player", "Player has m_pad %u during update!", m_pad);
//if (m_spellModTakingSpell)
- TC_LOG_FATAL("spells", "Player has m_spellModTakingSpell %u during update!", m_spellModTakingSpell->m_spellInfo->Id);
- m_spellModTakingSpell = NULL;
+ TC_LOG_FATAL("spells", "Player::Update: Player '%s' (%s) has m_spellModTakingSpell (SpellID: %u) during update!",
+ GetName().c_str(), GetGUID().ToString().c_str(), m_spellModTakingSpell->m_spellInfo->Id);
+ m_spellModTakingSpell = nullptr;
+ }
+
+ // Update cinematic location, if 500ms have passed and we're doing a cinematic now.
+ _cinematicMgr->m_cinematicDiff += p_time;
+ if (_cinematicMgr->m_cinematicCamera && _cinematicMgr->m_activeCinematicCameraId && GetMSTimeDiffToNow(_cinematicMgr->m_lastCinematicCheck) > CINEMATIC_UPDATEDIFF)
+ {
+ _cinematicMgr->m_lastCinematicCheck = getMSTime();
+ _cinematicMgr->UpdateCinematicLocation(p_time);
}
//used to implement delayed far teleports
@@ -1225,7 +1231,7 @@ void Player::Update(uint32 p_time)
Unit::Update(p_time);
SetCanDelayTeleport(false);
- time_t now = time(NULL);
+ time_t now = time(nullptr);
UpdatePvPFlag(now);
@@ -1237,13 +1243,14 @@ void Player::Update(uint32 p_time)
UpdateAfkReport(now);
- if (IsCharmed())
- if (Unit* charmer = GetCharmer())
- if (charmer->GetTypeId() == TYPEID_UNIT && charmer->IsAlive())
- UpdateCharmedAI();
-
- if (GetAI() && IsAIEnabled)
+ if (IsAIEnabled && GetAI())
GetAI()->UpdateAI(p_time);
+ else if (NeedChangeAI)
+ {
+ UpdateCharmAI();
+ NeedChangeAI = false;
+ IsAIEnabled = (GetAI() != nullptr);
+ }
// Update items that have just a limited lifetime
if (now > m_Last_tick)
@@ -1441,7 +1448,7 @@ void Player::Update(uint32 p_time)
{
// m_nextSave reset in SaveToDB call
SaveToDB();
- TC_LOG_DEBUG("entities.player", "Player '%s' (GUID: %u) saved", GetName().c_str(), GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.player", "Player::Update: Player '%s' (%s) saved", GetName().c_str(), GetGUID().ToString().c_str());
}
else
m_nextSave -= p_time;
@@ -1551,7 +1558,7 @@ void Player::setDeathState(DeathState s)
{
if (!cur)
{
- TC_LOG_ERROR("entities.player", "setDeathState: attempt to kill a dead player %s(%d)", GetName().c_str(), GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player::setDeathState: Attempt to kill a dead player '%s' (%s)", GetName().c_str(), GetGUID().ToString().c_str());
return;
}
@@ -1560,10 +1567,10 @@ void Player::setDeathState(DeathState s)
// lost combo points at any target (targeted combo points clear in Unit::setDeathState)
ClearComboPoints();
- clearResurrectRequestData();
+ ClearResurrectRequestData();
//FIXME: is pet dismissed at dying or releasing spirit? if second, add setDeathState(DEAD) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD)
- RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
+ RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true);
// save value before aura remove in Unit::setDeathState
ressSpellId = GetUInt32Value(PLAYER_SELF_RES_SPELL);
@@ -1592,12 +1599,14 @@ void Player::setDeathState(DeathState s)
bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
{
- // 0 1 2 3 4 5 6 7
- // "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
- // 8 9 10 11 12 13 14
- // "characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, guild_member.guildid, characters.playerFlags, "
- // 15 16 17 18 19 20 21
- // "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.data, character_banned.guid, character_declinedname.genitive "
+ // 0 1 2 3 4 5 6 7
+ // SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.skin, characters.face, characters.hairStyle,
+ // 8 9 10 11 12 13 14 15
+ // characters.hairColor, characters.facialStyle, characters.level, characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z,
+ // 16 17 18 19 20 21 22
+ // guild_member.guildid, characters.playerFlags, characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache,
+ // 23 24
+ // character_banned.guid, character_declinedname.genitive
Field* fields = result->Fetch();
@@ -1624,12 +1633,15 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
*data << uint8(plrClass); // class
*data << uint8(gender); // gender
- uint32 playerBytes = fields[5].GetUInt32();
- uint32 playerBytes2 = fields[6].GetUInt32();
+ uint8 skin = fields[5].GetUInt8();
+ uint8 face = fields[6].GetUInt8();
+ uint8 hairStyle = fields[7].GetUInt8();
+ uint8 hairColor = fields[8].GetUInt8();
+ uint8 facialStyle = fields[9].GetUInt8();
- uint16 atLoginFlags = fields[15].GetUInt16();
+ uint16 atLoginFlags = fields[18].GetUInt16();
- if (!ValidateAppearance(uint8(plrRace), uint8(plrClass), gender, uint8(playerBytes >> 16), uint8(playerBytes >> 24), uint8(playerBytes >> 8), uint8(playerBytes2), uint8(playerBytes)))
+ if (!ValidateAppearance(uint8(plrRace), uint8(plrClass), gender, hairStyle, hairColor, face, facialStyle, skin))
{
TC_LOG_ERROR("entities.player.loading", "Player %u has wrong Appearance values (Hair/Skin/Color), forcing recustomize", guid);
@@ -1643,25 +1655,24 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
}
}
- *data << uint8(playerBytes); // skin
- *data << uint8(playerBytes >> 8); // face
- *data << uint8(playerBytes >> 16); // hair style
- *data << uint8(playerBytes >> 24); // hair color
-
- *data << uint8(playerBytes2 & 0xFF); // facial hair
+ *data << uint8(skin);
+ *data << uint8(face);
+ *data << uint8(hairStyle);
+ *data << uint8(hairColor);
+ *data << uint8(facialStyle);
- *data << uint8(fields[7].GetUInt8()); // level
- *data << uint32(fields[8].GetUInt16()); // zone
- *data << uint32(fields[9].GetUInt16()); // map
+ *data << uint8(fields[10].GetUInt8()); // level
+ *data << uint32(fields[11].GetUInt16()); // zone
+ *data << uint32(fields[12].GetUInt16()); // map
- *data << fields[10].GetFloat(); // x
- *data << fields[11].GetFloat(); // y
- *data << fields[12].GetFloat(); // z
+ *data << fields[13].GetFloat(); // x
+ *data << fields[14].GetFloat(); // y
+ *data << fields[15].GetFloat(); // z
- *data << uint32(fields[13].GetUInt32()); // guild id
+ *data << uint32(fields[16].GetUInt32()); // guild id
uint32 charFlags = 0;
- uint32 playerFlags = fields[14].GetUInt32();
+ uint32 playerFlags = fields[17].GetUInt32();
if (atLoginFlags & AT_LOGIN_RESURRECT)
playerFlags &= ~PLAYER_FLAGS_GHOST;
if (playerFlags & PLAYER_FLAGS_HIDE_HELM)
@@ -1672,11 +1683,11 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
charFlags |= CHARACTER_FLAG_GHOST;
if (atLoginFlags & AT_LOGIN_RENAME)
charFlags |= CHARACTER_FLAG_RENAME;
- if (fields[20].GetUInt32())
+ if (fields[23].GetUInt32())
charFlags |= CHARACTER_FLAG_LOCKED_BY_BILLING;
if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED))
{
- if (!fields[21].GetString().empty())
+ if (!fields[24].GetString().empty())
charFlags |= CHARACTER_FLAG_DECLINED;
}
else
@@ -1700,17 +1711,17 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
// Pets info
uint32 petDisplayId = 0;
uint32 petLevel = 0;
- uint32 petFamily = 0;
+ CreatureFamily petFamily = CREATURE_FAMILY_NONE;
// show pet at selection character in character list only for non-ghost character
if (result && !(playerFlags & PLAYER_FLAGS_GHOST) && (plrClass == CLASS_WARLOCK || plrClass == CLASS_HUNTER || plrClass == CLASS_DEATH_KNIGHT))
{
- uint32 entry = fields[16].GetUInt32();
+ uint32 entry = fields[19].GetUInt32();
CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(entry);
if (creatureInfo)
{
- petDisplayId = fields[17].GetUInt32();
- petLevel = fields[18].GetUInt16();
+ petDisplayId = fields[20].GetUInt32();
+ petLevel = fields[21].GetUInt16();
petFamily = creatureInfo->family;
}
}
@@ -1719,7 +1730,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
*data << uint32(petLevel);
*data << uint32(petFamily);
- Tokenizer equipment(fields[19].GetString(), ' ');
+ Tokenizer equipment(fields[22].GetString(), ' ');
for (uint8 slot = 0; slot < INVENTORY_SLOT_BAG_END; ++slot)
{
uint32 visualBase = slot * 2;
@@ -1739,7 +1750,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
for (uint8 enchantSlot = PERM_ENCHANTMENT_SLOT; enchantSlot <= TEMP_ENCHANTMENT_SLOT; ++enchantSlot)
{
// values stored in 2 uint16
- uint32 enchantId = 0x0000FFFF & (enchants >> enchantSlot*16);
+ uint32 enchantId = 0x0000FFFF & (enchants >> enchantSlot * 16);
if (!enchantId)
continue;
@@ -1799,14 +1810,14 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
{
if (!MapManager::IsValidMapCoord(mapid, x, y, z, orientation))
{
- TC_LOG_ERROR("maps", "TeleportTo: invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player (GUID: %u, name: %s, map: %d, X: %f, Y: %f, Z: %f, O: %f).",
- mapid, x, y, z, orientation, GetGUID().GetCounter(), GetName().c_str(), GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ TC_LOG_ERROR("maps", "Player::TeleportTo: Invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player '%s' (%s, MapID: %d, X: %f, Y: %f, Z: %f, O: %f).",
+ mapid, x, y, z, orientation, GetGUID().ToString().c_str(), GetName().c_str(), GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
return false;
}
if (!GetSession()->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_DISABLE_MAP) && DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, mapid, this))
{
- TC_LOG_ERROR("maps", "Player (GUID: %u, name: %s) tried to enter a forbidden map %u", GetGUID().GetCounter(), GetName().c_str(), mapid);
+ TC_LOG_ERROR("maps", "Player::TeleportTo: Player '%s' (%s) tried to enter a forbidden map (MapID: %u)", GetGUID().ToString().c_str(), GetName().c_str(), mapid);
SendTransferAborted(mapid, TRANSFER_ABORT_MAP_NOT_ALLOWED);
return false;
}
@@ -1824,7 +1835,8 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// client without expansion support
if (GetSession()->Expansion() < mEntry->Expansion())
{
- TC_LOG_DEBUG("maps", "Player %s using client without required expansion tried teleport to non accessible map %u", GetName().c_str(), mapid);
+ TC_LOG_DEBUG("maps", "Player '%s' (%s) using client without required expansion tried teleport to non accessible map (MapID: %u)",
+ GetName().c_str(), GetGUID().ToString().c_str(), mapid);
if (Transport* transport = GetTransport())
{
@@ -1837,7 +1849,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
return false; // normal client can't teleport to this map...
}
else
- TC_LOG_DEBUG("maps", "Player %s is being teleported to map %u", GetName().c_str(), mapid);
+ TC_LOG_DEBUG("maps", "Player %s (%s) is being teleported to map (MapID: %u)", GetName().c_str(), GetGUID().ToString().c_str(), mapid);
if (m_vehicle)
ExitVehicle();
@@ -1862,7 +1874,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if (GetMapId() == mapid)
{
- //lets reset far teleport flag if it wasn't reset during chained teleports
+ //lets reset far teleport flag if it wasn't reset during chained teleport
SetSemaphoreTeleportFar(false);
//setup delayed teleport flag
SetDelayedTeleportFlag(IsCanDelayTeleport());
@@ -2046,24 +2058,7 @@ void Player::ProcessDelayedOperations()
return;
if (m_DelayedOperations & DELAYED_RESURRECT_PLAYER)
- {
- ResurrectPlayer(0.0f, false);
-
- if (GetMaxHealth() > m_resurrectHealth)
- SetHealth(m_resurrectHealth);
- else
- SetFullHealth();
-
- if (GetMaxPower(POWER_MANA) > m_resurrectMana)
- SetPower(POWER_MANA, m_resurrectMana);
- else
- SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
-
- SetPower(POWER_RAGE, 0);
- SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY));
-
- SpawnCorpseBones();
- }
+ ResurrectUsingRequestDataImpl();
if (m_DelayedOperations & DELAYED_SAVE_PLAYER)
SaveToDB();
@@ -2146,8 +2141,8 @@ void Player::RemoveFromWorld()
{
if (WorldObject* viewpoint = GetViewpoint())
{
- TC_LOG_ERROR("entities.player", "Player %s has viewpoint %u %u when removed from world",
- GetName().c_str(), viewpoint->GetEntry(), viewpoint->GetTypeId());
+ TC_LOG_ERROR("entities.player", "Player::RemoveFromWorld: Player '%s' (%s) has viewpoint (Entry:%u, Type: %u) when removed from world",
+ GetName().c_str(), GetGUID().ToString().c_str(), viewpoint->GetEntry(), viewpoint->GetTypeId());
SetViewpoint(viewpoint, false);
}
}
@@ -2388,14 +2383,14 @@ void Player::ResetAllPowers()
}
}
-bool Player::CanInteractWithQuestGiver(Object* questGiver)
+bool Player::CanInteractWithQuestGiver(Object* questGiver) const
{
switch (questGiver->GetTypeId())
{
case TYPEID_UNIT:
- return GetNPCIfCanInteractWith(questGiver->GetGUID(), UNIT_NPC_FLAG_QUESTGIVER) != NULL;
+ return GetNPCIfCanInteractWith(questGiver->GetGUID(), UNIT_NPC_FLAG_QUESTGIVER) != nullptr;
case TYPEID_GAMEOBJECT:
- return GetGameObjectIfCanInteractWith(questGiver->GetGUID(), GAMEOBJECT_TYPE_QUESTGIVER) != NULL;
+ return GetGameObjectIfCanInteractWith(questGiver->GetGUID(), GAMEOBJECT_TYPE_QUESTGIVER) != nullptr;
case TYPEID_PLAYER:
return IsAlive() && questGiver->ToPlayer()->IsAlive();
case TYPEID_ITEM:
@@ -2406,46 +2401,46 @@ bool Player::CanInteractWithQuestGiver(Object* questGiver)
return false;
}
-Creature* Player::GetNPCIfCanInteractWith(ObjectGuid const& guid, uint32 npcflagmask)
+Creature* Player::GetNPCIfCanInteractWith(ObjectGuid const& guid, uint32 npcflagmask) const
{
// unit checks
if (!guid)
- return NULL;
+ return nullptr;
if (!IsInWorld())
- return NULL;
+ return nullptr;
if (IsInFlight())
- return NULL;
+ return nullptr;
// exist (we need look pets also for some interaction (quest/etc)
Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
if (!creature)
- return NULL;
+ return nullptr;
// Deathstate checks
- if (!IsAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_GHOST))
- return NULL;
+ if (!IsAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_GHOST_VISIBLE))
+ return nullptr;
// alive or spirit healer
- if (!creature->IsAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_DEAD_INTERACT))
- return NULL;
+ if (!creature->IsAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_CAN_INTERACT_WHILE_DEAD))
+ return nullptr;
// appropriate npc type
if (npcflagmask && !creature->HasFlag(UNIT_NPC_FLAGS, npcflagmask))
- return NULL;
+ return nullptr;
// not allow interaction under control, but allow with own pets
if (creature->GetCharmerGUID())
- return NULL;
+ return nullptr;
// not unfriendly/hostile
if (creature->GetReactionTo(this) <= REP_UNFRIENDLY)
- return NULL;
+ return nullptr;
// not too far
if (!creature->IsWithinDistInMap(this, INTERACTION_DISTANCE))
- return NULL;
+ return nullptr;
return creature;
}
@@ -2473,8 +2468,8 @@ GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid const& guid, Gameo
if (go->IsWithinDistInMap(this, go->GetInteractionDistance()))
return go;
- TC_LOG_DEBUG("maps", "GetGameObjectIfCanInteractWith: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal %f is allowed)", go->GetGOInfo()->name.c_str(),
- go->GetGUID().GetCounter(), GetName().c_str(), GetGUID().GetCounter(), go->GetDistance(this), go->GetInteractionDistance());
+ TC_LOG_DEBUG("maps", "Player::GetGameObjectIfCanInteractWith: GameObject '%s' (%s) is too far away from player '%s' (%s) to be used by him (Distance: %f, maximal 10 is allowed)",
+ go->GetGOInfo()->name.c_str(), go->GetGUID().ToString().c_str(), GetName().c_str(), GetGUID().ToString().c_str(), go->GetDistance(this));
}
}
@@ -2625,14 +2620,14 @@ bool Player::IsGroupVisibleFor(Player const* p) const
bool Player::IsInSameGroupWith(Player const* p) const
{
- return p == this || (GetGroup() != NULL &&
+ return p == this || (GetGroup() != nullptr &&
GetGroup() == p->GetGroup() &&
GetGroup()->SameSubGroup(this, p));
}
bool Player::IsInSameRaidWith(Player const* p) const
{
- return p == this || (GetGroup() != NULL && GetGroup() == p->GetGroup());
+ return p == this || (GetGroup() != nullptr && GetGroup() == p->GetGroup());
}
///- If the player is invited, remove him. If the group if then only 1 person, disband the group.
@@ -2667,7 +2662,7 @@ void Player::RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method
group->RemoveMember(guid, method, kicker, reason);
}
-void Player::SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool recruitAFriend, float /*group_rate*/)
+void Player::SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool recruitAFriend, float /*group_rate*/) const
{
WorldPacket data(SMSG_LOG_XPGAIN, 21); // guess size?
data << uint64(victim ? victim->GetGUID() : ObjectGuid::Empty);
@@ -2708,7 +2703,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate)
if (level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
return;
- uint32 bonus_xp = 0;
+ uint32 bonus_xp;
bool recruitAFriend = GetsRecruitAFriendBonus(true);
// RaF does NOT stack with rested experience
@@ -2799,6 +2794,8 @@ void Player::GiveLevel(uint8 level)
if (sWorld->getBoolConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up
UpdateSkillsToMaxSkillsForLevel();
+ _ApplyAllLevelScaleItemMods(true);
+
// set current level health and mana/energy to maximum after applying all mods.
SetFullHealth();
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
@@ -2808,8 +2805,6 @@ void Player::GiveLevel(uint8 level)
SetPower(POWER_FOCUS, 0);
SetPower(POWER_HAPPINESS, 0);
- _ApplyAllLevelScaleItemMods(true);
-
// update level to hunter/summon pet
if (Pet* pet = GetPet())
pet->SynchronizeLevelWithOwner();
@@ -2831,8 +2826,8 @@ void Player::GiveLevel(uint8 level)
{
++m_grantableLevels;
- if (!HasByteFlag(PLAYER_FIELD_BYTES, 1, 0x01))
- SetByteFlag(PLAYER_FIELD_BYTES, 1, 0x01);
+ if (!HasByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_RAF_GRANTABLE_LEVEL, 0x01))
+ SetByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_RAF_GRANTABLE_LEVEL, 0x01);
}
sScriptMgr->OnPlayerLevelChanged(this, oldLevel);
@@ -3002,7 +2997,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
// cleanup unit flags (will be re-applied if need at aura load).
RemoveFlag(UNIT_FIELD_FLAGS,
- UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_ATTACKABLE_1 |
+ UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_NOT_ATTACKABLE_1 |
UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_LOOTING |
UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_SILENCED | UNIT_FLAG_PACIFIED |
UNIT_FLAG_STUNNED | UNIT_FLAG_IN_COMBAT | UNIT_FLAG_DISARMED |
@@ -3069,8 +3064,6 @@ void Player::SendInitialSpells()
GetSpellHistory()->WritePacket<Player>(data);
GetSession()->SendPacket(&data);
-
- TC_LOG_DEBUG("network", "CHARACTER: Sent Initial Spells");
}
void Player::RemoveMail(uint32 id)
@@ -3086,7 +3079,7 @@ void Player::RemoveMail(uint32 id)
}
}
-void Player::SendMailResult(uint32 mailId, MailResponseType mailAction, MailResponseResult mailError, uint32 equipError, ObjectGuid::LowType item_guid, uint32 item_count)
+void Player::SendMailResult(uint32 mailId, MailResponseType mailAction, MailResponseResult mailError, uint32 equipError, ObjectGuid::LowType item_guid, uint32 item_count) const
{
WorldPacket data(SMSG_SEND_MAIL_RESULT, (4+4+4+(mailError == MAIL_ERR_EQUIP_ERROR?4:(mailAction == MAIL_ITEM_TAKEN?4+4:0))));
data << (uint32) mailId;
@@ -3102,7 +3095,7 @@ void Player::SendMailResult(uint32 mailId, MailResponseType mailAction, MailResp
GetSession()->SendPacket(&data);
}
-void Player::SendNewMail()
+void Player::SendNewMail() const
{
// deliver undelivered mail
WorldPacket data(SMSG_RECEIVED_MAIL, 4);
@@ -3114,7 +3107,7 @@ void Player::UpdateNextMailTimeAndUnreads()
{
// calculate next delivery time (min. from non-delivered mails
// and recalculate unReadMail
- time_t cTime = time(NULL);
+ time_t cTime = time(nullptr);
m_nextMailDelivereTime = 0;
unReadMails = 0;
for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr)
@@ -3131,7 +3124,7 @@ void Player::UpdateNextMailTimeAndUnreads()
void Player::AddNewMailDeliverTime(time_t deliver_time)
{
- if (deliver_time <= time(NULL)) // ready now
+ if (deliver_time <= time(nullptr)) // ready now
{
++unReadMails;
SendNewMail();
@@ -3164,12 +3157,12 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- TC_LOG_ERROR("spells", "Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spellId);
+ TC_LOG_ERROR("spells", "Player::AddTalent: Spell (ID: %u) does not exist. Deleting for all characters in `character_spell` and `character_talent`.", spellId);
DeleteSpellFromAllPlayers(spellId);
}
else
- TC_LOG_ERROR("spells", "Player::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
+ TC_LOG_ERROR("spells", "Player::AddTalent: Spell (ID: %u) does not exist", spellId);
return false;
}
@@ -3179,12 +3172,12 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- TC_LOG_ERROR("spells", "Player::addTalent: Broken spell #%u learning not allowed, deleting for all characters in `character_talent`.", spellId);
+ TC_LOG_ERROR("spells", "Player::AddTalent: Spell (ID: %u) is invalid. Deleting for all characters in `character_spell` and `character_talent`.", spellId);
DeleteSpellFromAllPlayers(spellId);
}
else
- TC_LOG_ERROR("spells", "Player::addTalent: Broken spell #%u learning not allowed.", spellId);
+ TC_LOG_ERROR("spells", "Player::AddTalent: Spell (ID: %u) is invalid", spellId);
return false;
}
@@ -3209,10 +3202,9 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
}
}
- PlayerSpellState state = learning ? PLAYERSPELL_NEW : PLAYERSPELL_UNCHANGED;
PlayerTalent* newtalent = new PlayerTalent();
- newtalent->state = state;
+ newtalent->state = learning ? PLAYERSPELL_NEW : PLAYERSPELL_UNCHANGED;
newtalent->spec = spec;
(*m_talents[spec])[spellId] = newtalent;
@@ -3229,12 +3221,12 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- TC_LOG_ERROR("spells", "Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spellId);
+ TC_LOG_ERROR("spells", "Player::AddSpell: Spell (ID: %u) does not exist. deleting for all characters in `character_spell` and `character_talent`.", spellId);
DeleteSpellFromAllPlayers(spellId);
}
else
- TC_LOG_ERROR("spells", "Player::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
+ TC_LOG_ERROR("spells", "Player::AddSpell: Spell (ID: %u) does not exist", spellId);
return false;
}
@@ -3244,12 +3236,12 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- TC_LOG_ERROR("spells", "Player::addSpell: Broken spell #%u learning not allowed, deleting for all characters in `character_spell`.", spellId);
+ TC_LOG_ERROR("spells", "Player::AddSpell: Spell (ID: %u) is invalid. deleting for all characters in `character_spell` and `character_talent`.", spellId);
DeleteSpellFromAllPlayers(spellId);
}
else
- TC_LOG_ERROR("spells", "Player::addSpell: Broken spell #%u learning not allowed.", spellId);
+ TC_LOG_ERROR("spells", "Player::AddSpell: Spell (ID: %u) is invalid", spellId);
return false;
}
@@ -3852,7 +3844,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId)
if (_spell_idx->second->skillId != SKILL_MOUNTS)
break; // We can break because mount spells belong only to one skillline (at least 310 flyers do)
- spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
+ spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
spellInfo->Effects[i].CalcValue() == 310)
@@ -3872,7 +3864,7 @@ void Player::RemoveArenaSpellCooldowns(bool removeActivePetCooldowns)
// remove cooldowns on spells that have < 10 min CD
GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
return spellInfo->RecoveryTime < 10 * MINUTE * IN_MILLISECONDS && spellInfo->CategoryRecoveryTime < 10 * MINUTE * IN_MILLISECONDS;
}, true);
@@ -3939,12 +3931,12 @@ bool Player::ResetTalents(bool no_cost)
if (!HasEnoughMoney(cost))
{
- SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
+ SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, nullptr, 0, 0);
return false;
}
}
- RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
+ RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true);
for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
{
@@ -3966,7 +3958,7 @@ bool Player::ResetTalents(bool no_cost)
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
- // skip non-existant talent ranks
+ // skip non-existing talent ranks
if (talentInfo->RankID[rank] == 0)
continue;
const SpellInfo* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->RankID[rank]);
@@ -4024,7 +4016,7 @@ Mail* Player::GetMail(uint32 id)
if ((*itr)->messageID == id)
return (*itr);
- return NULL;
+ return nullptr;
}
void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const
@@ -4033,7 +4025,7 @@ void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
{
for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
- if (m_items[i] == NULL)
+ if (m_items[i] == nullptr)
continue;
m_items[i]->BuildCreateUpdateBlockForPlayer(data, target);
@@ -4041,7 +4033,7 @@ void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
for (uint8 i = INVENTORY_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i)
{
- if (m_items[i] == NULL)
+ if (m_items[i] == nullptr)
continue;
m_items[i]->BuildCreateUpdateBlockForPlayer(data, target);
@@ -4064,7 +4056,7 @@ void Player::DestroyForPlayer(Player* target, bool onDeath) const
for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i)
{
- if (m_items[i] == NULL)
+ if (m_items[i] == nullptr)
continue;
m_items[i]->DestroyForPlayer(target);
@@ -4074,7 +4066,7 @@ void Player::DestroyForPlayer(Player* target, bool onDeath) const
{
for (uint8 i = INVENTORY_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i)
{
- if (m_items[i] == NULL)
+ if (m_items[i] == nullptr)
continue;
m_items[i]->DestroyForPlayer(target);
@@ -4164,7 +4156,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
}
// check primary prof. limit
- // first rank of primary profession spell when there are no proffesions avalible is disabled
+ // first rank of primary profession spell when there are no professions available is disabled
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!trainer_spell->learnedSpell[i])
@@ -4219,7 +4211,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
// close player ticket if any
GmTicket* ticket = sTicketMgr->GetTicketByPlayer(playerguid);
if (ticket)
- ticket->SetClosedBy(playerguid);
+ sTicketMgr->CloseTicket(ticket->GetId(), playerguid);
// remove from arena teams
LeaveAllArenaTeams(playerguid);
@@ -4542,7 +4534,8 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
break;
}
default:
- TC_LOG_ERROR("entities.player", "Player::DeleteFromDB: Unsupported delete method: %u.", charDelete_method);
+ TC_LOG_ERROR("entities.player", "Player::DeleteFromDB: Tried to delete player (%s) with unsupported delete method (%u).",
+ playerguid.ToString().c_str(), charDelete_method);
return;
}
@@ -4571,19 +4564,19 @@ void Player::DeleteOldCharacters()
*
* @see Player::DeleteFromDB
*
- * @param keepDays overrite the config option by another amount of days
+ * @param keepDays overwrite the config option by another amount of days
*/
void Player::DeleteOldCharacters(uint32 keepDays)
{
- TC_LOG_INFO("entities.player", "Player::DeleteOldChars: Removing characters older than %u day(s)", keepDays);
+ TC_LOG_INFO("entities.player", "Player::DeleteOldCharacters: Deleting all characters which have been deleted %u days before...", keepDays);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_OLD_CHARS);
- stmt->setUInt32(0, uint32(time(NULL) - time_t(keepDays * DAY)));
+ stmt->setUInt32(0, uint32(time(nullptr) - time_t(keepDays * DAY)));
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (result)
{
- TC_LOG_DEBUG("entities.player", "Player::DeleteOldChars: " UI64FMTD " character(s) to remove", result->GetRowCount());
+ TC_LOG_DEBUG("entities.player", "Player::DeleteOldCharacters: Found " UI64FMTD " character(s) to delete", result->GetRowCount());
do
{
Field* fields = result->Fetch();
@@ -4632,7 +4625,7 @@ void Player::BuildPlayerRepop()
WorldLocation corpseLocation = GetCorpseLocation();
if (corpseLocation.GetMapId() == GetMapId())
{
- TC_LOG_ERROR("entities.player", "BuildPlayerRepop: player %s(%d) already has a corpse", GetName().c_str(), GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player::BuildPlayerRepop: Player '%s' (%s) already has a corpse", GetName().c_str(), GetGUID().ToString().c_str());
return;
}
@@ -4640,7 +4633,7 @@ void Player::BuildPlayerRepop()
Corpse* corpse = CreateCorpse();
if (!corpse)
{
- TC_LOG_ERROR("entities.player", "Error creating corpse for Player %s [%u]", GetName().c_str(), GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player::BuildPlayerRepop: Error creating corpse for player '%s' (%s)", GetName().c_str(), GetGUID().ToString().c_str());
return;
}
GetMap()->AddToMap(corpse);
@@ -4749,30 +4742,9 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
}
}
-void Player::SendGhoulResurrectRequest(Player* target)
-{
- target->m_ghoulResurrectPlayerGUID = GetGUID();
-
- WorldPacket data(SMSG_RESURRECT_REQUEST, 8 + 4 + 1 + 1);
- data << uint64(GetGUID());
- data << uint32(0);
- data << uint8(0);
- data << uint8(0);
- target->GetSession()->SendPacket(&data);
-}
-
-void Player::GhoulResurrect()
-{
- CastSpell(this, 46619 /*SPELL_DK_RAISE_ALLY*/, true, nullptr, nullptr, m_ghoulResurrectPlayerGUID);
-
- m_ghoulResurrectPlayerGUID = ObjectGuid::Empty;
-}
-
void Player::RemoveGhoul()
{
- if (IsGhouled())
- if (Creature* ghoul = ObjectAccessor::GetCreature(*this, m_ghoulResurrectGhoulGUID))
- ghoul->DespawnOrUnsummon(); // Raise Ally aura will handle unauras
+ RemoveAura(SPELL_DK_RAISE_ALLY);
}
void Player::KillPlayer()
@@ -4817,10 +4789,10 @@ void Player::OfflineResurrect(ObjectGuid const& guid, SQLTransaction& trans)
Corpse* Player::CreateCorpse()
{
- // prevent existence 2 corpse for player
+ // prevent the existence of 2 corpses for one player
SpawnCorpseBones();
- uint32 _pb, _pb2, _cfb1, _cfb2;
+ uint32 _cfb1, _cfb2;
Corpse* corpse = new Corpse((m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH) ? CORPSE_RESURRECTABLE_PVP : CORPSE_RESURRECTABLE_PVE);
SetPvPDeath(false);
@@ -4833,16 +4805,13 @@ Corpse* Player::CreateCorpse()
_corpseLocation.WorldRelocate(*this);
- _pb = GetUInt32Value(PLAYER_BYTES);
- _pb2 = GetUInt32Value(PLAYER_BYTES_2);
-
- uint8 skin = (uint8)(_pb);
- uint8 face = (uint8)(_pb >> 8);
- uint8 hairstyle = (uint8)(_pb >> 16);
- uint8 haircolor = (uint8)(_pb >> 24);
- uint8 facialhair = (uint8)(_pb2);
+ uint8 skin = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID);
+ uint8 face = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID);
+ uint8 hairstyle = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID);
+ uint8 haircolor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID);
+ uint8 facialhair = GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE);
- _cfb1 = ((0x00) | (getRace() << 8) | (GetByteValue(PLAYER_BYTES_3, 0) << 16) | (skin << 24));
+ _cfb1 = ((0x00) | (getRace() << 8) | (GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER) << 16) | (skin << 24));
_cfb2 = ((face) | (hairstyle << 8) | (haircolor << 16) | (facialhair << 24));
corpse->SetUInt32Value(CORPSE_FIELD_BYTES_1, _cfb1);
@@ -4962,7 +4931,7 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory)
//for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++)
for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
- if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i))
+ if (Bag* pBag = static_cast<Bag*>(GetItemByPos(INVENTORY_SLOT_BAG_0, i)))
for (uint32 j = 0; j < pBag->GetBagSize(); j++)
if (Item* pItem = GetItemByPos(i, j))
DurabilityPointsLoss(pItem, points);
@@ -4971,6 +4940,9 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory)
void Player::DurabilityPointsLoss(Item* item, int32 points)
{
+ if (HasAuraType(SPELL_AURA_PREVENT_DURABILITY_LOSS))
+ return;
+
int32 pMaxDurability = item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
int32 pOldDurability = item->GetUInt32Value(ITEM_FIELD_DURABILITY);
int32 pNewDurability = pOldDurability - points;
@@ -5042,7 +5014,8 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
DurabilityCostsEntry const* dcost = sDurabilityCostsStore.LookupEntry(ditemProto->ItemLevel);
if (!dcost)
{
- TC_LOG_ERROR("entities.player.items", "RepairDurability: Wrong item lvl %u", ditemProto->ItemLevel);
+ TC_LOG_ERROR("entities.player.items", "Player::DurabilityRepair: Player '%s' (%s) tried to repair an item (ItemID: %u) with invalid item level %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), ditemProto->ItemId, ditemProto->ItemLevel);
return TotalCost;
}
@@ -5050,7 +5023,8 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
DurabilityQualityEntry const* dQualitymodEntry = sDurabilityQualityStore.LookupEntry(dQualitymodEntryId);
if (!dQualitymodEntry)
{
- TC_LOG_ERROR("entities.player.items", "RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntryId);
+ TC_LOG_ERROR("entities.player.items", "Player::DurabilityRepair: Player '%s' (%s) tried to repair an item (ItemID: %u) with invalid QualitymodEntry %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), ditemProto->ItemId, dQualitymodEntryId);
return TotalCost;
}
@@ -5066,7 +5040,8 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
{
if (GetGuildId() == 0)
{
- TC_LOG_DEBUG("entities.player.items", "You are not member of a guild");
+ TC_LOG_DEBUG("entities.player.items", "Player::DurabilityRepair: Player '%s' (%s) tried to repair item in a guild bank but is not member of a guild",
+ GetName().c_str(), GetGUID().ToString().c_str());
return TotalCost;
}
@@ -5081,7 +5056,8 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
}
else if (!HasEnoughMoney(costs))
{
- TC_LOG_DEBUG("entities.player.items", "You do not have enough money");
+ TC_LOG_DEBUG("entities.player.items", "Player::DurabilityRepair: Player '%s' (%s) has not enough money to repair item",
+ GetName().c_str(), GetGUID().ToString().c_str());
return TotalCost;
}
else
@@ -5112,7 +5088,7 @@ void Player::RepopAtGraveyard()
SpawnCorpseBones();
}
- WorldSafeLocsEntry const* ClosestGrave = NULL;
+ WorldSafeLocsEntry const* ClosestGrave;
// Special handle for battleground maps
if (Battleground* bg = GetBattleground())
@@ -5149,7 +5125,7 @@ void Player::RepopAtGraveyard()
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
}
-bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone)
+bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone) const
{
if (channel->flags & CHANNEL_DBC_FLAG_ZONE_DEP && zone->flags & AREA_FLAG_ARENA_INSTANCE)
return false;
@@ -5183,7 +5159,7 @@ void Player::CleanupChannels()
if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetTeam()))
cMgr->LeftChannel(ch->GetName()); // deleted channel if empty
}
- TC_LOG_DEBUG("chat.system", "Player %s: channels cleaned up!", GetName().c_str());
+ TC_LOG_DEBUG("chat.system", "Player::CleanupChannels: Channels of player '%s' (%s) cleaned up.", GetName().c_str(), GetGUID().ToString().c_str());
}
void Player::UpdateLocalChannels(uint32 newZone)
@@ -5200,71 +5176,67 @@ void Player::UpdateLocalChannels(uint32 newZone)
return;
std::string current_zone_name = current_zone->area_name[GetSession()->GetSessionDbcLocale()];
-
for (uint32 i = 0; i < sChatChannelsStore.GetNumRows(); ++i)
{
- if (ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(i))
- {
- Channel* usedChannel = NULL;
+ ChatChannelsEntry const* channelEntry = sChatChannelsStore.LookupEntry(i);
+ if (!channelEntry)
+ continue;
- for (JoinedChannelsList::iterator itr = m_channels.begin(); itr != m_channels.end(); ++itr)
+ Channel* usedChannel = nullptr;
+ for (Channel* channel : m_channels)
+ {
+ if (channel->GetChannelId() == i)
{
- if ((*itr)->GetChannelId() == i)
- {
- usedChannel = *itr;
- break;
- }
+ usedChannel = channel;
+ break;
}
+ }
- Channel* removeChannel = NULL;
- Channel* joinChannel = NULL;
- bool sendRemove = true;
+ Channel* removeChannel = nullptr;
+ Channel* joinChannel = nullptr;
+ bool sendRemove = true;
- if (CanJoinConstantChannelInZone(channel, current_zone))
+ if (CanJoinConstantChannelInZone(channelEntry, current_zone))
+ {
+ if (!(channelEntry->flags & CHANNEL_DBC_FLAG_GLOBAL))
{
- if (!(channel->flags & CHANNEL_DBC_FLAG_GLOBAL))
- {
- if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel)
- continue; // Already on the channel, as city channel names are not changing
-
- char new_channel_name_buf[100];
- char const* currentNameExt;
+ if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel)
+ continue; // Already on the channel, as city channel names are not changing
- if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY)
- currentNameExt = sObjectMgr->GetTrinityStringForDBCLocale(LANG_CHANNEL_CITY);
- else
- currentNameExt = current_zone_name.c_str();
-
- snprintf(new_channel_name_buf, 100, channel->pattern[m_session->GetSessionDbcLocale()], currentNameExt);
+ std::string currentNameExt;
+ if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY)
+ currentNameExt = sObjectMgr->GetTrinityStringForDBCLocale(LANG_CHANNEL_CITY);
+ else
+ currentNameExt = current_zone_name;
- joinChannel = cMgr->GetJoinChannel(new_channel_name_buf, channel->ChannelID);
- if (usedChannel)
+ std::string newChannelName = Trinity::StringFormat(channelEntry->pattern[m_session->GetSessionDbcLocale()], currentNameExt.c_str());
+ joinChannel = cMgr->GetJoinChannel(newChannelName, channelEntry->ChannelID);
+ if (usedChannel)
+ {
+ if (joinChannel != usedChannel)
{
- if (joinChannel != usedChannel)
- {
- removeChannel = usedChannel;
- sendRemove = false; // Do not send leave channel, it already replaced at client
- }
- else
- joinChannel = NULL;
+ removeChannel = usedChannel;
+ sendRemove = false; // Do not send leave channel, it already replaced at client
}
+ else
+ joinChannel = nullptr;
}
- else
- joinChannel = cMgr->GetJoinChannel(channel->pattern[m_session->GetSessionDbcLocale()], channel->ChannelID);
}
else
- removeChannel = usedChannel;
+ joinChannel = cMgr->GetJoinChannel(channelEntry->pattern[m_session->GetSessionDbcLocale()], channelEntry->ChannelID);
+ }
+ else
+ removeChannel = usedChannel;
- if (joinChannel)
- joinChannel->JoinChannel(this, ""); // Changed Channel: ... or Joined Channel: ...
+ if (joinChannel)
+ joinChannel->JoinChannel(this, ""); // Changed Channel: ... or Joined Channel: ...
- if (removeChannel)
- {
- removeChannel->LeaveChannel(this, sendRemove); // Leave old channel
- std::string name = removeChannel->GetName(); // Store name, (*i)erase in LeftChannel
- LeftChannel(removeChannel); // Remove from player's channel list
- cMgr->LeftChannel(name); // Delete if empty
- }
+ if (removeChannel)
+ {
+ removeChannel->LeaveChannel(this, sendRemove); // Leave old channel
+ std::string name = removeChannel->GetName(); // Store name, (*i)erase in LeftChannel
+ LeftChannel(removeChannel); // Remove from player's channel list
+ cMgr->LeftChannel(name); // Delete if empty
}
}
}
@@ -5291,7 +5263,8 @@ void Player::HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, floa
{
if (modGroup >= BASEMOD_END || modType >= MOD_END)
{
- TC_LOG_ERROR("spells", "ERROR in HandleBaseModValue(): non existed BaseModGroup of wrong BaseModType!");
+ TC_LOG_ERROR("spells", "Player::HandleBaseModValue: Invalid BaseModGroup/BaseModType (%u/%u) for player '%s' (%s)",
+ modGroup, modType, GetName().c_str(), GetGUID().ToString().c_str());
return;
}
@@ -5317,7 +5290,8 @@ float Player::GetBaseModValue(BaseModGroup modGroup, BaseModType modType) const
{
if (modGroup >= BASEMOD_END || modType >= MOD_END)
{
- TC_LOG_ERROR("spells", "trial to access non existed BaseModGroup or wrong BaseModType!");
+ TC_LOG_ERROR("spells", "Player::GetBaseModValue: Invalid BaseModGroup/BaseModType (%u/%u) for player '%s' (%s)",
+ modGroup, modType, GetName().c_str(), GetGUID().ToString().c_str());
return 0.0f;
}
@@ -5331,7 +5305,8 @@ float Player::GetTotalBaseModValue(BaseModGroup modGroup) const
{
if (modGroup >= BASEMOD_END)
{
- TC_LOG_ERROR("spells", "wrong BaseModGroup in GetTotalBaseModValue()!");
+ TC_LOG_ERROR("spells", "Player::GetTotalBaseModValue: Invalid BaseModGroup (%u) for player '%s' (%s)",
+ modGroup, GetName().c_str(), GetGUID().ToString().c_str());
return 0.0f;
}
@@ -5350,7 +5325,7 @@ uint32 Player::GetShieldBlockValue() const
return uint32(value);
}
-float Player::GetMeleeCritFromAgility()
+float Player::GetMeleeCritFromAgility() const
{
uint8 level = getLevel();
uint32 pclass = getClass();
@@ -5360,14 +5335,14 @@ float Player::GetMeleeCritFromAgility()
GtChanceToMeleeCritBaseEntry const* critBase = sGtChanceToMeleeCritBaseStore.LookupEntry(pclass-1);
GtChanceToMeleeCritEntry const* critRatio = sGtChanceToMeleeCritStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1);
- if (critBase == NULL || critRatio == NULL)
+ if (critBase == nullptr || critRatio == nullptr)
return 0.0f;
float crit = critBase->base + GetStat(STAT_AGILITY)*critRatio->ratio;
return crit*100.0f;
}
-void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing)
+void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing) const
{
// Table for base dodge values
const float dodge_base[MAX_CLASSES] =
@@ -5408,7 +5383,7 @@ void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing)
// Dodge per agility is proportional to crit per agility, which is available from DBC files
GtChanceToMeleeCritEntry const* dodgeRatio = sGtChanceToMeleeCritStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1);
- if (dodgeRatio == NULL || pclass > MAX_CLASSES)
+ if (dodgeRatio == nullptr || pclass > MAX_CLASSES)
return;
/// @todo research if talents/effects that increase total agility by x% should increase non-diminishing part
@@ -5420,7 +5395,7 @@ void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing)
nondiminishing = 100.0f * (dodge_base[pclass-1] + base_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1]);
}
-float Player::GetSpellCritFromIntellect()
+float Player::GetSpellCritFromIntellect() const
{
uint8 level = getLevel();
uint32 pclass = getClass();
@@ -5430,7 +5405,7 @@ float Player::GetSpellCritFromIntellect()
GtChanceToSpellCritBaseEntry const* critBase = sGtChanceToSpellCritBaseStore.LookupEntry(pclass-1);
GtChanceToSpellCritEntry const* critRatio = sGtChanceToSpellCritStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1);
- if (critBase == NULL || critRatio == NULL)
+ if (critBase == nullptr || critRatio == nullptr)
return 0.0f;
float crit=critBase->base + GetStat(STAT_INTELLECT)*critRatio->ratio;
@@ -5472,7 +5447,7 @@ float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const
return 0.0f;
}
-float Player::OCTRegenHPPerSpirit()
+float Player::OCTRegenHPPerSpirit() const
{
uint8 level = getLevel();
uint32 pclass = getClass();
@@ -5495,7 +5470,7 @@ float Player::OCTRegenHPPerSpirit()
return regen;
}
-float Player::OCTRegenMPPerSpirit()
+float Player::OCTRegenMPPerSpirit() const
{
uint8 level = getLevel();
uint32 pclass = getClass();
@@ -5505,7 +5480,7 @@ float Player::OCTRegenMPPerSpirit()
// GtOCTRegenMPEntry const* baseRatio = sGtOCTRegenMPStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1);
GtRegenMPPerSptEntry const* moreRatio = sGtRegenMPPerSptStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1);
- if (moreRatio == NULL)
+ if (moreRatio == nullptr)
return 0.0f;
// Formula get from PaperDollFrame script
@@ -5703,7 +5678,8 @@ inline int SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLeve
bool Player::UpdateCraftSkill(uint32 spellid)
{
- TC_LOG_DEBUG("entities.player.skills", "UpdateCraftSkill spellid %d", spellid);
+ TC_LOG_DEBUG("entities.player.skills", "Player::UpdateCraftSkill: Player '%s' (%s), SpellID: %d",
+ GetName().c_str(), GetGUID().ToString().c_str(), spellid);
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellid);
@@ -5735,7 +5711,8 @@ bool Player::UpdateCraftSkill(uint32 spellid)
bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator)
{
- TC_LOG_DEBUG("entities.player.skills", "UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel);
+ TC_LOG_DEBUG("entities.player.skills", "Player::UpdateGatherSkill: Player '%s' (%s), SkillID: %u, SkillLevel: %u, RedLevel: %u)",
+ GetName().c_str(), GetGUID().ToString().c_str(), SkillId, SkillValue, RedLevel);
uint32 gathering_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_GATHERING);
@@ -5763,7 +5740,7 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve
bool Player::UpdateFishingSkill()
{
- TC_LOG_DEBUG("entities.player.skills", "UpdateFishingSkill");
+ TC_LOG_DEBUG("entities.player.skills", "Player::UpdateFishingSkill: Player '%s' (%s)", GetName().c_str(), GetGUID().ToString().c_str());
uint32 SkillValue = GetPureSkillValue(SKILL_FISHING);
@@ -5782,13 +5759,15 @@ static const size_t bonusSkillLevelsSize = sizeof(bonusSkillLevels) / sizeof(uin
bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
{
- TC_LOG_DEBUG("entities.player.skills", "UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance / 10.0f);
+ TC_LOG_DEBUG("entities.player.skills", "Player::UpdateSkillPro: Player '%s' (%s), SkillID: %u, Chance: %3.1f%%)",
+ GetName().c_str(), GetGUID().ToString().c_str(), SkillId, Chance / 10.0f);
if (!SkillId)
return false;
if (Chance <= 0) // speedup in 0 chance case
{
- TC_LOG_DEBUG("entities.player.skills", "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f);
+ TC_LOG_DEBUG("entities.player.skills", "Player::UpdateSkillPro: Player '%s' (%s), SkillID: %u, Chance: %3.1f%% missed",
+ GetName().c_str(), GetGUID().ToString().c_str(), SkillId, Chance / 10.0f);
return false;
}
@@ -5827,11 +5806,13 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
}
UpdateSkillEnchantments(SkillId, SkillValue, new_value);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId);
- TC_LOG_DEBUG("entities.player.skills", "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance / 10.0f);
+ TC_LOG_DEBUG("entities.player.skills", "Player::UpdateSkillPro: Player '%s' (%s), SkillID: %u, Chance: %3.1f%% taken",
+ GetName().c_str(), GetGUID().ToString().c_str(), SkillId, Chance / 10.0f);
return true;
}
- TC_LOG_DEBUG("entities.player.skills", "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f);
+ TC_LOG_DEBUG("entities.player.skills", "Player::UpdateSkillPro: Player '%s' (%s), SkillID: %u, Chance: %3.1f%% missed",
+ GetName().c_str(), GetGUID().ToString().c_str(), SkillId, Chance / 10.0f);
return false;
}
@@ -6065,7 +6046,8 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal)
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(id);
if (!pSkill)
{
- TC_LOG_ERROR("entities.player.skills", "Skill not found in SkillLineStore: skill #%u", id);
+ TC_LOG_ERROR("misc", "Player::SetSkill: Skill (SkillID: %u) not found in SkillLineStore for player '%s' (%s)",
+ id, GetName().c_str(), GetGUID().ToString().c_str());
return;
}
@@ -6247,20 +6229,22 @@ void Player::SendActionButtons(uint32 state) const
}
GetSession()->SendPacket(&data);
- TC_LOG_DEBUG("network", "SMSG_ACTION_BUTTONS sent '%u' spec '%u' Sent", GetGUID().GetCounter(), m_activeSpec);
+
}
-bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
+bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type) const
{
if (button >= MAX_ACTION_BUTTONS)
{
- TC_LOG_DEBUG("entities.player", "Action %u not added into button %u for player %s (GUID: %u): button must be < %u", action, button, GetName().c_str(), GetGUID().GetCounter(), MAX_ACTION_BUTTONS );
+ TC_LOG_ERROR("entities.player", "Player::IsActionButtonDataValid: Action %u not added into button %u for player %s (%s): button must be < %u",
+ action, button, GetName().c_str(), GetGUID().ToString().c_str(), MAX_ACTION_BUTTONS);
return false;
}
if (action >= MAX_ACTION_BUTTON_ACTION_VALUE)
{
- TC_LOG_DEBUG("entities.player", "Action %u not added into button %u for player %s (GUID: %u): action must be < %u", action, button, GetName().c_str(), GetGUID().GetCounter(), MAX_ACTION_BUTTON_ACTION_VALUE);
+ TC_LOG_ERROR("entities.player", "Player::IsActionButtonDataValid: Action %u not added into button %u for player %s (%s): action must be < %u",
+ action, button, GetName().c_str(), GetGUID().ToString().c_str(), MAX_ACTION_BUTTON_ACTION_VALUE);
return false;
}
@@ -6269,20 +6253,23 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
case ACTION_BUTTON_SPELL:
if (!sSpellMgr->GetSpellInfo(action))
{
- TC_LOG_DEBUG("entities.player", "Spell action %u not added into button %u for player %s (GUID: %u): spell not exist", action, button, GetName().c_str(), GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.player", "Player::IsActionButtonDataValid: Spell action %u not added into button %u for player %s (%s): spell does not exist. This can be due to a character imported from a different expansion",
+ action, button, GetName().c_str(), GetGUID().ToString().c_str());
return false;
}
if (!HasSpell(action))
{
- TC_LOG_DEBUG("entities.player", "Spell action %u not added into button %u for player %s (GUID: %u): player don't known this spell", action, button, GetName().c_str(), GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.player", "Player::IsActionButtonDataValid: Spell action %u not added into button %u for player %s (%s): player does not known this spell, this can be due to a player changing their talents",
+ action, button, GetName().c_str(), GetGUID().ToString().c_str());
return false;
}
break;
case ACTION_BUTTON_ITEM:
if (!sObjectMgr->GetItemTemplate(action))
{
- TC_LOG_DEBUG("entities.player", "Item action %u not added into button %u for player %s (GUID: %u): item not exist", action, button, GetName().c_str(), GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player::IsActionButtonDataValid: Item action %u not added into button %u for player %s (%s): item not exist",
+ action, button, GetName().c_str(), GetGUID().ToString().c_str());
return false;
}
break;
@@ -6292,7 +6279,7 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
case ACTION_BUTTON_EQSET:
break;
default:
- TC_LOG_DEBUG("entities.player", "Unknown action type %u", type);
+ TC_LOG_ERROR("entities.player", "Player::IsActionButtonDataValid: Unknown action type %u", type);
return false; // other cases not checked at this moment
}
@@ -6302,15 +6289,16 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type)
{
if (!IsActionButtonDataValid(button, action, type))
- return NULL;
+ return nullptr;
- // it create new button (NEW state) if need or return existed
+ // it create new button (NEW state) if need or return existing
ActionButton& ab = m_actionButtons[button];
// set data and update to CHANGED if not NEW
ab.SetActionAndType(action, ActionButtonType(type));
- TC_LOG_DEBUG("entities.player", "Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUID().GetCounter(), action, type, button);
+ TC_LOG_DEBUG("entities.player", "Player::AddActionButton: Player '%s' (%s) added action '%u' (type %u) to button '%u'",
+ GetName().c_str(), GetGUID().ToString().c_str(), action, type, button);
return &ab;
}
@@ -6325,14 +6313,15 @@ void Player::removeActionButton(uint8 button)
else
buttonItr->second.uState = ACTIONBUTTON_DELETED; // saved, will deleted at next save
- TC_LOG_DEBUG("entities.player", "Action Button '%u' Removed from Player '%u'", button, GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.player", "Player::RemoveActionButton: Player '%s' (%s) removed action button '%u'",
+ GetName().c_str(), GetGUID().ToString().c_str(), button);
}
ActionButton const* Player::GetActionButton(uint8 button)
{
ActionButtonList::iterator buttonItr = m_actionButtons.find(button);
if (buttonItr == m_actionButtons.end() || buttonItr->second.uState == ACTIONBUTTON_DELETED)
- return NULL;
+ return nullptr;
return &buttonItr->second;
}
@@ -6366,15 +6355,6 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation, bool t
return true;
}
-void Player::SaveRecallPosition()
-{
- m_recallMap = GetMapId();
- m_recallX = GetPositionX();
- m_recallY = GetPositionY();
- m_recallZ = GetPositionZ();
- m_recallO = GetOrientation();
-}
-
void Player::SendMessageToSetInRange(WorldPacket* data, float dist, bool self)
{
if (self)
@@ -6404,19 +6384,21 @@ void Player::SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr)
VisitNearbyWorldObject(GetVisibilityRange(), notifier);
}
-void Player::SendDirectMessage(WorldPacket* data)
+void Player::SendDirectMessage(WorldPacket const* data) const
{
m_session->SendPacket(data);
}
-void Player::SendCinematicStart(uint32 CinematicSequenceId)
+void Player::SendCinematicStart(uint32 CinematicSequenceId) const
{
WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4);
data << uint32(CinematicSequenceId);
SendDirectMessage(&data);
+ if (CinematicSequencesEntry const* sequence = sCinematicSequencesStore.LookupEntry(CinematicSequenceId))
+ _cinematicMgr->SetActiveCinematicCamera(sequence->cinematicCamera);
}
-void Player::SendMovieStart(uint32 MovieId)
+void Player::SendMovieStart(uint32 MovieId) const
{
WorldPacket data(SMSG_TRIGGER_MOVIE, 4);
data << uint32(MovieId);
@@ -6475,7 +6457,7 @@ void Player::CheckAreaExploreAndOutdoor()
else
{
int32 diff = int32(getLevel()) - areaEntry->area_level;
- uint32 XP = 0;
+ uint32 XP;
if (diff < -5)
{
XP = uint32(sObjectMgr->GetBaseXP(getLevel()+5)*sWorld->getRate(RATE_XP_EXPLORE));
@@ -6493,7 +6475,7 @@ void Player::CheckAreaExploreAndOutdoor()
XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*sWorld->getRate(RATE_XP_EXPLORE));
}
- GiveXP(XP, NULL);
+ GiveXP(XP, nullptr);
SendExplorationExperience(areaId, XP);
}
TC_LOG_DEBUG("entities.player", "Player '%s' (%s) discovered a new area: %u", GetName().c_str(),GetGUID().ToString().c_str(), areaId);
@@ -6710,8 +6692,8 @@ void Player::RewardReputation(Quest const* quest)
void Player::UpdateHonorFields()
{
/// called when rewarding honor and at each save
- time_t now = time_t(time(NULL));
- time_t today = time_t(time(NULL) / DAY) * DAY;
+ time_t now = time_t(time(nullptr));
+ time_t today = time_t(time(nullptr) / DAY) * DAY;
if (m_lastHonorUpdateTime < today)
{
@@ -6835,7 +6817,7 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto
}
}
- if (victim != NULL)
+ if (victim != nullptr)
{
if (groupsize > 1)
honor_f /= groupsize;
@@ -6980,6 +6962,7 @@ void Player::SetInArenaTeam(uint32 ArenaTeamId, uint8 slot, uint8 type)
SetArenaTeamInfoField(slot, ARENA_TEAM_ID, ArenaTeamId);
SetArenaTeamInfoField(slot, ARENA_TEAM_TYPE, type);
}
+
void Player::SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value)
{
SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value);
@@ -7212,7 +7195,7 @@ void Player::CheckDuelDistance(time_t currTime)
}
}
-bool Player::IsOutdoorPvPActive()
+bool Player::IsOutdoorPvPActive() const
{
return IsAlive() && !HasInvisibilityAura() && !HasStealthAura() && IsPvP() && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !IsInFlight();
}
@@ -7223,7 +7206,15 @@ void Player::DuelComplete(DuelCompleteType type)
if (!duel)
return;
- TC_LOG_DEBUG("entities.unit", "Duel Complete %s %s", GetName().c_str(), duel->opponent->GetName().c_str());
+ // Check if DuelComplete() has been called already up in the stack and in that case don't do anything else here
+ if (duel->isCompleted || ASSERT_NOTNULL(duel->opponent->duel)->isCompleted)
+ return;
+
+ duel->isCompleted = true;
+ duel->opponent->duel->isCompleted = true;
+
+ TC_LOG_DEBUG("entities.unit", "Player::DuelComplete: Player '%s' (%s), Opponent: '%s' (%s)",
+ GetName().c_str(), GetGUID().ToString().c_str(), duel->opponent->GetName().c_str(), duel->opponent->GetGUID().ToString().c_str());
WorldPacket data(SMSG_DUEL_COMPLETE, (1));
data << (uint8)((type != DUEL_INTERRUPTED) ? 1 : 0);
@@ -7271,7 +7262,7 @@ void Player::DuelComplete(DuelCompleteType type)
// Honor points after duel (the winner) - ImpConfig
if (uint32 amount = sWorld->getIntConfig(CONFIG_HONOR_AFTER_DUEL))
- duel->opponent->RewardHonor(NULL, 1, amount);
+ duel->opponent->RewardHonor(nullptr, 1, amount);
break;
default:
@@ -7326,9 +7317,9 @@ void Player::DuelComplete(DuelCompleteType type)
duel->opponent->SetUInt32Value(PLAYER_DUEL_TEAM, 0);
delete duel->opponent->duel;
- duel->opponent->duel = NULL;
+ duel->opponent->duel = nullptr;
delete duel;
- duel = NULL;
+ duel = nullptr;
}
//---------------------------------------------------------//
@@ -7347,7 +7338,7 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply)
if (item->IsBroken())
return;
- TC_LOG_DEBUG("entities.player.items", "applying mods for item %u ", item->GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.player.items", "Player::_ApplyItemMods: Applying mods for item %s", item->GetGUID().ToString().c_str());
uint8 attacktype = Player::GetAttackBySlot(slot);
@@ -7365,7 +7356,7 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply)
ApplyItemEquipSpell(item, apply);
ApplyEnchantment(item, apply);
- TC_LOG_DEBUG("entities.player.items", "_ApplyItemMods complete.");
+ TC_LOG_DEBUG("entities.player.items", "Player::_ApplyItemMods: completed");
}
void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply, bool only_level_scale /*= false*/)
@@ -7741,7 +7732,7 @@ void Player::_ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attac
if (aura->GetSpellInfo()->EquippedItemClass == -1)
return;
- BaseModGroup mod = BASEMOD_END;
+ BaseModGroup mod;
switch (attackType)
{
case BASE_ATTACK: mod = CRIT_PERCENTAGE; break;
@@ -7768,7 +7759,7 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item* item, WeaponAttackType att
if (aura->GetSpellInfo()->EquippedItemClass == -1)
return;
- UnitMods unitMod = UNIT_MOD_END;
+ UnitMods unitMod;
switch (attackType)
{
case BASE_ATTACK: unitMod = UNIT_MOD_DAMAGE_MAINHAND; break;
@@ -7777,7 +7768,7 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item* item, WeaponAttackType att
default: return;
}
- UnitModifierType unitModType = TOTAL_VALUE;
+ UnitModifierType unitModType;
switch (aura->GetAuraType())
{
case SPELL_AURA_MOD_DAMAGE_DONE: unitModType = TOTAL_VALUE; break;
@@ -7844,7 +7835,8 @@ void Player::ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply,
return;
}
- TC_LOG_DEBUG("entities.player", "WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id);
+ TC_LOG_DEBUG("entities.player", "Player::ApplyEquipSpell: Player '%s' (%s) cast %s equip spell (ID: %i)",
+ GetName().c_str(), GetGUID().ToString().c_str(), (item ? "item" : "itemset"), spellInfo->Id);
CastSpell(this, spellInfo, true, item);
}
@@ -7950,7 +7942,8 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player.items", "WORLD: unknown Item spellid %i", spellData.SpellId);
+ TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell: Player '%s' (%s) cast unknown item spell (ID: %i)",
+ GetName().c_str(), GetGUID().ToString().c_str(), spellData.SpellId);
continue;
}
@@ -8005,8 +7998,8 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is cast, ignoring...",
- GetGUID().GetCounter(), GetName().c_str(), pEnchant->ID, pEnchant->spellid[s]);
+ TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell: Player '%s' (%s) cast unknown spell (EnchantID: %u, SpellID: %i), ignoring",
+ GetName().c_str(), GetGUID().ToString().c_str(), pEnchant->ID, pEnchant->spellid[s]);
continue;
}
@@ -8050,7 +8043,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(learn_spell_id);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ", proto->ItemId, learn_spell_id);
+ TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Item (Entry: %u) has wrong spell id %u, ignoring.", proto->ItemId, learn_spell_id);
SendEquipError(EQUIP_ERR_NONE, item, NULL);
return;
}
@@ -8079,7 +8072,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring", proto->ItemId, spellData.SpellId);
+ TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Item (Entry: %u) has wrong spell id %u, ignoring", proto->ItemId, spellData.SpellId);
continue;
}
@@ -8106,7 +8099,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
+ TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
continue;
}
@@ -8325,7 +8318,7 @@ void Player::RemovedInsignia(Player* looterPlr)
looterPlr->SendLoot(bones->GetGUID(), LOOT_INSIGNIA);
}
-void Player::SendLootRelease(ObjectGuid guid)
+void Player::SendLootRelease(ObjectGuid guid) const
{
WorldPacket data(SMSG_LOOT_RELEASE_RESPONSE, (8+1));
data << uint64(guid) << uint8(1);
@@ -8337,13 +8330,13 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
if (ObjectGuid lguid = GetLootGUID())
m_session->DoLootRelease(lguid);
- Loot* loot = 0;
+ Loot* loot;
PermissionTypes permission = ALL_PERMISSION;
- TC_LOG_DEBUG("loot", "Player::SendLoot");
+ TC_LOG_DEBUG("loot", "Player::SendLoot: Player: '%s' (%s), Loot: %s",
+ GetName().c_str(), GetGUID().ToString().c_str(), guid.ToString().c_str());
if (guid.IsGameObject())
{
- TC_LOG_DEBUG("loot", "IS_GAMEOBJECT_GUID(guid)");
GameObject* go = GetMap()->GetGameObject(guid);
// not check distance for GO in case owned GO (fishing bobber case, for example)
@@ -8552,7 +8545,6 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
}
else
{
- permission = NONE_PERMISSION;
SendLootError(guid, LOOT_ERROR_ALREADY_PICKPOCKETED);
return;
}
@@ -8667,7 +8659,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_LOOTING);
}
-void Player::SendLootError(ObjectGuid guid, LootError error)
+void Player::SendLootError(ObjectGuid guid, LootError error) const
{
WorldPacket data(SMSG_LOOT_RESPONSE, 10);
data << uint64(guid);
@@ -8676,20 +8668,20 @@ void Player::SendLootError(ObjectGuid guid, LootError error)
SendDirectMessage(&data);
}
-void Player::SendNotifyLootMoneyRemoved()
+void Player::SendNotifyLootMoneyRemoved() const
{
WorldPacket data(SMSG_LOOT_CLEAR_MONEY, 0);
GetSession()->SendPacket(&data);
}
-void Player::SendNotifyLootItemRemoved(uint8 lootSlot)
+void Player::SendNotifyLootItemRemoved(uint8 lootSlot) const
{
WorldPacket data(SMSG_LOOT_REMOVED, 1);
data << uint8(lootSlot);
GetSession()->SendPacket(&data);
}
-void Player::SendUpdateWorldState(uint32 Field, uint32 Value)
+void Player::SendUpdateWorldState(uint32 Field, uint32 Value) const
{
WorldPacket data(SMSG_UPDATE_WORLD_STATE, 8);
data << Field;
@@ -9324,7 +9316,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
SendBattlefieldWorldStates();
}
-void Player::SendBGWeekendWorldStates()
+void Player::SendBGWeekendWorldStates() const
{
for (uint32 i = 1; i < sBattlemasterListStore.GetNumRows(); ++i)
{
@@ -9339,7 +9331,7 @@ void Player::SendBGWeekendWorldStates()
}
}
-void Player::SendBattlefieldWorldStates()
+void Player::SendBattlefieldWorldStates() const
{
/// Send misc stuff that needs to be sent on every login, like the battle timers.
if (sWorld->getBoolConfig(CONFIG_WINTERGRASP_ENABLE))
@@ -9348,7 +9340,7 @@ void Player::SendBattlefieldWorldStates()
{
SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, wg->IsWarTime() ? 0 : 1);
uint32 timer = wg->IsWarTime() ? 0 : (wg->GetTimer() / 1000); // 0 - Time to next battle
- SendUpdateWorldState(ClockWorldState[1], uint32(time(NULL) + timer));
+ SendUpdateWorldState(ClockWorldState[1], uint32(time(nullptr) + timer));
}
}
}
@@ -9362,18 +9354,18 @@ uint32 Player::GetXPRestBonus(uint32 xp)
SetRestBonus(GetRestBonus() - rested_bonus);
- TC_LOG_DEBUG("entities.player", "GetXPRestBonus: Player %s (%u) gain %u xp (+%u Rested Bonus). Rested points=%f", GetName().c_str(), GetGUID().GetCounter(), xp+rested_bonus, rested_bonus, GetRestBonus());
+ TC_LOG_DEBUG("entities.player", "Player::GetXPRestBonus: Player '%s' (%s) gain %u xp (+%u Rested Bonus). Rested points=%f", GetGUID().ToString().c_str(), GetName().c_str(), xp + rested_bonus, rested_bonus, GetRestBonus());
return rested_bonus;
}
-void Player::SetBindPoint(ObjectGuid guid)
+void Player::SetBindPoint(ObjectGuid guid) const
{
WorldPacket data(SMSG_BINDER_CONFIRM, 8);
data << uint64(guid);
GetSession()->SendPacket(&data);
}
-void Player::SendTalentWipeConfirm(ObjectGuid guid)
+void Player::SendTalentWipeConfirm(ObjectGuid guid) const
{
WorldPacket data(MSG_TALENT_WIPE_CONFIRM, (8+4));
data << uint64(guid);
@@ -9394,7 +9386,7 @@ void Player::ResetPetTalents()
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
- TC_LOG_ERROR("entities.player", "Object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().GetCounter(), pet->GetTypeId());
+ TC_LOG_ERROR("entities.player", "Object (GUID: %u TypeId: %u) is considered pet-like, but doesn't have charm info!", pet->GetGUID().GetCounter(), pet->GetTypeId());
return;
}
pet->resetTalents();
@@ -9430,24 +9422,24 @@ void Player::SetSheath(SheathState sheathed)
switch (sheathed)
{
case SHEATH_STATE_UNARMED: // no prepared weapon
- SetVirtualItemSlot(0, NULL);
- SetVirtualItemSlot(1, NULL);
- SetVirtualItemSlot(2, NULL);
+ SetVirtualItemSlot(0, nullptr);
+ SetVirtualItemSlot(1, nullptr);
+ SetVirtualItemSlot(2, nullptr);
break;
case SHEATH_STATE_MELEE: // prepared melee weapon
SetVirtualItemSlot(0, GetWeaponForAttack(BASE_ATTACK, true));
SetVirtualItemSlot(1, GetWeaponForAttack(OFF_ATTACK, true));
- SetVirtualItemSlot(2, NULL);
+ SetVirtualItemSlot(2, nullptr);
break;
case SHEATH_STATE_RANGED: // prepared ranged weapon
- SetVirtualItemSlot(0, NULL);
- SetVirtualItemSlot(1, NULL);
+ SetVirtualItemSlot(0, nullptr);
+ SetVirtualItemSlot(1, nullptr);
SetVirtualItemSlot(2, GetWeaponForAttack(RANGED_ATTACK, true));
break;
default:
- SetVirtualItemSlot(0, NULL);
- SetVirtualItemSlot(1, NULL);
- SetVirtualItemSlot(2, NULL);
+ SetVirtualItemSlot(0, nullptr);
+ SetVirtualItemSlot(1, nullptr);
+ SetVirtualItemSlot(2, nullptr);
break;
}
Unit::SetSheath(sheathed); // this must visualize Sheath changing for other players...
@@ -9795,7 +9787,7 @@ Item* Player::GetItemByGuid(ObjectGuid guid) const
if (pItem->GetGUID() == guid)
return pItem;
- return NULL;
+ return nullptr;
}
Item* Player::GetItemByPos(uint16 pos) const
@@ -9809,9 +9801,9 @@ Item* Player::GetItemByPos(uint8 bag, uint8 slot) const
{
if (bag == INVENTORY_SLOT_BAG_0 && (slot < BANK_SLOT_BAG_END || (slot >= KEYRING_SLOT_START && slot < CURRENCYTOKEN_SLOT_END)))
return m_items[slot];
- else if (Bag* pBag = GetBagByPos(bag))
+ if (Bag* pBag = GetBagByPos(bag))
return pBag->GetItemByPos(slot);
- return NULL;
+ return nullptr;
}
//Does additional check for disarmed weapons
@@ -9828,7 +9820,7 @@ Bag* Player::GetBagByPos(uint8 bag) const
|| (bag >= BANK_SLOT_BAG_START && bag < BANK_SLOT_BAG_END))
if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, bag))
return item->ToBag();
- return NULL;
+ return nullptr;
}
Item* Player::GetWeaponForAttack(WeaponAttackType attackType, bool useable /*= false*/) const
@@ -9839,41 +9831,41 @@ Item* Player::GetWeaponForAttack(WeaponAttackType attackType, bool useable /*= f
case BASE_ATTACK: slot = EQUIPMENT_SLOT_MAINHAND; break;
case OFF_ATTACK: slot = EQUIPMENT_SLOT_OFFHAND; break;
case RANGED_ATTACK: slot = EQUIPMENT_SLOT_RANGED; break;
- default: return NULL;
+ default: return nullptr;
}
- Item* item = NULL;
+ Item* item;
if (useable)
item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, slot);
else
item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
if (!item || item->GetTemplate()->Class != ITEM_CLASS_WEAPON)
- return NULL;
+ return nullptr;
if (!useable)
return item;
if (item->IsBroken() || IsInFeralForm())
- return NULL;
+ return nullptr;
return item;
}
Item* Player::GetShield(bool useable) const
{
- Item* item = NULL;
+ Item* item;
if (useable)
item = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
else
item = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if (!item || item->GetTemplate()->Class != ITEM_CLASS_ARMOR)
- return NULL;
+ return nullptr;
if (!useable)
return item;
if (item->IsBroken())
- return NULL;
+ return nullptr;
return item;
}
@@ -9933,7 +9925,7 @@ bool Player::IsBagPos(uint16 pos)
return false;
}
-bool Player::IsValidPos(uint8 bag, uint8 slot, bool explicit_pos)
+bool Player::IsValidPos(uint8 bag, uint8 slot, bool explicit_pos) const
{
// post selected
if (bag == NULL_BAG && !explicit_pos)
@@ -10190,7 +10182,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item
InventoryResult Player::CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count /*= NULL*/) const
{
- return CanStoreItem(bag, slot, dest, item, count, NULL, false, no_space_count);
+ return CanStoreItem(bag, slot, dest, item, count, nullptr, false, no_space_count);
}
InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap /*= false*/) const
@@ -10198,7 +10190,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& des
if (!pItem)
return EQUIP_ERR_ITEM_NOT_FOUND;
uint32 count = pItem->GetCount();
- return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL);
+ return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, nullptr);
}
bool Player::HasItemTotemCategory(uint32 TotemCategory) const
@@ -10237,7 +10229,7 @@ InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemP
// ignore move item (this slot will be empty at move)
if (pItem2 == pSrcItem)
- pItem2 = NULL;
+ pItem2 = nullptr;
uint32 need_space;
@@ -10311,7 +10303,7 @@ InventoryResult Player::CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, Ite
if (bag == skip_bag)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
- // skip not existed bag or self targeted bag
+ // skip non-existing bag or self targeted bag
Bag* pBag = GetBagByPos(bag);
if (!pBag || pBag == pSrcItem)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
@@ -10323,7 +10315,7 @@ InventoryResult Player::CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, Ite
if (!pBagProto)
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
- // specialized bag mode or non-specilized
+ // specialized bag mode or non-specialized
if (non_specialized != (pBagProto->Class == ITEM_CLASS_CONTAINER && pBagProto->SubClass == ITEM_SUBCLASS_CONTAINER))
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
@@ -10340,10 +10332,10 @@ InventoryResult Player::CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, Ite
// ignore move item (this slot will be empty at move)
if (pItem2 == pSrcItem)
- pItem2 = NULL;
+ pItem2 = nullptr;
// if merge skip empty, if !merge skip non-empty
- if ((pItem2 != NULL) != merge)
+ if ((pItem2 != nullptr) != merge)
continue;
uint32 need_space = pProto->GetMaxStackSize();
@@ -10351,8 +10343,7 @@ InventoryResult Player::CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, Ite
if (pItem2)
{
// can be merged at least partly
- uint8 res = pItem2->CanBeMergedPartlyWith(pProto);
- if (res != EQUIP_ERR_OK)
+ if (pItem2->CanBeMergedPartlyWith(pProto) != EQUIP_ERR_OK)
continue;
// descrease at current stacksize
@@ -10391,10 +10382,10 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl
// ignore move item (this slot will be empty at move)
if (pItem2 == pSrcItem)
- pItem2 = NULL;
+ pItem2 = nullptr;
// if merge skip empty, if !merge skip non-empty
- if ((pItem2 != NULL) != merge)
+ if ((pItem2 != nullptr) != merge)
continue;
uint32 need_space = pProto->GetMaxStackSize();
@@ -10402,8 +10393,7 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl
if (pItem2)
{
// can be merged at least partly
- uint8 res = pItem2->CanBeMergedPartlyWith(pProto);
- if (res != EQUIP_ERR_OK)
+ if (pItem2->CanBeMergedPartlyWith(pProto) != EQUIP_ERR_OK)
continue;
// descrease at current stacksize
@@ -10428,7 +10418,7 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl
InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* pItem, bool swap, uint32* no_space_count) const
{
- TC_LOG_DEBUG("entities.player.items", "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count);
+ TC_LOG_DEBUG("entities.player.items", "Player::CanStoreItem: Bag: %u, Slot: %u, Item: %u, Count: %u", bag, slot, entry, count);
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(entry);
if (!pProto)
@@ -10913,7 +10903,8 @@ InventoryResult Player::CanStoreItems(Item** items, int count, uint32* itemLimit
if (!item)
continue;
- TC_LOG_DEBUG("entities.player.items", "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, item->GetEntry(), item->GetCount());
+ TC_LOG_DEBUG("entities.player.items", "Player::CanStoreItems: Player '%s' (%s), Index: %i ItemID: %u, Count: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), k + 1, item->GetEntry(), item->GetCount());
ItemTemplate const* pProto = item->GetTemplate();
// strange item
@@ -11080,7 +11071,7 @@ InventoryResult Player::CanStoreItems(Item** items, int count, uint32* itemLimit
continue;
// search free slot in bags
- for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
+ for (uint8 t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t)
{
if (Bag* bag = GetBagByPos(t))
{
@@ -11130,7 +11121,8 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
dest = 0;
if (pItem)
{
- TC_LOG_DEBUG("entities.player.items", "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount());
+ TC_LOG_DEBUG("entities.player.items", "Player::CanEquipItem: Player '%s' (%s), Slot: %u, Item: %u, Count: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), slot, pItem->GetEntry(), pItem->GetCount());
ItemTemplate const* pProto = pItem->GetTemplate();
if (pProto)
{
@@ -11296,11 +11288,12 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
Item* pItem = GetItemByPos(pos);
- // Applied only to existed equipped item
+ // Applied only to existing equipped item
if (!pItem)
return EQUIP_ERR_OK;
- TC_LOG_DEBUG("entities.player.items", "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount());
+ TC_LOG_DEBUG("entities.player.items", "Player::CanUnequipItem: Player '%s' (%s), Slot: %u, Item: %u, Count: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), pos, pItem->GetEntry(), pItem->GetCount());
ItemTemplate const* pProto = pItem->GetTemplate();
if (!pProto)
@@ -11336,7 +11329,8 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest
uint32 count = pItem->GetCount();
- TC_LOG_DEBUG("entities.player.items", "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount());
+ TC_LOG_DEBUG("entities.player.items", "Player::CanBankItem: Player '%s' (%s), Bag: %u, Slot: %u, Item: %u, Count: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), bag, slot, pItem->GetEntry(), pItem->GetCount());
ItemTemplate const* pProto = pItem->GetTemplate();
if (!pProto)
return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND;
@@ -11352,8 +11346,8 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest
uint8 pItemslot = pItem->GetSlot();
if (pItemslot >= CURRENCYTOKEN_SLOT_START && pItemslot < CURRENCYTOKEN_SLOT_END)
{
- TC_LOG_ERROR("entities.player", "Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!",
- GetName().c_str(), GetGUID().GetCounter(), pItem->GetGUID().GetCounter(), pProto->ItemId);
+ TC_LOG_ERROR("entities.player", "Possible hacking attempt: Player %s (%s) tried to move token [%s entry: %u] out of the currency bag!",
+ GetName().c_str(), GetGUID().ToString().c_str(), pItem->GetGUID().ToString().c_str(), pProto->ItemId);
return EQUIP_ERR_ITEMS_CANT_BE_SWAPPED;
}
@@ -11520,7 +11514,8 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const
{
if (pItem)
{
- TC_LOG_DEBUG("entities.player.items", "STORAGE: CanUseItem item = %u", pItem->GetEntry());
+ TC_LOG_DEBUG("entities.player.items", "Player::CanUseItem: Player '%s' (%s), Item: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), pItem->GetEntry());
if (!IsAlive() && not_loading)
return EQUIP_ERR_YOU_ARE_DEAD;
@@ -11801,7 +11796,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update
Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update)
{
if (!pItem)
- return NULL;
+ return nullptr;
Item* lastItem = pItem;
for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end();)
@@ -11826,12 +11821,13 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update)
Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update)
{
if (!pItem)
- return NULL;
+ return nullptr;
uint8 bag = pos >> 8;
uint8 slot = pos & 255;
- TC_LOG_DEBUG("entities.player.items", "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.player.items", "Player::_StoreItem: Player '%s' (%s), Bag: %u, Slot: %u, Item: %u (%s), Count: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), bag, slot, pItem->GetEntry(), pItem->GetGUID().ToString().c_str(), count);
Item* pItem2 = GetItemByPos(bag, slot);
@@ -11843,7 +11839,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool
pItem->SetCount(count);
if (!pItem)
- return NULL;
+ return nullptr;
if (pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP ||
pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM ||
@@ -11859,7 +11855,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool
pItem->SetGuidValue(ITEM_FIELD_OWNER, GetGUID());
pItem->SetSlot(slot);
- pItem->SetContainer(NULL);
+ pItem->SetContainer(nullptr);
// need update known currency
if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END)
@@ -11944,7 +11940,7 @@ Item* Player::EquipNewItem(uint16 pos, uint32 item, bool update)
return EquipItem(pos, pItem, update);
}
- return NULL;
+ return nullptr;
}
Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
@@ -11977,7 +11973,8 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cooldownSpell);
if (!spellProto)
- TC_LOG_ERROR("entities.player", "Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell);
+ TC_LOG_ERROR("entities.player", "Player::EquipItem: Weapon switch cooldown spell %u for player '%s' (%s) couldn't be found in Spell.dbc",
+ cooldownSpell, GetName().c_str(), GetGUID().ToString().c_str());
else
{
m_weaponChangeTimer = spellProto->StartRecoveryTime;
@@ -12097,14 +12094,15 @@ void Player::VisualizeItem(uint8 slot, Item* pItem)
if (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM)
pItem->SetBinding(true);
- TC_LOG_DEBUG("entities.player.items", "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry());
+ TC_LOG_DEBUG("entities.player.items", "Player::SetVisibleItemSlot: Player '%s' (%s), Slot: %u, Item: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), slot, pItem->GetEntry());
m_items[slot] = pItem;
SetGuidValue(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID());
pItem->SetGuidValue(ITEM_FIELD_CONTAINED, GetGUID());
pItem->SetGuidValue(ITEM_FIELD_OWNER, GetGUID());
pItem->SetSlot(slot);
- pItem->SetContainer(NULL);
+ pItem->SetContainer(nullptr);
if (slot < EQUIPMENT_SLOT_END)
SetVisibleItemSlot(slot, pItem);
@@ -12127,7 +12125,8 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update)
Item* pItem = GetItemByPos(bag, slot);
if (pItem)
{
- TC_LOG_DEBUG("entities.player.items", "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry());
+ TC_LOG_DEBUG("entities.player.items", "Player::RemoveItem: Player '%s' (%s), Bag: %u, Slot: %u, Item: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), bag, slot, pItem->GetEntry());
RemoveEnchantmentDurations(pItem);
RemoveItemDurations(pItem);
@@ -12148,7 +12147,8 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update)
// remove item dependent auras and casts (only weapon and armor slots)
if (slot < EQUIPMENT_SLOT_END)
{
- RemoveItemDependentAurasAndCasts(pItem);
+ if (update)
+ RemoveItemDependentAurasAndCasts(pItem);
// remove held enchantments, update expertise
if (slot == EQUIPMENT_SLOT_MAINHAND)
@@ -12181,11 +12181,11 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update)
}
}
- m_items[slot] = NULL;
+ m_items[slot] = nullptr;
SetGuidValue(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), ObjectGuid::Empty);
if (slot < EQUIPMENT_SLOT_END)
- SetVisibleItemSlot(slot, NULL);
+ SetVisibleItemSlot(slot, nullptr);
}
else if (Bag* pBag = GetBagByPos(bag))
pBag->RemoveItem(slot, update);
@@ -12225,7 +12225,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool
// store item
Item* pLastItem = StoreItem(dest, pItem, update);
- // only set if not merged to existed stack (pItem can be deleted already but we can compare pointers any way)
+ // only set if not merged to existing stack (pItem can be deleted already but we can compare pointers any way)
if (pLastItem == pItem)
{
// update owner for last item (this can be original item with wrong owner
@@ -12246,7 +12246,8 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
Item* pItem = GetItemByPos(bag, slot);
if (pItem)
{
- TC_LOG_DEBUG("entities.player.items", "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry());
+ TC_LOG_DEBUG("entities.player.items", "Player::DestroyItem: Player '%s' (%s), Bag: %u, Slot: %u, Item: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), bag, slot, pItem->GetEntry());
// Also remove all contained items if the item is a bag.
// This if () prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow.
if (pItem->IsNotEmptyBag())
@@ -12315,10 +12316,10 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
UpdateExpertise(OFF_ATTACK);
// equipment visual show
- SetVisibleItemSlot(slot, NULL);
+ SetVisibleItemSlot(slot, nullptr);
}
- m_items[slot] = NULL;
+ m_items[slot] = nullptr;
}
else if (Bag* pBag = GetBagByPos(bag))
pBag->RemoveItem(slot, update);
@@ -12326,7 +12327,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
// Delete rolled money / loot from db.
// MUST be done before RemoveFromWorld() or GetTemplate() fails
if (ItemTemplate const* pTmp = pItem->GetTemplate())
- if (pTmp->Flags & ITEM_PROTO_FLAG_OPENABLE)
+ if (pTmp->Flags & ITEM_PROTO_FLAG_HAS_LOOT)
pItem->ItemContainerDeleteLootMoneyAndLootItemsFromDB();
if (IsInWorld() && update)
@@ -12344,7 +12345,8 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
void Player::DestroyItemCount(uint32 itemEntry, uint32 count, bool update, bool unequip_check)
{
- TC_LOG_DEBUG("entities.player.items", "STORAGE: DestroyItemCount item = %u, count = %u", itemEntry, count);
+ TC_LOG_DEBUG("entities.player.items", "Player::DestroyItemCount: Player '%s' (%s), Item: %u, Count: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), itemEntry, count);
uint32 remcount = 0;
// in inventory
@@ -12535,7 +12537,8 @@ void Player::DestroyItemCount(uint32 itemEntry, uint32 count, bool update, bool
void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone)
{
- TC_LOG_DEBUG("entities.player.items", "STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone);
+ TC_LOG_DEBUG("entities.player.items", "Player::DestroyZoneLimitedItem: In map %u and area %u for player '%s' (%s)",
+ GetMapId(), new_zone, GetName().c_str(), GetGUID().ToString().c_str());
// in inventory
for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
@@ -12567,7 +12570,8 @@ void Player::DestroyConjuredItems(bool update)
{
// used when entering arena
// destroys all conjured items
- TC_LOG_DEBUG("entities.player.items", "STORAGE: DestroyConjuredItems");
+ TC_LOG_DEBUG("entities.player.items", "Player::DestroyConjuredItems: Player '%s' (%s)",
+ GetName().c_str(), GetGUID().ToString().c_str());
// in inventory
for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
@@ -12593,7 +12597,7 @@ void Player::DestroyConjuredItems(bool update)
Item* Player::GetItemByEntry(uint32 entry) const
{
// in inventory
- for (int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
+ for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
if (pItem->GetEntry() == entry)
return pItem;
@@ -12603,19 +12607,19 @@ Item* Player::GetItemByEntry(uint32 entry) const
if (pItem->GetEntry() == entry)
return pItem;
- for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
+ for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
if (Bag* pBag = GetBagByPos(i))
for (uint32 j = 0; j < pBag->GetBagSize(); ++j)
if (Item* pItem = pBag->GetItemByPos(j))
if (pItem->GetEntry() == entry)
return pItem;
- for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i)
+ for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i)
if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
if (pItem->GetEntry() == entry)
return pItem;
- return NULL;
+ return nullptr;
}
void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update)
@@ -12623,7 +12627,8 @@ void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update)
if (!pItem)
return;
- TC_LOG_DEBUG("entities.player.items", "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUID().GetCounter(), pItem->GetEntry(), count);
+ TC_LOG_DEBUG("entities.player.items", "Player::DestroyItemCount: Player '%s' (%s), Item (%s, Entry: %u), Count: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), pItem->GetGUID().ToString().c_str(), pItem->GetEntry(), count);
if (pItem->GetCount() <= count)
{
@@ -12653,28 +12658,28 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
Item* pSrcItem = GetItemByPos(srcbag, srcslot);
if (!pSrcItem)
{
- SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pSrcItem, NULL);
+ SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pSrcItem, nullptr);
return;
}
if (pSrcItem->m_lootGenerated) // prevent split looting item (item
{
//best error message found for attempting to split while looting
- SendEquipError(EQUIP_ERR_COULDNT_SPLIT_ITEMS, pSrcItem, NULL);
+ SendEquipError(EQUIP_ERR_COULDNT_SPLIT_ITEMS, pSrcItem, nullptr);
return;
}
// not let split all items (can be only at cheating)
if (pSrcItem->GetCount() == count)
{
- SendEquipError(EQUIP_ERR_COULDNT_SPLIT_ITEMS, pSrcItem, NULL);
+ SendEquipError(EQUIP_ERR_COULDNT_SPLIT_ITEMS, pSrcItem, nullptr);
return;
}
- // not let split more existed items (can be only at cheating)
+ // not let split more existing items (can be only at cheating)
if (pSrcItem->GetCount() < count)
{
- SendEquipError(EQUIP_ERR_TRIED_TO_SPLIT_MORE_THAN_COUNT, pSrcItem, NULL);
+ SendEquipError(EQUIP_ERR_TRIED_TO_SPLIT_MORE_THAN_COUNT, pSrcItem, nullptr);
return;
}
@@ -12686,11 +12691,12 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
return;
}
- TC_LOG_DEBUG("entities.player.items", "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count);
+ TC_LOG_DEBUG("entities.player.items", "Player::SplitItem: Player '%s' (%s), Bag: %u, Slot: %u, Item: %u, Count: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), dstbag, dstslot, pSrcItem->GetEntry(), count);
Item* pNewItem = pSrcItem->CloneItem(count, this);
if (!pNewItem)
{
- SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pSrcItem, NULL);
+ SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pSrcItem, nullptr);
return;
}
@@ -12705,7 +12711,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
{
delete pNewItem;
pSrcItem->SetCount(pSrcItem->GetCount() + count);
- SendEquipError(msg, pSrcItem, NULL);
+ SendEquipError(msg, pSrcItem, nullptr);
return;
}
@@ -12725,7 +12731,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
{
delete pNewItem;
pSrcItem->SetCount(pSrcItem->GetCount() + count);
- SendEquipError(msg, pSrcItem, NULL);
+ SendEquipError(msg, pSrcItem, nullptr);
return;
}
@@ -12745,7 +12751,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
{
delete pNewItem;
pSrcItem->SetCount(pSrcItem->GetCount() + count);
- SendEquipError(msg, pSrcItem, NULL);
+ SendEquipError(msg, pSrcItem, nullptr);
return;
}
@@ -12771,7 +12777,8 @@ void Player::SwapItem(uint16 src, uint16 dst)
if (!pSrcItem)
return;
- TC_LOG_DEBUG("entities.player.items", "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry());
+ TC_LOG_DEBUG("entities.player.items", "Player::SwapItem: Player '%s' (%s), Bag: %u, Slot: %u, Item: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), dstbag, dstslot, pSrcItem->GetEntry());
if (!IsAlive())
{
@@ -12836,7 +12843,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
InventoryResult msg = CanStoreItem(dstbag, dstslot, dest, pSrcItem, false);
if (msg != EQUIP_ERR_OK)
{
- SendEquipError(msg, pSrcItem, NULL);
+ SendEquipError(msg, pSrcItem, nullptr);
return;
}
@@ -12851,7 +12858,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
InventoryResult msg = CanBankItem(dstbag, dstslot, dest, pSrcItem, false);
if (msg != EQUIP_ERR_OK)
{
- SendEquipError(msg, pSrcItem, NULL);
+ SendEquipError(msg, pSrcItem, nullptr);
return;
}
@@ -12865,7 +12872,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
InventoryResult msg = CanEquipItem(dstslot, dest, pSrcItem, false);
if (msg != EQUIP_ERR_OK)
{
- SendEquipError(msg, pSrcItem, NULL);
+ SendEquipError(msg, pSrcItem, nullptr);
return;
}
@@ -12974,8 +12981,8 @@ void Player::SwapItem(uint16 src, uint16 dst)
{
if (Bag* dstBag = pDstItem->ToBag())
{
- Bag* emptyBag = NULL;
- Bag* fullBag = NULL;
+ Bag* emptyBag = nullptr;
+ Bag* fullBag = nullptr;
if (srcBag->IsEmpty() && !IsBagPos(src))
{
emptyBag = srcBag;
@@ -13088,7 +13095,6 @@ void Player::SwapItem(uint16 src, uint16 dst)
if (bagItem->m_lootGenerated)
{
m_session->DoLootRelease(GetLootGUID());
- released = true; // not realy needed here
break;
}
}
@@ -13133,10 +13139,11 @@ void Player::AddItemToBuyBackSlot(Item* pItem)
}
RemoveItemFromBuyBackSlot(slot, true);
- TC_LOG_DEBUG("entities.player.items", "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot);
+ TC_LOG_DEBUG("entities.player.items", "Player::AddItemToBuyBackSlot: Player '%s' (%s), Item: %u, Slot: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), pItem->GetEntry(), slot);
m_items[slot] = pItem;
- time_t base = time(NULL);
+ time_t base = time(nullptr);
uint32 etime = uint32(base - m_logintime + (30 * 3600));
uint32 eslot = slot - BUYBACK_SLOT_START;
@@ -13155,15 +13162,17 @@ void Player::AddItemToBuyBackSlot(Item* pItem)
Item* Player::GetItemFromBuyBackSlot(uint32 slot)
{
- TC_LOG_DEBUG("entities.player.items", "STORAGE: GetItemFromBuyBackSlot slot = %u", slot);
+ TC_LOG_DEBUG("entities.player.items", "Player::GetItemFromBuyBackSlot: Player '%s' (%s), Slot: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), slot);
if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END)
return m_items[slot];
- return NULL;
+ return nullptr;
}
void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del)
{
- TC_LOG_DEBUG("entities.player.items", "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot);
+ TC_LOG_DEBUG("entities.player.items", "Player::RemoveItemFromBuyBackSlot: Player '%s' (%s), Slot: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), slot);
if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END)
{
Item* pItem = m_items[slot];
@@ -13174,7 +13183,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del)
pItem->SetState(ITEM_REMOVED, this);
}
- m_items[slot] = NULL;
+ m_items[slot] = nullptr;
uint32 eslot = slot - BUYBACK_SLOT_START;
SetGuidValue(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), ObjectGuid::Empty);
@@ -13187,9 +13196,9 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del)
}
}
-void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint32 itemid)
+void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint32 itemid) const
{
- TC_LOG_DEBUG("network", "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg);
+
WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18));
data << uint8(msg);
@@ -13230,9 +13239,8 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint
GetSession()->SendPacket(&data);
}
-void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param)
+void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param) const
{
- TC_LOG_DEBUG("network", "WORLD: Sent SMSG_BUY_FAILED");
WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1));
data << uint64(creature ? creature->GetGUID() : ObjectGuid::Empty);
data << uint32(item);
@@ -13242,9 +13250,8 @@ void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32
GetSession()->SendPacket(&data);
}
-void Player::SendSellError(SellResult msg, Creature* creature, ObjectGuid guid, uint32 param)
+void Player::SendSellError(SellResult msg, Creature* creature, ObjectGuid guid, uint32 param) const
{
- TC_LOG_DEBUG("network", "WORLD: Sent SMSG_SELL_ITEM");
WorldPacket data(SMSG_SELL_ITEM, (8+8+(param?4:0)+1)); // last check 2.0.10
data << uint64(creature ? creature->GetGUID() : ObjectGuid::Empty);
data << uint64(guid);
@@ -13280,9 +13287,9 @@ void Player::TradeCancel(bool sendback)
// cleanup
delete m_trade;
- m_trade = NULL;
+ m_trade = nullptr;
delete trader->m_trade;
- trader->m_trade = NULL;
+ trader->m_trade = nullptr;
}
}
@@ -13314,7 +13321,8 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly)
if (m_itemDuration.empty())
return;
- TC_LOG_DEBUG("entities.player.items", "Player::UpdateItemDuration(%u, %u)", time, realtimeonly);
+ TC_LOG_DEBUG("entities.player.items", "Player::UpdateItemDuration: Player '%s' (%s), Time: %u, RealTimeOnly: %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), time, realtimeonly);
for (ItemDurationList::const_iterator itr = m_itemDuration.begin(); itr != m_itemDuration.end();)
{
@@ -13775,7 +13783,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
{
if (getClass() == CLASS_SHAMAN)
{
- float addValue = 0.0f;
+ float addValue;
if (item->GetSlot() == EQUIPMENT_SLOT_MAINHAND)
{
addValue = float(enchant_amount * item->GetTemplate()->Delay / 1000.0f);
@@ -13796,10 +13804,11 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
// nothing do..
break;
default:
- TC_LOG_ERROR("entities.player", "Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type);
+ TC_LOG_ERROR("entities.player", "Player::ApplyEnchantment: Unknown item enchantment (ID: %u, DisplayType: %u) for player '%s' (%s)",
+ enchant_id, enchant_display_type, GetName().c_str(), GetGUID().ToString().c_str());
break;
- } /*switch (enchant_display_type)*/
- } /*for*/
+ }
+ }
}
// visualize enchantment at player and equipped items
@@ -13967,7 +13976,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
VendorItemData const* vendorItems = creature->GetVendorItems();
if (!vendorItems || vendorItems->Empty())
{
- TC_LOG_ERROR("sql.sql", "Creature %s (Entry: %u GUID: %u DB GUID: %u) has UNIT_NPC_FLAG_VENDOR set but has an empty trading item list.", creature->GetName().c_str(), creature->GetEntry(), creature->GetGUID().GetCounter(), creature->GetSpawnId());
+ TC_LOG_ERROR("sql.sql", "Creature %s (Entry: %u GUID: %u DB GUID: %u) has UNIT_NPC_FLAG_VENDOR set, but has an empty trading item list.", creature->GetName().c_str(), creature->GetEntry(), creature->GetGUID().GetCounter(), creature->GetSpawnId());
canTalk = false;
}
break;
@@ -14001,8 +14010,11 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
break;
case GOSSIP_OPTION_TRAINER:
if (getClass() != creature->GetCreatureTemplate()->trainer_class && creature->GetCreatureTemplate()->trainer_type == TRAINER_TYPE_CLASS)
- TC_LOG_ERROR("sql.sql", "GOSSIP_OPTION_TRAINER:: Player %s (GUID: %u) request wrong gossip menu: %u with wrong class: %u at Creature: %s (Entry: %u, Trainer Class: %u)",
- GetName().c_str(), GetGUID().GetCounter(), menu->GetGossipMenu().GetMenuId(), getClass(), creature->GetName().c_str(), creature->GetEntry(), creature->GetCreatureTemplate()->trainer_class);
+ {
+ TC_LOG_ERROR("sql.sql", "GOSSIP_OPTION_TRAINER:: Player %s (GUID: %u) requested wrong gossip menu: %u with wrong class: %u at Creature: %s (Entry: %u, Trainer Class: %u)",
+ GetName().c_str(), GetGUID().GetCounter(), menu->GetGossipMenu().GetMenuId(), getClass(), creature->GetName().c_str(), creature->GetEntry(), creature->GetCreatureTemplate()->trainer_class);
+ canTalk = false;
+ }
// no break;
case GOSSIP_OPTION_GOSSIP:
case GOSSIP_OPTION_SPIRITGUIDE:
@@ -14017,7 +14029,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
canTalk = false;
break;
default:
- TC_LOG_ERROR("sql.sql", "Creature entry %u has unknown gossip option %u for menu %u", creature->GetEntry(), itr->second.OptionType, itr->second.MenuId);
+ TC_LOG_ERROR("sql.sql", "Creature entry %u has unknown gossip option %u for menu %u.", creature->GetEntry(), itr->second.OptionType, itr->second.MenuId);
canTalk = false;
break;
}
@@ -14058,14 +14070,14 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
if (!optionBroadcastText)
{
/// Find localizations from database.
- if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuId)))
+ if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, itr->second.OptionIndex)))
ObjectMgr::GetLocaleString(gossipMenuLocale->OptionText, locale, strOptionText);
}
if (!boxBroadcastText)
{
/// Find localizations from database.
- if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, menuId)))
+ if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, itr->second.OptionIndex)))
ObjectMgr::GetLocaleString(gossipMenuLocale->BoxText, locale, strBoxText);
}
}
@@ -14130,7 +14142,8 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
{
if (gossipOptionId > GOSSIP_OPTION_QUESTGIVER)
{
- TC_LOG_ERROR("entities.player", "Player guid %u request invalid gossip option for GameObject entry %u", GetGUID().GetCounter(), source->GetEntry());
+ TC_LOG_ERROR("entities.player", "Player '%s' (%s) requests invalid gossip option for GameObject (Entry: %u)",
+ GetName().c_str(), GetGUID().ToString().c_str(), source->GetEntry());
return;
}
}
@@ -14142,7 +14155,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
int32 cost = int32(item->BoxMoney);
if (!HasEnoughMoney(cost))
{
- SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
+ SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, nullptr, 0, 0);
PlayerTalkClass->SendCloseGossip();
return;
}
@@ -14167,7 +14180,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
break;
case GOSSIP_OPTION_SPIRITHEALER:
if (isDead())
- source->ToCreature()->CastSpell(source->ToCreature(), 17251, true, NULL, NULL, GetGUID());
+ source->ToCreature()->CastSpell(source->ToCreature(), 17251, true, nullptr, nullptr, GetGUID());
break;
case GOSSIP_OPTION_QUESTGIVER:
PrepareQuestMenu(guid);
@@ -14188,8 +14201,8 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
{
// Cast spells that teach dual spec
// Both are also ImplicitTarget self and must be cast by player
- CastSpell(this, 63680, true, NULL, NULL, GetGUID());
- CastSpell(this, 63624, true, NULL, NULL, GetGUID());
+ CastSpell(this, 63680, true, nullptr, nullptr, GetGUID());
+ CastSpell(this, 63624, true, nullptr, nullptr, GetGUID());
// Should show another Gossip text with "Congratulations..."
PlayerTalkClass->SendCloseGossip();
@@ -14234,7 +14247,8 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
if (bgTypeId == BATTLEGROUND_TYPE_NONE)
{
- TC_LOG_ERROR("entities.player", "a user (guid %u) requested battlegroundlist from a npc who is no battlemaster", GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player '%s' (%s) requested battlegroundlist from an invalid creature (%s)",
+ GetName().c_str(), GetGUID().ToString().c_str(), source->GetGUID().ToString().c_str());
return;
}
@@ -14442,7 +14456,7 @@ bool Player::IsActiveQuest(uint32 quest_id) const
return m_QuestStatus.find(quest_id) != m_QuestStatus.end();
}
-Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const* quest)
+Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const* quest) const
{
QuestRelationBounds objectQR;
@@ -14459,7 +14473,7 @@ Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const* quest)
if (pGameObject)
objectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry());
else
- return NULL;
+ return nullptr;
}
uint32 nextQuestID = quest->GetNextQuestInChain();
@@ -14469,7 +14483,7 @@ Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const* quest)
return sObjectMgr->GetQuestTemplate(nextQuestID);
}
- return NULL;
+ return nullptr;
}
bool Player::CanSeeStartQuest(Quest const* quest)
@@ -14499,7 +14513,7 @@ bool Player::CanTakeQuest(Quest const* quest, bool msg)
&& SatisfyQuestConditions(quest, msg);
}
-bool Player::CanAddQuest(Quest const* quest, bool msg)
+bool Player::CanAddQuest(Quest const* quest, bool msg) const
{
if (!SatisfyQuestLog(msg))
return false;
@@ -14514,9 +14528,9 @@ bool Player::CanAddQuest(Quest const* quest, bool msg)
// player already have max number (in most case 1) source item, no additional item needed and quest can be added.
if (msg2 == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS)
return true;
- else if (msg2 != EQUIP_ERR_OK)
+ if (msg2 != EQUIP_ERR_OK)
{
- SendEquipError(msg2, NULL, NULL, srcitem);
+ SendEquipError(msg2, nullptr, nullptr, srcitem);
return false;
}
}
@@ -14635,7 +14649,7 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg)
GetItemCount(quest->RequiredItemId[i]) < quest->RequiredItemCount[i])
{
if (msg)
- SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL, quest->RequiredItemId[i]);
+ SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr, quest->RequiredItemId[i]);
return false;
}
}
@@ -14667,7 +14681,7 @@ void Player::AddQuestAndCheckCompletion(Quest const* quest, Object* questGiver)
case TYPEID_ITEM:
case TYPEID_CONTAINER:
{
- Item* item = (Item*)questGiver;
+ Item* item = static_cast<Item*>(questGiver);
sScriptMgr->OnQuestAccept(this, item, quest);
// destroy not required for quest finish quest starting item
@@ -14709,7 +14723,7 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardChoiceItemId[reward], quest->RewardChoiceItemCount[reward]);
if (res != EQUIP_ERR_OK)
{
- SendEquipError(res, NULL, NULL, quest->RewardChoiceItemId[reward]);
+ SendEquipError(res, nullptr, nullptr, quest->RewardChoiceItemId[reward]);
return false;
}
}
@@ -14724,7 +14738,7 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardItemId[i], quest->RewardItemIdCount[i]);
if (res != EQUIP_ERR_OK)
{
- SendEquipError(res, NULL, NULL, quest->RewardItemId[i]);
+ SendEquipError(res, nullptr, nullptr, quest->RewardItemId[i]);
return false;
}
}
@@ -14787,7 +14801,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver)
AddTimedQuest(quest_id);
questStatusData.Timer = timeAllowed * IN_MILLISECONDS;
- qtime = static_cast<uint32>(time(NULL)) + timeAllowed;
+ qtime = static_cast<uint32>(time(nullptr)) + timeAllowed;
}
else
questStatusData.Timer = 0;
@@ -14804,7 +14818,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver)
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, quest_id);
- SendQuestUpdate(quest_id);
+ SendQuestUpdate();
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
{
@@ -14831,17 +14845,13 @@ void Player::CompleteQuest(uint32 quest_id)
SetQuestSlotState(log_slot, QUEST_STATE_COMPLETE);
if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id))
- {
if (qInfo->HasFlag(QUEST_FLAGS_TRACKING))
RewardQuest(qInfo, 0, this, false);
- else
- SendQuestComplete(quest_id);
- }
}
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
{
- // prepare Quest Tracker datas
+ // prepare Quest Tracker data
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_COMPLETE_TIME);
stmt->setUInt32(0, quest_id);
stmt->setUInt32(1, GetGUID().GetCounter());
@@ -14872,15 +14882,23 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
uint32 quest_id = quest->GetQuestId();
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
- if (quest->RequiredItemId[i])
- DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true);
-
+ {
+ if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i]))
+ {
+ if (quest->RequiredItemCount[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
+ DestroyItemCount(quest->RequiredItemId[i], 9999, true, true);
+ else
+ DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true, true);
+ }
+ }
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
{
- if (quest->ItemDrop[i])
+ if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
{
- uint32 count = quest->ItemDropQuantity[i];
- DestroyItemCount(quest->ItemDrop[i], count ? count : 9999, true);
+ if (quest->ItemDropQuantity[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
+ DestroyItemCount(quest->ItemDrop[i], 9999, true, true);
+ else
+ DestroyItemCount(quest->ItemDrop[i], quest->ItemDropQuantity[i], true, true);
}
}
@@ -14935,7 +14953,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
int32 moneyRew = 0;
if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
- GiveXP(XP, NULL);
+ GiveXP(XP, nullptr);
else
moneyRew = int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY));
@@ -14953,7 +14971,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
// honor reward
if (uint32 honor = quest->CalculateHonorGain(getLevel()))
- RewardHonor(NULL, 0, honor);
+ RewardHonor(nullptr, 0, honor);
// title reward
if (quest->GetCharTitleId())
@@ -14976,7 +14994,10 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
{
/// @todo Poor design of mail system
SQLTransaction trans = CharacterDatabase.BeginTransaction();
- MailDraft(mail_template_id).SendMailTo(trans, this, questGiver, MAIL_CHECK_MASK_HAS_BODY, quest->GetRewMailDelaySecs());
+ if (uint32 questMailSender = quest->GetRewMailSenderEntry())
+ MailDraft(mail_template_id).SendMailTo(trans, this, questMailSender, MAIL_CHECK_MASK_HAS_BODY, quest->GetRewMailDelaySecs());
+ else
+ MailDraft(mail_template_id).SendMailTo(trans, this, questGiver, MAIL_CHECK_MASK_HAS_BODY, quest->GetRewMailDelaySecs());
CharacterDatabase.CommitTransaction(trans);
}
@@ -14997,13 +15018,16 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
SetSeasonalQuestStatus(quest_id);
RemoveActiveQuest(quest_id, false);
- m_RewardedQuests.insert(quest_id);
- m_RewardedQuestsSave[quest_id] = QUEST_DEFAULT_SAVE_TYPE;
+ if (quest->CanIncreaseRewardedQuestCounters())
+ {
+ m_RewardedQuests.insert(quest_id);
+ m_RewardedQuestsSave[quest_id] = QUEST_DEFAULT_SAVE_TYPE;
+ }
// StoreNewItem, mail reward, etc. save data directly to the database
// to prevent exploitable data desynchronisation we save the quest status to the database too
// (to prevent rewarding this quest another time while rewards were already given out)
- SQLTransaction trans = SQLTransaction(NULL);
+ SQLTransaction trans = SQLTransaction(nullptr);
_SaveQuestStatus(trans);
if (announce)
@@ -15044,7 +15068,9 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
UpdatePvPState();
}
- SendQuestUpdate(quest_id);
+ SendQuestUpdate();
+
+ SendQuestGiverStatusMultiple();
//lets remove flag for delayed teleports
SetCanDelayTeleport(false);
@@ -15082,14 +15108,32 @@ void Player::FailQuest(uint32 questId)
SendQuestFailed(questId);
// Destroy quest items on quest failure.
- for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- if (quest->RequiredItemId[i] > 0 && quest->RequiredItemCount[i] > 0)
- // Destroy items received on starting the quest.
- DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true, true);
+ for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
+ if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i]))
+ if (quest->RequiredItemCount[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
+ DestroyItemCount(quest->RequiredItemId[i], 9999, true, true);
+
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
- if (quest->ItemDrop[i] > 0 && quest->ItemDropQuantity[i] > 0)
- // Destroy items received during the quest.
- DestroyItemCount(quest->ItemDrop[i], quest->ItemDropQuantity[i], true, true);
+ if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
+ if (quest->ItemDropQuantity[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
+ DestroyItemCount(quest->ItemDrop[i], 9999, true, true);
+ }
+}
+
+void Player::AbandonQuest(uint32 questId)
+{
+ if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
+ {
+ // Destroy quest items on quest abandon.
+ for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
+ if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i]))
+ if (quest->RequiredItemCount[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
+ DestroyItemCount(quest->RequiredItemId[i], 9999, true, true);
+
+ for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
+ if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
+ if (quest->ItemDropQuantity[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
+ DestroyItemCount(quest->ItemDrop[i], 9999, true, true);
}
}
@@ -15107,7 +15151,8 @@ bool Player::SatisfyQuestSkill(Quest const* qInfo, bool msg) const
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestSkill: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player does not have required skill value.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestSkill: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) doesn't have the required skill value.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
@@ -15116,30 +15161,33 @@ bool Player::SatisfyQuestSkill(Quest const* qInfo, bool msg) const
return true;
}
-bool Player::SatisfyQuestLevel(Quest const* qInfo, bool msg)
+bool Player::SatisfyQuestLevel(Quest const* qInfo, bool msg) const
{
if (getLevel() < qInfo->GetMinLevel())
{
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_QUEST_FAILED_LOW_LEVEL);
- TC_LOG_DEBUG("misc", "SatisfyQuestLevel: Sent INVALIDREASON_QUEST_FAILED_LOW_LEVEL (questId: %u) because player does not have required (min) level.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestLevel: Sent INVALIDREASON_QUEST_FAILED_LOW_LEVEL (QuestID: %u) because player '%s' (%s) doesn't have the required (min) level.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
}
- else if (qInfo->GetMaxLevel() > 0 && getLevel() > qInfo->GetMaxLevel())
+
+ if (qInfo->GetMaxLevel() > 0 && getLevel() > qInfo->GetMaxLevel())
{
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); // There doesn't seem to be a specific response for too high player level
- TC_LOG_DEBUG("misc", "SatisfyQuestLevel: Sent INVALIDREASON_QUEST_FAILED_LOW_LEVEL (questId: %u) because player does not have required (max) level.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestLevel: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) doesn't have the required (max) level.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
}
return true;
}
-bool Player::SatisfyQuestLog(bool msg)
+bool Player::SatisfyQuestLog(bool msg) const
{
// exist free slot
if (FindQuestSlot(0) < MAX_QUEST_LOG_SIZE)
@@ -15149,7 +15197,6 @@ bool Player::SatisfyQuestLog(bool msg)
{
WorldPacket data(SMSG_QUESTLOG_FULL, 0);
GetSession()->SendPacket(&data);
- TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTLOG_FULL");
}
return false;
}
@@ -15193,7 +15240,8 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestPreviousQuest: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player does not have required quest (1).", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestPreviousQuest: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) doesn't have the required quest (1).",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
}
@@ -15226,7 +15274,8 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestPreviousQuest: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player does not have required quest (2).", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestPreviousQuest: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) doesn't have the required quest (2).",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
@@ -15242,7 +15291,8 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestPreviousQuest: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player does not have required quest (3).", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestPreviousQuest: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) doesn't have required quest (3).",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
@@ -15260,7 +15310,8 @@ bool Player::SatisfyQuestClass(Quest const* qInfo, bool msg) const
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestClass: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player does not have required class.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestClass: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) doesn't have required class.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
@@ -15269,7 +15320,7 @@ bool Player::SatisfyQuestClass(Quest const* qInfo, bool msg) const
return true;
}
-bool Player::SatisfyQuestRace(Quest const* qInfo, bool msg)
+bool Player::SatisfyQuestRace(Quest const* qInfo, bool msg) const
{
uint32 reqraces = qInfo->GetAllowableRaces();
if (reqraces == 0)
@@ -15279,7 +15330,8 @@ bool Player::SatisfyQuestRace(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_QUEST_FAILED_WRONG_RACE);
- TC_LOG_DEBUG("misc", "SatisfyQuestRace: Sent INVALIDREASON_QUEST_FAILED_WRONG_RACE (questId: %u) because player does not have required race.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestRace: Sent INVALIDREASON_QUEST_FAILED_WRONG_RACE (QuestID: %u) because player '%s' (%s) doesn't have required race.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
@@ -15295,7 +15347,8 @@ bool Player::SatisfyQuestReputation(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestReputation: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player does not have required reputation (min).", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestReputation: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) doesn't required reputation (min).",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
}
@@ -15306,7 +15359,8 @@ bool Player::SatisfyQuestReputation(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestReputation: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player does not have required reputation (max).", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "SatisfyQuestReputation: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) doesn't required reputation (max).",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
}
@@ -15319,7 +15373,7 @@ bool Player::SatisfyQuestReputation(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestReputation: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player does not have required reputation (ReputationObjective2).", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "SatisfyQuestReputation: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player does not have the required reputation (ReputationObjective2).", qInfo->GetQuestId());
}
return false;
}
@@ -15327,14 +15381,15 @@ bool Player::SatisfyQuestReputation(Quest const* qInfo, bool msg)
return true;
}
-bool Player::SatisfyQuestStatus(Quest const* qInfo, bool msg)
+bool Player::SatisfyQuestStatus(Quest const* qInfo, bool msg) const
{
if (GetQuestStatus(qInfo->GetQuestId()) != QUEST_STATUS_NONE)
{
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_QUEST_ALREADY_ON);
- TC_LOG_DEBUG("misc", "SatisfyQuestStatus: Sent INVALIDREASON_QUEST_ALREADY_ON (questId: %u) because player quest status is not NONE.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestStatus: Sent INVALIDREASON_QUEST_ALREADY_ON (QuestID: %u) because player '%s' (%s) quest status is not NONE.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
}
@@ -15348,7 +15403,8 @@ bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestConditions: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player does not meet conditions.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestConditions: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) doesn't meet conditions.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
TC_LOG_DEBUG("condition", "Player::SatisfyQuestConditions: conditions not met for quest %u", qInfo->GetQuestId());
return false;
@@ -15356,14 +15412,15 @@ bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg)
return true;
}
-bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg)
+bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg) const
{
if (!m_timedquests.empty() && qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED))
{
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_QUEST_ONLY_ONE_TIMED);
- TC_LOG_DEBUG("misc", "SatisfyQuestTimed: Sent INVALIDREASON_QUEST_ONLY_ONE_TIMED (questId: %u) because player is already on a timed quest.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestTimed: Sent INVALIDREASON_QUEST_ONLY_ONE_TIMED (QuestID: %u) because player '%s' (%s) is already on a timed quest.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
}
@@ -15394,7 +15451,8 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestExclusiveGroup: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player already did daily quests in exclusive group.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestExclusiveGroup: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) already did daily quests in exclusive group.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
@@ -15406,7 +15464,8 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestExclusiveGroup: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player already did quest in exclusive group.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestExclusiveGroup: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) already did quest in exclusive group.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
}
@@ -15414,7 +15473,7 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg)
return true;
}
-bool Player::SatisfyQuestNextChain(Quest const* qInfo, bool msg)
+bool Player::SatisfyQuestNextChain(Quest const* qInfo, bool msg) const
{
uint32 nextQuest = qInfo->GetNextQuestInChain();
if (!nextQuest)
@@ -15426,7 +15485,8 @@ bool Player::SatisfyQuestNextChain(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestNextChain: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player already did or started next quest in chain.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestNextChain: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) already did or started next quest in chain.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
}
@@ -15453,7 +15513,8 @@ bool Player::SatisfyQuestPrevChain(Quest const* qInfo, bool msg)
if (msg)
{
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
- TC_LOG_DEBUG("misc", "SatisfyQuestNextChain: Sent INVALIDREASON_DONT_HAVE_REQ (questId: %u) because player already did or started next quest in chain.", qInfo->GetQuestId());
+ TC_LOG_DEBUG("misc", "Player::SatisfyQuestNextChain: Sent INVALIDREASON_DONT_HAVE_REQ (QuestID: %u) because player '%s' (%s) already did or started next quest in chain.",
+ qInfo->GetQuestId(), GetName().c_str(), GetGUID().ToString().c_str());
}
return false;
}
@@ -15468,14 +15529,14 @@ bool Player::SatisfyQuestPrevChain(Quest const* qInfo, bool msg)
return true;
}
-bool Player::SatisfyQuestDay(Quest const* qInfo, bool msg)
+bool Player::SatisfyQuestDay(Quest const* qInfo, bool msg) const
{
if (!qInfo->IsDaily() && !qInfo->IsDFQuest())
return true;
if (qInfo->IsDFQuest())
{
- if (!m_DFQuests.empty())
+ if (m_DFQuests.find(qInfo->GetQuestId()) != m_DFQuests.end())
return false;
return true;
@@ -15556,8 +15617,8 @@ bool Player::GiveQuestSourceItem(Quest const* quest)
// player already have max amount required item, just report success
else if (msg == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS)
return true;
- else
- SendEquipError(msg, NULL, NULL, srcitem);
+
+ SendEquipError(msg, nullptr, nullptr, srcitem);
return false;
}
@@ -15586,7 +15647,7 @@ bool Player::TakeQuestSourceItem(uint32 questId, bool msg)
if (res != EQUIP_ERR_OK)
{
if (msg)
- SendEquipError(res, NULL, NULL, srcItemId);
+ SendEquipError(res, nullptr, nullptr, srcItemId);
return false;
}
@@ -15662,14 +15723,16 @@ bool Player::CanShareQuest(uint32 quest_id) const
void Player::SetQuestStatus(uint32 questId, QuestStatus status, bool update /*= true*/)
{
- if (sObjectMgr->GetQuestTemplate(questId))
+ if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
{
m_QuestStatus[questId].Status = status;
- m_QuestStatusSave[questId] = QUEST_DEFAULT_SAVE_TYPE;
+
+ if (!quest->IsAutoComplete())
+ m_QuestStatusSave[questId] = QUEST_DEFAULT_SAVE_TYPE;
}
if (update)
- SendQuestUpdate(questId);
+ SendQuestUpdate();
sScriptMgr->OnQuestStatusChange(this, questId, status);
}
@@ -15684,7 +15747,7 @@ void Player::RemoveActiveQuest(uint32 questId, bool update /*= true*/)
}
if (update)
- SendQuestUpdate(questId);
+ SendQuestUpdate();
}
void Player::RemoveRewardedQuest(uint32 questId, bool update /*= true*/)
@@ -15697,33 +15760,26 @@ void Player::RemoveRewardedQuest(uint32 questId, bool update /*= true*/)
}
if (update)
- SendQuestUpdate(questId);
+ SendQuestUpdate();
}
-void Player::SendQuestUpdate(uint32 questId)
+void Player::SendQuestUpdate()
{
uint32 zone = 0, area = 0;
+ GetZoneAndAreaId(zone, area);
- SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(questId);
- if (saBounds.first != saBounds.second)
- {
- GetZoneAndAreaId(zone, area);
+ SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForAreaMapBounds(area);
- for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
- if (itr->second->autocast && itr->second->IsFitToRequirements(this, zone, area))
- if (!HasAura(itr->second->spellId))
- CastSpell(this, itr->second->spellId, true);
- }
-
- saBounds = sSpellMgr->GetSpellAreaForQuestEndMapBounds(questId);
if (saBounds.first != saBounds.second)
{
- if (!zone || !area)
- GetZoneAndAreaId(zone, area);
-
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
+ {
if (!itr->second->IsFitToRequirements(this, zone, area))
RemoveAurasDueToSpell(itr->second->spellId);
+ else if (itr->second->autocast)
+ if (!HasAura(itr->second->spellId))
+ CastSpell(this, itr->second->spellId, true);
+ }
}
UpdateForQuestWorldObjects();
@@ -15832,15 +15888,17 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver)
}
// not used in Trinity, but used in scripting code
-uint16 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry)
+uint16 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry) const
{
Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id);
if (!qInfo)
return 0;
- for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
- if (qInfo->RequiredNpcOrGo[j] == entry)
- return m_QuestStatus[quest_id].CreatureOrGOCount[j];
+ auto itr = m_QuestStatus.find(quest_id);
+ if (itr != m_QuestStatus.end())
+ for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
+ if (qInfo->RequiredNpcOrGo[j] == entry)
+ return itr->second.CreatureOrGOCount[j];
return 0;
}
@@ -15963,7 +16021,7 @@ void Player::GroupEventHappens(uint32 questId, WorldObject const* pEventObject)
{
if (Group* group = GetGroup())
{
- for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* player = itr->GetSource();
@@ -16073,7 +16131,7 @@ void Player::KilledMonsterCredit(uint32 entry, ObjectGuid guid /*= ObjectGuid::E
{
uint16 addkillcount = 1;
uint32 real_entry = entry;
- Creature* killed = NULL;
+ Creature* killed = nullptr;
if (guid)
{
killed = GetMap()->GetCreature(guid);
@@ -16426,21 +16484,19 @@ bool Player::HasQuestForItem(uint32 itemid) const
return false;
}
-void Player::SendQuestComplete(uint32 quest_id)
+void Player::SendQuestComplete(uint32 quest_id) const
{
if (quest_id)
{
WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4);
data << uint32(quest_id);
GetSession()->SendPacket(&data);
- TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id);
}
}
-void Player::SendQuestReward(Quest const* quest, uint32 XP)
+void Player::SendQuestReward(Quest const* quest, uint32 XP) const
{
uint32 questid = quest->GetQuestId();
- TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid);
sGameEventMgr->HandleQuestComplete(questid);
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
data << uint32(questid);
@@ -16462,7 +16518,7 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP)
GetSession()->SendPacket(&data);
}
-void Player::SendQuestFailed(uint32 questId, InventoryResult reason)
+void Player::SendQuestFailed(uint32 questId, InventoryResult reason) const
{
if (questId)
{
@@ -16470,11 +16526,10 @@ void Player::SendQuestFailed(uint32 questId, InventoryResult reason)
data << uint32(questId);
data << uint32(reason); // failed reason (valid reasons: 4, 16, 50, 17, 74, other values show default message)
GetSession()->SendPacket(&data);
- TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED");
}
}
-void Player::SendQuestTimerFailed(uint32 quest_id)
+void Player::SendQuestTimerFailed(uint32 quest_id) const
{
if (quest_id)
{
@@ -16493,7 +16548,7 @@ void Player::SendCanTakeQuestResponse(QuestFailedReason msg) const
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID");
}
-void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver)
+void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver) const
{
if (pReceiver)
{
@@ -16514,7 +16569,7 @@ void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver)
}
}
-void Player::SendPushToPartyResponse(Player* player, uint8 msg)
+void Player::SendPushToPartyResponse(Player* player, uint8 msg) const
{
if (player)
{
@@ -16526,7 +16581,7 @@ void Player::SendPushToPartyResponse(Player* player, uint8 msg)
}
}
-void Player::SendQuestUpdateAddItem(Quest const* /*quest*/, uint32 /*item_idx*/, uint16 /*count*/)
+void Player::SendQuestUpdateAddItem(Quest const* /*quest*/, uint32 /*item_idx*/, uint16 /*count*/) const
{
WorldPacket data(SMSG_QUESTUPDATE_ADD_ITEM, 0);
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM");
@@ -16563,7 +16618,6 @@ void Player::SendQuestUpdateAddPlayer(Quest const* quest, uint16 old_count, uint
ASSERT(old_count + add_count < 65536 && "player count store in 16 bits");
WorldPacket data(SMSG_QUESTUPDATE_ADD_PVP_KILL, (3*4));
- TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTUPDATE_ADD_PVP_KILL");
data << uint32(quest->GetQuestId());
data << uint32(old_count + add_count);
data << uint32(quest->GetPlayersSlain());
@@ -16574,6 +16628,50 @@ void Player::SendQuestUpdateAddPlayer(Quest const* quest, uint16 old_count, uint
SetQuestSlotCounter(log_slot, QUEST_PVP_KILL_SLOT, GetQuestSlotCounter(log_slot, QUEST_PVP_KILL_SLOT) + add_count);
}
+void Player::SendQuestGiverStatusMultiple()
+{
+ uint32 count = 0;
+
+ WorldPacket data(SMSG_QUESTGIVER_STATUS_MULTIPLE, 4);
+ data << uint32(count); // placeholder
+
+ for (auto itr = m_clientGUIDs.begin(); itr != m_clientGUIDs.end(); ++itr)
+ {
+ uint32 questStatus = DIALOG_STATUS_NONE;
+
+ if (itr->IsAnyTypeCreature())
+ {
+ // need also pet quests case support
+ Creature* questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, *itr);
+ if (!questgiver || questgiver->IsHostileTo(this))
+ continue;
+ if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
+ continue;
+
+ questStatus = GetQuestDialogStatus(questgiver);
+
+ data << uint64(questgiver->GetGUID());
+ data << uint8(questStatus);
+ ++count;
+ }
+ else if (itr->IsGameObject())
+ {
+ GameObject* questgiver = GetMap()->GetGameObject(*itr);
+ if (!questgiver || questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
+ continue;
+
+ questStatus = GetQuestDialogStatus(questgiver);
+
+ data << uint64(questgiver->GetGUID());
+ data << uint8(questStatus);
+ ++count;
+ }
+ }
+
+ data.put<uint32>(0, count); // write real count
+ GetSession()->SendPacket(&data);
+}
+
bool Player::HasPvPForcingQuest() const
{
for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
@@ -16771,22 +16869,22 @@ bool Player::IsLoading() const
bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
{
- //// 0 1 2 3 4 5 6 7 8 9 10 11
- //QueryResult* result = CharacterDatabase.PQuery("SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, "
- // 12 13 14 15 16 17 18 19 20 21 22 23 24
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+ //QueryResult* result = CharacterDatabase.PQuery("SELECT guid, account, name, race, class, gender, level, xp, money, skin, face, hairStyle, hairColor, facialStyle, bankSlots, restState, playerFlags, "
+ // 17 18 19 20 21 22 23 24 25 26 27 28 29
//"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, "
- // 25 26 27 28 29 30 31 32 33 34 35 36 37 38
+ // 30 31 32 33 34 35 36 37 38 39 40 41 42 43
//"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, "
- // 39 40 41 42 43 44 45 46 47 48 49
+ // 44 45 46 47 48 49 50 51 52 53 54
//"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, "
- // 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
+ // 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
//"health, power1, power2, power3, power4, power5, power6, power7, instance_id, talentGroupsCount, activeTalentGroup, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = '%u'", guid);
PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_FROM);
if (!result)
{
std::string name = "<unknown>";
sObjectMgr->GetPlayerNameByGUID(guid, name);
- TC_LOG_ERROR("entities.player", "Player %s %s not found in table `characters`, can't load. ", name.c_str(), guid.ToString().c_str());
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player '%s' (%s) not found in table `characters`, can't load. ", name.c_str(), guid.ToString().c_str());
return false;
}
@@ -16798,13 +16896,13 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
// player should be able to load/delete character only with correct account!
if (dbAccountId != GetSession()->GetAccountId())
{
- TC_LOG_ERROR("entities.player", "Player %s loading from wrong account (is: %u, should be: %u)", guid.ToString().c_str(), GetSession()->GetAccountId(), dbAccountId);
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) loading from wrong account (is: %u, should be: %u)", guid.ToString().c_str(), GetSession()->GetAccountId(), dbAccountId);
return false;
}
if (holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_BANNED))
{
- TC_LOG_ERROR("entities.player", "%s is banned, can't load.", guid.ToString().c_str());
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) is banned, can't load.", guid.ToString().c_str());
return false;
}
@@ -16814,8 +16912,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
// check name limitations
if (ObjectMgr::CheckPlayerName(m_name, GetSession()->GetSessionDbcLocale()) != CHAR_NAME_SUCCESS ||
- (!GetSession()->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RESERVEDNAME) &&
- sObjectMgr->IsReservedName(m_name)))
+ (!GetSession()->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RESERVEDNAME) && sObjectMgr->IsReservedName(m_name)))
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
@@ -16830,30 +16927,27 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
uint8 gender = fields[5].GetUInt8();
if (!IsValidGender(gender))
{
- TC_LOG_ERROR("entities.player", "Player %s has wrong gender (%u), can't be loaded.", guid.ToString().c_str(), gender);
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has wrong gender (%u), can't load.", guid.ToString().c_str(), gender);
return false;
}
- // overwrite some data fields
- uint32 bytes0 = 0;
- bytes0 |= fields[3].GetUInt8(); // race
- bytes0 |= fields[4].GetUInt8() << 8; // class
- bytes0 |= gender << 16; // gender
- SetUInt32Value(UNIT_FIELD_BYTES_0, bytes0);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_RACE, fields[3].GetUInt8());
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, fields[4].GetUInt8());
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, gender);
// check if race/class combination is valid
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
if (!info)
{
- TC_LOG_ERROR("entities.player", "Player %s has wrong race/class (%u/%u), can't be loaded.", guid.ToString().c_str(), getRace(), getClass());
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has wrong race/class (%u/%u), can't load.", guid.ToString().c_str(), getRace(), getClass());
return false;
}
SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8());
SetUInt32Value(PLAYER_XP, fields[7].GetUInt32());
- _LoadIntoDataField(fields[61].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
- _LoadIntoDataField(fields[64].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);
+ _LoadIntoDataField(fields[66].GetString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
+ _LoadIntoDataField(fields[69].GetString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE * 2);
SetObjectScale(1.0f);
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
@@ -16866,47 +16960,53 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
money = MAX_MONEY_AMOUNT;
SetMoney(money);
- SetUInt32Value(PLAYER_BYTES, fields[9].GetUInt32());
- SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32());
- SetByteValue(PLAYER_BYTES_3, 0, fields[5].GetUInt8());
- SetByteValue(PLAYER_BYTES_3, 1, fields[49].GetUInt8());
+ SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID, fields[9].GetUInt8());
+ SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID, fields[10].GetUInt8());
+ SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID, fields[11].GetUInt8());
+ SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID, fields[12].GetUInt8());
+ SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, fields[13].GetUInt8());
+ SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS, fields[14].GetUInt8());
+ SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, fields[15].GetUInt8());
+ SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER, fields[5].GetUInt8());
+ SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_INEBRIATION, fields[54].GetUInt8());
if (!ValidateAppearance(
fields[3].GetUInt8(), // race
fields[4].GetUInt8(), // class
- gender, GetByteValue(PLAYER_BYTES, 2), // hair type
- GetByteValue(PLAYER_BYTES, 3), //hair color
- uint8(fields[9].GetUInt32() >> 8), // face
- GetByteValue(PLAYER_BYTES_2, 0), // facial hair
- GetByteValue(PLAYER_BYTES, 0))) // skin color
- {
- TC_LOG_ERROR("entities.player", "Player %s has wrong Appearance values (Hair/Skin/Color), can't be loaded.", guid.ToString().c_str());
+ gender,
+ GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID),
+ GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID),
+ GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID),
+ GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE),
+ GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID)))
+ {
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has wrong Appearance values (Hair/Skin/Color), can't load.", guid.ToString().c_str());
return false;
}
- SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32());
- SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[48].GetUInt32());
+ SetUInt32Value(PLAYER_FLAGS, fields[16].GetUInt32());
+ SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[53].GetUInt32());
- SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[47].GetUInt64());
+ SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[52].GetUInt64());
- SetUInt32Value(PLAYER_AMMO_ID, fields[63].GetUInt32());
+ SetUInt32Value(PLAYER_AMMO_ID, fields[68].GetUInt32());
// set which actionbars the client has active - DO NOT REMOVE EVER AGAIN (can be changed though, if it does change fieldwise)
- SetByteValue(PLAYER_FIELD_BYTES, 2, fields[65].GetUInt8());
+ SetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BAR_TOGGLES, fields[70].GetUInt8());
InitDisplayIds();
- // cleanup inventory related item value fields (its will be filled correctly in _LoadInventory)
+ // cleanup inventory related item value fields (it will be filled correctly in _LoadInventory)
for (uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot)
{
SetGuidValue(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), ObjectGuid::Empty);
- SetVisibleItemSlot(slot, NULL);
+ SetVisibleItemSlot(slot, nullptr);
delete m_items[slot];
- m_items[slot] = NULL;
+ m_items[slot] = nullptr;
}
- TC_LOG_DEBUG("entities.player.loading", "Load Basic value of player %s is: ", m_name.c_str());
+ TC_LOG_DEBUG("entities.player.loading", "Player::LoadFromDB: Load Basic value of player '%s' is: ", m_name.c_str());
outDebugValues();
//Need to call it to initialize m_team (m_team can be calculated from race)
@@ -16920,21 +17020,21 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
InitPrimaryProfessions(); // to max set before any spell loaded
// init saved position, and fix it later if problematic
- ObjectGuid::LowType transLowGUID = fields[30].GetUInt32();
- Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat());
- uint32 mapId = fields[15].GetUInt16();
- uint32 instanceId = fields[58].GetUInt32();
+ ObjectGuid::LowType transLowGUID = fields[35].GetUInt32();
+ Relocate(fields[17].GetFloat(), fields[18].GetFloat(), fields[19].GetFloat(), fields[21].GetFloat());
+ uint32 mapId = fields[20].GetUInt16();
+ uint32 instanceId = fields[63].GetUInt32();
- uint32 dungeonDiff = fields[38].GetUInt8() & 0x0F;
+ uint32 dungeonDiff = fields[43].GetUInt8() & 0x0F;
if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY)
dungeonDiff = DUNGEON_DIFFICULTY_NORMAL;
- uint32 raidDiff = (fields[38].GetUInt8() >> 4) & 0x0F;
+ uint32 raidDiff = (fields[43].GetUInt8() >> 4) & 0x0F;
if (raidDiff >= MAX_RAID_DIFFICULTY)
raidDiff = RAID_DIFFICULTY_10MAN_NORMAL;
SetDungeonDifficulty(Difficulty(dungeonDiff)); // may be changed in _LoadGroup
SetRaidDifficulty(Difficulty(raidDiff)); // may be changed in _LoadGroup
- std::string taxi_nodes = fields[37].GetString();
+ std::string taxi_nodes = fields[42].GetString();
#define RelocateToHomebind(){ mapId = m_homebindMapId; instanceId = 0; Relocate(m_homebindX, m_homebindY, m_homebindZ); }
@@ -16942,7 +17042,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
_LoadArenaTeamInfo(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_ARENA_INFO));
- SetArenaPoints(fields[39].GetUInt32());
+ SetArenaPoints(fields[44].GetUInt32());
// check arena teams integrity
for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot)
@@ -16960,12 +17060,12 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
SetArenaTeamInfoField(arena_slot, ArenaTeamInfoType(j), 0);
}
- SetHonorPoints(fields[40].GetUInt32());
- SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, fields[41].GetUInt32());
- SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, fields[42].GetUInt32());
- SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[43].GetUInt32());
- SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[44].GetUInt16());
- SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[45].GetUInt16());
+ SetHonorPoints(fields[45].GetUInt32());
+ SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, fields[46].GetUInt32());
+ SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, fields[47].GetUInt32());
+ SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[48].GetUInt32());
+ SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[49].GetUInt16());
+ SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[50].GetUInt16());
_LoadBoundInstances(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_BOUND_INSTANCES));
_LoadInstanceTimeRestrictions(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_INSTANCE_LOCK_TIMES));
@@ -16975,14 +17075,14 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
if (!mapEntry || !IsPositionValid())
{
- TC_LOG_ERROR("entities.player", "Player %s have invalid coordinates (MapId: %u X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has invalid coordinates (MapId: %u X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",
guid.ToString().c_str(), mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
RelocateToHomebind();
}
// Player was saved in Arena or Bg
else if (mapEntry && mapEntry->IsBattlegroundOrArena())
{
- Battleground* currentBg = NULL;
+ Battleground* currentBg = nullptr;
if (m_bgData.bgInstanceID) //saved in Battleground
currentBg = sBattlegroundMgr->GetBattleground(m_bgData.bgInstanceID, BATTLEGROUND_TYPE_NONE);
@@ -17016,7 +17116,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
//if (mapId == MAPID_INVALID) -- code kept for reference
if (int16(mapId) == int16(-1)) // Battleground Entry Point not found (???)
{
- TC_LOG_ERROR("entities.player", "Player %s was in BG in database, but BG was not found, and entry point was invalid! Teleport to default race/class locations.",
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) was in BG in database, but BG was not found and entry point was invalid! Teleport to default race/class locations.",
guid.ToString().c_str());
RelocateToHomebind();
}
@@ -17032,13 +17132,13 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
{
ObjectGuid transGUID(HighGuid::Mo_Transport, transLowGUID);
- Transport* transport = NULL;
+ Transport* transport = nullptr;
if (Transport* go = HashMapHolder<Transport>::Find(transGUID))
transport = go;
if (transport)
{
- float x = fields[26].GetFloat(), y = fields[27].GetFloat(), z = fields[28].GetFloat(), o = fields[29].GetFloat();
+ float x = fields[31].GetFloat(), y = fields[32].GetFloat(), z = fields[33].GetFloat(), o = fields[34].GetFloat();
m_movementInfo.transport.pos.Relocate(x, y, z, o);
transport->CalculatePassengerPosition(x, y, z, &o);
@@ -17048,7 +17148,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 250.0f ||
std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 250.0f)
{
- TC_LOG_ERROR("entities.player", "Player %s have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to bind location.",
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to bind location.",
guid.ToString().c_str(), x, y, z, o);
m_movementInfo.transport.Reset();
@@ -17065,7 +17165,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
}
else
{
- TC_LOG_ERROR("entities.player", "Player %s have problems with transport guid (%u). Teleport to bind location.",
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has problems with transport guid (%u). Teleport to bind location.",
guid.ToString().c_str(), transLowGUID);
RelocateToHomebind();
@@ -17085,18 +17185,18 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
else if (!m_taxi.LoadTaxiDestinationsFromString(taxi_nodes, GetTeam()))
{
// problems with taxi path loading
- TaxiNodesEntry const* nodeEntry = NULL;
+ TaxiNodesEntry const* nodeEntry = nullptr;
if (uint32 node_id = m_taxi.GetTaxiSource())
nodeEntry = sTaxiNodesStore.LookupEntry(node_id);
- if (!nodeEntry) // don't know taxi start node, to homebind
+ if (!nodeEntry) // don't know taxi start node, teleport to homebind
{
- TC_LOG_ERROR("entities.player", "Character %u have wrong data in taxi destination list, teleport to homebind.", GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has wrong data in taxi destination list, teleport to homebind.", GetGUID().ToString().c_str());
RelocateToHomebind();
}
- else // have start node, to it
+ else // has start node, teleport to it
{
- TC_LOG_ERROR("entities.player", "Character %u have too short taxi destination list, teleport to original node.", GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has too short taxi destination list, teleport to original node.", GetGUID().ToString().c_str());
mapId = nodeEntry->map_id;
Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f);
}
@@ -17125,7 +17225,8 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
{
if (GetSession()->Expansion() < mapEntry->Expansion())
{
- TC_LOG_DEBUG("entities.player.loading", "Player %s using client without required expansion tried login at non accessible map %u", GetName().c_str(), mapId);
+ TC_LOG_DEBUG("entities.player.loading", "Player::LoadFromDB: Player '%s' (%s) using client without required expansion tried login at non accessible map %u",
+ GetName().c_str(), GetGUID().ToString().c_str(), mapId);
RelocateToHomebind();
}
@@ -17139,7 +17240,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
// NOW player must have valid map
// load the player's map here if it's not already loaded
Map* map = sMapMgr->CreateMap(mapId, this, instanceId);
- AreaTrigger const* areaTrigger = NULL;
+ AreaTrigger const* areaTrigger = nullptr;
bool check = false;
if (!map)
@@ -17194,10 +17295,10 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
}
else
{
- TC_LOG_ERROR("entities.player", "Player %s %s Map: %u, X: %f, Y: %f, Z: %f, O: %f. Areatrigger not found.",
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player '%s' (%s) Map: %u, X: %f, Y: %f, Z: %f, O: %f. Areatrigger not found.",
m_name.c_str(), guid.ToString().c_str(), mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
RelocateToHomebind();
- map = NULL;
+ map = nullptr;
}
}
@@ -17208,7 +17309,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
map = sMapMgr->CreateMap(mapId, this);
if (!map)
{
- TC_LOG_ERROR("entities.player", "Player %s %s Map: %u, X: %f, Y: %f, Z: %f, O: %f. Invalid default map coordinates or instance couldn't be created.",
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player '%s' (%s) Map: %u, X: %f, Y: %f, Z: %f, O: %f. Invalid default map coordinates or instance couldn't be created.",
m_name.c_str(), guid.ToString().c_str(), mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
return false;
}
@@ -17223,12 +17324,12 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
// randomize first save time in range [CONFIG_INTERVAL_SAVE] around [CONFIG_INTERVAL_SAVE]
// this must help in case next save after mass player load after server startup
- m_nextSave = urand(m_nextSave/2, m_nextSave*3/2);
+ m_nextSave = urand(m_nextSave / 2, m_nextSave * 3 / 2);
SaveRecallPosition();
- time_t now = time(NULL);
- time_t logoutTime = time_t(fields[22].GetUInt32());
+ time_t now = time(nullptr);
+ time_t logoutTime = time_t(fields[27].GetUInt32());
// since last logout (in seconds)
uint32 time_diff = uint32(now - logoutTime); //uint64 is excessive for a time_diff in seconds.. uint32 allows for 136~ year difference.
@@ -17241,29 +17342,30 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
SetDrunkValue(newDrunkValue);
- m_cinematic = fields[18].GetUInt8();
- m_Played_time[PLAYED_TIME_TOTAL]= fields[19].GetUInt32();
- m_Played_time[PLAYED_TIME_LEVEL]= fields[20].GetUInt32();
+ m_cinematic = fields[23].GetUInt8();
+ m_Played_time[PLAYED_TIME_TOTAL] = fields[24].GetUInt32();
+ m_Played_time[PLAYED_TIME_LEVEL] = fields[25].GetUInt32();
- m_resetTalentsCost = fields[24].GetUInt32();
- m_resetTalentsTime = time_t(fields[25].GetUInt32());
+ m_resetTalentsCost = fields[29].GetUInt32();
+ m_resetTalentsTime = time_t(fields[30].GetUInt32());
- m_taxi.LoadTaxiMask(fields[17].GetString()); // must be before InitTaxiNodesForLevel
+ m_taxi.LoadTaxiMask(fields[22].GetString()); // must be before InitTaxiNodesForLevel
- uint32 extraflags = fields[31].GetUInt16();
+ uint32 extraflags = fields[36].GetUInt16();
- m_stableSlots = fields[32].GetUInt8();
+ m_stableSlots = fields[37].GetUInt8();
if (m_stableSlots > MAX_PET_STABLES)
{
- TC_LOG_ERROR("entities.player", "Player can have not more %u stable slots, but have in DB %u", MAX_PET_STABLES, uint32(m_stableSlots));
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) can't have more stable slots than %u, but has %u in DB",
+ GetGUID().ToString().c_str(), MAX_PET_STABLES, uint32(m_stableSlots));
m_stableSlots = MAX_PET_STABLES;
}
- m_atLoginFlags = fields[33].GetUInt16();
+ m_atLoginFlags = fields[38].GetUInt16();
if (HasAtLoginFlag(AT_LOGIN_RENAME))
{
- TC_LOG_ERROR("entities.player", "Player (GUID: %u) tried to login while forced to rename, can't load.'", GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) tried to login while forced to rename, can't load.'", GetGUID().ToString().c_str());
return false;
}
@@ -17272,7 +17374,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
m_lastHonorUpdateTime = logoutTime;
UpdateHonorFields();
- m_deathExpireTime = time_t(fields[36].GetUInt32());
+ m_deathExpireTime = time_t(fields[41].GetUInt32());
if (m_deathExpireTime > now + MAX_DEATH_COUNT * DEATH_EXPIRE_STEP)
m_deathExpireTime = now + MAX_DEATH_COUNT * DEATH_EXPIRE_STEP - 1;
@@ -17309,7 +17411,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
InitRunes();
// rest bonus can only be calculated after InitStatsForLevel()
- m_rest_bonus = fields[21].GetFloat();
+ m_rest_bonus = fields[26].GetFloat();
if (time_diff > 0)
{
@@ -17317,11 +17419,11 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
float bubble0 = 0.031f;
//speed collect rest bonus in offline, in logout, in tavern, city (section/in hour)
float bubble1 = 0.125f;
- float bubble = fields[23].GetUInt8() > 0
+ float bubble = fields[28].GetUInt8() > 0
? bubble1*sWorld->getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY)
: bubble0*sWorld->getRate(RATE_REST_OFFLINE_IN_WILDERNESS);
- SetRestBonus(GetRestBonus()+ time_diff*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble);
+ SetRestBonus(GetRestBonus() + time_diff*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP) / 72000)*bubble);
}
// load skills after InitStatsForLevel because it triggering aura apply also
@@ -17333,14 +17435,15 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
//mails are loaded only when needed ;-) - when player in game click on mailbox.
//_LoadMail();
- m_specsCount = fields[59].GetUInt8();
- m_activeSpec = fields[60].GetUInt8();
+ m_specsCount = fields[64].GetUInt8();
+ m_activeSpec = fields[65].GetUInt8();
// sanity check
if (m_specsCount > MAX_TALENT_SPECS || m_activeSpec > MAX_TALENT_SPEC || m_specsCount < MIN_TALENT_SPECS)
{
+ TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player %s (%s) has invalid SpecCount = %u and/or invalid ActiveSpec = %u.",
+ GetName().c_str(), GetGUID().ToString().c_str(), uint32(m_specsCount), uint32(m_activeSpec));
m_activeSpec = 0;
- TC_LOG_ERROR("entities.player", "Player %s(GUID: %u) has SpecCount = %u and ActiveSpec = %u.", GetName().c_str(), GetGUID().GetCounter(), m_specsCount, m_activeSpec);
}
_LoadTalents(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_TALENTS));
@@ -17384,7 +17487,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
// check PLAYER_CHOSEN_TITLE compatibility with PLAYER__FIELD_KNOWN_TITLES
// note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded
- uint32 curTitle = fields[46].GetUInt32();
+ uint32 curTitle = fields[51].GetUInt32();
if (curTitle && !HasTitle(curTitle))
curTitle = 0;
@@ -17407,15 +17510,15 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
UpdateAllStats();
// restore remembered power/health values (but not more max values)
- uint32 savedHealth = fields[50].GetUInt32();
+ uint32 savedHealth = fields[55].GetUInt32();
SetHealth(savedHealth > GetMaxHealth() ? GetMaxHealth() : savedHealth);
for (uint8 i = 0; i < MAX_POWERS; ++i)
{
- uint32 savedPower = fields[51+i].GetUInt32();
+ uint32 savedPower = fields[56 + i].GetUInt32();
SetPower(Powers(i), savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower);
}
- TC_LOG_DEBUG("entities.player.loading", "The value of player %s after load item and aura is: ", m_name.c_str());
+ TC_LOG_DEBUG("entities.player.loading", "Player::LoadFromDB: The value of player '%s' after load item and aura is: ", m_name.c_str());
outDebugValues();
// GM state
@@ -17467,12 +17570,12 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
}
// RaF stuff.
- m_grantableLevels = fields[66].GetUInt8();
+ m_grantableLevels = fields[71].GetUInt8();
if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0))
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND);
if (m_grantableLevels > 0)
- SetByteValue(PLAYER_FIELD_BYTES, 1, 0x01);
+ SetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_RAF_GRANTABLE_LEVEL, 0x01);
_LoadDeclinedNames(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_DECLINED_NAMES));
@@ -17494,6 +17597,8 @@ bool Player::isAllowedToLoot(const Creature* creature)
const Loot* loot = &creature->loot;
if (loot->isLooted()) // nothing to loot or everything looted.
return false;
+ if (!loot->hasItemForAll() && !loot->hasItemFor(this)) // no loot in creature for this player
+ return false;
if (loot->loot_type == LOOT_SKINNING)
return creature->GetSkinner() == GetGUID();
@@ -17550,9 +17655,10 @@ void Player::_LoadActions(PreparedQueryResult result)
ab->uState = ACTIONBUTTON_UNCHANGED;
else
{
- TC_LOG_ERROR("entities.player", " ...at loading, and will deleted in DB also");
+ TC_LOG_DEBUG("entities.player", "Player::_LoadActions: Player '%s' (%s) has an invalid action button (Button: %u, Action: %u, Type: %u). It will be deleted at next save. This can be due to a player changing their talents.",
+ GetName().c_str(), GetGUID().ToString().c_str(), button, action, type);
- // Will deleted in DB at next save (it can create data until save but marked as deleted)
+ // Will be deleted in DB at next save (it can create data until save but marked as deleted).
m_actionButtons[button].uState = ACTIONBUTTON_DELETED;
}
} while (result->NextRow());
@@ -17561,7 +17667,7 @@ void Player::_LoadActions(PreparedQueryResult result)
void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
{
- TC_LOG_DEBUG("entities.player.loading", "Loading auras for player %u", GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.player.loading", "Player::_LoadAuras: Loading auras for %s", GetGUID().ToString().c_str());
/* 0 1 2 3 4 5 6 7 8 9 10
QueryResult* result = CharacterDatabase.PQuery("SELECT casterGuid, spell, effectMask, recalculateMask, stackCount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2,
@@ -17594,7 +17700,8 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player", "Unknown aura (spellid %u), ignore.", spellid);
+ TC_LOG_ERROR("entities.player", "Player::_LoadAuras: Player '%s' (%s) has an invalid aura (SpellID: %u), ignoring.",
+ GetName().c_str(), GetGUID().ToString().c_str(), spellid);
continue;
}
@@ -17618,7 +17725,7 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
else
remaincharges = 0;
- if (Aura* aura = Aura::TryCreate(spellInfo, effmask, this, NULL, &baseDamage[0], NULL, caster_guid))
+ if (Aura* aura = Aura::TryCreate(spellInfo, effmask, this, nullptr, &baseDamage[0], nullptr, caster_guid))
{
if (!aura->CanBeSaved())
{
@@ -17628,7 +17735,8 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]);
aura->ApplyForTargets();
- TC_LOG_DEBUG("entities.player", "Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
+ TC_LOG_DEBUG("entities.player", "Player::_LoadAuras: Added aura (SpellID: %u, EffectMask: %u) to player '%s (%s)",
+ spellInfo->Id, effmask, GetName().c_str(), GetGUID().ToString().c_str());
}
}
while (result->NextRow());
@@ -17651,13 +17759,13 @@ void Player::_LoadGlyphAuras()
continue;
}
else
- TC_LOG_ERROR("entities.player", "Player %s has glyph with typeflags %u in slot with typeflags %u, removing.", m_name.c_str(), gp->TypeFlags, gs->TypeFlags);
+ TC_LOG_ERROR("entities.player", "Player::_LoadGlyphAuras: Player '%s' (%s) has glyph with typeflags %u in slot with typeflags %u, removing.", GetName().c_str(), GetGUID().ToString().c_str(), gp->TypeFlags, gs->TypeFlags);
}
else
- TC_LOG_ERROR("entities.player", "Player %s has not existing glyph slot entry %u on index %u", m_name.c_str(), GetGlyphSlot(i), i);
+ TC_LOG_ERROR("entities.player", "Player::_LoadGlyphAuras: Player '%s' (%s) has not existing glyph slot entry %u on index %u", GetName().c_str(), GetGUID().ToString().c_str(), GetGlyphSlot(i), i);
}
else
- TC_LOG_ERROR("entities.player", "Player %s has not existing glyph entry %u on index %u", m_name.c_str(), glyph, i);
+ TC_LOG_ERROR("entities.player", "Player::_LoadGlyphAuras: Player '%s' (%s) has not existing glyph entry %u on index %u", GetName().c_str(), GetGUID().ToString().c_str(), glyph, i);
// On any error remove glyph
SetGlyph(i, 0);
@@ -17676,7 +17784,7 @@ void Player::LoadCorpse(PreparedQueryResult result)
{
Field* fields = result->Fetch();
_corpseLocation.WorldRelocate(fields[0].GetUInt16(), fields[1].GetFloat(), fields[2].GetFloat(), fields[3].GetFloat(), fields[4].GetFloat());
- ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(_corpseLocation.GetMapId())->Instanceable());
+ ApplyModByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_FLAGS, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(_corpseLocation.GetMapId())->Instanceable());
}
else
ResurrectPlayer(0.5f);
@@ -17712,11 +17820,11 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
ObjectGuid::LowType bagGuid = fields[11].GetUInt32();
uint8 slot = fields[12].GetUInt8();
- uint8 err = EQUIP_ERR_OK;
+ InventoryResult err = EQUIP_ERR_OK;
// Item is not in bag
if (!bagGuid)
{
- item->SetContainer(NULL);
+ item->SetContainer(nullptr);
item->SetSlot(slot);
if (IsInventoryPos(INVENTORY_SLOT_BAG_0, slot))
@@ -17773,8 +17881,8 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
}
else
{
- TC_LOG_ERROR("entities.player", "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which doesnt have a valid bag (Bag GUID: %u, slot: %u). Possible cheat?",
- GetGUID().GetCounter(), GetName().c_str(), item->GetGUID().GetCounter(), item->GetEntry(), bagGuid, slot);
+ TC_LOG_ERROR("entities.player", "Player::_LoadInventory: Player '%s' (%s) has item (%s, entry: %u) which doesnt have a valid bag (Bag %u, slot: %u). Possible cheat?",
+ GetName().c_str(), GetGUID().ToString().c_str(), item->GetGUID().ToString().c_str(), item->GetEntry(), bagGuid, slot);
item->DeleteFromInventoryDB(trans);
delete item;
continue;
@@ -17787,8 +17895,8 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
item->SetState(ITEM_UNCHANGED, this);
else
{
- TC_LOG_ERROR("entities.player", "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which can't be loaded into inventory (Bag GUID: %u, slot: %u) by reason %u. Item will be sent by mail.",
- GetGUID().GetCounter(), GetName().c_str(), item->GetGUID().GetCounter(), item->GetEntry(), bagGuid, slot, err);
+ TC_LOG_ERROR("entities.player", "Player::_LoadInventory: Player '%s' (%s) has item (%s, entry: %u) which can't be loaded into inventory (Bag %u, slot: %u) by reason %u. Item will be sent by mail.",
+ GetName().c_str(), GetGUID().ToString().c_str(), item->GetGUID().ToString().c_str(), item->GetEntry(), bagGuid, slot, uint32(err));
item->DeleteFromInventoryDB(trans);
problematicItems.push_back(item);
}
@@ -17818,7 +17926,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields)
{
- Item* item = NULL;
+ Item* item = nullptr;
ObjectGuid::LowType itemGuid = fields[13].GetUInt32();
uint32 itemEntry = fields[14].GetUInt32();
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemEntry))
@@ -17827,7 +17935,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
item = NewItemOrBag(proto);
if (item->LoadFromDB(itemGuid, GetGUID(), fields, itemEntry))
{
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt;
// Do not allow to have item limited to another map/zone in alive state
if (IsAlive() && item->IsLimitedToAnotherMapOrZone(GetMapId(), zoneId))
@@ -17920,7 +18028,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
}
else
{
- TC_LOG_ERROR("entities.player", "Player::_LoadInventory: player (GUID: %u, name: '%s') has broken item (GUID: %u, entry: %u) in inventory. Deleting item.",
+ TC_LOG_ERROR("entities.player", "Player::_LoadInventory: player (GUID: %u, name: '%s') has a broken item (GUID: %u, entry: %u) in inventory. Deleting item.",
GetGUID().GetCounter(), GetName().c_str(), itemGuid, itemEntry);
remove = true;
}
@@ -17930,12 +18038,12 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
Item::DeleteFromInventoryDB(trans, itemGuid);
item->FSetState(ITEM_REMOVED);
item->SaveToDB(trans); // it also deletes item object!
- item = NULL;
+ item = nullptr;
}
}
else
{
- TC_LOG_ERROR("entities.player", "Player::_LoadInventory: player (GUID: %u, name: '%s') has unknown item (entry: %u) in inventory. Deleting item.",
+ TC_LOG_ERROR("entities.player", "Player::_LoadInventory: player (GUID: %u, name: '%s') has an unknown item (entry: %u) in inventory. Deleting item.",
GetGUID().GetCounter(), GetName().c_str(), itemEntry);
Item::DeleteFromInventoryDB(trans, itemGuid);
Item::DeleteFromDB(trans, itemGuid);
@@ -17966,7 +18074,8 @@ void Player::_LoadMailedItems(Mail* mail)
if (!proto)
{
- TC_LOG_ERROR("entities.player", "Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUID().GetCounter(), itemGuid, itemTemplate, mail->messageID);
+ TC_LOG_ERROR("entities.player", "Player '%s' (%s) has unknown item_template in mailed items (GUID: %u, Entry: %u) in mail (%u), deleted.",
+ GetName().c_str(), GetGUID().ToString().c_str(), itemGuid, itemTemplate, mail->messageID);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_MAIL_ITEM);
stmt->setUInt32(0, itemGuid);
@@ -17982,7 +18091,7 @@ void Player::_LoadMailedItems(Mail* mail)
if (!item->LoadFromDB(itemGuid, ObjectGuid(HighGuid::Player, fields[13].GetUInt32()), fields, itemTemplate))
{
- TC_LOG_ERROR("entities.player", "Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, itemGuid);
+ TC_LOG_ERROR("entities.player", "Player::_LoadMailedItems: Item (GUID: %u) in mail (%u) doesn't exist, deleted from mail.", itemGuid, mail->messageID);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM);
stmt->setUInt32(0, itemGuid);
@@ -17990,7 +18099,7 @@ void Player::_LoadMailedItems(Mail* mail)
item->FSetState(ITEM_REMOVED);
- SQLTransaction temp = SQLTransaction(NULL);
+ SQLTransaction temp = SQLTransaction(nullptr);
item->SaveToDB(temp); // it also deletes item object !
continue;
}
@@ -18045,7 +18154,7 @@ void Player::_LoadMail()
if (m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId))
{
- TC_LOG_ERROR("entities.player", "Player::_LoadMail - Mail (%u) have not existed MailTemplateId (%u), remove at load", m->messageID, m->mailTemplateId);
+ TC_LOG_ERROR("entities.player", "Player::_LoadMail: Mail (%u) has nonexistent MailTemplateId (%u), remove at load", m->messageID, m->mailTemplateId);
m->mailTemplateId = 0;
}
@@ -18102,8 +18211,8 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
else
{
questStatusData.Status = QUEST_STATUS_INCOMPLETE;
- TC_LOG_ERROR("entities.player", "Player %s (GUID: %u) has invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).",
- GetName().c_str(), GetGUID().GetCounter(), quest_id, qstatus);
+ TC_LOG_ERROR("entities.player", "Player::_LoadQuestStatus: Player '%s' (%s) has invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).",
+ GetName().c_str(), GetGUID().ToString().c_str(), quest_id, qstatus);
}
questStatusData.Explored = (fields[2].GetUInt8() > 0);
@@ -18152,7 +18261,8 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
++slot;
}
- TC_LOG_DEBUG("entities.player.loading", "Quest status is {%u} for quest {%u} for player (GUID: %u)", questStatusData.Status, quest_id, GetGUID().GetCounter());
+
+ TC_LOG_DEBUG("entities.player.loading", "Player::_LoadQuestStatus: Quest status is {%u} for quest {%u} for player (%s)", questStatusData.Status, quest_id, GetGUID().ToString().c_str());
}
}
while (result->NextRow());
@@ -18190,9 +18300,10 @@ void Player::_LoadQuestStatusRewarded(PreparedQueryResult result)
if (quest->GetBonusTalents())
m_questRewardTalentCount += quest->GetBonusTalents();
- }
- m_RewardedQuests.insert(quest_id);
+ if (quest->CanIncreaseRewardedQuestCounters())
+ m_RewardedQuests.insert(quest_id);
+ }
}
while (result->NextRow());
}
@@ -18226,7 +18337,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result)
if (quest_daily_idx >= PLAYER_MAX_DAILY_QUESTS) // max amount with exist data in query
{
- TC_LOG_ERROR("entities.player", "Player (GUID: %u) have more 25 daily quest records in `charcter_queststatus_daily`", GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player (GUID: %u) has more than 25 daily quest records in `charcter_queststatus_daily`", GetGUID().GetCounter());
break;
}
@@ -18242,7 +18353,8 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result)
SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx, quest_id);
++quest_daily_idx;
- TC_LOG_DEBUG("entities.player.loading", "Daily quest (%u) cooldown for player (GUID: %u)", quest_id, GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.player.loading", "Player::_LoadDailyQuestStatus: Loaded daily quest cooldown (QuestID: %u) for player '%s' (%s)",
+ quest_id, GetName().c_str(), GetGUID().ToString().c_str());
}
while (result->NextRow());
}
@@ -18265,7 +18377,9 @@ void Player::_LoadWeeklyQuestStatus(PreparedQueryResult result)
continue;
m_weeklyquests.insert(quest_id);
- TC_LOG_DEBUG("entities.player.loading", "Weekly quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUID().GetCounter());
+
+ TC_LOG_DEBUG("entities.player.loading", "Player::_LoadWeeklyQuestStatus: Loaded weekly quest cooldown (QuestID: %u) for player '%s' (%s)",
+ quest_id, GetName().c_str(), GetGUID().ToString().c_str());
}
while (result->NextRow());
}
@@ -18289,7 +18403,8 @@ void Player::_LoadSeasonalQuestStatus(PreparedQueryResult result)
continue;
m_seasonalquests[event_id].insert(quest_id);
- TC_LOG_DEBUG("entities.player.loading", "Seasonal quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.player.loading", "Player::_LoadSeasonalQuestStatus: Loaded seasonal quest cooldown (QuestID: %u) for player '%s' (%s)",
+ quest_id, GetName().c_str(), GetGUID().ToString().c_str());
}
while (result->NextRow());
}
@@ -18312,7 +18427,8 @@ void Player::_LoadMonthlyQuestStatus(PreparedQueryResult result)
continue;
m_monthlyquests.insert(quest_id);
- TC_LOG_DEBUG("entities.player.loading", "Monthly quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.player.loading", "Player::_LoadMonthlyQuestStatus: Loaded monthly quest cooldown (QuestID: %u) for player '%s' (%s)",
+ quest_id, GetName().c_str(), GetGUID().ToString().c_str());
}
while (result->NextRow());
}
@@ -18389,12 +18505,14 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
if (!mapEntry || !mapEntry->IsDungeon())
{
- TC_LOG_ERROR("entities.player", "_LoadBoundInstances: player %s(%d) has bind to not existed or not dungeon map %d (%s)", GetName().c_str(), GetGUID().GetCounter(), mapId, mapname.c_str());
+ TC_LOG_ERROR("entities.player", "Player::_LoadBoundInstances: Player '%s' (%s) has bind to not existed or not dungeon map %d (%s)",
+ GetName().c_str(), GetGUID().ToString().c_str(), mapId, mapname.c_str());
deleteInstance = true;
}
else if (difficulty >= MAX_DIFFICULTY)
{
- TC_LOG_ERROR("entities.player", "_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u (%s)", GetName().c_str(), GetGUID().GetCounter(), difficulty, mapId, mapname.c_str());
+ TC_LOG_ERROR("entities.player", "Player::_LoadBoundInstances: player '%s' (%s) has bind to not existed difficulty %d instance for map %u (%s)",
+ GetName().c_str(), GetGUID().ToString().c_str(), difficulty, mapId, mapname.c_str());
deleteInstance = true;
}
else
@@ -18402,12 +18520,14 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(difficulty));
if (!mapDiff)
{
- TC_LOG_ERROR("entities.player", "_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u (%s)", GetName().c_str(), GetGUID().GetCounter(), difficulty, mapId, mapname.c_str());
+ TC_LOG_ERROR("entities.player", "Player::_LoadBoundInstances: player '%s' (%s) has bind to not existed difficulty %d instance for map %u (%s)",
+ GetName().c_str(), GetGUID().ToString().c_str(), difficulty, mapId, mapname.c_str());
deleteInstance = true;
}
else if (!perm && group)
{
- TC_LOG_ERROR("entities.player", "_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d (%s), %d, %d", GetName().c_str(), GetGUID().GetCounter(), group->GetLowGUID(), mapId, mapname.c_str(), instanceId, difficulty);
+ TC_LOG_ERROR("entities.player", "Player::_LoadBoundInstances: player '%s' (%s) is in group %s but has a non-permanent character bind to map %d (%s), %d, %d",
+ GetName().c_str(), GetGUID().ToString().c_str(), group->GetGUID().ToString().c_str(), mapId, mapname.c_str(), instanceId, difficulty);
deleteInstance = true;
}
}
@@ -18437,7 +18557,7 @@ InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty
// some instances only have one difficulty
MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(mapid, difficulty);
if (!mapDiff)
- return NULL;
+ return nullptr;
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid);
if (itr != m_boundInstances[difficulty].end())
@@ -18543,12 +18663,13 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, B
bind.perm = permanent;
bind.extendState = extendState;
if (!load)
- TC_LOG_DEBUG("maps", "Player::BindToInstance: %s(%d) is now bound to map %d, instance %d, difficulty %d", GetName().c_str(), GetGUID().GetCounter(), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty());
- sScriptMgr->OnPlayerBindToInstance(this, save->GetDifficulty(), save->GetMapId(), permanent, uint8(extendState));
+ TC_LOG_DEBUG("maps", "Player::BindToInstance: Player '%s' (%s) is now bound to map (ID: %d, Instance: %d, Difficulty: %d)",
+ GetName().c_str(), GetGUID().ToString().c_str(), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty());
+ sScriptMgr->OnPlayerBindToInstance(this, save->GetDifficulty(), save->GetMapId(), permanent, extendState);
return &bind;
}
- return NULL;
+ return nullptr;
}
void Player::BindToInstance()
@@ -18582,7 +18703,7 @@ void Player::SendRaidInfo()
size_t p_counter = data.wpos();
data << uint32(counter); // placeholder
- time_t now = time(NULL);
+ time_t now = time(nullptr);
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
{
@@ -18741,7 +18862,7 @@ bool Player::CheckInstanceValidity(bool /*isLogin*/)
return true;
// non-instances are always valid
- Map* map = GetMap();
+ Map* map = FindMap();
if (!map || !map->IsDungeon())
return true;
@@ -18805,7 +18926,8 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
if (!info)
{
- TC_LOG_ERROR("entities.player", "Player (Name %s) has incorrect race/class pair. Can't be loaded.", GetName().c_str());
+ TC_LOG_ERROR("entities.player", "Player::_LoadHomeBind: Player '%s' (%s) has incorrect race/class (%u/%u) pair. Can't load.",
+ GetGUID().ToString().c_str(), GetName().c_str(), uint32(getRace()), uint32(getClass()));
return false;
}
@@ -18853,8 +18975,8 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
CharacterDatabase.Execute(stmt);
}
- TC_LOG_DEBUG("entities.player", "Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f",
- m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ);
+ TC_LOG_DEBUG("entities.player", "Player::_LoadHomeBind: Setting home position (MapID: %u, AreaID: %u, X: %f, Y: %f, Z: %f) of player '%s' (%s)",
+ m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ, GetName().c_str(), GetGUID().ToString().c_str());
return true;
}
@@ -18878,13 +19000,13 @@ void Player::SaveToDB(bool create /*=false*/)
// first save/honor gain after midnight will also update the player's honor fields
UpdateHonorFields();
- TC_LOG_DEBUG("entities.unit", "The value of player %s at save: ", m_name.c_str());
+ TC_LOG_DEBUG("entities.unit", "Player::SaveToDB: The value of player %s at save: ", m_name.c_str());
outDebugValues();
if (!create)
sScriptMgr->OnPlayerSave(this);
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt;
uint8 index = 0;
if (create)
@@ -18897,12 +19019,17 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setString(index++, GetName());
stmt->setUInt8(index++, getRace());
stmt->setUInt8(index++, getClass());
- stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_3, 0)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect
stmt->setUInt8(index++, getLevel());
stmt->setUInt32(index++, GetUInt32Value(PLAYER_XP));
stmt->setUInt32(index++, GetMoney());
- stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES));
- stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES_2));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS));
stmt->setUInt16(index++, (uint16)GetMapId());
stmt->setUInt32(index++, (uint32)GetInstanceId());
@@ -18927,7 +19054,7 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setUInt32(index++, m_Played_time[PLAYED_TIME_TOTAL]);
stmt->setUInt32(index++, m_Played_time[PLAYED_TIME_LEVEL]);
stmt->setFloat(index++, finiteAlways(m_rest_bonus));
- stmt->setUInt32(index++, uint32(time(NULL)));
+ stmt->setUInt32(index++, uint32(time(nullptr)));
stmt->setUInt8(index++, (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0));
//save, far from tavern/city
//save, but in tavern/city
@@ -18992,8 +19119,8 @@ void Player::SaveToDB(bool create /*=false*/)
ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i) << ' ';
stmt->setString(index++, ss.str());
- stmt->setUInt8(index++, GetByteValue(PLAYER_FIELD_BYTES, 2));
- stmt->setUInt32(index++, m_grantableLevels);
+ stmt->setUInt8(index++, GetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BAR_TOGGLES));
+ stmt->setUInt32(index, m_grantableLevels);
}
else
{
@@ -19002,12 +19129,17 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setString(index++, GetName());
stmt->setUInt8(index++, getRace());
stmt->setUInt8(index++, getClass());
- stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_3, 0)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect
stmt->setUInt8(index++, getLevel());
stmt->setUInt32(index++, GetUInt32Value(PLAYER_XP));
stmt->setUInt32(index++, GetMoney());
- stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES));
- stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES_2));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS));
if (!IsBeingTeleported())
@@ -19047,7 +19179,7 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setUInt32(index++, m_Played_time[PLAYED_TIME_TOTAL]);
stmt->setUInt32(index++, m_Played_time[PLAYED_TIME_LEVEL]);
stmt->setFloat(index++, finiteAlways(m_rest_bonus));
- stmt->setUInt32(index++, uint32(time(NULL)));
+ stmt->setUInt32(index++, uint32(time(nullptr)));
stmt->setUInt8(index++, (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0));
//save, far from tavern/city
//save, but in tavern/city
@@ -19112,7 +19244,7 @@ void Player::SaveToDB(bool create /*=false*/)
ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i) << ' ';
stmt->setString(index++, ss.str());
- stmt->setUInt8(index++, GetByteValue(PLAYER_FIELD_BYTES, 2));
+ stmt->setUInt8(index++, GetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BAR_TOGGLES));
stmt->setUInt32(index++, m_grantableLevels);
stmt->setUInt8(index++, IsInWorld() && !GetSession()->PlayerLogout() ? 1 : 0);
@@ -19166,7 +19298,7 @@ void Player::SaveInventoryAndGoldToDB(SQLTransaction& trans)
SaveGoldToDB(trans);
}
-void Player::SaveGoldToDB(SQLTransaction& trans)
+void Player::SaveGoldToDB(SQLTransaction& trans) const
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_MONEY);
stmt->setUInt32(0, GetMoney());
@@ -19176,7 +19308,7 @@ void Player::SaveGoldToDB(SQLTransaction& trans)
void Player::_SaveActions(SQLTransaction& trans)
{
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt;
for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end();)
{
@@ -19280,7 +19412,7 @@ void Player::_SaveAuras(SQLTransaction& trans)
void Player::_SaveInventory(SQLTransaction& trans)
{
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt;
// force items in buyback slots to new state
// and remove those that aren't already
for (uint8 i = BUYBACK_SLOT_START; i < BUYBACK_SLOT_END; ++i)
@@ -19318,7 +19450,8 @@ void Player::_SaveInventory(SQLTransaction& trans)
}
else
{
- TC_LOG_ERROR("entities.player", "Can't find %s but is in refundable storage for player %u ! Removing.", itr->ToString().c_str(), GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player::_SaveInventory: Can't find item (%s) in refundable storage for player '%s' (%s), removing.",
+ itr->ToString().c_str(), GetName().c_str(), GetGUID().ToString().c_str());
m_refundableItems.erase(itr);
}
}
@@ -19344,12 +19477,14 @@ void Player::_SaveInventory(SQLTransaction& trans)
if (item->GetState() != ITEM_REMOVED)
{
Item* test = GetItemByPos(item->GetBagSlot(), item->GetSlot());
- if (test == NULL)
+ if (test == nullptr)
{
ObjectGuid::LowType bagTestGUID = 0;
if (Item* test2 = GetItemByPos(INVENTORY_SLOT_BAG_0, item->GetBagSlot()))
bagTestGUID = test2->GetGUID().GetCounter();
- TC_LOG_ERROR("entities.player", "Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u (state %d) are incorrect, the player doesn't have an item at that position!", lowGuid, GetName().c_str(), item->GetBagSlot(), item->GetSlot(), item->GetGUID().GetCounter(), (int32)item->GetState());
+
+ TC_LOG_ERROR("entities.player", "Player::_SaveInventory: Player '%s' (%s) has incorrect values (Bag: %u, Slot: %u) for the item (%s, State: %d). The player doesn't have an item at that position.",
+ GetName().c_str(), GetGUID().ToString().c_str(), item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString().c_str(), (int32)item->GetState());
// according to the test that was just performed nothing should be in this slot, delete
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT);
stmt->setUInt32(0, bagTestGUID);
@@ -19365,9 +19500,10 @@ void Player::_SaveInventory(SQLTransaction& trans)
}
else if (test != item)
{
- TC_LOG_ERROR("entities.player", "Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u are incorrect, the item with guid %u is there instead!", lowGuid, GetName().c_str(), item->GetBagSlot(), item->GetSlot(), item->GetGUID().GetCounter(), test->GetGUID().GetCounter());
+ TC_LOG_ERROR("entities.player", "Player::_SaveInventory: Player '%s' (%s) has incorrect values (Bag: %u, Slot: %u) for the item (%s). %s is there instead!",
+ GetName().c_str(), GetGUID().ToString().c_str(), item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString().c_str(), test->GetGUID().ToString().c_str());
// save all changes to the item...
- if (item->GetState() != ITEM_NEW) // only for existing items, no dupes
+ if (item->GetState() != ITEM_NEW) // only for existing items, no duplicates
item->SaveToDB(trans);
// ...but do not save position in invntory
continue;
@@ -19404,7 +19540,7 @@ void Player::_SaveMail(SQLTransaction& trans)
if (!m_mailsLoaded)
return;
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt;
for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr)
{
@@ -19480,7 +19616,7 @@ void Player::_SaveQuestStatus(SQLTransaction& trans)
QuestStatusSaveMap::iterator saveItr;
QuestStatusMap::iterator statusItr;
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt;
bool keepAbandoned = !(sWorld->GetCleaningFlags() & CharacterDatabaseCleaner::CLEANING_FLAG_QUESTSTATUS);
@@ -19662,7 +19798,7 @@ void Player::_SaveMonthlyQuestStatus(SQLTransaction& trans)
void Player::_SaveSkills(SQLTransaction& trans)
{
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt;
// we don't need transactions here.
for (SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end();)
{
@@ -19718,7 +19854,7 @@ void Player::_SaveSkills(SQLTransaction& trans)
void Player::_SaveSpells(SQLTransaction& trans)
{
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt;
for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end();)
{
@@ -19756,13 +19892,13 @@ void Player::_SaveSpells(SQLTransaction& trans)
// save player stats -- only for external usage
// real stats will be recalculated on player login
-void Player::_SaveStats(SQLTransaction& trans)
+void Player::_SaveStats(SQLTransaction& trans) const
{
// check if stat saving is enabled and if char level is high enough
if (!sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE))
return;
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt;
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_STATS);
stmt->setUInt32(0, GetGUID().GetCounter());
@@ -19826,7 +19962,7 @@ void Player::UpdateSpeakTime()
if (GetSession()->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHAT_SPAM))
return;
- time_t current = time (NULL);
+ time_t current = time(nullptr);
if (m_speakTime > current)
{
uint32 max_count = sWorld->getIntConfig(CONFIG_CHATFLOOD_MESSAGE_COUNT);
@@ -19852,14 +19988,14 @@ void Player::UpdateSpeakTime()
bool Player::CanSpeak() const
{
- return GetSession()->m_muteTime <= time (NULL);
+ return GetSession()->m_muteTime <= time (nullptr);
}
/*********************************************************/
/*** LOW LEVEL FUNCTIONS:Notifiers ***/
/*********************************************************/
-void Player::SendAttackSwingNotInRange()
+void Player::SendAttackSwingNotInRange() const
{
WorldPacket data(SMSG_ATTACKSWING_NOTINRANGE, 0);
GetSession()->SendPacket(&data);
@@ -19893,48 +20029,38 @@ void Player::SetUInt32ValueInArray(Tokenizer& tokens, uint16 index, uint32 value
void Player::Customize(CharacterCustomizeInfo const* customizeInfo, SQLTransaction& trans)
{
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PLAYERBYTES2);
- stmt->setUInt32(0, customizeInfo->Guid.GetCounter());
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
-
- if (!result)
- return;
-
- Field* fields = result->Fetch();
-
- uint32 playerBytes2 = fields[0].GetUInt32();
- playerBytes2 &= ~0xFF;
- playerBytes2 |= customizeInfo->FacialHair;
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_PLAYERBYTES);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_AND_APPEARANCE);
stmt->setUInt8(0, customizeInfo->Gender);
- stmt->setUInt32(1, customizeInfo->Skin | (customizeInfo->Face << 8) | (customizeInfo->HairStyle << 16) | (customizeInfo->HairColor << 24));
- stmt->setUInt32(2, playerBytes2);
- stmt->setUInt32(3, customizeInfo->Guid.GetCounter());
+ stmt->setUInt8(1, customizeInfo->Skin);
+ stmt->setUInt8(2, customizeInfo->Face);
+ stmt->setUInt8(3, customizeInfo->HairStyle);
+ stmt->setUInt8(4, customizeInfo->HairColor);
+ stmt->setUInt8(5, customizeInfo->FacialHair);
+ stmt->setUInt32(6, customizeInfo->Guid.GetCounter());
CharacterDatabase.ExecuteOrAppend(trans, stmt);
}
-void Player::SendAttackSwingDeadTarget()
+void Player::SendAttackSwingDeadTarget() const
{
WorldPacket data(SMSG_ATTACKSWING_DEADTARGET, 0);
GetSession()->SendPacket(&data);
}
-void Player::SendAttackSwingCantAttack()
+void Player::SendAttackSwingCantAttack() const
{
WorldPacket data(SMSG_ATTACKSWING_CANT_ATTACK, 0);
GetSession()->SendPacket(&data);
}
-void Player::SendAttackSwingCancelAttack()
+void Player::SendAttackSwingCancelAttack() const
{
WorldPacket data(SMSG_CANCEL_COMBAT, 0);
GetSession()->SendPacket(&data);
}
-void Player::SendAttackSwingBadFacingAttack()
+void Player::SendAttackSwingBadFacingAttack() const
{
WorldPacket data(SMSG_ATTACKSWING_BADFACING, 0);
GetSession()->SendPacket(&data);
@@ -19947,7 +20073,7 @@ void Player::SendAutoRepeatCancel(Unit* target)
SendMessageToSet(&data, false);
}
-void Player::SendExplorationExperience(uint32 Area, uint32 Experience)
+void Player::SendExplorationExperience(uint32 Area, uint32 Experience) const
{
WorldPacket data(SMSG_EXPLORATION_EXPERIENCE, 8);
data << uint32(Area);
@@ -19955,7 +20081,7 @@ void Player::SendExplorationExperience(uint32 Area, uint32 Experience)
GetSession()->SendPacket(&data);
}
-void Player::SendDungeonDifficulty(bool IsInGroup)
+void Player::SendDungeonDifficulty(bool IsInGroup) const
{
uint8 val = 0x00000001;
WorldPacket data(MSG_SET_DUNGEON_DIFFICULTY, 12);
@@ -19965,7 +20091,7 @@ void Player::SendDungeonDifficulty(bool IsInGroup)
GetSession()->SendPacket(&data);
}
-void Player::SendRaidDifficulty(bool IsInGroup, int32 forcedDifficulty)
+void Player::SendRaidDifficulty(bool IsInGroup, int32 forcedDifficulty) const
{
uint8 val = 0x00000001;
WorldPacket data(MSG_SET_RAID_DIFFICULTY, 12);
@@ -19975,7 +20101,7 @@ void Player::SendRaidDifficulty(bool IsInGroup, int32 forcedDifficulty)
GetSession()->SendPacket(&data);
}
-void Player::SendResetFailedNotify(uint32 mapid)
+void Player::SendResetFailedNotify(uint32 mapid) const
{
WorldPacket data(SMSG_RESET_FAILED_NOTIFY, 4);
data << uint32(mapid);
@@ -20031,14 +20157,14 @@ void Player::ResetInstances(uint8 method, bool isRaid)
}
}
-void Player::SendResetInstanceSuccess(uint32 MapId)
+void Player::SendResetInstanceSuccess(uint32 MapId) const
{
WorldPacket data(SMSG_INSTANCE_RESET, 4);
data << uint32(MapId);
GetSession()->SendPacket(&data);
}
-void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId)
+void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) const
{
/*reasons for instance reset failure:
// 0: There are players inside the instance.
@@ -20116,22 +20242,22 @@ Pet* Player::GetPet() const
if (ObjectGuid pet_guid = GetPetGUID())
{
if (!pet_guid.IsPet())
- return NULL;
+ return nullptr;
Pet* pet = ObjectAccessor::GetPet(*this, pet_guid);
if (!pet)
- return NULL;
+ return nullptr;
if (IsInWorld() && pet)
return pet;
- //there may be a guardian in slot
- //TC_LOG_ERROR("entities.player", "Player::GetPet: Pet %u not exist.", GUID_LOPART(pet_guid));
+ // there may be a guardian in this slot
+ //TC_LOG_ERROR("entities.player", "Player::GetPet: Pet %u does not exist.", GUID_LOPART(pet_guid));
//const_cast<Player*>(this)->SetPetGUID(0);
}
- return NULL;
+ return nullptr;
}
void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
@@ -20141,7 +20267,8 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
if (pet)
{
- TC_LOG_DEBUG("entities.pet", "RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent);
+ TC_LOG_DEBUG("entities.pet", "Player::RemovePet: Player '%s' (%s), Pet (Entry: %u, Mode: %u, ReturnReagent: %u)",
+ GetName().c_str(), GetGUID().ToString().c_str(), pet->GetEntry(), mode, returnreagent);
if (pet->m_removed)
return;
@@ -20226,7 +20353,7 @@ void Player::StopCastingCharm()
if (charm->GetTypeId() == TYPEID_UNIT)
{
if (charm->ToCreature()->HasUnitTypeMask(UNIT_MASK_PUPPET))
- ((Puppet*)charm)->UnSummon();
+ static_cast<Puppet*>(charm)->UnSummon();
else if (charm->IsVehicle())
ExitVehicle();
}
@@ -20235,14 +20362,14 @@ void Player::StopCastingCharm()
if (GetCharmGUID())
{
- TC_LOG_FATAL("entities.player", "Player %s (%s) is not able to uncharm unit (%s)", GetName().c_str(), GetGUID().ToString().c_str(), GetCharmGUID().ToString().c_str());
- if (charm->GetCharmerGUID())
+ TC_LOG_FATAL("entities.player", "Player::StopCastingCharm: Player '%s' (%s) is not able to uncharm unit (%s)", GetName().c_str(), GetGUID().ToString().c_str(), GetCharmGUID().ToString().c_str());
+ if (!charm->GetCharmerGUID().IsEmpty())
{
- TC_LOG_FATAL("entities.player", "Charmed unit has charmer %s", charm->GetCharmerGUID().ToString().c_str());
+ TC_LOG_FATAL("entities.player", "Player::StopCastingCharm: Charmed unit has charmer %s", charm->GetCharmerGUID().ToString().c_str());
ABORT();
}
- else
- SetCharm(charm, false);
+
+ SetCharm(charm, false);
}
}
@@ -20256,6 +20383,11 @@ void Player::Say(std::string const& text, Language language, WorldObject const*
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true);
}
+void Player::Say(uint32 textId, WorldObject const* target /*= nullptr*/)
+{
+ Talk(textId, CHAT_MSG_SAY, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), target);
+}
+
void Player::Yell(std::string const& text, Language language, WorldObject const* /*= nullptr*/)
{
std::string _text(text);
@@ -20266,6 +20398,11 @@ void Player::Yell(std::string const& text, Language language, WorldObject const*
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), true);
}
+void Player::Yell(uint32 textId, WorldObject const* target /*= nullptr*/)
+{
+ Talk(textId, CHAT_MSG_YELL, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), target);
+}
+
void Player::TextEmote(std::string const& text, WorldObject const* /*= nullptr*/, bool /*= false*/)
{
std::string _text(text);
@@ -20276,6 +20413,11 @@ void Player::TextEmote(std::string const& text, WorldObject const* /*= nullptr*/
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHAT));
}
+void Player::TextEmote(uint32 textId, WorldObject const* target /*= nullptr*/, bool /*isBossEmote = false*/)
+{
+ Talk(textId, CHAT_MSG_EMOTE, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), target);
+}
+
void Player::Whisper(std::string const& text, Language language, Player* target, bool /*= false*/)
{
ASSERT(target);
@@ -20312,6 +20454,24 @@ void Player::Whisper(std::string const& text, Language language, Player* target,
ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, target->GetName().c_str(), target->autoReplyMsg.c_str());
}
+void Player::Whisper(uint32 textId, Player* target, bool /*isBossWhisper = false*/)
+{
+ if (!target)
+ return;
+
+ BroadcastText const* bct = sObjectMgr->GetBroadcastText(textId);
+ if (!bct)
+ {
+ TC_LOG_ERROR("entities.unit", "WorldObject::MonsterWhisper: `broadcast_text` was not %u found", textId);
+ return;
+ }
+
+ LocaleConstant locale = target->GetSession()->GetSessionDbLocaleIndex();
+ WorldPacket data;
+ ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale);
+ target->SendDirectMessage(&data);
+}
+
Item* Player::GetMItem(uint32 id)
{
ItemMap::const_iterator itr = mMitems.find(id);
@@ -20330,7 +20490,7 @@ bool Player::RemoveMItem(uint32 id)
return mMitems.erase(id) ? true : false;
}
-void Player::SendOnCancelExpectedVehicleRideAura()
+void Player::SendOnCancelExpectedVehicleRideAura() const
{
WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
GetSession()->SendPacket(&data);
@@ -20395,7 +20555,7 @@ void Player::PossessSpellInitialize()
if (!charmInfo)
{
- TC_LOG_ERROR("entities.player", "Player::PossessSpellInitialize(): charm (%s) has no charminfo!", charm->GetGUID().ToString().c_str());
+ TC_LOG_ERROR("entities.player", "Player::PossessSpellInitialize: charm (%s) has no charminfo!", charm->GetGUID().ToString().c_str());
return;
}
@@ -20430,7 +20590,7 @@ void Player::VehicleSpellInitialize()
data << uint8(0); // Command State
data << uint16(0x800); // DisableActions (set for all vehicles)
- for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ for (uint32 i = 0; i < MAX_CREATURE_SPELLS; ++i)
{
uint32 spellId = vehicle->m_spells[i];
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
@@ -20442,7 +20602,8 @@ void Player::VehicleSpellInitialize()
if (!sConditionMgr->IsObjectMeetingVehicleSpellConditions(vehicle->GetEntry(), spellId, this, vehicle))
{
- TC_LOG_DEBUG("condition", "VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", vehicle->ToCreature()->GetEntry(), spellId);
+ TC_LOG_DEBUG("condition", "Player::VehicleSpellInitialize: Player '%s' (%s) doesn't meet conditions for vehicle (Entry: %u, Spell: %u)",
+ GetName().c_str(), GetGUID().ToString().c_str(), vehicle->ToCreature()->GetEntry(), spellId);
data << uint16(0) << uint8(0) << uint8(i+8);
continue;
}
@@ -20453,7 +20614,7 @@ void Player::VehicleSpellInitialize()
data << uint32(MAKE_UNIT_ACTION_BUTTON(spellId, i+8));
}
- for (uint32 i = CREATURE_MAX_SPELLS; i < MAX_SPELL_CONTROL_BAR; ++i)
+ for (uint32 i = MAX_CREATURE_SPELLS; i < MAX_SPELL_CONTROL_BAR; ++i)
data << uint32(0);
data << uint8(0); // Auras?
@@ -20472,7 +20633,8 @@ void Player::CharmSpellInitialize()
CharmInfo* charmInfo = charm->GetCharmInfo();
if (!charmInfo)
{
- TC_LOG_ERROR("entities.player", "Player::CharmSpellInitialize(): the player's charm (%s) has no charminfo!", charm->GetGUID().ToString().c_str());
+ TC_LOG_ERROR("entities.player", "Player::CharmSpellInitialize(): Player '%s' (%s) has a charm (%s) but no no charminfo!",
+ GetName().c_str(), GetGUID().ToString().c_str(), charm->GetGUID().ToString().c_str());
return;
}
@@ -20517,14 +20679,14 @@ void Player::CharmSpellInitialize()
GetSession()->SendPacket(&data);
}
-void Player::SendRemoveControlBar()
+void Player::SendRemoveControlBar() const
{
WorldPacket data(SMSG_PET_SPELLS, 8);
data << uint64(0);
GetSession()->SendPacket(&data);
}
-bool Player::IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell)
+bool Player::IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell) const
{
if (!mod || !spellInfo)
return false;
@@ -20542,7 +20704,7 @@ bool Player::IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod
void Player::AddSpellMod(SpellModifier* mod, bool apply)
{
- TC_LOG_DEBUG("spells", "Player::AddSpellMod %d", mod->spellId);
+ TC_LOG_DEBUG("spells", "Player::AddSpellMod: Player '%s' (%s), SpellID: %d", GetName().c_str(), GetGUID().ToString().c_str(), mod->spellId);
uint16 Opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER;
int i = 0;
@@ -20713,7 +20875,7 @@ void Player::SetSpellModTakingSpell(Spell* spell, bool apply)
}
// send Proficiency
-void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask)
+void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) const
{
WorldPacket data(SMSG_SET_PROFICIENCY, 1 + 4);
data << uint8(itemClass) << uint32(itemSubclassMask);
@@ -20835,13 +20997,13 @@ void Player::SetRestBonus(float rest_bonus_new)
// update data for client
if ((GetsRecruitAFriendBonus(true) && (GetSession()->IsARecruiter() || GetSession()->GetRecruiterId() != 0)))
- SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_RAF_LINKED);
+ SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, REST_STATE_RAF_LINKED);
else
{
if (m_rest_bonus > 10)
- SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_RESTED);
+ SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, REST_STATE_RESTED);
else if (m_rest_bonus <= 1)
- SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_NOT_RAF_LINKED);
+ SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, REST_STATE_NOT_RAF_LINKED);
}
//RestTickUpdate
@@ -20860,7 +21022,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
return false;
}
- if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
+ if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL))
return false;
// taximaster case
@@ -20959,7 +21121,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
uint32 firstcost = 0;
uint32 prevnode = sourcenode;
- uint32 lastnode = 0;
+ uint32 lastnode;
for (uint32 i = 1; i < nodes.size(); ++i)
{
@@ -20992,7 +21154,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
// only one mount ID for both sides. Probably not good to use 315 in case DBC nodes
// change but I couldn't find a suitable alternative. OK to use class because only DK
// can use this taxi.
- uint32 mount_display_id = sObjectMgr->GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == NULL || (sourcenode == 315 && getClass() == CLASS_DEATH_KNIGHT));
+ uint32 mount_display_id = sObjectMgr->GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == nullptr || (sourcenode == 315 && getClass() == CLASS_DEATH_KNIGHT));
// in spell case allow 0 model
if ((mount_display_id == 0 && spellid == 0) || sourcepath == 0)
@@ -21052,24 +21214,24 @@ bool Player::ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid /*= 0*/)
nodes[0] = entry->from;
nodes[1] = entry->to;
- return ActivateTaxiPathTo(nodes, NULL, spellid);
+ return ActivateTaxiPathTo(nodes, nullptr, spellid);
}
void Player::CleanupAfterTaxiFlight()
{
m_taxi.ClearTaxiDestinations(); // not destinations, clear source node
Dismount();
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
+ RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);
getHostileRefManager().setOnlineOfflineState(true);
}
-void Player::ContinueTaxiFlight()
+void Player::ContinueTaxiFlight() const
{
uint32 sourceNode = m_taxi.GetTaxiSource();
if (!sourceNode)
return;
- TC_LOG_DEBUG("entities.unit", "WORLD: Restart character %u taxi flight", GetGUID().GetCounter());
+ TC_LOG_DEBUG("entities.unit", "Player::ContinueTaxiFlight: Restart %s taxi flight", GetGUID().ToString().c_str());
uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourceNode, GetTeam(), true);
if (!mountDisplayId)
@@ -21082,7 +21244,7 @@ void Player::ContinueTaxiFlight()
TaxiPathNodeList const& nodeList = sTaxiPathNodesByPath[path];
- float distPrev = MAP_SIZE*MAP_SIZE;
+ float distPrev;
float distNext =
(nodeList[0]->LocX - GetPositionX())*(nodeList[0]->LocX - GetPositionX()) +
(nodeList[0]->LocY - GetPositionY())*(nodeList[0]->LocY - GetPositionY()) +
@@ -21171,11 +21333,11 @@ void Player::InitDisplayIds()
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
if (!info)
{
- TC_LOG_ERROR("entities.player", "Player %s (%s) has incorrect race/class pair. Can't init display ids.", GetName().c_str(), GetGUID().ToString().c_str());
+ TC_LOG_ERROR("entities.player", "Player::InitDisplayIds: Player '%s' (%s) has incorrect race/class pair. Can't init display ids.", GetName().c_str(), GetGUID().ToString().c_str());
return;
}
- uint8 gender = GetByteValue(PLAYER_BYTES_3, 0);
+ uint8 gender = GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER);
switch (gender)
{
case GENDER_FEMALE:
@@ -21187,7 +21349,7 @@ void Player::InitDisplayIds()
SetNativeDisplayId(info->displayId_m);
break;
default:
- TC_LOG_ERROR("entities.player", "Player %s (%s) has invalid gender %u", GetName().c_str(), GetGUID().ToString().c_str(), gender);
+ TC_LOG_ERROR("entities.player", "Player::InitDisplayIds: Player '%s' (%s) has invalid gender %u", GetName().c_str(), GetGUID().ToString().c_str(), gender);
}
}
@@ -21200,7 +21362,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
CanEquipNewItem(slot, uiDest, item, false);
if (msg != EQUIP_ERR_OK)
{
- SendEquipError(msg, NULL, NULL, item);
+ SendEquipError(msg, nullptr, nullptr, item);
return false;
}
@@ -21270,13 +21432,13 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
if (!pProto)
{
- SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, item, 0);
+ SendBuyError(BUY_ERR_CANT_FIND_ITEM, nullptr, item, 0);
return false;
}
if (!(pProto->AllowableClass & getClassMask()) && pProto->Bonding == BIND_WHEN_PICKED_UP && !IsGameMaster())
{
- SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, item, 0);
+ SendBuyError(BUY_ERR_CANT_FIND_ITEM, nullptr, item, 0);
return false;
}
@@ -21286,14 +21448,16 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
Creature* creature = GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!creature)
{
- TC_LOG_DEBUG("network", "WORLD: BuyItemFromVendor - %s not found or you can't interact with him.", vendorguid.ToString().c_str());
- SendBuyError(BUY_ERR_DISTANCE_TOO_FAR, NULL, item, 0);
+ TC_LOG_DEBUG("network", "Player::BuyItemFromVendorSlot: Vendor (%s) not found or player '%s' (%s) can't interact with him.",
+ vendorguid.ToString().c_str(), GetName().c_str(), GetGUID().ToString().c_str());
+ SendBuyError(BUY_ERR_DISTANCE_TOO_FAR, nullptr, item, 0);
return false;
}
if (!sConditionMgr->IsObjectMeetingVendorItemConditions(creature->GetEntry(), item, this, creature))
{
- TC_LOG_DEBUG("condition", "BuyItemFromVendor: conditions not met for creature entry %u item %u", creature->GetEntry(), item);
+ TC_LOG_DEBUG("condition", "Player::BuyItemFromVendorSlot: Player '%s' (%s) doesn't meed conditions for creature (Entry: %u, Item: %u)",
+ GetName().c_str(), GetGUID().ToString().c_str(), creature->GetEntry(), item);
SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0);
return false;
}
@@ -21340,21 +21504,21 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost);
if (!iece)
{
- TC_LOG_ERROR("entities.player", "Item %u have wrong ExtendedCost field value %u", pProto->ItemId, crItem->ExtendedCost);
+ TC_LOG_ERROR("entities.player", "Player::BuyItemFromVendorSlot: Item %u has wrong ExtendedCost field value %u", pProto->ItemId, crItem->ExtendedCost);
return false;
}
// honor points price
if (GetHonorPoints() < (iece->reqhonorpoints * count))
{
- SendEquipError(EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS, NULL, NULL);
+ SendEquipError(EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS, nullptr, nullptr);
return false;
}
// arena points price
if (GetArenaPoints() < (iece->reqarenapoints * count))
{
- SendEquipError(EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS, NULL, NULL);
+ SendEquipError(EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS, nullptr, nullptr);
return false;
}
@@ -21363,7 +21527,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
{
if (iece->reqitem[i] && !HasItemCount(iece->reqitem[i], (iece->reqitemcount[i] * count)))
{
- SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL);
+ SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr);
return false;
}
}
@@ -21372,7 +21536,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
if (GetMaxPersonalArenaRatingRequirement(iece->reqarenaslot) < iece->reqpersonalarenarating)
{
// probably not the proper equip err
- SendEquipError(EQUIP_ERR_CANT_EQUIP_RANK, NULL, NULL);
+ SendEquipError(EQUIP_ERR_CANT_EQUIP_RANK, nullptr, nullptr);
return false;
}
}
@@ -21383,7 +21547,8 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
uint32 maxCount = MAX_MONEY_AMOUNT / pProto->BuyPrice;
if ((uint32)count > maxCount)
{
- TC_LOG_ERROR("entities.player", "Player %s tried to buy %u item id %u, causing overflow", GetName().c_str(), (uint32)count, pProto->ItemId);
+ TC_LOG_ERROR("entities.player", "Player::BuyItemFromVendorSlot: Player '%s' (%s) tried to buy item (ItemID: %u, Count: %u), causing overflow",
+ GetName().c_str(), GetGUID().ToString().c_str(), pProto->ItemId, (uint32)count);
count = (uint8)maxCount;
}
price = pProto->BuyPrice * count; //it should not exceed MAX_MONEY_AMOUNT
@@ -21407,7 +21572,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
{
if (pProto->BuyCount * count != 1)
{
- SendEquipError(EQUIP_ERR_ITEM_CANT_BE_EQUIPPED, NULL, NULL);
+ SendEquipError(EQUIP_ERR_ITEM_CANT_BE_EQUIPPED, nullptr, nullptr);
return false;
}
if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, creature, crItem, false))
@@ -21415,7 +21580,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
}
else
{
- SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL);
+ SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, nullptr, nullptr);
return false;
}
@@ -21477,7 +21642,8 @@ void Player::UpdateHomebindTime(uint32 time)
data << uint32(m_HomebindTimer);
data << uint32(1);
GetSession()->SendPacket(&data);
- TC_LOG_DEBUG("maps", "PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName().c_str(), GetGUID().GetCounter());
+ TC_LOG_DEBUG("maps", "Player::UpdateHomebindTime: Player '%s' (%s) will be teleported to homebind in 60 seconds",
+ GetName().c_str(), GetGUID().ToString().c_str());
}
}
@@ -21513,7 +21679,7 @@ void Player::UpdatePvPState(bool onlyFFA)
else // in friendly area
{
if (IsPvP() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP) && !pvpInfo.EndTimer)
- pvpInfo.EndTimer = time(NULL); // start toggle-off
+ pvpInfo.EndTimer = time(nullptr); // start toggle-off
}
}
@@ -21533,7 +21699,7 @@ void Player::UpdatePvP(bool state, bool _override)
}
else
{
- pvpInfo.EndTimer = time(NULL);
+ pvpInfo.EndTimer = time(nullptr);
SetPvP(state);
}
}
@@ -21547,7 +21713,7 @@ void Player::UpdatePotionCooldown(Spell* spell)
// Call not from spell cast, send cooldown event for item spells if no in combat
if (!spell)
{
- // spell/item pair let set proper cooldown (except not existed charged spell cooldown spellmods for potions)
+ // spell/item pair let set proper cooldown (except non-existing charged spell cooldown spellmods for potions)
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(m_lastPotionId))
for (uint8 idx = 0; idx < MAX_ITEM_PROTO_SPELLS; ++idx)
if (proto->Spells[idx].SpellId && proto->Spells[idx].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE)
@@ -21561,26 +21727,19 @@ void Player::UpdatePotionCooldown(Spell* spell)
m_lastPotionId = 0;
}
-void Player::setResurrectRequestData(ObjectGuid guid, uint32 mapId, float X, float Y, float Z, uint32 health, uint32 mana)
+void Player::SetResurrectRequestData(Unit* caster, uint32 health, uint32 mana, uint32 appliedAura)
{
- m_resurrectGUID = guid;
- m_resurrectMap = mapId;
- m_resurrectX = X;
- m_resurrectY = Y;
- m_resurrectZ = Z;
- m_resurrectHealth = health;
- m_resurrectMana = mana;
+ ASSERT(!IsResurrectRequested());
+ _resurrectionData.reset(new ResurrectionData());
+ _resurrectionData->GUID = caster->GetGUID();
+ _resurrectionData->Location.WorldRelocate(*caster);
+ _resurrectionData->Health = health;
+ _resurrectionData->Mana = mana;
+ _resurrectionData->Aura = appliedAura;
}
-void Player::clearResurrectRequestData()
-{
- setResurrectRequestData(ObjectGuid::Empty, 0, 0.0f, 0.0f, 0.0f, 0, 0);
-
- m_ghoulResurrectPlayerGUID = ObjectGuid::Empty;
- m_ghoulResurrectGhoulGUID = ObjectGuid::Empty;
-}
//slot to be excluded while counting
-bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
+bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) const
{
if (!enchantmentcondition)
return true;
@@ -21659,7 +21818,8 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
}
}
- TC_LOG_DEBUG("entities.player.items", "Checking Condition %u, there are %u Meta Gems, %u Red Gems, %u Yellow Gems and %u Blue Gems, Activate:%s", enchantmentcondition, curcount[0], curcount[1], curcount[2], curcount[3], activate ? "yes" : "no");
+ TC_LOG_DEBUG("entities.player.items", "Player::EnchantmentFitsRequirements: Checking Condition %u, there are %u Meta Gems, %u Red Gems, %u Yellow Gems and %u Blue Gems, Activate:%s",
+ enchantmentcondition, curcount[0], curcount[1], curcount[2], curcount[3], activate ? "yes" : "no");
return activate;
}
@@ -21771,7 +21931,7 @@ void Player::SetBattlegroundEntryPoint()
if (const WorldSafeLocsEntry* entry = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()))
m_bgData.joinPos = WorldLocation(entry->map_id, entry->x, entry->y, entry->z, 0.0f);
else
- TC_LOG_ERROR("entities.player", "SetBattlegroundEntryPoint: Dungeon map %u has no linked graveyard, setting home location as entry point.", GetMapId());
+ TC_LOG_ERROR("entities.player", "Player::SetBattlegroundEntryPoint: Dungeon (MapID: %u) has no linked graveyard, setting home location as entry point.", GetMapId());
}
// If new entry point is not BG or arena set it
else if (!GetMap()->IsBattlegroundOrArena())
@@ -21785,7 +21945,7 @@ void Player::SetBattlegroundEntryPoint()
void Player::SetBGTeam(uint32 team)
{
m_bgData.bgTeam = team;
- SetByteValue(PLAYER_BYTES_3, 3, uint8(team == ALLIANCE ? 1 : 0));
+ SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_ARENA_FACTION, uint8(team == ALLIANCE ? 1 : 0));
}
uint32 Player::GetBGTeam() const
@@ -21866,8 +22026,8 @@ void Player::ReportedAfkBy(Player* reporter)
if (m_bgData.bgAfkReporter.find(reporter->GetGUID().GetCounter()) == m_bgData.bgAfkReporter.end() && !HasAura(43680) && !HasAura(43681) && reporter->CanReportAfkDueToLimit())
{
m_bgData.bgAfkReporter.insert(reporter->GetGUID().GetCounter());
- // 3 players have to complain to apply debuff
- if (m_bgData.bgAfkReporter.size() >= 3)
+ // by default 3 players have to complain to apply debuff
+ if (m_bgData.bgAfkReporter.size() >= sWorld->getIntConfig(CONFIG_BATTLEGROUND_REPORT_AFK))
{
// cast 'Idle' spell
CastSpell(this, 43680, true);
@@ -21885,7 +22045,7 @@ WorldLocation Player::GetStartPosition() const
return WorldLocation(mapId, info->positionX, info->positionY, info->positionZ, 0);
}
-bool Player::HaveAtClient(WorldObject const* u) const
+bool Player::HaveAtClient(Object const* u) const
{
return u == this || m_clientGUIDs.find(u->GetGUID()) != m_clientGUIDs.end();
}
@@ -21982,7 +22142,7 @@ template<>
inline void BeforeVisibilityDestroy<Creature>(Creature* t, Player* p)
{
if (p->GetPetGUID() == t->GetGUID() && t->IsPet())
- ((Pet*)t)->Remove(PET_SAVE_NOT_IN_SLOT, true);
+ t->ToPet()->Remove(PET_SAVE_NOT_IN_SLOT, true);
}
void Player::UpdateVisibilityOf(WorldObject* target)
@@ -22016,7 +22176,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
// target aura duration for caster show only if target exist at caster client
// send data at target visibility change (adding to client)
if (target->isType(TYPEMASK_UNIT))
- SendInitialVisiblePackets((Unit*)target);
+ SendInitialVisiblePackets(static_cast<Unit*>(target));
}
}
}
@@ -22063,7 +22223,7 @@ void Player::UpdateTriggerVisibility()
GetSession()->SendPacket(&packet);
}
-void Player::SendInitialVisiblePackets(Unit* target)
+void Player::SendInitialVisiblePackets(Unit* target) const
{
SendAurasForTarget(target);
if (target->IsAlive())
@@ -22152,7 +22312,7 @@ bool Player::ModifyMoney(int32 amount, bool sendError /*= true*/)
sScriptMgr->OnPlayerMoneyLimit(this, amount);
if (sendError)
- SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL);
+ SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, nullptr, nullptr);
return false;
}
}
@@ -22183,14 +22343,14 @@ Unit* Player::GetSelectedUnit() const
{
if (ObjectGuid selectionGUID = GetTarget())
return ObjectAccessor::GetUnit(*this, selectionGUID);
- return NULL;
+ return nullptr;
}
Player* Player::GetSelectedPlayer() const
{
if (ObjectGuid selectionGUID = GetTarget())
return ObjectAccessor::GetPlayer(*this, selectionGUID);
- return NULL;
+ return nullptr;
}
void Player::SendComboPoints()
@@ -22281,7 +22441,7 @@ void Player::ClearComboPoints()
void Player::SetGroup(Group* group, int8 subgroup)
{
- if (group == NULL)
+ if (group == nullptr)
m_group.unlink();
else
{
@@ -22421,7 +22581,7 @@ void Player::SendUpdateToOutOfRangeGroupMembers()
pet->ResetAuraUpdateMaskForRaid();
}
-void Player::SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8 arg)
+void Player::SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8 arg) const
{
WorldPacket data(SMSG_TRANSFER_ABORTED, 4+2);
data << uint32(mapid);
@@ -22440,7 +22600,7 @@ void Player::SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8
GetSession()->SendPacket(&data);
}
-void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint32 time, bool welcome)
+void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint32 time, bool welcome) const
{
// type of warning, based on the time remaining until reset
uint32 type;
@@ -22486,7 +22646,7 @@ void Player::ApplyEquipCooldown(Item* pItem)
continue;
// Don't replace longer cooldowns by equip cooldown if we have any.
- if (GetSpellHistory()->GetRemainingCooldown(sSpellMgr->EnsureSpellInfo(spellData.SpellId)) > 30 * IN_MILLISECONDS)
+ if (GetSpellHistory()->GetRemainingCooldown(sSpellMgr->AssertSpellInfo(spellData.SpellId)) > 30 * IN_MILLISECONDS)
continue;
GetSpellHistory()->AddCooldown(spellData.SpellId, pItem->GetEntry(), std::chrono::seconds(30));
@@ -22564,7 +22724,8 @@ void Player::LearnCustomSpells()
for (PlayerCreateInfoSpells::const_iterator itr = info->customSpells.begin(); itr != info->customSpells.end(); ++itr)
{
uint32 tspell = *itr;
- TC_LOG_DEBUG("entities.player.loading", "PLAYER (Class: %u Race: %u): Adding initial spell, id = %u", uint32(getClass()), uint32(getRace()), tspell);
+ TC_LOG_DEBUG("entities.player.loading", "Player::LearnCustomSpells: Player '%s' (%s, Class: %u Race: %u): Adding initial spell (SpellID: %u)",
+ GetName().c_str(), GetGUID().ToString().c_str(), uint32(getClass()), uint32(getRace()), tspell);
if (!IsInWorld()) // will send in INITIAL_SPELLS in list anyway at map add
AddSpell(tspell, true, true, true, false);
else // but send in normal spell in game learn case
@@ -22736,7 +22897,7 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue)
}
}
-void Player::SendAurasForTarget(Unit* target)
+void Player::SendAurasForTarget(Unit* target) const
{
if (!target || target->GetVisibleAuras()->empty()) // speedup things
return;
@@ -22777,7 +22938,7 @@ void Player::SetDailyQuestStatus(uint32 quest_id)
if (!GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx))
{
SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx, quest_id);
- m_lastDailyQuestTime = time(NULL); // last daily quest time
+ m_lastDailyQuestTime = time(nullptr); // last daily quest time
m_DailyQuestChanged = true;
break;
}
@@ -22785,12 +22946,30 @@ void Player::SetDailyQuestStatus(uint32 quest_id)
} else
{
m_DFQuests.insert(quest_id);
- m_lastDailyQuestTime = time(NULL);
+ m_lastDailyQuestTime = time(nullptr);
m_DailyQuestChanged = true;
}
}
}
+bool Player::IsDailyQuestDone(uint32 quest_id)
+{
+ bool found = false;
+ if (sObjectMgr->GetQuestTemplate(quest_id))
+ {
+ for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx)
+ {
+ if (GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1 + quest_daily_idx) == quest_id)
+ {
+ found = true;
+ break;
+ }
+ }
+ }
+
+ return found;
+}
+
void Player::SetWeeklyQuestStatus(uint32 quest_id)
{
m_weeklyquests.insert(quest_id);
@@ -22858,7 +23037,7 @@ void Player::ResetMonthlyQuestStatus()
Battleground* Player::GetBattleground() const
{
if (GetBattlegroundId() == 0)
- return NULL;
+ return nullptr;
return sBattlegroundMgr->GetBattleground(GetBattlegroundId(), m_bgData.bgTypeID);
}
@@ -22917,7 +23096,7 @@ uint32 Player::AddBattlegroundQueueId(BattlegroundQueueTypeId val)
return PLAYER_MAX_BATTLEGROUND_QUEUES;
}
-bool Player::HasFreeBattlegroundQueueId()
+bool Player::HasFreeBattlegroundQueueId() const
{
for (uint8 i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
if (m_bgBattlegroundQueueID[i].bgQueueTypeId == BATTLEGROUND_QUEUE_NONE)
@@ -23103,13 +23282,32 @@ void Player::UpdateForQuestWorldObjects()
GetSession()->SendPacket(&packet);
}
-void Player::SetSummonPoint(uint32 mapid, float x, float y, float z)
+bool Player::HasSummonPending() const
{
- m_summon_expire = time(NULL) + MAX_PLAYER_SUMMON_DELAY;
- m_summon_mapid = mapid;
- m_summon_x = x;
- m_summon_y = y;
- m_summon_z = z;
+ return m_summon_expire >= time(nullptr);
+}
+
+void Player::SendSummonRequestFrom(Unit* summoner)
+{
+ if (!summoner)
+ return;
+
+ // Player already has active summon request
+ if (HasSummonPending())
+ return;
+
+ // Evil Twin (ignore player summon, but hide this for summoner)
+ if (HasAura(23445))
+ return;
+
+ m_summon_expire = time(nullptr) + MAX_PLAYER_SUMMON_DELAY;
+ m_summon_location.WorldRelocate(*summoner);
+
+ WorldPacket data(SMSG_SUMMON_REQUEST, 8 + 4 + 4);
+ data << uint64(summoner->GetGUID()); // summoner guid
+ data << uint32(summoner->GetZoneId()); // summoner zone
+ data << uint32(MAX_PLAYER_SUMMON_DELAY*IN_MILLISECONDS); // auto decline after msecs
+ GetSession()->SendPacket(&data);
}
void Player::SummonIfPossible(bool agree)
@@ -23121,7 +23319,7 @@ void Player::SummonIfPossible(bool agree)
}
// expire and auto declined
- if (m_summon_expire < time(NULL))
+ if (m_summon_expire < time(nullptr))
return;
// stop taxi flight at summon
@@ -23140,7 +23338,7 @@ void Player::SummonIfPossible(bool agree)
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS, 1);
- TeleportTo(m_summon_mapid, m_summon_x, m_summon_y, m_summon_z, GetOrientation());
+ TeleportTo(m_summon_location);
}
void Player::RemoveItemDurations(Item* item)
@@ -23179,8 +23377,7 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/)
return;
ItemPosCountVec off_dest;
- uint8 off_msg = CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false);
- if (off_msg == EQUIP_ERR_OK)
+ if (CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false) == EQUIP_ERR_OK)
{
RemoveItem(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND, true);
StoreItem(off_dest, offItem, true);
@@ -23242,7 +23439,7 @@ bool Player::HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item cons
break;
}
default:
- TC_LOG_ERROR("entities.player", "HasItemFitToSpellRequirements: Not handled spell requirement for item class %u", spellInfo->EquippedItemClass);
+ TC_LOG_ERROR("entities.player", "Player::HasItemFitToSpellRequirements: Not handled spell requirement for item class %u", spellInfo->EquippedItemClass);
break;
}
@@ -23368,7 +23565,7 @@ bool Player::GetsRecruitAFriendBonus(bool forXP)
{
if (Group* group = this->GetGroup())
{
- for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* player = itr->GetSource();
if (!player)
@@ -23417,7 +23614,7 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
// prepare data for near group iteration
if (Group* group = GetGroup())
{
- for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* player = itr->GetSource();
if (!player)
@@ -23483,8 +23680,14 @@ void Player::ResurrectUsingRequestData()
{
RemoveGhoul();
+ if (uint32 aura = _resurrectionData->Aura)
+ {
+ CastSpell(this, aura, true, nullptr, nullptr, _resurrectionData->GUID);
+ return;
+ }
+
/// Teleport before resurrecting by player, otherwise the player might get attacked from creatures near his corpse
- TeleportTo(m_resurrectMap, m_resurrectX, m_resurrectY, m_resurrectZ, GetOrientation());
+ TeleportTo(_resurrectionData->Location);
if (IsBeingTeleported())
{
@@ -23492,15 +23695,20 @@ void Player::ResurrectUsingRequestData()
return;
}
+ ResurrectUsingRequestDataImpl();
+}
+
+void Player::ResurrectUsingRequestDataImpl()
+{
ResurrectPlayer(0.0f, false);
- if (GetMaxHealth() > m_resurrectHealth)
- SetHealth(m_resurrectHealth);
+ if (GetMaxHealth() > _resurrectionData->Health)
+ SetHealth(_resurrectionData->Health);
else
SetFullHealth();
- if (GetMaxPower(POWER_MANA) > m_resurrectMana)
- SetPower(POWER_MANA, m_resurrectMana);
+ if (GetMaxPower(POWER_MANA) > _resurrectionData->Mana)
+ SetPower(POWER_MANA, _resurrectionData->Mana);
else
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
@@ -23527,7 +23735,7 @@ void Player::SetClientControl(Unit* target, bool allowMove)
void Player::SetMover(Unit* target)
{
- m_mover->m_movedPlayer = NULL;
+ m_mover->m_movedPlayer = nullptr;
m_mover = target;
m_mover->m_movedPlayer = this;
}
@@ -23572,7 +23780,7 @@ uint32 Player::GetCorpseReclaimDelay(bool pvp) const
else if (!sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE))
return 0;
- time_t now = time(NULL);
+ time_t now = time(nullptr);
// 0..2 full period
// should be ceil(x)-1 but not floor(x)
uint64 count = (now < m_deathExpireTime - 1) ? (m_deathExpireTime - 1 - now) / DEATH_EXPIRE_STEP : 0;
@@ -23587,7 +23795,7 @@ void Player::UpdateCorpseReclaimDelay()
(!pvp && !sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
return;
- time_t now = time(NULL);
+ time_t now = time(nullptr);
if (now < m_deathExpireTime)
{
@@ -23603,7 +23811,7 @@ void Player::UpdateCorpseReclaimDelay()
m_deathExpireTime = now + DEATH_EXPIRE_STEP;
}
-int32 Player::CalculateCorpseReclaimDelay(bool load)
+int32 Player::CalculateCorpseReclaimDelay(bool load) const
{
Corpse* corpse = GetCorpse();
@@ -23631,7 +23839,7 @@ int32 Player::CalculateCorpseReclaimDelay(bool load)
}
time_t expected_time = corpse->GetGhostTime() + copseReclaimDelay[count];
- time_t now = time(NULL);
+ time_t now = time(nullptr);
if (now >= expected_time)
return -1;
@@ -23644,7 +23852,7 @@ int32 Player::CalculateCorpseReclaimDelay(bool load)
return delay * IN_MILLISECONDS;
}
-void Player::SendCorpseReclaimDelay(uint32 delay)
+void Player::SendCorpseReclaimDelay(uint32 delay) const
{
WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4);
data << uint32(delay);
@@ -23655,12 +23863,12 @@ Player* Player::GetNextRandomRaidMember(float radius)
{
Group* group = GetGroup();
if (!group)
- return NULL;
+ return nullptr;
std::vector<Player*> nearMembers;
nearMembers.reserve(group->GetMembersCount());
- for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* Target = itr->GetSource();
@@ -23671,7 +23879,7 @@ Player* Player::GetNextRandomRaidMember(float radius)
}
if (nearMembers.empty())
- return NULL;
+ return nullptr;
uint32 randTarget = urand(0, nearMembers.size()-1);
return nearMembers[randTarget];
@@ -23703,7 +23911,7 @@ PartyResult Player::CanUninviteFromGroup(ObjectGuid guidMember) const
return ERR_PARTY_LFG_BOOT_LOOT_ROLLS;
/// @todo Should also be sent when anyone has recently left combat, with an aprox ~5 seconds timer.
- for (GroupReference const* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference const* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next())
if (itr->GetSource() && itr->GetSource()->IsInCombat())
return ERR_PARTY_LFG_BOOT_IN_COMBAT;
@@ -23727,12 +23935,12 @@ PartyResult Player::CanUninviteFromGroup(ObjectGuid guidMember) const
return ERR_PARTY_RESULT_OK;
}
-bool Player::isUsingLfg()
+bool Player::isUsingLfg() const
{
return sLFGMgr->GetState(GetGUID()) != lfg::LFG_STATE_NONE;
}
-bool Player::inRandomLfgDungeon()
+bool Player::inRandomLfgDungeon() const
{
if (sLFGMgr->selectedRandomLfgDungeon(GetGUID()))
{
@@ -23762,12 +23970,12 @@ void Player::RemoveFromBattlegroundOrBattlefieldRaid()
m_group.link(group, this);
m_group.setSubGroup(GetOriginalSubGroup());
}
- SetOriginalGroup(NULL);
+ SetOriginalGroup(nullptr);
}
void Player::SetOriginalGroup(Group* group, int8 subgroup)
{
- if (group == NULL)
+ if (group == nullptr)
m_originalGroup.unlink();
else
{
@@ -23788,7 +23996,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
if (_lastLiquid && _lastLiquid->SpellId)
RemoveAurasDueToSpell(_lastLiquid->SpellId);
- _lastLiquid = NULL;
+ _lastLiquid = nullptr;
return;
}
@@ -23814,7 +24022,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
else if (_lastLiquid && _lastLiquid->SpellId)
{
RemoveAurasDueToSpell(_lastLiquid->SpellId);
- _lastLiquid = NULL;
+ _lastLiquid = nullptr;
}
@@ -23869,7 +24077,7 @@ void Player::SetCanBlock(bool value)
UpdateBlockPercentage();
}
-bool ItemPosCount::isContainedIn(ItemPosCountVec const& vec) const
+bool ItemPosCount::isContainedIn(std::vector<ItemPosCount> const& vec) const
{
for (ItemPosCountVec::const_iterator itr = vec.begin(); itr != vec.end(); ++itr)
if (itr->pos == pos)
@@ -23877,15 +24085,15 @@ bool ItemPosCount::isContainedIn(ItemPosCountVec const& vec) const
return false;
}
-void Player::StopCastingBindSight()
+void Player::StopCastingBindSight() const
{
if (WorldObject* target = GetViewpoint())
{
if (target->isType(TYPEMASK_UNIT))
{
- ((Unit*)target)->RemoveAurasByType(SPELL_AURA_BIND_SIGHT, GetGUID());
- ((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS, GetGUID());
- ((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET, GetGUID());
+ static_cast<Unit*>(target)->RemoveAurasByType(SPELL_AURA_BIND_SIGHT, GetGUID());
+ static_cast<Unit*>(target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS, GetGUID());
+ static_cast<Unit*>(target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET, GetGUID());
}
}
}
@@ -23894,11 +24102,12 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
{
if (apply)
{
- TC_LOG_DEBUG("maps", "Player::CreateViewpoint: Player %s create seer %u (TypeId: %u).", GetName().c_str(), target->GetEntry(), target->GetTypeId());
+ TC_LOG_DEBUG("maps", "Player::CreateViewpoint: Player '%s' (%s) creates seer (Entry: %u, TypeId: %u).",
+ GetName().c_str(), GetGUID().ToString().c_str(), target->GetEntry(), target->GetTypeId());
if (!AddGuidValue(PLAYER_FARSIGHT, target->GetGUID()))
{
- TC_LOG_FATAL("entities.player", "Player::CreateViewpoint: Player %s cannot add new viewpoint!", GetName().c_str());
+ TC_LOG_FATAL("entities.player", "Player::CreateViewpoint: Player '%s' (%s) cannot add new viewpoint!", GetName().c_str(), GetGUID().ToString().c_str());
return;
}
@@ -23906,23 +24115,24 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
UpdateVisibilityOf(target);
if (target->isType(TYPEMASK_UNIT) && target != GetVehicleBase())
- ((Unit*)target)->AddPlayerToVision(this);
+ static_cast<Unit*>(target)->AddPlayerToVision(this);
+ SetSeer(target);
}
else
{
- TC_LOG_DEBUG("maps", "Player::CreateViewpoint: Player %s remove seer", GetName().c_str());
+ TC_LOG_DEBUG("maps", "Player::CreateViewpoint: Player %s removed seer", GetName().c_str());
if (!RemoveGuidValue(PLAYER_FARSIGHT, target->GetGUID()))
{
- TC_LOG_FATAL("entities.player", "Player::CreateViewpoint: Player %s cannot remove current viewpoint!", GetName().c_str());
+ TC_LOG_FATAL("entities.player", "Player::CreateViewpoint: Player '%s' (%s) cannot remove current viewpoint!", GetName().c_str(), GetGUID().ToString().c_str());
return;
}
if (target->isType(TYPEMASK_UNIT) && target != GetVehicleBase())
- ((Unit*)target)->RemovePlayerFromVision(this);
+ static_cast<Unit*>(target)->RemovePlayerFromVision(this);
//must immediately set seer back otherwise may crash
- m_seer = this;
+ SetSeer(this);
//WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0);
//GetSession()->SendPacket(&data);
@@ -23957,11 +24167,11 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
WorldObject* Player::GetViewpoint() const
{
if (ObjectGuid guid = GetGuidValue(PLAYER_FARSIGHT))
- return (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_SEER);
- return NULL;
+ return static_cast<WorldObject*>(ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_SEER));
+ return nullptr;
}
-bool Player::CanUseBattlegroundObject(GameObject* gameobject)
+bool Player::CanUseBattlegroundObject(GameObject* gameobject) const
{
// It is possible to call this method with a null pointer, only skipping faction check.
if (gameobject)
@@ -23980,24 +24190,24 @@ bool Player::CanUseBattlegroundObject(GameObject* gameobject)
IsAlive()); // Alive
}
-bool Player::CanCaptureTowerPoint()
+bool Player::CanCaptureTowerPoint() const
{
return (!HasStealthAura() && // not stealthed
!HasInvisibilityAura() && // not invisible
IsAlive()); // live player
}
-uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin)
+uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin) const
{
uint8 level = getLevel();
if (level > GT_MAX_LEVEL)
level = GT_MAX_LEVEL; // max level in this dbc
- uint8 hairstyle = GetByteValue(PLAYER_BYTES, 2);
- uint8 haircolor = GetByteValue(PLAYER_BYTES, 3);
- uint8 facialhair = GetByteValue(PLAYER_BYTES_2, 0);
- uint8 skincolor = GetByteValue(PLAYER_BYTES, 0);
+ uint8 hairstyle = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID);
+ uint8 haircolor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID);
+ uint8 facialhair = GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE);
+ uint8 skincolor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID);
if ((hairstyle == newhairstyle) && (haircolor == newhaircolor) && (facialhair == newfacialhair) && (!newSkin || (newSkin->hair_id == skincolor)))
return 0;
@@ -24055,7 +24265,7 @@ void Player::SetGlyph(uint8 slot, uint32 glyph)
SetUInt32Value(PLAYER_FIELD_GLYPHS_1 + slot, glyph);
}
-bool Player::isTotalImmune()
+bool Player::isTotalImmune() const
{
AuraEffectList const& immune = GetAuraEffectsByType(SPELL_AURA_SCHOOL_IMMUNITY);
@@ -24105,7 +24315,7 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost)
GetSession()->SendPacket(&data);
}
-bool Player::isTotalImmunity()
+bool Player::isTotalImmunity() const
{
AuraEffectList const& immune = GetAuraEffectsByType(SPELL_AURA_SCHOOL_IMMUNITY);
@@ -24129,38 +24339,6 @@ bool Player::isTotalImmunity()
return false;
}
-void Player::UpdateCharmedAI()
-{
- //This should only called in Player::Update
- Creature* charmer = GetCharmer()->ToCreature();
-
- //kill self if charm aura has infinite duration
- if (charmer->IsInEvadeMode())
- {
- AuraEffectList const& auras = GetAuraEffectsByType(SPELL_AURA_MOD_CHARM);
- for (AuraEffectList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
- if ((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->GetBase()->IsPermanent())
- {
- charmer->DealDamage(this, GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- return;
- }
- }
-
- if (!charmer->IsInCombat())
- GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
-
- Unit* target = GetVictim();
- if (!target || !charmer->IsValidAttackTarget(target))
- {
- target = charmer->SelectNearestTarget();
- if (!target)
- return;
-
- GetMotionMaster()->MoveChase(target);
- Attack(target, true);
- }
-}
-
uint32 Player::GetRuneBaseCooldown(uint8 index)
{
uint8 rune = GetBaseRune(index);
@@ -24213,7 +24391,7 @@ void Player::RemoveRunesByAuraEffect(AuraEffect const* aura)
if (m_runes->runes[i].ConvertAura == aura)
{
ConvertRune(i, GetBaseRune(i));
- SetRuneConvertAura(i, NULL);
+ SetRuneConvertAura(i, nullptr);
}
}
}
@@ -24221,11 +24399,11 @@ void Player::RemoveRunesByAuraEffect(AuraEffect const* aura)
void Player::RestoreBaseRune(uint8 index)
{
AuraEffect const* aura = m_runes->runes[index].ConvertAura;
- // If rune was converted by a non-pasive aura that still active we should keep it converted
+ // If rune was converted by a non-passive aura that still active we should keep it converted
if (aura && !aura->GetSpellInfo()->HasAttribute(SPELL_ATTR0_PASSIVE))
return;
ConvertRune(index, GetBaseRune(index));
- SetRuneConvertAura(index, NULL);
+ SetRuneConvertAura(index, nullptr);
// Don't drop passive talents providing rune convertion
if (!aura || aura->GetAuraType() != SPELL_AURA_CONVERT_RUNE)
return;
@@ -24247,7 +24425,7 @@ void Player::ConvertRune(uint8 index, RuneType newType)
GetSession()->SendPacket(&data);
}
-void Player::ResyncRunes(uint8 count)
+void Player::ResyncRunes(uint8 count) const
{
WorldPacket data(SMSG_RESYNC_RUNES, 4 + count * 2);
data << uint32(count);
@@ -24259,7 +24437,7 @@ void Player::ResyncRunes(uint8 count)
GetSession()->SendPacket(&data);
}
-void Player::AddRunePower(uint8 index)
+void Player::AddRunePower(uint8 index) const
{
WorldPacket data(SMSG_ADD_RUNE_POWER, 4);
data << uint32(1 << index); // mask (0x00-0x3F probably)
@@ -24293,7 +24471,7 @@ void Player::InitRunes()
SetRuneCooldown(i, 0); // reset cooldowns
SetRuneTimer(i, 0xFFFFFFFF); // Reset rune flags
SetLastRuneGraceTimer(i, 0);
- SetRuneConvertAura(i, NULL);
+ SetRuneConvertAura(i, nullptr);
m_runes->SetRuneState(i);
}
@@ -24328,7 +24506,7 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons
msg = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, lootItem->itemid, lootItem->count);
if (msg != EQUIP_ERR_OK)
{
- SendEquipError(msg, NULL, NULL, lootItem->itemid);
+ SendEquipError(msg, nullptr, nullptr, lootItem->itemid);
continue;
}
@@ -24339,15 +24517,15 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons
void Player::StoreLootItem(uint8 lootSlot, Loot* loot)
{
- QuestItem* qitem = NULL;
- QuestItem* ffaitem = NULL;
- QuestItem* conditem = NULL;
+ QuestItem* qitem = nullptr;
+ QuestItem* ffaitem = nullptr;
+ QuestItem* conditem = nullptr;
LootItem* item = loot->LootItemInSlot(lootSlot, this, &qitem, &ffaitem, &conditem);
if (!item)
{
- SendEquipError(EQUIP_ERR_ALREADY_LOOTED, NULL, NULL);
+ SendEquipError(EQUIP_ERR_ALREADY_LOOTED, nullptr, nullptr);
return;
}
@@ -24414,7 +24592,7 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot)
}
else
- SendEquipError(msg, NULL, NULL, item->itemid);
+ SendEquipError(msg, nullptr, nullptr, item->itemid);
}
uint32 Player::CalculateTalentsPoints() const
@@ -24467,8 +24645,8 @@ void Player::_LoadSkills(PreparedQueryResult result)
SkillRaceClassInfoEntry const* rcEntry = GetSkillRaceClassInfo(skill, getRace(), getClass());
if (!rcEntry)
{
- TC_LOG_ERROR("entities.player", "Character: %s (GUID: %u Race: %u Class: %u) has skill %u not allowed for his race/class combination",
- GetName().c_str(), GetGUID().GetCounter(), uint32(getRace()), uint32(getClass()), skill);
+ TC_LOG_ERROR("entities.player", "Player::_LoadSkills: Player '%s' (%s, Race: %u, Class: %u) has forbidden skill %u for his race/class combination",
+ GetName().c_str(), GetGUID().ToString().c_str(), uint32(getRace()), uint32(getClass()), skill);
mSkillStatus.insert(SkillStatusMap::value_type(skill, SkillStatusData(0, SKILL_DELETED)));
continue;
@@ -24491,7 +24669,8 @@ void Player::_LoadSkills(PreparedQueryResult result)
if (value == 0)
{
- TC_LOG_ERROR("entities.player", "Character %u has skill %u with value 0. Will be deleted.", GetGUID().GetCounter(), skill);
+ TC_LOG_ERROR("entities.player", "Player::_LoadSkills: Player '%s' (%s) has skill %u with value 0, deleted.",
+ GetName().c_str(), GetGUID().ToString().c_str(), skill);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SKILL);
@@ -24528,7 +24707,8 @@ void Player::_LoadSkills(PreparedQueryResult result)
if (count >= PLAYER_MAX_SKILLS) // client limit
{
- TC_LOG_ERROR("entities.player", "Character %u has more than %u skills.", GetGUID().GetCounter(), PLAYER_MAX_SKILLS);
+ TC_LOG_ERROR("entities.player", "Player::_LoadSkills: Player '%s' (%s) has more than %u skills.",
+ GetName().c_str(), GetGUID().ToString().c_str(), PLAYER_MAX_SKILLS);
break;
}
}
@@ -24795,30 +24975,13 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
uint32 tTab = talentInfo->TalentTab;
if (talentInfo->Row > 0)
- {
- uint32 numRows = sTalentStore.GetNumRows();
- for (uint32 i = 0; i < numRows; i++) // Loop through all talents.
- {
- // Someday, someone needs to revamp
- const TalentEntry* tmpTalent = sTalentStore.LookupEntry(i);
- if (tmpTalent) // the way talents are tracked
- {
+ for (uint32 i = 0; i < sTalentStore.GetNumRows(); i++) // Loop through all talents.
+ if (const TalentEntry* tmpTalent = sTalentStore.LookupEntry(i)) // the way talents are tracked
if (tmpTalent->TalentTab == tTab)
- {
for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++)
- {
if (tmpTalent->RankID[rank] != 0)
- {
if (HasSpell(tmpTalent->RankID[rank]))
- {
spentPoints += (rank + 1);
- }
- }
- }
- }
- }
- }
- }
// not have required min points spent in talent tree
if (spentPoints < (talentInfo->Row * MAX_TALENT_RANK))
@@ -24828,7 +24991,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
uint32 spellid = talentInfo->RankID[talentRank];
if (spellid == 0)
{
- TC_LOG_ERROR("entities.player", "Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
+ TC_LOG_ERROR("entities.player", "Player::LearnTalent: Talent.dbc has no spellInfo for talent: %u (spell id = 0)", talentId);
return;
}
@@ -24840,7 +25003,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
LearnSpell(spellid, false);
AddTalent(spellid, m_activeSpec, true);
- TC_LOG_DEBUG("entities.player", "TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, m_activeSpec);
+ TC_LOG_DEBUG("misc", "Player::LearnTalent: TalentID: %u Spell: %u Group: %u\n", talentId, spellid, uint32(m_activeSpec));
// update free talent points
SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1));
@@ -24965,7 +25128,7 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa
uint32 spellid = talentInfo->RankID[talentRank];
if (spellid == 0)
{
- TC_LOG_ERROR("entities.player", "Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
+ TC_LOG_ERROR("entities.player", "Talent.dbc contains talent: %u Rank: %u spell id = 0", talentId, talentRank);
return;
}
@@ -25292,7 +25455,8 @@ void Player::SetEquipmentSet(uint32 index, EquipmentSet eqset)
if (!found) // something wrong...
{
- TC_LOG_ERROR("entities.player", "Player %s tried to save equipment set " UI64FMTD " (index %u), but that equipment set not found!", GetName().c_str(), eqset.Guid, index);
+ TC_LOG_ERROR("entities.player", "Player::SetEquipmentSet: Player '%s' (%s) tried to save nonexistent equipment set " UI64FMTD " (index: %u)",
+ GetName().c_str(), GetGUID().ToString().c_str(), eqset.Guid, index);
return;
}
}
@@ -25322,7 +25486,7 @@ void Player::_SaveEquipmentSets(SQLTransaction& trans)
{
uint32 index = itr->first;
EquipmentSet& eqset = itr->second;
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt = nullptr;
uint8 j = 0;
switch (eqset.state)
{
@@ -25460,7 +25624,7 @@ void Player::_LoadGlyphs(PreparedQueryResult result)
while (result->NextRow());
}
-void Player::_SaveGlyphs(SQLTransaction& trans)
+void Player::_SaveGlyphs(SQLTransaction& trans) const
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GLYPHS);
stmt->setUInt32(0, GetGUID().GetCounter());
@@ -25544,7 +25708,7 @@ void Player::UpdateSpecCount(uint8 count)
ActivateSpec(0);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
- PreparedStatement* stmt = NULL;
+ PreparedStatement* stmt;
// Copy spec data
if (count > curCount)
@@ -25635,7 +25799,7 @@ void Player::ActivateSpec(uint8 spec)
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
- // skip non-existant talent ranks
+ // skip non-existing talent ranks
if (talentInfo->RankID[rank] == 0)
continue;
RemoveSpell(talentInfo->RankID[rank], true); // removes the talent, and all dependant, learned, and chained spells..
@@ -25679,7 +25843,7 @@ void Player::ActivateSpec(uint8 spec)
// learn highest talent rank that exists in newly activated spec
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
- // skip non-existant talent ranks
+ // skip non-existing talent ranks
if (talentInfo->RankID[rank] == 0)
continue;
// if the talent can be found in the newly activated PlayerTalentMap
@@ -25752,7 +25916,7 @@ uint32 Player::GetReputation(uint32 factionentry) const
return GetReputationMgr().GetReputation(sFactionStore.LookupEntry(factionentry));
}
-std::string const& Player::GetGuildName()
+std::string const& Player::GetGuildName() const
{
return sGuildMgr->GetGuildById(GetGuildId())->GetName();
}
@@ -25960,7 +26124,7 @@ void Player::SendItemRetrievalMail(uint32 itemEntry, uint32 count)
MailDraft draft("Recovered Item", "We recovered a lost item in the twisting nether and noted that it was yours.$B$BPlease find said object enclosed."); // This is the text used in Cataclysm, it probably wasn't changed.
SQLTransaction trans = CharacterDatabase.BeginTransaction();
- if (Item* item = Item::CreateItem(itemEntry, count, 0))
+ if (Item* item = Item::CreateItem(itemEntry, count, nullptr))
{
item->SaveToDB(trans);
draft.AddItem(item);
@@ -25991,7 +26155,7 @@ void Player::_LoadRandomBGStatus(PreparedQueryResult result)
m_IsBGRandomWinner = true;
}
-float Player::GetAverageItemLevel()
+float Player::GetAverageItemLevel() const
{
float sum = 0;
uint32 count = 0;
@@ -26073,6 +26237,9 @@ bool Player::SetCanFly(bool apply, bool packetOnly /*= false*/)
if (!packetOnly && !Unit::SetCanFly(apply))
return false;
+ if (!apply)
+ SetFallInformation(0, GetPositionZ());
+
WorldPacket data(apply ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, 12);
data << GetPackGUID();
data << uint32(0); //! movement counter
@@ -26169,7 +26336,7 @@ float Player::GetCollisionHeight(bool mounted) const
}
}
-std::string Player::GetMapAreaAndZoneString()
+std::string Player::GetMapAreaAndZoneString() const
{
uint32 areaId = GetAreaId();
std::string areaName = "Unknown";
@@ -26187,7 +26354,7 @@ std::string Player::GetMapAreaAndZoneString()
return str.str();
}
-std::string Player::GetCoordsMapAreaAndZoneString()
+std::string Player::GetCoordsMapAreaAndZoneString() const
{
std::ostringstream str;
str << Position::ToString() << " " << GetMapAreaAndZoneString();
@@ -26222,38 +26389,38 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
if (duration > 0)
pet->SetDuration(duration);
- return NULL;
+ return nullptr;
}
// petentry == 0 for hunter "call pet" (current pet summoned if any)
if (!entry)
{
delete pet;
- return NULL;
+ return nullptr;
}
pet->Relocate(x, y, z, ang);
if (!pet->IsPositionValid())
{
- TC_LOG_ERROR("misc", "Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUID().GetCounter(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
+ TC_LOG_ERROR("misc", "Player::SummonPet: Pet (%s, Entry: %d) not summoned. Suggested coordinates aren't valid (X: %f Y: %f)", pet->GetGUID().ToString().c_str(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
delete pet;
- return NULL;
+ return nullptr;
}
Map* map = GetMap();
uint32 pet_number = sObjectMgr->GeneratePetNumber();
if (!pet->Create(map->GenerateLowGuid<HighGuid::Pet>(), map, GetPhaseMask(), entry, pet_number))
{
- TC_LOG_ERROR("misc", "no such creature entry %u", entry);
+ TC_LOG_ERROR("misc", "Player::SummonPet: No such creature entry %u", entry);
delete pet;
- return NULL;
+ return nullptr;
}
pet->SetCreatorGUID(GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
pet->setPowerType(POWER_MANA);
- pet->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ pet->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
pet->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pet->InitStatsForLevel(getLevel());
@@ -26264,12 +26431,12 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
case SUMMON_PET:
// this enables pet details window (Shift+P)
pet->GetCharmInfo()->SetPetNumber(pet_number, true);
- pet->SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
+ pet->SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, CLASS_MAGE);
pet->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
pet->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
pet->SetFullHealth();
pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
- pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped in this case
+ pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(nullptr))); // cast can't be helped in this case
break;
default:
break;
@@ -26313,7 +26480,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
return pet;
}
-void Player::SendSupercededSpell(uint32 oldSpell, uint32 newSpell)
+void Player::SendSupercededSpell(uint32 oldSpell, uint32 newSpell) const
{
WorldPacket data(SMSG_SUPERCEDED_SPELL, 8);
data << uint32(oldSpell) << uint32(newSpell);
@@ -26401,3 +26568,22 @@ void Player::RemoveRestFlag(RestFlag restFlag)
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
}
}
+
+uint32 Player::DoRandomRoll(uint32 minimum, uint32 maximum)
+{
+ ASSERT(maximum <= 10000);
+
+ uint32 roll = urand(minimum, maximum);
+
+ WorldPacket data(MSG_RANDOM_ROLL, 4 + 4 + 4 + 8);
+ data << uint32(minimum);
+ data << uint32(maximum);
+ data << uint32(roll);
+ data << GetGUID();
+ if (Group* group = GetGroup())
+ group->BroadcastPacket(&data, false);
+ else
+ SendDirectMessage(&data);
+
+ return roll;
+}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 2388cf9d0c7..38fff9b8d83 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -30,6 +30,7 @@
#include "SpellHistory.h"
#include "Unit.h"
#include "TradeData.h"
+#include "CinematicMgr.h"
#include <limits>
#include <string>
@@ -54,6 +55,7 @@ class PlayerMenu;
class PlayerSocial;
class SpellCastTargets;
class UpdateMask;
+class PlayerAI;
struct CharacterCustomizeInfo;
@@ -116,7 +118,7 @@ struct PlayerTalent
// Spell modifier (used for modify other spells)
struct SpellModifier
{
- SpellModifier(Aura* _ownerAura = NULL) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), value(0), mask(), spellId(0), ownerAura(_ownerAura) { }
+ SpellModifier(Aura* _ownerAura = nullptr) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), value(0), mask(), spellId(0), ownerAura(_ownerAura) { }
SpellModOp op : 8;
SpellModType type : 8;
int16 charges : 16;
@@ -255,7 +257,7 @@ typedef std::list<PlayerCreateInfoSkill> PlayerCreateInfoSkills;
struct PlayerInfo
{
// existence checked by displayId != 0
- PlayerInfo() : mapId(0), areaId(0), positionX(0.0f), positionY(0.0f), positionZ(0.0f), orientation(0.0f), displayId_m(0), displayId_f(0), levelInfo(NULL) { }
+ PlayerInfo() : mapId(0), areaId(0), positionX(0.0f), positionY(0.0f), positionZ(0.0f), orientation(0.0f), displayId_m(0), displayId_f(0), levelInfo(nullptr) { }
uint32 mapId;
uint32 areaId;
@@ -267,6 +269,7 @@ struct PlayerInfo
uint16 displayId_f;
PlayerCreateInfoItems item;
PlayerCreateInfoSpells customSpells;
+ PlayerCreateInfoSpells castSpells;
PlayerCreateInfoActions action;
PlayerCreateInfoSkills skills;
@@ -286,7 +289,7 @@ struct PvPInfo
struct DuelInfo
{
- DuelInfo() : initiator(NULL), opponent(NULL), startTimer(0), startTime(0), outOfBound(0), isMounted(false) { }
+ DuelInfo() : initiator(nullptr), opponent(nullptr), startTimer(0), startTime(0), outOfBound(0), isMounted(false), isCompleted(false) { }
Player* initiator;
Player* opponent;
@@ -294,6 +297,7 @@ struct DuelInfo
time_t startTime;
time_t outOfBound;
bool isMounted;
+ bool isCompleted;
};
struct Areas
@@ -314,7 +318,7 @@ enum RuneCooldowns
RUNE_MISS_COOLDOWN = 1500 // cooldown applied on runes when the spell misses
};
-enum RuneType
+enum RuneType : uint8
{
RUNE_BLOOD = 0,
RUNE_UNHOLY = 1,
@@ -348,7 +352,7 @@ struct Runes
struct EnchantDuration
{
- EnchantDuration() : item(NULL), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) { }
+ EnchantDuration() : item(nullptr), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) { }
EnchantDuration(Item* _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
leftduration(_leftduration){ ASSERT(item); }
@@ -414,50 +418,48 @@ enum PlayerFlags
PLAYER_FLAGS_UNK31 = 0x80000000
};
-// used for PLAYER__FIELD_KNOWN_TITLES field (uint64), (1<<bit_index) without (-1)
-// can't use enum for uint64 values
-#define PLAYER_TITLE_DISABLED UI64LIT(0x0000000000000000)
-#define PLAYER_TITLE_NONE UI64LIT(0x0000000000000001)
-#define PLAYER_TITLE_PRIVATE UI64LIT(0x0000000000000002) // 1
-#define PLAYER_TITLE_CORPORAL UI64LIT(0x0000000000000004) // 2
-#define PLAYER_TITLE_SERGEANT_A UI64LIT(0x0000000000000008) // 3
-#define PLAYER_TITLE_MASTER_SERGEANT UI64LIT(0x0000000000000010) // 4
-#define PLAYER_TITLE_SERGEANT_MAJOR UI64LIT(0x0000000000000020) // 5
-#define PLAYER_TITLE_KNIGHT UI64LIT(0x0000000000000040) // 6
-#define PLAYER_TITLE_KNIGHT_LIEUTENANT UI64LIT(0x0000000000000080) // 7
-#define PLAYER_TITLE_KNIGHT_CAPTAIN UI64LIT(0x0000000000000100) // 8
-#define PLAYER_TITLE_KNIGHT_CHAMPION UI64LIT(0x0000000000000200) // 9
-#define PLAYER_TITLE_LIEUTENANT_COMMANDER UI64LIT(0x0000000000000400) // 10
-#define PLAYER_TITLE_COMMANDER UI64LIT(0x0000000000000800) // 11
-#define PLAYER_TITLE_MARSHAL UI64LIT(0x0000000000001000) // 12
-#define PLAYER_TITLE_FIELD_MARSHAL UI64LIT(0x0000000000002000) // 13
-#define PLAYER_TITLE_GRAND_MARSHAL UI64LIT(0x0000000000004000) // 14
-#define PLAYER_TITLE_SCOUT UI64LIT(0x0000000000008000) // 15
-#define PLAYER_TITLE_GRUNT UI64LIT(0x0000000000010000) // 16
-#define PLAYER_TITLE_SERGEANT_H UI64LIT(0x0000000000020000) // 17
-#define PLAYER_TITLE_SENIOR_SERGEANT UI64LIT(0x0000000000040000) // 18
-#define PLAYER_TITLE_FIRST_SERGEANT UI64LIT(0x0000000000080000) // 19
-#define PLAYER_TITLE_STONE_GUARD UI64LIT(0x0000000000100000) // 20
-#define PLAYER_TITLE_BLOOD_GUARD UI64LIT(0x0000000000200000) // 21
-#define PLAYER_TITLE_LEGIONNAIRE UI64LIT(0x0000000000400000) // 22
-#define PLAYER_TITLE_CENTURION UI64LIT(0x0000000000800000) // 23
-#define PLAYER_TITLE_CHAMPION UI64LIT(0x0000000001000000) // 24
-#define PLAYER_TITLE_LIEUTENANT_GENERAL UI64LIT(0x0000000002000000) // 25
-#define PLAYER_TITLE_GENERAL UI64LIT(0x0000000004000000) // 26
-#define PLAYER_TITLE_WARLORD UI64LIT(0x0000000008000000) // 27
-#define PLAYER_TITLE_HIGH_WARLORD UI64LIT(0x0000000010000000) // 28
-#define PLAYER_TITLE_GLADIATOR UI64LIT(0x0000000020000000) // 29
-#define PLAYER_TITLE_DUELIST UI64LIT(0x0000000040000000) // 30
-#define PLAYER_TITLE_RIVAL UI64LIT(0x0000000080000000) // 31
-#define PLAYER_TITLE_CHALLENGER UI64LIT(0x0000000100000000) // 32
-#define PLAYER_TITLE_SCARAB_LORD UI64LIT(0x0000000200000000) // 33
-#define PLAYER_TITLE_CONQUEROR UI64LIT(0x0000000400000000) // 34
-#define PLAYER_TITLE_JUSTICAR UI64LIT(0x0000000800000000) // 35
-#define PLAYER_TITLE_CHAMPION_OF_THE_NAARU UI64LIT(0x0000001000000000) // 36
-#define PLAYER_TITLE_MERCILESS_GLADIATOR UI64LIT(0x0000002000000000) // 37
-#define PLAYER_TITLE_OF_THE_SHATTERED_SUN UI64LIT(0x0000004000000000) // 38
-#define PLAYER_TITLE_HAND_OF_ADAL UI64LIT(0x0000008000000000) // 39
-#define PLAYER_TITLE_VENGEFUL_GLADIATOR UI64LIT(0x0000010000000000) // 40
+enum PlayerBytesOffsets
+{
+ PLAYER_BYTES_OFFSET_SKIN_ID = 0,
+ PLAYER_BYTES_OFFSET_FACE_ID = 1,
+ PLAYER_BYTES_OFFSET_HAIR_STYLE_ID = 2,
+ PLAYER_BYTES_OFFSET_HAIR_COLOR_ID = 3
+};
+
+enum PlayerBytes2Offsets
+{
+ PLAYER_BYTES_2_OFFSET_FACIAL_STYLE = 0,
+ PLAYER_BYTES_2_OFFSET_PARTY_TYPE = 1,
+ PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS = 2,
+ PLAYER_BYTES_2_OFFSET_REST_STATE = 3
+};
+
+enum PlayerBytes3Offsets
+{
+ PLAYER_BYTES_3_OFFSET_GENDER = 0,
+ PLAYER_BYTES_3_OFFSET_INEBRIATION = 1,
+ PLAYER_BYTES_3_OFFSET_PVP_TITLE = 2,
+ PLAYER_BYTES_3_OFFSET_ARENA_FACTION = 3
+};
+
+enum PlayerFieldBytesOffsets
+{
+ PLAYER_FIELD_BYTES_OFFSET_FLAGS = 0,
+ PLAYER_FIELD_BYTES_OFFSET_RAF_GRANTABLE_LEVEL = 1,
+ PLAYER_FIELD_BYTES_OFFSET_ACTION_BAR_TOGGLES = 2,
+ PLAYER_FIELD_BYTES_OFFSET_LIFETIME_MAX_PVP_RANK = 3
+};
+
+enum PlayerFieldBytes2Offsets
+{
+ PLAYER_FIELD_BYTES_2_OFFSET_OVERRIDE_SPELLS_ID = 0, // uint16!
+ PLAYER_FIELD_BYTES_2_OFFSET_IGNORE_POWER_REGEN_PREDICTION_MASK = 2,
+ PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION = 3
+};
+
+static_assert((PLAYER_FIELD_BYTES_2_OFFSET_OVERRIDE_SPELLS_ID & 1) == 0, "PLAYER_FIELD_BYTES_2_OFFSET_OVERRIDE_SPELLS_ID must be aligned to 2 byte boundary");
+
+#define PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET (PLAYER_FIELD_BYTES_2_OFFSET_OVERRIDE_SPELLS_ID / 2)
#define KNOWN_TITLES_SIZE 3
#define MAX_TITLE_INDEX (KNOWN_TITLES_SIZE*64) // 3 uint64 fields
@@ -583,7 +585,7 @@ enum PlayerSlots
#define INVENTORY_SLOT_BAG_0 255
-enum EquipmentSlots // 19 slots
+enum EquipmentSlots : uint8 // 19 slots
{
EQUIPMENT_SLOT_START = 0,
EQUIPMENT_SLOT_HEAD = 0,
@@ -608,13 +610,13 @@ enum EquipmentSlots // 19 slots
EQUIPMENT_SLOT_END = 19
};
-enum InventorySlots // 4 slots
+enum InventorySlots : uint8 // 4 slots
{
INVENTORY_SLOT_BAG_START = 19,
INVENTORY_SLOT_BAG_END = 23
};
-enum InventoryPackSlots // 16 slots
+enum InventoryPackSlots : uint8 // 16 slots
{
INVENTORY_SLOT_ITEM_START = 23,
INVENTORY_SLOT_ITEM_END = 39
@@ -639,7 +641,7 @@ enum BuyBackSlots // 12 slots
BUYBACK_SLOT_END = 86
};
-enum KeyRingSlots // 32 slots
+enum KeyRingSlots : uint8 // 32 slots
{
KEYRING_SLOT_START = 86,
KEYRING_SLOT_END = 118
@@ -749,7 +751,7 @@ enum TeleportToOptions
};
/// Type of environmental damages
-enum EnviromentalDamage
+enum EnviromentalDamage : uint8
{
DAMAGE_EXHAUSTED = 0,
DAMAGE_DROWNING = 1,
@@ -832,7 +834,7 @@ enum PlayerDelayedOperations
// Player summoning auto-decline time (in secs)
#define MAX_PLAYER_SUMMON_DELAY (2*MINUTE)
// Maximum money amount : 2^31 - 1
-extern uint32 const MAX_MONEY_AMOUNT;
+TC_GAME_API extern uint32 const MAX_MONEY_AMOUNT;
enum BindExtensionState
{
@@ -854,7 +856,7 @@ struct InstancePlayerBind
EXTENDED - won't be promoted to EXPIRED at next reset period, will instead be promoted to NORMAL */
BindExtensionState extendState;
- InstancePlayerBind() : save(NULL), perm(false), extendState(EXTEND_STATE_NORMAL) { }
+ InstancePlayerBind() : save(nullptr), perm(false), extendState(EXTEND_STATE_NORMAL) { }
};
struct AccessRequirement
@@ -901,7 +903,7 @@ enum ReferAFriendError
ERR_REFER_A_FRIEND_SUMMON_OFFLINE_S = 0x0D
};
-enum PlayerRestState
+enum PlayerRestState : uint8
{
REST_STATE_RESTED = 0x01,
REST_STATE_NOT_RAF_LINKED = 0x02,
@@ -918,7 +920,7 @@ enum PlayerCommandStates
CHEAT_WATERWALK = 0x10
};
-class PlayerTaxi
+class TC_GAME_API PlayerTaxi
{
public:
PlayerTaxi();
@@ -1013,15 +1015,29 @@ struct TradeStatusInfo
uint8 Slot;
};
-class Player : public Unit, public GridObject<Player>
+struct ResurrectionData
+{
+ ObjectGuid GUID;
+ WorldLocation Location;
+ uint32 Health;
+ uint32 Mana;
+ uint32 Aura;
+};
+
+#define SPELL_DK_RAISE_ALLY 46619
+
+class TC_GAME_API Player : public Unit, public GridObject<Player>
{
friend class WorldSession;
+ friend class CinematicMgr;
friend void Item::AddToUpdateQueueOf(Player* player);
friend void Item::RemoveFromUpdateQueueOf(Player* player);
public:
explicit Player(WorldSession* session);
~Player();
+ PlayerAI* AI() const { return reinterpret_cast<PlayerAI*>(i_AI); }
+
void CleanupsBeforeDelete(bool finalCleanup = true) override;
void AddToWorld() override;
@@ -1038,7 +1054,8 @@ class Player : public Unit, public GridObject<Player>
bool TeleportTo(WorldLocation const &loc, uint32 options = 0);
bool TeleportToBGEntryPoint();
- void SetSummonPoint(uint32 mapid, float x, float y, float z);
+ bool HasSummonPending() const;
+ void SendSummonRequestFrom(Unit* summoner);
void SummonIfPossible(bool agree);
bool Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo);
@@ -1058,12 +1075,12 @@ class Player : public Unit, public GridObject<Player>
void SendInitialPacketsBeforeAddToMap();
void SendInitialPacketsAfterAddToMap();
- void SendSupercededSpell(uint32 oldSpell, uint32 newSpell);
- void SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8 arg = 0);
- void SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint32 time, bool welcome);
+ void SendSupercededSpell(uint32 oldSpell, uint32 newSpell) const;
+ void SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8 arg = 0) const;
+ void SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint32 time, bool welcome) const;
- bool CanInteractWithQuestGiver(Object* questGiver);
- Creature* GetNPCIfCanInteractWith(ObjectGuid const& guid, uint32 npcflagmask);
+ bool CanInteractWithQuestGiver(Object* questGiver) const;
+ Creature* GetNPCIfCanInteractWith(ObjectGuid const& guid, uint32 npcflagmask) const;
GameObject* GetGameObjectIfCanInteractWith(ObjectGuid const& guid) const;
GameObject* GetGameObjectIfCanInteractWith(ObjectGuid const& guid, GameobjectTypes type) const;
@@ -1074,16 +1091,16 @@ class Player : public Unit, public GridObject<Player>
uint8 GetChatTag() const;
std::string autoReplyMsg;
- uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin=NULL);
+ uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin = nullptr) const;
- PlayerSocial *GetSocial() { return m_social; }
+ PlayerSocial *GetSocial() const { return m_social; }
PlayerTaxi m_taxi;
void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), getLevel()); }
- bool ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc = NULL, uint32 spellid = 0);
+ bool ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc = nullptr, uint32 spellid = 0);
bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 0);
void CleanupAfterTaxiFlight();
- void ContinueTaxiFlight();
+ void ContinueTaxiFlight() const;
// mount_id can be used in scripting calls
bool isAcceptWhispers() const { return (m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS) != 0; }
void SetAcceptWhispers(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
@@ -1136,12 +1153,16 @@ class Player : public Unit, public GridObject<Player>
/// Handles said message in regular chat based on declared language and in config pre-defined Range.
void Say(std::string const& text, Language language, WorldObject const* = nullptr) override;
+ void Say(uint32 textId, WorldObject const* target = nullptr) override;
/// Handles yelled message in regular chat based on declared language and in config pre-defined Range.
void Yell(std::string const& text, Language language, WorldObject const* = nullptr) override;
+ void Yell(uint32 textId, WorldObject const* target = nullptr) override;
/// Outputs an universal text which is supposed to be an action.
void TextEmote(std::string const& text, WorldObject const* = nullptr, bool = false) override;
+ void TextEmote(uint32 textId, WorldObject const* target = nullptr, bool isBossEmote = false) override;
/// Handles whispers from Addons and players based on sender, receiver's guid and language.
void Whisper(std::string const& text, Language language, Player* receiver, bool = false) override;
+ void Whisper(uint32 textId, Player* target, bool isBossWhisper = false) override;
/*********************************************************/
/*** STORAGE SYSTEM ***/
@@ -1150,8 +1171,8 @@ class Player : public Unit, public GridObject<Player>
void SetVirtualItemSlot(uint8 i, Item* item);
void SetSheath(SheathState sheathed) override; // overwrite Unit version
uint8 FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) const;
- uint32 GetItemCount(uint32 item, bool inBankAlso = false, Item* skipItem = NULL) const;
- uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = NULL) const;
+ uint32 GetItemCount(uint32 item, bool inBankAlso = false, Item* skipItem = nullptr) const;
+ uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = nullptr) const;
Item* GetItemByGuid(ObjectGuid guid) const;
Item* GetItemByEntry(uint32 entry) const;
Item* GetItemByPos(uint16 pos) const;
@@ -1169,18 +1190,18 @@ class Player : public Unit, public GridObject<Player>
static bool IsBagPos(uint16 pos);
static bool IsBankPos(uint16 pos) { return IsBankPos(pos >> 8, pos & 255); }
static bool IsBankPos(uint8 bag, uint8 slot);
- bool IsValidPos(uint16 pos, bool explicit_pos) { return IsValidPos(pos >> 8, pos & 255, explicit_pos); }
- bool IsValidPos(uint8 bag, uint8 slot, bool explicit_pos);
- uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_2, 2); }
- void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_2, 2, count); }
+ bool IsValidPos(uint16 pos, bool explicit_pos) const { return IsValidPos(pos >> 8, pos & 255, explicit_pos); }
+ bool IsValidPos(uint8 bag, uint8 slot, bool explicit_pos) const;
+ uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS); }
+ void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS, count); }
bool HasItemCount(uint32 item, uint32 count = 1, bool inBankAlso = false) const;
- bool HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem = NULL) const;
+ bool HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem = nullptr) const;
bool CanNoReagentCast(SpellInfo const* spellInfo) const;
bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const;
bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const;
InventoryResult CanTakeMoreSimilarItems(Item* pItem, uint32* itemLimitCategory = NULL) const { return CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem, NULL, itemLimitCategory); }
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, uint32* itemLimitCategory = NULL) const { return CanTakeMoreSimilarItems(entry, count, NULL, NULL, itemLimitCategory); }
- InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const;
+ InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = nullptr) const;
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap = false) const;
InventoryResult CanStoreItems(Item** items, int count, uint32* itemLimitCategory) const;
InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const;
@@ -1207,7 +1228,7 @@ class Player : public Unit, public GridObject<Player>
void StoreLootItem(uint8 lootSlot, Loot* loot);
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL, uint32* itemLimitCategory = NULL) const;
- InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const;
+ InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = nullptr, bool swap = false, uint32* no_space_count = nullptr) const;
void AddRefundReference(ObjectGuid it);
void DeleteRefundReference(ObjectGuid it);
@@ -1238,9 +1259,9 @@ class Player : public Unit, public GridObject<Player>
Item* GetItemFromBuyBackSlot(uint32 slot);
void RemoveItemFromBuyBackSlot(uint32 slot, bool del);
uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END-KEYRING_SLOT_START; }
- void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = NULL, uint32 itemid = 0);
- void SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param);
- void SendSellError(SellResult msg, Creature* creature, ObjectGuid guid, uint32 param);
+ void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = nullptr, uint32 itemid = 0) const;
+ void SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param) const;
+ void SendSellError(SellResult msg, Creature* creature, ObjectGuid guid, uint32 param) const;
void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; }
void AddArmorProficiency(uint32 newflag) { m_ArmorProficiency |= newflag; }
uint32 GetWeaponProficiency() const { return m_WeaponProficiency; }
@@ -1257,6 +1278,8 @@ class Player : public Unit, public GridObject<Player>
TradeData* GetTradeData() const { return m_trade; }
void TradeCancel(bool sendback);
+ CinematicMgr* GetCinematicMgr() const { return _cinematicMgr; }
+
void UpdateEnchantTime(uint32 time);
void UpdateSoulboundTradeItems();
void AddTradeableItem(Item* item);
@@ -1302,34 +1325,35 @@ class Player : public Unit, public GridObject<Player>
void PrepareQuestMenu(ObjectGuid guid);
void SendPreparedQuest(ObjectGuid guid);
bool IsActiveQuest(uint32 quest_id) const;
- Quest const* GetNextQuest(ObjectGuid guid, Quest const* quest);
+ Quest const* GetNextQuest(ObjectGuid guid, Quest const* quest) const;
bool CanSeeStartQuest(Quest const* quest);
bool CanTakeQuest(Quest const* quest, bool msg);
- bool CanAddQuest(Quest const* quest, bool msg);
+ bool CanAddQuest(Quest const* quest, bool msg) const;
bool CanCompleteQuest(uint32 quest_id);
bool CanCompleteRepeatableQuest(Quest const* quest);
bool CanRewardQuest(Quest const* quest, bool msg);
bool CanRewardQuest(Quest const* quest, uint32 reward, bool msg);
void AddQuestAndCheckCompletion(Quest const* quest, Object* questGiver);
void AddQuest(Quest const* quest, Object* questGiver);
+ void AbandonQuest(uint32 quest_id);
void CompleteQuest(uint32 quest_id);
void IncompleteQuest(uint32 quest_id);
void RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, bool announce = true);
void FailQuest(uint32 quest_id);
bool SatisfyQuestSkill(Quest const* qInfo, bool msg) const;
- bool SatisfyQuestLevel(Quest const* qInfo, bool msg);
- bool SatisfyQuestLog(bool msg);
+ bool SatisfyQuestLevel(Quest const* qInfo, bool msg) const;
+ bool SatisfyQuestLog(bool msg) const;
bool SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg);
bool SatisfyQuestClass(Quest const* qInfo, bool msg) const;
- bool SatisfyQuestRace(Quest const* qInfo, bool msg);
+ bool SatisfyQuestRace(Quest const* qInfo, bool msg) const;
bool SatisfyQuestReputation(Quest const* qInfo, bool msg);
- bool SatisfyQuestStatus(Quest const* qInfo, bool msg);
+ bool SatisfyQuestStatus(Quest const* qInfo, bool msg) const;
bool SatisfyQuestConditions(Quest const* qInfo, bool msg);
- bool SatisfyQuestTimed(Quest const* qInfo, bool msg);
+ bool SatisfyQuestTimed(Quest const* qInfo, bool msg) const;
bool SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg);
- bool SatisfyQuestNextChain(Quest const* qInfo, bool msg);
+ bool SatisfyQuestNextChain(Quest const* qInfo, bool msg) const;
bool SatisfyQuestPrevChain(Quest const* qInfo, bool msg);
- bool SatisfyQuestDay(Quest const* qInfo, bool msg);
+ bool SatisfyQuestDay(Quest const* qInfo, bool msg) const;
bool SatisfyQuestWeek(Quest const* qInfo, bool msg);
bool SatisfyQuestMonth(Quest const* qInfo, bool msg);
bool SatisfyQuestSeasonal(Quest const* qInfo, bool msg);
@@ -1340,10 +1364,11 @@ class Player : public Unit, public GridObject<Player>
void SetQuestStatus(uint32 questId, QuestStatus status, bool update = true);
void RemoveActiveQuest(uint32 questId, bool update = true);
void RemoveRewardedQuest(uint32 questId, bool update = true);
- void SendQuestUpdate(uint32 questId);
+ void SendQuestUpdate();
QuestGiverStatus GetQuestDialogStatus(Object* questGiver);
void SetDailyQuestStatus(uint32 quest_id);
+ bool IsDailyQuestDone(uint32 quest_id);
void SetWeeklyQuestStatus(uint32 quest_id);
void SetMonthlyQuestStatus(uint32 quest_id);
void SetSeasonalQuestStatus(uint32 quest_id);
@@ -1364,7 +1389,7 @@ class Player : public Unit, public GridObject<Player>
void SetQuestSlotTimer(uint16 slot, uint32 timer);
void SwapQuestSlot(uint16 slot1, uint16 slot2);
- uint16 GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry);
+ uint16 GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry) const;
void AreaExploredOrEventHappens(uint32 questId);
void GroupEventHappens(uint32 questId, WorldObject const* pEventObject);
void ItemAddedQuestCheck(uint32 entry, uint32 count);
@@ -1382,16 +1407,17 @@ class Player : public Unit, public GridObject<Player>
void UpdateForQuestWorldObjects();
bool CanShareQuest(uint32 questId) const;
- void SendQuestComplete(uint32 questId);
- void SendQuestReward(Quest const* quest, uint32 XP);
- void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK);
- void SendQuestTimerFailed(uint32 questId);
+ void SendQuestComplete(uint32 questId) const;
+ void SendQuestReward(Quest const* quest, uint32 XP) const;
+ void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK) const;
+ void SendQuestTimerFailed(uint32 questId) const;
void SendCanTakeQuestResponse(QuestFailedReason msg) const;
- void SendQuestConfirmAccept(Quest const* quest, Player* pReceiver);
- void SendPushToPartyResponse(Player* player, uint8 msg);
- void SendQuestUpdateAddItem(Quest const* quest, uint32 itemIdx, uint16 count);
+ void SendQuestConfirmAccept(Quest const* quest, Player* pReceiver) const;
+ void SendPushToPartyResponse(Player* player, uint8 msg) const;
+ void SendQuestUpdateAddItem(Quest const* quest, uint32 itemIdx, uint16 count) const;
void SendQuestUpdateAddCreatureOrGo(Quest const* quest, ObjectGuid guid, uint32 creatureOrGOIdx, uint16 oldCount, uint16 addCount);
void SendQuestUpdateAddPlayer(Quest const* quest, uint16 oldCount, uint16 addCount);
+ void SendQuestGiverStatusMultiple();
ObjectGuid GetDivider() const { return m_divider; }
void SetDivider(ObjectGuid guid) { m_divider = guid; }
@@ -1427,10 +1453,9 @@ class Player : public Unit, public GridObject<Player>
void SaveToDB(bool create = false);
void SaveInventoryAndGoldToDB(SQLTransaction& trans); // fast save function for item/money cheating preventing
- void SaveGoldToDB(SQLTransaction& trans);
+ void SaveGoldToDB(SQLTransaction& trans) const;
static void SetUInt32ValueInArray(Tokenizer& data, uint16 index, uint32 value);
- static void SetFloatValueInArray(Tokenizer& data, uint16 index, float value);
static void Customize(CharacterCustomizeInfo const* customizeInfo, SQLTransaction& trans);
static void SavePositionInDB(WorldLocation const& loc, uint16 zoneId, ObjectGuid guid, SQLTransaction& trans);
@@ -1441,10 +1466,9 @@ class Player : public Unit, public GridObject<Player>
bool m_mailsLoaded;
bool m_mailsUpdated;
- void SetBindPoint(ObjectGuid guid);
- void SendTalentWipeConfirm(ObjectGuid guid);
+ void SetBindPoint(ObjectGuid guid) const;
+ void SendTalentWipeConfirm(ObjectGuid guid) const;
void ResetPetTalents();
- void CalcRage(uint32 damage, bool attacker);
void RegenerateAll();
void Regenerate(Powers power);
void RegenerateHealth();
@@ -1472,13 +1496,13 @@ class Player : public Unit, public GridObject<Player>
uint8 GetComboPoints() const { return m_comboPoints; }
ObjectGuid GetComboTarget() const { return m_comboTarget; }
- void AddComboPoints(Unit* target, int8 count, Spell* spell = NULL);
+ void AddComboPoints(Unit* target, int8 count, Spell* spell = nullptr);
void GainSpellComboPoints(int8 count);
void ClearComboPoints();
void SendComboPoints();
- void SendMailResult(uint32 mailId, MailResponseType mailAction, MailResponseResult mailError, uint32 equipError = 0, ObjectGuid::LowType item_guid = 0, uint32 item_count = 0);
- void SendNewMail();
+ void SendMailResult(uint32 mailId, MailResponseType mailAction, MailResponseResult mailError, uint32 equipError = 0, ObjectGuid::LowType item_guid = 0, uint32 item_count = 0) const;
+ void SendNewMail() const;
void UpdateNextMailTimeAndUnreads();
void AddNewMailDeliverTime(time_t deliver_time);
bool IsMailsLoaded() const { return m_mailsLoaded; }
@@ -1509,19 +1533,19 @@ class Player : public Unit, public GridObject<Player>
void AddMItem(Item* it);
bool RemoveMItem(uint32 id);
- void SendOnCancelExpectedVehicleRideAura();
+ void SendOnCancelExpectedVehicleRideAura() const;
void PetSpellInitialize();
void CharmSpellInitialize();
void PossessSpellInitialize();
void VehicleSpellInitialize();
- void SendRemoveControlBar();
+ void SendRemoveControlBar() const;
bool HasSpell(uint32 spell) const override;
bool HasActiveSpell(uint32 spell) const; // show in spellbook
TrainerSpellState GetTrainerSpellState(TrainerSpell const* trainer_spell) const;
bool IsSpellFitByClassAndRace(uint32 spell_id) const;
bool IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const;
- void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask);
+ void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) const;
void SendInitialSpells();
bool AddSpell(uint32 spellId, bool active, bool learning, bool dependent, bool disabled, bool loading = false, uint32 fromSkill = 0);
void LearnSpell(uint32 spell_id, bool dependent, uint32 fromSkill = 0);
@@ -1537,7 +1561,7 @@ class Player : public Unit, public GridObject<Player>
void RemoveTemporarySpell(uint32 spellId);
void SetReputation(uint32 factionentry, uint32 value);
uint32 GetReputation(uint32 factionentry) const;
- std::string const& GetGuildName();
+ std::string const& GetGuildName() const;
uint32 GetFreeTalentPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS1); }
void SetFreeTalentPoints(uint32 points);
bool ResetTalents(bool no_cost = false);
@@ -1576,26 +1600,40 @@ class Player : public Unit, public GridObject<Player>
PlayerSpellMap & GetSpellMap() { return m_spells; }
void AddSpellMod(SpellModifier* mod, bool apply);
- bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = NULL);
- template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell = NULL);
+ bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = nullptr) const;
+ template <class T>
+ void ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* spell = nullptr);
void RemoveSpellMods(Spell* spell);
- void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = NULL);
- void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = NULL);
+ void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = nullptr);
+ void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = nullptr);
void DropModCharge(SpellModifier* mod, Spell* spell);
void SetSpellModTakingSpell(Spell* spell, bool apply);
void RemoveArenaSpellCooldowns(bool removeActivePetCooldowns = false);
uint32 GetLastPotionId() const { return m_lastPotionId; }
void SetLastPotionId(uint32 item_id) { m_lastPotionId = item_id; }
- void UpdatePotionCooldown(Spell* spell = NULL);
+ void UpdatePotionCooldown(Spell* spell = nullptr);
- void setResurrectRequestData(ObjectGuid guid, uint32 mapId, float X, float Y, float Z, uint32 health, uint32 mana);
- void clearResurrectRequestData();
- bool isResurrectRequestedBy(ObjectGuid guid) const { return !m_resurrectGUID.IsEmpty() && m_resurrectGUID == guid; }
- bool isResurrectRequested() const { return !m_resurrectGUID.IsEmpty(); }
+ void SetResurrectRequestData(Unit* caster, uint32 health, uint32 mana, uint32 appliedAura);
+
+ void ClearResurrectRequestData()
+ {
+ _resurrectionData.reset();
+ }
+
+ bool IsResurrectRequestedBy(ObjectGuid const& guid) const
+ {
+ if (!IsResurrectRequested())
+ return false;
+
+ return !_resurrectionData->GUID.IsEmpty() && _resurrectionData->GUID == guid;
+ }
+
+ bool IsResurrectRequested() const { return _resurrectionData.get() != nullptr; }
void ResurrectUsingRequestData();
+ void ResurrectUsingRequestDataImpl();
- uint8 getCinematic() { return m_cinematic; }
+ uint8 getCinematic() const { return m_cinematic; }
void setCinematic(uint8 cine) { m_cinematic = cine; }
ActionButton* addActionButton(uint8 button, uint32 action, uint8 type);
@@ -1603,11 +1641,11 @@ class Player : public Unit, public GridObject<Player>
ActionButton const* GetActionButton(uint8 button);
void SendInitialActionButtons() const { SendActionButtons(1); }
void SendActionButtons(uint32 state) const;
- bool IsActionButtonDataValid(uint8 button, uint32 action, uint8 type);
+ bool IsActionButtonDataValid(uint8 button, uint32 action, uint8 type) const;
PvPInfo pvpInfo;
void UpdatePvPState(bool onlyFFA = false);
- void SetPvP(bool state);
+ void SetPvP(bool state) override;
void UpdatePvP(bool state, bool override=false);
void UpdateZone(uint32 newZone, uint32 newArea);
void UpdateArea(uint32 newArea);
@@ -1633,7 +1671,7 @@ class Player : public Unit, public GridObject<Player>
bool IsInSameGroupWith(Player const* p) const;
bool IsInSameRaidWith(Player const* p) const;
void UninviteFromGroup();
- static void RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, const char* reason = NULL);
+ static void RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, const char* reason = nullptr);
void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); }
void SendUpdateToOutOfRangeGroupMembers();
@@ -1700,13 +1738,13 @@ class Player : public Unit, public GridObject<Player>
void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) override;
void UpdateDefenseBonusesMod();
- inline void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);}
- float GetMeleeCritFromAgility();
- void GetDodgeFromAgility(float &diminishing, float &nondiminishing);
+ void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);}
+ float GetMeleeCritFromAgility() const;
+ void GetDodgeFromAgility(float &diminishing, float &nondiminishing) const;
float GetMissPercentageFromDefence() const;
- float GetSpellCritFromIntellect();
- float OCTRegenHPPerSpirit();
- float OCTRegenMPPerSpirit();
+ float GetSpellCritFromIntellect() const;
+ float OCTRegenHPPerSpirit() const;
+ float OCTRegenMPPerSpirit() const;
float GetRatingMultiplier(CombatRating cr) const;
float GetRatingBonusValue(CombatRating cr) const;
uint32 GetBaseSpellPowerBonus() const { return m_baseSpellPower; }
@@ -1744,26 +1782,26 @@ class Player : public Unit, public GridObject<Player>
void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const override;
void DestroyForPlayer(Player* target, bool onDeath = false) const override;
- void SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool recruitAFriend = false, float group_rate=1.0f);
+ void SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool recruitAFriend = false, float group_rate=1.0f) const;
// notifiers
- void SendAttackSwingCantAttack();
- void SendAttackSwingCancelAttack();
- void SendAttackSwingDeadTarget();
- void SendAttackSwingNotInRange();
- void SendAttackSwingBadFacingAttack();
+ void SendAttackSwingCantAttack() const;
+ void SendAttackSwingCancelAttack() const;
+ void SendAttackSwingDeadTarget() const;
+ void SendAttackSwingNotInRange() const;
+ void SendAttackSwingBadFacingAttack() const;
void SendAutoRepeatCancel(Unit* target);
- void SendExplorationExperience(uint32 Area, uint32 Experience);
+ void SendExplorationExperience(uint32 Area, uint32 Experience) const;
- void SendDungeonDifficulty(bool IsInGroup);
- void SendRaidDifficulty(bool IsInGroup, int32 forcedDifficulty = -1);
+ void SendDungeonDifficulty(bool IsInGroup) const;
+ void SendRaidDifficulty(bool IsInGroup, int32 forcedDifficulty = -1) const;
void ResetInstances(uint8 method, bool isRaid);
- void SendResetInstanceSuccess(uint32 MapId);
- void SendResetInstanceFailed(uint32 reason, uint32 MapId);
- void SendResetFailedNotify(uint32 mapid);
+ void SendResetInstanceSuccess(uint32 MapId) const;
+ void SendResetInstanceFailed(uint32 reason, uint32 MapId) const;
+ void SendResetFailedNotify(uint32 mapid) const;
- virtual bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false) override;
- bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
+ bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false) override;
+ bool UpdatePosition(const Position &pos, bool teleport = false) override { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
void UpdateUnderwaterState(Map* m, float x, float y, float z) override;
void SendMessageToSet(WorldPacket* data, bool self) override { SendMessageToSetInRange(data, GetVisibilityRange(), self); }
@@ -1784,14 +1822,7 @@ class Player : public Unit, public GridObject<Player>
void ResurrectPlayer(float restore_percent, bool applySickness = false);
void BuildPlayerRepop();
void RepopAtGraveyard();
- void SendGhoulResurrectRequest(Player* target);
- bool IsValidGhoulResurrectRequest(ObjectGuid guid)
- {
- return !m_ghoulResurrectPlayerGUID.IsEmpty() && m_ghoulResurrectPlayerGUID == guid;
- }
- void GhoulResurrect();
- void SetGhoulResurrectGhoulGUID(ObjectGuid guid) { m_ghoulResurrectGhoulGUID = guid; }
- ObjectGuid GetGhoulResurrectGhoulGUID() { return m_ghoulResurrectGhoulGUID; }
+
void RemoveGhoul();
void DurabilityLossAll(double percent, bool inventory);
@@ -1804,11 +1835,11 @@ class Player : public Unit, public GridObject<Player>
void UpdateMirrorTimers();
void StopMirrorTimers();
- bool IsMirrorTimerActive(MirrorTimerType type);
+ bool IsMirrorTimerActive(MirrorTimerType type) const;
void SetMovement(PlayerMovementType pType);
- bool CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone);
+ bool CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone) const;
void JoinedChannel(Channel* c);
void LeftChannel(Channel* c);
@@ -1893,14 +1924,14 @@ class Player : public Unit, public GridObject<Player>
//End of PvP System
void SetDrunkValue(uint8 newDrunkValue, uint32 itemId = 0);
- uint8 GetDrunkValue() const { return GetByteValue(PLAYER_BYTES_3, 1); }
+ uint8 GetDrunkValue() const { return GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_INEBRIATION); }
static DrunkenState GetDrunkenstateByValue(uint8 value);
uint32 GetDeathTimer() const { return m_deathTimer; }
uint32 GetCorpseReclaimDelay(bool pvp) const;
void UpdateCorpseReclaimDelay();
- int32 CalculateCorpseReclaimDelay(bool load = false);
- void SendCorpseReclaimDelay(uint32 delay);
+ int32 CalculateCorpseReclaimDelay(bool load = false) const;
+ void SendCorpseReclaimDelay(uint32 delay) const;
uint32 GetShieldBlockValue() const override; // overwrite Unit version (virtual)
bool CanParry() const { return m_canParry; }
@@ -1933,7 +1964,7 @@ class Player : public Unit, public GridObject<Player>
void _ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply, bool only_level_scale = false);
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingStatValuesEntry const* ssv, bool apply);
void _ApplyAmmoBonuses();
- bool EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot);
+ bool EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) const;
void ToggleMetaGemsActive(uint8 exceptslot, bool apply);
void CorrectMetaGemEnchants(uint8 slot, bool apply);
void InitDataForForm(bool reapplyMods = false);
@@ -1950,21 +1981,21 @@ class Player : public Unit, public GridObject<Player>
void DeleteEquipmentSet(uint64 setGuid);
void SendInitWorldStates(uint32 zone, uint32 area);
- void SendUpdateWorldState(uint32 Field, uint32 Value);
- void SendDirectMessage(WorldPacket* data);
- void SendBGWeekendWorldStates();
- void SendBattlefieldWorldStates();
+ void SendUpdateWorldState(uint32 Field, uint32 Value) const;
+ void SendDirectMessage(WorldPacket const* data) const;
+ void SendBGWeekendWorldStates() const;
+ void SendBattlefieldWorldStates() const;
- void SendAurasForTarget(Unit* target);
+ void SendAurasForTarget(Unit* target) const;
PlayerMenu* PlayerTalkClass;
std::vector<ItemSetEffect*> ItemSetEff;
void SendLoot(ObjectGuid guid, LootType loot_type);
- void SendLootError(ObjectGuid guid, LootError error);
- void SendLootRelease(ObjectGuid guid);
- void SendNotifyLootItemRemoved(uint8 lootSlot);
- void SendNotifyLootMoneyRemoved();
+ void SendLootError(ObjectGuid guid, LootError error) const;
+ void SendLootRelease(ObjectGuid guid) const;
+ void SendNotifyLootItemRemoved(uint8 lootSlot) const;
+ void SendNotifyLootMoneyRemoved() const;
/*********************************************************/
/*** BATTLEGROUND SYSTEM ***/
@@ -1985,7 +2016,7 @@ class Player : public Unit, public GridObject<Player>
void SetBattlegroundId(uint32 val, BattlegroundTypeId bgTypeId);
uint32 AddBattlegroundQueueId(BattlegroundQueueTypeId val);
- bool HasFreeBattlegroundQueueId();
+ bool HasFreeBattlegroundQueueId() const;
void RemoveBattlegroundQueueId(BattlegroundQueueTypeId val);
void SetInviteForBattlegroundQueueType(BattlegroundQueueTypeId bgQueueTypeId, uint32 instanceId);
bool IsInvitedForBattlegroundInstance(uint32 instanceId) const;
@@ -2002,10 +2033,10 @@ class Player : public Unit, public GridObject<Player>
void ClearAfkReports() { m_bgData.bgAfkReporter.clear(); }
bool GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const;
- bool isTotalImmunity();
- bool CanUseBattlegroundObject(GameObject* gameobject);
- bool isTotalImmune();
- bool CanCaptureTowerPoint();
+ bool isTotalImmunity() const;
+ bool CanUseBattlegroundObject(GameObject* gameobject) const;
+ bool isTotalImmune() const;
+ bool CanCaptureTowerPoint() const;
bool GetRandomWinner() const { return m_IsBGRandomWinner; }
void SetRandomWinner(bool isWinner);
@@ -2016,13 +2047,13 @@ class Player : public Unit, public GridObject<Player>
OutdoorPvP* GetOutdoorPvP() const;
// returns true if the player is in active state for outdoor pvp objective capturing, false otherwise
- bool IsOutdoorPvPActive();
+ bool IsOutdoorPvPActive() const;
/*********************************************************/
/*** ENVIROMENTAL SYSTEM ***/
/*********************************************************/
- bool IsImmuneToEnvironmentalDamage();
+ bool IsImmuneToEnvironmentalDamage() const;
uint32 EnvironmentalDamage(EnviromentalDamage type, uint32 damage);
/*********************************************************/
@@ -2052,18 +2083,13 @@ class Player : public Unit, public GridObject<Player>
void SetViewpoint(WorldObject* target, bool apply);
WorldObject* GetViewpoint() const;
void StopCastingCharm();
- void StopCastingBindSight();
+ void StopCastingBindSight() const;
uint32 GetSaveTimer() const { return m_nextSave; }
void SetSaveTimer(uint32 timer) { m_nextSave = timer; }
- // Recall position
- uint32 m_recallMap;
- float m_recallX;
- float m_recallY;
- float m_recallZ;
- float m_recallO;
- void SaveRecallPosition();
+ void SaveRecallPosition() { m_recall_location.WorldRelocate(*this); }
+ void Recall() { TeleportTo(m_recall_location); }
void SetHomebind(WorldLocation const& loc, uint32 areaId);
@@ -2079,13 +2105,13 @@ class Player : public Unit, public GridObject<Player>
// currently visible objects at player client
GuidUnorderedSet m_clientGUIDs;
- bool HaveAtClient(WorldObject const* u) const;
+ bool HaveAtClient(Object const* u) const;
bool IsNeverVisible() const override;
bool IsVisibleGloballyFor(Player const* player) const;
- void SendInitialVisiblePackets(Unit* target);
+ void SendInitialVisiblePackets(Unit* target) const;
void UpdateObjectVisibility(bool forced = true) override;
void UpdateVisibilityForPlayer();
void UpdateVisibilityOf(WorldObject* target);
@@ -2100,8 +2126,8 @@ class Player : public Unit, public GridObject<Player>
void SetAtLoginFlag(AtLoginFlags f) { m_atLoginFlags |= f; }
void RemoveAtLoginFlag(AtLoginFlags flags, bool persist = false);
- bool isUsingLfg();
- bool inRandomLfgDungeon();
+ bool isUsingLfg() const;
+ bool inRandomLfgDungeon() const;
typedef std::set<uint32> DFQuestsDoneList;
DFQuestsDoneList m_DFQuests;
@@ -2113,8 +2139,10 @@ class Player : public Unit, public GridObject<Player>
void ResummonPetTemporaryUnSummonedIfAny();
bool IsPetNeedBeTemporaryUnsummoned() const;
- void SendCinematicStart(uint32 CinematicSequenceId);
- void SendMovieStart(uint32 MovieId);
+ void SendCinematicStart(uint32 CinematicSequenceId) const;
+ void SendMovieStart(uint32 MovieId) const;
+
+ uint32 DoRandomRoll(uint32 minimum, uint32 maximum);
/*********************************************************/
/*** INSTANCE SYSTEM ***/
@@ -2152,10 +2180,10 @@ class Player : public Unit, public GridObject<Player>
/*** GROUP SYSTEM ***/
/*********************************************************/
- Group* GetGroupInvite() { return m_groupInvite; }
+ Group* GetGroupInvite() const { return m_groupInvite; }
void SetGroupInvite(Group* group) { m_groupInvite = group; }
Group* GetGroup() { return m_group.getTarget(); }
- const Group* GetGroup() const { return (const Group*)m_group.getTarget(); }
+ Group const* GetGroup() const { return const_cast<Group const*>(m_group.getTarget()); }
GroupReference& GetGroupRef() { return m_group; }
void SetGroup(Group* group, int8 subgroup = -1);
uint8 GetSubGroup() const { return m_group.getSubGroup(); }
@@ -2169,7 +2197,7 @@ class Player : public Unit, public GridObject<Player>
// Battleground / Battlefield Group System
void SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup = -1);
void RemoveFromBattlegroundOrBattlefieldRaid();
- Group* GetOriginalGroup() { return m_originalGroup.getTarget(); }
+ Group* GetOriginalGroup() const { return m_originalGroup.getTarget(); }
GroupReference& GetOriginalGroupRef() { return m_originalGroup; }
uint8 GetOriginalSubGroup() const { return m_originalGroup.getSubGroup(); }
void SetOriginalGroup(Group* group, int8 subgroup = -1);
@@ -2202,8 +2230,8 @@ class Player : public Unit, public GridObject<Player>
void RemoveRunesByAuraEffect(AuraEffect const* aura);
void RestoreBaseRune(uint8 index);
void ConvertRune(uint8 index, RuneType newType);
- void ResyncRunes(uint8 count);
- void AddRunePower(uint8 index);
+ void ResyncRunes(uint8 count) const;
+ void AddRunePower(uint8 index) const;
void InitRunes();
void SendRespondInspectAchievements(Player* player) const;
@@ -2227,7 +2255,7 @@ class Player : public Unit, public GridObject<Player>
void SetChampioningFaction(uint32 faction) { m_ChampioningFaction = faction; }
Spell* m_spellModTakingSpell;
- float GetAverageItemLevel();
+ float GetAverageItemLevel() const;
bool isDebugAreaTriggers;
void ClearWhisperWhiteList() { WhisperList.clear(); }
@@ -2246,8 +2274,8 @@ class Player : public Unit, public GridObject<Player>
//! Return collision height sent to client
float GetCollisionHeight(bool mounted) const;
- std::string GetMapAreaAndZoneString();
- std::string GetCoordsMapAreaAndZoneString();
+ std::string GetMapAreaAndZoneString() const;
+ std::string GetCoordsMapAreaAndZoneString() const;
protected:
// Gamemaster whisper whitelist
@@ -2338,9 +2366,9 @@ class Player : public Unit, public GridObject<Player>
void _SaveSpells(SQLTransaction& trans);
void _SaveEquipmentSets(SQLTransaction& trans);
void _SaveBGData(SQLTransaction& trans);
- void _SaveGlyphs(SQLTransaction& trans);
+ void _SaveGlyphs(SQLTransaction& trans) const;
void _SaveTalents(SQLTransaction& trans);
- void _SaveStats(SQLTransaction& trans);
+ void _SaveStats(SQLTransaction& trans) const;
void _SaveInstanceTimeRestrictions(SQLTransaction& trans);
/*********************************************************/
@@ -2350,7 +2378,7 @@ class Player : public Unit, public GridObject<Player>
void SendMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, int32 Regen);
void StopMirrorTimer(MirrorTimerType Type);
void HandleDrowning(uint32 time_diff);
- int32 getMaxTimer(MirrorTimerType timer);
+ int32 getMaxTimer(MirrorTimerType timer) const;
/*********************************************************/
/*** HONOR SYSTEM ***/
@@ -2421,13 +2449,7 @@ class Player : public Unit, public GridObject<Player>
void ResetTimeSync();
void SendTimeSync();
- ObjectGuid m_resurrectGUID;
- uint32 m_resurrectMap;
- float m_resurrectX, m_resurrectY, m_resurrectZ;
- uint32 m_resurrectHealth, m_resurrectMana;
-
- ObjectGuid m_ghoulResurrectPlayerGUID;
- ObjectGuid m_ghoulResurrectGhoulGUID;
+ std::unique_ptr<ResurrectionData> _resurrectionData;
WorldSession* m_session;
@@ -2489,10 +2511,10 @@ class Player : public Unit, public GridObject<Player>
// Player summoning
time_t m_summon_expire;
- uint32 m_summon_mapid;
- float m_summon_x;
- float m_summon_y;
- float m_summon_z;
+ WorldLocation m_summon_location;
+
+ // Recall position
+ WorldLocation m_recall_location;
DeclinedName *m_declinedname;
Runes *m_runes;
@@ -2514,6 +2536,8 @@ class Player : public Unit, public GridObject<Player>
Item* _StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update);
Item* _LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields);
+ CinematicMgr* _cinematicMgr;
+
GuidSet m_refundableItems;
void SendRefundInfo(Item* item);
void RefundItem(Item* item);
@@ -2533,8 +2557,6 @@ class Player : public Unit, public GridObject<Player>
MapReference m_mapRef;
- void UpdateCharmedAI();
-
uint32 m_lastFallTime;
float m_lastFallZ;
@@ -2584,15 +2606,17 @@ class Player : public Unit, public GridObject<Player>
WorldLocation _corpseLocation;
};
-void AddItemsSetItem(Player* player, Item* item);
-void RemoveItemsSetItem(Player* player, ItemTemplate const* proto);
+TC_GAME_API void AddItemsSetItem(Player* player, Item* item);
+TC_GAME_API void RemoveItemsSetItem(Player* player, ItemTemplate const* proto);
// "the bodies of template functions must be made available in a header file"
-template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell)
+template <class T>
+void Player::ApplySpellMod(uint32 spellId, SpellModOp op, T& basevalue, Spell* spell /*= nullptr*/)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
- return 0;
+ return;
+
float totalmul = 1.0f;
int32 totalflat = 0;
@@ -2628,9 +2652,8 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
DropModCharge(mod, spell);
}
- float diff = (float)basevalue * (totalmul - 1.0f) + (float)totalflat;
- basevalue = T((float)basevalue + diff);
- return T(diff);
+
+ basevalue = T(float(basevalue + totalflat) * totalmul);
}
#endif
diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp
index ffb2d8a7dd8..809bdd0bf6f 100644
--- a/src/server/game/Entities/Player/SocialMgr.cpp
+++ b/src/server/game/Entities/Player/SocialMgr.cpp
@@ -195,6 +195,12 @@ SocialMgr::SocialMgr() { }
SocialMgr::~SocialMgr() { }
+SocialMgr* SocialMgr::instance()
+{
+ static SocialMgr instance;
+ return &instance;
+}
+
void SocialMgr::GetFriendInfo(Player* player, ObjectGuid::LowType friendGUID, FriendInfo &friendInfo)
{
if (!player)
diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h
index 8f8ed04b5fb..803301b95c7 100644
--- a/src/server/game/Entities/Player/SocialMgr.h
+++ b/src/server/game/Entities/Player/SocialMgr.h
@@ -99,7 +99,7 @@ enum FriendsResult
#define SOCIALMGR_FRIEND_LIMIT 50
#define SOCIALMGR_IGNORE_LIMIT 50
-class PlayerSocial
+class TC_GAME_API PlayerSocial
{
friend class SocialMgr;
public:
@@ -128,11 +128,7 @@ class SocialMgr
~SocialMgr();
public:
- static SocialMgr* instance()
- {
- static SocialMgr instance;
- return &instance;
- }
+ static SocialMgr* instance();
// Misc
void RemovePlayerSocial(ObjectGuid::LowType guid) { m_socialMap.erase(guid); }
diff --git a/src/server/game/Entities/Player/TradeData.h b/src/server/game/Entities/Player/TradeData.h
index 276e6f3db1c..396d784fee7 100644
--- a/src/server/game/Entities/Player/TradeData.h
+++ b/src/server/game/Entities/Player/TradeData.h
@@ -31,7 +31,7 @@ enum TradeSlots
class Item;
class Player;
-class TradeData
+class TC_GAME_API TradeData
{
public:
TradeData(Player* player, Player* trader) :
diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h
index bbe7943f4b6..42be4525a0c 100644
--- a/src/server/game/Entities/Totem/Totem.h
+++ b/src/server/game/Entities/Totem/Totem.h
@@ -32,7 +32,7 @@ enum TotemType
#define SENTRY_TOTEM_ENTRY 3968
-class Totem : public Minion
+class TC_GAME_API Totem : public Minion
{
public:
Totem(SummonPropertiesEntry const* properties, Unit* owner);
diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp
index 5e5c6901471..0d97e120fff 100644
--- a/src/server/game/Entities/Transport/Transport.cpp
+++ b/src/server/game/Entities/Transport/Transport.cpp
@@ -92,7 +92,8 @@ bool Transport::Create(ObjectGuid::LowType guidlow, uint32 entry, uint32 mapid,
SetGoType(GAMEOBJECT_TYPE_MO_TRANSPORT);
SetGoAnimProgress(animprogress);
SetName(goinfo->name);
- UpdateRotationFields(0.0f, 1.0f);
+ SetWorldRotation(G3D::Quat());
+ SetParentRotation(G3D::Quat());
m_model = CreateModel();
return true;
diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h
index 987fbf70739..4cd20c8b613 100644
--- a/src/server/game/Entities/Transport/Transport.h
+++ b/src/server/game/Entities/Transport/Transport.h
@@ -25,7 +25,7 @@
struct CreatureData;
-class Transport : public GameObject, public TransportBase
+class TC_GAME_API Transport : public GameObject, public TransportBase
{
friend Transport* TransportMgr::CreateTransport(uint32, ObjectGuid::LowType, Map*);
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index 39a97d4f5a0..def6c382893 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -1152,7 +1152,7 @@ bool Guardian::UpdateStats(Stats stat)
if (itr != ToPet()->m_spells.end()) // If pet has Wild Hunt
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
AddPct(mod, spellInfo->Effects[EFFECT_0].CalcValue());
}
}
@@ -1321,7 +1321,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
if (itr != ToPet()->m_spells.end()) // If pet has Wild Hunt
{
- SpellInfo const* sProto = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
+ SpellInfo const* sProto = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
mod += CalculatePct(1.0f, sProto->Effects[1].CalcValue());
}
}
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 4454b344741..ac924f39a03 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -45,6 +45,7 @@
#include "PetAI.h"
#include "Pet.h"
#include "Player.h"
+#include "PlayerAI.h"
#include "QuestDef.h"
#include "ReputationMgr.h"
#include "SpellAuraEffects.h"
@@ -458,12 +459,6 @@ void Unit::resetAttackTimer(WeaponAttackType type)
m_attackTimer[type] = uint32(GetAttackTime(type) * m_modAttackSpeedPct[type]);
}
-float Unit::GetMeleeReach() const
-{
- float reach = m_floatValues[UNIT_FIELD_COMBATREACH];
- return reach > MIN_MELEE_REACH ? reach : MIN_MELEE_REACH;
-}
-
bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const
{
if (!obj || !IsInMap(obj) || !InSamePhase(obj))
@@ -480,7 +475,7 @@ bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const
return distsq < maxdist * maxdist;
}
-bool Unit::IsWithinMeleeRange(const Unit* obj, float dist) const
+bool Unit::IsWithinMeleeRange(Unit const* obj) const
{
if (!obj || !IsInMap(obj) || !InSamePhase(obj))
return false;
@@ -490,10 +485,9 @@ bool Unit::IsWithinMeleeRange(const Unit* obj, float dist) const
float dz = GetPositionZMinusOffset() - obj->GetPositionZMinusOffset();
float distsq = dx*dx + dy*dy + dz*dz;
- float sizefactor = GetMeleeReach() + obj->GetMeleeReach();
- float maxdist = dist + sizefactor;
+ float maxdist = GetCombatReach() + obj->GetCombatReach() + 4.0f / 3.0f;
- return distsq < maxdist * maxdist;
+ return distsq <= maxdist * maxdist;
}
void Unit::GetRandomContactPoint(const Unit* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const
@@ -577,7 +571,7 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) cons
void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb)
{
- if (!victim || !victim->IsAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
+ if (!victim || !victim->IsAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks()))
{
if (absorb)
*absorb += damage;
@@ -598,11 +592,14 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
if (victim->GetTypeId() == TYPEID_PLAYER && this != victim)
{
- // Signal to pets that their owner was attacked
- Pet* pet = victim->ToPlayer()->GetPet();
+ // Signal to pets that their owner was attacked - except when DOT.
+ if (damagetype != DOT)
+ {
+ Pet* pet = victim->ToPlayer()->GetPet();
- if (pet && pet->IsAlive())
- pet->AI()->OwnerAttackedBy(this);
+ if (pet && pet->IsAlive())
+ pet->AI()->OwnerAttackedBy(this);
+ }
if (victim->ToPlayer()->GetCommandStatus(CHEAT_GOD))
return 0;
@@ -623,6 +620,17 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
else
victim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TAKE_DAMAGE, 0);
+ // interrupt spells with SPELL_INTERRUPT_FLAG_ABORT_ON_DMG on absorbed damage (no dots)
+ if (!damage && damagetype != DOT && cleanDamage && cleanDamage->absorbed_damage)
+ if (victim != this && victim->GetTypeId() == TYPEID_PLAYER)
+ if (Spell* spell = victim->m_currentSpells[CURRENT_GENERIC_SPELL])
+ if (spell->getState() == SPELL_STATE_PREPARING)
+ {
+ uint32 interruptFlags = spell->m_spellInfo->InterruptFlags;
+ if ((interruptFlags & SPELL_INTERRUPT_FLAG_ABORT_ON_DMG) != 0)
+ victim->InterruptNonMeleeSpells(false);
+ }
+
// We're going to call functions which can modify content of the list during iteration over it's elements
// Let's copy the list so we can prevent iterator invalidation
AuraEffectList vCopyDamageCopy(victim->GetAuraEffectsByType(SPELL_AURA_SHARE_DAMAGE_PCT));
@@ -1119,7 +1127,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss)
if (!victim)
return;
- if (!victim->IsAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
+ if (!victim->IsAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks()))
return;
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(damageInfo->SpellID);
@@ -1345,7 +1353,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
{
Unit* victim = damageInfo->target;
- if (!victim->IsAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
+ if (!victim->IsAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks()))
return;
// Hmmmm dont like this emotes client must by self do all animations
@@ -1354,7 +1362,8 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
if (damageInfo->blocked_amount && damageInfo->TargetState != VICTIMSTATE_BLOCKS)
victim->HandleEmoteCommand(EMOTE_ONESHOT_PARRY_SHIELD);
- if (damageInfo->TargetState == VICTIMSTATE_PARRY)
+ if (damageInfo->TargetState == VICTIMSTATE_PARRY &&
+ (GetTypeId() != TYPEID_UNIT || (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN) == 0))
{
// Get attack timers
float offtime = float(victim->getAttackTimer(OFF_ATTACK));
@@ -2043,7 +2052,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const
{
- if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())
+ if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks())
return MELEE_HIT_EVADE;
int32 attackerMaxSkillValueForLevel = GetMaxSkillValueForLevel(victim);
@@ -2252,7 +2261,7 @@ float Unit::CalculateLevelPenalty(SpellInfo const* spellProto) const
float LvlPenalty = 0.0f;
if (spellProto->SpellLevel < 20)
- LvlPenalty = 20.0f - spellProto->SpellLevel * 3.75f;
+ LvlPenalty = (20.0f - spellProto->SpellLevel) * 3.75f;
float LvlFactor = (float(spellProto->SpellLevel) + 6.0f) / float(getLevel());
if (LvlFactor > 1.0f)
LvlFactor = 1.0f;
@@ -2386,37 +2395,19 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
if (roll < tmp)
return SPELL_MISS_MISS;
- // Chance resist mechanic (select max value from every mechanic spell effect)
- int32 resist_mech = 0;
- // Get effects mechanic and chance
- for (uint8 eff = 0; eff < MAX_SPELL_EFFECTS; ++eff)
- {
- int32 effect_mech = spellInfo->GetEffectMechanic(eff);
- if (effect_mech)
- {
- int32 temp = victim->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_MECHANIC_RESISTANCE, effect_mech);
- if (resist_mech < temp * 100)
- resist_mech = temp * 100;
- }
- }
- // Roll chance
- tmp += resist_mech;
+ // Chance resist mechanic
+ int32 resist_chance = victim->GetMechanicResistChance(spellInfo) * 100;
+ tmp += resist_chance;
if (roll < tmp)
return SPELL_MISS_RESIST;
- bool canDodge = true;
- bool canParry = true;
- bool canBlock = spellInfo->HasAttribute(SPELL_ATTR3_BLOCKABLE_SPELL);
-
- // Same spells cannot be parry/dodge
+ // Same spells cannot be parried/dodged
if (spellInfo->HasAttribute(SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK))
return SPELL_MISS_NONE;
- // Chance resist mechanic
- int32 resist_chance = victim->GetMechanicResistChance(spellInfo) * 100;
- tmp += resist_chance;
- if (roll < tmp)
- return SPELL_MISS_RESIST;
+ bool canDodge = true;
+ bool canParry = true;
+ bool canBlock = spellInfo->HasAttribute(SPELL_ATTR3_BLOCKABLE_SPELL);
// Ranged attacks can only miss, resist and deflect
if (attType == RANGED_ATTACK)
@@ -2655,7 +2646,7 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, boo
return SPELL_MISS_NONE;
// Return evade for units in evade mode
- if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())
+ if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks())
return SPELL_MISS_EVADE;
// Try victim reflect spell
@@ -2853,6 +2844,15 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victi
else
crit += victim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE);
+ AuraEffectList const& critChanceForCaster = victim->GetAuraEffectsByType(SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER);
+ for (AuraEffect const* aurEff : critChanceForCaster)
+ {
+ if (aurEff->GetCasterGUID() != GetGUID())
+ continue;
+
+ crit += aurEff->GetAmount();
+ }
+
crit += victim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE);
// reduce crit chance from Rating for players
@@ -3188,6 +3188,15 @@ int32 Unit::GetCurrentSpellCastTime(uint32 spell_id) const
return 0;
}
+bool Unit::CanMoveDuringChannel() const
+{
+ if (Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
+ if (spell->getState() != SPELL_STATE_FINISHED)
+ return spell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING) && spell->IsChannelActive();
+
+ return false;
+}
+
bool Unit::isInFrontInMap(Unit const* target, float distance, float arc) const
{
return IsWithinDistInMap(target, distance) && HasInArc(arc, target);
@@ -3748,6 +3757,77 @@ void Unit::RemoveAura(Aura* aura, AuraRemoveMode mode)
RemoveAura(aurApp, mode);
}
+void Unit::RemoveAppliedAuras(std::function<bool(AuraApplication const*)> const& check)
+{
+ for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
+ {
+ if (check(iter->second))
+ {
+ RemoveAura(iter);
+ continue;
+ }
+ ++iter;
+ }
+}
+
+void Unit::RemoveOwnedAuras(std::function<bool(Aura const*)> const& check)
+{
+ for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
+ {
+ if (check(iter->second))
+ {
+ RemoveOwnedAura(iter);
+ continue;
+ }
+ ++iter;
+ }
+}
+
+void Unit::RemoveAppliedAuras(uint32 spellId, std::function<bool(AuraApplication const*)> const& check)
+{
+ for (AuraApplicationMap::iterator iter = m_appliedAuras.lower_bound(spellId); iter != m_appliedAuras.upper_bound(spellId);)
+ {
+ if (check(iter->second))
+ {
+ RemoveAura(iter);
+ continue;
+ }
+ ++iter;
+ }
+}
+
+void Unit::RemoveOwnedAuras(uint32 spellId, std::function<bool(Aura const*)> const& check)
+{
+ for (AuraMap::iterator iter = m_ownedAuras.lower_bound(spellId); iter != m_ownedAuras.upper_bound(spellId);)
+ {
+ if (check(iter->second))
+ {
+ RemoveOwnedAura(iter);
+ continue;
+ }
+ ++iter;
+ }
+}
+
+void Unit::RemoveAurasByType(AuraType auraType, std::function<bool(AuraApplication const*)> const& check)
+{
+ for (AuraEffectList::iterator iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end();)
+ {
+ Aura* aura = (*iter)->GetBase();
+ AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID());
+ ASSERT(aurApp);
+
+ ++iter;
+ if (check(aurApp))
+ {
+ uint32 removedAuras = m_removedAurasCount;
+ RemoveAura(aurApp);
+ if (m_removedAurasCount > removedAuras + 1)
+ iter = m_modAuras[auraType].begin();
+ }
+ }
+}
+
void Unit::RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID, uint8 reqEffMask, AuraRemoveMode removeMode)
{
for (AuraApplicationMap::iterator iter = m_appliedAuras.lower_bound(spellId); iter != m_appliedAuras.upper_bound(spellId);)
@@ -4113,6 +4193,16 @@ void Unit::RemoveArenaAuras()
}
}
+void Unit::RemoveAurasOnEvade()
+{
+ if (IsCharmedOwnedByPlayerOrPlayer()) // if it is a player owned creature it should not remove the aura
+ return;
+
+ // don't remove vehicle auras, passengers aren't supposed to drop off the vehicle
+ // don't remove clone caster on evade (to be verified)
+ RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE, SPELL_AURA_CLONE_CASTER);
+}
+
void Unit::RemoveAllAurasOnDeath()
{
// used just after dieing to remove all visible auras
@@ -4355,13 +4445,10 @@ void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelCharges
if (aura->GetSpellInfo()->GetDispelMask() & dispelMask)
{
- if (aura->GetSpellInfo()->Dispel == DISPEL_MAGIC)
- {
- // do not remove positive auras if friendly target
- // negative auras if non-friendly target
- if (aurApp->IsPositive() == IsFriendlyTo(caster))
- continue;
- }
+ // do not remove positive auras if friendly target
+ // negative auras if non-friendly target
+ if (aurApp->IsPositive() == IsFriendlyTo(caster))
+ continue;
// The charges / stack amounts don't count towards the total number of auras that can be dispelled.
// Ie: A dispel on a target with 5 stacks of Winters Chill and a Polymorph has 1 / (1 + 1) -> 50% chance to dispell
@@ -5208,7 +5295,7 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType
}
//victim may be NULL
-bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
+bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, Milliseconds& cooldown)
{
SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo();
uint32 effIndex = triggeredByAura->GetEffIndex();
@@ -5218,8 +5305,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL;
uint32 triggered_spell_id = 0;
- uint32 cooldown_spell_id = 0; // for random trigger, will be one of the triggered spell to avoid repeatable triggers
- // otherwise, it's the triggered_spell_id by default
Unit* target = victim;
int32 basepoints0 = 0;
ObjectGuid originalCaster;
@@ -5295,24 +5380,20 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case CLASS_PALADIN: // 39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409
case CLASS_DRUID: // 39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409
triggered_spell_id = RAND(39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409);
- cooldown_spell_id = 39511;
break;
case CLASS_ROGUE: // 39511, 40997, 40998, 41002, 41005, 41011
case CLASS_WARRIOR: // 39511, 40997, 40998, 41002, 41005, 41011
case CLASS_DEATH_KNIGHT:
triggered_spell_id = RAND(39511, 40997, 40998, 41002, 41005, 41011);
- cooldown_spell_id = 39511;
break;
case CLASS_PRIEST: // 40999, 41002, 41005, 41009, 41011, 41406, 41409
case CLASS_SHAMAN: // 40999, 41002, 41005, 41009, 41011, 41406, 41409
case CLASS_MAGE: // 40999, 41002, 41005, 41009, 41011, 41406, 41409
case CLASS_WARLOCK: // 40999, 41002, 41005, 41009, 41011, 41406, 41409
triggered_spell_id = RAND(40999, 41002, 41005, 41009, 41011, 41406, 41409);
- cooldown_spell_id = 40999;
break;
case CLASS_HUNTER: // 40997, 40999, 41002, 41005, 41009, 41011, 41406, 41409
triggered_spell_id = RAND(40997, 40999, 41002, 41005, 41009, 41011, 41406, 41409);
- cooldown_spell_id = 40997;
break;
default:
return false;
@@ -5542,11 +5623,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
uint8 rand_spell = urand(0, (RandomSpells.size() - 1));
CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster);
- for (std::vector<uint32>::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr)
- {
- if (!GetSpellHistory()->HasCooldown(*itr))
- GetSpellHistory()->AddCooldown(*itr, 0, std::chrono::seconds(cooldown));
- }
break;
}
case 71562: // Deathbringer's Will Heroic
@@ -5588,11 +5664,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
uint8 rand_spell = urand(0, (RandomSpells.size() - 1));
CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster);
- for (std::vector<uint32>::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr)
- {
- if (!GetSpellHistory()->HasCooldown(*itr))
- GetSpellHistory()->AddCooldown(*itr, 0, std::chrono::seconds(cooldown));
- }
break;
}
case 65032: // Boom aura (321 Boombot)
@@ -6230,24 +6301,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
return true;
}
}
- // Eclipse
- if (dummySpell->SpellIconID == 2856 && GetTypeId() == TYPEID_PLAYER)
- {
- if (!procSpell || effIndex != 0)
- return false;
-
- bool isWrathSpell = (procSpell->SpellFamilyFlags[0] & 1);
-
- if (!roll_chance_f(dummySpell->ProcChance * (isWrathSpell ? 0.6f : 1.0f)))
- return false;
-
- target = this;
- if (target->HasAura(isWrathSpell ? 48517 : 48518))
- return false;
-
- triggered_spell_id = isWrathSpell ? 48518 : 48517;
- break;
- }
break;
}
case SPELLFAMILY_ROGUE:
@@ -6412,6 +6465,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// 4 healing tick
basepoints0 = triggerAmount * damage / 400;
triggered_spell_id = 54203;
+ // Add remaining ticks to healing done
+ basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_HEAL);
break;
}
switch (dummySpell->Id)
@@ -6428,7 +6483,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
// Item - Paladin T8 Holy 4P Bonus
if (Unit* caster = triggeredByAura->GetCaster())
if (AuraEffect const* aurEff = caster->GetAuraEffect(64895, 0))
- cooldown = aurEff->GetAmount();
+ cooldown = Milliseconds(aurEff->GetAmount());
target = this;
break;
@@ -6743,10 +6798,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (!player || !castItem || !castItem->IsEquipped() || !victim || !victim->IsAlive())
return false;
- // custom cooldown processing case
- if (cooldown && GetSpellHistory()->HasCooldown(dummySpell->Id))
- return false;
-
if (triggeredByAura->GetBase() && castItem->GetGUID() != triggeredByAura->GetBase()->GetCastItemGUID())
return false;
@@ -6809,8 +6860,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
triggered_spell_id = 33750;
// apply cooldown before cast to prevent processing itself
- if (cooldown)
- player->GetSpellHistory()->AddCooldown(dummySpell->Id, 0, std::chrono::seconds(cooldown));
+ triggeredByAura->GetBase()->AddProcCooldown(std::chrono::steady_clock::now() + cooldown);
+ cooldown = Milliseconds::zero();
// Attack Twice
for (uint32 i = 0; i < 2; ++i)
@@ -7053,10 +7104,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (!procSpell || GetTypeId() != TYPEID_PLAYER || !victim)
return false;
- // custom cooldown processing case
- if (cooldown && GetTypeId() == TYPEID_PLAYER && GetSpellHistory()->HasCooldown(dummySpell->Id))
- return false;
-
uint32 spellId = 0;
// Every Lightning Bolt and Chain Lightning spell have duplicate vs half damage and zero cost
switch (procSpell->Id)
@@ -7102,10 +7149,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
}
CastSpell(victim, spellId, true, castItem, triggeredByAura);
-
- if (cooldown && GetTypeId() == TYPEID_PLAYER)
- GetSpellHistory()->AddCooldown(dummySpell->Id, 0, std::chrono::seconds(cooldown));
-
return true;
}
// Static Shock
@@ -7407,26 +7450,17 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
return false;
}
- if (cooldown_spell_id == 0)
- cooldown_spell_id = triggered_spell_id;
-
- if (cooldown && GetTypeId() == TYPEID_PLAYER && GetSpellHistory()->HasCooldown(cooldown_spell_id))
- return false;
-
if (basepoints0)
CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura, originalCaster);
else
CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura, originalCaster);
- if (cooldown && GetTypeId() == TYPEID_PLAYER)
- GetSpellHistory()->AddCooldown(cooldown_spell_id, 0, std::chrono::seconds(cooldown));
-
return true;
}
// Used in case when access to whole aura is needed
// All procs should be handled like this...
-bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 /*procFlag*/, uint32 procEx, uint32 cooldown, bool * handled)
+bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 /*procFlag*/, uint32 procEx, bool* handled)
{
SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo();
@@ -7638,12 +7672,6 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp
case 49222:
{
*handled = true;
- if (cooldown && GetTypeId() == TYPEID_PLAYER)
- {
- if (GetSpellHistory()->HasCooldown(100000))
- return false;
- GetSpellHistory()->AddCooldown(100000, 0, std::chrono::seconds(cooldown));
- }
return true;
}
// Hungering Cold aura drop
@@ -7686,7 +7714,7 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp
return false;
}
-bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlags, uint32 procEx, uint32 cooldown)
+bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx)
{
// Get triggered aura spell info
SpellInfo const* auraSpellInfo = triggeredByAura->GetSpellInfo();
@@ -7712,91 +7740,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
{
switch (auraSpellInfo->SpellFamilyName)
{
- case SPELLFAMILY_GENERIC:
- switch (auraSpellInfo->Id)
- {
- case 43820: // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket)
- // Pct value stored in dummy
- basepoints0 = victim->GetCreateHealth() * auraSpellInfo->Effects[1].CalcValue() / 100;
- target = victim;
- break;
- case 57345: // Darkmoon Card: Greatness
- {
- float stat = 0.0f;
- // strength
- if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 60229;stat = GetStat(STAT_STRENGTH); }
- // agility
- if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 60233;stat = GetStat(STAT_AGILITY); }
- // intellect
- if (GetStat(STAT_INTELLECT)> stat) { trigger_spell_id = 60234;stat = GetStat(STAT_INTELLECT);}
- // spirit
- if (GetStat(STAT_SPIRIT) > stat) { trigger_spell_id = 60235; }
- break;
- }
- case 64568: // Blood Reserve
- {
- if (HealthBelowPctDamaged(35, damage))
- {
- CastCustomSpell(this, 64569, &triggerAmount, NULL, NULL, true);
- RemoveAura(64568);
- }
- return false;
- }
- case 67702: // Death's Choice, Item - Coliseum 25 Normal Melee Trinket
- {
- float stat = 0.0f;
- // strength
- if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 67708;stat = GetStat(STAT_STRENGTH); }
- // agility
- if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 67703; }
- break;
- }
- case 67771: // Death's Choice (heroic), Item - Coliseum 25 Heroic Melee Trinket
- {
- float stat = 0.0f;
- // strength
- if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 67773;stat = GetStat(STAT_STRENGTH); }
- // agility
- if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 67772; }
- break;
- }
- // Mana Drain Trigger
- case 27522:
- case 40336:
- {
- // On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target.
- if (IsAlive())
- CastSpell(this, 29471, true, castItem, triggeredByAura);
- if (victim && victim->IsAlive())
- CastSpell(victim, 27526, true, castItem, triggeredByAura);
- return true;
- }
- // Evasive Maneuvers
- case 50240:
- {
- // Remove a Evasive Charge
- Aura* charge = GetAura(50241);
- if (charge && charge->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL))
- RemoveAurasDueToSpell(50240);
- break;
- }
- }
- break;
- case SPELLFAMILY_MAGE:
- if (auraSpellInfo->SpellIconID == 2127) // Blazing Speed
- {
- switch (auraSpellInfo->Id)
- {
- case 31641: // Rank 1
- case 31642: // Rank 2
- trigger_spell_id = 31643;
- break;
- default:
- TC_LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->Id);
- return false;
- }
- }
- break;
case SPELLFAMILY_WARLOCK:
{
// Drain Soul
@@ -7819,325 +7762,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
// Need for correct work Drain Soul SPELL_AURA_CHANNEL_DEATH_ITEM aura
return false;
}
- // Nether Protection
- else if (auraSpellInfo->SpellIconID == 1985)
- {
- if (!procSpell)
- return false;
- switch (GetFirstSchoolInMask(procSpell->GetSchoolMask()))
- {
- case SPELL_SCHOOL_NORMAL:
- return false; // ignore
- case SPELL_SCHOOL_HOLY: trigger_spell_id = 54370; break;
- case SPELL_SCHOOL_FIRE: trigger_spell_id = 54371; break;
- case SPELL_SCHOOL_NATURE: trigger_spell_id = 54375; break;
- case SPELL_SCHOOL_FROST: trigger_spell_id = 54372; break;
- case SPELL_SCHOOL_SHADOW: trigger_spell_id = 54374; break;
- case SPELL_SCHOOL_ARCANE: trigger_spell_id = 54373; break;
- default:
- return false;
- }
- }
- break;
- }
- case SPELLFAMILY_PRIEST:
- {
- // Blessed Recovery
- if (auraSpellInfo->SpellIconID == 1875)
- {
- switch (auraSpellInfo->Id)
- {
- case 27811: trigger_spell_id = 27813; break;
- case 27815: trigger_spell_id = 27817; break;
- case 27816: trigger_spell_id = 27818; break;
- default:
- TC_LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id);
- return false;
- }
- basepoints0 = CalculatePct(int32(damage), triggerAmount) / 3;
- target = this;
- // Add remaining ticks to healing done
- basepoints0 += GetRemainingPeriodicAmount(GetGUID(), trigger_spell_id, SPELL_AURA_PERIODIC_HEAL);
- }
- break;
- }
- case SPELLFAMILY_DRUID:
- {
- switch (auraSpellInfo->Id)
- {
- // Druid Forms Trinket
- case 37336:
- {
- switch (GetShapeshiftForm())
- {
- case FORM_NONE: trigger_spell_id = 37344; break;
- case FORM_CAT: trigger_spell_id = 37341; break;
- case FORM_BEAR:
- case FORM_DIREBEAR: trigger_spell_id = 37340; break;
- case FORM_TREE: trigger_spell_id = 37342; break;
- case FORM_MOONKIN: trigger_spell_id = 37343; break;
- default:
- return false;
- }
- break;
- }
- // Druid T9 Feral Relic (Lacerate, Swipe, Mangle, and Shred)
- case 67353:
- {
- switch (GetShapeshiftForm())
- {
- case FORM_CAT: trigger_spell_id = 67355; break;
- case FORM_BEAR:
- case FORM_DIREBEAR: trigger_spell_id = 67354; break;
- default:
- return false;
- }
- break;
- }
- default:
- break;
- }
- break;
- }
- case SPELLFAMILY_HUNTER:
- {
- if (auraSpellInfo->SpellIconID == 3247) // Piercing Shots
- {
- switch (auraSpellInfo->Id)
- {
- case 53234: // Rank 1
- case 53237: // Rank 2
- case 53238: // Rank 3
- trigger_spell_id = 63468;
- break;
- default:
- TC_LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->Id);
- return false;
- }
- SpellInfo const* TriggerPS = sSpellMgr->GetSpellInfo(trigger_spell_id);
- if (!TriggerPS)
- return false;
-
- basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].Amplitude);
- basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), trigger_spell_id, SPELL_AURA_PERIODIC_DAMAGE);
- break;
- }
- // Item - Hunter T9 4P Bonus
- if (auraSpellInfo->Id == 67151)
- {
- trigger_spell_id = 68130;
- target = this;
- break;
- }
- break;
- }
- case SPELLFAMILY_PALADIN:
- {
- switch (auraSpellInfo->Id)
- {
- // Soul Preserver
- case 60510:
- {
- switch (getClass())
- {
- case CLASS_DRUID:
- trigger_spell_id = 60512;
- break;
- case CLASS_PALADIN:
- trigger_spell_id = 60513;
- break;
- case CLASS_PRIEST:
- trigger_spell_id = 60514;
- break;
- case CLASS_SHAMAN:
- trigger_spell_id = 60515;
- break;
- }
-
- target = this;
- break;
- }
- case 37657: // Lightning Capacitor
- case 54841: // Thunder Capacitor
- case 67712: // Item - Coliseum 25 Normal Caster Trinket
- case 67758: // Item - Coliseum 25 Heroic Caster Trinket
- {
- if (!victim || !victim->IsAlive() || GetTypeId() != TYPEID_PLAYER)
- return false;
-
- uint32 stack_spell_id = 0;
- switch (auraSpellInfo->Id)
- {
- case 37657:
- stack_spell_id = 37658;
- trigger_spell_id = 37661;
- break;
- case 54841:
- stack_spell_id = 54842;
- trigger_spell_id = 54843;
- break;
- case 67712:
- stack_spell_id = 67713;
- trigger_spell_id = 67714;
- break;
- case 67758:
- stack_spell_id = 67759;
- trigger_spell_id = 67760;
- break;
- }
-
- CastSpell(this, stack_spell_id, true, NULL, triggeredByAura);
-
- Aura* dummy = GetAura(stack_spell_id);
- if (!dummy || dummy->GetStackAmount() < triggerAmount)
- return false;
-
- RemoveAurasDueToSpell(stack_spell_id);
- target = victim;
- break;
- }
- default:
- // Illumination
- if (auraSpellInfo->SpellIconID == 241)
- {
- if (!procSpell)
- return false;
- // procspell is triggered spell but we need mana cost of original cast spell
- uint32 originalSpellId = procSpell->Id;
- // Holy Shock heal
- if (procSpell->SpellFamilyFlags[1] & 0x00010000)
- {
- switch (procSpell->Id)
- {
- case 25914: originalSpellId = 20473; break;
- case 25913: originalSpellId = 20929; break;
- case 25903: originalSpellId = 20930; break;
- case 27175: originalSpellId = 27174; break;
- case 33074: originalSpellId = 33072; break;
- case 48820: originalSpellId = 48824; break;
- case 48821: originalSpellId = 48825; break;
- default:
- TC_LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->Id);
- return false;
- }
- }
- SpellInfo const* originalSpell = sSpellMgr->GetSpellInfo(originalSpellId);
- if (!originalSpell)
- {
- TC_LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId);
- return false;
- }
- // percent stored in effect 1 (class scripts) base points
- int32 cost = int32(originalSpell->ManaCost + CalculatePct(GetCreateMana(), originalSpell->ManaCostPercentage));
- basepoints0 = CalculatePct(cost, auraSpellInfo->Effects[1].CalcValue());
- trigger_spell_id = 20272;
- target = this;
- }
- break;
- }
- break;
- }
- case SPELLFAMILY_SHAMAN:
- {
- switch (auraSpellInfo->Id)
- {
- case 30881: // Nature's Guardian Rank 1
- case 30883: // Nature's Guardian Rank 2
- case 30884: // Nature's Guardian Rank 3
- case 30885: // Nature's Guardian Rank 4
- case 30886: // Nature's Guardian Rank 5
- {
- if (HealthBelowPct(30))
- {
- basepoints0 = int32(auraSpellInfo->Effects[EFFECT_0].CalcValue() * GetMaxHealth() / 100.0f);
- target = this;
- trigger_spell_id = 31616;
- /// @todo Threat part
- }
- else
- return false;
- break;
- }
- default:
- {
- // Lightning Shield (overwrite non existing triggered spell call in spell.dbc
- if (auraSpellInfo->SpellFamilyFlags[0] & 0x400)
- {
- trigger_spell_id = sSpellMgr->GetSpellWithRank(26364, auraSpellInfo->GetRank());
- }
- // Nature's Guardian
- else if (auraSpellInfo->SpellIconID == 2013)
- {
- // Check health condition - should drop to less 30% (damage deal after this!)
- if (!HealthBelowPctDamaged(30, damage))
- return false;
-
- if (victim && victim->IsAlive())
- victim->getThreatManager().modifyThreatPercent(this, -10);
-
- basepoints0 = int32(CountPctFromMaxHealth(triggerAmount));
- trigger_spell_id = 31616;
- target = this;
- }
- }
- }
- break;
- }
- case SPELLFAMILY_DEATHKNIGHT:
- {
- // Acclimation
- if (auraSpellInfo->SpellIconID == 1930)
- {
- if (!procSpell)
- return false;
- switch (GetFirstSchoolInMask(procSpell->GetSchoolMask()))
- {
- case SPELL_SCHOOL_NORMAL:
- return false; // ignore
- case SPELL_SCHOOL_HOLY: trigger_spell_id = 50490; break;
- case SPELL_SCHOOL_FIRE: trigger_spell_id = 50362; break;
- case SPELL_SCHOOL_NATURE: trigger_spell_id = 50488; break;
- case SPELL_SCHOOL_FROST: trigger_spell_id = 50485; break;
- case SPELL_SCHOOL_SHADOW: trigger_spell_id = 50489; break;
- case SPELL_SCHOOL_ARCANE: trigger_spell_id = 50486; break;
- default:
- return false;
- }
- }
- // Blood Presence (Improved)
- else if (auraSpellInfo->Id == 63611)
- {
- if (GetTypeId() != TYPEID_PLAYER)
- return false;
-
- trigger_spell_id = 50475;
- basepoints0 = CalculatePct(int32(damage), triggerAmount);
- }
- // Item - Death Knight T10 Melee 4P Bonus
- else if (auraSpellInfo->Id == 70656)
- {
- if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT)
- return false;
-
- for (uint8 i = 0; i < MAX_RUNES; ++i)
- if (ToPlayer()->GetRuneCooldown(i) == 0)
- return false;
- }
- break;
- }
- case SPELLFAMILY_ROGUE:
- {
- switch (auraSpellInfo->Id)
- {
- // Rogue T10 2P bonus, should only proc on caster
- case 70805:
- {
- if (victim != this)
- return false;
- break;
- }
- }
- break;
}
default:
break;
@@ -8171,7 +7795,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
float averageDmg = 0;
// now compute approximate weapon damage by formula from wowwiki.com
- if (procFlags & PROC_FLAG_DONE_OFFHAND_ATTACK)
+ if (procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
averageDmg = (GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE) + GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)) / 2.f;
else
averageDmg = (GetFloatValue(UNIT_FIELD_MINDAMAGE) + GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2.f;
@@ -8248,7 +7872,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 53232:
{
// This effect only from Rapid Fire (ability cast)
- if (!(procSpell->SpellFamilyFlags[0] & 0x20))
+ if (!procSpell || !(procSpell->SpellFamilyFlags[0] & 0x20))
return false;
break;
}
@@ -8266,7 +7890,9 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 15337: // Improved Spirit Tap (Rank 1)
case 15338: // Improved Spirit Tap (Rank 2)
{
- ASSERT(procSpell);
+ if (!procSpell)
+ return false;
+
if (procSpell->SpellFamilyFlags[0] & 0x800000)
if ((procSpell->Id != 58381) || !roll_chance_i(50))
return false;
@@ -8333,13 +7959,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
if (!target)
return false;
- if (cooldown && target->GetTypeId() == TYPEID_PLAYER && target->GetSpellHistory()->HasCooldown(trigger_spell_id))
- return false;
-
target->CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura);
-
- if (cooldown && GetTypeId() == TYPEID_PLAYER)
- GetSpellHistory()->AddCooldown(trigger_spell_id, 0, std::chrono::seconds(cooldown));
return true;
}
// Cast positive spell on enemy target
@@ -8448,7 +8068,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
// Astral Shift
case 52179:
{
- if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == victim)
+ if (!procSpell || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == victim)
return false;
// Need stun, fear or silence mechanic
@@ -8470,7 +8090,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 56453:
{
// Proc only from Frost/Freezing trap activation or from Freezing Arrow (the periodic dmg proc handled elsewhere)
- if (!(procFlags & PROC_FLAG_DONE_TRAP_ACTIVATION) || !procSpell || !(procSpell->SchoolMask & SPELL_SCHOOL_MASK_FROST) || !roll_chance_i(triggerAmount))
+ if (!(procFlag & PROC_FLAG_DONE_TRAP_ACTIVATION) || !procSpell || !(procSpell->SchoolMask & SPELL_SCHOOL_MASK_FROST) || !roll_chance_i(triggerAmount))
return false;
break;
}
@@ -8500,13 +8120,15 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 65081:
{
// Proc only from PW:S cast
- if (!(procSpell->SpellFamilyFlags[0] & 0x00000001))
+ if (!procSpell || !(procSpell->SpellFamilyFlags[0] & 0x00000001))
return false;
break;
}
// Culling the Herd
case 70893:
{
+ if (!procSpell)
+ return false;
// check if we're doing a critical hit
if (!(procSpell->SpellFamilyFlags[1] & 0x10000000) && (procEx != PROC_EX_CRITICAL_HIT))
return false;
@@ -8517,29 +8139,23 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
}
}
- if (cooldown && GetTypeId() == TYPEID_PLAYER && GetSpellHistory()->HasCooldown(trigger_spell_id))
- return false;
-
// extra attack should hit same target
if (triggerEntry->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
target = victim;
// try detect target manually if not set
if (target == NULL)
- target = !(procFlags & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry->IsPositive() ? this : victim;
+ target = !(procFlag & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry->IsPositive() ? this : victim;
if (basepoints0)
CastCustomSpell(target, trigger_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura);
else
CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura);
- if (cooldown && GetTypeId() == TYPEID_PLAYER)
- GetSpellHistory()->AddCooldown(trigger_spell_id, 0, std::chrono::seconds(cooldown));
-
return true;
}
-bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown)
+bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* procSpell)
{
int32 scriptId = triggeredByAura->GetMiscValue();
@@ -8630,14 +8246,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au
return false;
}
- if (cooldown && GetTypeId() == TYPEID_PLAYER && GetSpellHistory()->HasCooldown(triggered_spell_id))
- return false;
-
CastSpell(victim, triggered_spell_id, true, castItem, triggeredByAura);
-
- if (cooldown && GetTypeId() == TYPEID_PLAYER)
- GetSpellHistory()->AddCooldown(triggered_spell_id, 0, std::chrono::seconds(cooldown));
-
return true;
}
@@ -8646,7 +8255,7 @@ void Unit::setPowerType(Powers new_powertype)
if (getPowerType() == new_powertype)
return;
- SetByteValue(UNIT_FIELD_BYTES_0, 3, new_powertype);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE, new_powertype);
if (GetTypeId() == TYPEID_PLAYER)
{
@@ -8921,7 +8530,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
}
else
{
- if (victim->ToCreature()->IsInEvadeMode())
+ if (victim->ToCreature()->IsEvadingAttacks())
return false;
}
@@ -8983,13 +8592,16 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
if (GetTypeId() == TYPEID_UNIT && !IsPet())
{
// should not let player enter combat by right clicking target - doesn't helps
+ AddThreat(victim, 0.0f);
SetInCombatWith(victim);
if (victim->GetTypeId() == TYPEID_PLAYER)
victim->SetInCombatWith(this);
- AddThreat(victim, 0.0f);
ToCreature()->SendAIReaction(AI_REACTION_HOSTILE);
ToCreature()->CallAssistance();
+
+ // Remove emote state - will be restored on creature reset
+ SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
}
// delay offhand weapon attack to next attack time
@@ -9037,7 +8649,7 @@ bool Unit::AttackStop()
if (creature->HasSearchedAssistance())
{
creature->SetNoSearchAssistance(false);
- UpdateSpeed(MOVE_RUN, false);
+ UpdateSpeed(MOVE_RUN);
}
}
@@ -9230,7 +8842,7 @@ Unit* Unit::GetCharmer() const
if (ObjectGuid charmerGUID = GetCharmerGUID())
return ObjectAccessor::GetUnit(*this, charmerGUID);
- return NULL;
+ return nullptr;
}
Player* Unit::GetCharmerOrOwnerPlayerOrPlayerItself() const
@@ -9371,7 +8983,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
// FIXME: hack, speed must be set only at follow
if (GetTypeId() == TYPEID_PLAYER && minion->IsPet())
for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
- minion->SetSpeed(UnitMoveType(i), m_speed_rate[i], true);
+ minion->SetSpeedRate(UnitMoveType(i), m_speed_rate[i]);
// Ghoul pets have energy instead of mana (is anywhere better place for this code?)
if (minion->IsPetGhoul() || minion->IsRisenAlly())
@@ -10656,6 +10268,19 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto
if (Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CRITICAL_CHANCE, crit_chance);
+ // for this types the bonus was already added in GetUnitCriticalChance, do not add twice
+ if (spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE && spellProto->DmgClass != SPELL_DAMAGE_CLASS_RANGED)
+ {
+ AuraEffectList const& critChanceForCaster = victim->GetAuraEffectsByType(SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER);
+ for (AuraEffect const* aurEff : critChanceForCaster)
+ {
+ if (aurEff->GetCasterGUID() != GetGUID() || !aurEff->IsAffectedOnSpell(spellProto))
+ continue;
+
+ crit_chance += aurEff->GetAmount();
+ }
+ }
+
return crit_chance > 0.0f ? crit_chance : 0.0f;
}
@@ -11791,22 +11416,20 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
if (enemy)
{
if (IsAIEnabled)
- {
creature->AI()->EnterCombat(enemy);
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // unit has engaged in combat, remove immunity so players can fight back
- }
+
if (creature->GetFormation())
creature->GetFormation()->MemberAttackStart(creature, enemy);
}
if (IsPet())
{
- UpdateSpeed(MOVE_RUN, true);
- UpdateSpeed(MOVE_SWIM, true);
- UpdateSpeed(MOVE_FLIGHT, true);
+ UpdateSpeed(MOVE_RUN);
+ UpdateSpeed(MOVE_SWIM);
+ UpdateSpeed(MOVE_FLIGHT);
}
- if (!(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_MOUNTED_COMBAT))
+ if (!(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_MOUNTED_COMBAT_ALLOWED))
Dismount();
}
@@ -11835,9 +11458,6 @@ void Unit::ClearInCombat()
// Player's state will be cleared in Player::UpdateContestedPvP
if (Creature* creature = ToCreature())
{
- if (creature->GetCreatureTemplate() && creature->GetCreatureTemplate()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC)
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // set immunity state to the one from db on evade
-
ClearUnitState(UNIT_STATE_ATTACK_PLAYER);
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED))
SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureTemplate()->dynamicflags);
@@ -11847,7 +11467,7 @@ void Unit::ClearInCombat()
if (Unit* owner = GetOwner())
for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
if (owner->GetSpeedRate(UnitMoveType(i)) > GetSpeedRate(UnitMoveType(i)))
- SetSpeed(UnitMoveType(i), owner->GetSpeedRate(UnitMoveType(i)), true);
+ SetSpeedRate(UnitMoveType(i), owner->GetSpeedRate(UnitMoveType(i)));
}
else if (!IsCharmed())
return;
@@ -11856,6 +11476,7 @@ void Unit::ClearInCombat()
ToPlayer()->UpdatePotionCooldown();
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT);
+ RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LEAVE_COMBAT);
}
bool Unit::isTargetableForAttack(bool checkFakeDeath) const
@@ -11864,7 +11485,7 @@ bool Unit::isTargetableForAttack(bool checkFakeDeath) const
return false;
if (HasFlag(UNIT_FIELD_FLAGS,
- UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC))
+ UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
return false;
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->IsGameMaster())
@@ -11934,35 +11555,33 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|| target->GetReactionTo(this) > REP_NEUTRAL)
return false;
+ Player const* playerAffectingAttacker = HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? GetAffectingPlayer() : nullptr;
+ Player const* playerAffectingTarget = target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? target->GetAffectingPlayer() : nullptr;
+
// Not all neutral creatures can be attacked (even some unfriendly faction does not react aggresive to you, like Sporaggar)
- if (GetReactionTo(target) == REP_NEUTRAL &&
- target->GetReactionTo(this) <= REP_NEUTRAL)
+ if (
+ (playerAffectingAttacker && !playerAffectingTarget) ||
+ (!playerAffectingAttacker && playerAffectingTarget)
+ )
{
- if (!(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER) &&
- !(target->GetTypeId() == TYPEID_UNIT && GetTypeId() == TYPEID_UNIT))
- {
- Player const* player = target->GetTypeId() == TYPEID_PLAYER ? target->ToPlayer() : ToPlayer();
- Unit const* creature = target->GetTypeId() == TYPEID_UNIT ? target : this;
+ Player const* player = playerAffectingAttacker ? playerAffectingAttacker : playerAffectingTarget;
+ Unit const* creature = playerAffectingAttacker ? target : this;
- if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry())
- {
- if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))
- if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
- if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
- if (!(repState->Flags & FACTION_FLAG_AT_WAR))
- return false;
+ if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry())
+ {
+ if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))
+ if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
+ if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
+ if (!(repState->Flags & FACTION_FLAG_AT_WAR))
+ return false;
- }
}
}
Creature const* creatureAttacker = ToCreature();
- if (creatureAttacker && creatureAttacker->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER)
+ if (creatureAttacker && creatureAttacker->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT)
return false;
- Player const* playerAffectingAttacker = HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? GetAffectingPlayer() : NULL;
- Player const* playerAffectingTarget = target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? target->GetAffectingPlayer() : NULL;
-
// check duel - before sanctuary checks
if (playerAffectingAttacker && playerAffectingTarget)
if (playerAffectingAttacker->duel && playerAffectingAttacker->duel->opponent == playerAffectingTarget && playerAffectingAttacker->duel->startTime != 0)
@@ -12044,11 +11663,14 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co
// can't assist non-friendly targets
if (GetReactionTo(target) < REP_NEUTRAL
&& target->GetReactionTo(this) < REP_NEUTRAL
- && (!ToCreature() || !(ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER)))
+ && (!ToCreature() || !(ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT)))
return false;
+ // Controlled player case, we can assist creatures (reaction already checked above, our faction == charmer faction)
+ if (GetTypeId() == TYPEID_PLAYER && IsCharmed() && GetCharmerGUID().IsCreature())
+ return true;
// PvP case
- if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE))
+ else if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE))
{
Player const* targetPlayerOwner = target->GetAffectingPlayer();
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE))
@@ -12078,7 +11700,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co
&& !((target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_PVP)))
{
if (Creature const* creatureTarget = target->ToCreature())
- return creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER || creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS;
+ return creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT || creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_CAN_ASSIST;
}
return true;
}
@@ -12233,7 +11855,7 @@ void Unit::SetVisible(bool x)
UpdateObjectVisibility();
}
-void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
+void Unit::UpdateSpeed(UnitMoveType mtype)
{
int32 main_speed_mod = 0;
float stack_bonus = 1.0f;
@@ -12296,7 +11918,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
// Update speed for vehicle if available
if (GetTypeId() == TYPEID_PLAYER && GetVehicle())
- GetVehicleBase()->UpdateSpeed(MOVE_FLIGHT, true);
+ GetVehicleBase()->UpdateSpeed(MOVE_FLIGHT);
break;
}
default:
@@ -12344,7 +11966,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
if (Creature* creature = ToCreature())
{
uint32 immuneMask = creature->GetCreatureTemplate()->MechanicImmuneMask;
- if (immuneMask & (1 << MECHANIC_SNARE) || immuneMask & (1 << MECHANIC_DAZE))
+ if (immuneMask & (1 << (MECHANIC_SNARE - 1)) || immuneMask & (1 << (MECHANIC_DAZE - 1)))
break;
}
@@ -12378,7 +12000,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
speed = min_speed;
}
- SetSpeed(mtype, speed, forced);
+ SetSpeedRate(mtype, speed);
}
float Unit::GetSpeed(UnitMoveType mtype) const
@@ -12386,7 +12008,12 @@ float Unit::GetSpeed(UnitMoveType mtype) const
return m_speed_rate[mtype]*(IsControlledByPlayer() ? playerBaseMoveSpeed[mtype] : baseMoveSpeed[mtype]);
}
-void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
+void Unit::SetSpeed(UnitMoveType mtype, float newValue)
+{
+ SetSpeedRate(mtype, newValue / (IsControlledByPlayer() ? playerBaseMoveSpeed[mtype] : baseMoveSpeed[mtype]));
+}
+
+void Unit::SetSpeedRate(UnitMoveType mtype, float rate)
{
if (rate < 0)
rate = 0.0f;
@@ -12399,102 +12026,67 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
propagateSpeedChange();
- WorldPacket data;
- if (!forced)
+ // Spline packets are for units controlled by AI. "Force speed change" (wrongly named opcodes) and "move set speed" packets are for units controlled by a player.
+ static Opcodes const moveTypeToOpcode[MAX_MOVE_TYPE][3] =
+ {
+ {SMSG_SPLINE_SET_WALK_SPEED, SMSG_FORCE_WALK_SPEED_CHANGE, MSG_MOVE_SET_WALK_SPEED },
+ {SMSG_SPLINE_SET_RUN_SPEED, SMSG_FORCE_RUN_SPEED_CHANGE, MSG_MOVE_SET_RUN_SPEED },
+ {SMSG_SPLINE_SET_RUN_BACK_SPEED, SMSG_FORCE_RUN_BACK_SPEED_CHANGE, MSG_MOVE_SET_RUN_BACK_SPEED },
+ {SMSG_SPLINE_SET_SWIM_SPEED, SMSG_FORCE_SWIM_SPEED_CHANGE, MSG_MOVE_SET_SWIM_SPEED },
+ {SMSG_SPLINE_SET_SWIM_BACK_SPEED, SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, MSG_MOVE_SET_SWIM_BACK_SPEED },
+ {SMSG_SPLINE_SET_TURN_RATE, SMSG_FORCE_TURN_RATE_CHANGE, MSG_MOVE_SET_TURN_RATE },
+ {SMSG_SPLINE_SET_FLIGHT_SPEED, SMSG_FORCE_FLIGHT_SPEED_CHANGE, MSG_MOVE_SET_FLIGHT_SPEED },
+ {SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, MSG_MOVE_SET_FLIGHT_BACK_SPEED },
+ {SMSG_SPLINE_SET_PITCH_RATE, SMSG_FORCE_PITCH_RATE_CHANGE, MSG_MOVE_SET_PITCH_RATE },
+ };
+
+ if (GetTypeId() == TYPEID_PLAYER)
{
- switch (mtype)
- {
- case MOVE_WALK:
- data.Initialize(MSG_MOVE_SET_WALK_SPEED, 8+4+2+4+4+4+4+4+4+4);
- break;
- case MOVE_RUN:
- data.Initialize(MSG_MOVE_SET_RUN_SPEED, 8+4+2+4+4+4+4+4+4+4);
- break;
- case MOVE_RUN_BACK:
- data.Initialize(MSG_MOVE_SET_RUN_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4);
- break;
- case MOVE_SWIM:
- data.Initialize(MSG_MOVE_SET_SWIM_SPEED, 8+4+2+4+4+4+4+4+4+4);
- break;
- case MOVE_SWIM_BACK:
- data.Initialize(MSG_MOVE_SET_SWIM_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4);
- break;
- case MOVE_TURN_RATE:
- data.Initialize(MSG_MOVE_SET_TURN_RATE, 8+4+2+4+4+4+4+4+4+4);
- break;
- case MOVE_FLIGHT:
- data.Initialize(MSG_MOVE_SET_FLIGHT_SPEED, 8+4+2+4+4+4+4+4+4+4);
- break;
- case MOVE_FLIGHT_BACK:
- data.Initialize(MSG_MOVE_SET_FLIGHT_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4);
- break;
- case MOVE_PITCH_RATE:
- data.Initialize(MSG_MOVE_SET_PITCH_RATE, 8+4+2+4+4+4+4+4+4+4);
- break;
- default:
- TC_LOG_ERROR("entities.unit", "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
- return;
- }
+ // register forced speed changes for WorldSession::HandleForceSpeedChangeAck
+ // and do it only for real sent packets and use run for run/mounted as client expected
+ ++ToPlayer()->m_forced_speed_changes[mtype];
+
+ if (!IsInCombat())
+ if (Pet* pet = ToPlayer()->GetPet())
+ pet->SetSpeedRate(mtype, m_speed_rate[mtype]);
+ }
+
+ if (Player* playerMover = GetPlayerMover()) // unit controlled by a player.
+ {
+ // Send notification to self. this packet is only sent to one client (the client of the player concerned by the change).
+ WorldPacket self;
+ self.Initialize(moveTypeToOpcode[mtype][1], mtype != MOVE_RUN ? 8 + 4 + 4 : 8 + 4 + 1 + 4);
+ self << GetPackGUID();
+ self << (uint32)0; // Movement counter. Unimplemented at the moment! NUM_PMOVE_EVTS = 0x39Z.
+ if (mtype == MOVE_RUN)
+ self << uint8(1); // unknown byte added in 2.1.0
+ self << float(GetSpeed(mtype));
+ playerMover->GetSession()->SendPacket(&self);
+ // Send notification to other players. sent to every clients (if in range) except one: the client of the player concerned by the change.
+ WorldPacket data;
+ data.Initialize(moveTypeToOpcode[mtype][2], 8 + 30 + 4);
+ data << GetPackGUID();
BuildMovementPacket(&data);
data << float(GetSpeed(mtype));
- SendMessageToSet(&data, true);
+ playerMover->SendMessageToSet(&data, false);
}
- else
+ else // unit controlled by AI.
{
- if (GetTypeId() == TYPEID_PLAYER)
- {
- // register forced speed changes for WorldSession::HandleForceSpeedChangeAck
- // and do it only for real sent packets and use run for run/mounted as client expected
- ++ToPlayer()->m_forced_speed_changes[mtype];
-
- if (!IsInCombat())
- if (Pet* pet = ToPlayer()->GetPet())
- pet->SetSpeed(mtype, m_speed_rate[mtype], forced);
- }
-
- switch (mtype)
- {
- case MOVE_WALK:
- data.Initialize(SMSG_FORCE_WALK_SPEED_CHANGE, 16);
- break;
- case MOVE_RUN:
- data.Initialize(SMSG_FORCE_RUN_SPEED_CHANGE, 17);
- break;
- case MOVE_RUN_BACK:
- data.Initialize(SMSG_FORCE_RUN_BACK_SPEED_CHANGE, 16);
- break;
- case MOVE_SWIM:
- data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, 16);
- break;
- case MOVE_SWIM_BACK:
- data.Initialize(SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, 16);
- break;
- case MOVE_TURN_RATE:
- data.Initialize(SMSG_FORCE_TURN_RATE_CHANGE, 16);
- break;
- case MOVE_FLIGHT:
- data.Initialize(SMSG_FORCE_FLIGHT_SPEED_CHANGE, 16);
- break;
- case MOVE_FLIGHT_BACK:
- data.Initialize(SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, 16);
- break;
- case MOVE_PITCH_RATE:
- data.Initialize(SMSG_FORCE_PITCH_RATE_CHANGE, 16);
- break;
- default:
- TC_LOG_ERROR("entities.unit", "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
- return;
- }
+ // send notification to every clients.
+ WorldPacket data;
+ data.Initialize(moveTypeToOpcode[mtype][0], 8 + 4);
data << GetPackGUID();
- data << (uint32)0; // moveEvent, NUM_PMOVE_EVTS = 0x39
- if (mtype == MOVE_RUN)
- data << uint8(0); // new 2.1.0
data << float(GetSpeed(mtype));
- SendMessageToSet(&data, true);
+ SendMessageToSet(&data, false);
}
}
+bool Unit::IsGhouled() const
+{
+ return HasAura(SPELL_DK_RAISE_ALLY);
+}
+
void Unit::setDeathState(DeathState s)
{
// Death state needs to be updated before RemoveAllAurasOnDeath() is called, to prevent entering combat
@@ -12597,7 +12189,7 @@ float Unit::ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask)
void Unit::AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask, SpellInfo const* threatSpell)
{
// Only mobs can manage threat lists
- if (CanHaveThreatList())
+ if (CanHaveThreatList() && !HasUnitState(UNIT_STATE_EVADE))
m_ThreatManager.addThreat(victim, fThreat, schoolMask, threatSpell);
}
@@ -12752,7 +12344,7 @@ Unit* Creature::SelectVictim()
if (target && _IsTargetAcceptable(target) && CanCreatureAttack(target))
{
- if(!IsFocusing())
+ if (!IsFocusing())
SetInFront(target);
return target;
}
@@ -13655,28 +13247,80 @@ void Unit::CleanupsBeforeDelete(bool finalCleanup)
void Unit::UpdateCharmAI()
{
- if (GetTypeId() == TYPEID_PLAYER)
- return;
-
- if (i_disabledAI) // disabled AI must be primary AI
- {
- if (!IsCharmed())
- {
- delete i_AI;
- i_AI = i_disabledAI;
- i_disabledAI = NULL;
- }
- }
- else
+ switch (GetTypeId())
{
- if (IsCharmed())
+ case TYPEID_UNIT:
+ if (i_disabledAI) // disabled AI must be primary AI
+ {
+ if (!IsCharmed())
+ {
+ delete i_AI;
+ i_AI = i_disabledAI;
+ i_disabledAI = nullptr;
+
+ if (GetTypeId() == TYPEID_UNIT)
+ ToCreature()->AI()->OnCharmed(false);
+ }
+ }
+ else
+ {
+ if (IsCharmed())
+ {
+ i_disabledAI = i_AI;
+ if (isPossessed() || IsVehicle())
+ i_AI = new PossessedAI(ToCreature());
+ else
+ i_AI = new PetAI(ToCreature());
+ }
+ }
+ break;
+ case TYPEID_PLAYER:
{
- i_disabledAI = i_AI;
- if (isPossessed() || IsVehicle())
- i_AI = new PossessedAI(ToCreature());
+ if (IsCharmed()) // if we are currently being charmed, then we should apply charm AI
+ {
+ i_disabledAI = i_AI;
+
+ UnitAI* newAI = nullptr;
+ // first, we check if the creature's own AI specifies an override playerai for its owned players
+ if (Unit* charmer = GetCharmer())
+ {
+ if (Creature* creatureCharmer = charmer->ToCreature())
+ {
+ if (PlayerAI* charmAI = creatureCharmer->IsAIEnabled ? creatureCharmer->AI()->GetAIForCharmedPlayer(ToPlayer()) : nullptr)
+ newAI = charmAI;
+ }
+ else
+ {
+ TC_LOG_ERROR("misc", "Attempt to assign charm AI to player %s who is charmed by non-creature %s.", GetGUID().ToString().c_str(), GetCharmerGUID().ToString().c_str());
+ }
+ }
+ if (!newAI) // otherwise, we default to the generic one
+ newAI = new SimpleCharmedPlayerAI(ToPlayer());
+ i_AI = newAI;
+ newAI->OnCharmed(true);
+ }
else
- i_AI = new PetAI(ToCreature());
+ {
+ if (i_AI)
+ {
+ // we allow the charmed PlayerAI to clean up
+ i_AI->OnCharmed(false);
+ // then delete it
+ delete i_AI;
+ }
+ else
+ {
+ TC_LOG_ERROR("misc", "Attempt to remove charm AI from player %s who doesn't currently have charm AI.", GetGUID().ToString().c_str());
+ }
+ // and restore our previous PlayerAI (if we had one)
+ i_AI = i_disabledAI;
+ i_disabledAI = nullptr;
+ // IsAIEnabled gets handled in the caller
+ }
+ break;
}
+ default:
+ TC_LOG_ERROR("misc", "Attempt to update charm AI for unit %s, which is neither player nor creature.", GetGUID().ToString().c_str());
}
}
@@ -13764,7 +13408,7 @@ void CharmInfo::InitPossessCreateSpells()
break;
}
- for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
{
uint32 spellId = _unit->ToCreature()->m_spells[i];
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
@@ -13951,6 +13595,20 @@ void CharmInfo::SetSpellAutocast(SpellInfo const* spellInfo, bool state)
}
}
+Unit* Unit::GetMover() const
+{
+ if (Player const* player = ToPlayer())
+ return player->m_mover;
+ return nullptr;
+}
+
+Player* Unit::GetPlayerMover() const
+{
+ if (Unit* mover = GetMover())
+ return mover->ToPlayer();
+ return nullptr;
+}
+
bool Unit::isFrozen() const
{
return HasAuraState(AURA_STATE_FROZEN);
@@ -14151,6 +13809,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
HealInfo healInfo = HealInfo(actor, actionTarget, damage, procSpell, procSpell ? SpellSchoolMask(procSpell->SchoolMask) : SPELL_SCHOOL_MASK_NORMAL);
ProcEventInfo eventInfo = ProcEventInfo(actor, actionTarget, target, procFlag, 0, 0, procExtra, nullptr, &damageInfo, &healInfo);
+ std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
ProcTriggeredList procTriggered;
// Fill procTriggered list
for (AuraApplicationMap::const_iterator itr = GetAppliedAuras().begin(); itr!= GetAppliedAuras().end(); ++itr)
@@ -14158,6 +13817,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
// Do not allow auras to proc from effect triggered by itself
if (procAura && procAura->Id == itr->first)
continue;
+
+ if (itr->second->GetBase()->IsProcOnCooldown(now))
+ continue;
+
ProcTriggeredData triggerData(itr->second->GetBase());
// Defensive procs are active on absorbs (so absorption effects are not a hindrance)
bool active = damage || (procExtra & PROC_EX_BLOCK && isVictim);
@@ -14182,6 +13845,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
if (!triggerData.aura->CallScriptCheckProcHandlers(itr->second, eventInfo))
continue;
+ bool procSuccess = RollProcResult(target, triggerData.aura, attType, isVictim, triggerData.spellProcEvent);
+ if (!procSuccess)
+ continue;
+
// Triggered spells not triggering additional spells
bool triggered = !spellProto->HasAttribute(SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED) ?
(procExtra & PROC_EX_INTERNAL_TRIGGERED && !(procFlag & PROC_FLAG_DONE_TRAP_ACTIVATION)) : false;
@@ -14234,10 +13901,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
bool prepare = i->aura->CallScriptPrepareProcHandlers(aurApp, eventInfo);
- // For players set spell cooldown if need
- uint32 cooldown = 0;
- if (prepare && GetTypeId() == TYPEID_PLAYER && i->spellProcEvent && i->spellProcEvent->cooldown)
- cooldown = i->spellProcEvent->cooldown;
+ Milliseconds cooldown = Milliseconds::zero();
+ if (prepare && i->spellProcEvent && i->spellProcEvent->cooldown)
+ cooldown = Seconds(i->spellProcEvent->cooldown);
// Note: must SetCantProc(false) before return
if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC))
@@ -14246,9 +13912,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
bool handled = i->aura->CallScriptProcHandlers(aurApp, eventInfo);
// "handled" is needed as long as proc can be handled in multiple places
- if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled))
+ if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, &handled))
{
- TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id);
+ TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), Id);
takeCharges = true;
}
@@ -14256,7 +13922,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
{
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
{
- if (!(i->effMask & (1<<effIndex)))
+ if (!(i->effMask & (1 << effIndex)))
continue;
AuraEffect* triggeredByAura = i->aura->GetEffect(effIndex);
@@ -14273,9 +13939,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
{
case SPELL_AURA_PROC_TRIGGER_SPELL:
{
- TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
+ TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)",
+ spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
// Don`t drop charge or add cooldown for not started trigger
- if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra))
takeCharges = true;
break;
}
@@ -14292,7 +13959,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
case SPELL_AURA_MANA_SHIELD:
case SPELL_AURA_DUMMY:
{
- TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
+ TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)",
+ spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
if (HandleDummyAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
takeCharges = true;
break;
@@ -14301,20 +13969,22 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
case SPELL_AURA_MOD_SPELL_CRIT_CHANCE:
case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN:
case SPELL_AURA_MOD_MELEE_HASTE:
- TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, isVictim ? "a victim's" : "an attacker's", triggeredByAura->GetId());
+ TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)",
+ spellInfo->Id, isVictim ? "a victim's" : "an attacker's", triggeredByAura->GetId());
takeCharges = true;
break;
case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
{
- TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
- if (HandleOverrideClassScriptAuraProc(target, damage, triggeredByAura, procSpell, cooldown))
+ TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)",
+ spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
+ if (HandleOverrideClassScriptAuraProc(target, damage, triggeredByAura, procSpell))
takeCharges = true;
break;
}
case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE:
{
TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
- (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
+ (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
HandleAuraRaidProcFromChargeWithValue(triggeredByAura);
takeCharges = true;
@@ -14323,7 +13993,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
case SPELL_AURA_RAID_PROC_FROM_CHARGE:
{
TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
- (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
+ (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
HandleAuraRaidProcFromCharge(triggeredByAura);
takeCharges = true;
@@ -14331,9 +14001,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
}
case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE:
{
- TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
+ TC_LOG_DEBUG("spells", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)",
+ spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
- if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
+ if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra))
takeCharges = true;
break;
}
@@ -14418,6 +14089,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
} // for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
} // if (!handled)
+ if (prepare && takeCharges && cooldown != Milliseconds::zero())
+ i->aura->AddProcCooldown(now + cooldown);
+
// Remove charge (aura can be removed by triggers)
if (prepare && useCharges && takeCharges)
{
@@ -14446,6 +14120,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
void Unit::GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTriggeringProc, std::list<AuraApplication*>* procAuras, ProcEventInfo eventInfo)
{
+ std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
+
// use provided list of auras which can proc
if (procAuras)
{
@@ -14453,9 +14129,9 @@ void Unit::GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTrigge
{
ASSERT((*itr)->GetTarget() == this);
if (!(*itr)->GetRemoveMode())
- if ((*itr)->GetBase()->IsProcTriggeredOnEvent(*itr, eventInfo))
+ if ((*itr)->GetBase()->IsProcTriggeredOnEvent(*itr, eventInfo, now))
{
- (*itr)->GetBase()->PrepareProcToTrigger(*itr, eventInfo);
+ (*itr)->GetBase()->PrepareProcToTrigger(*itr, eventInfo, now);
aurasTriggeringProc.push_back(*itr);
}
}
@@ -14465,9 +14141,9 @@ void Unit::GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTrigge
{
for (AuraApplicationMap::iterator itr = GetAppliedAuras().begin(); itr!= GetAppliedAuras().end(); ++itr)
{
- if (itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo))
+ if (itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo, now))
{
- itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo);
+ itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo, now);
aurasTriggeringProc.push_back(itr->second);
}
}
@@ -14600,7 +14276,7 @@ void Unit::SendMovementFlagUpdate(bool self /* = false */)
bool Unit::IsSitState() const
{
- uint8 s = getStandState();
+ uint8 s = GetStandState();
return
s == UNIT_STAND_STATE_SIT_CHAIR || s == UNIT_STAND_STATE_SIT_LOW_CHAIR ||
s == UNIT_STAND_STATE_SIT_MEDIUM_CHAIR || s == UNIT_STAND_STATE_SIT_HIGH_CHAIR ||
@@ -14609,7 +14285,7 @@ bool Unit::IsSitState() const
bool Unit::IsStandState() const
{
- uint8 s = getStandState();
+ uint8 s = GetStandState();
return !IsSitState() && s != UNIT_STAND_STATE_SLEEP && s != UNIT_STAND_STATE_KNEEL;
}
@@ -14646,7 +14322,7 @@ void Unit::SetDisplayId(uint32 modelId)
SetUInt32Value(UNIT_FIELD_DISPLAYID, modelId);
// Set Gender by modelId
if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId))
- SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
}
void Unit::RestoreDisplayId()
@@ -15089,23 +14765,23 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
return true;
}
-bool Unit::IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent)
+bool Unit::IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent)
{
- SpellInfo const* spellProto = aura->GetSpellInfo();
+ SpellInfo const* spellInfo = aura->GetSpellInfo();
// let the aura be handled by new proc system if it has new entry
- if (sSpellMgr->GetSpellProcEntry(spellProto->Id))
+ if (sSpellMgr->GetSpellProcEntry(spellInfo->Id))
return false;
// Get proc Event Entry
- spellProcEvent = sSpellMgr->GetSpellProcEvent(spellProto->Id);
+ spellProcEvent = sSpellMgr->GetSpellProcEvent(spellInfo->Id);
// Get EventProcFlag
uint32 EventProcFlag;
if (spellProcEvent && spellProcEvent->procFlags) // if exist get custom spellProcEvent->procFlags
EventProcFlag = spellProcEvent->procFlags;
else
- EventProcFlag = spellProto->ProcFlags; // else get from spell proto
+ EventProcFlag = spellInfo->ProcFlags; // else get from spell proto
// Continue if no trigger exist
if (!EventProcFlag)
return false;
@@ -15113,12 +14789,12 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const
// Additional checks for triggered spells (ignore trap casts)
if (procExtra & PROC_EX_INTERNAL_TRIGGERED && !(procFlag & PROC_FLAG_DONE_TRAP_ACTIVATION))
{
- if (!spellProto->HasAttribute(SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED))
+ if (!spellInfo->HasAttribute(SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED))
return false;
}
// Check spellProcEvent data requirements
- if (!sSpellMgr->IsSpellProcEventCanTriggeredBy(spellProto, spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active))
+ if (!sSpellMgr->IsSpellProcEventCanTriggeredBy(spellInfo, spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active))
return false;
// In most cases req get honor or XP from kill
if (EventProcFlag & PROC_FLAG_KILL && GetTypeId() == TYPEID_PLAYER)
@@ -15136,15 +14812,15 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const
}
// Aura added by spell can`t trigger from self (prevent drop charges/do triggers)
// But except periodic and kill triggers (can triggered from self)
- if (procSpell && procSpell->Id == spellProto->Id
- && !(spellProto->ProcFlags&(PROC_FLAG_TAKEN_PERIODIC | PROC_FLAG_KILL)))
+ if (procSpell && procSpell->Id == spellInfo->Id
+ && !(spellInfo->ProcFlags&(PROC_FLAG_TAKEN_PERIODIC | PROC_FLAG_KILL)))
return false;
// Check if current equipment allows aura to proc
if (!isVictim && GetTypeId() == TYPEID_PLAYER)
{
Player* player = ToPlayer();
- if (spellProto->EquippedItemClass == ITEM_CLASS_WEAPON)
+ if (spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON)
{
Item* item = NULL;
if (attType == BASE_ATTACK)
@@ -15157,19 +14833,26 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const
if (player->IsInFeralForm())
return false;
- if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_WEAPON || !((1<<item->GetTemplate()->SubClass) & spellProto->EquippedItemSubClassMask))
+ if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_WEAPON || !((1<<item->GetTemplate()->SubClass) & spellInfo->EquippedItemSubClassMask))
return false;
}
- else if (spellProto->EquippedItemClass == ITEM_CLASS_ARMOR)
+ else if (spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR)
{
// Check if player is wearing shield
Item* item = player->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
- if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_ARMOR || !((1<<item->GetTemplate()->SubClass) & spellProto->EquippedItemSubClassMask))
+ if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_ARMOR || !((1<<item->GetTemplate()->SubClass) & spellInfo->EquippedItemSubClassMask))
return false;
}
}
+
+ return true;
+}
+
+bool Unit::RollProcResult(Unit* victim, Aura* aura, WeaponAttackType attType, bool isVictim, SpellProcEventEntry const* spellProcEvent)
+{
+ SpellInfo const* spellInfo = aura->GetSpellInfo();
// Get chance from spell
- float chance = float(spellProto->ProcChance);
+ float chance = float(spellInfo->ProcChance);
// If in spellProcEvent exist custom chance, chance = spellProcEvent->customChance;
if (spellProcEvent && spellProcEvent->customChance)
chance = spellProcEvent->customChance;
@@ -15179,19 +14862,18 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const
if (!isVictim)
{
uint32 weaponSpeed = GetAttackTime(attType);
- chance = GetPPMProcChance(weaponSpeed, spellProcEvent->ppmRate, spellProto);
+ chance = GetPPMProcChance(weaponSpeed, spellProcEvent->ppmRate, spellInfo);
}
else if (victim)
{
uint32 weaponSpeed = victim->GetAttackTime(attType);
- chance = victim->GetPPMProcChance(weaponSpeed, spellProcEvent->ppmRate, spellProto);
+ chance = victim->GetPPMProcChance(weaponSpeed, spellProcEvent->ppmRate, spellInfo);
}
}
// Apply chance modifer aura
if (Player* modOwner = GetSpellModOwner())
- {
- modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CHANCE_OF_SUCCESS, chance);
- }
+ modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CHANCE_OF_SUCCESS, chance);
+
return roll_chance_f(chance);
}
@@ -15502,12 +15184,19 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
Player* creditedPlayer = GetCharmerOrOwnerPlayerOrPlayerItself();
/// @todo do instance binding anyway if the charmer/owner is offline
- if (instanceMap->IsDungeon() && creditedPlayer)
+ if (instanceMap->IsDungeon() && (creditedPlayer || this == victim))
{
if (instanceMap->IsRaidOrHeroicDungeon())
{
if (creature->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
- ((InstanceMap*)instanceMap)->PermBindAllPlayers(creditedPlayer);
+ {
+ // if the boss killed itself we still need to bind players to the instance
+ if (!creditedPlayer && instanceMap->HavePlayers())
+ creditedPlayer = instanceMap->GetPlayers().getFirst()->GetSource();
+
+ if (creditedPlayer)
+ ((InstanceMap*)instanceMap)->PermBindAllPlayers(creditedPlayer);
+ }
}
else
{
@@ -15515,7 +15204,8 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
// until the players leave the instance
time_t resettime = creature->GetRespawnTimeEx() + 2 * HOUR;
if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(creature->GetInstanceId()))
- if (save->GetResetTime() < resettime) save->SetResetTime(resettime);
+ if (save->GetResetTime() < resettime)
+ save->SetResetTime(resettime);
}
}
}
@@ -15905,11 +15595,21 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
ToCreature()->AI()->OnCharmed(true);
GetMotionMaster()->MoveIdle();
}
- else
+ else if (Player* player = ToPlayer())
{
- Player* player = ToPlayer();
if (player->isAFK())
player->ToggleAFK();
+
+ if (charmer->GetTypeId() == TYPEID_UNIT) // we are charmed by a creature
+ {
+ // change AI to charmed AI on next Update tick
+ NeedChangeAI = true;
+ if (IsAIEnabled)
+ {
+ IsAIEnabled = false;
+ player->AI()->OnCharmed(true);
+ }
+ }
player->SetClientControl(this, false);
}
@@ -15940,7 +15640,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
case CHARM_TYPE_POSSESS:
AddUnitState(UNIT_STATE_POSSESSED);
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
- charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
playerCharmer->SetClientControl(this, true);
playerCharmer->PossessSpellInitialize();
break;
@@ -15951,7 +15651,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
if (cinfo && cinfo->type == CREATURE_TYPE_DEMON)
{
// to prevent client crash
- SetByteValue(UNIT_FIELD_BYTES_0, 1, (uint8)CLASS_MAGE);
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, (uint8)CLASS_MAGE);
// just to enable stat window
if (GetCharmInfo())
@@ -16043,7 +15743,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
case CHARM_TYPE_POSSESS:
playerCharmer->SetClientControl(this, false);
playerCharmer->SetClientControl(charmer, true);
- charmer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ charmer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
ClearUnitState(UNIT_STATE_POSSESSED);
break;
@@ -16053,7 +15753,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate();
if (cinfo && cinfo->type == CREATURE_TYPE_DEMON)
{
- SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class));
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, uint8(cinfo->unit_class));
if (GetCharmInfo())
GetCharmInfo()->SetPetNumber(0, true);
else
@@ -16067,7 +15767,14 @@ void Unit::RemoveCharmedBy(Unit* charmer)
}
if (Player* player = ToPlayer())
+ {
+ if (charmer->GetTypeId() == TYPEID_UNIT) // charmed by a creature, this means we had PlayerAI
+ {
+ NeedChangeAI = true;
+ IsAIEnabled = false;
+ }
player->SetClientControl(this, true);
+ }
// a guardian should always have charminfo
if (playerCharmer && this != charmer->GetFirstControlled())
@@ -16176,8 +15883,8 @@ bool Unit::IsInPartyWith(Unit const* unit) const
if (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_PLAYER)
return u1->ToPlayer()->IsInSameGroupWith(u2->ToPlayer());
- else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER) ||
- (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER))
+ else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT) ||
+ (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
return true;
else
return false;
@@ -16195,8 +15902,8 @@ bool Unit::IsInRaidWith(Unit const* unit) const
if (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_PLAYER)
return u1->ToPlayer()->IsInSameRaidWith(u2->ToPlayer());
- else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER) ||
- (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER))
+ else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT) ||
+ (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
return true;
else
return false;
@@ -16564,7 +16271,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) const
// Based on Hair color
if (getRace() == RACE_NIGHTELF)
{
- uint8 hairColor = GetByteValue(PLAYER_BYTES, 3);
+ uint8 hairColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID);
switch (hairColor)
{
case 7: // Violet
@@ -16585,7 +16292,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) const
// Based on Skin color
else if (getRace() == RACE_TAUREN)
{
- uint8 skinColor = GetByteValue(PLAYER_BYTES, 0);
+ uint8 skinColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID);
// Male
if (getGender() == GENDER_MALE)
{
@@ -16644,7 +16351,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) const
// Based on Hair color
if (getRace() == RACE_NIGHTELF)
{
- uint8 hairColor = GetByteValue(PLAYER_BYTES, 3);
+ uint8 hairColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID);
switch (hairColor)
{
case 0: // Green
@@ -16664,7 +16371,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) const
// Based on Skin color
else if (getRace() == RACE_TAUREN)
{
- uint8 skinColor = GetByteValue(PLAYER_BYTES, 0);
+ uint8 skinColor = GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID);
// Male
if (getGender() == GENDER_MALE)
{
@@ -17078,7 +16785,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
Movement::MoveSplineInit init(this);
// Creatures without inhabit type air should begin falling after exiting the vehicle
- if (GetTypeId() == TYPEID_UNIT && !CanFly() && height > GetMap()->GetWaterOrGroundLevel(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), &height) + 0.1f)
+ if (GetTypeId() == TYPEID_UNIT && !CanFly() && height > GetMap()->GetWaterOrGroundLevel(GetPhaseMask(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), &height) + 0.1f)
init.SetFall();
init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), height, false);
@@ -17541,7 +17248,7 @@ void Unit::SetFacingToObject(WorldObject const* object)
/// @todo figure out under what conditions creature will move towards object instead of facing it where it currently is.
Movement::MoveSplineInit init(this);
- init.MoveTo(GetPositionX(), GetPositionY(), GetPositionZMinusOffset());
+ init.MoveTo(GetPositionX(), GetPositionY(), GetPositionZMinusOffset(), false);
init.SetFacing(GetAngle(object)); // when on transport, GetAngle will still return global coordinates (and angle) that needs transforming
init.Launch();
}
@@ -17555,7 +17262,6 @@ bool Unit::SetWalk(bool enable)
AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
else
RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
-
return true;
}
@@ -17570,15 +17276,7 @@ bool Unit::SetDisableGravity(bool disable, bool /*packetOnly = false*/)
RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING);
}
else
- {
RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
- if (!HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY))
- {
- m_movementInfo.SetFallTime(0);
- AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
- }
- }
-
return true;
}
@@ -17591,7 +17289,6 @@ bool Unit::SetSwim(bool enable)
AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
else
RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
-
return true;
}
@@ -17606,15 +17303,7 @@ bool Unit::SetCanFly(bool enable, bool /*packetOnly = false */)
RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING);
}
else
- {
RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_MASK_MOVING_FLY);
- if (!IsLevitating())
- {
- m_movementInfo.SetFallTime(0);
- AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
- }
- }
-
return true;
}
@@ -17627,7 +17316,6 @@ bool Unit::SetWaterWalking(bool enable, bool /*packetOnly = false */)
AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING);
else
RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING);
-
return true;
}
@@ -17640,7 +17328,6 @@ bool Unit::SetFeatherFall(bool enable, bool /*packetOnly = false */)
AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW);
else
RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW);
-
return true;
}
@@ -17668,7 +17355,6 @@ bool Unit::SetHover(bool enable, bool /*packetOnly = false*/)
UpdateHeight(newZ);
}
}
-
return true;
}
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 4565160dc93..0f48f31b9c0 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -76,6 +76,7 @@ enum SpellAuraInterruptFlags
AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT = 0x00800000, // 23 removed by entering pvp combat
AURA_INTERRUPT_FLAG_DIRECT_DAMAGE = 0x01000000, // 24 removed by any direct damage
AURA_INTERRUPT_FLAG_LANDING = 0x02000000, // 25 removed by hitting the ground
+ AURA_INTERRUPT_FLAG_LEAVE_COMBAT = 0x80000000, // 31 removed by leaving combat
AURA_INTERRUPT_FLAG_NOT_VICTIM = (AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE | AURA_INTERRUPT_FLAG_DIRECT_DAMAGE)
};
@@ -190,6 +191,30 @@ enum UnitStandFlags
UNIT_STAND_FLAGS_ALL = 0xFF
};
+enum UnitBytes0Offsets
+{
+ UNIT_BYTES_0_OFFSET_RACE = 0,
+ UNIT_BYTES_0_OFFSET_CLASS = 1,
+ UNIT_BYTES_0_OFFSET_GENDER = 2,
+ UNIT_BYTES_0_OFFSET_POWER_TYPE = 3,
+};
+
+enum UnitBytes1Offsets
+{
+ UNIT_BYTES_1_OFFSET_STAND_STATE = 0,
+ UNIT_BYTES_1_OFFSET_PET_TALENTS = 1,
+ UNIT_BYTES_1_OFFSET_VIS_FLAG = 2,
+ UNIT_BYTES_1_OFFSET_ANIM_TIER = 3
+};
+
+enum UnitBytes2Offsets
+{
+ UNIT_BYTES_2_OFFSET_SHEATH_STATE = 0,
+ UNIT_BYTES_2_OFFSET_PVP_FLAG = 1,
+ UNIT_BYTES_2_OFFSET_PET_FLAG = 2,
+ UNIT_BYTES_2_OFFSET_SHAPESHIFT = 3,
+};
+
// byte flags value (UNIT_FIELD_BYTES_1, 3)
enum UnitBytes1_Flags
{
@@ -533,10 +558,10 @@ enum UnitMoveType
#define MAX_MOVE_TYPE 9
-extern float baseMoveSpeed[MAX_MOVE_TYPE];
-extern float playerBaseMoveSpeed[MAX_MOVE_TYPE];
+TC_GAME_API extern float baseMoveSpeed[MAX_MOVE_TYPE];
+TC_GAME_API extern float playerBaseMoveSpeed[MAX_MOVE_TYPE];
-enum WeaponAttackType
+enum WeaponAttackType : uint8
{
BASE_ATTACK = 0,
OFF_ATTACK = 1,
@@ -586,11 +611,11 @@ enum DamageEffectType
};
// Value masks for UNIT_FIELD_FLAGS
-enum UnitFlags
+enum UnitFlags : uint32
{
UNIT_FLAG_SERVER_CONTROLLED = 0x00000001, // set only when unit movement is controlled by server - by SPLINE/MONSTER_MOVE packets, together with UNIT_FLAG_STUNNED; only set to units controlled by client; client function CGUnit_C::IsClientControlled returns false when set for owner
UNIT_FLAG_NON_ATTACKABLE = 0x00000002, // not attackable
- UNIT_FLAG_DISABLE_MOVE = 0x00000004,
+ UNIT_FLAG_REMOVE_CLIENT_CONTROL = 0x00000004, // This is a legacy flag used to disable movement player's movement while controlling other units, SMSG_CLIENT_CONTROL replaces this functionality clientside now. CONFUSED and FLEEING flags have the same effect on client movement asDISABLE_MOVE_CONTROL in addition to preventing spell casts/autoattack (they all allow climbing steeper hills and emotes while moving)
UNIT_FLAG_PVP_ATTACKABLE = 0x00000008, // allow apply pvp rules to attackable state in addition to faction dependent state
UNIT_FLAG_RENAME = 0x00000010,
UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP
@@ -602,7 +627,7 @@ enum UnitFlags
UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8
UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3
UNIT_FLAG_SILENCED = 0x00002000, // silenced, 2.1.1
- UNIT_FLAG_UNK_14 = 0x00004000, // 2.0.8
+ UNIT_FLAG_CANNOT_SWIM = 0x00004000, // 2.0.8
UNIT_FLAG_UNK_15 = 0x00008000,
UNIT_FLAG_UNK_16 = 0x00010000,
UNIT_FLAG_PACIFIED = 0x00020000, // 3.0.3 ok
@@ -714,14 +739,13 @@ enum MovementFlags
MOVEMENTFLAG_FALLING_SLOW = 0x20000000, // active rogue safe fall spell (passive)
MOVEMENTFLAG_HOVER = 0x40000000, // hover, cannot jump
- /// @todo Check if PITCH_UP and PITCH_DOWN really belong here..
MOVEMENTFLAG_MASK_MOVING =
MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD | MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT |
- MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN | MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING |
+ MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING |
MOVEMENTFLAG_SPLINE_ELEVATION,
MOVEMENTFLAG_MASK_TURNING =
- MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT,
+ MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT | MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN,
MOVEMENTFLAG_MASK_MOVING_FLY =
MOVEMENTFLAG_FLYING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING,
@@ -826,7 +850,7 @@ struct CleanDamage
struct CalcDamageInfo;
-class DamageInfo
+class TC_GAME_API DamageInfo
{
private:
Unit* const m_attacker;
@@ -889,7 +913,7 @@ public:
SpellSchoolMask GetSchoolMask() const { return _schoolMask; };
};
-class ProcEventInfo
+class TC_GAME_API ProcEventInfo
{
public:
ProcEventInfo(Unit* actor, Unit* actionTarget, Unit* procTarget, uint32 typeMask,
@@ -947,7 +971,7 @@ struct CalcDamageInfo
};
// Spell damage info structure based on structure sending in SMSG_SPELLNONMELEEDAMAGELOG opcode
-struct SpellNonMeleeDamage
+struct TC_GAME_API SpellNonMeleeDamage
{
SpellNonMeleeDamage(Unit* _attacker, Unit* _target, uint32 _SpellID, uint32 _schoolMask)
: target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), overkill(0), schoolMask(_schoolMask),
@@ -1043,7 +1067,7 @@ enum ReactStates
REACT_AGGRESSIVE = 2
};
-enum CommandStates
+enum CommandStates : uint8
{
COMMAND_STAY = 0,
COMMAND_FOLLOW = 1,
@@ -1108,7 +1132,7 @@ enum ActionBarIndex
#define MAX_UNIT_ACTION_BAR_INDEX (ACTION_BAR_INDEX_END-ACTION_BAR_INDEX_START)
-struct CharmInfo
+struct TC_GAME_API CharmInfo
{
public:
explicit CharmInfo(Unit* unit);
@@ -1210,7 +1234,7 @@ enum PlayerTotemType
struct SpellProcEventEntry; // used only privately
-class Unit : public WorldObject
+class TC_GAME_API Unit : public WorldObject
{
public:
typedef std::set<Unit*> AttackerSet;
@@ -1265,9 +1289,8 @@ class Unit : public WorldObject
bool CanDualWield() const { return m_canDualWield; }
virtual void SetCanDualWield(bool value) { m_canDualWield = value; }
float GetCombatReach() const { return m_floatValues[UNIT_FIELD_COMBATREACH]; }
- float GetMeleeReach() const;
bool IsWithinCombatRange(const Unit* obj, float dist2compare) const;
- bool IsWithinMeleeRange(const Unit* obj, float dist = MELEE_RANGE) const;
+ bool IsWithinMeleeRange(Unit const* obj) const;
void GetRandomContactPoint(const Unit* target, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const;
uint32 m_extraAttacks;
bool m_canDualWield;
@@ -1276,7 +1299,7 @@ class Unit : public WorldObject
void _removeAttacker(Unit* pAttacker); // must be called only from Unit::AttackStop()
Unit* getAttackerForHelper() const; // If someone wants to help, who to give them
bool Attack(Unit* victim, bool meleeAttack);
- void MustReacquireTarget() { m_shouldReacquireTarget = true; } // flags the Unit for forced target reacquisition in the next ::Attack call
+ void MustReacquireTarget() { m_shouldReacquireTarget = true; } // flags the Unit for forced (client displayed) target reacquisition in the next ::Attack call
void CastStop(uint32 except_spellid = 0);
bool AttackStop();
void RemoveAllAttackers();
@@ -1314,11 +1337,11 @@ class Unit : public WorldObject
uint8 getLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); }
uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return getLevel(); }
void SetLevel(uint8 lvl);
- uint8 getRace() const { return GetByteValue(UNIT_FIELD_BYTES_0, 0); }
+ uint8 getRace() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_RACE); }
uint32 getRaceMask() const { return 1 << (getRace()-1); }
- uint8 getClass() const { return GetByteValue(UNIT_FIELD_BYTES_0, 1); }
+ uint8 getClass() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS); }
uint32 getClassMask() const { return 1 << (getClass()-1); }
- uint8 getGender() const { return GetByteValue(UNIT_FIELD_BYTES_0, 2); }
+ uint8 getGender() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER); }
float GetStat(Stats stat) const { return float(GetUInt32Value(UNIT_FIELD_STAT0+stat)); }
void SetStat(Stats stat, int32 val) { SetStatInt32Value(UNIT_FIELD_STAT0+stat, val); }
@@ -1347,7 +1370,7 @@ class Unit : public WorldObject
int32 ModifyHealth(int32 val);
int32 GetHealthGain(int32 dVal);
- Powers getPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, 3)); }
+ Powers getPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE)); }
void setPowerType(Powers power);
uint32 GetPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_POWER1 +power); }
uint32 GetMaxPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_MAXPOWER1+power); }
@@ -1383,11 +1406,12 @@ class Unit : public WorldObject
bool IsContestedGuard() const;
bool IsPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); }
bool IsFFAPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); }
- void SetPvP(bool state);
+ virtual void SetPvP(bool state);
+
uint32 GetCreatureType() const;
uint32 GetCreatureTypeMask() const;
- uint8 getStandState() const { return GetByteValue(UNIT_FIELD_BYTES_1, 0); }
+ uint8 GetStandState() const { return GetByteValue(UNIT_FIELD_BYTES_1, 0); }
bool IsSitState() const;
bool IsStandState() const;
void SetStandState(uint8 state);
@@ -1561,7 +1585,7 @@ class Unit : public WorldObject
void SendTeleportPacket(Position& pos);
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false);
// returns true if unit's position really changed
- bool UpdatePosition(const Position &pos, bool teleport = false);
+ virtual bool UpdatePosition(const Position &pos, bool teleport = false);
void UpdateOrientation(float orientation);
void UpdateHeight(float newZ);
@@ -1601,7 +1625,7 @@ class Unit : public WorldObject
bool IsAlive() const { return (m_deathState == ALIVE); }
bool isDying() const { return (m_deathState == JUST_DIED); }
bool isDead() const { return (m_deathState == DEAD || m_deathState == CORPSE); }
- bool IsGhouled() const { return HasAura(46619 /*SPELL_DK_RAISE_ALLY*/); }
+ bool IsGhouled() const;
DeathState getDeathState() const { return m_deathState; }
virtual void setDeathState(DeathState s); // overwrited in Creature/Player/Pet
@@ -1659,7 +1683,8 @@ class Unit : public WorldObject
CharmInfo* InitCharmInfo();
void DeleteCharmInfo();
void UpdateCharmAI();
- //Player* GetMoverSource() const;
+ Unit* GetMover() const;
+ Player* GetPlayerMover() const;
Player* m_movedPlayer;
SharedVisionList const& GetSharedVisionList() { return m_sharedVision; }
void AddPlayerToVision(Player* player);
@@ -1704,6 +1729,16 @@ class Unit : public WorldObject
void RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
void RemoveAura(Aura* aur, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
+ // Convenience methods removing auras by predicate
+ void RemoveAppliedAuras(std::function<bool(AuraApplication const*)> const& check);
+ void RemoveOwnedAuras(std::function<bool(Aura const*)> const& check);
+
+ // Optimized overloads taking advantage of map key
+ void RemoveAppliedAuras(uint32 spellId, std::function<bool(AuraApplication const*)> const& check);
+ void RemoveOwnedAuras(uint32 spellId, std::function<bool(Aura const*)> const& check);
+
+ void RemoveAurasByType(AuraType auraType, std::function<bool(AuraApplication const*)> const& check);
+
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
@@ -1720,6 +1755,7 @@ class Unit : public WorldObject
void RemoveAreaAurasDueToLeaveWorld();
void RemoveAllAuras();
void RemoveArenaAuras();
+ void RemoveAurasOnEvade();
void RemoveAllAurasOnDeath();
void RemoveAllAurasRequiringDeadTarget();
void RemoveAllAurasExceptType(AuraType type);
@@ -1821,6 +1857,9 @@ class Unit : public WorldObject
Spell* FindCurrentSpellBySpellId(uint32 spell_id) const;
int32 GetCurrentSpellCastTime(uint32 spell_id) const;
+ // Check if our current channel spell has attribute SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING
+ bool CanMoveDuringChannel() const;
+
SpellHistory* GetSpellHistory() { return m_spellHistory; }
SpellHistory const* GetSpellHistory() const { return m_spellHistory; }
@@ -1983,10 +2022,11 @@ class Unit : public WorldObject
void CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = NULL);
void CalcHealAbsorb(Unit* victim, SpellInfo const* spellInfo, uint32& healAmount, uint32& absorb);
- void UpdateSpeed(UnitMoveType mtype, bool forced);
+ void UpdateSpeed(UnitMoveType mtype);
float GetSpeed(UnitMoveType mtype) const;
float GetSpeedRate(UnitMoveType mtype) const { return m_speed_rate[mtype]; }
- void SetSpeed(UnitMoveType mtype, float rate, bool forced = false);
+ void SetSpeed(UnitMoveType mtype, float newValue);
+ void SetSpeedRate(UnitMoveType mtype, float rate);
float ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index, float value) const;
int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = NULL) const;
@@ -2130,11 +2170,11 @@ class Unit : public WorldObject
virtual void Yell(std::string const& text, Language language, WorldObject const* target = nullptr);
virtual void TextEmote(std::string const& text, WorldObject const* target = nullptr, bool isBossEmote = false);
virtual void Whisper(std::string const& text, Language language, Player* target, bool isBossWhisper = false);
- void Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject const* target);
- void Say(uint32 textId, WorldObject const* target = nullptr);
- void Yell(uint32 textId, WorldObject const* target = nullptr);
- void TextEmote(uint32 textId, WorldObject const* target = nullptr, bool isBossEmote = false);
- void Whisper(uint32 textId, Player* target, bool isBossWhisper = false);
+ virtual void Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject const* target);
+ virtual void Say(uint32 textId, WorldObject const* target = nullptr);
+ virtual void Yell(uint32 textId, WorldObject const* target = nullptr);
+ virtual void TextEmote(uint32 textId, WorldObject const* target = nullptr, bool isBossEmote = false);
+ virtual void Whisper(uint32 textId, Player* target, bool isBossWhisper = false);
protected:
explicit Unit (bool isWorldObject);
@@ -2214,11 +2254,12 @@ class Unit : public WorldObject
void DisableSpline();
private:
- bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent);
- bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
- bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled);
- bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
- bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown);
+ bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent);
+ bool RollProcResult(Unit* victim, Aura* aura, WeaponAttackType attType, bool isVictim, SpellProcEventEntry const* spellProcEvent);
+ bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, Milliseconds& cooldown);
+ bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, bool* handled);
+ bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx);
+ bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell);
bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura);
bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura);
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index 9cf485322f2..1c5299f4798 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -238,7 +238,7 @@ void Vehicle::RemoveAllPassengers()
while (!_pendingJoinEvents.empty())
{
VehicleJoinEvent* e = _pendingJoinEvents.front();
- e->to_Abort = true;
+ e->ScheduleAbort();
e->Target = eventVehicle;
_pendingJoinEvents.pop_front();
}
@@ -429,7 +429,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
if (seat == Seats.end()) // no available seat
{
- e->to_Abort = true;
+ e->ScheduleAbort();
return false;
}
@@ -441,7 +441,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
seat = Seats.find(seatId);
if (seat == Seats.end())
{
- e->to_Abort = true;
+ e->ScheduleAbort();
return false;
}
@@ -532,6 +532,9 @@ void Vehicle::RelocatePassengers()
{
ASSERT(_me->GetMap());
+ std::vector<std::pair<Unit*, Position>> seatRelocation;
+ seatRelocation.reserve(Seats.size());
+
// not sure that absolute position calculation is correct, it must depend on vehicle pitch angle
for (SeatMap::const_iterator itr = Seats.begin(); itr != Seats.end(); ++itr)
{
@@ -542,9 +545,12 @@ void Vehicle::RelocatePassengers()
float px, py, pz, po;
passenger->m_movementInfo.transport.pos.GetPosition(px, py, pz, po);
CalculatePassengerPosition(px, py, pz, &po);
- passenger->UpdatePosition(px, py, pz, po);
+ seatRelocation.emplace_back(passenger, Position(px, py, pz, po));
}
}
+
+ for (auto const& pair : seatRelocation)
+ pair.first->UpdatePosition(pair.second);
}
/**
@@ -701,7 +707,7 @@ void Vehicle::RemovePendingEventsForSeat(int8 seatId)
{
if ((*itr)->Seat->first == seatId)
{
- (*itr)->to_Abort = true;
+ (*itr)->ScheduleAbort();
_pendingJoinEvents.erase(itr++);
}
else
@@ -726,7 +732,7 @@ void Vehicle::RemovePendingEventsForPassenger(Unit* passenger)
{
if ((*itr)->Passenger == passenger)
{
- (*itr)->to_Abort = true;
+ (*itr)->ScheduleAbort();
_pendingJoinEvents.erase(itr++);
}
else
diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h
index cd28c4082d4..f8992708a46 100644
--- a/src/server/game/Entities/Vehicle/Vehicle.h
+++ b/src/server/game/Entities/Vehicle/Vehicle.h
@@ -29,7 +29,7 @@ struct VehicleEntry;
class Unit;
class VehicleJoinEvent;
-class Vehicle : public TransportBase
+class TC_GAME_API Vehicle : public TransportBase
{
protected:
friend bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry);
@@ -118,7 +118,7 @@ class Vehicle : public TransportBase
PendingJoinEventContainer _pendingJoinEvents; ///< Collection of delayed join events for prospective passengers
};
-class VehicleJoinEvent : public BasicEvent
+class TC_GAME_API VehicleJoinEvent : public BasicEvent
{
friend class Vehicle;
protected:
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index b2871786034..bb8e89d4829 100644
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -29,6 +29,12 @@
#include "UnitAI.h"
#include "GameObjectAI.h"
+GameEventMgr* GameEventMgr::instance()
+{
+ static GameEventMgr instance;
+ return &instance;
+}
+
bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
{
switch (mGameEvent[entry].state)
@@ -221,7 +227,7 @@ void GameEventMgr::LoadFromDB()
uint8 event_id = fields[0].GetUInt8();
if (event_id == 0)
{
- TC_LOG_ERROR("sql.sql", "`game_event` game event entry 0 is reserved and can't be used.");
+ TC_LOG_ERROR("sql.sql", "`game_event`: game event entry 0 is reserved and can't be used.");
continue;
}
@@ -240,7 +246,7 @@ void GameEventMgr::LoadFromDB()
if (pGameEvent.length == 0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check
{
- TC_LOG_ERROR("sql.sql", "`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event`: game event id (%i) is not a world event and has length = 0, thus cannot be used.", event_id);
continue;
}
@@ -248,7 +254,7 @@ void GameEventMgr::LoadFromDB()
{
if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id))
{
- TC_LOG_ERROR("sql.sql", "`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id);
+ TC_LOG_ERROR("sql.sql", "`game_event`: game event id (%i) contains nonexisting holiday id %u.", event_id, pGameEvent.holiday_id);
pGameEvent.holiday_id = HOLIDAY_NONE;
}
}
@@ -259,7 +265,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
@@ -283,7 +289,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_save`: game event entry (%i) is out of range compared to max event entry in `game_event`.", event_id);
continue;
}
@@ -294,7 +300,7 @@ void GameEventMgr::LoadFromDB()
}
else
{
- TC_LOG_ERROR("sql.sql", "game_event_save includes event save for non-worldevent id %u", event_id);
+ TC_LOG_ERROR("sql.sql", "game_event_save includes event save for non-worldevent id %u.", event_id);
continue;
}
@@ -302,7 +308,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u game event saves in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -326,7 +332,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_prerequisite`: game event id (%i) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -335,14 +341,14 @@ void GameEventMgr::LoadFromDB()
uint16 prerequisite_event = fields[1].GetUInt32();
if (prerequisite_event >= mGameEvent.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event);
+ TC_LOG_ERROR("sql.sql", "`game_event_prerequisite`: game event prerequisite id (%i) is out of range compared to max event id in `game_event`.", prerequisite_event);
continue;
}
mGameEvent[event_id].prerequisite_events.insert(prerequisite_event);
}
else
{
- TC_LOG_ERROR("sql.sql", "game_event_prerequisiste includes event entry for non-worldevent id %u", event_id);
+ TC_LOG_ERROR("sql.sql", "game_event_prerequisiste includes event entry for non-worldevent id %u.", event_id);
continue;
}
@@ -350,7 +356,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u game event prerequisites in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -363,7 +369,7 @@ void GameEventMgr::LoadFromDB()
QueryResult result = WorldDatabase.Query("SELECT guid, eventEntry FROM game_event_creature");
if (!result)
- TC_LOG_INFO("server.loading", ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty");
+ TC_LOG_INFO("server.loading", ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty.");
else
{
uint32 count = 0;
@@ -385,7 +391,7 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size()))
{
- TC_LOG_ERROR("sql.sql", "`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_creature`: game event id (%i) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -396,7 +402,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u creatures in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -431,7 +437,7 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size()))
{
- TC_LOG_ERROR("sql.sql", "`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_gameobject`: game event id (%i) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -442,7 +448,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u gameobjects in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -469,7 +475,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventModelEquip.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_model_equip`: game event id (%u) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -485,7 +491,7 @@ void GameEventMgr::LoadFromDB()
int8 equipId = static_cast<int8>(newModelEquipSet.equipment_id);
if (!sObjectMgr->GetEquipmentInfo(entry, equipId))
{
- TC_LOG_ERROR("sql.sql", "Table `game_event_model_equip` have creature (Guid: %u, entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.",
+ TC_LOG_ERROR("sql.sql", "Table `game_event_model_equip` contains creature (Guid: %u, entry: %u) with equipment_id %u not found in table `creature_equip_template`. Setting entry to no equipment.",
guid, entry, newModelEquipSet.equipment_id);
continue;
}
@@ -497,7 +503,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u model/equipment changes in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -523,7 +529,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventCreatureQuests.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_creature_quest`: game event id (%u) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -534,7 +540,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u quests additions in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -560,7 +566,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventGameObjectQuests.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_gameobject_quest`: game event id (%u) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -571,7 +577,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u quests additions in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -598,7 +604,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_quest_condition`: game event id (%u) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -610,7 +616,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u quest event conditions in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -635,7 +641,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_condition`: game event id (%u) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -648,7 +654,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u conditions in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -673,7 +679,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_condition_save`: game event id (%u) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -684,7 +690,7 @@ void GameEventMgr::LoadFromDB()
}
else
{
- TC_LOG_ERROR("sql.sql", "game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition);
+ TC_LOG_ERROR("sql.sql", "game_event_condition_save contains not present condition event id %u condition id %u.", event_id, condition);
continue;
}
@@ -692,7 +698,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u condition saves in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -718,7 +724,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_npcflag`: game event id (%u) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -728,7 +734,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u npcflags in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -753,13 +759,13 @@ void GameEventMgr::LoadFromDB()
if (!sObjectMgr->GetQuestTemplate(questId))
{
- TC_LOG_ERROR("sql.sql", "`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId);
+ TC_LOG_ERROR("sql.sql", "`game_event_seasonal_questrelation`: quest id (%u) does not exist in `quest_template`.", questId);
continue;
}
if (eventEntry >= mGameEvent.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry);
+ TC_LOG_ERROR("sql.sql", "`game_event_seasonal_questrelation`: event id (%u) is out of range compared to max event in `game_event`.", eventEntry);
continue;
}
@@ -768,7 +774,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u quests additions in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -792,7 +798,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventVendors.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_npc_vendor`: game event id (%u) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -830,7 +836,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u vendor additions in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -854,7 +860,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- TC_LOG_ERROR("sql.sql", "`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_battleground_holiday`: game event id (%u) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
@@ -864,7 +870,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u battleground holidays in game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
@@ -892,13 +898,13 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
- TC_LOG_ERROR("sql.sql", "`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ TC_LOG_ERROR("sql.sql", "`game_event_pool`: game event id (%i) is out of range compared to max event id in `game_event`.", event_id);
continue;
}
if (!sPoolMgr->CheckPool(entry))
{
- TC_LOG_ERROR("sql.sql", "Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry);
+ TC_LOG_ERROR("sql.sql", "Pool Id (%u) has all creatures or gameobjects with explicit chance sum <> 100 and no equal chance defined. The pool system cannot pick one to spawn.", entry);
continue;
}
@@ -909,7 +915,7 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u pools for game events in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
}
}
@@ -971,7 +977,7 @@ void GameEventMgr::StartArenaSeason()
if (!result)
{
- TC_LOG_ERROR("gameevent", "ArenaSeason (%u) must be an existant Arena Season", season);
+ TC_LOG_ERROR("gameevent", "ArenaSeason (%u) must be an existing Arena Season.", season);
return;
}
@@ -980,7 +986,7 @@ void GameEventMgr::StartArenaSeason()
if (eventId >= mGameEvent.size())
{
- TC_LOG_ERROR("gameevent", "EventEntry %u for ArenaSeason (%u) does not exists", eventId, season);
+ TC_LOG_ERROR("gameevent", "EventEntry %u for ArenaSeason (%u) does not exist.", eventId, season);
return;
}
@@ -1171,7 +1177,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size()))
{
- TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: %zu)",
+ TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempted access to out of range mGameEventCreatureGuids element %i (size: %zu).",
internal_event_id, mGameEventCreatureGuids.size());
return;
}
@@ -1198,7 +1204,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size()))
{
- TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %zu)",
+ TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempted access to out of range mGameEventGameobjectGuids element %i (size: %zu).",
internal_event_id, mGameEventGameobjectGuids.size());
return;
}
@@ -1231,7 +1237,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
- TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: %zu)",
+ TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventSpawn attempted access to out of range mGameEventPoolIds element %u (size: %zu).",
internal_event_id, mGameEventPoolIds.size());
return;
}
@@ -1246,7 +1252,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size()))
{
- TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: %zu)",
+ TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempted access to out of range mGameEventCreatureGuids element %i (size: %zu).",
internal_event_id, mGameEventCreatureGuids.size());
return;
}
@@ -1276,7 +1282,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size()))
{
- TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %zu)",
+ TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempted access to out of range mGameEventGameobjectGuids element %i (size: %zu).",
internal_event_id, mGameEventGameobjectGuids.size());
return;
}
@@ -1305,7 +1311,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
}
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
- TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: %zu)", internal_event_id, mGameEventPoolIds.size());
+ TC_LOG_ERROR("gameevent", "GameEventMgr::GameEventUnspawn attempted access to out of range mGameEventPoolIds element %u (size: %zu).", internal_event_id, mGameEventPoolIds.size());
return;
}
diff --git a/src/server/game/Events/GameEventMgr.h b/src/server/game/Events/GameEventMgr.h
index b8d281dfdd7..44ed2fb1332 100644
--- a/src/server/game/Events/GameEventMgr.h
+++ b/src/server/game/Events/GameEventMgr.h
@@ -93,18 +93,14 @@ class Player;
class Creature;
class Quest;
-class GameEventMgr
+class TC_GAME_API GameEventMgr
{
private:
GameEventMgr();
~GameEventMgr() { }
public:
- static GameEventMgr* instance()
- {
- static GameEventMgr instance;
- return &instance;
- }
+ static GameEventMgr* instance();
typedef std::set<uint16> ActiveEvents;
typedef std::vector<GameEventData> GameEventDataMap;
@@ -186,8 +182,8 @@ class GameEventMgr
#define sGameEventMgr GameEventMgr::instance()
-bool IsHolidayActive(HolidayIds id);
-bool IsEventActive(uint16 event_id);
+TC_GAME_API bool IsHolidayActive(HolidayIds id);
+TC_GAME_API bool IsEventActive(uint16 event_id);
#endif
diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp
index 762c9b9c28e..247c4943113 100644
--- a/src/server/game/Globals/ObjectAccessor.cpp
+++ b/src/server/game/Globals/ObjectAccessor.cpp
@@ -34,6 +34,53 @@
#include <boost/thread/shared_mutex.hpp>
#include <boost/thread/locks.hpp>
+template<class T>
+void HashMapHolder<T>::Insert(T* o)
+{
+ boost::unique_lock<boost::shared_mutex> lock(*GetLock());
+
+ GetContainer()[o->GetGUID()] = o;
+}
+
+template<class T>
+void HashMapHolder<T>::Remove(T* o)
+{
+ boost::unique_lock<boost::shared_mutex> lock(*GetLock());
+
+ GetContainer().erase(o->GetGUID());
+}
+
+template<class T>
+T* HashMapHolder<T>::Find(ObjectGuid guid)
+{
+ boost::shared_lock<boost::shared_mutex> lock(*GetLock());
+
+ typename MapType::iterator itr = GetContainer().find(guid);
+ return (itr != GetContainer().end()) ? itr->second : NULL;
+}
+
+template<class T>
+auto HashMapHolder<T>::GetContainer() -> MapType&
+{
+ static MapType _objectMap;
+ return _objectMap;
+}
+
+template<class T>
+boost::shared_mutex* HashMapHolder<T>::GetLock()
+{
+ static boost::shared_mutex _lock;
+ return &_lock;
+}
+
+HashMapHolder<Player>::MapType const& ObjectAccessor::GetPlayers()
+{
+ return HashMapHolder<Player>::GetContainer();
+}
+
+template class TC_GAME_API HashMapHolder<Player>;
+template class TC_GAME_API HashMapHolder<Transport>;
+
WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, ObjectGuid const& guid)
{
switch (guid.GetHigh())
@@ -206,11 +253,6 @@ Player* ObjectAccessor::FindConnectedPlayerByName(std::string const& name)
return NULL;
}
-HashMapHolder<Player>::MapType const& ObjectAccessor::GetPlayers()
-{
- return HashMapHolder<Player>::GetContainer();
-}
-
void ObjectAccessor::SaveAllPlayers()
{
boost::shared_lock<boost::shared_mutex> lock(*HashMapHolder<Player>::GetLock());
@@ -219,14 +261,3 @@ void ObjectAccessor::SaveAllPlayers()
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
itr->second->SaveToDB();
}
-
-/// Define the static members of HashMapHolder
-
-template <class T> typename HashMapHolder<T>::MapType HashMapHolder<T>::_objectMap;
-template <class T> boost::shared_mutex HashMapHolder<T>::_lock;
-
-/// Global definitions for the hashmap storage
-
-template class HashMapHolder<Player>;
-
-template class HashMapHolder<Transport>;
diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h
index d8466dbb1bc..be7066c84a9 100644
--- a/src/server/game/Globals/ObjectAccessor.h
+++ b/src/server/game/Globals/ObjectAccessor.h
@@ -42,76 +42,56 @@ class WorldRunnable;
class Transport;
template <class T>
-class HashMapHolder
+class TC_GAME_API HashMapHolder
{
- public:
- static_assert(std::is_same<Player, T>::value
- || std::is_same<Transport, T>::value,
- "Only Player and Transport can be registered in global HashMapHolder");
+ //Non instanceable only static
+ HashMapHolder() { }
- typedef std::unordered_map<ObjectGuid, T*> MapType;
+public:
+ static_assert(std::is_same<Player, T>::value
+ || std::is_same<Transport, T>::value,
+ "Only Player and Transport can be registered in global HashMapHolder");
- static void Insert(T* o)
- {
- boost::unique_lock<boost::shared_mutex> lock(_lock);
+ typedef std::unordered_map<ObjectGuid, T*> MapType;
- _objectMap[o->GetGUID()] = o;
- }
+ static void Insert(T* o);
- static void Remove(T* o)
- {
- boost::unique_lock<boost::shared_mutex> lock(_lock);
+ static void Remove(T* o);
- _objectMap.erase(o->GetGUID());
- }
+ static T* Find(ObjectGuid guid);
- static T* Find(ObjectGuid guid)
- {
- boost::shared_lock<boost::shared_mutex> lock(_lock);
+ static MapType& GetContainer();
- typename MapType::iterator itr = _objectMap.find(guid);
- return (itr != _objectMap.end()) ? itr->second : NULL;
- }
-
- static MapType& GetContainer() { return _objectMap; }
-
- static boost::shared_mutex* GetLock() { return &_lock; }
-
- private:
- //Non instanceable only static
- HashMapHolder() { }
-
- static boost::shared_mutex _lock;
- static MapType _objectMap;
+ static boost::shared_mutex* GetLock();
};
namespace ObjectAccessor
{
// these functions return objects only if in map of specified object
- WorldObject* GetWorldObject(WorldObject const&, ObjectGuid const&);
- Object* GetObjectByTypeMask(WorldObject const&, ObjectGuid const&, uint32 typemask);
- Corpse* GetCorpse(WorldObject const& u, ObjectGuid const& guid);
- GameObject* GetGameObject(WorldObject const& u, ObjectGuid const& guid);
- Transport* GetTransport(WorldObject const& u, ObjectGuid const& guid);
- DynamicObject* GetDynamicObject(WorldObject const& u, ObjectGuid const& guid);
- Unit* GetUnit(WorldObject const&, ObjectGuid const& guid);
- Creature* GetCreature(WorldObject const& u, ObjectGuid const& guid);
- Pet* GetPet(WorldObject const&, ObjectGuid const& guid);
- Player* GetPlayer(Map const*, ObjectGuid const& guid);
- Player* GetPlayer(WorldObject const&, ObjectGuid const& guid);
- Creature* GetCreatureOrPetOrVehicle(WorldObject const&, ObjectGuid const&);
+ TC_GAME_API WorldObject* GetWorldObject(WorldObject const&, ObjectGuid const&);
+ TC_GAME_API Object* GetObjectByTypeMask(WorldObject const&, ObjectGuid const&, uint32 typemask);
+ TC_GAME_API Corpse* GetCorpse(WorldObject const& u, ObjectGuid const& guid);
+ TC_GAME_API GameObject* GetGameObject(WorldObject const& u, ObjectGuid const& guid);
+ TC_GAME_API Transport* GetTransport(WorldObject const& u, ObjectGuid const& guid);
+ TC_GAME_API DynamicObject* GetDynamicObject(WorldObject const& u, ObjectGuid const& guid);
+ TC_GAME_API Unit* GetUnit(WorldObject const&, ObjectGuid const& guid);
+ TC_GAME_API Creature* GetCreature(WorldObject const& u, ObjectGuid const& guid);
+ TC_GAME_API Pet* GetPet(WorldObject const&, ObjectGuid const& guid);
+ TC_GAME_API Player* GetPlayer(Map const*, ObjectGuid const& guid);
+ TC_GAME_API Player* GetPlayer(WorldObject const&, ObjectGuid const& guid);
+ TC_GAME_API Creature* GetCreatureOrPetOrVehicle(WorldObject const&, ObjectGuid const&);
// these functions return objects if found in whole world
// ACCESS LIKE THAT IS NOT THREAD SAFE
- Player* FindPlayer(ObjectGuid const&);
- Player* FindPlayerByName(std::string const& name);
+ TC_GAME_API Player* FindPlayer(ObjectGuid const&);
+ TC_GAME_API Player* FindPlayerByName(std::string const& name);
// this returns Player even if he is not in world, for example teleporting
- Player* FindConnectedPlayer(ObjectGuid const&);
- Player* FindConnectedPlayerByName(std::string const& name);
+ TC_GAME_API Player* FindConnectedPlayer(ObjectGuid const&);
+ TC_GAME_API Player* FindConnectedPlayerByName(std::string const& name);
// when using this, you must use the hashmapholder's lock
- HashMapHolder<Player>::MapType const& GetPlayers();
+ TC_GAME_API HashMapHolder<Player>::MapType const& GetPlayers();
template<class T>
void AddObject(T* object)
@@ -125,7 +105,8 @@ namespace ObjectAccessor
HashMapHolder<T>::Remove(object);
}
- void SaveAllPlayers();
+ TC_GAME_API void SaveAllPlayers();
};
#endif
+
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index f45634e9684..bbd0cee2a51 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -235,6 +235,12 @@ ObjectMgr::ObjectMgr():
}
}
+ObjectMgr* ObjectMgr::instance()
+{
+ static ObjectMgr instance;
+ return &instance;
+}
+
ObjectMgr::~ObjectMgr()
{
for (QuestMap::iterator i = _questTemplates.begin(); i != _questTemplates.end(); ++i)
@@ -467,7 +473,7 @@ void ObjectMgr::LoadCreatureTemplate(Field* fields)
creatureTemplate.unit_flags = fields[29].GetUInt32();
creatureTemplate.unit_flags2 = fields[30].GetUInt32();
creatureTemplate.dynamicflags = fields[31].GetUInt32();
- creatureTemplate.family = fields[32].GetUInt8();
+ creatureTemplate.family = CreatureFamily(fields[32].GetUInt8());
creatureTemplate.trainer_type = fields[33].GetUInt8();
creatureTemplate.trainer_spell = fields[34].GetUInt32();
creatureTemplate.trainer_class = fields[35].GetUInt8();
@@ -481,7 +487,7 @@ void ObjectMgr::LoadCreatureTemplate(Field* fields)
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
creatureTemplate.resistance[i] = fields[42 + i - 1].GetInt16();
- for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
creatureTemplate.spells[i] = fields[48 + i].GetUInt32();
creatureTemplate.PetSpellDataId = fields[56].GetUInt32();
@@ -827,7 +833,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (!displayScaleEntry)
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->Entry);
- for (int k = 0; k < MAX_KILL_CREDIT; ++k)
+ for (uint8 k = 0; k < MAX_KILL_CREDIT; ++k)
{
if (cInfo->KillCredit[k])
{
@@ -882,7 +888,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (cInfo->family && !sCreatureFamilyStore.LookupEntry(cInfo->family) && cInfo->family != CREATURE_FAMILY_HORSE_CUSTOM)
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has invalid creature family (%u) in `family`.", cInfo->Entry, cInfo->family);
- const_cast<CreatureTemplate*>(cInfo)->family = 0;
+ const_cast<CreatureTemplate*>(cInfo)->family = CREATURE_FAMILY_NONE;
}
if (cInfo->InhabitType <= 0 || cInfo->InhabitType > INHABIT_ANYWHERE)
@@ -914,7 +920,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has non-existing PetSpellDataId (%u).", cInfo->Entry, cInfo->PetSpellDataId);
}
- for (uint8 j = 0; j < CREATURE_MAX_SPELLS; ++j)
+ for (uint8 j = 0; j < MAX_CREATURE_SPELLS; ++j)
{
if (cInfo->spells[j] && !sSpellMgr->GetSpellInfo(cInfo->spells[j]))
{
@@ -1044,8 +1050,8 @@ void ObjectMgr::LoadGameObjectAddons()
{
uint32 oldMSTime = getMSTime();
- // 0 1 2
- QueryResult result = WorldDatabase.Query("SELECT guid, invisibilityType, invisibilityValue FROM gameobject_addon");
+ // 0 1 2 3 4 5 6
+ QueryResult result = WorldDatabase.Query("SELECT guid, parent_rotation0, parent_rotation1, parent_rotation2, parent_rotation3, invisibilityType, invisibilityValue FROM gameobject_addon");
if (!result)
{
@@ -1060,7 +1066,7 @@ void ObjectMgr::LoadGameObjectAddons()
ObjectGuid::LowType guid = fields[0].GetUInt32();
- const GameObjectData* goData = GetGOData(guid);
+ GameObjectData const* goData = GetGOData(guid);
if (!goData)
{
TC_LOG_ERROR("sql.sql", "GameObject (GUID: %u) does not exist but has a record in `gameobject_addon`", guid);
@@ -1068,12 +1074,13 @@ void ObjectMgr::LoadGameObjectAddons()
}
GameObjectAddon& gameObjectAddon = _gameObjectAddonStore[guid];
- gameObjectAddon.invisibilityType = InvisibilityType(fields[1].GetUInt8());
- gameObjectAddon.InvisibilityValue = fields[2].GetUInt32();
+ gameObjectAddon.ParentRotation = G3D::Quat(fields[1].GetFloat(), fields[2].GetFloat(), fields[3].GetFloat(), fields[4].GetFloat());
+ gameObjectAddon.invisibilityType = InvisibilityType(fields[5].GetUInt8());
+ gameObjectAddon.InvisibilityValue = fields[6].GetUInt32();
if (gameObjectAddon.invisibilityType >= TOTAL_INVISIBILITY_TYPES)
{
- TC_LOG_ERROR("sql.sql", "GameObject (GUID: %u) has invalid InvisibilityType in `gameobject_addon`", guid);
+ TC_LOG_ERROR("sql.sql", "GameObject (GUID: %u) has invalid InvisibilityType in `gameobject_addon`, disabled invisibility", guid);
gameObjectAddon.invisibilityType = INVISIBILITY_GENERAL;
gameObjectAddon.InvisibilityValue = 0;
}
@@ -1084,6 +1091,12 @@ void ObjectMgr::LoadGameObjectAddons()
gameObjectAddon.InvisibilityValue = 1;
}
+ if (!gameObjectAddon.ParentRotation.isUnit())
+ {
+ TC_LOG_ERROR("sql.sql", "GameObject (GUID: %u) has invalid path rotation, set to default", guid);
+ gameObjectAddon.ParentRotation = G3D::Quat();
+ }
+
++count;
}
while (result->NextRow());
@@ -1877,10 +1890,10 @@ ObjectGuid::LowType ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, fl
data.posY = y;
data.posZ = z;
data.orientation = o;
- data.rotation0 = rotation0;
- data.rotation1 = rotation1;
- data.rotation2 = rotation2;
- data.rotation3 = rotation3;
+ data.rotation.x = rotation0;
+ data.rotation.y = rotation1;
+ data.rotation.z = rotation2;
+ data.rotation.w = rotation3;
data.spawntimesecs = spawntimedelay;
data.animprogress = 100;
data.spawnMask = 1;
@@ -2030,10 +2043,10 @@ void ObjectMgr::LoadGameobjects()
data.posY = fields[4].GetFloat();
data.posZ = fields[5].GetFloat();
data.orientation = fields[6].GetFloat();
- data.rotation0 = fields[7].GetFloat();
- data.rotation1 = fields[8].GetFloat();
- data.rotation2 = fields[9].GetFloat();
- data.rotation3 = fields[10].GetFloat();
+ data.rotation.x = fields[7].GetFloat();
+ data.rotation.y = fields[8].GetFloat();
+ data.rotation.z = fields[9].GetFloat();
+ data.rotation.w = fields[10].GetFloat();
data.spawntimesecs = fields[11].GetInt32();
MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid);
@@ -2074,15 +2087,27 @@ void ObjectMgr::LoadGameobjects()
data.orientation = Position::NormalizeOrientation(data.orientation);
}
- if (data.rotation2 < -1.0f || data.rotation2 > 1.0f)
+ if (data.rotation.x < -1.0f || data.rotation.x > 1.0f)
+ {
+ TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotationX (%f) value, skip", guid, data.id, data.rotation.x);
+ continue;
+ }
+
+ if (data.rotation.y < -1.0f || data.rotation.y > 1.0f)
+ {
+ TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotationY (%f) value, skip", guid, data.id, data.rotation.y);
+ continue;
+ }
+
+ if (data.rotation.z < -1.0f || data.rotation.z > 1.0f)
{
- TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.id, data.rotation2);
+ TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotationZ (%f) value, skip", guid, data.id, data.rotation.z);
continue;
}
- if (data.rotation3 < -1.0f || data.rotation3 > 1.0f)
+ if (data.rotation.w < -1.0f || data.rotation.w > 1.0f)
{
- TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip", guid, data.id, data.rotation3);
+ TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotationW (%f) value, skip", guid, data.id, data.rotation.w);
continue;
}
@@ -2172,26 +2197,12 @@ ObjectGuid ObjectMgr::GetPlayerGUIDByName(std::string const& name) const
bool ObjectMgr::GetPlayerNameByGUID(ObjectGuid guid, std::string& name) const
{
- // prevent DB access for online player
- if (Player* player = ObjectAccessor::FindConnectedPlayer(guid))
- {
- name = player->GetName();
- return true;
- }
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME);
-
- stmt->setUInt32(0, guid.GetCounter());
-
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
-
- if (result)
- {
- name = (*result)[0].GetString();
- return true;
- }
+ CharacterInfo const* characterInfo = sWorld->GetCharacterInfo(guid);
+ if (!characterInfo)
+ return false;
- return false;
+ name = characterInfo->Name;
+ return true;
}
uint32 ObjectMgr::GetPlayerTeamByGUID(ObjectGuid guid) const
@@ -3523,6 +3534,61 @@ void ObjectMgr::LoadPlayerInfo()
}
}
+ // Load playercreate cast spell
+ TC_LOG_INFO("server.loading", "Loading Player Create Cast Spell Data...");
+ {
+ uint32 oldMSTime = getMSTime();
+
+ QueryResult result = WorldDatabase.PQuery("SELECT raceMask, classMask, spell FROM playercreateinfo_cast_spell");
+
+ if (!result)
+ TC_LOG_ERROR("server.loading", ">> Loaded 0 player create cast spells. DB table `playercreateinfo_cast_spell` is empty.");
+ else
+ {
+ uint32 count = 0;
+
+ do
+ {
+ Field* fields = result->Fetch();
+ uint32 raceMask = fields[0].GetUInt32();
+ uint32 classMask = fields[1].GetUInt32();
+ uint32 spellId = fields[2].GetUInt32();
+
+ if (raceMask != 0 && !(raceMask & RACEMASK_ALL_PLAYABLE))
+ {
+ TC_LOG_ERROR("sql.sql", "Wrong race mask %u in `playercreateinfo_cast_spell` table, ignoring.", raceMask);
+ continue;
+ }
+
+ if (classMask != 0 && !(classMask & CLASSMASK_ALL_PLAYABLE))
+ {
+ TC_LOG_ERROR("sql.sql", "Wrong class mask %u in `playercreateinfo_cast_spell` table, ignoring.", classMask);
+ continue;
+ }
+
+ for (uint32 raceIndex = RACE_HUMAN; raceIndex < MAX_RACES; ++raceIndex)
+ {
+ if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
+ {
+ for (uint32 classIndex = CLASS_WARRIOR; classIndex < MAX_CLASSES; ++classIndex)
+ {
+ if (classMask == 0 || ((1 << (classIndex - 1)) & classMask))
+ {
+ if (PlayerInfo* info = _playerInfo[raceIndex][classIndex])
+ {
+ info->castSpells.push_back(spellId);
+ ++count;
+ }
+ }
+ }
+ }
+ }
+ } while (result->NextRow());
+
+ TC_LOG_INFO("server.loading", ">> Loaded %u player create cast spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ }
+ }
+
// Load playercreate actions
TC_LOG_INFO("server.loading", "Loading Player Create Action Data...");
{
@@ -4050,8 +4116,8 @@ void ObjectMgr::LoadQuests()
// Load `quest_template_addon`
// 0 1 2 3 4 5 6 7 8
result = WorldDatabase.Query("SELECT ID, MaxLevel, AllowableClasses, SourceSpellID, PrevQuestID, NextQuestID, ExclusiveGroup, RewardMailTemplateID, RewardMailDelay, "
- //9 10 11 12 13 14 15 16
- "RequiredSkillID, RequiredSkillPoints, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, ProvidedItemCount, SpecialFlags FROM quest_template_addon");
+ //9 10 11 12 13 14 15 16 17
+ "RequiredSkillID, RequiredSkillPoints, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, ProvidedItemCount, RewardMailSenderEntry, SpecialFlags FROM quest_template_addon LEFT JOIN quest_mail_sender ON Id=QuestId");
if (!result)
{
@@ -4555,6 +4621,7 @@ void ObjectMgr::LoadQuests()
qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId);
qinfo->RewardMailTemplateId = 0; // no mail will send to player
qinfo->RewardMailDelay = 0; // no mail will send to player
+ qinfo->RewardMailSenderEntry = 0;
}
else if (usedMailTemplates.find(qinfo->RewardMailTemplateId) != usedMailTemplates.end())
{
@@ -4563,6 +4630,7 @@ void ObjectMgr::LoadQuests()
qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId, used_mt_itr->second);
qinfo->RewardMailTemplateId = 0; // no mail will send to player
qinfo->RewardMailDelay = 0; // no mail will send to player
+ qinfo->RewardMailSenderEntry = 0;
}
else
usedMailTemplates[qinfo->RewardMailTemplateId] = qinfo->GetQuestId();
@@ -4709,7 +4777,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
if (tableName.empty())
return;
- if (sScriptMgr->IsScriptScheduled()) // function cannot be called when scripts are in use.
+ if (sMapMgr->IsScriptScheduled()) // function cannot be called when scripts are in use.
return;
TC_LOG_INFO("server.loading", "Loading %s...", tableName.c_str());
@@ -5156,7 +5224,7 @@ void ObjectMgr::LoadSpellScriptNames()
while (spellInfo)
{
- _spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, GetScriptId(scriptName)));
+ _spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, std::make_pair(GetScriptId(scriptName), true)));
spellInfo = spellInfo->GetNextRankSpell();
}
}
@@ -5165,7 +5233,7 @@ void ObjectMgr::LoadSpellScriptNames()
if (spellInfo->IsRanked())
TC_LOG_ERROR("sql.sql", "Scriptname: `%s` spell (Id: %d) is ranked spell. Perhaps not all ranks are assigned to this script.", scriptName.c_str(), spellId);
- _spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, GetScriptId(scriptName)));
+ _spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, std::make_pair(GetScriptId(scriptName), true)));
}
++count;
@@ -5187,45 +5255,59 @@ void ObjectMgr::ValidateSpellScripts()
uint32 count = 0;
- for (SpellScriptsContainer::iterator itr = _spellScriptsStore.begin(); itr != _spellScriptsStore.end();)
+ for (auto spell : _spellScriptsStore)
{
- SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(itr->first);
- std::vector<std::pair<SpellScriptLoader *, SpellScriptsContainer::iterator> > SpellScriptLoaders;
- sScriptMgr->CreateSpellScriptLoaders(itr->first, SpellScriptLoaders);
- itr = _spellScriptsStore.upper_bound(itr->first);
+ SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spell.first);
+
+ auto const bounds = sObjectMgr->GetSpellScriptsBounds(spell.first);
- for (std::vector<std::pair<SpellScriptLoader *, SpellScriptsContainer::iterator> >::iterator sitr = SpellScriptLoaders.begin(); sitr != SpellScriptLoaders.end(); ++sitr)
+ for (auto itr = bounds.first; itr != bounds.second; ++itr)
{
- SpellScript* spellScript = sitr->first->GetSpellScript();
- AuraScript* auraScript = sitr->first->GetAuraScript();
- bool valid = true;
- if (!spellScript && !auraScript)
- {
- TC_LOG_ERROR("scripts", "Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(sitr->second->second).c_str());
- valid = false;
- }
- if (spellScript)
- {
- spellScript->_Init(&sitr->first->GetName(), spellEntry->Id);
- spellScript->_Register();
- if (!spellScript->_Validate(spellEntry))
- valid = false;
- delete spellScript;
- }
- if (auraScript)
+ if (SpellScriptLoader* spellScriptLoader = sScriptMgr->GetSpellScriptLoader(itr->second.first))
{
- auraScript->_Init(&sitr->first->GetName(), spellEntry->Id);
- auraScript->_Register();
- if (!auraScript->_Validate(spellEntry))
- valid = false;
- delete auraScript;
- }
- if (!valid)
- {
- _spellScriptsStore.erase(sitr->second);
+ ++count;
+
+ std::unique_ptr<SpellScript> spellScript(spellScriptLoader->GetSpellScript());
+ std::unique_ptr<AuraScript> auraScript(spellScriptLoader->GetAuraScript());
+
+ if (!spellScript && !auraScript)
+ {
+ TC_LOG_ERROR("scripts", "Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(itr->second.first).c_str());
+
+ itr->second.second = false;
+ continue;
+ }
+
+ if (spellScript)
+ {
+ spellScript->_Init(&spellScriptLoader->GetName(), spellEntry->Id);
+ spellScript->_Register();
+
+ if (!spellScript->_Validate(spellEntry))
+ {
+ itr->second.second = false;
+ continue;
+ }
+ }
+
+ if (auraScript)
+ {
+ auraScript->_Init(&spellScriptLoader->GetName(), spellEntry->Id);
+ auraScript->_Register();
+
+ if (!auraScript->_Validate(spellEntry))
+ {
+ itr->second.second = false;
+ continue;
+ }
+ }
+
+ // Enable the script when all checks passed
+ itr->second.second = true;
}
+ else
+ itr->second.second = false;
}
- ++count;
}
TC_LOG_INFO("server.loading", ">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -5926,14 +6008,14 @@ void ObjectMgr::LoadGraveyardZones()
{
uint32 oldMSTime = getMSTime();
- GraveYardStore.clear(); // need for reload case
+ GraveYardStore.clear(); // need for reload case
- // 0 1 2
- QueryResult result = WorldDatabase.Query("SELECT id, ghost_zone, faction FROM game_graveyard_zone");
+ // 0 1 2
+ QueryResult result = WorldDatabase.Query("SELECT ID, GhostZone, Faction FROM graveyard_zone");
if (!result)
{
- TC_LOG_INFO("server.loading", ">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty.");
+ TC_LOG_INFO("server.loading", ">> Loaded 0 graveyard-zone links. DB table `graveyard_zone` is empty.");
return;
}
@@ -5952,31 +6034,31 @@ void ObjectMgr::LoadGraveyardZones()
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(safeLocId);
if (!entry)
{
- TC_LOG_ERROR("sql.sql", "Table `game_graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", safeLocId);
+ TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` has a record for non-existing graveyard (WorldSafeLocsID: %u), skipped.", safeLocId);
continue;
}
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(zoneId);
if (!areaEntry)
{
- TC_LOG_ERROR("sql.sql", "Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.", zoneId);
+ TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` has a record for non-existing Zone (ID: %u), skipped.", zoneId);
continue;
}
if (areaEntry->zone != 0)
{
- TC_LOG_ERROR("sql.sql", "Table `game_graveyard_zone` has a record for subzone id (%u) instead of zone, skipped.", zoneId);
+ TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` has a record for SubZone (ID: %u) instead of zone, skipped.", zoneId);
continue;
}
if (team != 0 && team != HORDE && team != ALLIANCE)
{
- TC_LOG_ERROR("sql.sql", "Table `game_graveyard_zone` has a record for non player faction (%u), skipped.", team);
+ TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` has a record for non player faction (%u), skipped.", team);
continue;
}
if (!AddGraveYardLink(safeLocId, zoneId, team, false))
- TC_LOG_ERROR("sql.sql", "Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId);
+ TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId);
} while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -6025,7 +6107,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
if (range.first == range.second && !map->IsBattlegroundOrArena())
{
if (zoneId != 0) // zone == 0 can't be fixed, used by bliz for bugged zones
- TC_LOG_ERROR("sql.sql", "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
+ TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
return GetDefaultGraveYard(team);
}
@@ -6051,7 +6133,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(data.safeLocId);
if (!entry)
{
- TC_LOG_ERROR("sql.sql", "Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", data.safeLocId);
+ TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` has record for not existing graveyard (WorldSafeLocsID %u), skipped.", data.safeLocId);
continue;
}
@@ -6166,7 +6248,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
GraveYardMapBoundsNonConst range = GraveYardStore.equal_range(zoneId);
if (range.first == range.second)
{
- //TC_LOG_ERROR("sql.sql", "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
+ //TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
return;
}
@@ -6474,7 +6556,7 @@ uint32 ObjectMgr::GenerateAuctionID()
{
if (_auctionId >= 0xFFFFFFFE)
{
- TC_LOG_ERROR("misc", "Auctions ids overflow!! Can't continue, shutting down server. ");
+ TC_LOG_ERROR("misc", "Auctions ids overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
World::StopNow(ERROR_EXIT_CODE);
}
return _auctionId++;
@@ -6484,7 +6566,7 @@ uint64 ObjectMgr::GenerateEquipmentSetGuid()
{
if (_equipmentSetGuid >= uint64(0xFFFFFFFFFFFFFFFELL))
{
- TC_LOG_ERROR("misc", "EquipmentSet guid overflow!! Can't continue, shutting down server. ");
+ TC_LOG_ERROR("misc", "EquipmentSet guid overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
World::StopNow(ERROR_EXIT_CODE);
}
return _equipmentSetGuid++;
@@ -6494,7 +6576,7 @@ uint32 ObjectMgr::GenerateMailID()
{
if (_mailId >= 0xFFFFFFFE)
{
- TC_LOG_ERROR("misc", "Mail ids overflow!! Can't continue, shutting down server. ");
+ TC_LOG_ERROR("misc", "Mail ids overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
World::StopNow(ERROR_EXIT_CODE);
}
return _mailId++;
@@ -6502,14 +6584,19 @@ uint32 ObjectMgr::GenerateMailID()
uint32 ObjectMgr::GeneratePetNumber()
{
- return ++_hiPetNumber;
+ if (_hiPetNumber >= 0xFFFFFFFE)
+ {
+ TC_LOG_ERROR("misc", "_hiPetNumber Id overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info.");
+ World::StopNow(ERROR_EXIT_CODE);
+ }
+ return _hiPetNumber++;
}
uint32 ObjectMgr::GenerateCreatureSpawnId()
{
if (_creatureSpawnId >= uint32(0xFFFFFF))
{
- TC_LOG_ERROR("misc", "Creature spawn id overflow!! Can't continue, shutting down server. ");
+ TC_LOG_ERROR("misc", "Creature spawn id overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info.");
World::StopNow(ERROR_EXIT_CODE);
}
return _creatureSpawnId++;
@@ -6519,7 +6606,7 @@ uint32 ObjectMgr::GenerateGameObjectSpawnId()
{
if (_gameObjectSpawnId >= uint32(0xFFFFFF))
{
- TC_LOG_ERROR("misc", "Creature spawn id overflow!! Can't continue, shutting down server. ");
+ TC_LOG_ERROR("misc", "Creature spawn id overflow!! Can't continue, shutting down server. Search on forum for TCE00007 for more info. ");
World::StopNow(ERROR_EXIT_CODE);
}
return _gameObjectSpawnId++;
@@ -7614,7 +7701,7 @@ ResponseCodes ObjectMgr::CheckPlayerName(std::string const& name, LocaleConstant
if (wname[i] == wname[i-1] && wname[i] == wname[i-2])
return CHAR_NAME_THREE_CONSECUTIVE;
- return ValidateName(name, locale);
+ return ValidateName(wname, locale);
}
bool ObjectMgr::IsValidCharterName(const std::string& name)
@@ -7652,7 +7739,7 @@ PetNameInvalidReason ObjectMgr::CheckPetName(const std::string& name, LocaleCons
if (!isValidString(wname, strictMask, false))
return PET_NAME_MIXED_LANGUAGES;
- switch (ValidateName(name, locale))
+ switch (ValidateName(wname, locale))
{
case CHAR_NAME_PROFANE:
return PET_NAME_PROFANE;
@@ -7738,7 +7825,7 @@ bool ObjectMgr::LoadTrinityStrings()
QueryResult result = WorldDatabase.Query("SELECT entry, content_default, content_loc1, content_loc2, content_loc3, content_loc4, content_loc5, content_loc6, content_loc7, content_loc8 FROM trinity_string");
if (!result)
{
- TC_LOG_ERROR("server.loading", ">> Loaded 0 trinity strings. DB table `trinity_string` is empty.");
+ TC_LOG_ERROR("server.loading", ">> Loaded 0 trinity strings. DB table `trinity_string` is empty. You have imported an incorrect database for more info search for TCE00003 on forum.");
return false;
}
@@ -8560,6 +8647,8 @@ void ObjectMgr::LoadScriptNames()
{
uint32 oldMSTime = getMSTime();
+ // We insert an empty placeholder here so we can use the
+ // script id 0 as dummy for "no script found".
_scriptNamesStore.emplace_back("");
QueryResult result = WorldDatabase.Query(
@@ -8601,18 +8690,18 @@ void ObjectMgr::LoadScriptNames()
std::sort(_scriptNamesStore.begin(), _scriptNamesStore.end());
-#ifdef SCRIPTS
- for (size_t i = 1; i < _scriptNamesStore.size(); ++i)
- UnusedScriptNames.push_back(_scriptNamesStore[i]);
-#endif
-
TC_LOG_INFO("server.loading", ">> Loaded " SZFMTD " ScriptNames in %u ms", _scriptNamesStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
+ObjectMgr::ScriptNameContainer const& ObjectMgr::GetAllScriptNames() const
+{
+ return _scriptNamesStore;
+}
+
std::string const& ObjectMgr::GetScriptName(uint32 id) const
{
static std::string const empty = "";
- return id < _scriptNamesStore.size() ? _scriptNamesStore[id] : empty;
+ return (id < _scriptNamesStore.size()) ? _scriptNamesStore[id] : empty;
}
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index ae1258713f5..f06c9faf58b 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -28,7 +28,7 @@
#include "TemporarySummon.h"
#include "Corpse.h"
#include "QuestDef.h"
-#include "ItemPrototype.h"
+#include "ItemTemplate.h"
#include "NPCHandler.h"
#include "DatabaseEnv.h"
#include "Mail.h"
@@ -370,17 +370,17 @@ struct ScriptInfo
typedef std::multimap<uint32, ScriptInfo> ScriptMap;
typedef std::map<uint32, ScriptMap > ScriptMapMap;
-typedef std::multimap<uint32, uint32> SpellScriptsContainer;
+typedef std::multimap<uint32 /*spell id*/, std::pair<uint32 /*script id*/, bool /*enabled*/>> SpellScriptsContainer;
typedef std::pair<SpellScriptsContainer::iterator, SpellScriptsContainer::iterator> SpellScriptsBounds;
-extern ScriptMapMap sSpellScripts;
-extern ScriptMapMap sEventScripts;
-extern ScriptMapMap sWaypointScripts;
+TC_GAME_API extern ScriptMapMap sSpellScripts;
+TC_GAME_API extern ScriptMapMap sEventScripts;
+TC_GAME_API extern ScriptMapMap sWaypointScripts;
std::string GetScriptsTableNameByType(ScriptsType type);
ScriptMapMap* GetScriptsMapByType(ScriptsType type);
std::string GetScriptCommandName(ScriptCommands command);
-struct SpellClickInfo
+struct TC_GAME_API SpellClickInfo
{
uint32 spellId;
uint8 castFlags;
@@ -637,7 +637,7 @@ SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry);
#define MAX_PET_NAME 12 // max allowed by client name length
#define MAX_CHARTER_NAME 24 // max allowed by client name length
-bool normalizePlayerName(std::string& name);
+TC_GAME_API bool normalizePlayerName(std::string& name);
struct LanguageDesc
{
@@ -646,7 +646,7 @@ struct LanguageDesc
uint32 skill_id;
};
-extern LanguageDesc lang_description[LANGUAGES_COUNT];
+TC_GAME_API extern LanguageDesc lang_description[LANGUAGES_COUNT];
LanguageDesc const* GetLanguageDescByID(uint32 lang);
enum EncounterCreditType
@@ -671,7 +671,7 @@ typedef std::unordered_map<uint32, DungeonEncounterList> DungeonEncounterContain
class PlayerDumpReader;
-class ObjectMgr
+class TC_GAME_API ObjectMgr
{
friend class PlayerDumpReader;
@@ -680,11 +680,13 @@ class ObjectMgr
~ObjectMgr();
public:
- static ObjectMgr* instance()
- {
- static ObjectMgr instance;
- return &instance;
- }
+ ObjectMgr(ObjectMgr const&) = delete;
+ ObjectMgr(ObjectMgr&&) = delete;
+
+ ObjectMgr& operator= (ObjectMgr const&) = delete;
+ ObjectMgr& operator= (ObjectMgr&&) = delete;
+
+ static ObjectMgr* instance();
typedef std::unordered_map<uint32, Item*> ItemMap;
@@ -1270,6 +1272,7 @@ class ObjectMgr
bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* player = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const;
void LoadScriptNames();
+ ScriptNameContainer const& GetAllScriptNames() const;
std::string const& GetScriptName(uint32 id) const;
uint32 GetScriptId(std::string const& name);
diff --git a/src/server/game/Grids/GridReference.h b/src/server/game/Grids/GridReference.h
index b1f2e92a840..f5766382822 100644
--- a/src/server/game/Grids/GridReference.h
+++ b/src/server/game/Grids/GridReference.h
@@ -28,18 +28,18 @@ template<class OBJECT>
class GridReference : public Reference<GridRefManager<OBJECT>, OBJECT>
{
protected:
- void targetObjectBuildLink()
+ void targetObjectBuildLink() override
{
// called from link()
this->getTarget()->insertFirst(this);
this->getTarget()->incSize();
}
- void targetObjectDestroyLink()
+ void targetObjectDestroyLink() override
{
// called from unlink()
if (this->isValid()) this->getTarget()->decSize();
}
- void sourceObjectDestroyLink()
+ void sourceObjectDestroyLink() override
{
// called from invalidate()
this->getTarget()->decSize();
diff --git a/src/server/game/Grids/GridStates.h b/src/server/game/Grids/GridStates.h
index 9420bef4b9d..b567da43b69 100644
--- a/src/server/game/Grids/GridStates.h
+++ b/src/server/game/Grids/GridStates.h
@@ -24,32 +24,32 @@
class Map;
-class GridState
+class TC_GAME_API GridState
{
public:
virtual ~GridState() { };
virtual void Update(Map &, NGridType&, GridInfo &, uint32 t_diff) const = 0;
};
-class InvalidState : public GridState
+class TC_GAME_API InvalidState : public GridState
{
public:
void Update(Map &, NGridType &, GridInfo &, uint32 t_diff) const override;
};
-class ActiveState : public GridState
+class TC_GAME_API ActiveState : public GridState
{
public:
void Update(Map &, NGridType &, GridInfo &, uint32 t_diff) const override;
};
-class IdleState : public GridState
+class TC_GAME_API IdleState : public GridState
{
public:
void Update(Map &, NGridType &, GridInfo &, uint32 t_diff) const override;
};
-class RemovalState : public GridState
+class TC_GAME_API RemovalState : public GridState
{
public:
void Update(Map &, NGridType &, GridInfo &, uint32 t_diff) const override;
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
index 571d56b618e..2cdbdca4e4f 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
@@ -131,7 +131,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
if (!u->IsAlive() || !c->IsAlive() || c == u || u->IsInFlight())
return;
- if ((c->HasReactState(REACT_AGGRESSIVE) || c->IsTrigger()) && !c->HasUnitState(UNIT_STATE_SIGHTLESS))
+ if (!c->HasUnitState(UNIT_STATE_SIGHTLESS))
{
if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true))
c->AI()->MoveInLineOfSight_Safe(u);
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 6edeadf6b94..5283805c59d 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -38,7 +38,7 @@ class Player;
namespace Trinity
{
- struct VisibleNotifier
+ struct TC_GAME_API VisibleNotifier
{
Player &i_player;
UpdateData i_data;
@@ -61,7 +61,7 @@ namespace Trinity
void Visit(DynamicObjectMapType &);
};
- struct PlayerRelocationNotifier : public VisibleNotifier
+ struct TC_GAME_API PlayerRelocationNotifier : public VisibleNotifier
{
PlayerRelocationNotifier(Player &player) : VisibleNotifier(player) { }
@@ -70,7 +70,7 @@ namespace Trinity
void Visit(PlayerMapType &);
};
- struct CreatureRelocationNotifier
+ struct TC_GAME_API CreatureRelocationNotifier
{
Creature &i_creature;
CreatureRelocationNotifier(Creature &c) : i_creature(c) { }
@@ -79,7 +79,7 @@ namespace Trinity
void Visit(PlayerMapType &);
};
- struct DelayedUnitRelocation
+ struct TC_GAME_API DelayedUnitRelocation
{
Map &i_map;
Cell &cell;
@@ -92,7 +92,7 @@ namespace Trinity
void Visit(PlayerMapType &);
};
- struct AIRelocationNotifier
+ struct TC_GAME_API AIRelocationNotifier
{
Unit &i_unit;
bool isCreature;
@@ -120,7 +120,7 @@ namespace Trinity
void Visit(CorpseMapType &m) { updateObjects<Corpse>(m); }
};
- struct MessageDistDeliverer
+ struct TC_GAME_API MessageDistDeliverer
{
WorldObject* i_source;
WorldPacket* i_message;
@@ -566,7 +566,7 @@ namespace Trinity
// WorldObject check classes
- class AnyDeadUnitObjectInRangeCheck
+ class TC_GAME_API AnyDeadUnitObjectInRangeCheck
{
public:
AnyDeadUnitObjectInRangeCheck(Unit* searchObj, float range) : i_searchObj(searchObj), i_range(range) { }
@@ -579,7 +579,7 @@ namespace Trinity
float i_range;
};
- class AnyDeadUnitSpellTargetInRangeCheck : public AnyDeadUnitObjectInRangeCheck
+ class TC_GAME_API AnyDeadUnitSpellTargetInRangeCheck : public AnyDeadUnitObjectInRangeCheck
{
public:
AnyDeadUnitSpellTargetInRangeCheck(Unit* searchObj, float range, SpellInfo const* spellInfo, SpellTargetCheckTypes check)
@@ -620,6 +620,9 @@ namespace Trinity
if (go->GetGOInfo()->spellFocus.focusId != i_focusId)
return false;
+ if (!go->isSpawned())
+ return false;
+
float dist = go->GetGOInfo()->spellFocus.dist / 2.f;
return go->IsWithinDistInMap(i_unit, dist);
@@ -1237,7 +1240,7 @@ namespace Trinity
AllGameObjectsWithEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
bool operator() (GameObject* go)
{
- if (go->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(go, m_fRange, false))
+ if ((!m_uiEntry || go->GetEntry() == m_uiEntry) && m_pObject->IsWithinDist(go, m_fRange, false))
return true;
return false;
@@ -1254,7 +1257,7 @@ namespace Trinity
AllCreaturesOfEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
bool operator() (Unit* unit)
{
- if (unit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(unit, m_fRange, false))
+ if ((!m_uiEntry || unit->GetEntry() == m_uiEntry) && m_pObject->IsWithinDist(unit, m_fRange, false))
return true;
return false;
diff --git a/src/server/game/Grids/ObjectGridLoader.h b/src/server/game/Grids/ObjectGridLoader.h
index 9dc4c7e048b..f2893da609e 100644
--- a/src/server/game/Grids/ObjectGridLoader.h
+++ b/src/server/game/Grids/ObjectGridLoader.h
@@ -27,7 +27,7 @@
class ObjectWorldLoader;
-class ObjectGridLoader
+class TC_GAME_API ObjectGridLoader
{
friend class ObjectWorldLoader;
@@ -55,7 +55,7 @@ class ObjectGridLoader
};
//Stop the creatures before unloading the NGrid
-class ObjectGridStoper
+class TC_GAME_API ObjectGridStoper
{
public:
void Visit(CreatureMapType &m);
@@ -63,7 +63,7 @@ class ObjectGridStoper
};
//Move the foreign creatures back to respawn positions before unloading the NGrid
-class ObjectGridEvacuator
+class TC_GAME_API ObjectGridEvacuator
{
public:
void Visit(CreatureMapType &m);
diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h
index 42fd9b582e8..18b8119246f 100644
--- a/src/server/game/Groups/Group.h
+++ b/src/server/game/Groups/Group.h
@@ -158,7 +158,7 @@ struct InstanceGroupBind
/** request member stats checken **/
/// @todo uninvite people that not accepted invite
-class Group
+class TC_GAME_API Group
{
public:
struct MemberSlot
diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp
index 0fd2e7c7095..a5aa432aadc 100644
--- a/src/server/game/Groups/GroupMgr.cpp
+++ b/src/server/game/Groups/GroupMgr.cpp
@@ -92,6 +92,12 @@ ObjectGuid::LowType GroupMgr::GenerateGroupId()
return NextGroupId++;
}
+GroupMgr* GroupMgr::instance()
+{
+ static GroupMgr instance;
+ return &instance;
+}
+
Group* GroupMgr::GetGroupByGUID(ObjectGuid::LowType groupId) const
{
GroupContainer::const_iterator itr = GroupStore.find(groupId);
diff --git a/src/server/game/Groups/GroupMgr.h b/src/server/game/Groups/GroupMgr.h
index 9afdddd0f18..14ff3519aa6 100644
--- a/src/server/game/Groups/GroupMgr.h
+++ b/src/server/game/Groups/GroupMgr.h
@@ -20,18 +20,14 @@
#include "Group.h"
-class GroupMgr
+class TC_GAME_API GroupMgr
{
private:
GroupMgr();
~GroupMgr();
public:
- static GroupMgr* instance()
- {
- static GroupMgr instance;
- return &instance;
- }
+ static GroupMgr* instance();
typedef std::map<ObjectGuid::LowType, Group*> GroupContainer;
typedef std::vector<Group*> GroupDbContainer;
diff --git a/src/server/game/Groups/GroupReference.h b/src/server/game/Groups/GroupReference.h
index 4718dda1832..6e7373de7d7 100644
--- a/src/server/game/Groups/GroupReference.h
+++ b/src/server/game/Groups/GroupReference.h
@@ -24,7 +24,7 @@
class Group;
class Player;
-class GroupReference : public Reference<Group, Player>
+class TC_GAME_API GroupReference : public Reference<Group, Player>
{
protected:
uint8 iSubGroup;
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index 87494e78a28..121afc014ce 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -1443,17 +1443,17 @@ void Guild::HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string
_BroadcastEvent(GE_BANK_TAB_UPDATED, ObjectGuid::Empty, aux, name.c_str(), icon.c_str());
}
-void Guild::HandleSetMemberNote(WorldSession* session, std::string const& name, std::string const& note, bool isPublic)
+void Guild::HandleSetMemberNote(WorldSession* session, std::string const& name, std::string const& note, bool officer)
{
// Player must have rights to set public/officer note
- if (!_HasRankRight(session->GetPlayer(), isPublic ? GR_RIGHT_EPNOTE : GR_RIGHT_EOFFNOTE))
+ if (!_HasRankRight(session->GetPlayer(), officer ? GR_RIGHT_EOFFNOTE : GR_RIGHT_EPNOTE))
SendCommandResult(session, GUILD_COMMAND_PUBLIC_NOTE, ERR_GUILD_PERMISSIONS);
else if (Member* member = GetMember(name))
{
- if (isPublic)
- member->SetPublicNote(note);
- else
+ if (officer)
member->SetOfficerNote(note);
+ else
+ member->SetPublicNote(note);
HandleRoster(session);
}
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index 2bc57a70671..e25a3201957 100644
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -223,7 +223,7 @@ enum GuildMemberFlags
};
// Emblem info
-class EmblemInfo
+class TC_GAME_API EmblemInfo
{
public:
EmblemInfo() : m_style(0), m_color(0), m_borderStyle(0), m_borderColor(0), m_backgroundColor(0) { }
@@ -279,7 +279,7 @@ typedef std::vector <GuildBankRightsAndSlots> GuildBankRightsAndSlotsVec;
typedef std::set <uint8> SlotIds;
-class Guild
+class TC_GAME_API Guild
{
private:
// Class representing guild member
diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp
index 2d4fb849fb5..a4d245cbc9b 100644
--- a/src/server/game/Guilds/GuildMgr.cpp
+++ b/src/server/game/Guilds/GuildMgr.cpp
@@ -79,6 +79,12 @@ std::string GuildMgr::GetGuildNameById(ObjectGuid::LowType guildId) const
return "";
}
+GuildMgr* GuildMgr::instance()
+{
+ static GuildMgr instance;
+ return &instance;
+}
+
Guild* GuildMgr::GetGuildByLeader(ObjectGuid guid) const
{
for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr)
diff --git a/src/server/game/Guilds/GuildMgr.h b/src/server/game/Guilds/GuildMgr.h
index a97a59cafe0..ad2555c2e71 100644
--- a/src/server/game/Guilds/GuildMgr.h
+++ b/src/server/game/Guilds/GuildMgr.h
@@ -20,18 +20,14 @@
#include "Guild.h"
-class GuildMgr
+class TC_GAME_API GuildMgr
{
private:
GuildMgr();
~GuildMgr();
public:
- static GuildMgr* instance()
- {
- static GuildMgr instance;
- return &instance;
- }
+ static GuildMgr* instance();
Guild* GetGuildByLeader(ObjectGuid guid) const;
Guild* GetGuildById(ObjectGuid::LowType guildId) const;
diff --git a/src/server/game/Handlers/AddonHandler.cpp b/src/server/game/Handlers/AddonHandler.cpp
index ad44e0993e4..c72fc08982c 100644
--- a/src/server/game/Handlers/AddonHandler.cpp
+++ b/src/server/game/Handlers/AddonHandler.cpp
@@ -21,6 +21,12 @@
#include "Opcodes.h"
#include "Log.h"
+AddonHandler* AddonHandler::instance()
+{
+ static AddonHandler instance;
+ return &instance;
+}
+
bool AddonHandler::BuildAddonPacket(WorldPacket* source, WorldPacket* target)
{
ByteBuffer AddOnPacked;
diff --git a/src/server/game/Handlers/AddonHandler.h b/src/server/game/Handlers/AddonHandler.h
index 1e8081e0913..0113695895a 100644
--- a/src/server/game/Handlers/AddonHandler.h
+++ b/src/server/game/Handlers/AddonHandler.h
@@ -26,11 +26,7 @@
class AddonHandler
{
public:
- static AddonHandler* instance()
- {
- static AddonHandler instance;
- return &instance;
- }
+ static AddonHandler* instance();
bool BuildAddonPacket(WorldPacket* Source, WorldPacket* Target);
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp
index e91da35c06b..55bfb93c1c4 100644
--- a/src/server/game/Handlers/BattleGroundHandler.cpp
+++ b/src/server/game/Handlers/BattleGroundHandler.cpp
@@ -777,7 +777,7 @@ void WorldSession::HandleReportPvPAFK(WorldPacket& recvData)
if (!reportedPlayer)
{
- TC_LOG_DEBUG("bg.battleground", "WorldSession::HandleReportPvPAFK: player not found");
+ TC_LOG_INFO("bg.reportpvpafk", "WorldSession::HandleReportPvPAFK: %s [IP: %s] reported %s [IP: %s]", _player->GetName().c_str(), _player->GetSession()->GetRemoteAddress().c_str(), reportedPlayer->GetName().c_str(), reportedPlayer->GetSession()->GetRemoteAddress().c_str());
return;
}
diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp
index 540eeba0752..1a654335714 100644
--- a/src/server/game/Handlers/CalendarHandler.cpp
+++ b/src/server/game/Handlers/CalendarHandler.cpp
@@ -700,7 +700,7 @@ void WorldSession::HandleSetSavedInstanceExtend(WorldPacket& recvData)
InstancePlayerBind* instanceBind = player->GetBoundInstance(mapId, Difficulty(difficulty), toggleExtend == 1); // include expired instances if we are toggling extend on
if (!instanceBind || !instanceBind->save || !instanceBind->perm)
return;
-
+
BindExtensionState newState;
if (!toggleExtend || instanceBind->extendState == EXTEND_STATE_EXPIRED)
newState = EXTEND_STATE_NORMAL;
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index e0d790312d2..812a828ddce 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -45,6 +45,7 @@
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
+#include "Metric.h"
class LoginQueryHolder : public SQLQueryHolder
@@ -228,11 +229,11 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
if (Player::BuildEnumData(result, &data))
{
// Do not allow banned characters to log in
- if (!(*result)[20].GetUInt32())
+ if (!(*result)[23].GetUInt32())
_legitCharacters.insert(guid);
if (!sWorld->HasCharacterInfo(guid)) // This can happen if characters are inserted into the database manually. Core hasn't loaded name data yet.
- sWorld->AddCharacterInfo(guid, GetAccountId(), (*result)[1].GetString(), (*result)[4].GetUInt8(), (*result)[2].GetUInt8(), (*result)[3].GetUInt8(), (*result)[7].GetUInt8());
+ sWorld->AddCharacterInfo(guid, GetAccountId(), (*result)[1].GetString(), (*result)[4].GetUInt8(), (*result)[2].GetUInt8(), (*result)[3].GetUInt8(), (*result)[10].GetUInt8());
++num;
}
}
@@ -627,13 +628,13 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM);
stmt->setUInt32(0, GetAccountId());
- stmt->setUInt32(1, realmID);
+ stmt->setUInt32(1, realm.Id.Realm);
trans->Append(stmt);
stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_REALM_CHARACTERS);
stmt->setUInt32(0, createInfo->CharCount);
stmt->setUInt32(1, GetAccountId());
- stmt->setUInt32(2, realmID);
+ stmt->setUInt32(2, realm.Id.Realm);
trans->Append(stmt);
LoginDatabase.CommitTransaction(trans);
@@ -642,7 +643,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), createInfo->Name.c_str(), newChar.GetGUID().GetCounter());
sScriptMgr->OnPlayerCreate(&newChar);
- sWorld->AddCharacterInfo(newChar.GetGUID(), GetAccountId(), newChar.GetName(), newChar.GetByteValue(PLAYER_BYTES_3, 0), newChar.getRace(), newChar.getClass(), newChar.getLevel());
+ sWorld->AddCharacterInfo(newChar.GetGUID(), GetAccountId(), newChar.GetName(), newChar.GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER), newChar.getRace(), newChar.getClass(), newChar.getLevel());
newChar.CleanupsBeforeDelete();
delete createInfo;
@@ -686,17 +687,17 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
return;
}
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_DATA_BY_GUID);
- stmt->setUInt32(0, guid.GetCounter());
-
- if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
+ CharacterInfo const* characterInfo = sWorld->GetCharacterInfo(guid);
+ if (!characterInfo)
{
- Field* fields = result->Fetch();
- accountId = fields[0].GetUInt32();
- name = fields[1].GetString();
- level = fields[2].GetUInt8();
+ sScriptMgr->OnPlayerFailedDelete(guid, initAccountId);
+ return;
}
+ accountId = characterInfo->AccountId;
+ name = characterInfo->Name;
+ level = characterInfo->Level;
+
// prevent deleting other players' characters using cheating tools
if (accountId != initAccountId)
{
@@ -969,8 +970,14 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
bool firstLogin = pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST);
if (firstLogin)
+ {
pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST);
+ PlayerInfo const* info = sObjectMgr->GetPlayerInfo(pCurrChar->getRace(), pCurrChar->getClass());
+ for (uint32 spellId : info->castSpells)
+ pCurrChar->CastSpell(pCurrChar, spellId, true);
+ }
+
// show time before shutdown if shutdown planned.
if (sWorld->IsShuttingDown())
sWorld->ShutdownMsg(true, pCurrChar);
@@ -995,6 +1002,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
sScriptMgr->OnPlayerLogin(pCurrChar, firstLogin);
+ TC_METRIC_EVENT("player_events", "Login", pCurrChar->GetName());
+
delete holder;
}
@@ -1242,20 +1251,25 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair);
- if (!bs_hair || bs_hair->type != 0 || bs_hair->race != _player->getRace() || bs_hair->gender != _player->GetByteValue(PLAYER_BYTES_3, 0))
+ if (!bs_hair || bs_hair->type != 0 || bs_hair->race != _player->getRace() || bs_hair->gender != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER))
return;
BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(FacialHair);
- if (!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->getRace() || bs_facialHair->gender != _player->GetByteValue(PLAYER_BYTES_3, 0))
+ if (!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->getRace() || bs_facialHair->gender != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER))
return;
BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(SkinColor);
- if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->GetByteValue(PLAYER_BYTES_3, 0)))
+ if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)))
return;
- if (!Player::ValidateAppearance(_player->getRace(), _player->getClass(), _player->GetByteValue(PLAYER_BYTES_3, 0), bs_hair->hair_id, Color, _player->GetByteValue(PLAYER_BYTES, 1), bs_facialHair->hair_id, bs_skinColor ? bs_skinColor->hair_id : _player->GetByteValue(PLAYER_BYTES, 0)))
+ if (!Player::ValidateAppearance(_player->getRace(), _player->getClass(), _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER),
+ bs_hair->hair_id,
+ Color,
+ _player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID),
+ bs_facialHair->hair_id,
+ bs_skinColor ? bs_skinColor->hair_id : _player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID)))
return;
GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f);
@@ -1265,7 +1279,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
return;
}
- if (_player->getStandState() != UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight)
+ if (_player->GetStandState() != UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight)
{
SendBarberShopResult(BARBER_SHOP_RESULT_NOT_ON_CHAIR);
return;
@@ -1287,11 +1301,11 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
_player->ModifyMoney(-int32(cost)); // it isn't free
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, cost);
- _player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->hair_id));
- _player->SetByteValue(PLAYER_BYTES, 3, uint8(Color));
- _player->SetByteValue(PLAYER_BYTES_2, 0, uint8(bs_facialHair->hair_id));
+ _player->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID, uint8(bs_hair->hair_id));
+ _player->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID, uint8(Color));
+ _player->SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, uint8(bs_facialHair->hair_id));
if (bs_skinColor)
- _player->SetByteValue(PLAYER_BYTES, 0, uint8(bs_skinColor->hair_id));
+ _player->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID, uint8(bs_skinColor->hair_id));
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1);
@@ -1356,6 +1370,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
uint8 plrRace = fields[0].GetUInt8();
uint8 plrClass = fields[1].GetUInt8();
uint8 plrGender = fields[2].GetUInt8();
+ std::string oldName = fields[4].GetString();
if (!Player::ValidateAppearance(plrRace, plrClass, plrGender, customizeInfo.HairStyle, customizeInfo.HairColor, customizeInfo.Face, customizeInfo.FacialHair, customizeInfo.Skin, true))
{
@@ -1384,6 +1399,13 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
return;
}
+ // prevent character rename
+ if (sWorld->getBoolConfig(CONFIG_PREVENT_RENAME_CUSTOMIZATION) && (customizeInfo.Name != oldName))
+ {
+ SendCharCustomize(CHAR_NAME_FAILURE, customizeInfo);
+ return;
+ }
+
// prevent character rename to invalid name
if (!normalizePlayerName(customizeInfo.Name))
{
@@ -1415,17 +1437,6 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
}
}
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME);
- stmt->setUInt32(0, customizeInfo.Guid.GetCounter());
- result = CharacterDatabase.Query(stmt);
-
- if (result)
- {
- std::string oldname = result->Fetch()[0].GetString();
- TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s), Character[%s] (%s) Customized to: %s",
- GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), customizeInfo.Guid.ToString().c_str(), customizeInfo.Name.c_str());
- }
-
SQLTransaction trans = CharacterDatabase.BeginTransaction();
Player::Customize(&customizeInfo, trans);
@@ -1447,6 +1458,9 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
sWorld->UpdateCharacterInfo(customizeInfo.Guid, customizeInfo.Name, customizeInfo.Gender);
SendCharCustomize(RESPONSE_SUCCESS, customizeInfo);
+
+ TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s), Character[%s] (%s) Customized to: %s",
+ GetAccountId(), GetRemoteAddress().c_str(), oldName.c_str(), customizeInfo.Guid.ToString().c_str(), customizeInfo.Name.c_str());
}
void WorldSession::HandleEquipmentSetSave(WorldPacket& recvData)
@@ -1600,6 +1614,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
return;
}
+ std::string oldName = nameData->Name;
uint8 oldRace = nameData->Race;
uint8 playerClass = nameData->Class;
uint8 level = nameData->Level;
@@ -1642,6 +1657,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
}
}
+ // prevent character rename
+ if (sWorld->getBoolConfig(CONFIG_PREVENT_RENAME_CUSTOMIZATION) && (factionChangeInfo.Name != oldName))
+ {
+ SendCharFactionChange(CHAR_NAME_FAILURE, factionChangeInfo);
+ return;
+ }
+
// prevent character rename to invalid name
if (!normalizePlayerName(factionChangeInfo.Name))
{
diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp
index 346adf6f091..2d94d423142 100644
--- a/src/server/game/Handlers/ChatHandler.cpp
+++ b/src/server/game/Handlers/ChatHandler.cpp
@@ -239,8 +239,6 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
switch (type)
{
case CHAT_MSG_SAY:
- case CHAT_MSG_EMOTE:
- case CHAT_MSG_YELL:
{
// Prevent cheating
if (!sender->IsAlive())
@@ -252,13 +250,39 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
return;
}
- if (type == CHAT_MSG_SAY)
- sender->Say(msg, Language(lang));
- else if (type == CHAT_MSG_EMOTE)
- sender->TextEmote(msg);
- else if (type == CHAT_MSG_YELL)
- sender->Yell(msg, Language(lang));
- } break;
+ sender->Say(msg, Language(lang));
+ break;
+ }
+ case CHAT_MSG_EMOTE:
+ {
+ // Prevent cheating
+ if (!sender->IsAlive())
+ return;
+
+ if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_EMOTE_LEVEL_REQ))
+ {
+ SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_EMOTE_LEVEL_REQ));
+ return;
+ }
+
+ sender->TextEmote(msg);
+ break;
+ }
+ case CHAT_MSG_YELL:
+ {
+ // Prevent cheating
+ if (!sender->IsAlive())
+ return;
+
+ if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_YELL_LEVEL_REQ))
+ {
+ SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_YELL_LEVEL_REQ));
+ return;
+ }
+
+ sender->Yell(msg, Language(lang));
+ break;
+ }
case CHAT_MSG_WHISPER:
{
if (!normalizePlayerName(to))
@@ -298,7 +322,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
sender->AddWhisperWhiteList(receiver->GetGUID());
GetPlayer()->Whisper(msg, Language(lang), receiver);
- } break;
+ break;
+ }
case CHAT_MSG_PARTY:
case CHAT_MSG_PARTY_LEADER:
{
@@ -319,7 +344,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
WorldPacket data;
ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, NULL, msg);
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID()));
- } break;
+ break;
+ }
case CHAT_MSG_GUILD:
{
if (GetPlayer()->GetGuildId())
@@ -331,7 +357,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
guild->BroadcastToGuild(this, false, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
}
- } break;
+ break;
+ }
case CHAT_MSG_OFFICER:
{
if (GetPlayer()->GetGuildId())
@@ -343,7 +370,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
guild->BroadcastToGuild(this, true, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
}
- } break;
+ break;
+ }
case CHAT_MSG_RAID:
{
// if player is in battleground, he cannot say to battleground members by /ra
@@ -360,7 +388,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID, Language(lang), sender, NULL, msg);
group->BroadcastPacket(&data, false);
- } break;
+ break;
+ }
case CHAT_MSG_RAID_LEADER:
{
// if player is in battleground, he cannot say to battleground members by /ra
@@ -377,7 +406,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_LEADER, Language(lang), sender, NULL, msg);
group->BroadcastPacket(&data, false);
- } break;
+ break;
+ }
case CHAT_MSG_RAID_WARNING:
{
Group* group = GetPlayer()->GetGroup();
@@ -390,7 +420,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
//in battleground, raid warning is sent only to players in battleground - code is ok
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_WARNING, Language(lang), sender, NULL, msg);
group->BroadcastPacket(&data, false);
- } break;
+ break;
+ }
case CHAT_MSG_BATTLEGROUND:
{
//battleground raid is always in Player->GetGroup(), never in GetOriginalGroup()
@@ -403,7 +434,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND, Language(lang), sender, NULL, msg);
group->BroadcastPacket(&data, false);
- } break;
+ break;
+ }
case CHAT_MSG_BATTLEGROUND_LEADER:
{
// battleground raid is always in Player->GetGroup(), never in GetOriginalGroup()
@@ -416,7 +448,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND_LEADER, Language(lang), sender, NULL, msg);;
group->BroadcastPacket(&data, false);
- } break;
+ break;
+ }
case CHAT_MSG_CHANNEL:
{
if (!HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHAT_CHANNEL_REQ))
@@ -436,7 +469,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
chn->Say(sender->GetGUID(), msg.c_str(), lang);
}
}
- } break;
+ break;
+ }
case CHAT_MSG_AFK:
{
if (!sender->IsInCombat())
diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp
index 84cbb86345d..5ea81718a5d 100644
--- a/src/server/game/Handlers/GroupHandler.cpp
+++ b/src/server/game/Handlers/GroupHandler.cpp
@@ -82,6 +82,13 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
return;
}
+ // player trying to invite himself (most likely cheating)
+ if (player == GetPlayer())
+ {
+ SendPartyResult(PARTY_OP_INVITE, membername, ERR_BAD_PLAYER_NAME_S);
+ return;
+ }
+
// restrict invite to GMs
if (!sWorld->getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->IsGameMaster() && player->IsGameMaster())
{
@@ -113,6 +120,12 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
return;
}
+ if (!player->GetSocial()->HasFriend(GetPlayer()->GetGUID().GetCounter()) && GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_PARTY_LEVEL_REQ))
+ {
+ SendPartyResult(PARTY_OP_INVITE, membername, ERR_INVITE_RESTRICTED);
+ return;
+ }
+
Group* group = GetPlayer()->GetGroup();
if (group && group->isBGGroup())
group = GetPlayer()->GetOriginalGroup();
@@ -170,6 +183,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
}
if (!group->AddInvite(player))
{
+ group->RemoveAllInvites();
delete group;
return;
}
@@ -488,9 +502,7 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData)
void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData)
{
- TC_LOG_DEBUG("network", "WORLD: Received MSG_RANDOM_ROLL");
-
- uint32 minimum, maximum, roll;
+ uint32 minimum, maximum;
recvData >> minimum;
recvData >> maximum;
@@ -499,20 +511,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData)
return;
/********************/
- // everything's fine, do it
- roll = urand(minimum, maximum);
-
- //TC_LOG_DEBUG("ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll);
-
- WorldPacket data(MSG_RANDOM_ROLL, 4+4+4+8);
- data << uint32(minimum);
- data << uint32(maximum);
- data << uint32(roll);
- data << uint64(GetPlayer()->GetGUID());
- if (GetPlayer()->GetGroup())
- GetPlayer()->GetGroup()->BroadcastPacket(&data, false);
- else
- SendPacket(&data);
+ GetPlayer()->DoRandomRoll(minimum, maximum);
}
void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData)
diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp
index e8f8372d679..3801e974dba 100644
--- a/src/server/game/Handlers/GuildHandler.cpp
+++ b/src/server/game/Handlers/GuildHandler.cpp
@@ -178,7 +178,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
if (normalizePlayerName(playerName))
if (Guild* guild = GetPlayer()->GetGuild())
- guild->HandleSetMemberNote(this, playerName, note, true);
+ guild->HandleSetMemberNote(this, playerName, note, false);
}
void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
@@ -192,7 +192,7 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
if (normalizePlayerName(playerName))
if (Guild* guild = GetPlayer()->GetGuild())
- guild->HandleSetMemberNote(this, playerName, note, false);
+ guild->HandleSetMemberNote(this, playerName, note, true);
}
void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 7f5d882a912..42ce01708eb 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -1095,7 +1095,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
return;
}
- if (!(gift->GetTemplate()->Flags & ITEM_PROTO_FLAG_WRAPPER)) // cheating: non-wrapper wrapper
+ if (!(gift->GetTemplate()->Flags & ITEM_PROTO_FLAG_IS_WRAPPER)) // cheating: non-wrapper wrapper
{
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, gift, NULL);
return;
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp
index 82fdc2e54c7..b0b06b517c8 100644
--- a/src/server/game/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -338,7 +338,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
else
{
// Only delete item if no loot or money (unlooted loot is saved to db) or if it isn't an openable item
- if (pItem->loot.isLooted() || !(proto->Flags & ITEM_PROTO_FLAG_OPENABLE))
+ if (pItem->loot.isLooted() || !(proto->Flags & ITEM_PROTO_FLAG_HAS_LOOT))
player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
}
return; // item can be looted only single player
@@ -370,13 +370,10 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
loot->roundRobinPlayer.Clear();
if (Group* group = player->GetGroup())
- {
group->SendLooter(creature, NULL);
-
- // force update of dynamic flags, otherwise other group's players still not able to loot.
- creature->ForceValuesUpdateAtIndex(UNIT_DYNAMIC_FLAGS);
- }
}
+ // force dynflag update to update looter and lootable info
+ creature->ForceValuesUpdateAtIndex(UNIT_DYNAMIC_FLAGS);
}
}
diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp
index aaf6ca39d09..36df5b64f1b 100644
--- a/src/server/game/Handlers/MailHandler.cpp
+++ b/src/server/game/Handlers/MailHandler.cpp
@@ -35,7 +35,7 @@ bool WorldSession::CanOpenMailBox(ObjectGuid guid)
{
if (!HasPermission(rbac::RBAC_PERM_COMMAND_MAILBOX))
{
- TC_LOG_WARN("cheat", "%s attempt open mailbox in cheating way.", _player->GetName().c_str());
+ TC_LOG_WARN("cheat", "%s attempted to open mailbox by using a cheat.", _player->GetName().c_str());
return false;
}
}
@@ -108,7 +108,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
if (!receiverGuid)
{
- TC_LOG_INFO("network", "Player %u is sending mail to %s (GUID: not existed!) with subject %s "
+ TC_LOG_INFO("network", "Player %u is sending mail to %s (GUID: non-existing!) with subject %s "
"and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u",
player->GetGUID().GetCounter(), receiverName.c_str(), subject.c_str(), body.c_str(),
items_count, money, COD, stationery, package);
@@ -117,7 +117,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
}
TC_LOG_INFO("network", "Player %u is sending mail to %s (%s) with subject %s and body %s "
- "includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u",
+ "including %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u",
player->GetGUID().GetCounter(), receiverName.c_str(), receiverGuid.ToString().c_str(), subject.c_str(),
body.c_str(), items_count, money, COD, stationery, package);
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index 5f5a66e7b20..52b36d80202 100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -284,7 +284,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData)
continue;
uint32 pzoneid = target->GetZoneId();
- uint8 gender = target->GetByteValue(PLAYER_BYTES_3, 0);
+ uint8 gender = target->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER);
bool z_show = true;
for (uint32 i = 0; i < zones_count; ++i)
@@ -405,7 +405,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recvData*/)
// not set flags if player can't free move to prevent lost state at logout cancel
if (GetPlayer()->CanFreeMove())
{
- if (GetPlayer()->getStandState() == UNIT_STAND_STATE_STAND)
+ if (GetPlayer()->GetStandState() == UNIT_STAND_STATE_STAND)
GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);
WorldPacket data(SMSG_FORCE_MOVE_ROOT, (8+4)); // guess size
@@ -569,7 +569,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(PreparedQueryResult result, std
team = Player::TeamForRace(fields[1].GetUInt8());
friendAccountId = fields[2].GetUInt32();
- if (HasPermission(rbac::RBAC_PERM_ALLOW_GM_FRIEND) || AccountMgr::IsPlayerAccount(AccountMgr::GetSecurity(friendAccountId, realmID)))
+ if (HasPermission(rbac::RBAC_PERM_ALLOW_GM_FRIEND) || AccountMgr::IsPlayerAccount(AccountMgr::GetSecurity(friendAccountId, realm.Id.Realm)))
{
if (friendGuid)
{
@@ -773,17 +773,11 @@ void WorldSession::HandleResurrectResponseOpcode(WorldPacket& recvData)
if (status == 0)
{
- GetPlayer()->clearResurrectRequestData(); // reject
+ GetPlayer()->ClearResurrectRequestData(); // reject
return;
}
- if (GetPlayer()->IsValidGhoulResurrectRequest(guid))
- {
- GetPlayer()->GhoulResurrect();
- return;
- }
-
- if (!GetPlayer()->isResurrectRequestedBy(guid))
+ if (!GetPlayer()->IsResurrectRequestedBy(guid))
return;
GetPlayer()->ResurrectUsingRequestData();
@@ -890,15 +884,15 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
player->SendTransferAborted(entry->MapID, TRANSFER_ABORT_DIFFICULTY, player->GetDifficulty(entry->IsRaid()));
break;
case Map::CANNOT_ENTER_NOT_IN_RAID:
- if (MapEntry const* entry = sMapStore.LookupEntry(at->target_mapId))
- {
- char const* mapName = entry->name[player->GetSession()->GetSessionDbcLocale()];
- TC_LOG_DEBUG("maps", "MAP: Player '%s' must be in a raid group to enter instance '%s'", player->GetName().c_str(), mapName);
- // probably there must be special opcode, because client has this string constant in GlobalStrings.lua
- player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetTrinityString(LANG_INSTANCE_RAID_GROUP_ONLY), mapName);
- }
+ {
+ WorldPacket data(SMSG_RAID_GROUP_ONLY, 4 + 4);
+ data << uint32(0);
+ data << uint32(2); // You must be in a raid group to enter this instance.
+ player->GetSession()->SendPacket(&data);
+ TC_LOG_DEBUG("maps", "MAP: Player '%s' must be in a raid group to enter instance map %d", player->GetName().c_str(), at->target_mapId);
reviveAtTrigger = true;
break;
+ }
case Map::CANNOT_ENTER_CORPSE_IN_DIFFERENT_INSTANCE:
{
WorldPacket data(SMSG_CORPSE_NOT_IN_INSTANCE);
@@ -933,7 +927,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
default:
break;
}
-
+
if (reviveAtTrigger) // check if the player is touching the areatrigger leading to the map his corpse is on
if (!player->IsAlive() && player->HasCorpse())
if (player->GetCorpseLocation().GetMapId() == at->target_mapId)
@@ -1062,12 +1056,14 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recvData)
void WorldSession::HandleCompleteCinematic(WorldPacket& /*recvData*/)
{
- TC_LOG_DEBUG("network", "WORLD: Received CMSG_COMPLETE_CINEMATIC");
+ // If player has sight bound to visual waypoint NPC we should remove it
+ GetPlayer()->GetCinematicMgr()->EndCinematic();
}
void WorldSession::HandleNextCinematicCamera(WorldPacket& /*recvData*/)
{
- TC_LOG_DEBUG("network", "WORLD: Received CMSG_NEXT_CINEMATIC_CAMERA");
+ // Sent by client when cinematic actually begun. So we begin the server side process
+ GetPlayer()->GetCinematicMgr()->BeginCinematic();
}
void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket& recvData)
@@ -1163,7 +1159,7 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recvData)
return;
}
- GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, 2, actionBar);
+ GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BAR_TOGGLES, actionBar);
}
void WorldSession::HandlePlayedTime(WorldPacket& recvData)
@@ -1203,7 +1199,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recvData)
WorldPacket data(SMSG_INSPECT_TALENT, guid_size+4+talent_points);
data << player->GetPackGUID();
- if (sWorld->getBoolConfig(CONFIG_TALENTS_INSPECTING) || _player->IsGameMaster())
+ if (GetPlayer()->CanBeGameMaster() || sWorld->getIntConfig(CONFIG_TALENTS_INSPECTING) + (GetPlayer()->GetTeamId() == player->GetTeamId()) > 1)
player->BuildPlayerTalentsInfoData(&data);
else
{
diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp
index 02702fc5622..64f927a987f 100644
--- a/src/server/game/Handlers/MovementHandler.cpp
+++ b/src/server/game/Handlers/MovementHandler.cpp
@@ -473,7 +473,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData)
{
TC_LOG_ERROR("network", "%sSpeedChange player %s is NOT correct (must be %f instead %f), force set to correct value",
move_type_name[move_type], _player->GetName().c_str(), _player->GetSpeed(move_type), newspeed);
- _player->SetSpeed(move_type, _player->GetSpeedRate(move_type), true);
+ _player->SetSpeedRate(move_type, _player->GetSpeedRate(move_type));
}
else // must be lesser - cheating
{
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index 1e00c25a0c3..d02611971cc 100644
--- a/src/server/game/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -236,8 +236,8 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
recvData >> guid >> spellId;
TC_LOG_DEBUG("network", "WORLD: Received CMSG_TRAINER_BUY_SPELL %s, learn spell id is: %u", guid.ToString().c_str(), spellId);
- Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
- if (!unit)
+ Creature* trainer = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
+ if (!trainer)
{
TC_LOG_DEBUG("network", "WORLD: HandleTrainerBuySpellOpcode - %s not found or you can not interact with him.", guid.ToString().c_str());
return;
@@ -247,8 +247,20 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
+ // check race for mount trainers
+ if (trainer->GetCreatureTemplate()->trainer_type == TRAINER_TYPE_MOUNTS)
+ {
+ if (uint32 trainerRace = trainer->GetCreatureTemplate()->trainer_race)
+ if (_player->getRace() != trainerRace)
+ return;
+ }
+
+ // check class for class trainers
+ if (_player->getClass() != trainer->GetCreatureTemplate()->trainer_class && trainer->GetCreatureTemplate()->trainer_type == TRAINER_TYPE_CLASS)
+ return;
+
// check present spell in trainer spell list
- TrainerSpellData const* trainer_spells = unit->GetTrainerSpells();
+ TrainerSpellData const* trainer_spells = trainer->GetTrainerSpells();
if (!trainer_spells)
return;
@@ -262,7 +274,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
return;
// apply reputation discount
- uint32 nSpellCost = uint32(floor(trainer_spell->spellCost * _player->GetReputationPriceDiscount(unit)));
+ uint32 nSpellCost = uint32(floor(trainer_spell->spellCost * _player->GetReputationPriceDiscount(trainer)));
// check money requirement
if (!_player->HasEnoughMoney(nSpellCost))
@@ -270,8 +282,8 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
_player->ModifyMoney(-int32(nSpellCost));
- unit->SendPlaySpellVisual(179); // 53 SpellCastDirected
- unit->SendPlaySpellImpact(_player->GetGUID(), 362); // 113 EmoteSalute
+ trainer->SendPlaySpellVisual(179); // 53 SpellCastDirected
+ trainer->SendPlaySpellImpact(_player->GetGUID(), 362); // 113 EmoteSalute
// learn explicitly or cast explicitly
if (trainer_spell->IsCastable())
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index 8bfb0070605..17c9c4a58d7 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -595,7 +595,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
Pet* pet = ObjectAccessor::GetPet(*_player, petguid);
// check it!
- if (!pet || !pet->IsPet() || ((Pet*)pet)->getPetType()!= HUNTER_PET ||
+ if (!pet || !pet->IsPet() || ((Pet*)pet)->getPetType() != HUNTER_PET ||
!pet->HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ||
pet->GetOwnerGUID() != _player->GetGUID() || !pet->GetCharmInfo())
return;
diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp
index ebc9ebde994..1eee9e0d9fe 100644
--- a/src/server/game/Handlers/QueryHandler.cpp
+++ b/src/server/game/Handlers/QueryHandler.cpp
@@ -133,10 +133,10 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket& recvData)
CreatureQuestItemList const* items = sObjectMgr->GetCreatureQuestItemList(entry);
if (items)
- for (size_t i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i)
+ for (uint32 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i)
data << (i < items->size() ? uint32((*items)[i]) : uint32(0));
else
- for (size_t i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i)
+ for (uint32 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i)
data << uint32(0);
data << uint32(ci->movementId); // CreatureMovementInfo.dbc
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index a7db18deddb..b7aee1778a9 100644
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -426,6 +426,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
}
_player->TakeQuestSourceItem(questId, true); // remove quest src item from player
+ _player->AbandonQuest(questId); // remove all quest items player received before abandoning quest. Note, this does not remove normal drop items that happen to be quest requirements.
_player->RemoveActiveQuest(questId);
_player->RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId);
@@ -640,46 +641,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
{
TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY");
- uint32 count = 0;
-
- WorldPacket data(SMSG_QUESTGIVER_STATUS_MULTIPLE, 4);
- data << uint32(count); // placeholder
-
- for (auto itr = _player->m_clientGUIDs.begin(); itr != _player->m_clientGUIDs.end(); ++itr)
- {
- uint32 questStatus = DIALOG_STATUS_NONE;
-
- if (itr->IsAnyTypeCreature())
- {
- // need also pet quests case support
- Creature* questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*GetPlayer(), *itr);
- if (!questgiver || questgiver->IsHostileTo(_player))
- continue;
- if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
- continue;
-
- questStatus = _player->GetQuestDialogStatus(questgiver);
-
- data << uint64(questgiver->GetGUID());
- data << uint8(questStatus);
- ++count;
- }
- else if (itr->IsGameObject())
- {
- GameObject* questgiver = GetPlayer()->GetMap()->GetGameObject(*itr);
- if (!questgiver || questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
- continue;
-
- questStatus = _player->GetQuestDialogStatus(questgiver);
-
- data << uint64(questgiver->GetGUID());
- data << uint8(questStatus);
- ++count;
- }
- }
-
- data.put<uint32>(0, count); // write real count
- SendPacket(&data);
+ _player->SendQuestGiverStatusMultiple();
}
void WorldSession::HandleQueryQuestsCompleted(WorldPacket & /*recvData*/)
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index 6be1fd30ae3..93e986b0339 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -196,7 +196,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
}
// Verify that the bag is an actual bag or wrapped item that can be used "normally"
- if (!(proto->Flags & ITEM_PROTO_FLAG_OPENABLE) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
+ if (!(proto->Flags & ITEM_PROTO_FLAG_HAS_LOOT) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
{
pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
TC_LOG_ERROR("network", "Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!",
@@ -594,11 +594,11 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData)
if (creator->GetTypeId() == TYPEID_PLAYER)
{
Player* player = creator->ToPlayer();
- data << uint8(player->GetByteValue(PLAYER_BYTES, 0)); // skin
- data << uint8(player->GetByteValue(PLAYER_BYTES, 1)); // face
- data << uint8(player->GetByteValue(PLAYER_BYTES, 2)); // hair
- data << uint8(player->GetByteValue(PLAYER_BYTES, 3)); // haircolor
- data << uint8(player->GetByteValue(PLAYER_BYTES_2, 0)); // facialhair
+ data << uint8(player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID));
+ data << uint8(player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID));
+ data << uint8(player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID));
+ data << uint8(player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID));
+ data << uint8(player->GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE));
data << uint32(player->GetGuildId()); // unk
static EquipmentSlots const itemSlots[] =
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp
index 3538262ed35..2fbf50cb020 100644
--- a/src/server/game/Instances/InstanceSaveMgr.cpp
+++ b/src/server/game/Instances/InstanceSaveMgr.cpp
@@ -38,6 +38,12 @@ InstanceSaveManager::~InstanceSaveManager()
{
}
+InstanceSaveManager* InstanceSaveManager::instance()
+{
+ static InstanceSaveManager instance;
+ return &instance;
+}
+
void InstanceSaveManager::Unload()
{
lock_instLists = true;
@@ -447,7 +453,7 @@ time_t InstanceSaveManager::GetSubsequentResetTime(uint32 mapid, Difficulty diff
TC_LOG_ERROR("misc", "InstanceSaveManager::GetSubsequentResetTime: not valid difficulty or no reset delay for map %u", mapid);
return 0;
}
-
+
time_t diff = sWorld->getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR;
time_t period = uint32(((mapDiff->resetTime * sWorld->getRate(RATE_INSTANCE_RESET_TIME)) / DAY) * DAY);
if (period < DAY)
diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h
index d2b3237b3cf..18e22602e07 100644
--- a/src/server/game/Instances/InstanceSaveMgr.h
+++ b/src/server/game/Instances/InstanceSaveMgr.h
@@ -41,7 +41,7 @@ class Group;
- player-instance binds for permanent heroic/raid saves
- group-instance binds (both solo and permanent) cache the player binds for the group leader
*/
-class InstanceSave
+class TC_GAME_API InstanceSave
{
friend class InstanceSaveManager;
public:
@@ -147,7 +147,7 @@ class InstanceSave
typedef std::unordered_map<uint32 /*PAIR32(map, difficulty)*/, time_t /*resetTime*/> ResetTimeByMapDifficultyMap;
-class InstanceSaveManager
+class TC_GAME_API InstanceSaveManager
{
friend class InstanceSave;
@@ -158,11 +158,7 @@ class InstanceSaveManager
public:
typedef std::unordered_map<uint32 /*InstanceId*/, InstanceSave*> InstanceSaveHashMap;
- static InstanceSaveManager* instance()
- {
- static InstanceSaveManager instance;
- return &instance;
- }
+ static InstanceSaveManager* instance();
void Unload();
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index 1575b50098f..0887d183a8b 100644
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -29,6 +29,8 @@
#include "Pet.h"
#include "WorldSession.h"
#include "Opcodes.h"
+#include "ScriptReloadMgr.h"
+#include "ScriptMgr.h"
BossBoundaryData::~BossBoundaryData()
{
@@ -36,6 +38,18 @@ BossBoundaryData::~BossBoundaryData()
delete it->Boundary;
}
+InstanceScript::InstanceScript(Map* map) : instance(map), completedEncounters(0)
+{
+#ifdef TRINITY_API_USE_DYNAMIC_LINKING
+ uint32 scriptId = sObjectMgr->GetInstanceTemplate(map->GetId())->ScriptId;
+ auto const scriptname = sObjectMgr->GetScriptName(scriptId);
+ ASSERT(!scriptname.empty());
+ // Acquire a strong reference from the script module
+ // to keep it loaded until this object is destroyed.
+ module_reference = sScriptMgr->AcquireModuleReferenceOfScriptName(scriptname);
+#endif // #ifndef TRINITY_API_USE_DYNAMIC_LINKING
+}
+
void InstanceScript::SaveToDB()
{
std::string data = GetSaveData();
diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h
index ce83061e162..3814afe2f4b 100644
--- a/src/server/game/Instances/InstanceScript.h
+++ b/src/server/game/Instances/InstanceScript.h
@@ -36,6 +36,7 @@ class Unit;
class Player;
class GameObject;
class Creature;
+class ModuleReference;
enum EncounterFrameType
{
@@ -79,7 +80,7 @@ struct BossBoundaryEntry
AreaBoundary const* Boundary;
};
-struct BossBoundaryData
+struct TC_GAME_API BossBoundaryData
{
typedef std::vector<BossBoundaryEntry> StorageType;
typedef StorageType::const_iterator const_iterator;
@@ -134,10 +135,10 @@ typedef std::map<uint32 /*entry*/, MinionInfo> MinionInfoMap;
typedef std::map<uint32 /*type*/, ObjectGuid /*guid*/> ObjectGuidMap;
typedef std::map<uint32 /*entry*/, uint32 /*type*/> ObjectInfoMap;
-class InstanceScript : public ZoneScript
+class TC_GAME_API InstanceScript : public ZoneScript
{
public:
- explicit InstanceScript(Map* map) : instance(map), completedEncounters(0) { }
+ explicit InstanceScript(Map* map);
virtual ~InstanceScript() { }
@@ -289,6 +290,11 @@ class InstanceScript : public ZoneScript
ObjectInfoMap _gameObjectInfo;
ObjectGuidMap _objectGuids;
uint32 completedEncounters; // completed encounter mask, bit indexes are DungeonEncounter.dbc boss numbers, used for packets
+
+ #ifdef TRINITY_API_USE_DYNAMIC_LINKING
+ // Strong reference to the associated script module
+ std::shared_ptr<ModuleReference> module_reference;
+ #endif // #ifndef TRINITY_API_USE_DYNAMIC_LINKING
};
template<class AI, class T>
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 19dc210ea5b..260e7ff464f 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -353,7 +353,7 @@ LootItem::LootItem(LootStoreItem const& li)
conditions = li.conditions;
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid);
- freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT);
+ freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_MULTI_DROP);
follow_loot_rules = proto && (proto->FlagsCu & ITEM_FLAGS_CU_FOLLOW_LOOT_RULES);
needs_quest = li.needs_quest;
@@ -429,7 +429,7 @@ void Loot::AddItem(LootStoreItem const& item)
// non-conditional one-player only items are counted here,
// free for all items are counted in FillFFALoot(),
// non-ffa conditionals are counted in FillNonQuestNonFFAConditionalLoot()
- if (!item.needs_quest && item.conditions.empty() && !(proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT))
+ if (!item.needs_quest && item.conditions.empty() && !(proto->Flags & ITEM_PROTO_FLAG_MULTI_DROP))
++unlootedCount;
}
}
@@ -704,7 +704,7 @@ void Loot::DeleteLootItemFromContainerItemDB(uint32 itemID)
if (_itr->itemid != itemID)
continue;
- _itr->canSave = true;
+ _itr->canSave = false;
break;
}
}
@@ -786,6 +786,19 @@ uint32 Loot::GetMaxSlotInLootFor(Player* player) const
return items.size() + (itr != PlayerQuestItems.end() ? itr->second->size() : 0);
}
+// return true if there is any item that is lootable for any player (not quest item, FFA or conditional)
+bool Loot::hasItemForAll() const
+{
+ // Gold is always lootable
+ if (gold)
+ return true;
+
+ for (LootItem const& item : items)
+ if (!item.is_looted && !item.freeforall && item.conditions.empty())
+ return true;
+ return false;
+}
+
// return true if there is any FFA, quest or conditional item for the player.
bool Loot::hasItemFor(Player* player) const
{
@@ -1640,7 +1653,7 @@ void LoadLootTemplates_Item()
// remove real entries and check existence loot
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
- if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_PROTO_FLAG_OPENABLE)
+ if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_PROTO_FLAG_HAS_LOOT)
lootIdSet.erase(itr->second.ItemId);
// output error for any still listed (not referenced from appropriate table) ids
@@ -1871,3 +1884,20 @@ void LoadLootTemplates_Reference()
TC_LOG_INFO("server.loading", ">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime));
}
+
+void LoadLootTables()
+{
+ LoadLootTemplates_Creature();
+ LoadLootTemplates_Fishing();
+ LoadLootTemplates_Gameobject();
+ LoadLootTemplates_Item();
+ LoadLootTemplates_Mail();
+ LoadLootTemplates_Milling();
+ LoadLootTemplates_Pickpocketing();
+ LoadLootTemplates_Skinning();
+ LoadLootTemplates_Disenchant();
+ LoadLootTemplates_Prospecting();
+ LoadLootTemplates_Spell();
+
+ LoadLootTemplates_Reference();
+}
diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h
index af6f3e56707..a66b8f0b4c5 100644
--- a/src/server/game/Loot/LootMgr.h
+++ b/src/server/game/Loot/LootMgr.h
@@ -54,7 +54,7 @@ enum RollMask
#define MAX_NR_QUEST_ITEMS 32
// unrelated to the number of quest items shown, just for reserve
-enum LootMethod
+enum LootMethod : uint8
{
FREE_FOR_ALL = 0,
ROUND_ROBIN = 1,
@@ -74,7 +74,7 @@ enum PermissionTypes
NONE_PERMISSION = 6
};
-enum LootType
+enum LootType : uint8
{
LOOT_NONE = 0,
@@ -122,7 +122,7 @@ enum LootSlotType
class Player;
class LootStore;
-struct LootStoreItem
+struct TC_GAME_API LootStoreItem
{
uint32 itemid; // id of the item
uint32 reference; // referenced TemplateleId
@@ -148,7 +148,7 @@ struct LootStoreItem
typedef std::set<ObjectGuid::LowType> AllowedLooterSet;
-struct LootItem
+struct TC_GAME_API LootItem
{
uint32 itemid;
uint32 randomSuffix;
@@ -203,7 +203,7 @@ typedef std::unordered_map<uint32, LootTemplate*> LootTemplateMap;
typedef std::set<uint32> LootIdSet;
-class LootStore
+class TC_GAME_API LootStore
{
public:
explicit LootStore(char const* name, char const* entryName, bool ratesAllowed)
@@ -239,7 +239,7 @@ class LootStore
bool m_ratesAllowed;
};
-class LootTemplate
+class TC_GAME_API LootTemplate
{
class LootGroup; // A set of loot definitions for items (refs are not allowed inside)
typedef std::vector<LootGroup*> LootGroups;
@@ -307,7 +307,7 @@ struct LootView;
ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li);
ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv);
-struct Loot
+struct TC_GAME_API Loot
{
friend ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv);
@@ -382,6 +382,7 @@ struct Loot
LootItem* LootItemInSlot(uint32 lootslot, Player* player, QuestItem** qitem = NULL, QuestItem** ffaitem = NULL, QuestItem** conditem = NULL);
uint32 GetMaxSlotInLootFor(Player* player) const;
+ bool hasItemForAll() const;
bool hasItemFor(Player* player) const;
bool hasOverThresholdItem() const;
@@ -409,48 +410,33 @@ struct LootView
: loot(_loot), viewer(_viewer), permission(_permission) { }
};
-extern LootStore LootTemplates_Creature;
-extern LootStore LootTemplates_Fishing;
-extern LootStore LootTemplates_Gameobject;
-extern LootStore LootTemplates_Item;
-extern LootStore LootTemplates_Mail;
-extern LootStore LootTemplates_Milling;
-extern LootStore LootTemplates_Pickpocketing;
-extern LootStore LootTemplates_Reference;
-extern LootStore LootTemplates_Skinning;
-extern LootStore LootTemplates_Disenchant;
-extern LootStore LootTemplates_Prospecting;
-extern LootStore LootTemplates_Spell;
-
-void LoadLootTemplates_Creature();
-void LoadLootTemplates_Fishing();
-void LoadLootTemplates_Gameobject();
-void LoadLootTemplates_Item();
-void LoadLootTemplates_Mail();
-void LoadLootTemplates_Milling();
-void LoadLootTemplates_Pickpocketing();
-void LoadLootTemplates_Skinning();
-void LoadLootTemplates_Disenchant();
-void LoadLootTemplates_Prospecting();
-
-void LoadLootTemplates_Spell();
-void LoadLootTemplates_Reference();
-
-inline void LoadLootTables()
-{
- LoadLootTemplates_Creature();
- LoadLootTemplates_Fishing();
- LoadLootTemplates_Gameobject();
- LoadLootTemplates_Item();
- LoadLootTemplates_Mail();
- LoadLootTemplates_Milling();
- LoadLootTemplates_Pickpocketing();
- LoadLootTemplates_Skinning();
- LoadLootTemplates_Disenchant();
- LoadLootTemplates_Prospecting();
- LoadLootTemplates_Spell();
-
- LoadLootTemplates_Reference();
-}
+TC_GAME_API extern LootStore LootTemplates_Creature;
+TC_GAME_API extern LootStore LootTemplates_Fishing;
+TC_GAME_API extern LootStore LootTemplates_Gameobject;
+TC_GAME_API extern LootStore LootTemplates_Item;
+TC_GAME_API extern LootStore LootTemplates_Mail;
+TC_GAME_API extern LootStore LootTemplates_Milling;
+TC_GAME_API extern LootStore LootTemplates_Pickpocketing;
+TC_GAME_API extern LootStore LootTemplates_Reference;
+TC_GAME_API extern LootStore LootTemplates_Skinning;
+TC_GAME_API extern LootStore LootTemplates_Disenchant;
+TC_GAME_API extern LootStore LootTemplates_Prospecting;
+TC_GAME_API extern LootStore LootTemplates_Spell;
+
+TC_GAME_API void LoadLootTemplates_Creature();
+TC_GAME_API void LoadLootTemplates_Fishing();
+TC_GAME_API void LoadLootTemplates_Gameobject();
+TC_GAME_API void LoadLootTemplates_Item();
+TC_GAME_API void LoadLootTemplates_Mail();
+TC_GAME_API void LoadLootTemplates_Milling();
+TC_GAME_API void LoadLootTemplates_Pickpocketing();
+TC_GAME_API void LoadLootTemplates_Skinning();
+TC_GAME_API void LoadLootTemplates_Disenchant();
+TC_GAME_API void LoadLootTemplates_Prospecting();
+
+TC_GAME_API void LoadLootTemplates_Spell();
+TC_GAME_API void LoadLootTemplates_Reference();
+
+TC_GAME_API void LoadLootTables();
#endif
diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp
index b0e8a1ebe02..0fc49eba05e 100644
--- a/src/server/game/Mails/Mail.cpp
+++ b/src/server/game/Mails/Mail.cpp
@@ -49,8 +49,8 @@ MailSender::MailSender(Object* sender, MailStationery stationery) : m_stationery
break;
default:
m_messageType = MAIL_NORMAL;
- m_senderId = 0; // will show mail from not existed player
- TC_LOG_ERROR("misc", "MailSender::MailSender - Mail have unexpected sender typeid (%u)", sender->GetTypeId());
+ m_senderId = 0; // will show mail from non-existing player
+ TC_LOG_ERROR("misc", "MailSender::MailSender - Mail message contains unexpected sender typeid (%u).", sender->GetTypeId());
break;
}
}
@@ -70,6 +70,13 @@ MailSender::MailSender(Player* sender)
m_senderId = sender->GetGUID().GetCounter();
}
+MailSender::MailSender(uint32 senderEntry)
+{
+ m_messageType = MAIL_CREATURE;
+ m_senderId = senderEntry;
+ m_stationery = MAIL_STATIONERY_DEFAULT;
+}
+
MailReceiver::MailReceiver(Player* receiver) : m_receiver(receiver), m_receiver_lowguid(receiver->GetGUID().GetCounter()) { }
MailReceiver::MailReceiver(Player* receiver, ObjectGuid::LowType receiver_lowguid) : m_receiver(receiver), m_receiver_lowguid(receiver_lowguid)
diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h
index 407edf2badb..ad14e3cecf9 100644
--- a/src/server/game/Mails/Mail.h
+++ b/src/server/game/Mails/Mail.h
@@ -79,7 +79,7 @@ enum MailShowFlags
MAIL_SHOW_RETURN = 0x0010
};
-class MailSender
+class TC_GAME_API MailSender
{
public: // Constructors
MailSender(MailMessageType messageType, ObjectGuid::LowType sender_guidlow_or_entry, MailStationery stationery = MAIL_STATIONERY_DEFAULT)
@@ -90,6 +90,7 @@ class MailSender
MailSender(CalendarEvent* sender);
MailSender(AuctionEntry* sender);
MailSender(Player* sender);
+ MailSender(uint32 senderEntry);
public: // Accessors
MailMessageType GetMailMessageType() const { return m_messageType; }
ObjectGuid::LowType GetSenderId() const { return m_senderId; }
@@ -100,7 +101,7 @@ class MailSender
MailStationery m_stationery;
};
-class MailReceiver
+class TC_GAME_API MailReceiver
{
public: // Constructors
explicit MailReceiver(ObjectGuid::LowType receiver_lowguid) : m_receiver(NULL), m_receiver_lowguid(receiver_lowguid) { }
@@ -114,7 +115,7 @@ class MailReceiver
ObjectGuid::LowType m_receiver_lowguid;
};
-class MailDraft
+class TC_GAME_API MailDraft
{
typedef std::map<ObjectGuid::LowType, Item*> MailItemMap;
@@ -162,7 +163,7 @@ struct MailItemInfo
};
typedef std::vector<MailItemInfo> MailItemInfoVec;
-struct Mail
+struct TC_GAME_API Mail
{
uint32 messageID;
uint8 messageType;
diff --git a/src/server/game/Maps/AreaBoundary.h b/src/server/game/Maps/AreaBoundary.h
index a134b783ca6..0973d1a6e86 100644
--- a/src/server/game/Maps/AreaBoundary.h
+++ b/src/server/game/Maps/AreaBoundary.h
@@ -20,7 +20,7 @@
#include "Position.h"
-class AreaBoundary
+class TC_GAME_API AreaBoundary
{
public:
enum BoundaryType
@@ -40,7 +40,7 @@ class AreaBoundary
{
double d_positionX, d_positionY, d_positionZ;
DoublePosition(double x = 0.0, double y = 0.0, double z = 0.0, float o = 0.0f)
- : Position(x, y, z, o), d_positionX(x), d_positionY(y), d_positionZ(z) { }
+ : Position(float(x), float(y), float(z), o), d_positionX(x), d_positionY(y), d_positionZ(z) { }
DoublePosition(float x, float y = 0.0f, float z = 0.0f, float o = 0.0f)
: Position(x, y, z, o), d_positionX(x), d_positionY(y), d_positionZ(z) { }
DoublePosition(const Position& pos)
@@ -66,7 +66,7 @@ class AreaBoundary
bool m_isInvertedBoundary;
};
-class RectangleBoundary : public AreaBoundary
+class TC_GAME_API RectangleBoundary : public AreaBoundary
{
public:
// X axis is north/south, Y axis is east/west, larger values are northwest
@@ -79,7 +79,7 @@ class RectangleBoundary : public AreaBoundary
const float _minX, _maxX, _minY, _maxY;
};
-class CircleBoundary : public AreaBoundary
+class TC_GAME_API CircleBoundary : public AreaBoundary
{
public:
CircleBoundary(Position const& center, double radius, bool isInverted = false);
@@ -95,7 +95,7 @@ class CircleBoundary : public AreaBoundary
const double _radiusSq;
};
-class EllipseBoundary : public AreaBoundary
+class TC_GAME_API EllipseBoundary : public AreaBoundary
{
public:
EllipseBoundary(Position const& center, double radiusX, double radiusY, bool isInverted = false);
@@ -109,7 +109,7 @@ class EllipseBoundary : public AreaBoundary
const double _radiusYSq, _scaleXSq;
};
-class TriangleBoundary : public AreaBoundary
+class TC_GAME_API TriangleBoundary : public AreaBoundary
{
public:
TriangleBoundary(Position const& pointA, Position const& pointB, Position const& pointC, bool isInverted = false);
@@ -123,7 +123,7 @@ class TriangleBoundary : public AreaBoundary
const double _abx, _bcx, _cax, _aby, _bcy, _cay;
};
-class ParallelogramBoundary : public AreaBoundary
+class TC_GAME_API ParallelogramBoundary : public AreaBoundary
{
public:
// Note: AB must be orthogonal to AD
@@ -138,7 +138,7 @@ class ParallelogramBoundary : public AreaBoundary
const double _abx, _dax, _aby, _day;
};
-class ZRangeBoundary : public AreaBoundary
+class TC_GAME_API ZRangeBoundary : public AreaBoundary
{
public:
ZRangeBoundary(float minZ, float maxZ, bool isInverted = false);
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index ca384160ad1..23ca8cbba1a 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -17,6 +17,7 @@
*/
#include "Map.h"
+#include "MapManager.h"
#include "Battleground.h"
#include "MMapFactory.h"
#include "CellImpl.h"
@@ -64,7 +65,7 @@ Map::~Map()
}
if (!m_scriptSchedule.empty())
- sScriptMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size());
+ sMapMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size());
MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(GetId(), i_InstanceId);
}
@@ -89,7 +90,7 @@ bool Map::ExistMap(uint32 mapid, int gx, int gy)
if (fread(&header, sizeof(header), 1, pf) == 1)
{
if (header.mapMagic.asUInt != MapMagic.asUInt || header.versionMagic.asUInt != MapVersionMagic.asUInt)
- TC_LOG_ERROR("maps", "Map file '%s' is from an incompatible map version (%.*s %.*s), %.*s %.*s is expected. Please recreate using the mapextractor.",
+ TC_LOG_ERROR("maps", "Map file '%s' is from an incompatible map version (%.*s %.*s), %.*s %.*s is expected. Please pull your source, recompile tools and recreate maps using the updated mapextractor, then replace your old map files with new files. If you still have problems search on forum for error TCE00018.",
fileName, 4, header.mapMagic.asChar, 4, header.versionMagic.asChar, 4, MapMagic.asChar, 4, MapVersionMagic.asChar);
else
ret = true;
@@ -129,9 +130,9 @@ void Map::LoadMMap(int gx, int gy)
bool mmapLoadResult = MMAP::MMapFactory::createOrGetMMapManager()->loadMap((sWorld->GetDataPath() + "mmaps").c_str(), GetId(), gx, gy);
if (mmapLoadResult)
- TC_LOG_DEBUG("maps", "MMAP loaded name:%s, id:%d, x:%d, y:%d (mmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+ TC_LOG_DEBUG("mmaps", "MMAP loaded name:%s, id:%d, x:%d, y:%d (mmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
else
- TC_LOG_ERROR("maps", "Could not load MMAP name:%s, id:%d, x:%d, y:%d (mmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+ TC_LOG_ERROR("mmaps", "Could not load MMAP name:%s, id:%d, x:%d, y:%d (mmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
}
void Map::LoadVMap(int gx, int gy)
@@ -209,6 +210,13 @@ void Map::LoadMapAndVMap(int gx, int gy)
}
}
+void Map::LoadAllCells()
+{
+ for (uint32 cellX = 0; cellX < TOTAL_NUMBER_OF_CELLS_PER_MAP; cellX++)
+ for (uint32 cellY = 0; cellY < TOTAL_NUMBER_OF_CELLS_PER_MAP; cellY++)
+ LoadGrid((cellX + 0.5f - CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL, (cellY + 0.5f - CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL);
+}
+
void Map::InitStateMachine()
{
si_GridStates[GRID_STATE_INVALID] = new InvalidState;
@@ -594,7 +602,7 @@ bool Map::AddToMap(T* obj)
//something, such as vehicle, needs to be update immediately
//also, trigger needs to cast spell, if not update, cannot see visual
- obj->UpdateObjectVisibility(true);
+ obj->UpdateObjectVisibilityOnCreate();
return true;
}
@@ -706,6 +714,15 @@ void Map::Update(const uint32 t_diff)
VisitNearbyCellsOf(player, grid_object_update, world_object_update);
+ // If player is using far sight, visit that object too
+ if (WorldObject* viewPoint = player->GetViewpoint())
+ {
+ if (Creature* viewCreature = viewPoint->ToCreature())
+ VisitNearbyCellsOf(viewCreature, grid_object_update, world_object_update);
+ else if (DynamicObject* viewObject = viewPoint->ToDynObject())
+ VisitNearbyCellsOf(viewObject, grid_object_update, world_object_update);
+ }
+
// Handle updates for creatures in combat with player and are more than 60 yards away
if (player->IsInCombat())
{
@@ -1714,7 +1731,7 @@ bool GridMap::loadData(const char* filename)
return true;
}
- TC_LOG_ERROR("maps", "Map file '%s' is from an incompatible map version (%.*s %.*s), %.*s %.*s is expected. Please recreate using the mapextractor.",
+ TC_LOG_ERROR("maps", "Map file '%s' is from an incompatible map version (%.*s %.*s), %.*s %.*s is expected. Please pull your source, recompile tools and recreate maps using the updated mapextractor, then replace your old map files with new files. If you still have problems search on forum for error TCE00018.",
filename, 4, header.mapMagic.asChar, 4, header.versionMagic.asChar, 4, MapMagic.asChar, 4, MapVersionMagic.asChar);
fclose(in);
return false;
@@ -2282,12 +2299,12 @@ inline GridMap* Map::GetGrid(float x, float y)
return GridMaps[gx][gy];
}
-float Map::GetWaterOrGroundLevel(float x, float y, float z, float* ground /*= NULL*/, bool /*swim = false*/) const
+float Map::GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float* ground /*= NULL*/, bool /*swim = false*/) const
{
if (const_cast<Map*>(this)->GetGrid(x, y))
{
// we need ground level (including grid height version) for proper return water level in point
- float ground_z = GetHeight(PHASEMASK_NORMAL, x, y, z, true, 50.0f);
+ float ground_z = GetHeight(phasemask, x, y, z, true, 50.0f);
if (ground)
*ground = ground_z;
@@ -2328,9 +2345,9 @@ float Map::GetHeight(float x, float y, float z, bool checkVMap /*= true*/, float
{
// we have mapheight and vmapheight and must select more appropriate
- // we are already under the surface or vmap height above map heigt
+ // vmap height above map height
// or if the distance of the vmap height is less the land height distance
- if (z < mapHeight || vmapHeight > mapHeight || std::fabs(mapHeight - z) > std::fabs(vmapHeight - z))
+ if (vmapHeight > mapHeight || std::fabs(mapHeight - z) > std::fabs(vmapHeight - z))
return vmapHeight;
else
return mapHeight; // better use .map surface height
@@ -2428,7 +2445,7 @@ uint32 Map::GetAreaId(float x, float y, float z, bool *isOutdoors) const
atEntry = sAreaTableStore.LookupEntry(wmoEntry->areaId);
}
- uint32 areaId;
+ uint32 areaId = 0;
if (atEntry)
areaId = atEntry->ID;
@@ -2436,8 +2453,9 @@ uint32 Map::GetAreaId(float x, float y, float z, bool *isOutdoors) const
{
if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
areaId = gmap->getArea(x, y);
+
// this used while not all *.map files generated (instances)
- else
+ if (!areaId)
areaId = i_mapEntry->linked_zone;
}
@@ -2649,8 +2667,8 @@ void Map::UpdateObjectsVisibilityFor(Player* player, Cell cell, CellCoord cellpa
cell.SetNoCreate();
TypeContainerVisitor<Trinity::VisibleNotifier, WorldTypeMapContainer > world_notifier(notifier);
TypeContainerVisitor<Trinity::VisibleNotifier, GridTypeMapContainer > grid_notifier(notifier);
- cell.Visit(cellpair, world_notifier, *this, *player, player->GetSightRange());
- cell.Visit(cellpair, grid_notifier, *this, *player, player->GetSightRange());
+ cell.Visit(cellpair, world_notifier, *this, *player->m_seer, player->GetSightRange());
+ cell.Visit(cellpair, grid_notifier, *this, *player->m_seer, player->GetSightRange());
// send data
notifier.SendToSelf();
@@ -2985,15 +3003,15 @@ void Map::RemoveFromActive(DynamicObject* obj)
RemoveFromActiveHelper(obj);
}
-template bool Map::AddToMap(Corpse*);
-template bool Map::AddToMap(Creature*);
-template bool Map::AddToMap(GameObject*);
-template bool Map::AddToMap(DynamicObject*);
+template TC_GAME_API bool Map::AddToMap(Corpse*);
+template TC_GAME_API bool Map::AddToMap(Creature*);
+template TC_GAME_API bool Map::AddToMap(GameObject*);
+template TC_GAME_API bool Map::AddToMap(DynamicObject*);
-template void Map::RemoveFromMap(Corpse*, bool);
-template void Map::RemoveFromMap(Creature*, bool);
-template void Map::RemoveFromMap(GameObject*, bool);
-template void Map::RemoveFromMap(DynamicObject*, bool);
+template TC_GAME_API void Map::RemoveFromMap(Corpse*, bool);
+template TC_GAME_API void Map::RemoveFromMap(Creature*, bool);
+template TC_GAME_API void Map::RemoveFromMap(GameObject*, bool);
+template TC_GAME_API void Map::RemoveFromMap(DynamicObject*, bool);
/* ******* Dungeon Instance Maps ******* */
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index bc2bf72f271..48864180b84 100644
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -154,7 +154,7 @@ struct LiquidData
float depth_level;
};
-class GridMap
+class TC_GAME_API GridMap
{
uint32 _flags;
union{
@@ -253,7 +253,7 @@ typedef std::map<uint32/*leaderDBGUID*/, CreatureGroup*> CreatureGroupHol
typedef std::unordered_map<uint32 /*zoneId*/, ZoneDynamicInfo> ZoneDynamicInfoMap;
-class Map : public GridRefManager<NGridType>
+class TC_GAME_API Map : public GridRefManager<NGridType>
{
friend class MapReference;
public:
@@ -277,6 +277,7 @@ class Map : public GridRefManager<NGridType>
virtual bool AddPlayerToMap(Player*);
virtual void RemovePlayerFromMap(Player*, bool);
+
template<class T> bool AddToMap(T *);
template<class T> void RemoveFromMap(T *, bool);
@@ -292,7 +293,8 @@ class Map : public GridRefManager<NGridType>
void GameObjectRelocation(GameObject* go, float x, float y, float z, float orientation, bool respawnRelocationOnFail = true);
void DynamicObjectRelocation(DynamicObject* go, float x, float y, float z, float orientation);
- template<class T, class CONTAINER> void Visit(const Cell& cell, TypeContainerVisitor<T, CONTAINER> &visitor);
+ template<class T, class CONTAINER>
+ void Visit(const Cell& cell, TypeContainerVisitor<T, CONTAINER> &visitor);
bool IsRemovalGrid(float x, float y) const
{
@@ -308,6 +310,7 @@ class Map : public GridRefManager<NGridType>
bool GetUnloadLock(const GridCoord &p) const { return getNGrid(p.x_coord, p.y_coord)->getUnloadLock(); }
void SetUnloadLock(const GridCoord &p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadExplicitLock(on); }
void LoadGrid(float x, float y);
+ void LoadAllCells();
bool UnloadGrid(NGridType& ngrid, bool pForce);
virtual void UnloadAll();
@@ -491,7 +494,7 @@ class Map : public GridRefManager<NGridType>
BattlegroundMap* ToBattlegroundMap() { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap*>(this); else return NULL; }
BattlegroundMap const* ToBattlegroundMap() const { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap const*>(this); return NULL; }
- float GetWaterOrGroundLevel(float x, float y, float z, float* ground = NULL, bool swim = false) const;
+ float GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float* ground = NULL, bool swim = false) const;
float GetHeight(uint32 phasemask, float x, float y, float z, bool vmap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const;
bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask) const;
void Balance() { _dynamicTree.balance(); }
@@ -753,7 +756,7 @@ enum InstanceResetMethod
INSTANCE_RESET_RESPAWN_DELAY
};
-class InstanceMap : public Map
+class TC_GAME_API InstanceMap : public Map
{
public:
InstanceMap(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode, Map* _parent);
@@ -785,7 +788,7 @@ class InstanceMap : public Map
uint32 i_script_id;
};
-class BattlegroundMap : public Map
+class TC_GAME_API BattlegroundMap : public Map
{
public:
BattlegroundMap(uint32 id, time_t, uint32 InstanceId, Map* _parent, uint8 spawnMode);
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index 47b9b376b1e..58decc05354 100644
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -230,6 +230,9 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
bool load_data = save != NULL;
map->CreateInstanceData(load_data);
+ if (sWorld->getBoolConfig(CONFIG_INSTANCEMAP_LOAD_GRIDS))
+ map->LoadAllCells();
+
m_InstancedMaps[InstanceId] = map;
return map;
}
diff --git a/src/server/game/Maps/MapInstanced.h b/src/server/game/Maps/MapInstanced.h
index 7fa66bde06a..eea54e1f013 100644
--- a/src/server/game/Maps/MapInstanced.h
+++ b/src/server/game/Maps/MapInstanced.h
@@ -23,7 +23,7 @@
#include "InstanceSaveMgr.h"
#include "DBCEnums.h"
-class MapInstanced : public Map
+class TC_GAME_API MapInstanced : public Map
{
friend class MapManager;
public:
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp
index e5f364e39f4..79a8b3855e8 100644
--- a/src/server/game/Maps/MapManager.cpp
+++ b/src/server/game/Maps/MapManager.cpp
@@ -38,10 +38,10 @@
#include "AchievementMgr.h"
MapManager::MapManager()
+ : _nextInstanceId(0), _scheduledScripts(0)
{
i_gridCleanUpDelay = sWorld->getIntConfig(CONFIG_INTERVAL_GRIDCLEAN);
i_timer.SetInterval(sWorld->getIntConfig(CONFIG_INTERVAL_MAPUPDATE));
- _nextInstanceId = 0;
}
MapManager::~MapManager() { }
@@ -62,6 +62,12 @@ void MapManager::InitializeVisibilityDistanceInfo()
(*iter).second->InitVisibilityDistance();
}
+MapManager* MapManager::instance()
+{
+ static MapManager instance;
+ return &instance;
+}
+
Map* MapManager::CreateBaseMap(uint32 id)
{
Map* map = FindBaseMap(id);
diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h
index 7f9621593d4..91a26c29150 100644
--- a/src/server/game/Maps/MapManager.h
+++ b/src/server/game/Maps/MapManager.h
@@ -28,14 +28,10 @@
class Transport;
struct TransportCreatureProto;
-class MapManager
+class TC_GAME_API MapManager
{
public:
- static MapManager* instance()
- {
- static MapManager instance;
- return &instance;
- }
+ static MapManager* instance();
Map* CreateBaseMap(uint32 mapId);
Map* FindBaseNonInstanceMap(uint32 mapId) const;
@@ -130,6 +126,11 @@ class MapManager
template<typename Worker>
void DoForAllMapsWithMapId(uint32 mapId, Worker&& worker);
+ void IncreaseScheduledScriptsCount() { ++_scheduledScripts; }
+ void DecreaseScheduledScriptCount() { --_scheduledScripts; }
+ void DecreaseScheduledScriptCount(std::size_t count) { _scheduledScripts -= count; }
+ bool IsScriptScheduled() const { return _scheduledScripts > 0; }
+
private:
typedef std::unordered_map<uint32, Map*> MapMapType;
typedef std::vector<bool> InstanceIds;
@@ -154,6 +155,9 @@ class MapManager
InstanceIds _instanceIds;
uint32 _nextInstanceId;
MapUpdater m_updater;
+
+ // atomic op counter for active scripts amount
+ std::atomic<std::size_t> _scheduledScripts;
};
template<typename Worker>
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Maps/MapScripts.cpp
index a01c109b9ca..c5d7bdc64ce 100644
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Maps/MapScripts.cpp
@@ -21,6 +21,7 @@
#include "GridNotifiersImpl.h"
#include "GossipDef.h"
#include "Map.h"
+#include "MapManager.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "Item.h"
@@ -58,7 +59,7 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O
if (iter->first == 0)
immedScript = true;
- sScriptMgr->IncreaseScheduledScriptsCount();
+ sMapMgr->IncreaseScheduledScriptsCount();
}
///- If one of the effects should be immediate, launch the script execution
if (/*start &&*/ immedScript && !i_scriptLock)
@@ -86,7 +87,7 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou
sa.script = &script;
m_scriptSchedule.insert(ScriptScheduleMap::value_type(time_t(sWorld->GetGameTime() + delay), sa));
- sScriptMgr->IncreaseScheduledScriptsCount();
+ sMapMgr->IncreaseScheduledScriptsCount();
///- If effects should be immediate, launch the script execution
if (delay == 0 && !i_scriptLock)
@@ -878,6 +879,6 @@ void Map::ScriptsProcess()
m_scriptSchedule.erase(iter);
iter = m_scriptSchedule.begin();
- sScriptMgr->DecreaseScheduledScriptCount();
+ sMapMgr->DecreaseScheduledScriptCount();
}
}
diff --git a/src/server/game/Maps/MapUpdater.h b/src/server/game/Maps/MapUpdater.h
index 3d0f0b9e7e8..d95011d5a42 100644
--- a/src/server/game/Maps/MapUpdater.h
+++ b/src/server/game/Maps/MapUpdater.h
@@ -28,7 +28,7 @@
class MapUpdateRequest;
class Map;
-class MapUpdater
+class TC_GAME_API MapUpdater
{
public:
diff --git a/src/server/game/Maps/TransportMgr.cpp b/src/server/game/Maps/TransportMgr.cpp
index afbddc5e686..c94dd860dea 100644
--- a/src/server/game/Maps/TransportMgr.cpp
+++ b/src/server/game/Maps/TransportMgr.cpp
@@ -36,6 +36,12 @@ TransportMgr::TransportMgr() { }
TransportMgr::~TransportMgr() { }
+TransportMgr* TransportMgr::instance()
+{
+ static TransportMgr instance;
+ return &instance;
+}
+
void TransportMgr::Unload()
{
_transportTemplates.clear();
diff --git a/src/server/game/Maps/TransportMgr.h b/src/server/game/Maps/TransportMgr.h
index 0bfb5b7a410..229fea882a4 100644
--- a/src/server/game/Maps/TransportMgr.h
+++ b/src/server/game/Maps/TransportMgr.h
@@ -82,7 +82,7 @@ struct TransportTemplate
typedef std::map<uint32, TransportAnimationEntry const*> TransportPathContainer;
typedef std::map<uint32, TransportRotationEntry const*> TransportPathRotationContainer;
-struct TransportAnimation
+struct TC_GAME_API TransportAnimation
{
TransportAnimation() : TotalTime(0) { }
@@ -96,16 +96,12 @@ struct TransportAnimation
typedef std::map<uint32, TransportAnimation> TransportAnimationContainer;
-class TransportMgr
+class TC_GAME_API TransportMgr
{
- friend void LoadDBCStores(std::string const&);
+ friend TC_GAME_API void LoadDBCStores(std::string const&);
public:
- static TransportMgr* instance()
- {
- static TransportMgr instance;
- return &instance;
- }
+ static TransportMgr* instance();
void Unload();
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 62c2a3a1981..143f535ddf5 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -112,7 +112,9 @@ enum TrinityStrings
LANG_RBAC_PERM_REVOKED_NOT_IN_LIST = 79,
LANG_PVPSTATS = 80,
LANG_PVPSTATS_DISABLED = 81,
- // Free 82 - 95
+ LANG_COMMAND_NEARGRAVEYARD = 82,
+ LANG_COMMAND_NEARGRAVEYARD_NOTFOUND = 83,
+ // Free 84 - 95
LANG_GUILD_RENAME_ALREADY_EXISTS = 96,
@@ -208,7 +210,9 @@ enum TrinityStrings
LANG_INVALID_GAMEOBJECT_TYPE = 176,
LANG_GAMEOBJECT_DAMAGED = 177,
LANG_GRID_POSITION = 178,
- // Room for more level 1 179-199 not used
+ // 179-185 used in 6.x branch
+ LANG_TRANSPORT_POSITION = 186,
+ // Room for more level 1 187-199 not used
// level 2 chat
LANG_NO_SELECTION = 200,
@@ -885,7 +889,9 @@ enum TrinityStrings
LANG_CHARACTER_DELETED_LIST_LINE_CHAT = 1026,
LANG_SQLDRIVER_QUERY_LOGGING_ENABLED = 1027,
LANG_SQLDRIVER_QUERY_LOGGING_DISABLED = 1028,
- // Room for more level 4 1029-1099 not used
+ LANG_ACCOUNT_INVALID_BNET_NAME = 1029, // 6.x ONLY
+ LANG_ACCOUNT_USE_BNET_COMMANDS = 1030, // 6.x enum value name but different text in DB
+ // Room for more level 4 1031-1099 not used
// Level 3 (continue)
LANG_ACCOUNT_SETADDON = 1100,
@@ -1059,7 +1065,7 @@ enum TrinityStrings
LANG_COMMAND_NO_FROZEN_PLAYERS = 5004,
LANG_COMMAND_LIST_FREEZE = 5005,
LANG_COMMAND_PERMA_FROZEN_PLAYER = 5006,
- LANG_INSTANCE_RAID_GROUP_ONLY = 5007,
+ // = 5007, unused
LANG_INSTANCE_CLOSED = 5008,
LANG_COMMAND_PLAYED_TO_ALL = 5009,
LANG_NPCINFO_LINKGUID = 5010,
@@ -1208,6 +1214,8 @@ enum TrinityStrings
LANG_CREATURE_NO_INTERIOR_POINT_FOUND = 11011,
LANG_CREATURE_MOVEMENT_NOT_BOUNDED = 11012,
LANG_CREATURE_MOVEMENT_MAYBE_UNBOUNDED = 11013,
- LANG_INSTANCE_BIND_MISMATCH = 11014
+ LANG_INSTANCE_BIND_MISMATCH = 11014,
+ LANG_CREATURE_NOT_AI_ENABLED = 11015,
+ LANG_SELECT_PLAYER_OR_PET = 11016,
};
#endif
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 77d6f739da6..7f77453d00b 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -23,7 +23,7 @@
#include "DetourNavMesh.h"
#include <cassert>
-enum SpellEffIndex
+enum SpellEffIndex : uint8
{
EFFECT_0 = 0,
EFFECT_1 = 1,
@@ -456,7 +456,7 @@ enum SpellAttr4
enum SpellAttr5
{
- SPELL_ATTR5_UNK0 = 0x00000001, // 0
+ SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING = 0x00000001, // 0 available casting channel spell when moving
SPELL_ATTR5_NO_REAGENT_WHILE_PREP = 0x00000002, // 1 not need reagents if UNIT_FLAG_PREPARATION
SPELL_ATTR5_UNK2 = 0x00000004, // 2
SPELL_ATTR5_USABLE_WHILE_STUNNED = 0x00000008, // 3 usable while stunned
@@ -828,7 +828,7 @@ enum SpellEffects
SPELL_EFFECT_CREATE_ITEM_2 = 157,
SPELL_EFFECT_MILLING = 158,
SPELL_EFFECT_ALLOW_RENAME_PET = 159,
- SPELL_EFFECT_160 = 160,
+ SPELL_EFFECT_FORCE_CAST_2 = 160,
SPELL_EFFECT_TALENT_SPEC_COUNT = 161,
SPELL_EFFECT_TALENT_SPEC_SELECT = 162,
SPELL_EFFECT_163 = 163,
@@ -1490,11 +1490,12 @@ enum GameObjectFlags
{
GO_FLAG_IN_USE = 0x00000001, // disables interaction while animated
GO_FLAG_LOCKED = 0x00000002, // require key, spell, event, etc to be opened. Makes "Locked" appear in tooltip
- GO_FLAG_INTERACT_COND = 0x00000004, // cannot interact (condition to interact)
+ GO_FLAG_INTERACT_COND = 0x00000004, // cannot interact (condition to interact - requires GO_DYNFLAG_LO_ACTIVATE to enable interaction clientside)
GO_FLAG_TRANSPORT = 0x00000008, // any kind of transport? Object can transport (elevator, boat, car)
GO_FLAG_NOT_SELECTABLE = 0x00000010, // not selectable even in GM mode
GO_FLAG_NODESPAWN = 0x00000020, // never despawn, typically for doors, they just change state
- GO_FLAG_TRIGGERED = 0x00000040, // typically, summoned objects. Triggered by spell or other events
+ GO_FLAG_AI_OBSTACLE = 0x00000040, // makes the client register the object in something called AIObstacleMgr, unknown what it does
+ GO_FLAG_FREEZE_ANIMATION = 0x00000080,
GO_FLAG_DAMAGED = 0x00000200,
GO_FLAG_DESTROYED = 0x00000400
};
@@ -2531,6 +2532,7 @@ uint32 const CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL = (1 << (CREATURE_TYPE_ME
// CreatureFamily.dbc
enum CreatureFamily
{
+ CREATURE_FAMILY_NONE = 0,
CREATURE_FAMILY_WOLF = 1,
CREATURE_FAMILY_CAT = 2,
CREATURE_FAMILY_SPIDER = 3,
@@ -2576,38 +2578,38 @@ enum CreatureFamily
enum CreatureTypeFlags
{
- CREATURE_TYPEFLAGS_TAMEABLE = 0x00000001, // Tameable by any hunter
- CREATURE_TYPEFLAGS_GHOST = 0x00000002, // Creature are also visible for not alive player. Allow gossip interaction if npcflag allow?
- CREATURE_TYPEFLAGS_BOSS = 0x00000004,
- CREATURE_TYPEFLAGS_UNK3 = 0x00000008,
- CREATURE_TYPEFLAGS_UNK4 = 0x00000010,
- CREATURE_TYPEFLAGS_UNK5 = 0x00000020,
- CREATURE_TYPEFLAGS_UNK6 = 0x00000040,
- CREATURE_TYPEFLAGS_DEAD_INTERACT = 0x00000080, // Player can interact with the creature if its dead (not player dead)
- CREATURE_TYPEFLAGS_HERBLOOT = 0x00000100, // Can be looted by herbalist
- CREATURE_TYPEFLAGS_MININGLOOT = 0x00000200, // Can be looted by miner
- CREATURE_TYPEFLAGS_DONT_LOG_DEATH = 0x00000400, // Death event will not show up in combat log
- CREATURE_TYPEFLAGS_MOUNTED_COMBAT = 0x00000800, // Creature can remain mounted when entering combat
- CREATURE_TYPEFLAGS_AID_PLAYERS = 0x00001000, // ? Can aid any player in combat if in range?
- CREATURE_TYPEFLAGS_UNK13 = 0x00002000,
- CREATURE_TYPEFLAGS_UNK14 = 0x00004000, // ? Possibly not in use
- CREATURE_TYPEFLAGS_ENGINEERLOOT = 0x00008000, // Can be looted by engineer
- CREATURE_TYPEFLAGS_EXOTIC = 0x00010000, // Can be tamed by hunter as exotic pet
- CREATURE_TYPEFLAGS_UNK17 = 0x00020000, // ? Related to vehicles/pvp?
- CREATURE_TYPEFLAGS_UNK18 = 0x00040000, // ? Related to vehicle/siege weapons?
- CREATURE_TYPEFLAGS_PROJECTILE_COLLISION = 0x00080000, // Projectiles can collide with this creature - interacts with TARGET_DEST_TRAJ
- CREATURE_TYPEFLAGS_UNK20 = 0x00100000,
- CREATURE_TYPEFLAGS_UNK21 = 0x00200000,
- CREATURE_TYPEFLAGS_UNK22 = 0x00400000,
- CREATURE_TYPEFLAGS_UNK23 = 0x00800000, // ? First seen in 3.2.2. Related to banner/backpack of creature/companion?
- CREATURE_TYPEFLAGS_UNK24 = 0x01000000,
- CREATURE_TYPEFLAGS_UNK25 = 0x02000000,
- CREATURE_TYPEFLAGS_PARTY_MEMBER = 0x04000000, //! Creature can be targeted by spells that require target to be in caster's party/raid
- CREATURE_TYPEFLAGS_UNK27 = 0x08000000,
- CREATURE_TYPEFLAGS_UNK28 = 0x10000000,
- CREATURE_TYPEFLAGS_UNK29 = 0x20000000,
- CREATURE_TYPEFLAGS_UNK30 = 0x40000000,
- CREATURE_TYPEFLAGS_UNK31 = 0x80000000
+ CREATURE_TYPE_FLAG_TAMEABLE_PET = 0x00000001, // Makes the mob tameable (must also be a beast and have family set)
+ CREATURE_TYPE_FLAG_GHOST_VISIBLE = 0x00000002, // Creature are also visible for not alive player. Allow gossip interaction if npcflag allow?
+ CREATURE_TYPE_FLAG_BOSS_MOB = 0x00000004, // Changes creature's visible level to "??" in the creature's portrait - Immune Knockback.
+ CREATURE_TYPE_FLAG_DO_NOT_PLAY_WOUND_PARRY_ANIMATION = 0x00000008,
+ CREATURE_TYPE_FLAG_HIDE_FACTION_TOOLTIP = 0x00000010,
+ CREATURE_TYPE_FLAG_UNK5 = 0x00000020, // Sound related
+ CREATURE_TYPE_FLAG_SPELL_ATTACKABLE = 0x00000040,
+ CREATURE_TYPE_FLAG_CAN_INTERACT_WHILE_DEAD = 0x00000080, // Player can interact with the creature if its dead (not player dead)
+ CREATURE_TYPE_FLAG_HERB_SKINNING_SKILL = 0x00000100, // Can be looted by herbalist
+ CREATURE_TYPE_FLAG_MINING_SKINNING_SKILL = 0x00000200, // Can be looted by miner
+ CREATURE_TYPE_FLAG_DO_NOT_LOG_DEATH = 0x00000400, // Death event will not show up in combat log
+ CREATURE_TYPE_FLAG_MOUNTED_COMBAT_ALLOWED = 0x00000800, // Creature can remain mounted when entering combat
+ CREATURE_TYPE_FLAG_CAN_ASSIST = 0x00001000, // ? Can aid any player in combat if in range?
+ CREATURE_TYPE_FLAG_IS_PET_BAR_USED = 0x00002000,
+ CREATURE_TYPE_FLAG_MASK_UID = 0x00004000,
+ CREATURE_TYPE_FLAG_ENGINEERING_SKINNING_SKILL = 0x00008000, // Can be looted by engineer
+ CREATURE_TYPE_FLAG_EXOTIC_PET = 0x00010000, // Can be tamed by hunter as exotic pet
+ CREATURE_TYPE_FLAG_USE_DEFAULT_COLLISION_BOX = 0x00020000, // Collision related. (always using default collision box?)
+ CREATURE_TYPE_FLAG_IS_SIEGE_WEAPON = 0x00040000,
+ CREATURE_TYPE_FLAG_CAN_COLLIDE_WITH_MISSILES = 0x00080000, // Projectiles can collide with this creature - interacts with TARGET_DEST_TRAJ
+ CREATURE_TYPE_FLAG_HIDE_NAME_PLATE = 0x00100000,
+ CREATURE_TYPE_FLAG_DO_NOT_PLAY_MOUNTED_ANIMATIONS = 0x00200000,
+ CREATURE_TYPE_FLAG_IS_LINK_ALL = 0x00400000,
+ CREATURE_TYPE_FLAG_INTERACT_ONLY_WITH_CREATOR = 0x00800000,
+ CREATURE_TYPE_FLAG_DO_NOT_PLAY_UNIT_EVENT_SOUNDS = 0x01000000,
+ CREATURE_TYPE_FLAG_HAS_NO_SHADOW_BLOB = 0x02000000,
+ CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT = 0x04000000, // ! Creature can be targeted by spells that require target to be in caster's party/raid
+ CREATURE_TYPE_FLAG_FORCE_GOSSIP = 0x08000000, // Allows the creature to display a single gossip option.
+ CREATURE_TYPE_FLAG_DO_NOT_SHEATHE = 0x10000000,
+ CREATURE_TYPE_FLAG_DO_NOT_TARGET_ON_INTERACTION = 0x20000000,
+ CREATURE_TYPE_FLAG_DO_NOT_RENDER_OBJECT_NAME = 0x40000000,
+ CREATURE_TYPE_FLAG_UNIT_IS_QUEST_BOSS = 0x80000000 // Not verified
};
enum CreatureEliteType
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index 05948b987ad..26873451649 100644
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -193,7 +193,7 @@ void MotionMaster::MoveRandom(float spawndist)
{
if (_owner->GetTypeId() == TYPEID_UNIT)
{
- TC_LOG_DEBUG("misc", "Creature (GUID: %u) start moving random", _owner->GetGUID().GetCounter());
+ TC_LOG_DEBUG("misc", "Creature (GUID: %u) started random movement.", _owner->GetGUID().GetCounter());
Mutate(new RandomMovementGenerator<Creature>(spawndist), MOTION_SLOT_IDLE);
}
}
@@ -204,22 +204,22 @@ void MotionMaster::MoveTargetedHome()
if (_owner->GetTypeId() == TYPEID_UNIT && !_owner->ToCreature()->GetCharmerOrOwnerGUID())
{
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) targeted home", _owner->GetEntry(), _owner->GetGUID().GetCounter());
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) targeted home.", _owner->GetEntry(), _owner->GetGUID().GetCounter());
Mutate(new HomeMovementGenerator<Creature>(), MOTION_SLOT_ACTIVE);
}
else if (_owner->GetTypeId() == TYPEID_UNIT && _owner->ToCreature()->GetCharmerOrOwnerGUID())
{
- TC_LOG_DEBUG("misc", "Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUID().GetCounter());
+ TC_LOG_DEBUG("misc", "Pet or controlled creature (Entry: %u GUID: %u) is targeting home.", _owner->GetEntry(), _owner->GetGUID().GetCounter());
Unit* target = _owner->ToCreature()->GetCharmerOrOwner();
if (target)
{
- TC_LOG_DEBUG("misc", "Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUID().GetCounter() : ((Creature*)target)->GetSpawnId());
+ TC_LOG_DEBUG("misc", "Following %s (GUID: %u).", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUID().GetCounter() : ((Creature*)target)->GetSpawnId());
Mutate(new FollowMovementGenerator<Creature>(target, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE);
}
}
else
{
- TC_LOG_ERROR("misc", "Player (GUID: %u) attempt targeted home", _owner->GetGUID().GetCounter());
+ TC_LOG_ERROR("misc", "Player (GUID: %u) attempted to move towards target home.", _owner->GetGUID().GetCounter());
}
}
@@ -241,7 +241,7 @@ void MotionMaster::MoveConfused()
void MotionMaster::MoveChase(Unit* target, float dist, float angle)
{
// ignore movement request if target not exist
- if (!target || target == _owner || _owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
+ if (!target || target == _owner)
return;
//_owner->ClearUnitState(UNIT_STATE_FOLLOW);
@@ -266,20 +266,20 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle)
void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slot)
{
// ignore movement request if target not exist
- if (!target || target == _owner || _owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
+ if (!target || target == _owner)
return;
//_owner->AddUnitState(UNIT_STATE_FOLLOW);
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- TC_LOG_DEBUG("misc", "Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUID().GetCounter(),
+ TC_LOG_DEBUG("misc", "Player (GUID: %u) follows %s (GUID: %u).", _owner->GetGUID().GetCounter(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUID().GetCounter() : target->ToCreature()->GetSpawnId());
Mutate(new FollowMovementGenerator<Player>(target, dist, angle), slot);
}
else
{
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)",
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) follows %s (GUID: %u).",
_owner->GetEntry(), _owner->GetGUID().GetCounter(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUID().GetCounter() : target->ToCreature()->GetSpawnId());
@@ -291,23 +291,44 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generate
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- TC_LOG_DEBUG("misc", "Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUID().GetCounter(), id, x, y, z);
+ TC_LOG_DEBUG("misc", "Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f).", _owner->GetGUID().GetCounter(), id, x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, generatePath), MOTION_SLOT_ACTIVE);
}
else
{
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)",
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f).",
_owner->GetEntry(), _owner->GetGUID().GetCounter(), id, x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, generatePath), MOTION_SLOT_ACTIVE);
}
}
+void MotionMaster::MoveCloserAndStop(uint32 id, Unit* target, float distance)
+{
+ float distanceToTravel = _owner->GetExactDist2d(target) - distance;
+ if (distanceToTravel > 0.0f)
+ {
+ float angle = _owner->GetAngle(target);
+ float destx = _owner->GetPositionX() + distanceToTravel * std::cos(angle);
+ float desty = _owner->GetPositionY() + distanceToTravel * std::sin(angle);
+ MovePoint(id, destx, desty, target->GetPositionZ());
+ }
+ else
+ {
+ // we are already close enough. We just need to turn toward the target without changing position.
+ Movement::MoveSplineInit init(_owner);
+ init.MoveTo(_owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZMinusOffset());
+ init.SetFacing(target);
+ init.Launch();
+ Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
+ }
+}
+
void MotionMaster::MoveLand(uint32 id, Position const& pos)
{
float x, y, z;
pos.GetPosition(x, y, z);
- TC_LOG_DEBUG("misc", "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z);
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f).", _owner->GetEntry(), id, x, y, z);
Movement::MoveSplineInit init(_owner);
init.MoveTo(x, y, z);
@@ -321,7 +342,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos)
float x, y, z;
pos.GetPosition(x, y, z);
- TC_LOG_DEBUG("misc", "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z);
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f).", _owner->GetEntry(), id, x, y, z);
Movement::MoveSplineInit init(_owner);
init.MoveTo(x, y, z);
@@ -371,7 +392,7 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
void MotionMaster::MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint32 id, bool hasOrientation /* = false*/)
{
- TC_LOG_DEBUG("misc", "Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUID().GetCounter(), x, y, z);
+ TC_LOG_DEBUG("misc", "Unit (GUID: %u) jumps to point (X: %f Y: %f Z: %f).", _owner->GetGUID().GetCounter(), x, y, z);
if (speedXY <= 0.1f)
return;
@@ -449,7 +470,7 @@ void MotionMaster::MoveFall(uint32 id /*=0*/)
float tz = _owner->GetMap()->GetHeight(_owner->GetPhaseMask(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ(), true, MAX_FALL_DISTANCE);
if (tz <= INVALID_HEIGHT)
{
- TC_LOG_DEBUG("misc", "MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).",
+ TC_LOG_DEBUG("misc", "MotionMaster::MoveFall: unable to retrieve a proper height at map %u (x: %f, y: %f, z: %f).",
_owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ());
return;
}
@@ -458,11 +479,12 @@ void MotionMaster::MoveFall(uint32 id /*=0*/)
if (std::fabs(_owner->GetPositionZ() - tz) < 0.1f)
return;
+ _owner->AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
+ _owner->m_movementInfo.SetFallTime(0);
+
+ // don't run spline movement for players
if (_owner->GetTypeId() == TYPEID_PLAYER)
- {
- _owner->AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
- _owner->m_movementInfo.SetFallTime(0);
- }
+ return;
Movement::MoveSplineInit init(_owner);
init.MoveTo(_owner->GetPositionX(), _owner->GetPositionY(), tz, false);
@@ -478,12 +500,12 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed /*= SPEED_C
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- TC_LOG_DEBUG("misc", "Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetGUID().GetCounter(), x, y, z);
+ TC_LOG_DEBUG("misc", "Player (GUID: %u) charged point (X: %f Y: %f Z: %f).", _owner->GetGUID().GetCounter(), x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, generatePath, speed), MOTION_SLOT_CONTROLLED);
}
else
{
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)",
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) charged point (X: %f Y: %f Z: %f).",
_owner->GetEntry(), _owner->GetGUID().GetCounter(), x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, generatePath, speed), MOTION_SLOT_CONTROLLED);
}
@@ -506,13 +528,14 @@ void MotionMaster::MoveSeekAssistance(float x, float y, float z)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- TC_LOG_ERROR("misc", "Player (GUID: %u) attempt to seek assistance", _owner->GetGUID().GetCounter());
+ TC_LOG_ERROR("misc", "Player (GUID: %u) attempted to seek assistance.", _owner->GetGUID().GetCounter());
}
else
{
TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)",
_owner->GetEntry(), _owner->GetGUID().GetCounter(), x, y, z);
_owner->AttackStop();
+ _owner->CastStop();
_owner->ToCreature()->SetReactState(REACT_PASSIVE);
Mutate(new AssistanceMovementGenerator(x, y, z), MOTION_SLOT_ACTIVE);
}
@@ -522,11 +545,11 @@ void MotionMaster::MoveSeekAssistanceDistract(uint32 time)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- TC_LOG_ERROR("misc", "Player (GUID: %u) attempt to call distract after assistance", _owner->GetGUID().GetCounter());
+ TC_LOG_ERROR("misc", "Player (GUID: %u) attempted to call distract assistance.", _owner->GetGUID().GetCounter());
}
else
{
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)",
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u).",
_owner->GetEntry(), _owner->GetGUID().GetCounter(), time);
Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE);
}
@@ -539,14 +562,14 @@ void MotionMaster::MoveFleeing(Unit* enemy, uint32 time)
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- TC_LOG_DEBUG("misc", "Player (GUID: %u) flee from %s (GUID: %u)", _owner->GetGUID().GetCounter(),
+ TC_LOG_DEBUG("misc", "Player (GUID: %u) flees from %s (GUID: %u).", _owner->GetGUID().GetCounter(),
enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUID().GetCounter() : enemy->ToCreature()->GetSpawnId());
Mutate(new FleeingMovementGenerator<Player>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED);
}
else
{
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s",
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) flees from %s (GUID: %u)%s.",
_owner->GetEntry(), _owner->GetGUID().GetCounter(),
enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUID().GetCounter() : enemy->ToCreature()->GetSpawnId(),
@@ -564,20 +587,20 @@ void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode)
{
if (path < sTaxiPathNodesByPath.size())
{
- TC_LOG_DEBUG("misc", "%s taxi to (Path %u node %u)", _owner->GetName().c_str(), path, pathnode);
+ TC_LOG_DEBUG("misc", "%s taxi to (Path %u node %u).", _owner->GetName().c_str(), path, pathnode);
FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(pathnode);
mgen->LoadPath(_owner->ToPlayer());
Mutate(mgen, MOTION_SLOT_CONTROLLED);
}
else
{
- TC_LOG_ERROR("misc", "%s attempt taxi to (not existed Path %u node %u)",
+ TC_LOG_ERROR("misc", "%s attempted taxi to (non-existing Path %u node %u).",
_owner->GetName().c_str(), path, pathnode);
}
}
else
{
- TC_LOG_ERROR("misc", "Creature (Entry: %u GUID: %u) attempt taxi to (Path %u node %u)",
+ TC_LOG_ERROR("misc", "Creature (Entry: %u GUID: %u) attempted taxi to (Path %u node %u).",
_owner->GetEntry(), _owner->GetGUID().GetCounter(), path, pathnode);
}
}
@@ -589,11 +612,11 @@ void MotionMaster::MoveDistract(uint32 timer)
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- TC_LOG_DEBUG("misc", "Player (GUID: %u) distracted (timer: %u)", _owner->GetGUID().GetCounter(), timer);
+ TC_LOG_DEBUG("misc", "Player (GUID: %u) distracted (timer: %u).", _owner->GetGUID().GetCounter(), timer);
}
else
{
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) (timer: %u)",
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) distracted (timer: %u)",
_owner->GetEntry(), _owner->GetGUID().GetCounter(), timer);
}
@@ -645,7 +668,7 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable)
//Mutate(new WaypointMovementGenerator<Player>(path_id, repeatable)):
Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable), MOTION_SLOT_IDLE);
- TC_LOG_DEBUG("misc", "%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
+ TC_LOG_DEBUG("misc", "%s (GUID: %u) starts moving over path(Id:%u, repeatable: %s).",
_owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature",
_owner->GetGUID().GetCounter(), path_id, repeatable ? "YES" : "NO");
}
diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h
index 76ae12986d5..005f10b44af 100644
--- a/src/server/game/Movement/MotionMaster.h
+++ b/src/server/game/Movement/MotionMaster.h
@@ -79,7 +79,7 @@ enum RotateDirection
// assume it is 25 yard per 0.6 second
#define SPEED_CHARGE 42.0f
-class MotionMaster //: private std::stack<MovementGenerator *>
+class TC_GAME_API MotionMaster //: private std::stack<MovementGenerator *>
{
private:
//typedef std::stack<MovementGenerator *> Impl;
@@ -173,6 +173,12 @@ class MotionMaster //: private std::stack<MovementGenerator *>
{ MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, generatePath); }
void MovePoint(uint32 id, float x, float y, float z, bool generatePath = true);
+ /* Makes the unit move toward the target until it is at a certain distance from it. The unit then stops.
+ Only works in 2D.
+ This method doesn't account for any movement done by the target. in other words, it only works if the target is stationary.
+ */
+ void MoveCloserAndStop(uint32 id, Unit* target, float distance);
+
// These two movement types should only be used with creatures having landing/takeoff animations
void MoveLand(uint32 id, Position const& pos);
void MoveTakeoff(uint32 id, Position const& pos);
diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h
index 56e5dc7058a..d9dd17fabc2 100755
--- a/src/server/game/Movement/MovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerator.h
@@ -27,7 +27,7 @@
class Unit;
-class MovementGenerator
+class TC_GAME_API MovementGenerator
{
public:
virtual ~MovementGenerator();
diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
index 108276c951a..6f6a8037d47 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
@@ -23,11 +23,6 @@
#include "MoveSpline.h"
#include "Player.h"
-#ifdef MAP_BASED_RAND_GEN
-#define rand_norm() unit.rand_norm()
-#define urand(a, b) unit.urand(a, b)
-#endif
-
template<class T>
void ConfusedMovementGenerator<T>::DoInitialize(T* unit)
{
diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
index 6cdd29986bb..4cf896c6d98 100644
--- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
@@ -38,6 +38,12 @@ void FleeingMovementGenerator<T>::_setTargetLocation(T* owner)
if (owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
return;
+ if (owner->HasUnitState(UNIT_STATE_CASTING) && !owner->CanMoveDuringChannel())
+ {
+ owner->CastStop();
+ return;
+ }
+
owner->AddUnitState(UNIT_STATE_FLEEING_MOVE);
float x, y, z;
diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
index 9aa778c5651..161f9e3e970 100755
--- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h
@@ -32,7 +32,7 @@ class IdleMovementGenerator : public MovementGenerator
MovementGeneratorType GetMovementGeneratorType() const override { return IDLE_MOTION_TYPE; }
};
-extern IdleMovementGenerator si_idleMovement;
+TC_GAME_API extern IdleMovementGenerator si_idleMovement;
class RotateMovementGenerator : public MovementGenerator
{
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
index 2e013c44ae8..feea0ce734d 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -26,13 +26,15 @@
#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV"
-#ifdef MAP_BASED_RAND_GEN
-#define rand_norm() creature.rand_norm()
-#endif
-
template<>
void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
{
+ if (creature->HasUnitState(UNIT_STATE_CASTING) && !creature->CanMoveDuringChannel())
+ {
+ creature->CastStop();
+ return;
+ }
+
float respX, respY, respZ, respO, destX, destY, destZ, travelDistZ;
creature->GetHomePosition(respX, respY, respZ, respO);
Map const* map = creature->GetBaseMap();
@@ -61,7 +63,7 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
// Limit height change
const float distanceZ = float(rand_norm()) * travelDistZ/2.0f;
destZ = respZ + distanceZ;
- float levelZ = map->GetWaterOrGroundLevel(destX, destY, destZ-2.0f);
+ float levelZ = map->GetWaterOrGroundLevel(creature->GetPhaseMask(), destX, destY, destZ-2.5f);
// Problem here, we must fly above the ground and water, not under. Let's try on next tick
if (levelZ >= destZ)
@@ -145,6 +147,9 @@ void RandomMovementGenerator<Creature>::DoFinalize(Creature* creature)
template<>
bool RandomMovementGenerator<Creature>::DoUpdate(Creature* creature, const uint32 diff)
{
+ if (!creature || !creature->IsAlive())
+ return false;
+
if (creature->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
{
i_nextMoveTime.Reset(0); // Expire the timer
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
index b595059557a..2a95952d793 100644
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -36,8 +36,14 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool up
if (owner->HasUnitState(UNIT_STATE_NOT_MOVE))
return;
+ if (owner->HasUnitState(UNIT_STATE_CASTING) && !owner->CanMoveDuringChannel())
+ return;
+
if (owner->GetTypeId() == TYPEID_UNIT && !i_target->isInAccessiblePlaceFor(owner->ToCreature()))
+ {
+ owner->ToCreature()->SetCannotReachTarget(true);
return;
+ }
if (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsFocusing(nullptr, true))
return;
@@ -48,6 +54,9 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool up
{
if (!i_offset)
{
+ if (i_target->IsWithinDistInMap(owner, CONTACT_DISTANCE))
+ return;
+
// to nearest contact position
i_target->GetContactPoint(owner, x, y, z);
}
@@ -64,8 +73,8 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool up
// doing a "dance" while fighting
if (owner->IsPet() && i_target->GetTypeId() == TYPEID_PLAYER)
{
- dist = i_target->GetCombatReach();
- size = i_target->GetCombatReach() - i_target->GetObjectSize();
+ dist = 1.0f; //i_target->GetCombatReach();
+ size = 1.0f; //i_target->GetCombatReach() - i_target->GetObjectSize();
}
else
{
@@ -99,8 +108,10 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool up
bool result = i_path->CalculatePath(x, y, z, forceDest);
if (!result || (i_path->GetPathType() & PATHFIND_NOPATH))
{
- // Cant reach target
+ // can't reach target
i_recalculateTravel = true;
+ if (owner->GetTypeId() == TYPEID_UNIT)
+ owner->ToCreature()->SetCannotReachTarget(true);
return;
}
@@ -108,6 +119,8 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool up
i_targetReached = false;
i_recalculateTravel = false;
owner->AddUnitState(UNIT_STATE_CHASE);
+ if (owner->GetTypeId() == TYPEID_UNIT)
+ owner->ToCreature()->SetCannotReachTarget(false);
Movement::MoveSplineInit init(owner);
init.MovebyPath(i_path->GetPath());
@@ -136,7 +149,7 @@ bool TargetedMovementGeneratorMedium<T, D>::DoUpdate(T* owner, uint32 time_diff)
}
// prevent movement while casting spells with cast time or channel time
- if (owner->HasUnitState(UNIT_STATE_CASTING))
+ if (owner->HasUnitState(UNIT_STATE_CASTING) && !owner->CanMoveDuringChannel())
{
if (!owner->IsStopped())
owner->StopMoving();
@@ -155,8 +168,15 @@ bool TargetedMovementGeneratorMedium<T, D>::DoUpdate(T* owner, uint32 time_diff)
if (i_recheckDistance.Passed())
{
i_recheckDistance.Reset(100);
+
//More distance let have better performance, less distance let have more sensitive reaction at target move.
- float allowed_dist = owner->GetCombatReach() + sWorld->getRate(RATE_TARGET_POS_RECALCULATION_RANGE);
+ float allowed_dist = 0.0f;
+
+ if (owner->IsPet() && (owner->GetCharmerOrOwnerGUID() == i_target->GetGUID()))
+ allowed_dist = 1.0f; // pet following owner
+ else
+ allowed_dist = owner->GetCombatReach() + sWorld->getRate(RATE_TARGET_POS_RECALCULATION_RANGE);
+
G3D::Vector3 dest = owner->movespline->FinalDestination();
if (owner->movespline->onTransport)
if (TransportBase* transport = owner->GetDirectTransport())
@@ -198,6 +218,8 @@ void ChaseMovementGenerator<T>::_reachTarget(T* owner)
{
if (owner->IsWithinMeleeRange(this->i_target.getTarget()))
owner->Attack(this->i_target.getTarget(), true);
+ if (owner->GetTypeId() == TYPEID_UNIT)
+ owner->ToCreature()->SetCannotReachTarget(false);
}
template<>
@@ -265,9 +287,9 @@ void FollowMovementGenerator<Creature>::_updateSpeed(Creature* owner)
if (!owner->IsPet() || !owner->IsInWorld() || !i_target.isValid() || i_target->GetGUID() != owner->GetOwnerGUID())
return;
- owner->UpdateSpeed(MOVE_RUN, true);
- owner->UpdateSpeed(MOVE_WALK, true);
- owner->UpdateSpeed(MOVE_SWIM, true);
+ owner->UpdateSpeed(MOVE_RUN);
+ owner->UpdateSpeed(MOVE_WALK);
+ owner->UpdateSpeed(MOVE_SWIM);
}
template<>
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
index 7103eaace55..9250b666484 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
@@ -50,7 +50,7 @@ class TargetedMovementGeneratorMedium : public MovementGeneratorMedium< T, D >,
bool DoUpdate(T*, uint32);
Unit* GetTarget() const { return i_target.getTarget(); }
- void unitSpeedChanged() { i_recalculateTravel = true; }
+ void unitSpeedChanged() override { i_recalculateTravel = true; }
bool IsReachable() const { return (i_path) ? (i_path->GetPathType() & PATHFIND_NORMAL) : true; }
protected:
void _setTargetLocation(T* owner, bool updateDestination);
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
index 48d29b3259b..2ffa1a644eb 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
@@ -213,7 +213,7 @@ bool WaypointMovementGenerator<Creature>::DoUpdate(Creature* creature, uint32 di
creature->SetHomePosition(creature->GetPosition());
if (creature->IsStopped())
- Stop(STOP_TIME_FOR_PLAYER);
+ Stop(sWorld->getIntConfig(CONFIG_CREATURE_STOP_FOR_PLAYER));
else if (creature->movespline->Finalized())
{
OnArrived(creature);
@@ -315,7 +315,7 @@ void FlightPathMovementGenerator::DoFinalize(Player* player)
player->ClearUnitState(UNIT_STATE_IN_FLIGHT);
player->Dismount();
- player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
+ player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);
if (player->m_taxi.empty())
{
@@ -335,7 +335,7 @@ void FlightPathMovementGenerator::DoReset(Player* player)
{
player->getHostileRefManager().setOnlineOfflineState(false);
player->AddUnitState(UNIT_STATE_IN_FLIGHT);
- player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
+ player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);
Movement::MoveSplineInit init(player);
uint32 end = GetPathAtMapEnd();
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
index 1dd4611d53b..72309822dab 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
@@ -28,9 +28,9 @@
#include "MovementGenerator.h"
#include "WaypointManager.h"
#include "Player.h"
+#include "World.h"
#define FLIGHT_TRAVEL_UPDATE 100
-#define STOP_TIME_FOR_PLAYER 3 * MINUTE * IN_MILLISECONDS // 3 Minutes
#define TIMEDIFF_NEXT_WP 250
template<class T, class P>
diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp
index 3b4f19adb0b..3f8e7d44ff2 100644
--- a/src/server/game/Movement/PathGenerator.cpp
+++ b/src/server/game/Movement/PathGenerator.cpp
@@ -25,6 +25,7 @@
#include "DisableMgr.h"
#include "DetourCommon.h"
#include "DetourNavMeshQuery.h"
+#include "Metric.h"
////////////////// PathGenerator //////////////////
PathGenerator::PathGenerator(const Unit* owner) :
@@ -61,6 +62,8 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo
if (!Trinity::IsValidMapCoord(destX, destY, destZ) || !Trinity::IsValidMapCoord(x, y, z))
return false;
+ TC_METRIC_EVENT("mmap_events", "CalculatePath", "");
+
G3D::Vector3 dest(destX, destY, destZ);
SetEndPosition(dest);
@@ -939,3 +942,8 @@ void PathGenerator::ReducePathLenghtByDist(float dist)
nextVec = currVec; // we're going backwards
}
}
+
+bool PathGenerator::IsInvalidDestinationZ(Unit const* target) const
+{
+ return (target->GetPositionZ() - GetActualEndPosition().z) > 5.0f;
+}
diff --git a/src/server/game/Movement/PathGenerator.h b/src/server/game/Movement/PathGenerator.h
index 71e0e88f0b2..a3e88b8a705 100644
--- a/src/server/game/Movement/PathGenerator.h
+++ b/src/server/game/Movement/PathGenerator.h
@@ -49,7 +49,7 @@ enum PathType
PATHFIND_SHORT = 0x20, // path is longer or equal to its limited path length
};
-class PathGenerator
+class TC_GAME_API PathGenerator
{
public:
explicit PathGenerator(Unit const* owner);
@@ -58,6 +58,7 @@ class PathGenerator
// Calculate the path from owner to given destination
// return: true if new path was calculated, false otherwise (no change needed)
bool CalculatePath(float destX, float destY, float destZ, bool forceDest = false, bool straightLine = false);
+ bool IsInvalidDestinationZ(Unit const* target) const;
// option setters - use optional
void SetUseStraightPath(bool useStraightPath) { _useStraightPath = useStraightPath; }
diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp
index d8173aab331..991a4eacd29 100644
--- a/src/server/game/Movement/Spline/MoveSpline.cpp
+++ b/src/server/game/Movement/Spline/MoveSpline.cpp
@@ -206,7 +206,7 @@ bool MoveSplineInitArgs::Validate(Unit* unit) const
return false;\
}
CHECK(path.size() > 1);
- CHECK(velocity > 0.1f);
+ CHECK(velocity > 0.01f);
CHECK(time_perc >= 0.f && time_perc <= 1.f);
//CHECK(_checkPathBounds());
return true;
diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h
index 209f978d658..0e62862cecc 100644
--- a/src/server/game/Movement/Spline/MoveSpline.h
+++ b/src/server/game/Movement/Spline/MoveSpline.h
@@ -37,7 +37,7 @@ namespace Movement
// MoveSpline represents smooth catmullrom or linear curve and point that moves belong it
// curve can be cyclic - in this case movement will be cyclic
// point can have vertical acceleration motion componemt(used in fall, parabolic movement)
- class MoveSpline
+ class TC_GAME_API MoveSpline
{
public:
typedef Spline<int32> MySpline;
diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h
index a94c84d92f3..3f38da97916 100644
--- a/src/server/game/Movement/Spline/MoveSplineInit.h
+++ b/src/server/game/Movement/Spline/MoveSplineInit.h
@@ -35,7 +35,7 @@ namespace Movement
};
// Transforms coordinates from global to transport offsets
- class TransportPathTransform
+ class TC_GAME_API TransportPathTransform
{
public:
TransportPathTransform(Unit* owner, bool transformForTransport)
@@ -49,7 +49,7 @@ namespace Movement
/* Initializes and launches spline movement
*/
- class MoveSplineInit
+ class TC_GAME_API MoveSplineInit
{
public:
diff --git a/src/server/game/Movement/Spline/MovementTypedefs.h b/src/server/game/Movement/Spline/MovementTypedefs.h
index 031ec729949..c87fea47a82 100644
--- a/src/server/game/Movement/Spline/MovementTypedefs.h
+++ b/src/server/game/Movement/Spline/MovementTypedefs.h
@@ -69,8 +69,8 @@ namespace Movement
typedef counter<uint32, 0xFFFFFFFF> UInt32Counter;
- extern float gravity;
- extern UInt32Counter splineIdGen;
+ TC_GAME_API extern float gravity;
+ TC_GAME_API extern UInt32Counter splineIdGen;
}
#endif // TRINITYSERVER_TYPEDEFS_H
diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp
index e0639e38e77..dc935263927 100644
--- a/src/server/game/Movement/Waypoints/WaypointManager.cpp
+++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp
@@ -94,6 +94,12 @@ void WaypointMgr::Load()
TC_LOG_INFO("server.loading", ">> Loaded %u waypoints in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
+WaypointMgr* WaypointMgr::instance()
+{
+ static WaypointMgr instance;
+ return &instance;
+}
+
void WaypointMgr::ReloadPath(uint32 id)
{
WaypointPathContainer::iterator itr = _waypointStore.find(id);
diff --git a/src/server/game/Movement/Waypoints/WaypointManager.h b/src/server/game/Movement/Waypoints/WaypointManager.h
index d519eee4793..63dc4184308 100644
--- a/src/server/game/Movement/Waypoints/WaypointManager.h
+++ b/src/server/game/Movement/Waypoints/WaypointManager.h
@@ -44,14 +44,10 @@ struct WaypointData
typedef std::vector<WaypointData*> WaypointPath;
typedef std::unordered_map<uint32, WaypointPath> WaypointPathContainer;
-class WaypointMgr
+class TC_GAME_API WaypointMgr
{
public:
- static WaypointMgr* instance()
- {
- static WaypointMgr instance;
- return &instance;
- }
+ static WaypointMgr* instance();
// Attempts to reload a single path from database
void ReloadPath(uint32 id);
diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
index d329ab27de9..1343e0966c1 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
@@ -95,7 +95,7 @@ void OPvPCapturePoint::AddGO(uint32 type, ObjectGuid::LowType guid, uint32 entry
entry = data->id;
}
- m_Objects[type] = ObjectGuid(HighGuid::GameObject, entry, guid);
+ m_Objects[type] = guid;
m_ObjectTypes[m_Objects[type]] = type;
}
@@ -109,7 +109,7 @@ void OPvPCapturePoint::AddCre(uint32 type, ObjectGuid::LowType guid, uint32 entr
entry = data->id;
}
- m_Creatures[type] = ObjectGuid(HighGuid::Unit, entry, guid);
+ m_Creatures[type] = guid;
m_CreatureTypes[m_Creatures[type]] = type;
}
@@ -190,7 +190,8 @@ bool OPvPCapturePoint::DelCreature(uint32 type)
// delete respawn time for this creature
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN);
stmt->setUInt32(0, spawnId);
- stmt->setUInt16(1, m_PvP->GetMap()->GetId()); stmt->setUInt32(2, 0); // instance id, always 0 for world maps
+ stmt->setUInt16(1, m_PvP->GetMap()->GetId());
+ stmt->setUInt32(2, 0); // instance id, always 0 for world maps
CharacterDatabase.Execute(stmt);
sObjectMgr->DeleteCreatureData(spawnId);
@@ -236,9 +237,9 @@ bool OPvPCapturePoint::DelCapturePoint()
void OPvPCapturePoint::DeleteSpawns()
{
- for (std::map<uint32, uint32>::iterator i = m_Objects.begin(); i != m_Objects.end(); ++i)
+ for (std::map<uint32, ObjectGuid::LowType>::iterator i = m_Objects.begin(); i != m_Objects.end(); ++i)
DelObject(i->first);
- for (std::map<uint32, uint32>::iterator i = m_Creatures.begin(); i != m_Creatures.end(); ++i)
+ for (std::map<uint32, ObjectGuid::LowType>::iterator i = m_Creatures.begin(); i != m_Creatures.end(); ++i)
DelCreature(i->first);
DelCapturePoint();
}
@@ -581,7 +582,7 @@ bool OPvPCapturePoint::HandleDropFlag(Player* /*player*/, uint32 /*id*/)
int32 OPvPCapturePoint::HandleOpenGo(Player* /*player*/, GameObject* go)
{
- std::map<uint32, uint32>::iterator itr = m_ObjectTypes.find(go->GetSpawnId());
+ std::map<ObjectGuid::LowType, uint32>::iterator itr = m_ObjectTypes.find(go->GetSpawnId());
if (itr != m_ObjectTypes.end())
return itr->second;
@@ -596,7 +597,7 @@ bool OutdoorPvP::HandleAreaTrigger(Player* /*player*/, uint32 /*trigger*/)
void OutdoorPvP::BroadcastPacket(WorldPacket &data) const
{
// This is faster than sWorld->SendZoneMessage
- for (uint32 team = 0; team < 2; ++team)
+ for (uint32 team = 0; team < BG_TEAMS_COUNT; ++team)
for (GuidSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
if (Player* const player = ObjectAccessor::FindPlayer(*itr))
player->GetSession()->SendPacket(&data);
diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h
index 79f34ff10ea..255f3cd0f99 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvP.h
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.h
@@ -84,7 +84,7 @@ class Unit;
struct GossipMenuItems;
class OutdoorPvP;
-class OPvPCapturePoint
+class TC_GAME_API OPvPCapturePoint
{
public:
@@ -185,7 +185,7 @@ class OPvPCapturePoint
};
// base class for specific outdoor pvp handlers
-class OutdoorPvP : public ZoneScript
+class TC_GAME_API OutdoorPvP : public ZoneScript
{
friend class OutdoorPvPMgr;
diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
index 8296cdfb7ea..aa00d211d6e 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
@@ -33,8 +33,20 @@ void OutdoorPvPMgr::Die()
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
delete *itr;
+ m_OutdoorPvPSet.clear();
+
for (OutdoorPvPDataMap::iterator itr = m_OutdoorPvPDatas.begin(); itr != m_OutdoorPvPDatas.end(); ++itr)
delete itr->second;
+
+ m_OutdoorPvPDatas.clear();
+
+ m_OutdoorPvPMap.clear();
+}
+
+OutdoorPvPMgr* OutdoorPvPMgr::instance()
+{
+ static OutdoorPvPMgr instance;
+ return &instance;
}
void OutdoorPvPMgr::InitOutdoorPvP()
diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
index 8a113987882..e53a78ac271 100644
--- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
+++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h
@@ -35,18 +35,14 @@ struct OutdoorPvPData
};
// class to handle player enter / leave / areatrigger / GO use events
-class OutdoorPvPMgr
+class TC_GAME_API OutdoorPvPMgr
{
private:
OutdoorPvPMgr();
~OutdoorPvPMgr() { };
public:
- static OutdoorPvPMgr* instance()
- {
- static OutdoorPvPMgr instance;
- return &instance;
- }
+ static OutdoorPvPMgr* instance();
// create outdoor pvp events
void InitOutdoorPvP();
diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp
index 12fb8a06b62..812d8ea3940 100644
--- a/src/server/game/Pools/PoolMgr.cpp
+++ b/src/server/game/Pools/PoolMgr.cpp
@@ -60,6 +60,11 @@ bool ActivePoolData::IsActiveObject<Quest>(uint32 quest_id) const
return mActiveQuests.find(quest_id) != mActiveQuests.end();
}
+template TC_GAME_API bool ActivePoolData::IsActiveObject<Creature>(uint32) const;
+template TC_GAME_API bool ActivePoolData::IsActiveObject<GameObject>(uint32) const;
+template TC_GAME_API bool ActivePoolData::IsActiveObject<Pool>(uint32) const;
+template TC_GAME_API bool ActivePoolData::IsActiveObject<Quest>(uint32) const;
+
template<>
void ActivePoolData::ActivateObject<Creature>(uint32 db_guid, uint32 pool_id)
{
@@ -570,6 +575,12 @@ void PoolMgr::Initialize()
mCreatureSearchMap.clear();
}
+PoolMgr* PoolMgr::instance()
+{
+ static PoolMgr instance;
+ return &instance;
+}
+
void PoolMgr::LoadFromDB()
{
// Pool templates
diff --git a/src/server/game/Pools/PoolMgr.h b/src/server/game/Pools/PoolMgr.h
index 51e0bcb4cac..f1af3a3530e 100644
--- a/src/server/game/Pools/PoolMgr.h
+++ b/src/server/game/Pools/PoolMgr.h
@@ -43,7 +43,7 @@ class Pool // for Pool of Pool
typedef std::set<ObjectGuid::LowType> ActivePoolObjects;
typedef std::map<uint32, uint32> ActivePoolPools;
-class ActivePoolData
+class TC_GAME_API ActivePoolData
{
public:
template<typename T>
@@ -66,7 +66,7 @@ class ActivePoolData
};
template <class T>
-class PoolGroup
+class TC_GAME_API PoolGroup
{
typedef std::vector<PoolObject> PoolObjectList;
public:
@@ -101,18 +101,14 @@ typedef std::multimap<uint32, uint32> PooledQuestRelation;
typedef std::pair<PooledQuestRelation::const_iterator, PooledQuestRelation::const_iterator> PooledQuestRelationBounds;
typedef std::pair<PooledQuestRelation::iterator, PooledQuestRelation::iterator> PooledQuestRelationBoundsNC;
-class PoolMgr
+class TC_GAME_API PoolMgr
{
private:
PoolMgr();
~PoolMgr() { };
public:
- static PoolMgr* instance()
- {
- static PoolMgr instance;
- return &instance;
- }
+ static PoolMgr* instance();
void LoadFromDB();
void LoadQuestPools();
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index 4a4ee9bff9c..91a7b87eec7 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -132,7 +132,15 @@ Quest::Quest(Field* questRecord)
void Quest::LoadQuestDetails(Field* fields)
{
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
+ {
+ if (!sEmotesStore.LookupEntry(fields[1+i].GetUInt16()))
+ {
+ TC_LOG_ERROR("sql.sql", "Table `quest_details` has non-existing Emote%i (%u) set for quest %u. Skipped.", 1+i, fields[1+i].GetUInt16(), fields[0].GetUInt32());
+ continue;
+ }
+
DetailsEmote[i] = fields[1+i].GetUInt16();
+ }
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
DetailsEmoteDelay[i] = fields[5+i].GetUInt32();
@@ -142,13 +150,28 @@ void Quest::LoadQuestRequestItems(Field* fields)
{
EmoteOnComplete = fields[1].GetUInt16();
EmoteOnIncomplete = fields[2].GetUInt16();
+
+ if (!sEmotesStore.LookupEntry(EmoteOnComplete))
+ TC_LOG_ERROR("sql.sql", "Table `quest_request_items` has non-existing EmoteOnComplete (%u) set for quest %u.", EmoteOnComplete, fields[0].GetUInt32());
+
+ if (!sEmotesStore.LookupEntry(EmoteOnIncomplete))
+ TC_LOG_ERROR("sql.sql", "Table `quest_request_items` has non-existing EmoteOnIncomplete (%u) set for quest %u.", EmoteOnIncomplete, fields[0].GetUInt32());
+
RequestItemsText = fields[3].GetString();
}
void Quest::LoadQuestOfferReward(Field* fields)
{
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
+ {
+ if (!sEmotesStore.LookupEntry(fields[1+i].GetUInt16()))
+ {
+ TC_LOG_ERROR("sql.sql", "Table `quest_offer_reward` has non-existing Emote%i (%u) set for quest %u. Skipped.", 1+i, fields[1+i].GetUInt16(), fields[0].GetUInt32());
+ continue;
+ }
+
OfferRewardEmote[i] = fields[1+i].GetUInt16();
+ }
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmoteDelay[i] = fields[5+i].GetUInt32();
@@ -173,7 +196,8 @@ void Quest::LoadQuestTemplateAddon(Field* fields)
RequiredMinRepValue = fields[13].GetInt32();
RequiredMaxRepValue = fields[14].GetInt32();
StartItemCount = fields[15].GetUInt8();
- SpecialFlags = fields[16].GetUInt8();
+ RewardMailSenderEntry = fields[16].GetUInt32();
+ SpecialFlags = fields[17].GetUInt8();
if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT)
Flags |= QUEST_FLAGS_AUTO_ACCEPT;
@@ -254,6 +278,9 @@ bool Quest::IsRaidQuest(Difficulty difficulty) const
break;
}
+ if ((Flags & QUEST_FLAGS_RAID) != 0)
+ return true;
+
return false;
}
@@ -285,3 +312,10 @@ uint32 Quest::CalculateHonorGain(uint8 level) const
return honor;
}
+
+bool Quest::CanIncreaseRewardedQuestCounters() const
+{
+ // Dungeon Finder/Daily/Repeatable (if not weekly, monthly or seasonal) quests are never considered rewarded serverside.
+ // This affects counters and client requests for completed quests.
+ return (!IsDFQuest() && !IsDaily() && (!IsRepeatable() || IsWeekly() || IsMonthly() || IsSeasonal()));
+}
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index a502fef6140..dc6d22deab0 100644
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -60,7 +60,7 @@ enum QuestFailedReason
INVALIDREASON_DAILY_QUEST_COMPLETED_TODAY = 29 // You have completed that daily quest today.
};
-enum QuestShareMessages
+enum QuestShareMessages : uint8
{
QUEST_PARTY_MSG_SHARING_QUEST = 0,
QUEST_PARTY_MSG_CANT_TAKE_QUEST = 1,
@@ -134,7 +134,7 @@ enum QuestFlags
QUEST_FLAGS_SHARABLE = 0x00000008, // Can be shared: Player::CanShareQuest()
QUEST_FLAGS_HAS_CONDITION = 0x00000010, // Not used currently
QUEST_FLAGS_HIDE_REWARD_POI = 0x00000020, // Not used currently: Unsure of content
- QUEST_FLAGS_RAID = 0x00000040, // Not used currently
+ QUEST_FLAGS_RAID = 0x00000040, // Can be completed while in raid
QUEST_FLAGS_TBC = 0x00000080, // Not used currently: Available if TBC expansion enabled only
QUEST_FLAGS_NO_MONEY_FROM_XP = 0x00000100, // Not used currently: Experience is not converted to gold at max level
QUEST_FLAGS_HIDDEN_REWARDS = 0x00000200, // Items and money rewarded only sent in SMSG_QUESTGIVER_OFFER_REWARD (not in SMSG_QUESTGIVER_QUEST_DETAILS or in client quest log(SMSG_QUEST_QUERY_RESPONSE))
@@ -190,7 +190,7 @@ struct QuestLocale
// This Quest class provides a convenient way to access a few pretotaled (cached) quest details,
// all base quest information, and any utility functions such as generating the amount of
// xp to give
-class Quest
+class TC_GAME_API Quest
{
friend class ObjectMgr;
public:
@@ -257,6 +257,7 @@ class Quest
int32 GetRewSpellCast() const { return RewardSpell; }
uint32 GetRewMailTemplateId() const { return RewardMailTemplateId; }
uint32 GetRewMailDelaySecs() const { return RewardMailDelay; }
+ uint32 GetRewMailSenderEntry() const { return RewardMailSenderEntry; }
uint32 GetPOIContinent() const { return POIContinent; }
float GetPOIx() const { return POIx; }
float GetPOIy() const { return POIy; }
@@ -276,6 +277,7 @@ class Quest
bool IsAllowedInRaid(Difficulty difficulty) const;
bool IsDFQuest() const { return (SpecialFlags & QUEST_SPECIAL_FLAGS_DF_QUEST) != 0; }
uint32 CalculateHonorGain(uint8 level) const;
+ bool CanIncreaseRewardedQuestCounters() const;
// multiple values
std::string ObjectiveText[QUEST_OBJECTIVES_COUNT];
@@ -373,6 +375,7 @@ class Quest
uint32 RequiredMaxRepFaction = 0;
int32 RequiredMaxRepValue = 0;
uint32 StartItemCount = 0;
+ uint32 RewardMailSenderEntry = 0;
uint32 SpecialFlags = 0; // custom flags, not sniffed/WDB
};
diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h
index 6f319a39b0c..5a51c9eb383 100644
--- a/src/server/game/Reputation/ReputationMgr.h
+++ b/src/server/game/Reputation/ReputationMgr.h
@@ -61,7 +61,7 @@ typedef std::map<uint32, ReputationRank> ForcedReactions;
class Player;
-class ReputationMgr
+class TC_GAME_API ReputationMgr
{
public: // constructors and global modifiers
explicit ReputationMgr(Player* owner) : _player(owner),
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
deleted file mode 100644
index 2922e4ef58d..00000000000
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ /dev/null
@@ -1,1421 +0,0 @@
-/*
- * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ScriptLoader.h"
-#include "World.h"
-
-// spells
-void AddSC_deathknight_spell_scripts();
-void AddSC_druid_spell_scripts();
-void AddSC_generic_spell_scripts();
-void AddSC_hunter_spell_scripts();
-void AddSC_mage_spell_scripts();
-void AddSC_paladin_spell_scripts();
-void AddSC_priest_spell_scripts();
-void AddSC_rogue_spell_scripts();
-void AddSC_shaman_spell_scripts();
-void AddSC_warlock_spell_scripts();
-void AddSC_warrior_spell_scripts();
-void AddSC_quest_spell_scripts();
-void AddSC_item_spell_scripts();
-void AddSC_holiday_spell_scripts();
-
-void AddSC_SmartScripts();
-
-//Commands
-void AddSC_account_commandscript();
-void AddSC_achievement_commandscript();
-void AddSC_ahbot_commandscript();
-void AddSC_arena_commandscript();
-void AddSC_ban_commandscript();
-void AddSC_bf_commandscript();
-void AddSC_cast_commandscript();
-void AddSC_character_commandscript();
-void AddSC_cheat_commandscript();
-void AddSC_debug_commandscript();
-void AddSC_deserter_commandscript();
-void AddSC_disable_commandscript();
-void AddSC_event_commandscript();
-void AddSC_gm_commandscript();
-void AddSC_go_commandscript();
-void AddSC_gobject_commandscript();
-void AddSC_group_commandscript();
-void AddSC_guild_commandscript();
-void AddSC_honor_commandscript();
-void AddSC_instance_commandscript();
-void AddSC_learn_commandscript();
-void AddSC_lfg_commandscript();
-void AddSC_list_commandscript();
-void AddSC_lookup_commandscript();
-void AddSC_message_commandscript();
-void AddSC_misc_commandscript();
-void AddSC_mmaps_commandscript();
-void AddSC_modify_commandscript();
-void AddSC_npc_commandscript();
-void AddSC_pet_commandscript();
-void AddSC_quest_commandscript();
-void AddSC_rbac_commandscript();
-void AddSC_reload_commandscript();
-void AddSC_reset_commandscript();
-void AddSC_send_commandscript();
-void AddSC_server_commandscript();
-void AddSC_tele_commandscript();
-void AddSC_ticket_commandscript();
-void AddSC_titles_commandscript();
-void AddSC_wp_commandscript();
-
-#ifdef SCRIPTS
-//world
-void AddSC_areatrigger_scripts();
-void AddSC_emerald_dragons();
-void AddSC_generic_creature();
-void AddSC_go_scripts();
-void AddSC_guards();
-void AddSC_item_scripts();
-void AddSC_npc_professions();
-void AddSC_npc_innkeeper();
-void AddSC_npcs_special();
-void AddSC_achievement_scripts();
-void AddSC_action_ip_logger();
-void AddSC_duel_reset();
-
-//eastern kingdoms
-void AddSC_alterac_valley(); //Alterac Valley
-void AddSC_boss_balinda();
-void AddSC_boss_drekthar();
-void AddSC_boss_galvangar();
-void AddSC_boss_vanndar();
-void AddSC_blackrock_depths(); //Blackrock Depths
-void AddSC_boss_ambassador_flamelash();
-void AddSC_boss_draganthaurissan();
-void AddSC_boss_general_angerforge();
-void AddSC_boss_high_interrogator_gerstahn();
-void AddSC_boss_magmus();
-void AddSC_boss_moira_bronzebeard();
-void AddSC_boss_tomb_of_seven();
-void AddSC_instance_blackrock_depths();
-void AddSC_boss_drakkisath(); //Blackrock Spire
-void AddSC_boss_halycon();
-void AddSC_boss_highlordomokk();
-void AddSC_boss_mothersmolderweb();
-void AddSC_boss_overlordwyrmthalak();
-void AddSC_boss_shadowvosh();
-void AddSC_boss_thebeast();
-void AddSC_boss_warmastervoone();
-void AddSC_boss_quatermasterzigris();
-void AddSC_boss_pyroguard_emberseer();
-void AddSC_boss_gyth();
-void AddSC_boss_rend_blackhand();
-void AddSC_boss_gizrul_the_slavener();
-void AddSC_boss_urok_doomhowl();
-void AddSC_boss_lord_valthalak();
-void AddSC_instance_blackrock_spire();
-void AddSC_boss_razorgore(); //Blackwing lair
-void AddSC_boss_vaelastrasz();
-void AddSC_boss_broodlord();
-void AddSC_boss_firemaw();
-void AddSC_boss_ebonroc();
-void AddSC_boss_flamegor();
-void AddSC_boss_chromaggus();
-void AddSC_boss_nefarian();
-void AddSC_instance_blackwing_lair();
-void AddSC_deadmines(); //Deadmines
-void AddSC_instance_deadmines();
-void AddSC_boss_mr_smite();
-void AddSC_gnomeregan(); //Gnomeregan
-void AddSC_instance_gnomeregan();
-void AddSC_boss_attumen(); //Karazhan
-void AddSC_boss_curator();
-void AddSC_boss_maiden_of_virtue();
-void AddSC_boss_shade_of_aran();
-void AddSC_boss_malchezaar();
-void AddSC_boss_terestian_illhoof();
-void AddSC_boss_moroes();
-void AddSC_bosses_opera();
-void AddSC_boss_netherspite();
-void AddSC_instance_karazhan();
-void AddSC_karazhan();
-void AddSC_boss_nightbane();
-void AddSC_boss_felblood_kaelthas(); // Magister's Terrace
-void AddSC_boss_selin_fireheart();
-void AddSC_boss_vexallus();
-void AddSC_boss_priestess_delrissa();
-void AddSC_instance_magisters_terrace();
-void AddSC_magisters_terrace();
-void AddSC_boss_lucifron(); //Molten core
-void AddSC_boss_magmadar();
-void AddSC_boss_gehennas();
-void AddSC_boss_garr();
-void AddSC_boss_baron_geddon();
-void AddSC_boss_shazzrah();
-void AddSC_boss_golemagg();
-void AddSC_boss_sulfuron();
-void AddSC_boss_majordomo();
-void AddSC_boss_ragnaros();
-void AddSC_instance_molten_core();
-void AddSC_instance_ragefire_chasm(); //Ragefire Chasm
-void AddSC_the_scarlet_enclave(); //Scarlet Enclave
-void AddSC_the_scarlet_enclave_c1();
-void AddSC_the_scarlet_enclave_c2();
-void AddSC_the_scarlet_enclave_c5();
-void AddSC_boss_arcanist_doan(); //Scarlet Monastery
-void AddSC_boss_azshir_the_sleepless();
-void AddSC_boss_bloodmage_thalnos();
-void AddSC_boss_headless_horseman();
-void AddSC_boss_herod();
-void AddSC_boss_high_inquisitor_fairbanks();
-void AddSC_boss_houndmaster_loksey();
-void AddSC_boss_interrogator_vishas();
-void AddSC_boss_scorn();
-void AddSC_instance_scarlet_monastery();
-void AddSC_boss_mograine_and_whitemane();
-void AddSC_boss_darkmaster_gandling(); //Scholomance
-void AddSC_boss_death_knight_darkreaver();
-void AddSC_boss_theolenkrastinov();
-void AddSC_boss_illuciabarov();
-void AddSC_boss_instructormalicia();
-void AddSC_boss_jandicebarov();
-void AddSC_boss_kormok();
-void AddSC_boss_lordalexeibarov();
-void AddSC_boss_lorekeeperpolkelt();
-void AddSC_boss_rasfrost();
-void AddSC_boss_theravenian();
-void AddSC_boss_vectus();
-void AddSC_boss_kirtonos_the_herald();
-void AddSC_instance_scholomance();
-void AddSC_shadowfang_keep(); //Shadowfang keep
-void AddSC_instance_shadowfang_keep();
-void AddSC_boss_magistrate_barthilas(); //Stratholme
-void AddSC_boss_maleki_the_pallid();
-void AddSC_boss_nerubenkan();
-void AddSC_boss_cannon_master_willey();
-void AddSC_boss_baroness_anastari();
-void AddSC_boss_ramstein_the_gorger();
-void AddSC_boss_timmy_the_cruel();
-void AddSC_boss_postmaster_malown();
-void AddSC_boss_baron_rivendare();
-void AddSC_boss_dathrohan_balnazzar();
-void AddSC_boss_order_of_silver_hand();
-void AddSC_instance_stratholme();
-void AddSC_stratholme();
-void AddSC_sunken_temple(); // Sunken Temple
-void AddSC_instance_sunken_temple();
-void AddSC_instance_sunwell_plateau(); //Sunwell Plateau
-void AddSC_boss_kalecgos();
-void AddSC_boss_brutallus();
-void AddSC_boss_felmyst();
-void AddSC_boss_eredar_twins();
-void AddSC_boss_muru();
-void AddSC_boss_kiljaeden();
-void AddSC_sunwell_plateau();
-void AddSC_boss_archaedas(); //Uldaman
-void AddSC_boss_ironaya();
-void AddSC_uldaman();
-void AddSC_instance_uldaman();
-void AddSC_instance_the_stockade(); //The Stockade
-void AddSC_boss_akilzon(); //Zul'Aman
-void AddSC_boss_halazzi();
-void AddSC_boss_hex_lord_malacrass();
-void AddSC_boss_janalai();
-void AddSC_boss_nalorakk();
-void AddSC_boss_zuljin();
-void AddSC_instance_zulaman();
-void AddSC_zulaman();
-void AddSC_boss_jeklik(); //Zul'Gurub
-void AddSC_boss_venoxis();
-void AddSC_boss_marli();
-void AddSC_boss_mandokir();
-void AddSC_boss_gahzranka();
-void AddSC_boss_thekal();
-void AddSC_boss_arlokk();
-void AddSC_boss_jindo();
-void AddSC_boss_hakkar();
-void AddSC_boss_grilek();
-void AddSC_boss_hazzarah();
-void AddSC_boss_renataki();
-void AddSC_boss_wushoolay();
-void AddSC_instance_zulgurub();
-
-//void AddSC_alterac_mountains();
-void AddSC_arathi_highlands();
-void AddSC_blasted_lands();
-void AddSC_burning_steppes();
-void AddSC_duskwood();
-void AddSC_eastern_plaguelands();
-void AddSC_ghostlands();
-void AddSC_hinterlands();
-void AddSC_isle_of_queldanas();
-void AddSC_loch_modan();
-void AddSC_redridge_mountains();
-void AddSC_silverpine_forest();
-void AddSC_stormwind_city();
-void AddSC_stranglethorn_vale();
-void AddSC_swamp_of_sorrows();
-void AddSC_tirisfal_glades();
-void AddSC_undercity();
-void AddSC_western_plaguelands();
-void AddSC_wetlands();
-
-//kalimdor
-void AddSC_blackfathom_deeps(); //Blackfathom Depths
-void AddSC_boss_gelihast();
-void AddSC_boss_kelris();
-void AddSC_boss_aku_mai();
-void AddSC_instance_blackfathom_deeps();
-void AddSC_hyjal(); //CoT Battle for Mt. Hyjal
-void AddSC_boss_archimonde();
-void AddSC_instance_mount_hyjal();
-void AddSC_hyjal_trash();
-void AddSC_boss_rage_winterchill();
-void AddSC_boss_anetheron();
-void AddSC_boss_kazrogal();
-void AddSC_boss_azgalor();
-void AddSC_boss_captain_skarloc(); //CoT Old Hillsbrad
-void AddSC_boss_epoch_hunter();
-void AddSC_boss_lieutenant_drake();
-void AddSC_instance_old_hillsbrad();
-void AddSC_old_hillsbrad();
-void AddSC_boss_aeonus(); //CoT The Black Morass
-void AddSC_boss_chrono_lord_deja();
-void AddSC_boss_temporus();
-void AddSC_the_black_morass();
-void AddSC_instance_the_black_morass();
-void AddSC_boss_epoch(); //CoT Culling Of Stratholme
-void AddSC_boss_infinite_corruptor();
-void AddSC_boss_salramm();
-void AddSC_boss_mal_ganis();
-void AddSC_boss_meathook();
-void AddSC_culling_of_stratholme();
-void AddSC_instance_culling_of_stratholme();
-void AddSC_instance_dire_maul(); //Dire Maul
-void AddSC_boss_celebras_the_cursed(); //Maraudon
-void AddSC_boss_landslide();
-void AddSC_boss_noxxion();
-void AddSC_boss_ptheradras();
-void AddSC_instance_maraudon();
-void AddSC_boss_onyxia(); //Onyxia's Lair
-void AddSC_instance_onyxias_lair();
-void AddSC_boss_tuten_kash(); //Razorfen Downs
-void AddSC_boss_mordresh_fire_eye();
-void AddSC_boss_glutton();
-void AddSC_boss_amnennar_the_coldbringer();
-void AddSC_razorfen_downs();
-void AddSC_instance_razorfen_downs();
-void AddSC_razorfen_kraul(); //Razorfen Kraul
-void AddSC_instance_razorfen_kraul();
-void AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj
-void AddSC_boss_rajaxx();
-void AddSC_boss_moam();
-void AddSC_boss_buru();
-void AddSC_boss_ayamiss();
-void AddSC_boss_ossirian();
-void AddSC_instance_ruins_of_ahnqiraj();
-void AddSC_boss_cthun(); //Temple of ahn'qiraj
-void AddSC_boss_viscidus();
-void AddSC_boss_fankriss();
-void AddSC_boss_huhuran();
-void AddSC_bug_trio();
-void AddSC_boss_sartura();
-void AddSC_boss_skeram();
-void AddSC_boss_twinemperors();
-void AddSC_boss_ouro();
-void AddSC_npc_anubisath_sentinel();
-void AddSC_instance_temple_of_ahnqiraj();
-void AddSC_wailing_caverns(); //Wailing caverns
-void AddSC_instance_wailing_caverns();
-void AddSC_boss_zum_rah(); //Zul'Farrak
-void AddSC_zulfarrak();
-void AddSC_instance_zulfarrak();
-
-void AddSC_ashenvale();
-void AddSC_azshara();
-void AddSC_azuremyst_isle();
-void AddSC_bloodmyst_isle();
-void AddSC_boss_azuregos();
-void AddSC_darkshore();
-void AddSC_desolace();
-void AddSC_durotar();
-void AddSC_dustwallow_marsh();
-void AddSC_felwood();
-void AddSC_feralas();
-void AddSC_moonglade();
-void AddSC_orgrimmar();
-void AddSC_silithus();
-void AddSC_stonetalon_mountains();
-void AddSC_tanaris();
-void AddSC_the_barrens();
-void AddSC_thousand_needles();
-void AddSC_thunder_bluff();
-void AddSC_ungoro_crater();
-void AddSC_winterspring();
-
-// Northrend
-
-void AddSC_boss_slad_ran();
-void AddSC_boss_moorabi();
-void AddSC_boss_drakkari_colossus();
-void AddSC_boss_gal_darah();
-void AddSC_boss_eck();
-void AddSC_instance_gundrak();
-
-// Azjol-Nerub - Azjol-Nerub
-void AddSC_boss_krik_thir();
-void AddSC_boss_hadronox();
-void AddSC_boss_anub_arak();
-void AddSC_instance_azjol_nerub();
-
-// Azjol-Nerub - Ahn'kahet
-void AddSC_boss_elder_nadox();
-void AddSC_boss_taldaram();
-void AddSC_boss_amanitar();
-void AddSC_boss_jedoga_shadowseeker();
-void AddSC_boss_volazj();
-void AddSC_instance_ahnkahet();
-
-// Drak'Tharon Keep
-void AddSC_boss_trollgore();
-void AddSC_boss_novos();
-void AddSC_boss_king_dred();
-void AddSC_boss_tharon_ja();
-void AddSC_instance_drak_tharon_keep();
-
-void AddSC_boss_argent_challenge(); //Trial of the Champion
-void AddSC_boss_black_knight();
-void AddSC_boss_grand_champions();
-void AddSC_instance_trial_of_the_champion();
-void AddSC_trial_of_the_champion();
-void AddSC_boss_anubarak_trial(); //Trial of the Crusader
-void AddSC_boss_faction_champions();
-void AddSC_boss_jaraxxus();
-void AddSC_boss_northrend_beasts();
-void AddSC_boss_twin_valkyr();
-void AddSC_trial_of_the_crusader();
-void AddSC_instance_trial_of_the_crusader();
-void AddSC_boss_anubrekhan(); //Naxxramas
-void AddSC_boss_maexxna();
-void AddSC_boss_patchwerk();
-void AddSC_boss_grobbulus();
-void AddSC_boss_razuvious();
-void AddSC_boss_kelthuzad();
-void AddSC_boss_loatheb();
-void AddSC_boss_noth();
-void AddSC_boss_gluth();
-void AddSC_boss_sapphiron();
-void AddSC_boss_four_horsemen();
-void AddSC_boss_faerlina();
-void AddSC_boss_heigan();
-void AddSC_boss_gothik();
-void AddSC_boss_thaddius();
-void AddSC_instance_naxxramas();
-void AddSC_boss_nexus_commanders(); // The Nexus Nexus
-void AddSC_boss_magus_telestra();
-void AddSC_boss_anomalus();
-void AddSC_boss_ormorok();
-void AddSC_boss_keristrasza();
-void AddSC_instance_nexus();
-void AddSC_boss_drakos(); //The Nexus The Oculus
-void AddSC_boss_urom();
-void AddSC_boss_varos();
-void AddSC_boss_eregos();
-void AddSC_instance_oculus();
-void AddSC_oculus();
-void AddSC_boss_malygos(); // The Nexus: Eye of Eternity
-void AddSC_instance_eye_of_eternity();
-void AddSC_boss_sartharion(); //Obsidian Sanctum
-void AddSC_obsidian_sanctum();
-void AddSC_instance_obsidian_sanctum();
-void AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning
-void AddSC_boss_loken();
-void AddSC_boss_ionar();
-void AddSC_boss_volkhan();
-void AddSC_instance_halls_of_lightning();
-void AddSC_boss_maiden_of_grief(); //Ulduar Halls of Stone
-void AddSC_boss_krystallus();
-void AddSC_boss_sjonnir();
-void AddSC_instance_halls_of_stone();
-void AddSC_halls_of_stone();
-void AddSC_boss_auriaya(); //Ulduar Ulduar
-void AddSC_boss_flame_leviathan();
-void AddSC_boss_ignis();
-void AddSC_boss_razorscale();
-void AddSC_boss_xt002();
-void AddSC_boss_kologarn();
-void AddSC_boss_assembly_of_iron();
-void AddSC_boss_general_vezax();
-void AddSC_boss_mimiron();
-void AddSC_boss_hodir();
-void AddSC_boss_freya();
-void AddSC_boss_yogg_saron();
-void AddSC_boss_algalon_the_observer();
-void AddSC_instance_ulduar();
-
-// Utgarde Keep - Utgarde Keep
-void AddSC_boss_keleseth();
-void AddSC_boss_skarvald_dalronn();
-void AddSC_boss_ingvar_the_plunderer();
-void AddSC_instance_utgarde_keep();
-void AddSC_utgarde_keep();
-
-// Utgarde Keep - Utgarde Pinnacle
-void AddSC_boss_svala();
-void AddSC_boss_palehoof();
-void AddSC_boss_skadi();
-void AddSC_boss_ymiron();
-void AddSC_instance_utgarde_pinnacle();
-
-// Vault of Archavon
-void AddSC_boss_archavon();
-void AddSC_boss_emalon();
-void AddSC_boss_koralon();
-void AddSC_boss_toravon();
-void AddSC_instance_vault_of_archavon();
-
-void AddSC_boss_cyanigosa(); //Violet Hold
-void AddSC_boss_erekem();
-void AddSC_boss_ichoron();
-void AddSC_boss_lavanthor();
-void AddSC_boss_moragg();
-void AddSC_boss_xevozz();
-void AddSC_boss_zuramat();
-void AddSC_instance_violet_hold();
-void AddSC_violet_hold();
-void AddSC_instance_forge_of_souls(); //Forge of Souls
-void AddSC_forge_of_souls();
-void AddSC_boss_bronjahm();
-void AddSC_boss_devourer_of_souls();
-void AddSC_instance_pit_of_saron(); //Pit of Saron
-void AddSC_pit_of_saron();
-void AddSC_boss_garfrost();
-void AddSC_boss_ick();
-void AddSC_boss_tyrannus();
-void AddSC_instance_halls_of_reflection(); // Halls of Reflection
-void AddSC_halls_of_reflection();
-void AddSC_boss_falric();
-void AddSC_boss_marwyn();
-void AddSC_boss_lord_marrowgar(); // Icecrown Citadel
-void AddSC_boss_lady_deathwhisper();
-void AddSC_boss_icecrown_gunship_battle();
-void AddSC_boss_deathbringer_saurfang();
-void AddSC_boss_festergut();
-void AddSC_boss_rotface();
-void AddSC_boss_professor_putricide();
-void AddSC_boss_blood_prince_council();
-void AddSC_boss_blood_queen_lana_thel();
-void AddSC_boss_valithria_dreamwalker();
-void AddSC_boss_sindragosa();
-void AddSC_boss_the_lich_king();
-void AddSC_icecrown_citadel_teleport();
-void AddSC_instance_icecrown_citadel();
-void AddSC_icecrown_citadel();
-void AddSC_instance_ruby_sanctum(); // Ruby Sanctum
-void AddSC_ruby_sanctum();
-void AddSC_boss_baltharus_the_warborn();
-void AddSC_boss_saviana_ragefire();
-void AddSC_boss_general_zarithrian();
-void AddSC_boss_halion();
-
-void AddSC_dalaran();
-void AddSC_borean_tundra();
-void AddSC_dragonblight();
-void AddSC_grizzly_hills();
-void AddSC_howling_fjord();
-void AddSC_icecrown();
-void AddSC_sholazar_basin();
-void AddSC_storm_peaks();
-void AddSC_wintergrasp();
-void AddSC_zuldrak();
-void AddSC_crystalsong_forest();
-void AddSC_isle_of_conquest();
-
-// Outland
-
-// Auchindoun - Auchenai Crypts
-void AddSC_boss_shirrak_the_dead_watcher();
-void AddSC_boss_exarch_maladaar();
-void AddSC_instance_auchenai_crypts();
-
-// Auchindoun - Mana Tombs
-void AddSC_boss_pandemonius();
-void AddSC_boss_nexusprince_shaffar();
-void AddSC_instance_mana_tombs();
-
-// Auchindoun - Sekketh Halls
-void AddSC_boss_darkweaver_syth();
-void AddSC_boss_talon_king_ikiss();
-void AddSC_boss_anzu();
-void AddSC_instance_sethekk_halls();
-
-// Auchindoun - Shadow Labyrinth
-void AddSC_boss_ambassador_hellmaw();
-void AddSC_boss_blackheart_the_inciter();
-void AddSC_boss_grandmaster_vorpil();
-void AddSC_boss_murmur();
-void AddSC_instance_shadow_labyrinth();
-
-// Black Temple
-void AddSC_black_temple();
-void AddSC_boss_illidan();
-void AddSC_boss_shade_of_akama();
-void AddSC_boss_supremus();
-void AddSC_boss_gurtogg_bloodboil();
-void AddSC_boss_mother_shahraz();
-void AddSC_boss_reliquary_of_souls();
-void AddSC_boss_teron_gorefiend();
-void AddSC_boss_najentus();
-void AddSC_boss_illidari_council();
-void AddSC_instance_black_temple();
-
-// Coilfang Reservoir - Serpent Shrine Cavern
-void AddSC_boss_fathomlord_karathress();
-void AddSC_boss_hydross_the_unstable();
-void AddSC_boss_lady_vashj();
-void AddSC_boss_leotheras_the_blind();
-void AddSC_boss_morogrim_tidewalker();
-void AddSC_instance_serpentshrine_cavern();
-void AddSC_boss_the_lurker_below();
-
-// Coilfang Reservoir - The Steam Vault
-void AddSC_boss_hydromancer_thespia();
-void AddSC_boss_mekgineer_steamrigger();
-void AddSC_boss_warlord_kalithresh();
-void AddSC_instance_steam_vault();
-
-// Coilfang Reservoir - The Slave Pens
-void AddSC_instance_the_slave_pens();
-void AddSC_boss_mennu_the_betrayer();
-void AddSC_boss_rokmar_the_crackler();
-void AddSC_boss_quagmirran();
-
-// Coilfang Reservoir - The Underbog
-void AddSC_instance_the_underbog();
-void AddSC_boss_hungarfen();
-void AddSC_boss_the_black_stalker();
-
-// Gruul's Lair
-void AddSC_boss_gruul();
-void AddSC_boss_high_king_maulgar();
-void AddSC_instance_gruuls_lair();
-void AddSC_boss_broggok(); //HC Blood Furnace
-void AddSC_boss_kelidan_the_breaker();
-void AddSC_boss_the_maker();
-void AddSC_instance_blood_furnace();
-void AddSC_boss_magtheridon(); //HC Magtheridon's Lair
-void AddSC_instance_magtheridons_lair();
-void AddSC_boss_grand_warlock_nethekurse(); //HC Shattered Halls
-void AddSC_boss_warbringer_omrogg();
-void AddSC_boss_warchief_kargath_bladefist();
-void AddSC_shattered_halls();
-void AddSC_instance_shattered_halls();
-void AddSC_boss_watchkeeper_gargolmar(); //HC Ramparts
-void AddSC_boss_omor_the_unscarred();
-void AddSC_boss_vazruden_the_herald();
-void AddSC_instance_ramparts();
-void AddSC_arcatraz(); //TK Arcatraz
-void AddSC_boss_zereketh_the_unbound();
-void AddSC_boss_dalliah_the_doomsayer();
-void AddSC_boss_wrath_scryer_soccothrates();
-void AddSC_boss_harbinger_skyriss();
-void AddSC_instance_arcatraz();
-void AddSC_boss_high_botanist_freywinn(); //TK Botanica
-void AddSC_boss_laj();
-void AddSC_boss_warp_splinter();
-void AddSC_boss_thorngrin_the_tender();
-void AddSC_boss_commander_sarannis();
-void AddSC_instance_the_botanica();
-void AddSC_boss_alar(); //TK The Eye
-void AddSC_boss_kaelthas();
-void AddSC_boss_void_reaver();
-void AddSC_boss_high_astromancer_solarian();
-void AddSC_instance_the_eye();
-void AddSC_the_eye();
-void AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar
-void AddSC_boss_gatewatcher_gyrokill();
-void AddSC_boss_nethermancer_sepethrea();
-void AddSC_boss_pathaleon_the_calculator();
-void AddSC_boss_mechano_lord_capacitus();
-void AddSC_instance_mechanar();
-
-void AddSC_blades_edge_mountains();
-void AddSC_boss_doomlordkazzak();
-void AddSC_boss_doomwalker();
-void AddSC_hellfire_peninsula();
-void AddSC_nagrand();
-void AddSC_netherstorm();
-void AddSC_shadowmoon_valley();
-void AddSC_shattrath_city();
-void AddSC_terokkar_forest();
-void AddSC_zangarmarsh();
-
-// Events
-void AddSC_event_childrens_week();
-
-// Pets
-void AddSC_deathknight_pet_scripts();
-void AddSC_generic_pet_scripts();
-void AddSC_hunter_pet_scripts();
-void AddSC_mage_pet_scripts();
-void AddSC_priest_pet_scripts();
-void AddSC_shaman_pet_scripts();
-
-// battlegrounds
-
-// outdoor pvp
-void AddSC_outdoorpvp_ep();
-void AddSC_outdoorpvp_hp();
-void AddSC_outdoorpvp_na();
-void AddSC_outdoorpvp_si();
-void AddSC_outdoorpvp_tf();
-void AddSC_outdoorpvp_zm();
-
-// player
-void AddSC_chat_log();
-void AddSC_action_ip_logger();
-
-#endif
-
-void AddScripts()
-{
- AddSpellScripts();
- AddSC_SmartScripts();
- AddCommandScripts();
-#ifdef SCRIPTS
- AddWorldScripts();
- AddEasternKingdomsScripts();
- AddKalimdorScripts();
- AddOutlandScripts();
- AddNorthrendScripts();
- AddEventScripts();
- AddPetScripts();
- AddBattlegroundScripts();
- AddOutdoorPvPScripts();
- AddCustomScripts();
-#endif
-}
-
-void AddSpellScripts()
-{
- AddSC_deathknight_spell_scripts();
- AddSC_druid_spell_scripts();
- AddSC_generic_spell_scripts();
- AddSC_hunter_spell_scripts();
- AddSC_mage_spell_scripts();
- AddSC_paladin_spell_scripts();
- AddSC_priest_spell_scripts();
- AddSC_rogue_spell_scripts();
- AddSC_shaman_spell_scripts();
- AddSC_warlock_spell_scripts();
- AddSC_warrior_spell_scripts();
- AddSC_quest_spell_scripts();
- AddSC_item_spell_scripts();
- AddSC_holiday_spell_scripts();
-}
-
-void AddCommandScripts()
-{
- AddSC_account_commandscript();
- AddSC_achievement_commandscript();
- AddSC_ahbot_commandscript();
- AddSC_arena_commandscript();
- AddSC_ban_commandscript();
- AddSC_bf_commandscript();
- AddSC_cast_commandscript();
- AddSC_character_commandscript();
- AddSC_cheat_commandscript();
- AddSC_debug_commandscript();
- AddSC_deserter_commandscript();
- AddSC_disable_commandscript();
- AddSC_event_commandscript();
- AddSC_gm_commandscript();
- AddSC_go_commandscript();
- AddSC_gobject_commandscript();
- AddSC_group_commandscript();
- AddSC_guild_commandscript();
- AddSC_honor_commandscript();
- AddSC_instance_commandscript();
- AddSC_learn_commandscript();
- AddSC_lookup_commandscript();
- AddSC_lfg_commandscript();
- AddSC_list_commandscript();
- AddSC_message_commandscript();
- AddSC_misc_commandscript();
- AddSC_mmaps_commandscript();
- AddSC_modify_commandscript();
- AddSC_npc_commandscript();
- AddSC_quest_commandscript();
- AddSC_pet_commandscript();
- AddSC_rbac_commandscript();
- AddSC_reload_commandscript();
- AddSC_reset_commandscript();
- AddSC_send_commandscript();
- AddSC_server_commandscript();
- AddSC_tele_commandscript();
- AddSC_ticket_commandscript();
- AddSC_titles_commandscript();
- AddSC_wp_commandscript();
-}
-
-void AddWorldScripts()
-{
-#ifdef SCRIPTS
- AddSC_areatrigger_scripts();
- AddSC_emerald_dragons();
- AddSC_generic_creature();
- AddSC_go_scripts();
- AddSC_guards();
- AddSC_item_scripts();
- AddSC_npc_professions();
- AddSC_npc_innkeeper();
- AddSC_npcs_special();
- AddSC_achievement_scripts();
- AddSC_chat_log(); // location: scripts\World\chat_log.cpp
- // To avoid duplicate code, we check once /*ONLY*/ if logging is permitted or not.
- if (sWorld->getBoolConfig(CONFIG_IP_BASED_ACTION_LOGGING))
- AddSC_action_ip_logger(); // location: scripts\World\action_ip_logger.cpp
- AddSC_duel_reset();
-#endif
-}
-
-void AddEasternKingdomsScripts()
-{
-#ifdef SCRIPTS
- AddSC_alterac_valley(); //Alterac Valley
- AddSC_boss_balinda();
- AddSC_boss_drekthar();
- AddSC_boss_galvangar();
- AddSC_boss_vanndar();
- AddSC_blackrock_depths(); //Blackrock Depths
- AddSC_boss_ambassador_flamelash();
- AddSC_boss_draganthaurissan();
- AddSC_boss_general_angerforge();
- AddSC_boss_high_interrogator_gerstahn();
- AddSC_boss_magmus();
- AddSC_boss_moira_bronzebeard();
- AddSC_boss_tomb_of_seven();
- AddSC_instance_blackrock_depths();
- AddSC_boss_drakkisath(); //Blackrock Spire
- AddSC_boss_halycon();
- AddSC_boss_highlordomokk();
- AddSC_boss_mothersmolderweb();
- AddSC_boss_overlordwyrmthalak();
- AddSC_boss_shadowvosh();
- AddSC_boss_thebeast();
- AddSC_boss_warmastervoone();
- AddSC_boss_quatermasterzigris();
- AddSC_boss_pyroguard_emberseer();
- AddSC_boss_gyth();
- AddSC_boss_rend_blackhand();
- AddSC_boss_gizrul_the_slavener();
- AddSC_boss_urok_doomhowl();
- AddSC_boss_lord_valthalak();
- AddSC_instance_blackrock_spire();
- AddSC_boss_razorgore(); //Blackwing lair
- AddSC_boss_vaelastrasz();
- AddSC_boss_broodlord();
- AddSC_boss_firemaw();
- AddSC_boss_ebonroc();
- AddSC_boss_flamegor();
- AddSC_boss_chromaggus();
- AddSC_boss_nefarian();
- AddSC_instance_blackwing_lair();
- AddSC_deadmines(); //Deadmines
- AddSC_boss_mr_smite();
- AddSC_instance_deadmines();
- AddSC_gnomeregan(); //Gnomeregan
- AddSC_instance_gnomeregan();
- AddSC_boss_attumen(); //Karazhan
- AddSC_boss_curator();
- AddSC_boss_maiden_of_virtue();
- AddSC_boss_shade_of_aran();
- AddSC_boss_malchezaar();
- AddSC_boss_terestian_illhoof();
- AddSC_boss_moroes();
- AddSC_bosses_opera();
- AddSC_boss_netherspite();
- AddSC_instance_karazhan();
- AddSC_karazhan();
- AddSC_boss_nightbane();
- AddSC_boss_felblood_kaelthas(); // Magister's Terrace
- AddSC_boss_selin_fireheart();
- AddSC_boss_vexallus();
- AddSC_boss_priestess_delrissa();
- AddSC_instance_magisters_terrace();
- AddSC_magisters_terrace();
- AddSC_boss_lucifron(); //Molten core
- AddSC_boss_magmadar();
- AddSC_boss_gehennas();
- AddSC_boss_garr();
- AddSC_boss_baron_geddon();
- AddSC_boss_shazzrah();
- AddSC_boss_golemagg();
- AddSC_boss_sulfuron();
- AddSC_boss_majordomo();
- AddSC_boss_ragnaros();
- AddSC_instance_molten_core();
- AddSC_instance_ragefire_chasm(); //Ragefire Chasm
- AddSC_the_scarlet_enclave(); //Scarlet Enclave
- AddSC_the_scarlet_enclave_c1();
- AddSC_the_scarlet_enclave_c2();
- AddSC_the_scarlet_enclave_c5();
- AddSC_boss_arcanist_doan(); //Scarlet Monastery
- AddSC_boss_azshir_the_sleepless();
- AddSC_boss_bloodmage_thalnos();
- AddSC_boss_headless_horseman();
- AddSC_boss_herod();
- AddSC_boss_high_inquisitor_fairbanks();
- AddSC_boss_houndmaster_loksey();
- AddSC_boss_interrogator_vishas();
- AddSC_boss_scorn();
- AddSC_instance_scarlet_monastery();
- AddSC_boss_mograine_and_whitemane();
- AddSC_boss_darkmaster_gandling(); //Scholomance
- AddSC_boss_death_knight_darkreaver();
- AddSC_boss_theolenkrastinov();
- AddSC_boss_illuciabarov();
- AddSC_boss_instructormalicia();
- AddSC_boss_jandicebarov();
- AddSC_boss_kormok();
- AddSC_boss_lordalexeibarov();
- AddSC_boss_lorekeeperpolkelt();
- AddSC_boss_rasfrost();
- AddSC_boss_theravenian();
- AddSC_boss_vectus();
- AddSC_boss_kirtonos_the_herald();
- AddSC_instance_scholomance();
- AddSC_shadowfang_keep(); //Shadowfang keep
- AddSC_instance_shadowfang_keep();
- AddSC_boss_magistrate_barthilas(); //Stratholme
- AddSC_boss_maleki_the_pallid();
- AddSC_boss_nerubenkan();
- AddSC_boss_cannon_master_willey();
- AddSC_boss_baroness_anastari();
- AddSC_boss_ramstein_the_gorger();
- AddSC_boss_timmy_the_cruel();
- AddSC_boss_postmaster_malown();
- AddSC_boss_baron_rivendare();
- AddSC_boss_dathrohan_balnazzar();
- AddSC_boss_order_of_silver_hand();
- AddSC_instance_stratholme();
- AddSC_stratholme();
- AddSC_sunken_temple(); // Sunken Temple
- AddSC_instance_sunken_temple();
- AddSC_instance_sunwell_plateau(); //Sunwell Plateau
- AddSC_boss_kalecgos();
- AddSC_boss_brutallus();
- AddSC_boss_felmyst();
- AddSC_boss_eredar_twins();
- AddSC_boss_muru();
- AddSC_boss_kiljaeden();
- AddSC_sunwell_plateau();
- AddSC_instance_the_stockade(); //The Stockade
- AddSC_boss_archaedas(); //Uldaman
- AddSC_boss_ironaya();
- AddSC_uldaman();
- AddSC_instance_uldaman();
- AddSC_boss_akilzon(); //Zul'Aman
- AddSC_boss_halazzi();
- AddSC_boss_hex_lord_malacrass();
- AddSC_boss_janalai();
- AddSC_boss_nalorakk();
- AddSC_boss_zuljin();
- AddSC_instance_zulaman();
- AddSC_zulaman();
- AddSC_boss_jeklik(); //Zul'Gurub
- AddSC_boss_venoxis();
- AddSC_boss_marli();
- AddSC_boss_mandokir();
- AddSC_boss_gahzranka();
- AddSC_boss_thekal();
- AddSC_boss_arlokk();
- AddSC_boss_jindo();
- AddSC_boss_hakkar();
- AddSC_boss_grilek();
- AddSC_boss_hazzarah();
- AddSC_boss_renataki();
- AddSC_boss_wushoolay();
- AddSC_instance_zulgurub();
-
- //AddSC_alterac_mountains();
- AddSC_arathi_highlands();
- AddSC_blasted_lands();
- AddSC_burning_steppes();
- AddSC_duskwood();
- AddSC_eastern_plaguelands();
- AddSC_ghostlands();
- AddSC_hinterlands();
- AddSC_isle_of_queldanas();
- AddSC_loch_modan();
- AddSC_redridge_mountains();
- AddSC_silverpine_forest();
- AddSC_stormwind_city();
- AddSC_stranglethorn_vale();
- AddSC_swamp_of_sorrows();
- AddSC_tirisfal_glades();
- AddSC_undercity();
- AddSC_western_plaguelands();
- AddSC_wetlands();
-#endif
-}
-
-void AddKalimdorScripts()
-{
-#ifdef SCRIPTS
- AddSC_blackfathom_deeps(); //Blackfathom Depths
- AddSC_boss_gelihast();
- AddSC_boss_kelris();
- AddSC_boss_aku_mai();
- AddSC_instance_blackfathom_deeps();
- AddSC_hyjal(); //CoT Battle for Mt. Hyjal
- AddSC_boss_archimonde();
- AddSC_instance_mount_hyjal();
- AddSC_hyjal_trash();
- AddSC_boss_rage_winterchill();
- AddSC_boss_anetheron();
- AddSC_boss_kazrogal();
- AddSC_boss_azgalor();
- AddSC_boss_captain_skarloc(); //CoT Old Hillsbrad
- AddSC_boss_epoch_hunter();
- AddSC_boss_lieutenant_drake();
- AddSC_instance_old_hillsbrad();
- AddSC_old_hillsbrad();
- AddSC_boss_aeonus(); //CoT The Black Morass
- AddSC_boss_chrono_lord_deja();
- AddSC_boss_temporus();
- AddSC_the_black_morass();
- AddSC_instance_the_black_morass();
- AddSC_boss_epoch(); //CoT Culling Of Stratholme
- AddSC_boss_infinite_corruptor();
- AddSC_boss_salramm();
- AddSC_boss_mal_ganis();
- AddSC_boss_meathook();
- AddSC_culling_of_stratholme();
- AddSC_instance_culling_of_stratholme();
- AddSC_instance_dire_maul(); //Dire Maul
- AddSC_boss_celebras_the_cursed(); //Maraudon
- AddSC_boss_landslide();
- AddSC_boss_noxxion();
- AddSC_boss_ptheradras();
- AddSC_instance_maraudon();
- AddSC_boss_onyxia(); //Onyxia's Lair
- AddSC_instance_onyxias_lair();
- AddSC_boss_tuten_kash(); //Razorfen Downs
- AddSC_boss_mordresh_fire_eye();
- AddSC_boss_glutton();
- AddSC_boss_amnennar_the_coldbringer();
- AddSC_razorfen_downs();
- AddSC_instance_razorfen_downs();
- AddSC_razorfen_kraul(); //Razorfen Kraul
- AddSC_instance_razorfen_kraul();
- AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj
- AddSC_boss_rajaxx();
- AddSC_boss_moam();
- AddSC_boss_buru();
- AddSC_boss_ayamiss();
- AddSC_boss_ossirian();
- AddSC_instance_ruins_of_ahnqiraj();
- AddSC_boss_cthun(); //Temple of ahn'qiraj
- AddSC_boss_viscidus();
- AddSC_boss_fankriss();
- AddSC_boss_huhuran();
- AddSC_bug_trio();
- AddSC_boss_sartura();
- AddSC_boss_skeram();
- AddSC_boss_twinemperors();
- AddSC_boss_ouro();
- AddSC_npc_anubisath_sentinel();
- AddSC_instance_temple_of_ahnqiraj();
- AddSC_wailing_caverns(); //Wailing caverns
- AddSC_instance_wailing_caverns();
- AddSC_boss_zum_rah(); //Zul'Farrak
- AddSC_zulfarrak();
- AddSC_instance_zulfarrak();
-
- AddSC_ashenvale();
- AddSC_azshara();
- AddSC_azuremyst_isle();
- AddSC_bloodmyst_isle();
- AddSC_boss_azuregos();
- AddSC_darkshore();
- AddSC_desolace();
- AddSC_durotar();
- AddSC_dustwallow_marsh();
- AddSC_felwood();
- AddSC_feralas();
- AddSC_moonglade();
- AddSC_orgrimmar();
- AddSC_silithus();
- AddSC_stonetalon_mountains();
- AddSC_tanaris();
- AddSC_the_barrens();
- AddSC_thousand_needles();
- AddSC_thunder_bluff();
- AddSC_ungoro_crater();
- AddSC_winterspring();
-#endif
-}
-
-void AddOutlandScripts()
-{
-#ifdef SCRIPTS
- // Auchindoun - Auchenai Crypts
- AddSC_boss_shirrak_the_dead_watcher();
- AddSC_boss_exarch_maladaar();
- AddSC_instance_auchenai_crypts();
-
- // Auchindoun - Mana Tombs
- AddSC_boss_pandemonius();
- AddSC_boss_nexusprince_shaffar();
- AddSC_instance_mana_tombs();
-
- // Auchindoun - Sekketh Halls
- AddSC_boss_darkweaver_syth();
- AddSC_boss_talon_king_ikiss();
- AddSC_boss_anzu();
- AddSC_instance_sethekk_halls();
-
- // Auchindoun - Shadow Labyrinth
- AddSC_boss_ambassador_hellmaw();
- AddSC_boss_blackheart_the_inciter();
- AddSC_boss_grandmaster_vorpil();
- AddSC_boss_murmur();
- AddSC_instance_shadow_labyrinth();
-
- // Black Temple
- AddSC_black_temple();
- AddSC_boss_illidan();
- AddSC_boss_shade_of_akama();
- AddSC_boss_supremus();
- AddSC_boss_gurtogg_bloodboil();
- AddSC_boss_mother_shahraz();
- AddSC_boss_reliquary_of_souls();
- AddSC_boss_teron_gorefiend();
- AddSC_boss_najentus();
- AddSC_boss_illidari_council();
- AddSC_instance_black_temple();
-
- // Coilfang Reservoir - Serpent Shrine Cavern
- AddSC_boss_fathomlord_karathress();
- AddSC_boss_hydross_the_unstable();
- AddSC_boss_lady_vashj();
- AddSC_boss_leotheras_the_blind();
- AddSC_boss_morogrim_tidewalker();
- AddSC_instance_serpentshrine_cavern();
- AddSC_boss_the_lurker_below();
-
- // Coilfang Reservoir - The Steam Vault
- AddSC_instance_steam_vault();
- AddSC_boss_hydromancer_thespia();
- AddSC_boss_mekgineer_steamrigger();
- AddSC_boss_warlord_kalithresh();
-
- // Coilfang Reservoir - The Slave Pens
- AddSC_instance_the_slave_pens();
- AddSC_boss_mennu_the_betrayer();
- AddSC_boss_rokmar_the_crackler();
- AddSC_boss_quagmirran();
-
- // Coilfang Reservoir - The Underbog
- AddSC_instance_the_underbog();
- AddSC_boss_hungarfen();
- AddSC_boss_the_black_stalker();
-
- // Gruul's Lair
- AddSC_boss_gruul();
- AddSC_boss_high_king_maulgar();
- AddSC_instance_gruuls_lair();
- AddSC_boss_broggok(); //HC Blood Furnace
- AddSC_boss_kelidan_the_breaker();
- AddSC_boss_the_maker();
- AddSC_instance_blood_furnace();
- AddSC_boss_magtheridon(); //HC Magtheridon's Lair
- AddSC_instance_magtheridons_lair();
- AddSC_boss_grand_warlock_nethekurse(); //HC Shattered Halls
- AddSC_boss_warbringer_omrogg();
- AddSC_boss_warchief_kargath_bladefist();
- AddSC_shattered_halls();
- AddSC_instance_shattered_halls();
- AddSC_boss_watchkeeper_gargolmar(); //HC Ramparts
- AddSC_boss_omor_the_unscarred();
- AddSC_boss_vazruden_the_herald();
- AddSC_instance_ramparts();
- AddSC_arcatraz(); //TK Arcatraz
- AddSC_boss_zereketh_the_unbound();
- AddSC_boss_dalliah_the_doomsayer();
- AddSC_boss_wrath_scryer_soccothrates();
- AddSC_boss_harbinger_skyriss();
- AddSC_instance_arcatraz();
- AddSC_boss_high_botanist_freywinn(); //TK Botanica
- AddSC_boss_laj();
- AddSC_boss_warp_splinter();
- AddSC_boss_thorngrin_the_tender();
- AddSC_boss_commander_sarannis();
- AddSC_instance_the_botanica();
- AddSC_boss_alar(); //TK The Eye
- AddSC_boss_kaelthas();
- AddSC_boss_void_reaver();
- AddSC_boss_high_astromancer_solarian();
- AddSC_instance_the_eye();
- AddSC_the_eye();
- AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar
- AddSC_boss_gatewatcher_gyrokill();
- AddSC_boss_nethermancer_sepethrea();
- AddSC_boss_pathaleon_the_calculator();
- AddSC_boss_mechano_lord_capacitus();
- AddSC_instance_mechanar();
-
- AddSC_blades_edge_mountains();
- AddSC_boss_doomlordkazzak();
- AddSC_boss_doomwalker();
- AddSC_hellfire_peninsula();
- AddSC_nagrand();
- AddSC_netherstorm();
- AddSC_shadowmoon_valley();
- AddSC_shattrath_city();
- AddSC_terokkar_forest();
- AddSC_zangarmarsh();
-#endif
-}
-
-void AddNorthrendScripts()
-{
-#ifdef SCRIPTS
- AddSC_boss_slad_ran(); //Gundrak
- AddSC_boss_moorabi();
- AddSC_boss_drakkari_colossus();
- AddSC_boss_gal_darah();
- AddSC_boss_eck();
- AddSC_instance_gundrak();
-
- // Azjol-Nerub - Ahn'kahet
- AddSC_boss_elder_nadox();
- AddSC_boss_taldaram();
- AddSC_boss_amanitar();
- AddSC_boss_jedoga_shadowseeker();
- AddSC_boss_volazj();
- AddSC_instance_ahnkahet();
-
- // Azjol-Nerub - Azjol-Nerub
- AddSC_boss_krik_thir();
- AddSC_boss_hadronox();
- AddSC_boss_anub_arak();
- AddSC_instance_azjol_nerub();
-
- // Drak'Tharon Keep
- AddSC_boss_trollgore();
- AddSC_boss_novos();
- AddSC_boss_king_dred();
- AddSC_boss_tharon_ja();
- AddSC_instance_drak_tharon_keep();
-
- AddSC_boss_argent_challenge(); //Trial of the Champion
- AddSC_boss_black_knight();
- AddSC_boss_grand_champions();
- AddSC_instance_trial_of_the_champion();
- AddSC_trial_of_the_champion();
- AddSC_boss_anubarak_trial(); //Trial of the Crusader
- AddSC_boss_faction_champions();
- AddSC_boss_jaraxxus();
- AddSC_trial_of_the_crusader();
- AddSC_boss_twin_valkyr();
- AddSC_boss_northrend_beasts();
- AddSC_instance_trial_of_the_crusader();
- AddSC_boss_anubrekhan(); //Naxxramas
- AddSC_boss_maexxna();
- AddSC_boss_patchwerk();
- AddSC_boss_grobbulus();
- AddSC_boss_razuvious();
- AddSC_boss_kelthuzad();
- AddSC_boss_loatheb();
- AddSC_boss_noth();
- AddSC_boss_gluth();
- AddSC_boss_sapphiron();
- AddSC_boss_four_horsemen();
- AddSC_boss_faerlina();
- AddSC_boss_heigan();
- AddSC_boss_gothik();
- AddSC_boss_thaddius();
- AddSC_instance_naxxramas();
- AddSC_boss_nexus_commanders(); // The Nexus Nexus
- AddSC_boss_magus_telestra();
- AddSC_boss_anomalus();
- AddSC_boss_ormorok();
- AddSC_boss_keristrasza();
- AddSC_instance_nexus();
- AddSC_boss_drakos(); //The Nexus The Oculus
- AddSC_boss_urom();
- AddSC_boss_varos();
- AddSC_boss_eregos();
- AddSC_instance_oculus();
- AddSC_oculus();
- AddSC_boss_malygos(); // The Nexus: Eye of Eternity
- AddSC_instance_eye_of_eternity();
- AddSC_boss_sartharion(); //Obsidian Sanctum
- AddSC_obsidian_sanctum();
- AddSC_instance_obsidian_sanctum();
- AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning
- AddSC_boss_loken();
- AddSC_boss_ionar();
- AddSC_boss_volkhan();
- AddSC_instance_halls_of_lightning();
- AddSC_boss_maiden_of_grief(); //Ulduar Halls of Stone
- AddSC_boss_krystallus();
- AddSC_boss_sjonnir();
- AddSC_instance_halls_of_stone();
- AddSC_halls_of_stone();
- AddSC_boss_auriaya(); //Ulduar Ulduar
- AddSC_boss_flame_leviathan();
- AddSC_boss_ignis();
- AddSC_boss_razorscale();
- AddSC_boss_xt002();
- AddSC_boss_general_vezax();
- AddSC_boss_assembly_of_iron();
- AddSC_boss_kologarn();
- AddSC_boss_mimiron();
- AddSC_boss_hodir();
- AddSC_boss_freya();
- AddSC_boss_yogg_saron();
- AddSC_boss_algalon_the_observer();
- AddSC_instance_ulduar();
-
- // Utgarde Keep - Utgarde Keep
- AddSC_boss_keleseth();
- AddSC_boss_skarvald_dalronn();
- AddSC_boss_ingvar_the_plunderer();
- AddSC_instance_utgarde_keep();
- AddSC_utgarde_keep();
-
- // Utgarde Keep - Utgarde Pinnacle
- AddSC_boss_svala();
- AddSC_boss_palehoof();
- AddSC_boss_skadi();
- AddSC_boss_ymiron();
- AddSC_instance_utgarde_pinnacle();
-
- // Vault of Archavon
- AddSC_boss_archavon();
- AddSC_boss_emalon();
- AddSC_boss_koralon();
- AddSC_boss_toravon();
- AddSC_instance_vault_of_archavon();
-
- AddSC_boss_cyanigosa(); //Violet Hold
- AddSC_boss_erekem();
- AddSC_boss_ichoron();
- AddSC_boss_lavanthor();
- AddSC_boss_moragg();
- AddSC_boss_xevozz();
- AddSC_boss_zuramat();
- AddSC_instance_violet_hold();
- AddSC_violet_hold();
- AddSC_instance_forge_of_souls(); //Forge of Souls
- AddSC_forge_of_souls();
- AddSC_boss_bronjahm();
- AddSC_boss_devourer_of_souls();
- AddSC_instance_pit_of_saron(); //Pit of Saron
- AddSC_pit_of_saron();
- AddSC_boss_garfrost();
- AddSC_boss_ick();
- AddSC_boss_tyrannus();
- AddSC_instance_halls_of_reflection(); // Halls of Reflection
- AddSC_halls_of_reflection();
- AddSC_boss_falric();
- AddSC_boss_marwyn();
- AddSC_boss_lord_marrowgar(); // Icecrown Citadel
- AddSC_boss_lady_deathwhisper();
- AddSC_boss_icecrown_gunship_battle();
- AddSC_boss_deathbringer_saurfang();
- AddSC_boss_festergut();
- AddSC_boss_rotface();
- AddSC_boss_professor_putricide();
- AddSC_boss_blood_prince_council();
- AddSC_boss_blood_queen_lana_thel();
- AddSC_boss_valithria_dreamwalker();
- AddSC_boss_sindragosa();
- AddSC_boss_the_lich_king();
- AddSC_icecrown_citadel_teleport();
- AddSC_instance_icecrown_citadel();
- AddSC_icecrown_citadel();
- AddSC_instance_ruby_sanctum(); // Ruby Sanctum
- AddSC_ruby_sanctum();
- AddSC_boss_baltharus_the_warborn();
- AddSC_boss_saviana_ragefire();
- AddSC_boss_general_zarithrian();
- AddSC_boss_halion();
-
- AddSC_dalaran();
- AddSC_borean_tundra();
- AddSC_dragonblight();
- AddSC_grizzly_hills();
- AddSC_howling_fjord();
- AddSC_icecrown();
- AddSC_sholazar_basin();
- AddSC_storm_peaks();
- AddSC_wintergrasp();
- AddSC_zuldrak();
- AddSC_crystalsong_forest();
- AddSC_isle_of_conquest();
-#endif
-}
-
-void AddEventScripts()
-{
-#ifdef SCRIPTS
- AddSC_event_childrens_week();
-#endif
-}
-
-void AddPetScripts()
-{
-#ifdef SCRIPTS
- AddSC_deathknight_pet_scripts();
- AddSC_generic_pet_scripts();
- AddSC_hunter_pet_scripts();
- AddSC_mage_pet_scripts();
- AddSC_priest_pet_scripts();
- AddSC_shaman_pet_scripts();
-#endif
-}
-
-void AddOutdoorPvPScripts()
-{
-#ifdef SCRIPTS
- AddSC_outdoorpvp_ep();
- AddSC_outdoorpvp_hp();
- AddSC_outdoorpvp_na();
- AddSC_outdoorpvp_si();
- AddSC_outdoorpvp_tf();
- AddSC_outdoorpvp_zm();
-#endif
-}
-
-void AddBattlegroundScripts()
-{
-#ifdef SCRIPTS
-#endif
-}
-
-#ifdef SCRIPTS
-/* This is where custom scripts' loading functions should be declared. */
-
-#endif
-
-void AddCustomScripts()
-{
-#ifdef SCRIPTS
- /* This is where custom scripts should be added. */
-
-#endif
-}
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index 37917f64de6..bd3f9cf2bfe 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -17,15 +17,16 @@
*/
#include "ScriptMgr.h"
+#include "ScriptReloadMgr.h"
#include "Config.h"
#include "DatabaseEnv.h"
#include "DBCStores.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
-#include "ScriptLoader.h"
#include "ScriptSystem.h"
#include "Transport.h"
#include "Vehicle.h"
+#include "SmartAI.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "GossipDef.h"
@@ -34,12 +35,9 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Chat.h"
-
-// namespace
-// {
- UnusedScriptContainer UnusedScripts;
- UnusedScriptNamesContainer UnusedScriptNames;
-// }
+#include "MapManager.h"
+#include "LFGScripts.h"
+#include "InstanceScript.h"
// Trait which indicates whether this script type
// must be assigned in the database.
@@ -68,6 +66,10 @@ struct is_script_database_bound<GameObjectScript>
: std::true_type { };
template<>
+struct is_script_database_bound<VehicleScript>
+ : std::true_type { };
+
+template<>
struct is_script_database_bound<AreaTriggerScript>
: std::true_type { };
@@ -95,144 +97,850 @@ template<>
struct is_script_database_bound<AchievementCriteriaScript>
: std::true_type { };
+enum Spells
+{
+ SPELL_HOTSWAP_VISUAL_SPELL_EFFECT = 40162 // 59084
+};
+
+class ScriptRegistryInterface
+{
+public:
+ ScriptRegistryInterface() { }
+ virtual ~ScriptRegistryInterface() { }
+
+ ScriptRegistryInterface(ScriptRegistryInterface const&) = delete;
+ ScriptRegistryInterface(ScriptRegistryInterface&&) = delete;
+
+ ScriptRegistryInterface& operator= (ScriptRegistryInterface const&) = delete;
+ ScriptRegistryInterface& operator= (ScriptRegistryInterface&&) = delete;
+
+ /// Removes all scripts associated with the given script context.
+ /// Requires ScriptRegistryBase::SwapContext to be called after all transfers have finished.
+ virtual void ReleaseContext(std::string const& context) = 0;
+
+ /// Injects and updates the changed script objects.
+ virtual void SwapContext(bool initialize) = 0;
+
+ /// Removes the scripts used by this registry from the given container.
+ /// Used to find unused script names.
+ virtual void RemoveUsedScriptsFromContainer(std::unordered_set<std::string>& scripts) = 0;
+
+ /// Unloads the script registry.
+ virtual void Unload() = 0;
+};
+
+template<class>
+class ScriptRegistry;
+
+class ScriptRegistryCompositum
+ : public ScriptRegistryInterface
+{
+ ScriptRegistryCompositum() { }
+
+ template<class>
+ friend class ScriptRegistry;
+
+ /// Type erasure wrapper for objects
+ class DeleteableObjectBase
+ {
+ public:
+ DeleteableObjectBase() { }
+ virtual ~DeleteableObjectBase() { }
+
+ DeleteableObjectBase(DeleteableObjectBase const&) = delete;
+ DeleteableObjectBase& operator= (DeleteableObjectBase const&) = delete;
+ };
+
+ template<typename T>
+ class DeleteableObject
+ : public DeleteableObjectBase
+ {
+ public:
+ DeleteableObject(T&& object)
+ : _object(std::forward<T>(object)) { }
+
+ private:
+ T _object;
+ };
+
+public:
+ void SetScriptNameInContext(std::string const& scriptname, std::string const& context)
+ {
+ ASSERT(_scriptnames_to_context.find(scriptname) == _scriptnames_to_context.end(),
+ "Scriptname was assigned to this context already!");
+ _scriptnames_to_context.insert(std::make_pair(scriptname, context));
+ }
+
+ std::string const& GetScriptContextOfScriptName(std::string const& scriptname) const
+ {
+ auto itr = _scriptnames_to_context.find(scriptname);
+ ASSERT(itr != _scriptnames_to_context.end() &&
+ "Given scriptname doesn't exist!");
+ return itr->second;
+ }
+
+ void ReleaseContext(std::string const& context) final override
+ {
+ for (auto const registry : _registries)
+ registry->ReleaseContext(context);
+
+ // Clear the script names in context after calling the release hooks
+ // since it's possible that new references to a shared library
+ // are acquired when releasing.
+ for (auto itr = _scriptnames_to_context.begin();
+ itr != _scriptnames_to_context.end();)
+ if (itr->second == context)
+ itr = _scriptnames_to_context.erase(itr);
+ else
+ ++itr;
+ }
+
+ void SwapContext(bool initialize) final override
+ {
+ for (auto const registry : _registries)
+ registry->SwapContext(initialize);
+
+ DoDelayedDelete();
+ }
+
+ void RemoveUsedScriptsFromContainer(std::unordered_set<std::string>& scripts) final override
+ {
+ for (auto const registry : _registries)
+ registry->RemoveUsedScriptsFromContainer(scripts);
+ }
+
+ void Unload() final override
+ {
+ for (auto const registry : _registries)
+ registry->Unload();
+ }
+
+ template<typename T>
+ void QueueForDelayedDelete(T&& any)
+ {
+ _delayed_delete_queue.push_back(
+ Trinity::make_unique<
+ DeleteableObject<typename std::decay<T>::type>
+ >(std::forward<T>(any))
+ );
+ }
+
+ static ScriptRegistryCompositum* Instance()
+ {
+ static ScriptRegistryCompositum instance;
+ return &instance;
+ }
+
+private:
+ void Register(ScriptRegistryInterface* registry)
+ {
+ _registries.insert(registry);
+ }
+
+ void DoDelayedDelete()
+ {
+ _delayed_delete_queue.clear();
+ }
+
+ std::unordered_set<ScriptRegistryInterface*> _registries;
+
+ std::vector<std::unique_ptr<DeleteableObjectBase>> _delayed_delete_queue;
+
+ std::unordered_map<
+ std::string /*script name*/,
+ std::string /*context*/
+ > _scriptnames_to_context;
+};
+
+#define sScriptRegistryCompositum ScriptRegistryCompositum::Instance()
+
+template<typename /*ScriptType*/, bool /*IsDatabaseBound*/>
+class SpecializedScriptRegistry;
+
// This is the global static registry of scripts.
-template<class TScript>
-class ScriptRegistry
+template<class ScriptType>
+class ScriptRegistry final
+ : public SpecializedScriptRegistry<
+ ScriptType, is_script_database_bound<ScriptType>::value>
{
+ ScriptRegistry()
+ {
+ sScriptRegistryCompositum->Register(this);
+ }
+
+public:
+ static ScriptRegistry* Instance()
+ {
+ static ScriptRegistry instance;
+ return &instance;
+ }
+
+ void LogDuplicatedScriptPointerError(ScriptType const* first, ScriptType const* second)
+ {
+ // See if the script is using the same memory as another script. If this happens, it means that
+ // someone forgot to allocate new memory for a script.
+ TC_LOG_ERROR("scripts", "Script '%s' has same memory pointer as '%s'.",
+ first->GetName().c_str(), second->GetName().c_str());
+ }
+};
+
+class ScriptRegistrySwapHookBase
+{
+public:
+ ScriptRegistrySwapHookBase() { }
+ virtual ~ScriptRegistrySwapHookBase() { }
+
+ ScriptRegistrySwapHookBase(ScriptRegistrySwapHookBase const&) = delete;
+ ScriptRegistrySwapHookBase(ScriptRegistrySwapHookBase&&) = delete;
+
+ ScriptRegistrySwapHookBase& operator= (ScriptRegistrySwapHookBase const&) = delete;
+ ScriptRegistrySwapHookBase& operator= (ScriptRegistrySwapHookBase&&) = delete;
+
+ /// Called before the actual context release happens
+ virtual void BeforeReleaseContext(std::string const& /*context*/) { }
+
+ /// Called before SwapContext
+ virtual void BeforeSwapContext(bool /*initialize*/) { }
+
+ /// Called before Unload
+ virtual void BeforeUnload() { }
+};
+
+template<typename ScriptType, typename Base>
+class ScriptRegistrySwapHooks
+ : public ScriptRegistrySwapHookBase
+{
+};
+
+/// This hook is responsible for swapping OutdoorPvP's
+template<typename Base>
+class UnsupportedScriptRegistrySwapHooks
+ : public ScriptRegistrySwapHookBase
+{
+public:
+ void BeforeReleaseContext(std::string const& context) final override
+ {
+ auto const bounds = static_cast<Base*>(this)->_ids_of_contexts.equal_range(context);
+ ASSERT(bounds.first == bounds.second);
+ }
+};
+
+/// This hook is responsible for swapping Creature and GameObject AI's
+template<typename ObjectType, typename ScriptType, typename Base>
+class CreatureGameObjectScriptRegistrySwapHooks
+ : public ScriptRegistrySwapHookBase
+{
+ template<typename W>
+ class AIFunctionMapWorker
+ {
+ public:
+ template<typename T>
+ AIFunctionMapWorker(T&& worker)
+ : _worker(std::forward<T>(worker)) { }
+
+ void Visit(std::unordered_map<ObjectGuid, ObjectType*>& objects)
+ {
+ _worker(objects);
+ }
+
+ template<typename O>
+ void Visit(std::unordered_map<ObjectGuid, O*>&) { }
+
+ private:
+ W _worker;
+ };
+
+ class AsyncCastHotswapEffectEvent : public BasicEvent
+ {
public:
+ explicit AsyncCastHotswapEffectEvent(Unit* owner) : owner_(owner) { }
+
+ bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override
+ {
+ owner_->CastSpell(owner_, SPELL_HOTSWAP_VISUAL_SPELL_EFFECT, true);
+ return true;
+ }
+
+ private:
+ Unit* owner_;
+ };
+
+ // Hook which is called before a creature is swapped
+ static void UnloadStage1(Creature* creature)
+ {
+ // Remove deletable events only,
+ // otherwise it causes crashes with non-deletable spell events.
+ creature->m_Events.KillAllEvents(false);
+
+ if (creature->IsCharmed())
+ creature->RemoveCharmedBy(nullptr);
+
+ ASSERT(!creature->IsCharmed(),
+ "There is a disabled AI which is still loaded.");
+
+ creature->AI()->EnterEvadeMode();
+ }
+
+ static void UnloadStage2(Creature* creature)
+ {
+ bool const destroyed = creature->AIM_Destroy();
+ ASSERT(destroyed,
+ "Destroying the AI should never fail here!");
+ (void)destroyed;
+
+ ASSERT(!creature->AI(),
+ "The AI should be null here!");
+ }
+
+ // Hook which is called before a gameobject is swapped
+ static void UnloadStage1(GameObject* gameobject)
+ {
+ gameobject->AI()->Reset();
+ }
+
+ static void UnloadStage2(GameObject* gameobject)
+ {
+ gameobject->AIM_Destroy();
+
+ ASSERT(!gameobject->AI(),
+ "The AI should be null here!");
+ }
+
+ // Hook which is called after a creature was swapped
+ static void LoadStage1(Creature* creature)
+ {
+ ASSERT(!creature->AI(),
+ "The AI should be null here!");
+
+ if (creature->IsAlive())
+ creature->ClearUnitState(UNIT_STATE_EVADE);
+
+ bool const created = creature->AIM_Initialize();
+ ASSERT(created,
+ "Creating the AI should never fail here!");
+ (void)created;
+ }
+
+ static void LoadStage2(Creature* creature)
+ {
+ if (!creature->IsAlive())
+ return;
+
+ creature->AI()->EnterEvadeMode();
+
+ // Cast a dummy visual spell asynchronously here to signal
+ // that the AI was hot swapped
+ creature->m_Events.AddEvent(new AsyncCastHotswapEffectEvent(creature),
+ creature->m_Events.CalculateTime(0));
+ }
+
+ // Hook which is called after a gameobject was swapped
+ static void LoadStage1(GameObject* gameobject)
+ {
+ ASSERT(!gameobject->AI(),
+ "The AI should be null here!");
+
+ gameobject->AIM_Initialize();
+ }
+
+ static void LoadStage2(GameObject* gameobject)
+ {
+ gameobject->AI()->Reset();
+ }
+
+ template<typename T>
+ void RunOverAllEntities(T fn)
+ {
+ auto evaluator = [&](std::unordered_map<ObjectGuid, ObjectType*>& objects)
+ {
+ for (auto object : objects)
+ fn(object.second);
+ };
+
+ AIFunctionMapWorker<typename std::decay<decltype(evaluator)>::type> worker(std::move(evaluator));
+ TypeContainerVisitor<decltype(worker), MapStoredObjectTypesContainer> visitor(worker);
- typedef std::map<uint32, TScript*> ScriptMap;
- typedef typename ScriptMap::iterator ScriptMapIterator;
+ sMapMgr->DoForAllMaps([&](Map* map)
+ {
+ // Run the worker over all maps
+ visitor.Visit(map->GetObjectsStore());
+ });
+ }
+
+public:
+ void BeforeReleaseContext(std::string const& context) final override
+ {
+ auto ids_to_remove = static_cast<Base*>(this)->GetScriptIDsToRemove(context);
- // The actual list of scripts. This will be accessed concurrently, so it must not be modified
- // after server startup.
- static ScriptMap ScriptPointerList;
+ std::vector<ObjectType*> stage2;
- static void AddScript(TScript* const script)
+ RunOverAllEntities([&](ObjectType* object)
{
- ASSERT(script);
+ if (ids_to_remove.find(object->GetScriptId()) != ids_to_remove.end())
+ {
+ UnloadStage1(object);
+ stage2.push_back(object);
+ }
+ });
+
+ for (auto object : stage2)
+ UnloadStage2(object);
+
+ // Add the new ids which are removed to the global ids to remove set
+ ids_removed_.insert(ids_to_remove.begin(), ids_to_remove.end());
+ }
+
+ void BeforeSwapContext(bool initialize) override
+ {
+ // Never swap creature or gameobject scripts when initializing
+ if (initialize)
+ return;
+
+ // Add the recently added scripts to the deleted scripts to replace
+ // default AI's with recently added core scripts.
+ ids_removed_.insert(static_cast<Base*>(this)->GetRecentlyAddedScriptIDs().begin(),
+ static_cast<Base*>(this)->GetRecentlyAddedScriptIDs().end());
+
+ std::vector<ObjectType*> remove;
+ std::vector<ObjectType*> stage2;
- // See if the script is using the same memory as another script. If this happens, it means that
- // someone forgot to allocate new memory for a script.
- for (ScriptMapIterator it = ScriptPointerList.begin(); it != ScriptPointerList.end(); ++it)
+ RunOverAllEntities([&](ObjectType* object)
+ {
+ if (ids_removed_.find(object->GetScriptId()) != ids_removed_.end())
{
- if (it->second == script)
+ if (object->AI())
{
- TC_LOG_ERROR("scripts", "Script '%s' has same memory pointer as '%s'.",
- script->GetName().c_str(), it->second->GetName().c_str());
-
- return;
+ // Overwrite existing (default) AI's which are replaced by a new script
+ UnloadStage1(object);
+ remove.push_back(object);
}
+
+ stage2.push_back(object);
}
+ });
+
+ for (auto object : remove)
+ UnloadStage2(object);
+
+ for (auto object : stage2)
+ LoadStage1(object);
+
+ for (auto object : stage2)
+ LoadStage2(object);
+
+ ids_removed_.clear();
+ }
+
+ void BeforeUnload() final override
+ {
+ ASSERT(ids_removed_.empty());
+ }
- AddScript(is_script_database_bound<TScript>{}, script);
+private:
+ std::unordered_set<uint32> ids_removed_;
+};
+
+// This hook is responsible for swapping CreatureAI's
+template<typename Base>
+class ScriptRegistrySwapHooks<CreatureScript, Base>
+ : public CreatureGameObjectScriptRegistrySwapHooks<
+ Creature, CreatureScript, Base
+ > { };
+
+// This hook is responsible for swapping GameObjectAI's
+template<typename Base>
+class ScriptRegistrySwapHooks<GameObjectScript, Base>
+ : public CreatureGameObjectScriptRegistrySwapHooks<
+ GameObject, GameObjectScript, Base
+ > { };
+
+/// This hook is responsible for swapping BattlegroundScript's
+template<typename Base>
+class ScriptRegistrySwapHooks<BattlegroundScript, Base>
+ : public UnsupportedScriptRegistrySwapHooks<Base> { };
+
+/// This hook is responsible for swapping OutdoorPvP's
+template<typename Base>
+class ScriptRegistrySwapHooks<OutdoorPvPScript, Base>
+ : public ScriptRegistrySwapHookBase
+{
+public:
+ ScriptRegistrySwapHooks() : swapped(false) { }
+
+ void BeforeReleaseContext(std::string const& context) final override
+ {
+ auto const bounds = static_cast<Base*>(this)->_ids_of_contexts.equal_range(context);
+
+ if ((!swapped) && (bounds.first != bounds.second))
+ {
+ swapped = true;
+ sOutdoorPvPMgr->Die();
}
+ }
- // Gets a script by its ID (assigned by ObjectMgr).
- static TScript* GetScriptById(uint32 id)
+ void BeforeSwapContext(bool initialize) override
+ {
+ // Never swap outdoor pvp scripts when initializing
+ if ((!initialize) && swapped)
{
- ScriptMapIterator it = ScriptPointerList.find(id);
- if (it != ScriptPointerList.end())
- return it->second;
+ sOutdoorPvPMgr->InitOutdoorPvP();
+ swapped = false;
+ }
+ }
+
+ void BeforeUnload() final override
+ {
+ ASSERT(!swapped);
+ }
- return NULL;
+private:
+ bool swapped;
+};
+
+/// This hook is responsible for swapping InstanceMapScript's
+template<typename Base>
+class ScriptRegistrySwapHooks<InstanceMapScript, Base>
+ : public ScriptRegistrySwapHookBase
+{
+public:
+ ScriptRegistrySwapHooks() : swapped(false) { }
+
+ void BeforeReleaseContext(std::string const& context) final override
+ {
+ auto const bounds = static_cast<Base*>(this)->_ids_of_contexts.equal_range(context);
+ if (bounds.first != bounds.second)
+ swapped = true;
+ }
+
+ void BeforeSwapContext(bool /*initialize*/) override
+ {
+ swapped = false;
+ }
+
+ void BeforeUnload() final override
+ {
+ ASSERT(!swapped);
+ }
+
+private:
+ bool swapped;
+};
+
+/// This hook is responsible for swapping SpellScriptLoader's
+template<typename Base>
+class ScriptRegistrySwapHooks<SpellScriptLoader, Base>
+ : public ScriptRegistrySwapHookBase
+{
+public:
+ ScriptRegistrySwapHooks() : swapped(false) { }
+
+ void BeforeReleaseContext(std::string const& context) final override
+ {
+ auto const bounds = static_cast<Base*>(this)->_ids_of_contexts.equal_range(context);
+
+ if (bounds.first != bounds.second)
+ swapped = true;
+ }
+
+ void BeforeSwapContext(bool /*initialize*/) override
+ {
+ if (swapped)
+ {
+ sObjectMgr->ValidateSpellScripts();
+ swapped = false;
}
+ }
- private:
+ void BeforeUnload() final override
+ {
+ ASSERT(!swapped);
+ }
+
+private:
+ bool swapped;
+};
+
+// Database bound script registry
+template<typename ScriptType>
+class SpecializedScriptRegistry<ScriptType, true>
+ : public ScriptRegistryInterface,
+ public ScriptRegistrySwapHooks<ScriptType, ScriptRegistry<ScriptType>>
+{
+ template<typename>
+ friend class UnsupportedScriptRegistrySwapHooks;
- // Adds a database bound script
- static void AddScript(std::true_type, TScript* const script)
+ template<typename, typename>
+ friend class ScriptRegistrySwapHooks;
+
+ template<typename, typename, typename>
+ friend class CreatureGameObjectScriptRegistrySwapHooks;
+
+public:
+ SpecializedScriptRegistry() { }
+
+ typedef std::unordered_map<
+ uint32 /*script id*/,
+ std::unique_ptr<ScriptType>
+ > ScriptStoreType;
+
+ typedef typename ScriptStoreType::iterator ScriptStoreIteratorType;
+
+ void ReleaseContext(std::string const& context) final override
+ {
+ this->BeforeReleaseContext(context);
+
+ auto const bounds = _ids_of_contexts.equal_range(context);
+ for (auto itr = bounds.first; itr != bounds.second; ++itr)
+ _scripts.erase(itr->second);
+ }
+
+ void SwapContext(bool initialize) final override
+ {
+ this->BeforeSwapContext(initialize);
+
+ _recently_added_ids.clear();
+ }
+
+ void RemoveUsedScriptsFromContainer(std::unordered_set<std::string>& scripts) final override
+ {
+ for (auto const& script : _scripts)
+ scripts.erase(script.second->GetName());
+ }
+
+ void Unload() final override
+ {
+ this->BeforeUnload();
+
+ ASSERT(_recently_added_ids.empty(),
+ "Recently added script ids should be empty here!");
+
+ _scripts.clear();
+ _ids_of_contexts.clear();
+ }
+
+ // Adds a database bound script
+ void AddScript(ScriptType* script)
+ {
+ ASSERT(script,
+ "Tried to call AddScript with a nullpointer!");
+ ASSERT(!sScriptMgr->GetCurrentScriptContext().empty(),
+ "Tried to register a script without being in a valid script context!");
+
+ std::unique_ptr<ScriptType> script_ptr(script);
+
+ // Get an ID for the script. An ID only exists if it's a script that is assigned in the database
+ // through a script name (or similar).
+ if (uint32 const id = sObjectMgr->GetScriptId(script->GetName()))
{
- // Get an ID for the script. An ID only exists if it's a script that is assigned in the database
- // through a script name (or similar).
- uint32 id = sObjectMgr->GetScriptId(script->GetName());
- if (id)
+ // Try to find an existing script.
+ for (auto const& stored_script : _scripts)
{
- // Try to find an existing script.
- bool existing = false;
- for (ScriptMapIterator it = ScriptPointerList.begin(); it != ScriptPointerList.end(); ++it)
- {
- // If the script names match...
- if (it->second->GetName() == script->GetName())
- {
- // ... It exists.
- existing = true;
- break;
- }
- }
-
- // If the script isn't assigned -> assign it!
- if (!existing)
- {
- ScriptPointerList[id] = script;
- sScriptMgr->IncrementScriptCount();
-
- #ifdef SCRIPTS
- UnusedScriptNamesContainer::iterator itr = std::lower_bound(UnusedScriptNames.begin(), UnusedScriptNames.end(), script->GetName());
- if (itr != UnusedScriptNames.end() && *itr == script->GetName())
- UnusedScriptNames.erase(itr);
- #endif
- }
- else
+ // If the script names match...
+ if (stored_script.second->GetName() == script->GetName())
{
// If the script is already assigned -> delete it!
- TC_LOG_ERROR("scripts", "Script '%s' already assigned with the same script name, so the script can't work.",
- script->GetName().c_str());
+ TC_LOG_ERROR("scripts", "Script '%s' already assigned with the same script name, "
+ "so the script can't work.", script->GetName().c_str());
- ABORT(); // Error that should be fixed ASAP.
+ // Error that should be fixed ASAP.
+ sScriptRegistryCompositum->QueueForDelayedDelete(std::move(script_ptr));
+ ABORT();
+ return;
}
}
- else
+
+ // If the script isn't assigned -> assign it!
+ _scripts.insert(std::make_pair(id, std::move(script_ptr)));
+ _ids_of_contexts.insert(std::make_pair(sScriptMgr->GetCurrentScriptContext(), id));
+ _recently_added_ids.insert(id);
+
+ sScriptRegistryCompositum->SetScriptNameInContext(script->GetName(),
+ sScriptMgr->GetCurrentScriptContext());
+ }
+ else
+ {
+ // The script uses a script name from database, but isn't assigned to anything.
+ TC_LOG_ERROR("sql.sql", "Script named '%s' does not have a script name assigned in database.",
+ script->GetName().c_str());
+
+ // Avoid calling "delete script;" because we are currently in the script constructor
+ // In a valid scenario this will not happen because every script has a name assigned in the database
+ sScriptRegistryCompositum->QueueForDelayedDelete(std::move(script_ptr));
+ return;
+ }
+ }
+
+ // Gets a script by its ID (assigned by ObjectMgr).
+ ScriptType* GetScriptById(uint32 id)
+ {
+ auto const itr = _scripts.find(id);
+ if (itr != _scripts.end())
+ return itr->second.get();
+
+ return nullptr;
+ }
+
+ ScriptStoreType& GetScripts()
+ {
+ return _scripts;
+ }
+
+protected:
+ // Returns the script id's which are registered to a certain context
+ std::unordered_set<uint32> GetScriptIDsToRemove(std::string const& context) const
+ {
+ // Create a set of all ids which are removed
+ std::unordered_set<uint32> scripts_to_remove;
+
+ auto const bounds = _ids_of_contexts.equal_range(context);
+ for (auto itr = bounds.first; itr != bounds.second; ++itr)
+ scripts_to_remove.insert(itr->second);
+
+ return scripts_to_remove;
+ }
+
+ std::unordered_set<uint32> const& GetRecentlyAddedScriptIDs() const
+ {
+ return _recently_added_ids;
+ }
+
+private:
+ ScriptStoreType _scripts;
+
+ // Scripts of a specific context
+ std::unordered_multimap<std::string /*context*/, uint32 /*id*/> _ids_of_contexts;
+
+ // Script id's which were registered recently
+ std::unordered_set<uint32> _recently_added_ids;
+};
+
+/// This hook is responsible for swapping CommandScript's
+template<typename Base>
+class ScriptRegistrySwapHooks<CommandScript, Base>
+ : public ScriptRegistrySwapHookBase
+{
+public:
+ void BeforeReleaseContext(std::string const& /*context*/) final override
+ {
+ ChatHandler::invalidateCommandTable();
+ }
+
+ void BeforeSwapContext(bool /*initialize*/) override
+ {
+ ChatHandler::invalidateCommandTable();
+ }
+
+ void BeforeUnload() final override
+ {
+ ChatHandler::invalidateCommandTable();
+ }
+};
+
+// Database unbound script registry
+template<typename ScriptType>
+class SpecializedScriptRegistry<ScriptType, false>
+ : public ScriptRegistryInterface,
+ public ScriptRegistrySwapHooks<ScriptType, ScriptRegistry<ScriptType>>
+{
+ template<typename, typename>
+ friend class ScriptRegistrySwapHooks;
+
+public:
+ typedef std::unordered_multimap<std::string /*context*/, std::unique_ptr<ScriptType>> ScriptStoreType;
+ typedef typename ScriptStoreType::iterator ScriptStoreIteratorType;
+
+ SpecializedScriptRegistry() { }
+
+ void ReleaseContext(std::string const& context) final override
+ {
+ this->BeforeReleaseContext(context);
+
+ _scripts.erase(context);
+ }
+
+ void SwapContext(bool initialize) final override
+ {
+ this->BeforeSwapContext(initialize);
+ }
+
+ void RemoveUsedScriptsFromContainer(std::unordered_set<std::string>& scripts) final override
+ {
+ for (auto const& script : _scripts)
+ scripts.erase(script.second->GetName());
+ }
+
+ void Unload() final override
+ {
+ this->BeforeUnload();
+
+ _scripts.clear();
+ }
+
+ // Adds a non database bound script
+ void AddScript(ScriptType* script)
+ {
+ ASSERT(script,
+ "Tried to call AddScript with a nullpointer!");
+ ASSERT(!sScriptMgr->GetCurrentScriptContext().empty(),
+ "Tried to register a script without being in a valid script context!");
+
+ std::unique_ptr<ScriptType> script_ptr(script);
+
+ for (auto const& entry : _scripts)
+ if (entry.second.get() == script)
{
- // The script uses a script name from database, but isn't assigned to anything.
- TC_LOG_ERROR("sql.sql", "Script named '%s' does not have a script name assigned in database.", script->GetName().c_str());
+ static_cast<ScriptRegistry<ScriptType>*>(this)->
+ LogDuplicatedScriptPointerError(script, entry.second.get());
- // Avoid calling "delete script;" because we are currently in the script constructor
- // In a valid scenario this will not happen because every script has a name assigned in the database
- UnusedScripts.push_back(script);
+ sScriptRegistryCompositum->QueueForDelayedDelete(std::move(script_ptr));
return;
}
- }
- // Adds a non database bound script
- static void AddScript(std::false_type, TScript* const script)
- {
- // We're dealing with a code-only script; just add it.
- ScriptPointerList[_scriptIdCounter++] = script;
- sScriptMgr->IncrementScriptCount();
- }
+ // We're dealing with a code-only script, just add it.
+ _scripts.insert(std::make_pair(sScriptMgr->GetCurrentScriptContext(), std::move(script_ptr)));
+ }
+
+ ScriptStoreType& GetScripts()
+ {
+ return _scripts;
+ }
- // Counter used for code-only scripts.
- static uint32 _scriptIdCounter;
+private:
+ ScriptStoreType _scripts;
};
// Utility macros to refer to the script registry.
-#define SCR_REG_MAP(T) ScriptRegistry<T>::ScriptMap
-#define SCR_REG_ITR(T) ScriptRegistry<T>::ScriptMapIterator
-#define SCR_REG_LST(T) ScriptRegistry<T>::ScriptPointerList
+#define SCR_REG_MAP(T) ScriptRegistry<T>::ScriptStoreType
+#define SCR_REG_ITR(T) ScriptRegistry<T>::ScriptStoreIteratorType
+#define SCR_REG_LST(T) ScriptRegistry<T>::Instance()->GetScripts()
// Utility macros for looping over scripts.
#define FOR_SCRIPTS(T, C, E) \
if (SCR_REG_LST(T).empty()) \
return; \
+ \
for (SCR_REG_ITR(T) C = SCR_REG_LST(T).begin(); \
C != SCR_REG_LST(T).end(); ++C)
+
#define FOR_SCRIPTS_RET(T, C, E, R) \
if (SCR_REG_LST(T).empty()) \
return R; \
+ \
for (SCR_REG_ITR(T) C = SCR_REG_LST(T).begin(); \
C != SCR_REG_LST(T).end(); ++C)
+
#define FOREACH_SCRIPT(T) \
FOR_SCRIPTS(T, itr, end) \
- itr->second
+ itr->second
// Utility macros for finding specific scripts.
#define GET_SCRIPT(T, I, V) \
- T* V = ScriptRegistry<T>::GetScriptById(I); \
+ T* V = ScriptRegistry<T>::Instance()->GetScriptById(I); \
if (!V) \
return;
+
#define GET_SCRIPT_RET(T, I, V, R) \
- T* V = ScriptRegistry<T>::GetScriptById(I); \
+ T* V = ScriptRegistry<T>::Instance()->GetScriptById(I); \
if (!V) \
return R;
@@ -242,14 +950,34 @@ struct TSpellSummary
uint8 Effects; // set of enum SelectEffect
} *SpellSummary;
-ScriptMgr::ScriptMgr() : _scriptCount(0), _scheduledScripts(0)
+ScriptObject::ScriptObject(const char* name) : _name(name)
+{
+ sScriptMgr->IncreaseScriptCount();
+}
+
+ScriptObject::~ScriptObject()
+{
+ sScriptMgr->DecreaseScriptCount();
+}
+
+ScriptMgr::ScriptMgr()
+ : _scriptCount(0), _script_loader_callback(nullptr)
{
}
ScriptMgr::~ScriptMgr() { }
+ScriptMgr* ScriptMgr::instance()
+{
+ static ScriptMgr instance;
+ return &instance;
+}
+
void ScriptMgr::Initialize()
{
+ ASSERT(sSpellMgr->GetSpellInfo(SPELL_HOTSWAP_VISUAL_SPELL_EFFECT)
+ && "Reload hotswap spell effect for creatures isn't valid!");
+
uint32 oldMSTime = getMSTime();
LoadDatabase();
@@ -257,68 +985,95 @@ void ScriptMgr::Initialize()
TC_LOG_INFO("server.loading", "Loading C++ scripts");
FillSpellSummary();
- AddScripts();
-#ifdef SCRIPTS
- for (std::string const& scriptName : UnusedScriptNames)
+ // Load core scripts
+ SetScriptContext(GetNameOfStaticContext());
+
+ // SmartAI
+ AddSC_SmartScripts();
+
+ // LFGScripts
+ lfg::AddSC_LFGScripts();
+
+ // Load all static linked scripts through the script loader function.
+ ASSERT(_script_loader_callback,
+ "Script loader callback wasn't registered!");
+ _script_loader_callback();
+
+ // Initialize all dynamic scripts
+ // and finishes the context switch to do
+ // bulk loading
+ sScriptReloadMgr->Initialize();
+
+ // Loads all scripts from the current context
+ sScriptMgr->SwapScriptContext(true);
+
+ // Print unused script names.
+ std::unordered_set<std::string> unusedScriptNames(
+ sObjectMgr->GetAllScriptNames().begin(),
+ sObjectMgr->GetAllScriptNames().end());
+
+ // Remove the used scripts from the given container.
+ sScriptRegistryCompositum->RemoveUsedScriptsFromContainer(unusedScriptNames);
+
+ for (std::string const& scriptName : unusedScriptNames)
{
- TC_LOG_ERROR("sql.sql", "ScriptName '%s' exists in database, but no core script found!", scriptName.c_str());
+ // Avoid complaining about empty script names since the
+ // script name container contains a placeholder as the 0 element.
+ if (scriptName.empty())
+ continue;
+
+ TC_LOG_ERROR("sql.sql", "ScriptName '%s' exists in database, "
+ "but no core script found!", scriptName.c_str());
}
-#endif
- UnloadUnusedScripts();
+ TC_LOG_INFO("server.loading", ">> Loaded %u C++ scripts in %u ms",
+ GetScriptCount(), GetMSTimeDiffToNow(oldMSTime));
+}
- TC_LOG_INFO("server.loading", ">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime));
+void ScriptMgr::SetScriptContext(std::string const& context)
+{
+ _currentContext = context;
}
-void ScriptMgr::Unload()
+void ScriptMgr::SwapScriptContext(bool initialize)
{
- #define SCR_CLEAR(T) \
- for (SCR_REG_ITR(T) itr = SCR_REG_LST(T).begin(); itr != SCR_REG_LST(T).end(); ++itr) \
- delete itr->second; \
- SCR_REG_LST(T).clear();
-
- // Clear scripts for every script type.
- SCR_CLEAR(SpellScriptLoader);
- SCR_CLEAR(ServerScript);
- SCR_CLEAR(WorldScript);
- SCR_CLEAR(FormulaScript);
- SCR_CLEAR(WorldMapScript);
- SCR_CLEAR(InstanceMapScript);
- SCR_CLEAR(BattlegroundMapScript);
- SCR_CLEAR(ItemScript);
- SCR_CLEAR(CreatureScript);
- SCR_CLEAR(GameObjectScript);
- SCR_CLEAR(AreaTriggerScript);
- SCR_CLEAR(BattlegroundScript);
- SCR_CLEAR(OutdoorPvPScript);
- SCR_CLEAR(CommandScript);
- SCR_CLEAR(WeatherScript);
- SCR_CLEAR(AuctionHouseScript);
- SCR_CLEAR(ConditionScript);
- SCR_CLEAR(VehicleScript);
- SCR_CLEAR(DynamicObjectScript);
- SCR_CLEAR(TransportScript);
- SCR_CLEAR(AchievementCriteriaScript);
- SCR_CLEAR(PlayerScript);
- SCR_CLEAR(AccountScript);
- SCR_CLEAR(GuildScript);
- SCR_CLEAR(GroupScript);
- SCR_CLEAR(UnitScript);
-
- #undef SCR_CLEAR
-
- UnloadUnusedScripts();
+ sScriptRegistryCompositum->SwapContext(initialize);
+ _currentContext.clear();
+}
- delete[] SpellSummary;
- delete[] UnitAI::AISpellInfo;
+std::string const& ScriptMgr::GetNameOfStaticContext()
+{
+ static std::string const name = "___static___";
+ return name;
}
-void ScriptMgr::UnloadUnusedScripts()
+void ScriptMgr::ReleaseScriptContext(std::string const& context)
{
- for (size_t i = 0; i < UnusedScripts.size(); ++i)
- delete UnusedScripts[i];
- UnusedScripts.clear();
+ sScriptRegistryCompositum->ReleaseContext(context);
+}
+
+std::shared_ptr<ModuleReference>
+ ScriptMgr::AcquireModuleReferenceOfScriptName(std::string const& scriptname) const
+{
+#ifdef TRINITY_API_USE_DYNAMIC_LINKING
+ // Returns the reference to the module of the given scriptname
+ return ScriptReloadMgr::AcquireModuleReferenceOfContext(
+ sScriptRegistryCompositum->GetScriptContextOfScriptName(scriptname));
+#else
+ (void)scriptname;
+ // Something went wrong when this function is used in
+ // a static linked context.
+ WPAbort();
+#endif // #ifndef TRINITY_API_USE_DYNAMIC_LINKING
+}
+
+void ScriptMgr::Unload()
+{
+ sScriptRegistryCompositum->Unload();
+
+ delete[] SpellSummary;
+ delete[] UnitAI::AISpellInfo;
}
void ScriptMgr::LoadDatabase()
@@ -413,38 +1168,22 @@ void ScriptMgr::FillSpellSummary()
}
}
-void ScriptMgr::CreateSpellScripts(uint32 spellId, std::list<SpellScript*>& scriptVector)
+template<typename T, typename F>
+void CreateSpellOrAuraScripts(uint32 spellId, std::list<T*>& scriptVector, F&& extractor)
{
SpellScriptsBounds bounds = sObjectMgr->GetSpellScriptsBounds(spellId);
for (SpellScriptsContainer::iterator itr = bounds.first; itr != bounds.second; ++itr)
{
- SpellScriptLoader* tmpscript = ScriptRegistry<SpellScriptLoader>::GetScriptById(itr->second);
- if (!tmpscript)
- continue;
-
- SpellScript* script = tmpscript->GetSpellScript();
-
- if (!script)
+ // When the script is disabled continue with the next one
+ if (!itr->second.second)
continue;
- script->_Init(&tmpscript->GetName(), spellId);
-
- scriptVector.push_back(script);
- }
-}
-
-void ScriptMgr::CreateAuraScripts(uint32 spellId, std::list<AuraScript*>& scriptVector)
-{
- SpellScriptsBounds bounds = sObjectMgr->GetSpellScriptsBounds(spellId);
-
- for (SpellScriptsContainer::iterator itr = bounds.first; itr != bounds.second; ++itr)
- {
- SpellScriptLoader* tmpscript = ScriptRegistry<SpellScriptLoader>::GetScriptById(itr->second);
+ SpellScriptLoader* tmpscript = sScriptMgr->GetSpellScriptLoader(itr->second.first);
if (!tmpscript)
continue;
- AuraScript* script = tmpscript->GetAuraScript();
+ T* script = (*tmpscript.*extractor)();
if (!script)
continue;
@@ -455,19 +1194,19 @@ void ScriptMgr::CreateAuraScripts(uint32 spellId, std::list<AuraScript*>& script
}
}
-void ScriptMgr::CreateSpellScriptLoaders(uint32 spellId, std::vector<std::pair<SpellScriptLoader*, SpellScriptsContainer::iterator> >& scriptVector)
+void ScriptMgr::CreateSpellScripts(uint32 spellId, std::list<SpellScript*>& scriptVector)
{
- SpellScriptsBounds bounds = sObjectMgr->GetSpellScriptsBounds(spellId);
- scriptVector.reserve(std::distance(bounds.first, bounds.second));
+ CreateSpellOrAuraScripts(spellId, scriptVector, &SpellScriptLoader::GetSpellScript);
+}
- for (SpellScriptsContainer::iterator itr = bounds.first; itr != bounds.second; ++itr)
- {
- SpellScriptLoader* tmpscript = ScriptRegistry<SpellScriptLoader>::GetScriptById(itr->second);
- if (!tmpscript)
- continue;
+void ScriptMgr::CreateAuraScripts(uint32 spellId, std::list<AuraScript*>& scriptVector)
+{
+ CreateSpellOrAuraScripts(spellId, scriptVector, &SpellScriptLoader::GetAuraScript);
+}
- scriptVector.push_back(std::make_pair(tmpscript, itr));
- }
+SpellScriptLoader* ScriptMgr::GetSpellScriptLoader(uint32 scriptId)
+{
+ return ScriptRegistry<SpellScriptLoader>::Instance()->GetScriptById(scriptId);
}
void ScriptMgr::OnNetworkStart()
@@ -514,17 +1253,6 @@ void ScriptMgr::OnPacketSend(WorldSession* session, WorldPacket const& packet)
FOREACH_SCRIPT(ServerScript)->OnPacketSend(session, copy);
}
-void ScriptMgr::OnUnknownPacketReceive(WorldSession* session, WorldPacket const& packet)
-{
- ASSERT(session);
-
- if (SCR_REG_LST(ServerScript).empty())
- return;
-
- WorldPacket copy(packet);
- FOREACH_SCRIPT(ServerScript)->OnUnknownPacketReceive(session, copy);
-}
-
void ScriptMgr::OnOpenStateChange(bool open)
{
FOREACH_SCRIPT(WorldScript)->OnOpenStateChange(open);
@@ -1506,57 +2234,62 @@ void ScriptMgr::OnGroupDisband(Group* group)
void ScriptMgr::OnHeal(Unit* healer, Unit* reciever, uint32& gain)
{
FOREACH_SCRIPT(UnitScript)->OnHeal(healer, reciever, gain);
+ FOREACH_SCRIPT(PlayerScript)->OnHeal(healer, reciever, gain);
}
void ScriptMgr::OnDamage(Unit* attacker, Unit* victim, uint32& damage)
{
FOREACH_SCRIPT(UnitScript)->OnDamage(attacker, victim, damage);
+ FOREACH_SCRIPT(PlayerScript)->OnDamage(attacker, victim, damage);
}
void ScriptMgr::ModifyPeriodicDamageAurasTick(Unit* target, Unit* attacker, uint32& damage)
{
FOREACH_SCRIPT(UnitScript)->ModifyPeriodicDamageAurasTick(target, attacker, damage);
+ FOREACH_SCRIPT(PlayerScript)->ModifyPeriodicDamageAurasTick(target, attacker, damage);
}
void ScriptMgr::ModifyMeleeDamage(Unit* target, Unit* attacker, uint32& damage)
{
FOREACH_SCRIPT(UnitScript)->ModifyMeleeDamage(target, attacker, damage);
+ FOREACH_SCRIPT(PlayerScript)->ModifyMeleeDamage(target, attacker, damage);
}
void ScriptMgr::ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& damage)
{
FOREACH_SCRIPT(UnitScript)->ModifySpellDamageTaken(target, attacker, damage);
+ FOREACH_SCRIPT(PlayerScript)->ModifySpellDamageTaken(target, attacker, damage);
}
SpellScriptLoader::SpellScriptLoader(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<SpellScriptLoader>::AddScript(this);
+ ScriptRegistry<SpellScriptLoader>::Instance()->AddScript(this);
}
ServerScript::ServerScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<ServerScript>::AddScript(this);
+ ScriptRegistry<ServerScript>::Instance()->AddScript(this);
}
WorldScript::WorldScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<WorldScript>::AddScript(this);
+ ScriptRegistry<WorldScript>::Instance()->AddScript(this);
}
FormulaScript::FormulaScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<FormulaScript>::AddScript(this);
+ ScriptRegistry<FormulaScript>::Instance()->AddScript(this);
}
UnitScript::UnitScript(const char* name, bool addToScripts)
: ScriptObject(name)
{
if (addToScripts)
- ScriptRegistry<UnitScript>::AddScript(this);
+ ScriptRegistry<UnitScript>::Instance()->AddScript(this);
}
WorldMapScript::WorldMapScript(const char* name, uint32 mapId)
@@ -1565,7 +2298,7 @@ WorldMapScript::WorldMapScript(const char* name, uint32 mapId)
if (GetEntry() && !GetEntry()->IsWorldMap())
TC_LOG_ERROR("scripts", "WorldMapScript for map %u is invalid.", mapId);
- ScriptRegistry<WorldMapScript>::AddScript(this);
+ ScriptRegistry<WorldMapScript>::Instance()->AddScript(this);
}
InstanceMapScript::InstanceMapScript(const char* name, uint32 mapId)
@@ -1574,7 +2307,7 @@ InstanceMapScript::InstanceMapScript(const char* name, uint32 mapId)
if (GetEntry() && !GetEntry()->IsDungeon())
TC_LOG_ERROR("scripts", "InstanceMapScript for map %u is invalid.", mapId);
- ScriptRegistry<InstanceMapScript>::AddScript(this);
+ ScriptRegistry<InstanceMapScript>::Instance()->AddScript(this);
}
BattlegroundMapScript::BattlegroundMapScript(const char* name, uint32 mapId)
@@ -1583,155 +2316,141 @@ BattlegroundMapScript::BattlegroundMapScript(const char* name, uint32 mapId)
if (GetEntry() && !GetEntry()->IsBattleground())
TC_LOG_ERROR("scripts", "BattlegroundMapScript for map %u is invalid.", mapId);
- ScriptRegistry<BattlegroundMapScript>::AddScript(this);
+ ScriptRegistry<BattlegroundMapScript>::Instance()->AddScript(this);
}
ItemScript::ItemScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<ItemScript>::AddScript(this);
+ ScriptRegistry<ItemScript>::Instance()->AddScript(this);
}
CreatureScript::CreatureScript(const char* name)
: UnitScript(name, false)
{
- ScriptRegistry<CreatureScript>::AddScript(this);
+ ScriptRegistry<CreatureScript>::Instance()->AddScript(this);
}
GameObjectScript::GameObjectScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<GameObjectScript>::AddScript(this);
+ ScriptRegistry<GameObjectScript>::Instance()->AddScript(this);
}
AreaTriggerScript::AreaTriggerScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<AreaTriggerScript>::AddScript(this);
+ ScriptRegistry<AreaTriggerScript>::Instance()->AddScript(this);
}
BattlegroundScript::BattlegroundScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<BattlegroundScript>::AddScript(this);
+ ScriptRegistry<BattlegroundScript>::Instance()->AddScript(this);
}
OutdoorPvPScript::OutdoorPvPScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<OutdoorPvPScript>::AddScript(this);
+ ScriptRegistry<OutdoorPvPScript>::Instance()->AddScript(this);
}
CommandScript::CommandScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<CommandScript>::AddScript(this);
+ ScriptRegistry<CommandScript>::Instance()->AddScript(this);
}
WeatherScript::WeatherScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<WeatherScript>::AddScript(this);
+ ScriptRegistry<WeatherScript>::Instance()->AddScript(this);
}
AuctionHouseScript::AuctionHouseScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<AuctionHouseScript>::AddScript(this);
+ ScriptRegistry<AuctionHouseScript>::Instance()->AddScript(this);
}
ConditionScript::ConditionScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<ConditionScript>::AddScript(this);
+ ScriptRegistry<ConditionScript>::Instance()->AddScript(this);
}
VehicleScript::VehicleScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<VehicleScript>::AddScript(this);
+ ScriptRegistry<VehicleScript>::Instance()->AddScript(this);
}
DynamicObjectScript::DynamicObjectScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<DynamicObjectScript>::AddScript(this);
+ ScriptRegistry<DynamicObjectScript>::Instance()->AddScript(this);
}
TransportScript::TransportScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<TransportScript>::AddScript(this);
+ ScriptRegistry<TransportScript>::Instance()->AddScript(this);
}
AchievementCriteriaScript::AchievementCriteriaScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<AchievementCriteriaScript>::AddScript(this);
+ ScriptRegistry<AchievementCriteriaScript>::Instance()->AddScript(this);
}
PlayerScript::PlayerScript(const char* name)
: UnitScript(name, false)
{
- ScriptRegistry<PlayerScript>::AddScript(this);
+ ScriptRegistry<PlayerScript>::Instance()->AddScript(this);
}
AccountScript::AccountScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<AccountScript>::AddScript(this);
+ ScriptRegistry<AccountScript>::Instance()->AddScript(this);
}
GuildScript::GuildScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<GuildScript>::AddScript(this);
+ ScriptRegistry<GuildScript>::Instance()->AddScript(this);
}
GroupScript::GroupScript(const char* name)
: ScriptObject(name)
{
- ScriptRegistry<GroupScript>::AddScript(this);
+ ScriptRegistry<GroupScript>::Instance()->AddScript(this);
}
-// Instantiate static members of ScriptRegistry.
-template<class TScript> std::map<uint32, TScript*> ScriptRegistry<TScript>::ScriptPointerList;
-template<class TScript> uint32 ScriptRegistry<TScript>::_scriptIdCounter = 0;
-
// Specialize for each script type class like so:
-template class ScriptRegistry<SpellScriptLoader>;
-template class ScriptRegistry<ServerScript>;
-template class ScriptRegistry<WorldScript>;
-template class ScriptRegistry<FormulaScript>;
-template class ScriptRegistry<WorldMapScript>;
-template class ScriptRegistry<InstanceMapScript>;
-template class ScriptRegistry<BattlegroundMapScript>;
-template class ScriptRegistry<ItemScript>;
-template class ScriptRegistry<CreatureScript>;
-template class ScriptRegistry<GameObjectScript>;
-template class ScriptRegistry<AreaTriggerScript>;
-template class ScriptRegistry<BattlegroundScript>;
-template class ScriptRegistry<OutdoorPvPScript>;
-template class ScriptRegistry<CommandScript>;
-template class ScriptRegistry<WeatherScript>;
-template class ScriptRegistry<AuctionHouseScript>;
-template class ScriptRegistry<ConditionScript>;
-template class ScriptRegistry<VehicleScript>;
-template class ScriptRegistry<DynamicObjectScript>;
-template class ScriptRegistry<TransportScript>;
-template class ScriptRegistry<AchievementCriteriaScript>;
-template class ScriptRegistry<PlayerScript>;
-template class ScriptRegistry<GuildScript>;
-template class ScriptRegistry<GroupScript>;
-template class ScriptRegistry<UnitScript>;
-template class ScriptRegistry<AccountScript>;
-
-// Undefine utility macros.
-#undef GET_SCRIPT_RET
-#undef GET_SCRIPT
-#undef FOREACH_SCRIPT
-#undef FOR_SCRIPTS_RET
-#undef FOR_SCRIPTS
-#undef SCR_REG_LST
-#undef SCR_REG_ITR
-#undef SCR_REG_MAP
+template class TC_GAME_API ScriptRegistry<SpellScriptLoader>;
+template class TC_GAME_API ScriptRegistry<ServerScript>;
+template class TC_GAME_API ScriptRegistry<WorldScript>;
+template class TC_GAME_API ScriptRegistry<FormulaScript>;
+template class TC_GAME_API ScriptRegistry<WorldMapScript>;
+template class TC_GAME_API ScriptRegistry<InstanceMapScript>;
+template class TC_GAME_API ScriptRegistry<BattlegroundMapScript>;
+template class TC_GAME_API ScriptRegistry<ItemScript>;
+template class TC_GAME_API ScriptRegistry<CreatureScript>;
+template class TC_GAME_API ScriptRegistry<GameObjectScript>;
+template class TC_GAME_API ScriptRegistry<AreaTriggerScript>;
+template class TC_GAME_API ScriptRegistry<BattlegroundScript>;
+template class TC_GAME_API ScriptRegistry<OutdoorPvPScript>;
+template class TC_GAME_API ScriptRegistry<CommandScript>;
+template class TC_GAME_API ScriptRegistry<WeatherScript>;
+template class TC_GAME_API ScriptRegistry<AuctionHouseScript>;
+template class TC_GAME_API ScriptRegistry<ConditionScript>;
+template class TC_GAME_API ScriptRegistry<VehicleScript>;
+template class TC_GAME_API ScriptRegistry<DynamicObjectScript>;
+template class TC_GAME_API ScriptRegistry<TransportScript>;
+template class TC_GAME_API ScriptRegistry<AchievementCriteriaScript>;
+template class TC_GAME_API ScriptRegistry<PlayerScript>;
+template class TC_GAME_API ScriptRegistry<GuildScript>;
+template class TC_GAME_API ScriptRegistry<GroupScript>;
+template class TC_GAME_API ScriptRegistry<UnitScript>;
+template class TC_GAME_API ScriptRegistry<AccountScript>;
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 6706c4f9c14..233e56aadb2 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -46,6 +46,7 @@ class InstanceMap;
class InstanceScript;
class Item;
class Map;
+class ModuleReference;
class OutdoorPvP;
class Player;
class Quest;
@@ -147,7 +148,7 @@ struct OutdoorPvPData;
event on all registered scripts of that type.
*/
-class ScriptObject
+class TC_GAME_API ScriptObject
{
friend class ScriptMgr;
@@ -157,14 +158,8 @@ class ScriptObject
protected:
- ScriptObject(const char* name)
- : _name(name)
- {
- }
-
- virtual ~ScriptObject()
- {
- }
+ ScriptObject(const char* name);
+ virtual ~ScriptObject();
private:
@@ -186,7 +181,7 @@ template<class TObject> class UpdatableScript
virtual void OnUpdate(TObject* /*obj*/, uint32 /*diff*/) { }
};
-class SpellScriptLoader : public ScriptObject
+class TC_GAME_API SpellScriptLoader : public ScriptObject
{
protected:
@@ -201,7 +196,7 @@ class SpellScriptLoader : public ScriptObject
virtual AuraScript* GetAuraScript() const { return NULL; }
};
-class ServerScript : public ScriptObject
+class TC_GAME_API ServerScript : public ScriptObject
{
protected:
@@ -229,13 +224,9 @@ class ServerScript : public ScriptObject
// Called when a (valid) packet is received by a client. The packet object is a copy of the original packet, so
// reading and modifying it is safe. Make sure to check WorldSession pointer before usage, it might be null in case of auth packets
virtual void OnPacketReceive(WorldSession* /*session*/, WorldPacket& /*packet*/) { }
-
- // Called when an invalid (unknown opcode) packet is received by a client. The packet is a reference to the orignal
- // packet; not a copy. This allows you to actually handle unknown packets (for whatever purpose).
- virtual void OnUnknownPacketReceive(WorldSession* /*session*/, WorldPacket& /*packet*/) { }
};
-class WorldScript : public ScriptObject
+class TC_GAME_API WorldScript : public ScriptObject
{
protected:
@@ -268,7 +259,7 @@ class WorldScript : public ScriptObject
virtual void OnShutdown() { }
};
-class FormulaScript : public ScriptObject
+class TC_GAME_API FormulaScript : public ScriptObject
{
protected:
@@ -335,14 +326,15 @@ template<class TMap> class MapScript : public UpdatableScript<TMap>
virtual void OnPlayerLeave(TMap* /*map*/, Player* /*player*/) { }
};
-class WorldMapScript : public ScriptObject, public MapScript<Map>
+class TC_GAME_API WorldMapScript : public ScriptObject, public MapScript<Map>
{
protected:
WorldMapScript(const char* name, uint32 mapId);
};
-class InstanceMapScript : public ScriptObject, public MapScript<InstanceMap>
+class TC_GAME_API InstanceMapScript
+ : public ScriptObject, public MapScript<InstanceMap>
{
protected:
@@ -354,14 +346,14 @@ class InstanceMapScript : public ScriptObject, public MapScript<InstanceMap>
virtual InstanceScript* GetInstanceScript(InstanceMap* /*map*/) const { return NULL; }
};
-class BattlegroundMapScript : public ScriptObject, public MapScript<BattlegroundMap>
+class TC_GAME_API BattlegroundMapScript : public ScriptObject, public MapScript<BattlegroundMap>
{
protected:
BattlegroundMapScript(const char* name, uint32 mapId);
};
-class ItemScript : public ScriptObject
+class TC_GAME_API ItemScript : public ScriptObject
{
protected:
@@ -385,7 +377,7 @@ class ItemScript : public ScriptObject
virtual bool OnRemove(Player* /*player*/, Item* /*item*/) { return false; }
};
-class UnitScript : public ScriptObject
+class TC_GAME_API UnitScript : public ScriptObject
{
protected:
@@ -408,7 +400,7 @@ class UnitScript : public ScriptObject
virtual void ModifySpellDamageTaken(Unit* /*target*/, Unit* /*attacker*/, int32& /*damage*/) { }
};
-class CreatureScript : public UnitScript, public UpdatableScript<Creature>
+class TC_GAME_API CreatureScript : public UnitScript, public UpdatableScript<Creature>
{
protected:
@@ -444,7 +436,7 @@ class CreatureScript : public UnitScript, public UpdatableScript<Creature>
virtual CreatureAI* GetAI(Creature* /*creature*/) const { return NULL; }
};
-class GameObjectScript : public ScriptObject, public UpdatableScript<GameObject>
+class TC_GAME_API GameObjectScript : public ScriptObject, public UpdatableScript<GameObject>
{
protected:
@@ -489,7 +481,7 @@ class GameObjectScript : public ScriptObject, public UpdatableScript<GameObject>
virtual GameObjectAI* GetAI(GameObject* /*go*/) const { return NULL; }
};
-class AreaTriggerScript : public ScriptObject
+class TC_GAME_API AreaTriggerScript : public ScriptObject
{
protected:
@@ -501,7 +493,7 @@ class AreaTriggerScript : public ScriptObject
virtual bool OnTrigger(Player* /*player*/, AreaTriggerEntry const* /*trigger*/) { return false; }
};
-class BattlegroundScript : public ScriptObject
+class TC_GAME_API BattlegroundScript : public ScriptObject
{
protected:
@@ -513,7 +505,7 @@ class BattlegroundScript : public ScriptObject
virtual Battleground* GetBattleground() const = 0;
};
-class OutdoorPvPScript : public ScriptObject
+class TC_GAME_API OutdoorPvPScript : public ScriptObject
{
protected:
@@ -525,7 +517,7 @@ class OutdoorPvPScript : public ScriptObject
virtual OutdoorPvP* GetOutdoorPvP() const = 0;
};
-class CommandScript : public ScriptObject
+class TC_GAME_API CommandScript : public ScriptObject
{
protected:
@@ -537,7 +529,7 @@ class CommandScript : public ScriptObject
virtual std::vector<ChatCommand> GetCommands() const = 0;
};
-class WeatherScript : public ScriptObject, public UpdatableScript<Weather>
+class TC_GAME_API WeatherScript : public ScriptObject, public UpdatableScript<Weather>
{
protected:
@@ -549,7 +541,7 @@ class WeatherScript : public ScriptObject, public UpdatableScript<Weather>
virtual void OnChange(Weather* /*weather*/, WeatherState /*state*/, float /*grade*/) { }
};
-class AuctionHouseScript : public ScriptObject
+class TC_GAME_API AuctionHouseScript : public ScriptObject
{
protected:
@@ -570,7 +562,7 @@ class AuctionHouseScript : public ScriptObject
virtual void OnAuctionExpire(AuctionHouseObject* /*ah*/, AuctionEntry* /*entry*/) { }
};
-class ConditionScript : public ScriptObject
+class TC_GAME_API ConditionScript : public ScriptObject
{
protected:
@@ -582,7 +574,7 @@ class ConditionScript : public ScriptObject
virtual bool OnConditionCheck(Condition const* /*condition*/, ConditionSourceInfo& /*sourceInfo*/) { return true; }
};
-class VehicleScript : public ScriptObject
+class TC_GAME_API VehicleScript : public ScriptObject
{
protected:
@@ -609,14 +601,14 @@ class VehicleScript : public ScriptObject
virtual void OnRemovePassenger(Vehicle* /*veh*/, Unit* /*passenger*/) { }
};
-class DynamicObjectScript : public ScriptObject, public UpdatableScript<DynamicObject>
+class TC_GAME_API DynamicObjectScript : public ScriptObject, public UpdatableScript<DynamicObject>
{
protected:
DynamicObjectScript(const char* name);
};
-class TransportScript : public ScriptObject, public UpdatableScript<Transport>
+class TC_GAME_API TransportScript : public ScriptObject, public UpdatableScript<Transport>
{
protected:
@@ -637,7 +629,7 @@ class TransportScript : public ScriptObject, public UpdatableScript<Transport>
virtual void OnRelocate(Transport* /*transport*/, uint32 /*waypointId*/, uint32 /*mapId*/, float /*x*/, float /*y*/, float /*z*/) { }
};
-class AchievementCriteriaScript : public ScriptObject
+class TC_GAME_API AchievementCriteriaScript : public ScriptObject
{
protected:
@@ -649,7 +641,7 @@ class AchievementCriteriaScript : public ScriptObject
virtual bool OnCheck(Player* source, Unit* target) = 0;
};
-class PlayerScript : public UnitScript
+class TC_GAME_API PlayerScript : public UnitScript
{
protected:
@@ -746,7 +738,7 @@ class PlayerScript : public UnitScript
virtual void OnQuestStatusChange(Player* /*player*/, uint32 /*questId*/, QuestStatus /*status*/) { }
};
-class AccountScript : public ScriptObject
+class TC_GAME_API AccountScript : public ScriptObject
{
protected:
@@ -773,7 +765,7 @@ class AccountScript : public ScriptObject
virtual void OnFailedPasswordChange(uint32 /*accountId*/) {}
};
-class GuildScript : public ScriptObject
+class TC_GAME_API GuildScript : public ScriptObject
{
protected:
@@ -814,7 +806,7 @@ class GuildScript : public ScriptObject
virtual void OnBankEvent(Guild* /*guild*/, uint8 /*eventType*/, uint8 /*tabId*/, ObjectGuid::LowType /*playerGuid*/, uint32 /*itemOrMoney*/, uint16 /*itemStackCount*/, uint8 /*destTabId*/) { }
};
-class GroupScript : public ScriptObject
+class TC_GAME_API GroupScript : public ScriptObject
{
protected:
@@ -838,20 +830,8 @@ class GroupScript : public ScriptObject
virtual void OnDisband(Group* /*group*/) { }
};
-// Placed here due to ScriptRegistry::AddScript dependency.
-#define sScriptMgr ScriptMgr::instance()
-
-// namespace
-// {
- typedef std::vector<ScriptObject*> UnusedScriptContainer;
- typedef std::list<std::string> UnusedScriptNamesContainer;
-
- extern UnusedScriptContainer UnusedScripts;
- extern UnusedScriptNamesContainer UnusedScriptNames;
-// }
-
// Manages registration, loading, and execution of scripts.
-class ScriptMgr
+class TC_GAME_API ScriptMgr
{
friend class ScriptObject;
@@ -859,32 +839,61 @@ class ScriptMgr
ScriptMgr();
virtual ~ScriptMgr();
+ void FillSpellSummary();
+ void LoadDatabase();
+
+ void IncreaseScriptCount() { ++_scriptCount; }
+ void DecreaseScriptCount() { --_scriptCount; }
+
public: /* Initialization */
- static ScriptMgr* instance()
- {
- static ScriptMgr instance;
- return &instance;
- }
+ static ScriptMgr* instance();
void Initialize();
- void LoadDatabase();
- void FillSpellSummary();
-
- const char* ScriptsVersion() const { return "Integrated Trinity Scripts"; }
- void IncrementScriptCount() { ++_scriptCount; }
uint32 GetScriptCount() const { return _scriptCount; }
+ typedef void(*ScriptLoaderCallbackType)();
+
+ /// Sets the script loader callback which is invoked to load scripts
+ /// (Workaround for circular dependency game <-> scripts)
+ void SetScriptLoader(ScriptLoaderCallbackType script_loader_callback)
+ {
+ _script_loader_callback = script_loader_callback;
+ }
+
+ public: /* Script contexts */
+ /// Set the current script context, which allows the ScriptMgr
+ /// to accept new scripts in this context.
+ /// Requires a SwapScriptContext() call afterwards to load the new scripts.
+ void SetScriptContext(std::string const& context);
+ /// Returns the current script context.
+ std::string const& GetCurrentScriptContext() const { return _currentContext; }
+ /// Releases all scripts associated with the given script context immediately.
+ /// Requires a SwapScriptContext() call afterwards to finish the unloading.
+ void ReleaseScriptContext(std::string const& context);
+ /// Executes all changed introduced by SetScriptContext and ReleaseScriptContext.
+ /// It is possible to combine multiple SetScriptContext and ReleaseScriptContext
+ /// calls for better performance (bulk changes).
+ void SwapScriptContext(bool initialize = false);
+
+ /// Returns the context name of the static context provided by the worldserver
+ static std::string const& GetNameOfStaticContext();
+
+ /// Acquires a strong module reference to the module containing the given script name,
+ /// which prevents the shared library which contains the script from unloading.
+ /// The shared library is lazy unloaded as soon as all references to it are released.
+ std::shared_ptr<ModuleReference> AcquireModuleReferenceOfScriptName(
+ std::string const& scriptname) const;
+
public: /* Unloading */
void Unload();
- void UnloadUnusedScripts();
public: /* SpellScriptLoader */
void CreateSpellScripts(uint32 spellId, std::list<SpellScript*>& scriptVector);
void CreateAuraScripts(uint32 spellId, std::list<AuraScript*>& scriptVector);
- void CreateSpellScriptLoaders(uint32 spellId, std::vector<std::pair<SpellScriptLoader*, std::multimap<uint32, uint32>::iterator> >& scriptVector);
+ SpellScriptLoader* GetSpellScriptLoader(uint32 scriptId);
public: /* ServerScript */
@@ -894,7 +903,6 @@ class ScriptMgr
void OnSocketClose(std::shared_ptr<WorldSocket> socket);
void OnPacketReceive(WorldSession* session, WorldPacket const& packet);
void OnPacketSend(WorldSession* session, WorldPacket const& packet);
- void OnUnknownPacketReceive(WorldSession* session, WorldPacket const& packet);
public: /* WorldScript */
@@ -1098,19 +1106,14 @@ class ScriptMgr
void ModifyMeleeDamage(Unit* target, Unit* attacker, uint32& damage);
void ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& damage);
- public: /* Scheduled scripts */
-
- uint32 IncreaseScheduledScriptsCount() { return ++_scheduledScripts; }
- uint32 DecreaseScheduledScriptCount() { return --_scheduledScripts; }
- uint32 DecreaseScheduledScriptCount(size_t count) { return _scheduledScripts -= count; }
- bool IsScriptScheduled() const { return _scheduledScripts > 0; }
-
private:
-
uint32 _scriptCount;
- //atomic op counter for active scripts amount
- std::atomic<uint32> _scheduledScripts;
+ ScriptLoaderCallbackType _script_loader_callback;
+
+ std::string _currentContext;
};
+#define sScriptMgr ScriptMgr::instance()
+
#endif
diff --git a/src/server/game/Scripting/ScriptReloadMgr.cpp b/src/server/game/Scripting/ScriptReloadMgr.cpp
new file mode 100644
index 00000000000..b0c9b6821d2
--- /dev/null
+++ b/src/server/game/Scripting/ScriptReloadMgr.cpp
@@ -0,0 +1,1641 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ScriptReloadMgr.h"
+#include "Errors.h"
+
+#ifndef TRINITY_API_USE_DYNAMIC_LINKING
+
+// This method should never be called
+std::shared_ptr<ModuleReference>
+ ScriptReloadMgr::AcquireModuleReferenceOfContext(std::string const& /*context*/)
+{
+ WPAbort();
+}
+
+// Returns the empty implemented ScriptReloadMgr
+ScriptReloadMgr* ScriptReloadMgr::instance()
+{
+ static ScriptReloadMgr instance;
+ return &instance;
+}
+
+#else
+
+#include <algorithm>
+#include <regex>
+#include <vector>
+#include <future>
+#include <memory>
+#include <fstream>
+#include <type_traits>
+#include <unordered_set>
+#include <unordered_map>
+
+#include <boost/algorithm/string/replace.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/system/system_error.hpp>
+
+#include "efsw/efsw.hpp"
+
+#include "Log.h"
+#include "Config.h"
+#include "BuiltInConfig.h"
+#include "ScriptMgr.h"
+#include "SHA1.h"
+#include "StartProcess.h"
+#include "MPSCQueue.h"
+#include "GitRevision.h"
+
+namespace fs = boost::filesystem;
+
+#ifdef _WIN32
+ #include <windows.h>
+ #define HOTSWAP_PLATFORM_REQUIRES_CACHING
+#else // Posix
+ #include <dlfcn.h>
+ // #define HOTSWAP_PLATFORM_REQUIRES_CACHING
+#endif
+
+// Promote the sScriptReloadMgr to a HotSwapScriptReloadMgr
+// in this compilation unit.
+#undef sScriptReloadMgr
+#define sScriptReloadMgr static_cast<HotSwapScriptReloadMgr*>(ScriptReloadMgr::instance())
+
+// Returns "" on Windows and "lib" on posix.
+static char const* GetSharedLibraryPrefix()
+{
+#ifdef _WIN32
+ return "";
+#else // Posix
+ return "lib";
+#endif
+}
+
+// Returns "dll" on Windows and "so" on posix.
+static char const* GetSharedLibraryExtension()
+{
+#ifdef _WIN32
+ return "dll";
+#else // Posix
+ return "so";
+#endif
+}
+
+#ifdef _WIN32
+typedef HMODULE HandleType;
+#else // Posix
+typedef void* HandleType;
+#endif
+
+static fs::path GetDirectoryOfExecutable()
+{
+ ASSERT((!sConfigMgr->GetArguments().empty()),
+ "Expected the arguments to contain at least 1 element!");
+
+ fs::path path(sConfigMgr->GetArguments()[0]);
+ if (path.is_absolute())
+ return path.parent_path();
+ else
+ return fs::absolute(path).parent_path();
+}
+
+class SharedLibraryUnloader
+{
+public:
+ explicit SharedLibraryUnloader(fs::path path)
+ : path_(std::move(path)) { }
+ SharedLibraryUnloader(fs::path path, Optional<fs::path> cache_path)
+ : path_(std::move(path)), cache_path_(std::move(cache_path)) { }
+
+ void operator() (HandleType handle) const
+ {
+ // Unload the associated shared library.
+#ifdef _WIN32
+ bool success = (FreeLibrary(handle) != 0);
+#else // Posix
+ bool success = (dlclose(handle) == 0);
+#endif
+
+ if (!success)
+ {
+ TC_LOG_ERROR("scripts.hotswap", "Failed to unload (syscall) the shared library \"%s\".",
+ path_.generic_string().c_str());
+
+ return;
+ }
+
+ /// When the shared library was cached delete it's shared version
+ if (cache_path_)
+ {
+ boost::system::error_code error;
+ if (!fs::remove(*cache_path_, error))
+ {
+ TC_LOG_ERROR("scripts.hotswap", "Failed to delete the cached shared library \"%s\" (%s).",
+ cache_path_->generic_string().c_str(), error.message().c_str());
+
+ return;
+ }
+
+ TC_LOG_TRACE("scripts.hotswap", "Lazy unloaded the shared library \"%s\" "
+ "and deleted it's cached version at \"%s\"",
+ path_.generic_string().c_str(), cache_path_->generic_string().c_str());
+ }
+ else
+ {
+ TC_LOG_TRACE("scripts.hotswap", "Lazy unloaded the shared library \"%s\".",
+ path_.generic_string().c_str());
+ }
+ }
+
+private:
+ fs::path const path_;
+ Optional<fs::path> const cache_path_;
+};
+
+typedef std::unique_ptr<typename std::remove_pointer<HandleType>::type, SharedLibraryUnloader> HandleHolder;
+
+typedef char const* (*GetScriptModuleRevisionHashType)();
+typedef void (*AddScriptsType)();
+typedef char const* (*GetScriptModuleType)();
+typedef char const* (*GetBuildDirectiveType)();
+
+class ScriptModule
+ : public ModuleReference
+{
+public:
+ explicit ScriptModule(HandleHolder handle, GetScriptModuleRevisionHashType getScriptModuleRevisionHash,
+ AddScriptsType addScripts, GetScriptModuleType getScriptModule,
+ GetBuildDirectiveType getBuildDirective, fs::path const& path)
+ : _handle(std::forward<HandleHolder>(handle)), _getScriptModuleRevisionHash(getScriptModuleRevisionHash),
+ _addScripts(addScripts), _getScriptModule(getScriptModule),
+ _getBuildDirective(getBuildDirective), _path(path) { }
+
+ ScriptModule(ScriptModule const&) = delete;
+ ScriptModule(ScriptModule&& right) = delete;
+
+ ScriptModule& operator= (ScriptModule const&) = delete;
+ ScriptModule& operator= (ScriptModule&& right) = delete;
+
+ static Optional<std::shared_ptr<ScriptModule>>
+ CreateFromPath(fs::path const& path, Optional<fs::path> cache_path);
+
+ static void ScheduleDelayedDelete(ScriptModule* module);
+
+ char const* GetScriptModuleRevisionHash() const override
+ {
+ return _getScriptModuleRevisionHash();
+ }
+
+ void AddScripts() const
+ {
+ return _addScripts();
+ }
+
+ char const* GetScriptModule() const override
+ {
+ return _getScriptModule();
+ }
+
+ char const* GetBuildDirective() const
+ {
+ return _getBuildDirective();
+ }
+
+ fs::path const& GetModulePath() const override
+ {
+ return _path;
+ }
+
+private:
+ HandleHolder _handle;
+
+ GetScriptModuleRevisionHashType _getScriptModuleRevisionHash;
+ AddScriptsType _addScripts;
+ GetScriptModuleType _getScriptModule;
+ GetBuildDirectiveType _getBuildDirective;
+
+ fs::path _path;
+};
+
+template<typename Fn>
+static bool GetFunctionFromSharedLibrary(HandleType handle, std::string const& name, Fn& fn)
+{
+#ifdef _WIN32
+ fn = reinterpret_cast<Fn>(GetProcAddress(handle, name.c_str()));
+#else // Posix
+ fn = reinterpret_cast<Fn>(dlsym(handle, name.c_str()));
+#endif
+ return fn != nullptr;
+}
+
+// Load a shared library from the given path.
+Optional<std::shared_ptr<ScriptModule>>
+ ScriptModule::CreateFromPath(fs::path const& path, Optional<fs::path> cache_path)
+{
+ auto const load_path = [&] () -> fs::path {
+ if (cache_path)
+ return *cache_path;
+ else
+ return path;
+ }();
+
+#ifdef _WIN32
+ HandleType handle = LoadLibrary(load_path.generic_string().c_str());
+#else // Posix
+ HandleType handle = dlopen(load_path.generic_string().c_str(), RTLD_LAZY);
+#endif
+
+ if (!handle)
+ {
+ if (cache_path)
+ {
+ TC_LOG_ERROR("scripts.hotswap", "Could not dynamic load the shared library \"%s\" "
+ "(the library is cached at %s)",
+ path.generic_string().c_str(), cache_path->generic_string().c_str());
+ }
+ else
+ {
+ TC_LOG_ERROR("scripts.hotswap", "Could not dynamic load the shared library \"%s\".",
+ path.generic_string().c_str());
+ }
+
+ return boost::none;
+ }
+
+ // Use RAII to release the library on failure.
+ HandleHolder holder(handle, SharedLibraryUnloader(path, std::move(cache_path)));
+
+ GetScriptModuleRevisionHashType getScriptModuleRevisionHash;
+ AddScriptsType addScripts;
+ GetScriptModuleType getScriptModule;
+ GetBuildDirectiveType getBuildDirective;
+
+ if (GetFunctionFromSharedLibrary(handle, "GetScriptModuleRevisionHash", getScriptModuleRevisionHash) &&
+ GetFunctionFromSharedLibrary(handle, "AddScripts", addScripts) &&
+ GetFunctionFromSharedLibrary(handle, "GetScriptModule", getScriptModule) &&
+ GetFunctionFromSharedLibrary(handle, "GetBuildDirective", getBuildDirective))
+ {
+ auto module = new ScriptModule(std::move(holder), getScriptModuleRevisionHash,
+ addScripts, getScriptModule, getBuildDirective, path);
+
+ // Unload the module at the next update tick as soon as all references are removed
+ return std::shared_ptr<ScriptModule>(module, ScheduleDelayedDelete);
+ }
+ else
+ {
+ TC_LOG_ERROR("scripts.hotswap", "Could not extract all required functions from the shared library \"%s\"!",
+ path.generic_string().c_str());
+
+ return boost::none;
+ }
+}
+
+static bool HasValidScriptModuleName(std::string const& name)
+{
+ // Detects scripts_NAME.dll's / .so's
+ static std::regex const regex(
+ Trinity::StringFormat("^%s[sS]cripts_[a-zA-Z0-9_]+\\.%s$",
+ GetSharedLibraryPrefix(),
+ GetSharedLibraryExtension()));
+
+ return std::regex_match(name, regex);
+}
+
+/// File watcher responsible for watching shared libraries
+class LibraryUpdateListener : public efsw::FileWatchListener
+{
+public:
+ LibraryUpdateListener() { }
+ virtual ~LibraryUpdateListener() { }
+
+ void handleFileAction(efsw::WatchID /*watchid*/, std::string const& dir,
+ std::string const& filename, efsw::Action action, std::string oldFilename = "") final override;
+};
+
+static LibraryUpdateListener libraryUpdateListener;
+
+/// File watcher responsible for watching source files
+class SourceUpdateListener : public efsw::FileWatchListener
+{
+ fs::path const path_;
+
+ std::string const script_module_name_;
+
+ efsw::WatchID const watcher_id_;
+
+public:
+ explicit SourceUpdateListener(fs::path path, std::string script_module_name);
+
+ virtual ~SourceUpdateListener();
+
+ void handleFileAction(efsw::WatchID /*watchid*/, std::string const& dir,
+ std::string const& filename, efsw::Action action, std::string oldFilename = "") final override;
+};
+
+namespace std
+{
+ template <>
+ struct hash<fs::path>
+ {
+ hash<string> hasher;
+
+ std::size_t operator()(fs::path const& key) const
+ {
+ return hasher(key.generic_string());
+ }
+ };
+}
+
+/// Invokes a synchronous CMake process with the given arguments
+template<typename... T>
+static int InvokeCMakeCommand(T&&... args)
+{
+ auto const executable = BuiltInConfig::GetCMakeCommand();
+ return Trinity::StartProcess(executable, {
+ executable,
+ std::forward<T>(args)...
+ }, "scripts.hotswap");
+}
+
+/// Invokes an asynchronous CMake process with the given arguments
+template<typename... T>
+static std::shared_ptr<Trinity::AsyncProcessResult> InvokeAsyncCMakeCommand(T&&... args)
+{
+ auto const executable = BuiltInConfig::GetCMakeCommand();
+ return Trinity::StartAsyncProcess(executable, {
+ executable,
+ std::forward<T>(args)...
+ }, "scripts.hotswap");
+}
+
+/// Calculates the C++ project name of the given module which is
+/// the lowercase string of scripts_${module}.
+static std::string CalculateScriptModuleProjectName(std::string const& module)
+{
+ std::string module_project = "scripts_" + module;
+ std::transform(module_project.begin(), module_project.end(),
+ module_project.begin(), ::tolower);
+
+ return module_project;
+}
+
+/// Returns false when there isn't any attached debugger to the process which
+/// could block the rebuild of new shared libraries.
+static bool IsDebuggerBlockingRebuild()
+{
+#ifdef _WIN32
+ if (IsDebuggerPresent())
+ return true;
+#endif
+ return false;
+}
+
+/// ScriptReloadMgr which is used when dynamic linking is enabled
+///
+/// This class manages shared library loading/unloading through watching
+/// the script module directory. Loaded shared libraries are mirrored
+/// into a cache subdirectory to allow lazy unloading as long as
+/// the shared library is still used which is useful for scripts
+/// which can't be instantly replaced like spells or instances.
+/// Several modules which reference different versions can be kept loaded
+/// to serve scripts of different versions to entities and spells.
+///
+/// Also this class invokes rebuilds as soon as the source of loaded
+/// scripts change and installs the modules correctly through CMake.
+class HotSwapScriptReloadMgr final
+ : public ScriptReloadMgr
+{
+ friend class ScriptReloadMgr;
+ friend class SourceUpdateListener;
+
+ /// Reflects a queued change on a shared library or shared library
+ /// which is waiting for processing
+ enum class ChangeStateRequest : uint8
+ {
+ CHANGE_REQUEST_ADDED,
+ CHANGE_REQUEST_MODIFIED,
+ CHANGE_REQUEST_REMOVED
+ };
+
+ /// Reflects a running job of an invoked asynchronous external process
+ enum class BuildJobType : uint8
+ {
+ BUILD_JOB_NONE,
+ BUILD_JOB_RERUN_CMAKE,
+ BUILD_JOB_COMPILE,
+ BUILD_JOB_INSTALL,
+ };
+
+ // Represents a job which was invoked through a source or shared library change
+ class BuildJob
+ {
+ // Script module which is processed in the current running job
+ std::string script_module_name_;
+ // The C++ project name of the module which is processed
+ std::string script_module_project_name_;
+ // The build directive of the current module which is processed
+ // like "Release" or "Debug". The build directive from the
+ // previous same module is used if there was any.
+ std::string script_module_build_directive_;
+ // The time where the build job started
+ uint32 start_time_;
+
+ // Type of the current running job
+ BuildJobType type_;
+ // The async process result of the current job
+ std::shared_ptr<Trinity::AsyncProcessResult> async_result_;
+
+ public:
+ explicit BuildJob(std::string script_module_name, std::string script_module_project_name,
+ std::string script_module_build_directive)
+ : script_module_name_(std::move(script_module_name)),
+ script_module_project_name_(std::move(script_module_project_name)),
+ script_module_build_directive_(std::move(script_module_build_directive)),
+ start_time_(getMSTime()), type_(BuildJobType::BUILD_JOB_NONE) { }
+
+ bool IsValid() const
+ {
+ return type_ != BuildJobType::BUILD_JOB_NONE;
+ }
+
+ std::string const& GetModuleName() const { return script_module_name_; }
+
+ std::string const& GetProjectName() const { return script_module_project_name_; }
+
+ std::string const& GetBuildDirective() const { return script_module_build_directive_; }
+
+ uint32 GetTimeFromStart() const { return GetMSTimeDiffToNow(start_time_); }
+
+ BuildJobType GetType() const { return type_; }
+
+ std::shared_ptr<Trinity::AsyncProcessResult> const& GetProcess() const
+ {
+ ASSERT(async_result_, "Tried to access an empty process handle!");
+ return async_result_;
+ }
+
+ /// Updates the current running job with the given type and async result
+ void UpdateCurrentJob(BuildJobType type,
+ std::shared_ptr<Trinity::AsyncProcessResult> async_result)
+ {
+ ASSERT(type != BuildJobType::BUILD_JOB_NONE, "None isn't allowed here!");
+ ASSERT(async_result, "The async result must not be empty!");
+
+ type_ = type;
+ async_result_ = std::move(async_result);
+ }
+ };
+
+ /// Base class for lockfree asynchronous messages to the script reloader
+ class ScriptReloaderMessage
+ {
+ public:
+ virtual ~ScriptReloaderMessage() { }
+
+ /// Invoke this function to run a message thread safe on the reloader
+ virtual void operator() (HotSwapScriptReloadMgr* reloader) = 0;
+ };
+
+ /// Implementation class which wraps functional types and dispatches
+ /// it in the overwritten implementation of the reloader messages.
+ template<typename T>
+ class ScriptReloaderMessageImplementation
+ : public ScriptReloaderMessage
+ {
+ T dispatcher_;
+
+ public:
+ explicit ScriptReloaderMessageImplementation(T dispatcher)
+ : dispatcher_(std::move(dispatcher)) { }
+
+ void operator() (HotSwapScriptReloadMgr* reloader) final override
+ {
+ dispatcher_(reloader);
+ }
+ };
+
+ /// Uses the given functional type and creates a asynchronous reloader
+ /// message on the heap, which requires deletion.
+ template<typename T>
+ auto MakeMessage(T&& dispatcher)
+ -> ScriptReloaderMessageImplementation<typename std::decay<T>::type>*
+ {
+ return new ScriptReloaderMessageImplementation<typename std::decay<T>::type>
+ (std::forward<T>(dispatcher));
+ }
+
+public:
+ HotSwapScriptReloadMgr()
+ : _libraryWatcher(-1), _unique_library_name_counter(0),
+ _last_time_library_changed(0), _last_time_sources_changed(0),
+ _last_time_user_informed(0), terminate_early(false) { }
+
+ virtual ~HotSwapScriptReloadMgr()
+ {
+ // Delete all messages
+ ScriptReloaderMessage* message;
+ while (_messages.Dequeue(message))
+ delete message;
+ }
+
+ /// Returns the absolute path to the script module directory
+ static fs::path GetLibraryDirectory()
+ {
+ // When an absolute path is given in the config use it,
+ // otherwise interpret paths relative to the executable.
+ fs::path path(sConfigMgr->GetStringDefault("HotSwap.ScriptDir", "scripts"));
+ if (path.is_absolute())
+ return path;
+ else
+ return fs::absolute(path, GetDirectoryOfExecutable());
+ }
+
+ /// Returns the absolute path to the scripts directory in the source tree.
+ static fs::path GetSourceDirectory()
+ {
+ fs::path dir = BuiltInConfig::GetSourceDirectory();
+ dir /= "src";
+ dir /= "server";
+ dir /= "scripts";
+ return dir;
+ }
+
+ /// Initializes the file watchers and loads all existing shared libraries
+ /// into the running server.
+ void Initialize() final override
+ {
+ if (!sWorld->getBoolConfig(CONFIG_HOTSWAP_ENABLED))
+ return;
+
+ if (BuiltInConfig::GetBuildDirectory().find(" ") != std::string::npos)
+ {
+ TC_LOG_ERROR("scripts.hotswap", "Your build directory path \"%s\" "
+ "contains spaces, which isn't allowed for compatibility reasons! "
+ "You need to create a build directory which doesn't contain any space character "
+ "in it's path!",
+ BuiltInConfig::GetBuildDirectory().c_str());
+
+ return;
+ }
+
+ {
+ auto const library_directory = GetLibraryDirectory();
+ if (!fs::exists(library_directory) || !fs::is_directory(library_directory))
+ {
+ TC_LOG_ERROR("scripts.hotswap", "Library directory \"%s\" doesn't exist!.",
+ library_directory.generic_string().c_str());
+ return;
+ }
+ }
+
+ #ifdef HOTSWAP_PLATFORM_REQUIRES_CACHING
+
+ temporary_cache_path_ = CalculateTemporaryCachePath();
+
+ // We use the boost filesystem function versions which accept
+ // an error code to prevent it from throwing exceptions.
+ boost::system::error_code code;
+ if ((!fs::exists(temporary_cache_path_, code)
+ || (fs::remove_all(temporary_cache_path_, code) > 0)) &&
+ !fs::create_directory(temporary_cache_path_, code))
+ {
+ TC_LOG_ERROR("scripts.hotswap", "Couldn't create the cache directory at \"%s\".",
+ temporary_cache_path_.generic_string().c_str());
+
+ return;
+ }
+
+ // Used to silent compiler warnings
+ (void)code;
+
+ #endif // #ifdef HOTSWAP_PLATFORM_REQUIRES_CACHING
+
+ // Correct the CMake prefix when needed
+ if (sWorld->getBoolConfig(CONFIG_HOTSWAP_PREFIX_CORRECTION_ENABLED))
+ DoCMakePrefixCorrectionIfNeeded();
+
+ InitializeDefaultLibraries();
+ InitializeFileWatchers();
+ }
+
+ /// Needs to be called periodically from the worldserver loop
+ /// to invoke queued actions like module loading/unloading and script
+ /// compilation.
+ /// This method should be invoked from a thread safe point to
+ /// prevent misbehavior.
+ void Update() final override
+ {
+ // Consume all messages
+ ScriptReloaderMessage* message;
+ while (_messages.Dequeue(message))
+ {
+ (*message)(this);
+ delete message;
+ }
+
+ DispatchRunningBuildJobs();
+ DispatchModuleChanges();
+ }
+
+ /// Unloads the manager and cancels all runnings jobs immediately
+ void Unload() final override
+ {
+ if (_libraryWatcher >= 0)
+ {
+ _fileWatcher.removeWatch(_libraryWatcher);
+ _libraryWatcher = -1;
+ }
+
+ // If a build is in progress cancel it
+ if (_build_job)
+ {
+ _build_job->GetProcess()->Terminate();
+ _build_job.reset();
+ }
+
+ // Release all strong references to script modules
+ // to trigger unload actions as early as possible,
+ // otherwise the worldserver will crash on exit.
+ _running_script_modules.clear();
+ }
+
+ /// Queue's a thread safe message to the reloader which is executed on
+ /// the next world server update tick.
+ template<typename T>
+ void QueueMessage(T&& message)
+ {
+ _messages.Enqueue(MakeMessage(std::forward<T>(message)));
+ }
+
+ /// Queues an action which marks the given shared library as changed
+ /// which will add, unload or reload it at the next world update tick.
+ /// This method is thread safe.
+ void QueueSharedLibraryChanged(fs::path const& path)
+ {
+ _last_time_library_changed = getMSTime();
+ _libraries_changed.insert(path);
+ }
+
+ /// Queues a notification that a source file was added
+ /// This method is thread unsafe.
+ void QueueAddSourceFile(std::string const& module_name, fs::path const& path)
+ {
+ UpdateSourceChangeRequest(module_name, path, ChangeStateRequest::CHANGE_REQUEST_ADDED);
+ }
+
+ /// Queues a notification that a source file was modified
+ /// This method is thread unsafe.
+ void QueueModifySourceFile(std::string const& module_name, fs::path const& path)
+ {
+ UpdateSourceChangeRequest(module_name, path, ChangeStateRequest::CHANGE_REQUEST_MODIFIED);
+ }
+
+ /// Queues a notification that a source file was removed
+ /// This method is thread unsafe.
+ void QueueRemoveSourceFile(std::string const& module_name, fs::path const& path)
+ {
+ UpdateSourceChangeRequest(module_name, path, ChangeStateRequest::CHANGE_REQUEST_REMOVED);
+ }
+
+private:
+ // Loads all shared libraries which are contained in the
+ // scripts directory on startup.
+ void InitializeDefaultLibraries()
+ {
+ fs::path const libraryDirectory(GetLibraryDirectory());
+ fs::directory_iterator const dir_end;
+
+ uint32 count = 0;
+
+ // Iterate through all shared libraries in the script directory and load it
+ for (fs::directory_iterator dir_itr(libraryDirectory); dir_itr != dir_end ; ++dir_itr)
+ if (fs::is_regular_file(dir_itr->path()) && HasValidScriptModuleName(dir_itr->path().filename().generic_string()))
+ {
+ TC_LOG_INFO("scripts.hotswap", "Loading script module \"%s\"...",
+ dir_itr->path().filename().generic_string().c_str());
+
+ // Don't swap the script context to do bulk loading
+ ProcessLoadScriptModule(dir_itr->path(), false);
+ ++count;
+ }
+
+ TC_LOG_INFO("scripts.hotswap", ">> Loaded %u script modules.", count);
+ }
+
+ // Initialize all enabled file watchers.
+ // Needs to be called after InitializeDefaultLibraries()!
+ void InitializeFileWatchers()
+ {
+ _libraryWatcher = _fileWatcher.addWatch(GetLibraryDirectory().generic_string(), &libraryUpdateListener, false);
+ if (_libraryWatcher >= 0)
+ {
+ TC_LOG_INFO("scripts.hotswap", ">> Library reloader is listening on \"%s\".",
+ GetLibraryDirectory().generic_string().c_str());
+ }
+ else
+ {
+ TC_LOG_ERROR("scripts.hotswap", "Failed to initialize the library reloader on \"%s\".",
+ GetLibraryDirectory().generic_string().c_str());
+ }
+
+ _fileWatcher.watch();
+ }
+
+ static fs::path CalculateTemporaryCachePath()
+ {
+ auto path = fs::temp_directory_path();
+ path /= Trinity::StringFormat("tc_script_cache_%s_%s",
+ GitRevision::GetBranch(),
+ CalculateSHA1Hash(sConfigMgr->GetFilename()).c_str());
+
+ return path;
+ }
+
+ fs::path GenerateUniquePathForLibraryInCache(fs::path path)
+ {
+ ASSERT(!temporary_cache_path_.empty(),
+ "The temporary cache path wasn't set!");
+
+ // Create the cache path and increment the library counter to use an unique name for each library
+ auto cache_path = temporary_cache_path_;
+ cache_path /= Trinity::StringFormat("%s.%u%s",
+ path.stem().generic_string().c_str(),
+ _unique_library_name_counter++,
+ path.extension().generic_string().c_str());
+
+ return cache_path;
+ }
+
+ /// Updates the current state of the given source path
+ void UpdateSourceChangeRequest(std::string const& module_name,
+ fs::path const& path,
+ ChangeStateRequest state)
+ {
+ _last_time_sources_changed = getMSTime();
+
+ // Write when there is no module with the given name known
+ auto module_itr = _sources_changed.find(module_name);
+
+ // When the file was modified it's enough to mark the module as
+ // dirty by initializing the associated map.
+ if (module_itr == _sources_changed.end())
+ module_itr = _sources_changed.insert(std::make_pair(
+ module_name, decltype(_sources_changed)::mapped_type{})).first;
+
+ // Leave when the file was just modified as explained above
+ if (state == ChangeStateRequest::CHANGE_REQUEST_MODIFIED)
+ return;
+
+ // Insert when the given path isn't existent
+ auto const itr = module_itr->second.find(path);
+ if (itr == module_itr->second.end())
+ {
+ module_itr->second.insert(std::make_pair(path, state));
+ return;
+ }
+
+ ASSERT((itr->second == ChangeStateRequest::CHANGE_REQUEST_ADDED)
+ || (itr->second == ChangeStateRequest::CHANGE_REQUEST_REMOVED),
+ "Stored value is invalid!");
+
+ ASSERT((state == ChangeStateRequest::CHANGE_REQUEST_ADDED)
+ || (state == ChangeStateRequest::CHANGE_REQUEST_REMOVED),
+ "The given state is invalid!");
+
+ ASSERT(state != itr->second,
+ "Tried to apply a state which is stored already!");
+
+ module_itr->second.erase(itr);
+ }
+
+ /// Called periodically on the worldserver tick to process all
+ /// load/unload/reload requests of shared libraries.
+ void DispatchModuleChanges()
+ {
+ // When there are no libraries to change return
+ if (_libraries_changed.empty())
+ return;
+
+ // Wait some time after changes to catch bulk changes
+ if (GetMSTimeDiffToNow(_last_time_library_changed) < 500)
+ return;
+
+ for (auto const& path : _libraries_changed)
+ {
+ bool const is_running =
+ _running_script_module_names.find(path) != _running_script_module_names.end();
+
+ bool const exists = fs::exists(path);
+
+ if (is_running)
+ {
+ if (exists)
+ ProcessReloadScriptModule(path);
+ else
+ ProcessUnloadScriptModule(path);
+ }
+ else if (exists)
+ ProcessLoadScriptModule(path);
+ }
+
+ _libraries_changed.clear();
+ }
+
+ void ProcessLoadScriptModule(fs::path const& path, bool swap_context = true)
+ {
+ ASSERT(_running_script_module_names.find(path) == _running_script_module_names.end(),
+ "Can't load a module which is running already!");
+
+ Optional<fs::path> cache_path;
+
+ #ifdef HOTSWAP_PLATFORM_REQUIRES_CACHING
+
+ // Copy the shared library into a cache on platforms which lock files on use (windows).
+ cache_path = GenerateUniquePathForLibraryInCache(path);
+
+ {
+ boost::system::error_code code;
+ fs::copy_file(path, *cache_path, fs::copy_option::fail_if_exists, code);
+ if (code)
+ {
+ TC_LOG_FATAL("scripts.hotswap", ">> Failed to create cache entry for module "
+ "\"%s\" at \"%s\" with reason (\"%s\")!",
+ path.filename().generic_string().c_str(), cache_path->generic_string().c_str(),
+ code.message().c_str());
+
+ // Find a better solution for this but it's much better
+ // to start the core without scripts
+ std::this_thread::sleep_for(std::chrono::seconds(5));
+ ABORT();
+ return;
+ }
+
+ TC_LOG_TRACE("scripts.hotswap", ">> Copied the shared library \"%s\" to \"%s\" for caching.",
+ path.filename().generic_string().c_str(), cache_path->generic_string().c_str());
+ }
+
+ #endif // #ifdef HOTSWAP_PLATFORM_REQUIRES_CACHING
+
+ auto module = ScriptModule::CreateFromPath(path, cache_path);
+ if (!module)
+ {
+ TC_LOG_FATAL("scripts.hotswap", ">> Failed to load script module \"%s\"!",
+ path.filename().generic_string().c_str());
+
+ // Find a better solution for this but it's much better
+ // to start the core without scripts
+ std::this_thread::sleep_for(std::chrono::seconds(5));
+ ABORT();
+ return;
+ }
+
+ // Limit the git revision hash to 7 characters.
+ std::string module_revision((*module)->GetScriptModuleRevisionHash());
+ if (module_revision.size() >= 7)
+ module_revision = module_revision.substr(0, 7);
+
+ std::string const module_name = (*module)->GetScriptModule();
+ TC_LOG_INFO("scripts.hotswap", ">> Loaded script module \"%s\" (\"%s\" - %s).",
+ path.filename().generic_string().c_str(), module_name.c_str(), module_revision.c_str());
+
+ if (module_revision.empty())
+ {
+ TC_LOG_WARN("scripts.hotswap", ">> Script module \"%s\" has an empty revision hash!",
+ path.filename().generic_string().c_str());
+ }
+ else
+ {
+ // Trim the revision hash
+ std::string my_revision_hash = GitRevision::GetHash();
+ std::size_t const trim = std::min(module_revision.size(), my_revision_hash.size());
+ my_revision_hash = my_revision_hash.substr(0, trim);
+ module_revision = module_revision.substr(0, trim);
+
+ if (my_revision_hash != module_revision)
+ {
+ TC_LOG_WARN("scripts.hotswap", ">> Script module \"%s\" has a different revision hash! "
+ "Binary incompatibility could lead to unknown behaviour!", path.filename().generic_string().c_str());
+ }
+ }
+
+ {
+ auto const itr = _running_script_modules.find(module_name);
+ if (itr != _running_script_modules.end())
+ {
+ TC_LOG_ERROR("scripts.hotswap", ">> Attempt to load a module twice \"%s\" (loaded module is at %s)!",
+ path.generic_string().c_str(), itr->second.first->GetModulePath().generic_string().c_str());
+
+ return;
+ }
+ }
+
+ // Create the source listener
+ auto listener = Trinity::make_unique<SourceUpdateListener>(
+ sScriptReloadMgr->GetSourceDirectory() / module_name,
+ module_name);
+
+ // Store the module
+ _known_modules_build_directives.insert(std::make_pair(module_name, (*module)->GetBuildDirective()));
+ _running_script_modules.insert(std::make_pair(module_name,
+ std::make_pair(*module, std::move(listener))));
+ _running_script_module_names.insert(std::make_pair(path, module_name));
+
+ // Process the script loading after the module was registered correctly (#17557).
+ sScriptMgr->SetScriptContext(module_name);
+ (*module)->AddScripts();
+ TC_LOG_TRACE("scripts.hotswap", ">> Registered all scripts of module %s.", module_name.c_str());
+
+ if (swap_context)
+ sScriptMgr->SwapScriptContext();
+ }
+
+ void ProcessReloadScriptModule(fs::path const& path)
+ {
+ ProcessUnloadScriptModule(path, false);
+ ProcessLoadScriptModule(path);
+ }
+
+ void ProcessUnloadScriptModule(fs::path const& path, bool finish = true)
+ {
+ auto const itr = _running_script_module_names.find(path);
+
+ ASSERT(itr != _running_script_module_names.end(),
+ "Can't unload a module which isn't running!");
+
+ // Unload the script context
+ sScriptMgr->ReleaseScriptContext(itr->second);
+
+ if (finish)
+ sScriptMgr->SwapScriptContext();
+
+ TC_LOG_INFO("scripts.hotswap", "Released script module \"%s\" (\"%s\")...",
+ path.filename().generic_string().c_str(), itr->second.c_str());
+
+ // Unload the script module
+ auto ref = _running_script_modules.find(itr->second);
+ ASSERT(ref != _running_script_modules.end() &&
+ "Expected the script reference to be present!");
+
+ // Yield a message when there are other owning references to
+ // the module which prevents it from unloading.
+ // The module will be unloaded once all scripts provided from the module
+ // are destroyed.
+ if (!ref->second.first.unique())
+ {
+ TC_LOG_INFO("scripts.hotswap",
+ "Script module %s is still used by %lu spell, aura or instance scripts. "
+ "Will lazy unload the module once all scripts stopped using it, "
+ "to use the latest version of an edited script unbind yourself from "
+ "the instance or re-cast the spell.",
+ ref->second.first->GetScriptModule(), ref->second.first.use_count() - 1);
+ }
+
+ // Remove the owning reference from the reloader
+ _running_script_modules.erase(ref);
+ _running_script_module_names.erase(itr);
+ }
+
+ /// Called periodically on the worldserver tick to process all recompile
+ /// requests. This method invokes one build or install job at the time
+ void DispatchRunningBuildJobs()
+ {
+ if (_build_job)
+ {
+ // Terminate the current build job when an associated source was changed
+ // while compiling and the terminate early option is enabled.
+ if (sWorld->getBoolConfig(CONFIG_HOTSWAP_EARLY_TERMINATION_ENABLED))
+ {
+ if (!terminate_early && _sources_changed.find(_build_job->GetModuleName()) != _sources_changed.end())
+ {
+ /*
+ FIXME: Currently crashes the server
+ TC_LOG_INFO("scripts.hotswap", "Terminating the running build of module \"%s\"...",
+ _build_job->GetModuleName().c_str());
+
+ _build_job->GetProcess()->Terminate();
+ _build_job.reset();
+
+ // Continue with the default execution path
+ DispatchRunningBuildJobs();
+ return;
+ */
+
+ terminate_early = true;
+ return;
+ }
+ }
+
+ // Wait for the current build job to finish, if the job finishes in time
+ // evaluate it and continue with the next one.
+ if (_build_job->GetProcess()->GetFutureResult().
+ wait_for(std::chrono::seconds(0)) == std::future_status::ready)
+ ProcessReadyBuildJob();
+ else
+ return; // Return when the job didn't finish in time
+
+ // Skip this cycle when the previous job scheduled a new one
+ if (_build_job)
+ return;
+ }
+
+ // Avoid burst updates through waiting for a short time after changes
+ if ((_last_time_sources_changed != 0) &&
+ (GetMSTimeDiffToNow(_last_time_sources_changed) < 500))
+ return;
+
+ // If the changed sources are empty do nothing
+ if (_sources_changed.empty())
+ return;
+
+ // Wait until are attached debugger were detached.
+ if (IsDebuggerBlockingRebuild())
+ {
+ if ((_last_time_user_informed == 0) ||
+ (GetMSTimeDiffToNow(_last_time_user_informed) > 7500))
+ {
+ _last_time_user_informed = getMSTime();
+
+ // Informs the user that the attached debugger is blocking the automatic script rebuild.
+ TC_LOG_INFO("scripts.hotswap", "Your attached debugger is blocking the TrinityCore "
+ "automatic script rebuild, please detach it!");
+ }
+
+ return;
+ }
+
+ // Find all source files of a changed script module and removes
+ // it from the changed source list, invoke the build afterwards.
+ bool rebuild_buildfiles;
+ auto module_name = [&]
+ {
+ auto itr = _sources_changed.begin();
+ auto name = itr->first;
+ rebuild_buildfiles = !itr->second.empty();
+
+ if (sLog->ShouldLog("scripts.hotswap", LogLevel::LOG_LEVEL_TRACE))
+ for (auto const& entry : itr->second)
+ {
+ TC_LOG_TRACE("scripts.hotswap", "Source file %s was %s.",
+ entry.first.generic_string().c_str(),
+ ((entry.second == ChangeStateRequest::CHANGE_REQUEST_ADDED) ?
+ "added" : "removed"));
+ }
+
+ _sources_changed.erase(itr);
+ return name;
+ }();
+
+ // Erase the added delete history all modules when we
+ // invoke a cmake rebuild since we add all
+ // added files of other modules to the build as well
+ if (rebuild_buildfiles)
+ {
+ for (auto& entry : _sources_changed)
+ entry.second.clear();
+ }
+
+ ASSERT(!module_name.empty(),
+ "The current module name is invalid!");
+
+ TC_LOG_INFO("scripts.hotswap", "Recompiling Module \"%s\"...",
+ module_name.c_str());
+
+ // Calculate the project name of the script module
+ auto project_name = CalculateScriptModuleProjectName(module_name);
+
+ // Find the best build directive for the module
+ auto build_directive = [&] () -> std::string
+ {
+ auto directive = sConfigMgr->GetStringDefault("HotSwap.ReCompilerBuildType", "");
+ if (!directive.empty())
+ return directive;
+
+ auto const itr = _known_modules_build_directives.find(module_name);
+ if (itr != _known_modules_build_directives.end())
+ return itr->second;
+ else // If no build directive of the module was found use the one from the game library
+ return _BUILD_DIRECTIVE;
+ }();
+
+ // Initiate the new build job
+ _build_job = BuildJob(std::move(module_name),
+ std::move(project_name), std::move(build_directive));
+
+ // Rerun CMake when we need to recreate the build files
+ if (rebuild_buildfiles
+ && sWorld->getBoolConfig(CONFIG_HOTSWAP_BUILD_FILE_RECREATION_ENABLED))
+ DoRerunCMake();
+ else
+ DoCompileCurrentProcessedModule();
+ }
+
+ void ProcessReadyBuildJob()
+ {
+ ASSERT(_build_job->IsValid(), "Invalid build job!");
+
+ // Retrieve the result
+ auto const error = _build_job->GetProcess()->GetFutureResult().get();
+
+ if (terminate_early)
+ {
+ _build_job.reset();
+ terminate_early = false;
+ return;
+ }
+
+ switch (_build_job->GetType())
+ {
+ case BuildJobType::BUILD_JOB_RERUN_CMAKE:
+ {
+ if (!error)
+ {
+ TC_LOG_INFO("scripts.hotswap", ">> Successfully updated the build files!");
+ }
+ else
+ {
+ TC_LOG_INFO("scripts.hotswap", ">> Failed to update the build files at \"%s\", "
+ "it's possible that recently added sources are not included "
+ "in your next builds, rerun CMake manually.",
+ BuiltInConfig::GetBuildDirectory().c_str());
+ }
+ // Continue with building the changes sources
+ DoCompileCurrentProcessedModule();
+ return;
+ }
+ case BuildJobType::BUILD_JOB_COMPILE:
+ {
+ if (!error) // Build was successful
+ {
+ if (sWorld->getBoolConfig(CONFIG_HOTSWAP_INSTALL_ENABLED))
+ {
+ // Continue with the installation when it's enabled
+ TC_LOG_INFO("scripts.hotswap",
+ ">> Successfully build module %s, continue with installing...",
+ _build_job->GetModuleName().c_str());
+
+ DoInstallCurrentProcessedModule();
+ return;
+ }
+
+ // Skip the installation because it's disabled in config
+ TC_LOG_INFO("scripts.hotswap",
+ ">> Successfully build module %s, skipped the installation.",
+ _build_job->GetModuleName().c_str());
+ }
+ else // Build wasn't successful
+ {
+ TC_LOG_ERROR("scripts.hotswap",
+ ">> The build of module %s failed! See the log for details.",
+ _build_job->GetModuleName().c_str());
+ }
+ break;
+ }
+ case BuildJobType::BUILD_JOB_INSTALL:
+ {
+ if (!error)
+ {
+ // Installation was successful
+ TC_LOG_INFO("scripts.hotswap", ">> Successfully installed module %s in %us",
+ _build_job->GetModuleName().c_str(),
+ _build_job->GetTimeFromStart() / IN_MILLISECONDS);
+ }
+ else
+ {
+ // Installation wasn't successful
+ TC_LOG_INFO("scripts.hotswap",
+ ">> The installation of module %s failed! See the log for details.",
+ _build_job->GetModuleName().c_str());
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ // Clear the current job
+ _build_job.reset();
+ }
+
+ /// Reruns CMake asynchronously over the build directory
+ void DoRerunCMake()
+ {
+ ASSERT(_build_job, "There isn't any active build job!");
+
+ TC_LOG_INFO("scripts.hotswap", "Rerunning CMake because there were sources added or removed...");
+
+ _build_job->UpdateCurrentJob(BuildJobType::BUILD_JOB_RERUN_CMAKE,
+ InvokeAsyncCMakeCommand(BuiltInConfig::GetBuildDirectory()));
+ }
+
+ /// Invokes a new build of the current active module job
+ void DoCompileCurrentProcessedModule()
+ {
+ ASSERT(_build_job, "There isn't any active build job!");
+
+ TC_LOG_INFO("scripts.hotswap", "Starting asynchronous build job for module %s...",
+ _build_job->GetModuleName().c_str());
+
+ _build_job->UpdateCurrentJob(BuildJobType::BUILD_JOB_COMPILE,
+ InvokeAsyncCMakeCommand(
+ "--build", BuiltInConfig::GetBuildDirectory(),
+ "--target", _build_job->GetProjectName(),
+ "--config", _build_job->GetBuildDirective()));
+ }
+
+ /// Invokes a new asynchronous install of the current active module job
+ void DoInstallCurrentProcessedModule()
+ {
+ ASSERT(_build_job, "There isn't any active build job!");
+
+ TC_LOG_INFO("scripts.hotswap", "Starting asynchronous install job for module %s...",
+ _build_job->GetModuleName().c_str());
+
+ _build_job->UpdateCurrentJob(BuildJobType::BUILD_JOB_INSTALL,
+ InvokeAsyncCMakeCommand(
+ "-DCOMPONENT=" + _build_job->GetProjectName(),
+ "-DBUILD_TYPE=" + _build_job->GetBuildDirective(),
+ "-P", fs::absolute("cmake_install.cmake",
+ BuiltInConfig::GetBuildDirectory()).generic_string()));
+ }
+
+ /// Sets the CMAKE_INSTALL_PREFIX variable in the CMake cache
+ /// to point to the current worldserver position,
+ /// since most users will forget this.
+ void DoCMakePrefixCorrectionIfNeeded()
+ {
+ TC_LOG_INFO("scripts.hotswap", "Correcting your CMAKE_INSTALL_PREFIX in \"%s\"...",
+ BuiltInConfig::GetBuildDirectory().c_str());
+
+ auto const cmake_cache_path = fs::absolute("CMakeCache.txt",
+ BuiltInConfig::GetBuildDirectory());
+
+ // Stop when the CMakeCache wasn't found
+ if (![&]
+ {
+ boost::system::error_code error;
+ if (!fs::exists(cmake_cache_path, error))
+ {
+ TC_LOG_ERROR("scripts.hotswap", ">> CMake cache \"%s\" doesn't exist, "
+ "set the \"BuildDirectory\" option in your worldserver.conf to point"
+ "to your build directory!",
+ cmake_cache_path.generic_string().c_str());
+
+ return false;
+ }
+ else
+ return true;
+ }())
+ return;
+
+ TC_LOG_TRACE("scripts.hotswap", "Checking CMake cache (\"%s\") "
+ "for the correct CMAKE_INSTALL_PREFIX location...",
+ cmake_cache_path.generic_string().c_str());
+
+ std::string cmake_cache_content;
+ {
+ std::ifstream in(cmake_cache_path.generic_string());
+ if (!in.is_open())
+ {
+ TC_LOG_ERROR("scripts.hotswap", ">> Failed to read the CMake cache at \"%s\"!",
+ cmake_cache_path.generic_string().c_str());
+
+ return;
+ }
+
+ std::ostringstream ss;
+ ss << in.rdbuf();
+ cmake_cache_content = ss.str();
+
+ in.close();
+ }
+
+ static std::string const prefix_key = "CMAKE_INSTALL_PREFIX:PATH=";
+
+ // Extract the value of CMAKE_INSTALL_PREFIX
+ auto begin = cmake_cache_content.find(prefix_key);
+ if (begin != std::string::npos)
+ {
+ begin += prefix_key.length();
+ auto const end = cmake_cache_content.find("\n", begin);
+ if (end != std::string::npos)
+ {
+ fs::path value = cmake_cache_content.substr(begin, end - begin);
+
+ auto current_path = fs::current_path();
+
+ #ifndef _WIN32
+ // The worldserver location is ${CMAKE_INSTALL_PREFIX}/bin
+ // on all other platforms then windows
+ current_path = current_path.parent_path();
+ #endif
+
+ if (value != current_path)
+ {
+ // Prevent correction of the install prefix
+ // when we are starting the core from inside the build tree
+ bool const is_in_path = [&]
+ {
+ fs::path base = BuiltInConfig::GetBuildDirectory();
+ fs::path branch = value;
+ while (!branch.empty())
+ {
+ if (base == branch)
+ return true;
+
+ branch = branch.parent_path();
+ }
+
+ return false;
+ }();
+
+ if (is_in_path)
+ return;
+
+ TC_LOG_INFO("scripts.hotswap", ">> Found outdated CMAKE_INSTALL_PREFIX (\"%s\"), "
+ "worldserver is currently installed at %s...",
+ value.generic_string().c_str(), current_path.generic_string().c_str());
+ }
+ else
+ {
+ TC_LOG_INFO("scripts.hotswap", ">> CMAKE_INSTALL_PREFIX is equal to the current path of execution.");
+ return;
+ }
+ }
+ }
+
+ TC_LOG_INFO("scripts.hotswap", "Invoking CMake cache correction...");
+
+ auto const error = InvokeCMakeCommand(
+ "-DCMAKE_INSTALL_PREFIX:PATH=" + fs::current_path().generic_string(),
+ BuiltInConfig::GetBuildDirectory());
+
+ if (error)
+ {
+ TC_LOG_ERROR("scripts.hotswap", ">> Failed to update the CMAKE_INSTALL_PREFIX! "
+ "This could lead to unexpected behaviour!");
+ }
+ else
+ {
+ TC_LOG_ERROR("scripts.hotswap", ">> Successfully corrected your CMAKE_INSTALL_PREFIX variable"
+ "to point at your current path of execution.");
+ }
+ }
+
+ // File watcher instance and watcher ID's
+ efsw::FileWatcher _fileWatcher;
+ efsw::WatchID _libraryWatcher;
+
+ // Unique library name counter which is used to
+ // generate unique names for every shared library version.
+ uint32 _unique_library_name_counter;
+
+ // Queue which is used for thread safe message processing
+ MPSCQueue<ScriptReloaderMessage> _messages;
+
+ // Change requests to load or unload shared libraries
+ std::unordered_set<fs::path /*path*/> _libraries_changed;
+ // The timestamp which indicates the last time a library was changed
+ uint32 _last_time_library_changed;
+
+ // Contains all running script modules
+ // The associated shared libraries are unloaded immediately
+ // on loosing ownership through RAII.
+ std::unordered_map<std::string /*module name*/,
+ std::pair<std::shared_ptr<ScriptModule>, std::unique_ptr<SourceUpdateListener>>
+ > _running_script_modules;
+ // Container which maps the path of a shared library to it's module name
+ std::unordered_map<fs::path, std::string /*module name*/> _running_script_module_names;
+ // Container which maps the module name to it's last known build directive
+ std::unordered_map<std::string /*module name*/, std::string /*build directive*/> _known_modules_build_directives;
+
+ // Modules which were changed and are queued for recompilation
+ std::unordered_map<std::string /*module*/,
+ std::unordered_map<fs::path /*path*/, ChangeStateRequest /*state*/>> _sources_changed;
+ // Tracks the time since the last module has changed to avoid burst updates
+ uint32 _last_time_sources_changed;
+
+ // Tracks the last timestamp the user was informed about a certain repeating event.
+ uint32 _last_time_user_informed;
+
+ // Represents the current build job which is in progress
+ Optional<BuildJob> _build_job;
+
+ // Is true when the build job dispatcher should stop after
+ // the current job has finished
+ bool terminate_early;
+
+ // The path to the tc_scripts temporary cache
+ fs::path temporary_cache_path_;
+};
+
+class ScriptModuleDeleteMessage
+{
+public:
+ explicit ScriptModuleDeleteMessage(ScriptModule* module)
+ : module_(module) { }
+
+ void operator() (HotSwapScriptReloadMgr*)
+ {
+ module_.reset();
+ }
+
+private:
+ std::unique_ptr<ScriptModule> module_;
+};
+
+void ScriptModule::ScheduleDelayedDelete(ScriptModule* module)
+{
+ sScriptReloadMgr->QueueMessage(ScriptModuleDeleteMessage(module));
+}
+
+/// Maps efsw actions to strings
+static char const* ActionToString(efsw::Action action)
+{
+ switch (action)
+ {
+ case efsw::Action::Add:
+ return "added";
+ case efsw::Action::Delete:
+ return "deleted";
+ case efsw::Action::Moved:
+ return "moved";
+ default:
+ return "modified";
+ }
+}
+
+void LibraryUpdateListener::handleFileAction(efsw::WatchID watchid, std::string const& dir,
+ std::string const& filename, efsw::Action action, std::string oldFilename)
+{
+ // TC_LOG_TRACE("scripts.hotswap", "Library listener detected change on possible module \"%s\ (%s)".", filename.c_str(), ActionToString(action));
+
+ // Split moved actions into a delete and an add action
+ if (action == efsw::Action::Moved)
+ {
+ ASSERT(!oldFilename.empty(), "Old filename doesn't exist!");
+ handleFileAction(watchid, dir, oldFilename, efsw::Action::Delete);
+ handleFileAction(watchid, dir, filename, efsw::Action::Add);
+ return;
+ }
+
+ sScriptReloadMgr->QueueMessage([=](HotSwapScriptReloadMgr* reloader) mutable
+ {
+ auto const path = fs::absolute(
+ filename,
+ sScriptReloadMgr->GetLibraryDirectory());
+
+ if (!HasValidScriptModuleName(filename))
+ return;
+
+ switch (action)
+ {
+ case efsw::Actions::Add:
+ TC_LOG_TRACE("scripts.hotswap", ">> Loading \"%s\" (%s)...",
+ path.generic_string().c_str(), ActionToString(action));
+ reloader->QueueSharedLibraryChanged(path);
+ break;
+ case efsw::Actions::Delete:
+ TC_LOG_TRACE("scripts.hotswap", ">> Unloading \"%s\" (%s)...",
+ path.generic_string().c_str(), ActionToString(action));
+ reloader->QueueSharedLibraryChanged(path);
+ break;
+ case efsw::Actions::Modified:
+ TC_LOG_TRACE("scripts.hotswap", ">> Reloading \"%s\" (%s)...",
+ path.generic_string().c_str(), ActionToString(action));
+ reloader->QueueSharedLibraryChanged(path);
+ break;
+ default:
+ WPAbort();
+ break;
+ }
+ });
+}
+
+/// Returns true when the given path has a known C++ file extension
+static bool HasCXXSourceFileExtension(fs::path const& path)
+{
+ static std::regex const regex("^\\.(h|hpp|c|cc|cpp)$");
+ return std::regex_match(path.extension().generic_string(), regex);
+}
+
+SourceUpdateListener::SourceUpdateListener(fs::path path, std::string script_module_name)
+ : path_(std::move(path)), script_module_name_(std::move(script_module_name)),
+ watcher_id_(sScriptReloadMgr->_fileWatcher.addWatch(path_.generic_string(), this, true))
+{
+ if (watcher_id_ >= 0)
+ {
+ TC_LOG_TRACE("scripts.hotswap", ">> Attached the source recompiler to \"%s\".",
+ path_.generic_string().c_str());
+ }
+ else
+ {
+ TC_LOG_ERROR("scripts.hotswap", "Failed to initialize thesource recompiler on \"%s\".",
+ path_.generic_string().c_str());
+ }
+}
+
+SourceUpdateListener::~SourceUpdateListener()
+{
+ if (watcher_id_ >= 0)
+ {
+ sScriptReloadMgr->_fileWatcher.removeWatch(watcher_id_);
+
+ TC_LOG_TRACE("scripts.hotswap", ">> Detached the source recompiler from \"%s\".",
+ path_.generic_string().c_str());
+ }
+}
+
+void SourceUpdateListener::handleFileAction(efsw::WatchID watchid, std::string const& dir,
+ std::string const& filename, efsw::Action action, std::string oldFilename)
+{
+ // TC_LOG_TRACE("scripts.hotswap", "Source listener detected change on possible file \"%s/%s\" (%s).", dir.c_str(), filename.c_str(), ActionToString(action));
+
+ // Skip the file change notification if the recompiler is disabled
+ if (!sWorld->getBoolConfig(CONFIG_HOTSWAP_RECOMPILER_ENABLED))
+ return;
+
+ // Split moved actions into a delete and an add action
+ if (action == efsw::Action::Moved)
+ {
+ ASSERT(!oldFilename.empty(), "Old filename doesn't exist!");
+ handleFileAction(watchid, dir, oldFilename, efsw::Action::Delete);
+ handleFileAction(watchid, dir, filename, efsw::Action::Add);
+ return;
+ }
+
+ auto const path = fs::absolute(
+ filename,
+ dir);
+
+ // Check if the file is a C/C++ source file.
+ if (!path.has_extension() || !HasCXXSourceFileExtension(path))
+ return;
+
+ /// Thread safe part
+ sScriptReloadMgr->QueueMessage([=](HotSwapScriptReloadMgr* reloader)
+ {
+ TC_LOG_TRACE("scripts.hotswap", "Detected source change on module \"%s\", "
+ "queued for recompilation...", script_module_name_.c_str());
+
+ switch (action)
+ {
+ case efsw::Actions::Add:
+ TC_LOG_TRACE("scripts.hotswap", "Source file %s of module %s was added.",
+ path.generic_string().c_str(), script_module_name_.c_str());
+ reloader->QueueAddSourceFile(script_module_name_, path);
+ break;
+ case efsw::Actions::Delete:
+ TC_LOG_TRACE("scripts.hotswap", "Source file %s of module %s was deleted.",
+ path.generic_string().c_str(), script_module_name_.c_str());
+ reloader->QueueRemoveSourceFile(script_module_name_, path);
+ break;
+ case efsw::Actions::Modified:
+ TC_LOG_TRACE("scripts.hotswap", "Source file %s of module %s was modified.",
+ path.generic_string().c_str(), script_module_name_.c_str());
+ reloader->QueueModifySourceFile(script_module_name_, path);
+ break;
+ default:
+ WPAbort();
+ break;
+ }
+ });
+}
+
+// Returns the module reference of the given context
+std::shared_ptr<ModuleReference>
+ ScriptReloadMgr::AcquireModuleReferenceOfContext(std::string const& context)
+{
+ // Return empty references for the static context exported by the worldserver
+ if (context == ScriptMgr::GetNameOfStaticContext())
+ return { };
+
+ auto const itr = sScriptReloadMgr->_running_script_modules.find(context);
+ ASSERT(itr != sScriptReloadMgr->_running_script_modules.end()
+ && "Requested a reference to a non existent script context!");
+
+ return itr->second.first;
+}
+
+// Returns the full hot swap implemented ScriptReloadMgr
+ScriptReloadMgr* ScriptReloadMgr::instance()
+{
+ static HotSwapScriptReloadMgr instance;
+ return &instance;
+}
+
+#endif // #ifndef TRINITY_API_USE_DYNAMIC_LINKING
diff --git a/src/server/game/Scripting/ScriptReloadMgr.h b/src/server/game/Scripting/ScriptReloadMgr.h
new file mode 100644
index 00000000000..f9b388f8eb0
--- /dev/null
+++ b/src/server/game/Scripting/ScriptReloadMgr.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SCRIPT_RELOADER_H
+#define SCRIPT_RELOADER_H
+
+#include <memory>
+#include <string>
+#include "Define.h"
+#include <boost/filesystem/path.hpp>
+
+/// Represents a strong reference to a dynamic library which
+/// provides C++ scripts. As long as one reference to the library exists
+/// the library is kept loaded in the server, which makes it possible to lazy
+/// unload several script types on demand (like SpellScripts), and to
+/// provide multiple versions of the same script to the script factories.
+///
+/// Acquire a new reference through using:
+/// `ScriptReloadMgr::AcquireModuleReferenceOfContext`
+class ModuleReference
+{
+public:
+ virtual ~ModuleReference() { }
+
+ /// Returns the git revision hash of the referenced script module
+ virtual char const* GetScriptModuleRevisionHash() const = 0;
+ /// Returns the name of the referenced script module
+ virtual char const* GetScriptModule() const = 0;
+ /// Returns the path to the script module
+ virtual boost::filesystem::path const& GetModulePath() const = 0;
+};
+
+/// Provides the whole physical dynamic library unloading capability.
+/// Loads, Reloads and Unloads dynamic libraries on changes and
+/// informs the ScriptMgr about changes which were made.
+/// The ScriptReloadMgr is also responsible for watching the source directory
+/// and to invoke a build on changes.
+class TC_GAME_API ScriptReloadMgr
+{
+protected:
+ ScriptReloadMgr() { }
+
+public:
+ virtual ~ScriptReloadMgr() { }
+
+ /// Initializes the ScriptReloadMgr
+ virtual void Initialize() { }
+
+ /// Needs to be called periodically to check for updates on script modules.
+ /// Expects to be invoked in a thread safe way which means it's required that
+ /// the current thread is the only one which accesses the world data.
+ virtual void Update() { }
+
+ /// Unloads the ScriptReloadMgr
+ virtual void Unload() { }
+
+ /// Returns an owning reference to the current module of the given context
+ static std::shared_ptr<ModuleReference> AcquireModuleReferenceOfContext(
+ std::string const& context);
+
+ /// Returns the unique ScriptReloadMgr singleton instance
+ static ScriptReloadMgr* instance();
+};
+
+#define sScriptReloadMgr ScriptReloadMgr::instance()
+
+#endif // SCRIPT_RELOADER_H
diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp
index e828830ec0f..52c5c1640af 100644
--- a/src/server/game/Scripting/ScriptSystem.cpp
+++ b/src/server/game/Scripting/ScriptSystem.cpp
@@ -21,7 +21,13 @@
#include "DatabaseEnv.h"
#include "ScriptMgr.h"
-ScriptPointVector const SystemMgr::_empty;
+TC_GAME_API ScriptPointVector const SystemMgr::_empty;
+
+SystemMgr* SystemMgr::instance()
+{
+ static SystemMgr instance;
+ return &instance;
+}
void SystemMgr::LoadScriptWaypoints()
{
diff --git a/src/server/game/Scripting/ScriptSystem.h b/src/server/game/Scripting/ScriptSystem.h
index 74c51e5b136..7cf8ffc85b0 100644
--- a/src/server/game/Scripting/ScriptSystem.h
+++ b/src/server/game/Scripting/ScriptSystem.h
@@ -45,18 +45,14 @@ struct ScriptPointMove
typedef std::vector<ScriptPointMove> ScriptPointVector;
-class SystemMgr
+class TC_GAME_API SystemMgr
{
private:
SystemMgr() { }
~SystemMgr() { }
public:
- static SystemMgr* instance()
- {
- static SystemMgr instance;
- return &instance;
- }
+ static SystemMgr* instance();
typedef std::unordered_map<uint32, ScriptPointVector> PointMoveMap;
diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h
index 0d30134aa9f..48ed03004ea 100644
--- a/src/server/game/Server/Protocol/Opcodes.h
+++ b/src/server/game/Server/Protocol/Opcodes.h
@@ -1373,7 +1373,7 @@ struct OpcodeHandler
void (WorldSession::*handler)(WorldPacket& recvPacket);
};
-extern OpcodeHandler opcodeTable[NUM_MSG_TYPES];
+TC_GAME_API extern OpcodeHandler opcodeTable[NUM_MSG_TYPES];
#pragma pack(pop)
diff --git a/src/server/game/Server/Protocol/PacketLog.cpp b/src/server/game/Server/Protocol/PacketLog.cpp
index 57b76304a77..114b2ae0ecc 100644
--- a/src/server/game/Server/Protocol/PacketLog.cpp
+++ b/src/server/game/Server/Protocol/PacketLog.cpp
@@ -45,7 +45,7 @@ struct PacketHeader
uint32 SocketPort;
};
- char Direction[4];
+ uint32 Direction;
uint32 ConnectionId;
uint32 ArrivalTicks;
uint32 OptionalDataSize;
@@ -69,6 +69,12 @@ PacketLog::~PacketLog()
_file = NULL;
}
+PacketLog* PacketLog::instance()
+{
+ static PacketLog instance;
+ return &instance;
+}
+
void PacketLog::Initialize()
{
std::string logsDir = sConfigMgr->GetStringDefault("LogsDir", "");
@@ -103,7 +109,7 @@ void PacketLog::LogPacket(WorldPacket const& packet, Direction direction, boost:
std::lock_guard<std::mutex> lock(_logPacketLock);
PacketHeader header;
- *reinterpret_cast<uint32*>(header.Direction) = direction == CLIENT_TO_SERVER ? 0x47534d43 : 0x47534d53;
+ header.Direction = direction == CLIENT_TO_SERVER ? 0x47534d43 : 0x47534d53;
header.ConnectionId = 0;
header.ArrivalTicks = getMSTime();
diff --git a/src/server/game/Server/Protocol/PacketLog.h b/src/server/game/Server/Protocol/PacketLog.h
index 45a3f0a4655..5e7661a884b 100644
--- a/src/server/game/Server/Protocol/PacketLog.h
+++ b/src/server/game/Server/Protocol/PacketLog.h
@@ -31,7 +31,7 @@ enum Direction
class WorldPacket;
-class PacketLog
+class TC_GAME_API PacketLog
{
private:
PacketLog();
@@ -40,11 +40,7 @@ class PacketLog
std::once_flag _initializeFlag;
public:
- static PacketLog* instance()
- {
- static PacketLog instance;
- return &instance;
- }
+ static PacketLog* instance();
void Initialize();
bool CanLogPacket() const { return (_file != NULL); }
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index c380c1a5627..f65cd750ea9 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -43,6 +43,7 @@
#include "WardenWin.h"
#include "MoveSpline.h"
#include "WardenMac.h"
+#include "Metric.h"
#include <zlib.h>
@@ -187,7 +188,7 @@ ObjectGuid::LowType WorldSession::GetGUIDLow() const
}
/// Send a packet to the client
-void WorldSession::SendPacket(WorldPacket* packet)
+void WorldSession::SendPacket(WorldPacket const* packet)
{
if (!m_Socket)
return;
@@ -272,119 +273,99 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
WorldPacket* packet = NULL;
//! Delete packet after processing by default
bool deletePacket = true;
- //! To prevent infinite loop
- WorldPacket* firstDelayedPacket = NULL;
- //! If _recvQueue.peek() == firstDelayedPacket it means that in this Update call, we've processed all
- //! *properly timed* packets, and we're now at the part of the queue where we find
- //! delayed packets that were re-enqueued due to improper timing. To prevent an infinite
- //! loop caused by re-enqueueing the same packets over and over again, we stop updating this session
- //! and continue updating others. The re-enqueued packets will be handled in the next Update call for this session.
+ std::vector<WorldPacket*> requeuePackets;
uint32 processedPackets = 0;
time_t currentTime = time(NULL);
- while (m_Socket && !_recvQueue.empty() && _recvQueue.peek(true) != firstDelayedPacket && _recvQueue.next(packet, updater))
+ while (m_Socket && _recvQueue.next(packet, updater))
{
- if (packet->GetOpcode() >= NUM_MSG_TYPES)
+ OpcodeHandler const& opHandle = opcodeTable[packet->GetOpcode()];
+ try
{
- TC_LOG_ERROR("network.opcode", "Received non-existed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
- , GetPlayerInfo().c_str());
- sScriptMgr->OnUnknownPacketReceive(this, *packet);
- }
- else
- {
- OpcodeHandler& opHandle = opcodeTable[packet->GetOpcode()];
- try
+ switch (opHandle.status)
{
- switch (opHandle.status)
- {
- case STATUS_LOGGEDIN:
- if (!_player)
- {
- // skip STATUS_LOGGEDIN opcode unexpected errors if player logout sometime ago - this can be network lag delayed packets
- //! If player didn't log out a while ago, it means packets are being sent while the server does not recognize
- //! the client to be in world yet. We will re-add the packets to the bottom of the queue and process them later.
- if (!m_playerRecentlyLogout)
- {
- //! Prevent infinite loop
- if (!firstDelayedPacket)
- firstDelayedPacket = packet;
- //! Because checking a bool is faster than reallocating memory
- deletePacket = false;
- QueuePacket(packet);
- //! Log
- TC_LOG_DEBUG("network", "Re-enqueueing packet with opcode %s with with status STATUS_LOGGEDIN. "
- "Player is currently not in world yet.", GetOpcodeNameForLogging(packet->GetOpcode()).c_str());
- }
- }
- else if (_player->IsInWorld() && AntiDOS.EvaluateOpcode(*packet, currentTime))
- {
- sScriptMgr->OnPacketReceive(this, *packet);
- (this->*opHandle.handler)(*packet);
- LogUnprocessedTail(packet);
- }
- // lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer
- break;
- case STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT:
- if (!_player && !m_playerRecentlyLogout && !m_playerLogout) // There's a short delay between _player = null and m_playerRecentlyLogout = true during logout
- LogUnexpectedOpcode(packet, "STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT",
- "the player has not logged in yet and not recently logout");
- else if (AntiDOS.EvaluateOpcode(*packet, currentTime))
- {
- // not expected _player or must checked in packet handler
- sScriptMgr->OnPacketReceive(this, *packet);
- (this->*opHandle.handler)(*packet);
- LogUnprocessedTail(packet);
- }
- break;
- case STATUS_TRANSFER:
- if (!_player)
- LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player has not logged in yet");
- else if (_player->IsInWorld())
- LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player is still in world");
- else if (AntiDOS.EvaluateOpcode(*packet, currentTime))
- {
- sScriptMgr->OnPacketReceive(this, *packet);
- (this->*opHandle.handler)(*packet);
- LogUnprocessedTail(packet);
- }
- break;
- case STATUS_AUTHED:
- // prevent cheating with skip queue wait
- if (m_inQueue)
- {
- LogUnexpectedOpcode(packet, "STATUS_AUTHED", "the player not pass queue yet");
- break;
- }
-
- // some auth opcodes can be recieved before STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes
- // however when we recieve CMSG_CHAR_ENUM we are surely no longer during the logout process.
- if (packet->GetOpcode() == CMSG_CHAR_ENUM)
- m_playerRecentlyLogout = false;
-
- if (AntiDOS.EvaluateOpcode(*packet, currentTime))
+ case STATUS_LOGGEDIN:
+ if (!_player)
+ {
+ // skip STATUS_LOGGEDIN opcode unexpected errors if player logout sometime ago - this can be network lag delayed packets
+ //! If player didn't log out a while ago, it means packets are being sent while the server does not recognize
+ //! the client to be in world yet. We will re-add the packets to the bottom of the queue and process them later.
+ if (!m_playerRecentlyLogout)
{
- sScriptMgr->OnPacketReceive(this, *packet);
- (this->*opHandle.handler)(*packet);
- LogUnprocessedTail(packet);
+ requeuePackets.push_back(packet);
+ deletePacket = false;
+ TC_LOG_DEBUG("network", "Re-enqueueing packet with opcode %s with with status STATUS_LOGGEDIN. "
+ "Player is currently not in world yet.", GetOpcodeNameForLogging(packet->GetOpcode()).c_str());
}
+ }
+ else if (_player->IsInWorld() && AntiDOS.EvaluateOpcode(*packet, currentTime))
+ {
+ sScriptMgr->OnPacketReceive(this, *packet);
+ (this->*opHandle.handler)(*packet);
+ LogUnprocessedTail(packet);
+ }
+ // lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer
+ break;
+ case STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT:
+ if (!_player && !m_playerRecentlyLogout && !m_playerLogout) // There's a short delay between _player = null and m_playerRecentlyLogout = true during logout
+ LogUnexpectedOpcode(packet, "STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT",
+ "the player has not logged in yet and not recently logout");
+ else if (AntiDOS.EvaluateOpcode(*packet, currentTime))
+ {
+ // not expected _player or must checked in packet hanlder
+ sScriptMgr->OnPacketReceive(this, *packet);
+ (this->*opHandle.handler)(*packet);
+ LogUnprocessedTail(packet);
+ }
+ break;
+ case STATUS_TRANSFER:
+ if (!_player)
+ LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player has not logged in yet");
+ else if (_player->IsInWorld())
+ LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player is still in world");
+ else if (AntiDOS.EvaluateOpcode(*packet, currentTime))
+ {
+ sScriptMgr->OnPacketReceive(this, *packet);
+ (this->*opHandle.handler)(*packet);
+ LogUnprocessedTail(packet);
+ }
+ break;
+ case STATUS_AUTHED:
+ // prevent cheating with skip queue wait
+ if (m_inQueue)
+ {
+ LogUnexpectedOpcode(packet, "STATUS_AUTHED", "the player not pass queue yet");
break;
- case STATUS_NEVER:
- TC_LOG_ERROR("network.opcode", "Received not allowed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
- , GetPlayerInfo().c_str());
- break;
- case STATUS_UNHANDLED:
- TC_LOG_DEBUG("network.opcode", "Received not handled opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
- , GetPlayerInfo().c_str());
- break;
- }
- }
- catch (ByteBufferException const&)
- {
- TC_LOG_ERROR("misc", "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.",
- packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
- packet->hexlike();
+ }
+
+ // some auth opcodes can be recieved before STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes
+ // however when we recieve CMSG_CHAR_ENUM we are surely no longer during the logout process.
+ if (packet->GetOpcode() == CMSG_CHAR_ENUM)
+ m_playerRecentlyLogout = false;
+
+ if (AntiDOS.EvaluateOpcode(*packet, currentTime))
+ {
+ sScriptMgr->OnPacketReceive(this, *packet);
+ (this->*opHandle.handler)(*packet);
+ LogUnprocessedTail(packet);
+ }
+ break;
+ case STATUS_NEVER:
+ TC_LOG_ERROR("network.opcode", "Received not allowed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
+ , GetPlayerInfo().c_str());
+ break;
+ case STATUS_UNHANDLED:
+ TC_LOG_DEBUG("network.opcode", "Received not handled opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()
+ , GetPlayerInfo().c_str());
+ break;
}
}
+ catch (ByteBufferException const&)
+ {
+ TC_LOG_ERROR("network", "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.",
+ packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
+ packet->hexlike();
+ }
if (deletePacket)
delete packet;
@@ -400,6 +381,10 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
break;
}
+ TC_METRIC_VALUE("processed_packets", processedPackets);
+
+ _recvQueue.readd(requeuePackets.begin(), requeuePackets.end());
+
if (m_Socket && m_Socket->IsOpen() && _warden)
_warden->Update();
@@ -554,6 +539,8 @@ void WorldSession::LogoutPlayer(bool save)
//! Call script hook before deletion
sScriptMgr->OnPlayerLogout(_player);
+ TC_METRIC_EVENT("player_events", "Logout", _player->GetName());
+
//! Remove the player from the world
// the player may not be in the world when logging out
// e.g if he got disconnected during a transfer to another map
@@ -841,32 +828,15 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi)
mi->RemoveMovementFlag((maskToRemove));
#endif
+ if (!GetPlayer()->GetVehicleBase() || !(GetPlayer()->GetVehicle()->GetVehicleInfo()->m_flags & VEHICLE_FLAG_FIXED_POSITION))
+ REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT), MOVEMENTFLAG_ROOT);
+
/*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid
in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD.
It will freeze clients that receive this player's movement info.
*/
- // Only adjust movement flag removal for vehicles with the VEHICLE_FLAG_FIXED_POSITION flag, or the hard coded exceptions below:
- // 30236 | Argent Cannon
- // 39759 | Tankbuster Cannon
- if (GetPlayer()->GetVehicleBase() && ((GetPlayer()->GetVehicle()->GetVehicleInfo()->m_flags & VEHICLE_FLAG_FIXED_POSITION) || GetPlayer()->GetVehicleBase()->GetEntry() == 30236 || GetPlayer()->GetVehicleBase()->GetEntry() == 39759))
- {
- // Actually players in rooted vehicles still send commands, don't clear root for these!
- // Check specifically for the following conditions:
- // MOVEMENTFLAG_ROOT + no other flags (0x800)
- // MOVEMENTFLAG_ROOT + MOVEMENTFLAG_LEFT (0x810)
- // MOVEMENTFLAG_ROOT + MOVEMENTFLAG_RIGHT (0x820)
- // MOVEMENTFLAG_ROOT + MOVEMENTFLAG_PITCH_UP (0x840)
- // MOVEMENTFLAG_ROOT + MOVEMENTFLAG_PITCH_DOWN (0x880)
- // If none of these are true, clear the root
- REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT) && mi->HasMovementFlag(MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT | MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN),
- MOVEMENTFLAG_MASK_MOVING);
- }
- else
- {
- // Only remove here for non vehicles
- REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT),
- MOVEMENTFLAG_ROOT);
- }
+ REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT) && mi->HasMovementFlag(MOVEMENTFLAG_MASK_MOVING),
+ MOVEMENTFLAG_MASK_MOVING);
//! Cannot hover without SPELL_AURA_HOVER
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasAuraType(SPELL_AURA_HOVER),
@@ -892,8 +862,10 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi)
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD),
MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD);
- //! Cannot walk on water without SPELL_AURA_WATER_WALK
- REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK),
+ //! Cannot walk on water without SPELL_AURA_WATER_WALK except for ghosts
+ REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) &&
+ !GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK) &&
+ !GetPlayer()->HasAuraType(SPELL_AURA_GHOST),
MOVEMENTFLAG_WATERWALKING);
//! Cannot feather fall without SPELL_AURA_FEATHER_FALL
@@ -1220,7 +1192,7 @@ void WorldSession::LoadPermissions()
uint32 id = GetAccountId();
uint8 secLevel = GetSecurity();
- _RBACData = new rbac::RBACData(id, _accountName, realmID, secLevel);
+ _RBACData = new rbac::RBACData(id, _accountName, realm.Id.Realm, secLevel);
_RBACData->LoadFromDB();
}
@@ -1230,9 +1202,9 @@ PreparedQueryResultFuture WorldSession::LoadPermissionsAsync()
uint8 secLevel = GetSecurity();
TC_LOG_DEBUG("rbac", "WorldSession::LoadPermissions [AccountId: %u, Name: %s, realmId: %d, secLevel: %u]",
- id, _accountName.c_str(), realmID, secLevel);
+ id, _accountName.c_str(), realm.Id.Realm, secLevel);
- _RBACData = new rbac::RBACData(id, _accountName, realmID, secLevel);
+ _RBACData = new rbac::RBACData(id, _accountName, realm.Id.Realm, secLevel);
return _RBACData->LoadFromDBAsync();
}
@@ -1310,7 +1282,7 @@ bool WorldSession::HasPermission(uint32 permission)
bool hasPermission = _RBACData->HasPermission(permission);
TC_LOG_DEBUG("rbac", "WorldSession::HasPermission [AccountId: %u, Name: %s, realmId: %d]",
- _RBACData->GetId(), _RBACData->GetName().c_str(), realmID);
+ _RBACData->GetId(), _RBACData->GetName().c_str(), realm.Id.Realm);
return hasPermission;
}
@@ -1318,7 +1290,7 @@ bool WorldSession::HasPermission(uint32 permission)
void WorldSession::InvalidateRBACData()
{
TC_LOG_DEBUG("rbac", "WorldSession::Invalidaterbac::RBACData [AccountId: %u, Name: %s, realmId: %d]",
- _RBACData->GetId(), _RBACData->GetName().c_str(), realmID);
+ _RBACData->GetId(), _RBACData->GetName().c_str(), realm.Id.Realm);
delete _RBACData;
_RBACData = NULL;
}
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index 2253b6bc684..584367bd375 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -246,7 +246,7 @@ struct PacketCounter
};
/// Player session in the World
-class WorldSession
+class TC_GAME_API WorldSession
{
public:
WorldSession(uint32 id, std::string&& name, std::shared_ptr<WorldSocket> sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale, uint32 recruiter, bool isARecruiter);
@@ -264,7 +264,7 @@ class WorldSession
void ReadMovementInfo(WorldPacket& data, MovementInfo* mi);
void WriteMovementInfo(WorldPacket* data, MovementInfo* mi);
- void SendPacket(WorldPacket* packet);
+ void SendPacket(WorldPacket const* packet);
void SendNotification(const char *format, ...) ATTR_PRINTF(2, 3);
void SendNotification(uint32 string_id, ...);
void SendPetNameInvalid(uint32 error, std::string const& name, DeclinedName *declinedName);
diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp
index a2d357cbc4d..a8a639d9b7f 100644
--- a/src/server/game/Server/WorldSocket.cpp
+++ b/src/server/game/Server/WorldSocket.cpp
@@ -25,6 +25,17 @@
#include <memory>
+class EncryptablePacket : public WorldPacket
+{
+public:
+ EncryptablePacket(WorldPacket const& packet, bool encrypt) : WorldPacket(packet), _encrypt(encrypt) { }
+
+ bool NeedsEncryption() const { return _encrypt; }
+
+private:
+ bool _encrypt;
+};
+
using boost::asio::ip::tcp;
WorldSocket::WorldSocket(tcp::socket&& socket)
@@ -40,11 +51,8 @@ void WorldSocket::Start()
stmt->setString(0, ip_address);
stmt->setUInt32(1, inet_addr(ip_address.c_str()));
- {
- std::lock_guard<std::mutex> guard(_queryLock);
- _queryCallback = io_service().wrap(std::bind(&WorldSocket::CheckIpCallback, this, std::placeholders::_1));
- _queryFuture = LoginDatabase.AsyncQuery(stmt);
- }
+ _queryCallback = std::bind(&WorldSocket::CheckIpCallback, this, std::placeholders::_1);
+ _queryFuture = LoginDatabase.AsyncQuery(stmt);
}
void WorldSocket::CheckIpCallback(PreparedQueryResult result)
@@ -78,17 +86,50 @@ void WorldSocket::CheckIpCallback(PreparedQueryResult result)
bool WorldSocket::Update()
{
+ EncryptablePacket* queued;
+ MessageBuffer buffer;
+ while (_bufferQueue.Dequeue(queued))
+ {
+ ServerPktHeader header(queued->size() + 2, queued->GetOpcode());
+ if (queued->NeedsEncryption())
+ _authCrypt.EncryptSend(header.header, header.getHeaderLength());
+
+ if (buffer.GetRemainingSpace() < queued->size() + header.getHeaderLength())
+ {
+ QueuePacket(std::move(buffer));
+ buffer.Resize(4096);
+ }
+
+ if (buffer.GetRemainingSpace() >= queued->size() + header.getHeaderLength())
+ {
+ buffer.Write(header.header, header.getHeaderLength());
+ if (!queued->empty())
+ buffer.Write(queued->contents(), queued->size());
+ }
+ else // single packet larger than 4096 bytes
+ {
+ MessageBuffer packetBuffer(queued->size() + header.getHeaderLength());
+ packetBuffer.Write(header.header, header.getHeaderLength());
+ if (!queued->empty())
+ packetBuffer.Write(queued->contents(), queued->size());
+
+ QueuePacket(std::move(packetBuffer));
+ }
+
+ delete queued;
+ }
+
+ if (buffer.GetActiveSize() > 0)
+ QueuePacket(std::move(buffer));
+
if (!BaseSocket::Update())
return false;
+ if (_queryFuture.valid() && _queryFuture.wait_for(std::chrono::seconds(0)) == std::future_status::ready)
{
- std::lock_guard<std::mutex> guard(_queryLock);
- if (_queryFuture.valid() && _queryFuture.wait_for(std::chrono::seconds(0)) == std::future_status::ready)
- {
- auto callback = std::move(_queryCallback);
- _queryCallback = nullptr;
- callback(_queryFuture.get());
- }
+ auto callback = _queryCallback;
+ _queryCallback = nullptr;
+ callback(_queryFuture.get());
}
return true;
@@ -283,9 +324,20 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
switch (opcode)
{
case CMSG_PING:
+ {
LogOpcodeText(opcode, sessionGuard);
- return HandlePing(packet) ? ReadDataHandlerResult::Ok : ReadDataHandlerResult::Error;
+ try
+ {
+ return HandlePing(packet) ? ReadDataHandlerResult::Ok : ReadDataHandlerResult::Error;
+ }
+ catch (ByteBufferPositionException const&)
+ {
+ }
+ TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler(): client %s sent malformed CMSG_PING", GetRemoteIpAddress().to_string().c_str());
+ return ReadDataHandlerResult::Error;
+ }
case CMSG_AUTH_SESSION:
+ {
LogOpcodeText(opcode, sessionGuard);
if (_authed)
{
@@ -295,19 +347,29 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler()
return ReadDataHandlerResult::Error;
}
- HandleAuthSession(packet);
- return ReadDataHandlerResult::WaitingForQuery;
+ try
+ {
+ HandleAuthSession(packet);
+ return ReadDataHandlerResult::WaitingForQuery;
+ }
+ catch (ByteBufferPositionException const&)
+ {
+ }
+ TC_LOG_ERROR("network", "WorldSocket::ReadDataHandler(): client %s sent malformed CMSG_AUTH_SESSION", GetRemoteIpAddress().to_string().c_str());
+ return ReadDataHandlerResult::Error;
+ }
case CMSG_KEEP_ALIVE:
LogOpcodeText(opcode, sessionGuard);
break;
default:
{
sessionGuard.lock();
+
LogOpcodeText(opcode, sessionGuard);
+
if (!_worldSession)
{
TC_LOG_ERROR("network.opcode", "ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
- CloseSocket();
return ReadDataHandlerResult::Error;
}
@@ -351,29 +413,7 @@ void WorldSocket::SendPacket(WorldPacket const& packet)
if (sPacketLog->CanLogPacket())
sPacketLog->LogPacket(packet, SERVER_TO_CLIENT, GetRemoteIpAddress(), GetRemotePort());
- ServerPktHeader header(packet.size() + 2, packet.GetOpcode());
-
- std::unique_lock<std::mutex> guard(_writeLock);
-
- _authCrypt.EncryptSend(header.header, header.getHeaderLength());
-
-#ifndef TC_SOCKET_USE_IOCP
- if (_writeQueue.empty() && _writeBuffer.GetRemainingSpace() >= header.getHeaderLength() + packet.size())
- {
- _writeBuffer.Write(header.header, header.getHeaderLength());
- if (!packet.empty())
- _writeBuffer.Write(packet.contents(), packet.size());
- }
- else
-#endif
- {
- MessageBuffer buffer(header.getHeaderLength() + packet.size());
- buffer.Write(header.header, header.getHeaderLength());
- if (!packet.empty())
- buffer.Write(packet.contents(), packet.size());
-
- QueuePacket(std::move(buffer), guard);
- }
+ _bufferQueue.Enqueue(new EncryptablePacket(packet, _authCrypt.IsInitialized()));
}
void WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
@@ -395,14 +435,11 @@ void WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
// Get the account information from the auth database
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME);
- stmt->setInt32(0, int32(realmID));
+ stmt->setInt32(0, int32(realm.Id.Realm));
stmt->setString(1, authSession->Account);
- {
- std::lock_guard<std::mutex> guard(_queryLock);
- _queryCallback = io_service().wrap(std::bind(&WorldSocket::HandleAuthSessionCallback, this, authSession, std::placeholders::_1));
- _queryFuture = LoginDatabase.AsyncQuery(stmt);
- }
+ _queryCallback = std::bind(&WorldSocket::HandleAuthSessionCallback, this, authSession, std::placeholders::_1);
+ _queryFuture = LoginDatabase.AsyncQuery(stmt);
}
void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<AuthSession> authSession, PreparedQueryResult result)
@@ -441,10 +478,11 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<AuthSession> authSes
return;
}
- if (authSession->RealmID != realmID)
+ if (authSession->RealmID != realm.Id.Realm)
{
SendAuthResponseError(REALM_LIST_REALM_NOT_FOUND);
- TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Sent Auth Response (bad realm).");
+ TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Client %s requested connecting with realm id %u but this realm has id %u set in config.",
+ GetRemoteIpAddress().to_string().c_str(), authSession->RealmID, realm.Id.Realm);
DelayedCloseSocket();
return;
}
@@ -559,7 +597,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<AuthSession> authSes
if (wardenActive)
_worldSession->InitWarden(&account.SessionKey, account.OS);
- _queryCallback = io_service().wrap(std::bind(&WorldSocket::LoadSessionPermissionsCallback, this, std::placeholders::_1));
+ _queryCallback = std::bind(&WorldSocket::LoadSessionPermissionsCallback, this, std::placeholders::_1);
_queryFuture = _worldSession->LoadPermissionsAsync();
AsyncRead();
}
diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h
index 9e5b35992a6..3874b60b0bb 100644
--- a/src/server/game/Server/WorldSocket.h
+++ b/src/server/game/Server/WorldSocket.h
@@ -26,11 +26,12 @@
#include "Util.h"
#include "WorldPacket.h"
#include "WorldSession.h"
+#include "MPSCQueue.h"
#include <chrono>
#include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/buffer.hpp>
using boost::asio::ip::tcp;
+class EncryptablePacket;
#pragma pack(push, 1)
@@ -47,7 +48,7 @@ struct ClientPktHeader
struct AuthSession;
-class WorldSocket : public Socket<WorldSocket>
+class TC_GAME_API WorldSocket : public Socket<WorldSocket>
{
typedef Socket<WorldSocket> BaseSocket;
@@ -104,8 +105,8 @@ private:
MessageBuffer _headerBuffer;
MessageBuffer _packetBuffer;
+ MPSCQueue<EncryptablePacket> _bufferQueue;
- std::mutex _queryLock;
PreparedQueryResultFuture _queryFuture;
std::function<void(PreparedQueryResult&&)> _queryCallback;
std::string _ipCountry;
diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp
index 529396b3966..2faf0704d4f 100644
--- a/src/server/game/Server/WorldSocketMgr.cpp
+++ b/src/server/game/Server/WorldSocketMgr.cpp
@@ -24,9 +24,9 @@
#include <boost/system/error_code.hpp>
-static void OnSocketAccept(tcp::socket&& sock)
+static void OnSocketAccept(tcp::socket&& sock, uint32 threadIndex)
{
- sWorldSocketMgr.OnSocketOpen(std::forward<tcp::socket>(sock));
+ sWorldSocketMgr.OnSocketOpen(std::forward<tcp::socket>(sock), threadIndex);
}
class WorldSocketThread : public NetworkThread<WorldSocket>
@@ -47,7 +47,13 @@ WorldSocketMgr::WorldSocketMgr() : BaseSocketMgr(), _socketSendBufferSize(-1), m
{
}
-bool WorldSocketMgr::StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port)
+WorldSocketMgr& WorldSocketMgr::Instance()
+{
+ static WorldSocketMgr instance;
+ return instance;
+}
+
+bool WorldSocketMgr::StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port, int threadCount)
{
_tcpNoDelay = sConfigMgr->GetBoolDefault("Network.TcpNodelay", true);
@@ -65,9 +71,11 @@ bool WorldSocketMgr::StartNetwork(boost::asio::io_service& service, std::string
return false;
}
- BaseSocketMgr::StartNetwork(service, bindIp, port);
+ BaseSocketMgr::StartNetwork(service, bindIp, port, threadCount);
+
+ _acceptor->SetSocketFactory(std::bind(&BaseSocketMgr::GetSocketForAccept, this));
- _acceptor->AsyncAcceptManaged(&OnSocketAccept);
+ _acceptor->AsyncAcceptWithCallback<&OnSocketAccept>();
sScriptMgr->OnNetworkStart();
return true;
@@ -80,7 +88,7 @@ void WorldSocketMgr::StopNetwork()
sScriptMgr->OnNetworkStop();
}
-void WorldSocketMgr::OnSocketOpen(tcp::socket&& sock)
+void WorldSocketMgr::OnSocketOpen(tcp::socket&& sock, uint32 threadIndex)
{
// set some options here
if (_socketSendBufferSize >= 0)
@@ -108,7 +116,7 @@ void WorldSocketMgr::OnSocketOpen(tcp::socket&& sock)
//sock->m_OutBufferSize = static_cast<size_t> (m_SockOutUBuff);
- BaseSocketMgr::OnSocketOpen(std::forward<tcp::socket>(sock));
+ BaseSocketMgr::OnSocketOpen(std::forward<tcp::socket>(sock), threadIndex);
}
NetworkThread<WorldSocket>* WorldSocketMgr::CreateThreads() const
diff --git a/src/server/game/Server/WorldSocketMgr.h b/src/server/game/Server/WorldSocketMgr.h
index 92a28d0c135..a5aee344bf7 100644
--- a/src/server/game/Server/WorldSocketMgr.h
+++ b/src/server/game/Server/WorldSocketMgr.h
@@ -30,24 +30,20 @@
class WorldSocket;
/// Manages all sockets connected to peers and network threads
-class WorldSocketMgr : public SocketMgr<WorldSocket>
+class TC_GAME_API WorldSocketMgr : public SocketMgr<WorldSocket>
{
typedef SocketMgr<WorldSocket> BaseSocketMgr;
public:
- static WorldSocketMgr& Instance()
- {
- static WorldSocketMgr instance;
- return instance;
- }
+ static WorldSocketMgr& Instance();
/// Start network, listen at address:port .
- bool StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port) override;
+ bool StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port, int networkThreads) override;
/// Stops all network threads, It will wait for all running threads .
void StopNetwork() override;
- void OnSocketOpen(tcp::socket&& sock) override;
+ void OnSocketOpen(tcp::socket&& sock, uint32 threadIndex) override;
protected:
WorldSocketMgr();
diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp
index 36a7d147192..8860b391f48 100644
--- a/src/server/game/Skills/SkillDiscovery.cpp
+++ b/src/server/game/Skills/SkillDiscovery.cpp
@@ -88,7 +88,7 @@ void LoadSkillDiscoveryTable()
{
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
{
- TC_LOG_ERROR("sql.sql", "Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table", spellId, reqSkillOrSpell);
+ TC_LOG_ERROR("sql.sql", "Spell (ID: %u) has a non-existing spell (ID: %i) in `reqSpell` field in the `skill_discovery_template` table.", spellId, reqSkillOrSpell);
reportedReqSpells.insert(absReqSkillOrSpell);
}
continue;
@@ -101,8 +101,8 @@ void LoadSkillDiscoveryTable()
{
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
{
- TC_LOG_ERROR("sql.sql", "Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
- " and not 100%% chance random discovery ability but listed for spellId %u (and maybe more) in `skill_discovery_template` table",
+ TC_LOG_ERROR("sql.sql", "Spell (ID: %u) does not have any MECHANIC_DISCOVERY (28) value in the Mechanic field in spell.dbc"
+ " nor 100%% chance random discovery ability, but is listed for spellId %u (and maybe more) in the `skill_discovery_template` table.",
absReqSkillOrSpell, spellId);
reportedReqSpells.insert(absReqSkillOrSpell);
}
@@ -117,7 +117,7 @@ void LoadSkillDiscoveryTable()
if (bounds.first == bounds.second)
{
- TC_LOG_ERROR("sql.sql", "Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table", spellId);
+ TC_LOG_ERROR("sql.sql", "Spell (ID: %u) is not listed in `SkillLineAbility.dbc`, but listed with `reqSpell`= 0 in the `skill_discovery_template` table.", spellId);
continue;
}
@@ -126,7 +126,7 @@ void LoadSkillDiscoveryTable()
}
else
{
- TC_LOG_ERROR("sql.sql", "Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId);
+ TC_LOG_ERROR("sql.sql", "Spell (ID: %u) has a negative value in `reqSpell` field in the `skill_discovery_template` table.", spellId);
continue;
}
@@ -135,7 +135,7 @@ void LoadSkillDiscoveryTable()
while (result->NextRow());
if (!ssNonDiscoverableEntries.str().empty())
- TC_LOG_ERROR("sql.sql", "Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str());
+ TC_LOG_ERROR("sql.sql", "Some items can't be successfully discovered, their chance field value is < 0.000001 in the `skill_discovery_template` DB table. List:\n%s", ssNonDiscoverableEntries.str().c_str());
// report about empty data for explicit discovery spells
for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id)
@@ -149,10 +149,10 @@ void LoadSkillDiscoveryTable()
continue;
if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end())
- TC_LOG_ERROR("sql.sql", "Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table", spell_id);
+ TC_LOG_ERROR("sql.sql", "Spell (ID: %u) has got 100%% chance random discovery ability, but does not have data in the `skill_discovery_template` table.", spell_id);
}
- TC_LOG_INFO("server.loading", ">> Loaded %u skill discovery definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u skill discovery definitions in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
diff --git a/src/server/game/Skills/SkillDiscovery.h b/src/server/game/Skills/SkillDiscovery.h
index b7fe1cdc8b2..c2020e5b075 100644
--- a/src/server/game/Skills/SkillDiscovery.h
+++ b/src/server/game/Skills/SkillDiscovery.h
@@ -23,8 +23,9 @@
class Player;
-void LoadSkillDiscoveryTable();
-uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player);
-bool HasDiscoveredAllSpells(uint32 spellId, Player* player);
-uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player);
+TC_GAME_API void LoadSkillDiscoveryTable();
+TC_GAME_API uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player);
+TC_GAME_API bool HasDiscoveredAllSpells(uint32 spellId, Player* player);
+TC_GAME_API uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player);
+
#endif
diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp
index 5213944cc90..f76e4623137 100644
--- a/src/server/game/Skills/SkillExtraItems.cpp
+++ b/src/server/game/Skills/SkillExtraItems.cpp
@@ -74,28 +74,28 @@ void LoadSkillPerfectItemTable()
if (!sSpellMgr->GetSpellInfo(spellId))
{
- TC_LOG_ERROR("sql.sql", "Skill perfection data for spell %u has non-existent spell id in `skill_perfect_item_template`!", spellId);
+ TC_LOG_ERROR("sql.sql", "Skill perfection data for spell %u has a non-existing spell id in the `skill_perfect_item_template`!", spellId);
continue;
}
uint32 requiredSpecialization = fields[1].GetUInt32();
if (!sSpellMgr->GetSpellInfo(requiredSpecialization))
{
- TC_LOG_ERROR("sql.sql", "Skill perfection data for spell %u has non-existent required specialization spell id %u in `skill_perfect_item_template`!", spellId, requiredSpecialization);
+ TC_LOG_ERROR("sql.sql", "Skill perfection data for spell %u has a non-existing required specialization spell id %u in the `skill_perfect_item_template`!", spellId, requiredSpecialization);
continue;
}
float perfectCreateChance = fields[2].GetFloat();
if (perfectCreateChance <= 0.0f)
{
- TC_LOG_ERROR("sql.sql", "Skill perfection data for spell %u has impossibly low proc chance in `skill_perfect_item_template`!", spellId);
+ TC_LOG_ERROR("sql.sql", "Skill perfection data for spell %u has impossibly low proc chance in the `skill_perfect_item_template`!", spellId);
continue;
}
uint32 perfectItemType = fields[3].GetUInt32();
if (!sObjectMgr->GetItemTemplate(perfectItemType))
{
- TC_LOG_ERROR("sql.sql", "Skill perfection data for spell %u references non-existent perfect item id %u in `skill_perfect_item_template`!", spellId, perfectItemType);
+ TC_LOG_ERROR("sql.sql", "Skill perfection data for spell %u references a non-existing perfect item id %u in the `skill_perfect_item_template`!", spellId, perfectItemType);
continue;
}
@@ -109,7 +109,7 @@ void LoadSkillPerfectItemTable()
}
while (result->NextRow());
- TC_LOG_INFO("server.loading", ">> Loaded %u spell perfection definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ TC_LOG_INFO("server.loading", ">> Loaded %u spell perfection definitions in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
// struct to store information about extra item creation
@@ -161,28 +161,28 @@ void LoadSkillExtraItemTable()
if (!sSpellMgr->GetSpellInfo(spellId))
{
- TC_LOG_ERROR("sql.sql", "Skill specialization %u has non-existent spell id in `skill_extra_item_template`!", spellId);
+ TC_LOG_ERROR("sql.sql", "Skill specialization %u has a non-existing spell id in the `skill_extra_item_template`!", spellId);
continue;
}
uint32 requiredSpecialization = fields[1].GetUInt32();
if (!sSpellMgr->GetSpellInfo(requiredSpecialization))
{
- TC_LOG_ERROR("sql.sql", "Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId, requiredSpecialization);
+ TC_LOG_ERROR("sql.sql", "Skill specialization %u has a non-existing required specialization spell id %u in the `skill_extra_item_template`!", spellId, requiredSpecialization);
continue;
}
float additionalCreateChance = fields[2].GetFloat();
if (additionalCreateChance <= 0.0f)
{
- TC_LOG_ERROR("sql.sql", "Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId);
+ TC_LOG_ERROR("sql.sql", "Skill specialization %u has too low additional create chance in the `skill_extra_item_template`!", spellId);
continue;
}
uint8 additionalMaxNum = fields[3].GetUInt8();
if (!additionalMaxNum)
{
- TC_LOG_ERROR("sql.sql", "Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId);
+ TC_LOG_ERROR("sql.sql", "Skill specialization %u has 0 max number of extra items in the `skill_extra_item_template`!", spellId);
continue;
}
diff --git a/src/server/game/Skills/SkillExtraItems.h b/src/server/game/Skills/SkillExtraItems.h
index 2889b221600..5a477b65f0b 100644
--- a/src/server/game/Skills/SkillExtraItems.h
+++ b/src/server/game/Skills/SkillExtraItems.h
@@ -23,12 +23,14 @@
// predef classes used in functions
class Player;
+
// returns true and sets the appropriate info if the player can create a perfect item with the given spellId
-bool CanCreatePerfectItem(Player* player, uint32 spellId, float &perfectCreateChance, uint32 &perfectItemType);
+TC_GAME_API bool CanCreatePerfectItem(Player* player, uint32 spellId, float &perfectCreateChance, uint32 &perfectItemType);
// load perfection proc info from DB
-void LoadSkillPerfectItemTable();
+TC_GAME_API void LoadSkillPerfectItemTable();
// returns true and sets the appropriate info if the player can create extra items with the given spellId
-bool CanCreateExtraItems(Player* player, uint32 spellId, float &additionalChance, uint8 &additionalMax);
+TC_GAME_API bool CanCreateExtraItems(Player* player, uint32 spellId, float &additionalChance, uint8 &additionalMax);
// function to load the extra item creation info from DB
-void LoadSkillExtraItemTable();
+TC_GAME_API void LoadSkillExtraItemTable();
+
#endif
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h
index e0daf59fcc2..43f6b51031a 100644
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -348,7 +348,7 @@ enum AuraType
SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
SPELL_AURA_DEFLECT_SPELLS = 287,
SPELL_AURA_IGNORE_HIT_DIRECTION = 288,
- SPELL_AURA_289 = 289,
+ SPELL_AURA_PREVENT_DURABILITY_LOSS = 289,
SPELL_AURA_MOD_CRIT_PCT = 290,
SPELL_AURA_MOD_XP_QUEST_PCT = 291,
SPELL_AURA_OPEN_STABLE = 292,
@@ -367,7 +367,7 @@ enum AuraType
SPELL_AURA_MOD_MINIMUM_SPEED = 305,
SPELL_AURA_306 = 306,
SPELL_AURA_HEAL_ABSORB_TEST = 307,
- SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308, // NYI
+ SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308,
SPELL_AURA_309 = 309,
SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310,
SPELL_AURA_311 = 311,
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 1cab186b95e..94fe6778ba1 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -346,7 +346,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNoImmediateEffect, //286 SPELL_AURA_ABILITY_PERIODIC_CRIT implemented in AuraEffect::PeriodicTick
&AuraEffect::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult
&AuraEffect::HandleNoImmediateEffect, //288 SPELL_AURA_IGNORE_HIT_DIRECTION implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult Unit::RollMeleeOutcomeAgainst
- &AuraEffect::HandleNULL, //289 unused (3.2.0)
+ &AuraEffect::HandleNoImmediateEffect, //289 SPELL_AURA_PREVENT_DURABILITY_LOSS implemented in Player::DurabilityPointsLoss
&AuraEffect::HandleAuraModCritPct, //290 SPELL_AURA_MOD_CRIT_PCT
&AuraEffect::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest
&AuraEffect::HandleAuraOpenStable, //292 SPELL_AURA_OPEN_STABLE
@@ -365,7 +365,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleAuraModIncreaseSpeed, //305 SPELL_AURA_MOD_MINIMUM_SPEED
&AuraEffect::HandleUnused, //306 0 spells in 3.3.5
&AuraEffect::HandleUnused, //307 0 spells in 3.3.5
- &AuraEffect::HandleNULL, //308 new aura for hunter traps
+ &AuraEffect::HandleNoImmediateEffect, //308 SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER implemented in Unit::GetUnitCriticalChance and Unit::GetUnitSpellCriticalChance
&AuraEffect::HandleUnused, //309 0 spells in 3.3.5
&AuraEffect::HandleNoImmediateEffect, //310 SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE implemented in Spell::CalculateDamageDone
&AuraEffect::HandleNULL, //311 0 spells in 3.3.5
@@ -846,16 +846,6 @@ void AuraEffect::UpdatePeriodic(Unit* caster)
case 59911: // Tenacity (vehicle)
GetBase()->RefreshDuration();
break;
- case 66823: case 67618: case 67619: case 67620: // Paralytic Toxin
- // Get 0 effect aura
- if (AuraEffect* slow = GetBase()->GetEffect(0))
- {
- int32 newAmount = slow->GetAmount() - 10;
- if (newAmount < -100)
- newAmount = -100;
- slow->ChangeAmount(newAmount);
- }
- break;
default:
break;
}
@@ -1325,7 +1315,7 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode
{
// apply glow vision
if (target->GetTypeId() == TYPEID_PLAYER)
- target->SetByteFlag(PLAYER_FIELD_BYTES2, 3, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
+ target->SetByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
target->m_invisibility.AddFlag(type);
target->m_invisibility.AddValue(type, GetAmount());
@@ -1337,7 +1327,7 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode
// if not have different invisibility auras.
// remove glow vision
if (target->GetTypeId() == TYPEID_PLAYER)
- target->RemoveByteFlag(PLAYER_FIELD_BYTES2, 3, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
+ target->RemoveByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
target->m_invisibility.DelFlag(type);
}
@@ -1409,7 +1399,7 @@ void AuraEffect::HandleModStealth(AuraApplication const* aurApp, uint8 mode, boo
target->SetStandFlags(UNIT_STAND_FLAGS_CREEP);
if (target->GetTypeId() == TYPEID_PLAYER)
- target->SetByteFlag(PLAYER_FIELD_BYTES2, 3, PLAYER_FIELD_BYTE2_STEALTH);
+ target->SetByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_STEALTH);
}
else
{
@@ -1421,7 +1411,7 @@ void AuraEffect::HandleModStealth(AuraApplication const* aurApp, uint8 mode, boo
target->RemoveStandFlags(UNIT_STAND_FLAGS_CREEP);
if (target->GetTypeId() == TYPEID_PLAYER)
- target->RemoveByteFlag(PLAYER_FIELD_BYTES2, 3, PLAYER_FIELD_BYTE2_STEALTH);
+ target->RemoveByteFlag(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, PLAYER_FIELD_BYTE2_STEALTH);
}
}
@@ -2400,7 +2390,7 @@ void AuraEffect::HandleAuraTrackStealthed(AuraApplication const* aurApp, uint8 m
if (target->HasAuraType(GetAuraType()))
return;
}
- target->ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_TRACK_STEALTHED, apply);
+ target->ApplyModByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_FLAGS, PLAYER_FIELD_BYTE_TRACK_STEALTHED, apply);
}
void AuraEffect::HandleAuraModStalked(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -2545,10 +2535,9 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode
return;
}
- target->SetCanFly(apply);
-
- if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating())
- target->GetMotionMaster()->MoveFall();
+ if (target->SetCanFly(apply))
+ if (!apply && !target->IsLevitating())
+ target->GetMotionMaster()->MoveFall();
}
void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -2915,7 +2904,7 @@ void AuraEffect::HandleAuraModIncreaseSpeed(AuraApplication const* aurApp, uint8
Unit* target = aurApp->GetTarget();
- target->UpdateSpeed(MOVE_RUN, true);
+ target->UpdateSpeed(MOVE_RUN);
}
void AuraEffect::HandleAuraModIncreaseMountedSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -2930,7 +2919,7 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,
Unit* target = aurApp->GetTarget();
if (mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK)
- target->UpdateSpeed(MOVE_FLIGHT, true);
+ target->UpdateSpeed(MOVE_FLIGHT);
//! Update ability to fly
if (GetAuraType() == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)
@@ -2938,10 +2927,9 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY))))
{
- target->SetCanFly(apply);
-
- if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating())
- target->GetMotionMaster()->MoveFall();
+ if (target->SetCanFly(apply))
+ if (!apply && !target->IsLevitating())
+ target->GetMotionMaster()->MoveFall();
}
//! Someone should clean up these hacks and remove it from this function. It doesn't even belong here.
@@ -2965,7 +2953,7 @@ void AuraEffect::HandleAuraModIncreaseSwimSpeed(AuraApplication const* aurApp, u
Unit* target = aurApp->GetTarget();
- target->UpdateSpeed(MOVE_SWIM, true);
+ target->UpdateSpeed(MOVE_SWIM);
}
void AuraEffect::HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
@@ -2975,12 +2963,12 @@ void AuraEffect::HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8
Unit* target = aurApp->GetTarget();
- target->UpdateSpeed(MOVE_RUN, true);
- target->UpdateSpeed(MOVE_SWIM, true);
- target->UpdateSpeed(MOVE_FLIGHT, true);
- target->UpdateSpeed(MOVE_RUN_BACK, true);
- target->UpdateSpeed(MOVE_SWIM_BACK, true);
- target->UpdateSpeed(MOVE_FLIGHT_BACK, true);
+ target->UpdateSpeed(MOVE_RUN);
+ target->UpdateSpeed(MOVE_SWIM);
+ target->UpdateSpeed(MOVE_FLIGHT);
+ target->UpdateSpeed(MOVE_RUN_BACK);
+ target->UpdateSpeed(MOVE_SWIM_BACK);
+ target->UpdateSpeed(MOVE_FLIGHT_BACK);
}
void AuraEffect::HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
@@ -2990,9 +2978,9 @@ void AuraEffect::HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint
Unit* target = aurApp->GetTarget();
- target->UpdateSpeed(MOVE_RUN, true);
- target->UpdateSpeed(MOVE_SWIM, true);
- target->UpdateSpeed(MOVE_FLIGHT, true);
+ target->UpdateSpeed(MOVE_RUN);
+ target->UpdateSpeed(MOVE_SWIM);
+ target->UpdateSpeed(MOVE_FLIGHT);
}
/*********************************************************/
@@ -3384,7 +3372,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint
&& !iter->second->IsPositive() //Don't remove positive spells
&& spell->Id != GetId()) //Don't remove self
{
- target->RemoveAura(iter, AURA_REMOVE_BY_ENEMY_SPELL);
+ target->RemoveAura(iter);
}
else
++iter;
@@ -4686,7 +4674,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
case 71563:
if (Aura* newAura = target->AddAura(71564, target))
newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
- break;
+ break;
}
}
// AT REMOVE
@@ -4808,7 +4796,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
uint32 spellId = 24659;
if (apply && caster)
{
- SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(spellId);
+ SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
for (uint32 i = 0; i < spell->StackAmount; ++i)
caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGUID());
@@ -4823,7 +4811,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
uint32 spellId = 24662;
if (apply && caster)
{
- SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(spellId);
+ SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
for (uint32 i = 0; i < spell->StackAmount; ++i)
caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGUID());
break;
@@ -5248,7 +5236,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m
if (apply)
{
- target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, overrideId);
+ target->SetUInt16Value(PLAYER_FIELD_BYTES2, PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET, overrideId);
if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
if (uint32 spellId = overrideSpells->spellId[i])
@@ -5256,7 +5244,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m
}
else
{
- target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, 0);
+ target->SetUInt16Value(PLAYER_FIELD_BYTES2, PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET, 0);
if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
if (uint32 spellId = overrideSpells->spellId[i])
@@ -5302,9 +5290,9 @@ void AuraEffect::HandlePreventResurrection(AuraApplication const* aurApp, uint8
return;
if (apply)
- aurApp->GetTarget()->RemoveByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
+ aurApp->GetTarget()->RemoveByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_FLAGS, PLAYER_FIELD_BYTE_RELEASE_TIMER);
else if (!aurApp->GetTarget()->GetBaseMap()->Instanceable())
- aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
+ aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_FLAGS, PLAYER_FIELD_BYTE_RELEASE_TIMER);
}
void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
@@ -5974,9 +5962,6 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, m_spellInfo);
- if (target->GetHealth() < damage)
- damage = uint32(target->GetHealth());
-
TC_LOG_DEBUG("spells.periodic", "PeriodicTick: %s health leech of %s for %u dmg inflicted by %u abs is %u",
GetCasterGUID().ToString().c_str(), target->GetGUID().ToString().c_str(), damage, GetId(), absorb);
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index b400520a08a..32a7b97fff2 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -27,7 +27,7 @@ class Aura;
typedef void(AuraEffect::*pAuraEffectHandler)(AuraApplication const* aurApp, uint8 mode, bool apply) const;
-class AuraEffect
+class TC_GAME_API AuraEffect
{
friend void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount);
friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount, Item* castItem, ObjectGuid casterGUID);
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 1ca5df6b327..35606989240 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -337,7 +337,8 @@ m_spellInfo(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID(
m_castItemGuid(castItem ? castItem->GetGUID() : ObjectGuid::Empty), m_applyTime(time(NULL)),
m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0),
m_casterLevel(caster ? caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1),
-m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false), m_dropEvent(nullptr)
+m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false), m_dropEvent(nullptr),
+m_procCooldown(std::chrono::steady_clock::time_point::min())
{
if (m_spellInfo->ManaPerSecond || m_spellInfo->ManaPerSecondPerLevel)
m_timeCla = 1 * IN_MILLISECONDS;
@@ -469,7 +470,7 @@ void Aura::_Remove(AuraRemoveMode removeMode)
if (m_dropEvent)
{
- m_dropEvent->to_Abort = true;
+ m_dropEvent->ScheduleAbort();
m_dropEvent = nullptr;
}
}
@@ -789,7 +790,7 @@ uint8 Aura::CalcMaxCharges(Unit* caster) const
{
uint32 maxProcCharges = m_spellInfo->ProcCharges;
if (SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()))
- maxProcCharges = procEntry->charges;
+ maxProcCharges = procEntry->Charges;
if (caster)
if (Player* modOwner = caster->GetSpellModOwner())
@@ -1851,22 +1852,17 @@ bool Aura::CanStackWith(Aura const* existingAura) const
return true;
}
-bool Aura::IsProcOnCooldown() const
+bool Aura::IsProcOnCooldown(std::chrono::steady_clock::time_point now) const
{
- /*if (m_procCooldown)
- {
- if (m_procCooldown > time(NULL))
- return true;
- }*/
- return false;
+ return m_procCooldown > now;
}
-void Aura::AddProcCooldown(uint32 /*msec*/)
+void Aura::AddProcCooldown(std::chrono::steady_clock::time_point cooldownEnd)
{
- //m_procCooldown = time(NULL) + msec;
+ m_procCooldown = cooldownEnd;
}
-void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo)
+void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now)
{
bool prepare = CallScriptPrepareProcHandlers(aurApp, eventInfo);
if (!prepare)
@@ -1884,10 +1880,10 @@ void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInf
ASSERT(procEntry);
// cooldowns should be added to the whole aura (see 51698 area aura)
- AddProcCooldown(procEntry->cooldown);
+ AddProcCooldown(now + procEntry->Cooldown);
}
-bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) const
+bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const
{
SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId());
// only auras with spell proc entry can trigger proc
@@ -1899,7 +1895,7 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
return false;
// check proc cooldown
- if (IsProcOnCooldown())
+ if (IsProcOnCooldown(now))
return false;
/// @todo
@@ -1963,16 +1959,16 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const
{
- float chance = procEntry.chance;
+ float chance = procEntry.Chance;
// calculate chances depending on unit with caster's data
// so talents modifying chances and judgements will have properly calculated proc chance
if (Unit* caster = GetCaster())
{
// calculate ppm chance if present and we're using weapon
- if (eventInfo.GetDamageInfo() && procEntry.ratePerMinute != 0)
+ if (eventInfo.GetDamageInfo() && procEntry.ProcsPerMinute != 0)
{
uint32 WeaponSpeed = caster->GetAttackTime(eventInfo.GetDamageInfo()->GetAttackType());
- chance = caster->GetPPMProcChance(WeaponSpeed, procEntry.ratePerMinute, GetSpellInfo());
+ chance = caster->GetPPMProcChance(WeaponSpeed, procEntry.ProcsPerMinute, GetSpellInfo());
}
// apply chance modifer aura, applies also to ppm chance (see improved judgement of light spell)
if (Player* modOwner = caster->GetSpellModOwner())
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index 2180f524194..a147957f258 100644
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -39,7 +39,7 @@ class ChargeDropEvent;
// update aura target map every 500 ms instead of every update - reduce amount of grid searcher calls
#define UPDATE_TARGET_MAP_INTERVAL 500
-class AuraApplication
+class TC_GAME_API AuraApplication
{
friend void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask);
friend void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode);
@@ -82,7 +82,7 @@ class AuraApplication
void ClientUpdate(bool remove = false);
};
-class Aura
+class TC_GAME_API Aura
{
friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID);
public:
@@ -203,12 +203,12 @@ class Aura
// this subsystem is not yet in use - the core of it is functional, but still some research has to be done
// and some dependant problems fixed before it can replace old proc system (for example cooldown handling)
// currently proc system functionality is implemented in Unit::ProcDamageAndSpell
- bool IsProcOnCooldown() const;
- void AddProcCooldown(uint32 msec);
+ bool IsProcOnCooldown(std::chrono::steady_clock::time_point now) const;
+ void AddProcCooldown(std::chrono::steady_clock::time_point cooldownEnd);
bool IsUsingCharges() const { return m_isUsingCharges; }
void SetUsingCharges(bool val) { m_isUsingCharges = val; }
- void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo);
- bool IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) const;
+ void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now);
+ bool IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const;
float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const;
void TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo);
@@ -269,11 +269,13 @@ class Aura
ChargeDropEvent* m_dropEvent;
+ std::chrono::steady_clock::time_point m_procCooldown;
+
private:
Unit::AuraApplicationList m_removedApplications;
};
-class UnitAura : public Aura
+class TC_GAME_API UnitAura : public Aura
{
friend Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID);
protected:
@@ -294,7 +296,7 @@ class UnitAura : public Aura
DiminishingGroup m_AuraDRGroup:8; // Diminishing
};
-class DynObjAura : public Aura
+class TC_GAME_API DynObjAura : public Aura
{
friend Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID);
protected:
@@ -305,12 +307,12 @@ class DynObjAura : public Aura
void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) override;
};
-class ChargeDropEvent : public BasicEvent
+class TC_GAME_API ChargeDropEvent : public BasicEvent
{
friend class Aura;
protected:
ChargeDropEvent(Aura* base, AuraRemoveMode mode) : _base(base), _mode(mode) { }
- bool Execute(uint64 /*e_time*/, uint32 /*p_time*/);
+ bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override;
private:
Aura* _base;
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 23e2f144ff2..5e58a602a43 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -602,7 +602,7 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
//Auto Shot & Shoot (wand)
m_autoRepeat = m_spellInfo->IsAutoRepeatRangedSpell();
-
+
m_isDelayedInstantCast = false;
m_runesState = 0;
@@ -979,14 +979,22 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa
{
CallScriptObjectTargetSelectHandlers(target, effIndex, targetType);
if (target)
- m_targets.SetDst(*target);
+ {
+ SpellDestination dest(*target);
+ CallScriptDestinationTargetSelectHandlers(dest, effIndex, targetType);
+ m_targets.SetDst(dest);
+ }
}
else
TC_LOG_DEBUG("spells", "SPELL: cannot find channel spell destination for spell ID %u, effect %u", m_spellInfo->Id, effIndex);
break;
case TARGET_DEST_CHANNEL_CASTER:
- m_targets.SetDst(*channeledSpell->GetCaster());
+ {
+ SpellDestination dest(*channeledSpell->GetCaster());
+ CallScriptDestinationTargetSelectHandlers(dest, effIndex, targetType);
+ m_targets.SetDst(dest);
break;
+ }
default:
ASSERT(false && "Spell::SelectImplicitChannelTargets: received not implemented target type");
break;
@@ -1042,7 +1050,11 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
if (m_spellInfo->RequiresSpellFocus)
{
if (focusObject)
- m_targets.SetDst(*focusObject);
+ {
+ SpellDestination dest(*focusObject);
+ CallScriptDestinationTargetSelectHandlers(dest, effIndex, targetType);
+ m_targets.SetDst(dest);
+ }
return;
}
break;
@@ -1068,7 +1080,6 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
switch (targetType.GetObjectType())
{
case TARGET_OBJECT_TYPE_UNIT:
- {
if (Unit* unit = target->ToUnit())
AddUnitTarget(unit, effMask, true, false);
else
@@ -1077,7 +1088,6 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
return;
}
break;
- }
case TARGET_OBJECT_TYPE_GOBJ:
if (GameObject* gobjTarget = target->ToGameObject())
AddGOTarget(gobjTarget, effMask);
@@ -1088,8 +1098,12 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar
}
break;
case TARGET_OBJECT_TYPE_DEST:
- m_targets.SetDst(*target);
+ {
+ SpellDestination dest(*target);
+ CallScriptDestinationTargetSelectHandlers(dest, effIndex, targetType);
+ m_targets.SetDst(dest);
break;
+ }
default:
ASSERT(false && "Spell::SelectImplicitNearbyTargets: received not implemented target object type");
break;
@@ -1288,18 +1302,30 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
}
default:
{
- float dist;
+ float dist = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
float angle = targetType.CalcDirectionAngle();
float objSize = m_caster->GetObjectSize();
- if (targetType.GetTarget() == TARGET_DEST_CASTER_SUMMON)
- dist = PET_FOLLOW_DIST;
- else
- dist = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
if (dist < objSize)
dist = objSize;
- else if (targetType.GetTarget() == TARGET_DEST_CASTER_RANDOM)
- dist = objSize + (dist - objSize) * float(rand_norm());
+
+ switch (targetType.GetTarget())
+ {
+ case TARGET_DEST_CASTER_SUMMON:
+ dist = PET_FOLLOW_DIST;
+ break;
+ case TARGET_DEST_CASTER_RANDOM:
+ dist = objSize + (dist - objSize) * float(rand_norm());
+ break;
+ case TARGET_DEST_CASTER_FRONT_LEFT:
+ case TARGET_DEST_CASTER_BACK_LEFT:
+ case TARGET_DEST_CASTER_FRONT_RIGHT:
+ case TARGET_DEST_CASTER_BACK_RIGHT:
+ dist = dist + objSize;
+ break;
+ default:
+ break;
+ }
Position pos = dest._position;
m_caster->MovePositionToFirstCollision(pos, dist, angle);
@@ -1538,7 +1564,7 @@ void Spell::SelectImplicitTrajTargets(SpellEffIndex effIndex)
if (Creature* creatureTarget = unit->ToCreature())
{
- if (!(creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PROJECTILE_COLLISION))
+ if (!(creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_CAN_COLLIDE_WITH_MISSILES))
continue;
}
}
@@ -2294,8 +2320,14 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
}
}
+ bool enablePvP = false; // need to check PvP state before spell effects, but act on it afterwards
+
if (spellHitTarget)
{
+ // if target is flagged for pvp also flag caster if a player
+ if (unit->IsPvP() && m_caster->GetTypeId() == TYPEID_PLAYER)
+ enablePvP = true; // Decide on PvP flagging now, but act on it later.
+
SpellMissInfo missInfo2 = DoSpellHitOnUnit(spellHitTarget, mask, target->scaleAura);
if (missInfo2 != SPELL_MISS_NONE)
{
@@ -2435,6 +2467,10 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
unit->SetStandState(UNIT_STAND_STATE_STAND);
}
+ // Check for SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER
+ if (m_spellInfo->HasAttribute(SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER) && unit->GetTypeId() != TYPEID_PLAYER)
+ caster->CastSpell(unit, SPELL_INTERRUPT_NONPLAYER, true);
+
if (spellHitTarget)
{
//AI functions
@@ -2448,8 +2484,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
// Needs to be called after dealing damage/healing to not remove breaking on damage auras
DoTriggersOnSpellHit(spellHitTarget, mask);
- // if target is fallged for pvp also flag caster if a player
- if (unit->IsPvP() && m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (enablePvP)
m_caster->ToPlayer()->UpdatePvP(true);
CallScriptAfterHitHandlers();
@@ -2884,7 +2919,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
if (m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->ToPlayer()->SetSpellModTakingSpell(this, true);
- // Fill cost data (not use power for item casts
+ // Fill cost data (do not use power for item casts)
m_powerCost = m_CastItem ? 0 : m_spellInfo->CalcPowerCost(m_caster, m_spellSchoolMask);
if (m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
@@ -2960,12 +2995,17 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
}
// don't allow channeled spells / spells with cast time to be cast while moving
+ // exception are only channeled spells that have no casttime and SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING
// (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in)
- if ((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT)
+ if ((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && !(m_caster->IsCharmed() && m_caster->GetCharmerGUID().IsCreature()) && m_caster->isMoving() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT))
{
- SendCastResult(SPELL_FAILED_MOVING);
- finish(false);
- return;
+ // 1. Is a channel spell, 2. Has no casttime, 3. And has flag to allow movement during channel
+ if (!(m_spellInfo->IsChanneled() && !m_casttime && m_spellInfo->HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING)))
+ {
+ SendCastResult(SPELL_FAILED_MOVING);
+ finish(false);
+ return;
+ }
}
// set timer base at cast time
@@ -3193,6 +3233,10 @@ void Spell::cast(bool skipCheck)
return;
}
+ if (m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET))
+ if (Creature* pet = ObjectAccessor::GetCreature(*m_caster, m_caster->GetPetGUID()))
+ pet->DespawnOrUnsummon();
+
PrepareTriggersExecutedOnHit();
CallScriptOnCastHandlers();
@@ -3502,12 +3546,18 @@ void Spell::update(uint32 difftime)
// check if the player caster has moved before the spell finished
if ((m_caster->GetTypeId() == TYPEID_PLAYER && m_timer != 0) &&
- m_caster->isMoving() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) &&
- (m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR)))
+ m_caster->isMoving() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT &&
+ (m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR))))
{
// don't cancel for melee, autorepeat, triggered and instant spells
- if (!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !IsTriggered())
- cancel();
+ if (!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !IsTriggered() && !(IsChannelActive() && m_spellInfo->HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING)))
+ {
+ // if charmed by creature, trust the AI not to cheat and allow the cast to proceed
+ // @todo this is a hack, "creature" movesplines don't differentiate turning/moving right now
+ // however, checking what type of movement the spline is for every single spline would be really expensive
+ if (!m_caster->GetCharmerGUID().IsCreature())
+ cancel();
+ }
}
switch (m_spellState)
@@ -3773,6 +3823,9 @@ void Spell::SendCastResult(SpellCastResult result)
if (m_caster->ToPlayer()->GetSession()->PlayerLoading()) // don't send cast results at loading time
return;
+ if (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR)
+ result = SPELL_FAILED_DONT_REPORT;
+
SendCastResult(m_caster->ToPlayer(), m_spellInfo, m_cast_count, result, m_customError);
}
@@ -3789,6 +3842,9 @@ void Spell::SendPetCastResult(SpellCastResult result)
if (!player)
return;
+ if (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR)
+ result = SPELL_FAILED_DONT_REPORT;
+
WorldPacket data(SMSG_PET_CAST_FAILED, 1 + 4 + 1);
WriteCastResultInfo(data, player, m_spellInfo, m_cast_count, result, m_customError);
@@ -3808,10 +3864,10 @@ void Spell::SendSpellStart()
if (schoolImmunityMask || mechanicImmunityMask)
castFlags |= CAST_FLAG_IMMUNITY;
- if ((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell)
+ if (((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell) && !m_cast_count)
castFlags |= CAST_FLAG_PENDING;
- if (m_spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO))
+ if (m_spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO) || m_spellInfo->HasAttribute(SPELL_ATTR0_CU_NEEDS_AMMO_DATA))
castFlags |= CAST_FLAG_AMMO;
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->IsPet()))
@@ -3861,10 +3917,10 @@ void Spell::SendSpellGo()
uint32 castFlags = CAST_FLAG_UNKNOWN_9;
// triggered spells with spell visual != 0
- if ((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell)
+ if (((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell) && !m_cast_count)
castFlags |= CAST_FLAG_PENDING;
- if (m_spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO))
+ if (m_spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO) || m_spellInfo->HasAttribute(SPELL_ATTR0_CU_NEEDS_AMMO_DATA))
castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
@@ -4803,7 +4859,7 @@ SpellCastResult Spell::CheckCast(bool strict)
// cancel autorepeat spells if cast start when moving
// (not wand currently autorepeat cast delayed to moving stop anyway in spell update code)
- if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->isMoving())
+ if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->isMoving() && (!m_caster->IsCharmed() || !m_caster->GetCharmerGUID().IsCreature()))
{
// skip stuck spell to allow use it in falling case and apply spell limitations at movement
if ((!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR) || m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK) &&
@@ -4831,6 +4887,7 @@ SpellCastResult Spell::CheckCast(bool strict)
m_customError = SpellCustomErrors(condInfo.mLastFailedCondition->ErrorTextId);
return SpellCastResult(condInfo.mLastFailedCondition->ErrorType);
}
+
if (!condInfo.mLastFailedCondition || !condInfo.mLastFailedCondition->ConditionTarget)
return SPELL_FAILED_CASTER_AURASTATE;
return SPELL_FAILED_BAD_TARGETS;
@@ -5140,7 +5197,11 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_OUT_OF_RANGE;
else if (!result || m_preGeneratedPath.GetPathType() & (PATHFIND_NOPATH | PATHFIND_INCOMPLETE))
return SPELL_FAILED_NOPATH;
+ else if (m_preGeneratedPath.IsInvalidDestinationZ(target)) // Check position z, if not in a straight line
+ return SPELL_FAILED_NOPATH;
}
+ else if (m_preGeneratedPath.IsInvalidDestinationZ(target)) // Check position z, if in a straight line
+ return SPELL_FAILED_NOPATH;
m_preGeneratedPath.ReducePathLenghtByDist(objSize); // move back
}
@@ -5256,7 +5317,7 @@ SpellCastResult Spell::CheckCast(bool strict)
switch (SummonProperties->Category)
{
case SUMMON_CATEGORY_PET:
- if (m_caster->GetPetGUID())
+ if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET) && m_caster->GetPetGUID())
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
// intentional missing break, check both GetPetGUID() and GetCharmGUID for SUMMON_CATEGORY_PET
case SUMMON_CATEGORY_PUPPET:
@@ -5272,7 +5333,7 @@ SpellCastResult Spell::CheckCast(bool strict)
{
if (m_targets.GetUnitTarget()->GetTypeId() != TYPEID_PLAYER)
return SPELL_FAILED_BAD_TARGETS;
- if (m_targets.GetUnitTarget()->GetPetGUID())
+ if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET) && m_targets.GetUnitTarget()->GetPetGUID())
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
}
break;
@@ -5281,13 +5342,13 @@ SpellCastResult Spell::CheckCast(bool strict)
{
if (m_caster->GetPetGUID()) //let warlock do a replacement summon
{
- if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK)
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
if (strict) //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
if (Pet* pet = m_caster->ToPlayer()->GetPet())
pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID());
}
- else
+ else if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET))
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
}
@@ -5306,6 +5367,9 @@ SpellCastResult Spell::CheckCast(bool strict)
if (!target || m_caster->ToPlayer() == target || (!target->IsInSameRaidWith(m_caster->ToPlayer()) && m_spellInfo->Id != 48955)) // refer-a-friend spell
return SPELL_FAILED_BAD_TARGETS;
+ if (target->HasSummonPending())
+ return SPELL_FAILED_SUMMON_PENDING;
+
// check if our map is dungeon
MapEntry const* map = sMapStore.LookupEntry(m_caster->GetMapId());
if (map->IsDungeon())
@@ -5411,7 +5475,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_CHARM
|| m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_POSSESS)
{
- if (m_caster->GetPetGUID())
+ if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET) && m_caster->GetPetGUID())
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
if (m_caster->GetCharmGUID())
@@ -5441,7 +5505,7 @@ SpellCastResult Spell::CheckCast(bool strict)
}
case SPELL_AURA_MOUNTED:
{
- if (m_caster->IsInWater())
+ if (m_caster->IsInWater() && m_spellInfo->HasAura(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
return SPELL_FAILED_ONLY_ABOVEWATER;
// Ignore map check if spell have AreaId. AreaId already checked and this prevent special mount spells
@@ -5478,7 +5542,7 @@ SpellCastResult Spell::CheckCast(bool strict)
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(m_originalCaster->GetZoneId());
if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(m_originalCaster->GetAreaId()))
if (area->flags & AREA_FLAG_NO_FLY_ZONE || (Bf && !Bf->CanFlyIn()))
- return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_NOT_HERE;
+ return SPELL_FAILED_NOT_HERE;
}
break;
}
@@ -5557,7 +5621,14 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
m_targets.SetUnitTarget(target);
}
- // cooldown
+ // check power requirement
+ // this would be zero until ::prepare normally, we set it here (it gets reset in ::prepare)
+ m_powerCost = m_spellInfo->CalcPowerCost(m_caster, m_spellSchoolMask);
+ SpellCastResult failReason = CheckPower();
+ if (failReason != SPELL_CAST_OK)
+ return failReason;
+
+ // check cooldown
if (Creature* creatureCaster = m_caster->ToCreature())
if (!creatureCaster->GetSpellHistory()->IsReady(m_spellInfo))
return SPELL_FAILED_NOT_READY;
@@ -5700,42 +5771,58 @@ SpellCastResult Spell::CheckCasterAuras() const
bool Spell::CanAutoCast(Unit* target)
{
+ if (!target)
+ return (CheckPetCast(target) == SPELL_CAST_OK);
+
ObjectGuid targetguid = target->GetGUID();
- for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
+ // check if target already has the same or a more powerful aura
+ for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
- if (m_spellInfo->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA)
+ if (!GetSpellInfo()->Effects[i].IsAura())
+ continue;
+
+ AuraType const& auraType = AuraType(GetSpellInfo()->Effects[i].ApplyAuraName);
+ Unit::AuraEffectList const& auras = target->GetAuraEffectsByType(auraType);
+ for (Unit::AuraEffectList::const_iterator auraIt = auras.begin(); auraIt != auras.end(); ++auraIt)
{
- if (m_spellInfo->StackAmount <= 1)
+ if (GetSpellInfo()->Id == (*auraIt)->GetSpellInfo()->Id)
+ return false;
+
+ switch (sSpellMgr->CheckSpellGroupStackRules(GetSpellInfo(), (*auraIt)->GetSpellInfo()))
{
- if (target->HasAuraEffect(m_spellInfo->Id, j))
+ case SPELL_GROUP_STACK_RULE_EXCLUSIVE:
return false;
- }
- else
- {
- if (AuraEffect* aureff = target->GetAuraEffect(m_spellInfo->Id, j))
- if (aureff->GetBase()->GetStackAmount() >= m_spellInfo->StackAmount)
+ case SPELL_GROUP_STACK_RULE_EXCLUSIVE_FROM_SAME_CASTER:
+ if (GetCaster() == (*auraIt)->GetCaster())
return false;
+ break;
+ case SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT: // this one has further checks, but i don't think they're necessary for autocast logic
+ case SPELL_GROUP_STACK_RULE_EXCLUSIVE_HIGHEST:
+ if (abs(GetSpellInfo()->Effects[i].BasePoints) <= abs((*auraIt)->GetAmount()))
+ return false;
+ break;
+ case SPELL_GROUP_STACK_RULE_DEFAULT:
+ default:
+ break;
}
}
- else if (m_spellInfo->Effects[j].IsAreaAuraEffect())
- {
- if (target->HasAuraEffect(m_spellInfo->Id, j))
- return false;
- }
}
SpellCastResult result = CheckPetCast(target);
-
if (result == SPELL_CAST_OK || result == SPELL_FAILED_UNIT_NOT_INFRONT)
{
+ // do not check targets for ground-targeted spells (we target them on top of the intended target anyway)
+ if (GetSpellInfo()->ExplicitTargetMask & TARGET_FLAG_DEST_LOCATION)
+ return true;
SelectSpellTargets();
//check if among target units, our WANTED target is as well (->only self cast spells return false)
- for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
+ for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
if (ihit->targetGUID == targetguid)
return true;
}
- return false; //target invalid
+ // either the cast failed or the intended target wouldn't be hit
+ return false;
}
SpellCastResult Spell::CheckRange(bool strict)
@@ -5744,55 +5831,88 @@ SpellCastResult Spell::CheckRange(bool strict)
if (!strict && m_casttime == 0)
return SPELL_CAST_OK;
- uint32 range_type = 0;
+ Unit* target = m_targets.GetUnitTarget();
+ float minRange = 0.0f;
+ float maxRange = 0.0f;
+ float rangeMod = 0.0f;
+ if (strict && IsNextMeleeSwingSpell())
+ maxRange = 100.0f;
+ else if (m_spellInfo->RangeEntry)
+ {
+ if (m_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE)
+ {
+ rangeMod = m_caster->GetCombatReach() + 4.0f / 3.0f;
+ if (target)
+ rangeMod += target->GetCombatReach();
+ else
+ rangeMod += m_caster->GetCombatReach();
- if (m_spellInfo->RangeEntry)
- {
- // check needed by 68766 51693 - both spells are cast on enemies and have 0 max range
- // these are triggered by other spells - possibly we should omit range check in that case?
- if (m_spellInfo->RangeEntry->ID == 1)
- return SPELL_CAST_OK;
+ rangeMod = std::max(rangeMod, NOMINAL_MELEE_RANGE);
+ }
+ else
+ {
+ float meleeRange = 0.0f;
+ if (m_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED)
+ {
+ meleeRange = m_caster->GetCombatReach() + 4.0f / 3.0f;
+ if (target)
+ meleeRange += target->GetCombatReach();
+ else
+ meleeRange += m_caster->GetCombatReach();
+
+ meleeRange = std::max(meleeRange, NOMINAL_MELEE_RANGE);
+ }
- range_type = m_spellInfo->RangeEntry->type;
+ minRange = m_caster->GetSpellMinRangeForTarget(target, m_spellInfo) + meleeRange;
+ maxRange = m_caster->GetSpellMaxRangeForTarget(target, m_spellInfo);
+
+ if (target || m_targets.GetCorpseTarget())
+ {
+ rangeMod = m_caster->GetCombatReach();
+ if (target)
+ rangeMod += target->GetCombatReach();
+
+ if (minRange > 0.0f && !(m_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED))
+ minRange += rangeMod;
+ }
+ }
+
+ if (target && m_caster->isMoving() && target->isMoving() && !m_caster->IsWalking() && !target->IsWalking() &&
+ (m_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE || target->GetTypeId() == TYPEID_PLAYER))
+ rangeMod += 5.0f / 3.0f;
}
- Unit* target = m_targets.GetUnitTarget();
- float max_range = m_caster->GetSpellMaxRangeForTarget(target, m_spellInfo);
- float min_range = m_caster->GetSpellMinRangeForTarget(target, m_spellInfo);
+ if (m_spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO) && m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (Item* ranged = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK, true))
+ maxRange *= ranged->GetTemplate()->RangedModRange * 0.01f;
if (Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, max_range, this);
+ modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, maxRange, this);
+
+ maxRange += rangeMod;
+
+ minRange *= minRange;
+ maxRange *= maxRange;
if (target && target != m_caster)
{
- if (range_type == SPELL_RANGE_MELEE)
- {
- // Because of lag, we can not check too strictly here.
- if (!m_caster->IsWithinMeleeRange(target, max_range))
- return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_OUT_OF_RANGE : SPELL_FAILED_DONT_REPORT;
- }
- else if (!m_caster->IsWithinCombatRange(target, max_range))
- return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_OUT_OF_RANGE : SPELL_FAILED_DONT_REPORT; //0x5A;
+ if (m_caster->GetExactDistSq(target) > maxRange)
+ return SPELL_FAILED_OUT_OF_RANGE;
- if (range_type == SPELL_RANGE_RANGED)
- {
- if (m_caster->IsWithinMeleeRange(target))
- return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_TOO_CLOSE : SPELL_FAILED_DONT_REPORT;
- }
- else if (min_range && m_caster->IsWithinCombatRange(target, min_range)) // skip this check if min_range = 0
- return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_TOO_CLOSE : SPELL_FAILED_DONT_REPORT;
+ if (minRange > 0.0f && m_caster->GetExactDistSq(target) < minRange)
+ return SPELL_FAILED_OUT_OF_RANGE;
if (m_caster->GetTypeId() == TYPEID_PLAYER &&
(m_spellInfo->FacingCasterFlags & SPELL_FACING_FLAG_INFRONT) && !m_caster->HasInArc(static_cast<float>(M_PI), target))
- return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_UNIT_NOT_INFRONT : SPELL_FAILED_DONT_REPORT;
+ return SPELL_FAILED_UNIT_NOT_INFRONT;
}
if (m_targets.HasDst() && !m_targets.HasTraj())
{
- if (!m_caster->IsWithinDist3d(m_targets.GetDstPos(), max_range))
- return SPELL_FAILED_OUT_OF_RANGE;
- if (min_range && m_caster->IsWithinDist3d(m_targets.GetDstPos(), min_range))
- return SPELL_FAILED_TOO_CLOSE;
+ if (m_caster->GetExactDistSq(m_targets.GetDstPos()) > maxRange)
+ return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_OUT_OF_RANGE : SPELL_FAILED_DONT_REPORT;
+ if (minRange > 0.0f && m_caster->GetExactDistSq(m_targets.GetDstPos()) < minRange)
+ return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_OUT_OF_RANGE : SPELL_FAILED_DONT_REPORT;
}
return SPELL_CAST_OK;
@@ -6317,11 +6437,11 @@ SpellCastResult Spell::CheckItems()
// skip spell if no weapon in slot or broken
if (!item || item->IsBroken())
- return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS;
+ return SPELL_FAILED_EQUIPPED_ITEM_CLASS;
// skip spell if weapon not fit to triggered spell
if (!item->IsFitToSpellRequirements(m_spellInfo))
- return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS;
+ return SPELL_FAILED_EQUIPPED_ITEM_CLASS;
}
// offhand hand weapon required
@@ -6331,11 +6451,11 @@ SpellCastResult Spell::CheckItems()
// skip spell if no weapon in slot or broken
if (!item || item->IsBroken())
- return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS;
+ return SPELL_FAILED_EQUIPPED_ITEM_CLASS;
// skip spell if weapon not fit to triggered spell
if (!item->IsFitToSpellRequirements(m_spellInfo))
- return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS;
+ return SPELL_FAILED_EQUIPPED_ITEM_CLASS;
}
}
@@ -6882,7 +7002,7 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk
reqSkillValue = lockInfo->Skill[j];
// castitem check: rogue using skeleton keys. the skill values should not be added in this case.
- skillValue = m_CastItem || m_caster->GetTypeId()!= TYPEID_PLAYER ?
+ skillValue = m_CastItem || m_caster->GetTypeId() != TYPEID_PLAYER ?
0 : m_caster->ToPlayer()->GetSkillValue(skillId);
// skill bonus provided by casting spell (mostly item spells)
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 696d2801645..46384fc54ec 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -80,7 +80,7 @@ enum SpellRangeFlag
SPELL_RANGE_RANGED = 2 //hunter range and ranged weapon
};
-struct SpellDestination
+struct TC_GAME_API SpellDestination
{
SpellDestination();
SpellDestination(float x, float y, float z, float orientation = 0.0f, uint32 mapId = MAPID_INVALID);
@@ -95,7 +95,7 @@ struct SpellDestination
Position _transportOffset;
};
-class SpellCastTargets
+class TC_GAME_API SpellCastTargets
{
public:
SpellCastTargets();
@@ -218,7 +218,9 @@ enum SpellEffectHandleMode
typedef std::list<std::pair<uint32, ObjectGuid>> DispelList;
-class Spell
+static const uint32 SPELL_INTERRUPT_NONPLAYER = 32747;
+
+class TC_GAME_API Spell
{
friend void Unit::SetCurrentCastSpell(Spell* pSpell);
friend class SpellScript;
@@ -694,21 +696,13 @@ class Spell
ByteBuffer * m_effectExecuteData[MAX_SPELL_EFFECTS];
-#ifdef MAP_BASED_RAND_GEN
- int32 irand(int32 min, int32 max) { return int32 (m_caster->GetMap()->mtRand.randInt(max - min)) + min; }
- uint32 urand(uint32 min, uint32 max) { return m_caster->GetMap()->mtRand.randInt(max - min) + min; }
- int32 rand32() { return m_caster->GetMap()->mtRand.randInt(); }
- double rand_norm() { return m_caster->GetMap()->mtRand.randExc(); }
- double rand_chance() { return m_caster->GetMap()->mtRand.randExc(100.0); }
-#endif
-
Spell(Spell const& right) = delete;
Spell& operator=(Spell const& right) = delete;
};
namespace Trinity
{
- struct WorldObjectSpellTargetCheck
+ struct TC_GAME_API WorldObjectSpellTargetCheck
{
Unit* _caster;
Unit* _referer;
@@ -723,7 +717,7 @@ namespace Trinity
bool operator()(WorldObject* target);
};
- struct WorldObjectSpellNearbyTargetCheck : public WorldObjectSpellTargetCheck
+ struct TC_GAME_API WorldObjectSpellNearbyTargetCheck : public WorldObjectSpellTargetCheck
{
float _range;
Position const* _position;
@@ -732,7 +726,7 @@ namespace Trinity
bool operator()(WorldObject* target);
};
- struct WorldObjectSpellAreaTargetCheck : public WorldObjectSpellTargetCheck
+ struct TC_GAME_API WorldObjectSpellAreaTargetCheck : public WorldObjectSpellTargetCheck
{
float _range;
Position const* _position;
@@ -741,7 +735,7 @@ namespace Trinity
bool operator()(WorldObject* target);
};
- struct WorldObjectSpellConeTargetCheck : public WorldObjectSpellAreaTargetCheck
+ struct TC_GAME_API WorldObjectSpellConeTargetCheck : public WorldObjectSpellAreaTargetCheck
{
float _coneAngle;
WorldObjectSpellConeTargetCheck(float coneAngle, float range, Unit* caster,
@@ -749,7 +743,7 @@ namespace Trinity
bool operator()(WorldObject* target);
};
- struct WorldObjectSpellTrajTargetCheck : public WorldObjectSpellAreaTargetCheck
+ struct TC_GAME_API WorldObjectSpellTrajTargetCheck : public WorldObjectSpellAreaTargetCheck
{
WorldObjectSpellTrajTargetCheck(float range, Position const* position, Unit* caster, SpellInfo const* spellInfo);
bool operator()(WorldObject* target);
@@ -758,7 +752,7 @@ namespace Trinity
typedef void(Spell::*pEffect)(SpellEffIndex effIndex);
-class SpellEvent : public BasicEvent
+class TC_GAME_API SpellEvent : public BasicEvent
{
public:
SpellEvent(Spell* spell);
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 9535ca291eb..b0e3b6deeee 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -217,7 +217,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectCreateItem2, //157 SPELL_EFFECT_CREATE_ITEM_2 create item or create item template and replace by some randon spell loot item
&Spell::EffectMilling, //158 SPELL_EFFECT_MILLING milling
&Spell::EffectRenamePet, //159 SPELL_EFFECT_ALLOW_RENAME_PET allow rename pet once again
- &Spell::EffectNULL, //160 SPELL_EFFECT_160 1 spell - 45534
+ &Spell::EffectForceCast, //160 SPELL_EFFECT_FORCE_CAST_2
&Spell::EffectSpecCount, //161 SPELL_EFFECT_TALENT_SPEC_COUNT second talent spec (learn/revert)
&Spell::EffectActivateSpec, //162 SPELL_EFFECT_TALENT_SPEC_SELECT activate primary/secondary spec
&Spell::EffectNULL, //163 unused
@@ -250,13 +250,13 @@ void Spell::EffectResurrectNew(SpellEffIndex effIndex)
Player* target = unitTarget->ToPlayer();
- if (target->isResurrectRequested()) // already have one active request
+ if (target->IsResurrectRequested()) // already have one active request
return;
uint32 health = damage;
uint32 mana = m_spellInfo->Effects[effIndex].MiscValue;
ExecuteLogEffectResurrect(effIndex, target);
- target->setResurrectRequestData(m_caster->GetGUID(), m_caster->GetMapId(), m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), health, mana);
+ target->SetResurrectRequestData(m_caster, health, mana, 0);
SendResurrectRequest(target);
}
@@ -556,7 +556,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
if (uint32 combo = player->GetComboPoints())
{
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
- damage += irand(int32(ap * combo * 0.03f), int32(ap * combo * 0.07f));
+ damage += std::lroundf(ap * combo * 0.07f);
// Eviscerate and Envenom Bonus Damage (item set effect)
if (m_caster->HasAura(37169))
@@ -596,17 +596,13 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
if (Player* caster = m_caster->ToPlayer())
{
// Add Ammo and Weapon damage plus RAP * 0.1
- if (Item* item = caster->GetWeaponForAttack(RANGED_ATTACK))
- {
- ItemTemplate const* weaponTemplate = item->GetTemplate();
- float dmg_min = weaponTemplate->Damage[0].DamageMin;
- float dmg_max = weaponTemplate->Damage[0].DamageMax;
- if (dmg_max == 0.0f && dmg_min > dmg_max)
- damage += int32(dmg_min);
- else
- damage += irand(int32(dmg_min), int32(dmg_max));
- damage += int32(caster->GetAmmoDPS() * weaponTemplate->Delay * 0.001f);
- }
+ float dmg_min = caster->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE);
+ float dmg_max = caster->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE);
+ if (dmg_max == 0.0f && dmg_min > dmg_max)
+ damage += int32(dmg_min);
+ else
+ damage += irand(int32(dmg_min), int32(dmg_max));
+ damage += int32(caster->GetAmmoDPS() * caster->GetAttackTime(RANGED_ATTACK) * 0.001f);
}
}
break;
@@ -893,7 +889,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id);
if (!spellInfo)
{
- TC_LOG_ERROR("spells", "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id);
+ TC_LOG_ERROR("spells", "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u.", m_spellInfo->Id, triggered_spell_id);
return;
}
@@ -944,7 +940,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex)
if (!spellInfo)
{
- TC_LOG_ERROR("spells", "Spell::EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
+ TC_LOG_ERROR("spells", "Spell::EffectForceCast of spell %u: triggering unknown spell id %i.", m_spellInfo->Id, triggered_spell_id);
return;
}
@@ -996,7 +992,7 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex effIndex)
if (!spellInfo)
{
- TC_LOG_ERROR("spells", "EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
+ TC_LOG_ERROR("spells", "EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i.", m_spellInfo->Id, triggered_spell_id);
return;
}
@@ -1062,7 +1058,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
// If not exist data for dest location - return
if (!m_targets.HasDst())
{
- TC_LOG_ERROR("spells", "Spell::EffectTeleportUnits - does not have destination for spellId %u.", m_spellInfo->Id);
+ TC_LOG_ERROR("spells", "Spell::EffectTeleportUnits - does not have a destination for spellId %u.", m_spellInfo->Id);
return;
}
@@ -1393,7 +1389,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
if (!targetAura)
{
- TC_LOG_ERROR("spells", "Target (%s) has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID().ToString().c_str());
+ TC_LOG_ERROR("spells", "Target (%s) has the aurastate AURA_STATE_SWIFTMEND, but no matching aura.", unitTarget->GetGUID().ToString().c_str());
return;
}
@@ -1683,6 +1679,8 @@ void Spell::EffectCreateItem2(SpellEffIndex effIndex)
}
else
player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell); // create some random items
+
+ player->UpdateCraftSkill(m_spellInfo->Id);
}
/// @todo ExecuteLogEffectCreateItem(i, m_spellInfo->Effects[i].ItemType);
}
@@ -1830,7 +1828,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs);
for (std::set<uint32>::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end();)
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(*itr);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(*itr);
if (spellInfo->SpellLevel < m_spellInfo->SpellLevel || spellInfo->SpellLevel > unitTarget->getLevel())
avalibleElixirs.erase(itr++);
else if (sSpellMgr->IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_SHATTRATH))
@@ -1886,7 +1884,7 @@ void Spell::SendLoot(ObjectGuid guid, LootType loottype)
// Players shouldn't be able to loot gameobjects that are currently despawned
if (!gameObjTarget->isSpawned() && !player->IsGameMaster())
{
- TC_LOG_ERROR("spells", "Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!",
+ TC_LOG_ERROR("spells", "Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn timer without being in GM mode!",
player->GetName().c_str(), player->GetGUID().GetCounter(), gameObjTarget->GetEntry(), gameObjTarget->GetGUID().GetCounter());
return;
}
@@ -2110,8 +2108,7 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
else if (player->IsBankPos(pos))
{
ItemPosCountVec dest;
- uint8 msg = player->CanBankItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), dest, pNewItem, true);
- if (msg == EQUIP_ERR_OK)
+ if (player->CanBankItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), dest, pNewItem, true) == EQUIP_ERR_OK)
{
player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true);
@@ -2133,7 +2130,7 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true);
- uint8 msg = player->CanEquipItem(m_CastItem->GetSlot(), dest, pNewItem, true);
+ InventoryResult msg = player->CanEquipItem(m_CastItem->GetSlot(), dest, pNewItem, true);
if (msg == EQUIP_ERR_OK || msg == EQUIP_ERR_CANT_DO_RIGHT_NOW)
{
@@ -2191,7 +2188,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(m_spellInfo->Effects[effIndex].MiscValueB);
if (!properties)
{
- TC_LOG_ERROR("spells", "EffectSummonType: Unhandled summon type %u", m_spellInfo->Effects[effIndex].MiscValueB);
+ TC_LOG_ERROR("spells", "EffectSummonType: Unhandled summon type %u.", m_spellInfo->Effects[effIndex].MiscValueB);
return;
}
@@ -2379,7 +2376,7 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex)
uint32 spellToLearn = (m_spellInfo->Id == 483 || m_spellInfo->Id == 55884) ? damage : m_spellInfo->Effects[effIndex].TriggerSpell;
player->LearnSpell(spellToLearn, false);
- TC_LOG_DEBUG("spells", "Spell: Player %u has learned spell %u from NpcGUID=%u", player->GetGUID().GetCounter(), spellToLearn, m_caster->GetGUID().GetCounter());
+ TC_LOG_DEBUG("spells", "Spell: Player %u has learned spell %u from NpcGUID: %u", player->GetGUID().GetCounter(), spellToLearn, m_caster->GetGUID().GetCounter());
}
void Spell::EffectDispel(SpellEffIndex effIndex)
@@ -2758,7 +2755,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
}
if (!add_socket)
{
- TC_LOG_ERROR("spells", "Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.",
+ TC_LOG_ERROR("spells", "Spell::EffectEnchantItemPrismatic: attempt to apply the enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u), but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not supported yet.",
m_spellInfo->Id, SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC, ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET);
return;
}
@@ -2823,7 +2820,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
case 10: spell_id = 36758; break; // 14%
case 11: spell_id = 36760; break; // 20%
default:
- TC_LOG_ERROR("spells", "Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW", damage);
+ TC_LOG_ERROR("spells", "Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW.", damage);
return;
}
@@ -2857,14 +2854,14 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
if (!enchant_id)
{
- TC_LOG_ERROR("spells", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have 0 as enchanting id", m_spellInfo->Id, effIndex);
+ TC_LOG_ERROR("spells", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) has enchanting id 0.", m_spellInfo->Id, effIndex);
return;
}
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
if (!pEnchant)
{
- TC_LOG_ERROR("spells", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ", m_spellInfo->Id, effIndex, enchant_id);
+ TC_LOG_ERROR("spells", "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) has a non-existing enchanting id %u ", m_spellInfo->Id, effIndex, enchant_id);
return;
}
@@ -3020,6 +3017,12 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
//OldSummon->Relocate(px, py, pz, OldSummon->GetOrientation());
//OldSummon->SetMap(owner->GetMap());
//owner->GetMap()->Add(OldSummon->ToCreature());
+ if (OldSummon->getPetType() == SUMMON_PET)
+ {
+ OldSummon->SetHealth(OldSummon->GetMaxHealth());
+ OldSummon->SetPower(OldSummon->getPowerType(),
+ OldSummon->GetMaxPower(OldSummon->getPowerType()));
+ }
if (owner->GetTypeId() == TYPEID_PLAYER && OldSummon->isControlled())
owner->ToPlayer()->PetSpellInitialize();
@@ -3506,7 +3509,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
Map* map = target->GetMap();
if (!pGameObj->Create(map->GenerateLowGuid<HighGuid::GameObject>(), gameobject_id, map,
- m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
+ m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
{
delete pGameObj;
return;
@@ -3531,7 +3534,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
{
GameObject* linkedGO = new GameObject;
if (linkedGO->Create(map->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, map,
- m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
+ m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
{
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
linkedGO->SetSpellId(m_spellInfo->Id);
@@ -3662,16 +3665,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
m_caster->CastSpell(unitTarget, 22682, true);
return;
}
- // Decimate
- case 28374:
- case 54426:
- if (unitTarget)
- {
- int32 decimateDamage = int32(unitTarget->GetHealth()) - int32(unitTarget->CountPctFromMaxHealth(5));
- if (decimateDamage > 0)
- m_caster->CastCustomSpell(28375, SPELLVALUE_BASE_POINT0, decimateDamage, unitTarget);
- }
- return;
// Mirren's Drinking Hat
case 29830:
{
@@ -3782,28 +3775,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
break;
}
- // Roll Dice - Decahedral Dwarven Dice
- case 47770:
- {
- char buf[128];
- const char *gender = "his";
- if (m_caster->getGender() > 0)
- gender = "her";
- sprintf(buf, "%s rubs %s [Decahedral Dwarven Dice] between %s hands and rolls. One %u and one %u.", m_caster->GetName().c_str(), gender, gender, urand(1, 10), urand(1, 10));
- m_caster->TextEmote(buf);
- break;
- }
- // Roll 'dem Bones - Worn Troll Dice
- case 47776:
- {
- char buf[128];
- const char *gender = "his";
- if (m_caster->getGender() > 0)
- gender = "her";
- sprintf(buf, "%s causually tosses %s [Worn Troll Dice]. One %u and one %u.", m_caster->GetName().c_str(), gender, urand(1, 6), urand(1, 6));
- m_caster->TextEmote(buf);
- break;
- }
// Death Knight Initiate Visual
case 51519:
{
@@ -3980,7 +3951,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 31893: spell_heal = 48084; break;
case 31883: spell_heal = 48085; break;
default:
- TC_LOG_ERROR("spells", "Unknown Lightwell spell caster %u", m_caster->GetEntry());
+ TC_LOG_ERROR("spells", "Unknown Lightwell spell caster %u.", m_caster->GetEntry());
return;
}
@@ -4152,13 +4123,16 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
uint32 gameobject_id = m_spellInfo->Effects[effIndex].MiscValue;
- Map* map = m_caster->GetMap();
- if (!pGameObj->Create(map->GenerateLowGuid<HighGuid::GameObject>(), gameobject_id,
- map, m_caster->GetPhaseMask(),
- m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2,
- m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2,
+ Position const pos =
+ {
+ m_caster->GetPositionX() + (unitTarget->GetPositionX() - m_caster->GetPositionX()) / 2,
+ m_caster->GetPositionY() + (unitTarget->GetPositionY() - m_caster->GetPositionY()) / 2,
m_caster->GetPositionZ(),
- m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
+ m_caster->GetOrientation()
+ };
+
+ Map* map = m_caster->GetMap();
+ if (!pGameObj->Create(map->GenerateLowGuid<HighGuid::GameObject>(), gameobject_id, map, m_caster->GetPhaseMask(), pos, G3D::Quat(), 0, GO_STATE_READY))
{
delete pGameObj;
return;
@@ -4219,7 +4193,7 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)
return;
TC_LOG_DEBUG("spells", "Spell Effect: Stuck");
- TC_LOG_DEBUG("spells", "Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", player->GetName().c_str(), player->GetGUID().GetCounter(), player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
+ TC_LOG_DEBUG("spells", "Player %s (guid %u) used the auto-unstuck feature at map %u (%f, %f, %f).", player->GetName().c_str(), player->GetGUID().GetCounter(), player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
if (player->IsInFlight())
return;
@@ -4245,20 +4219,7 @@ void Spell::EffectSummonPlayer(SpellEffIndex /*effIndex*/)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- // Evil Twin (ignore player summon, but hide this for summoner)
- if (unitTarget->HasAura(23445))
- return;
-
- float x, y, z;
- m_caster->GetPosition(x, y, z);
-
- unitTarget->ToPlayer()->SetSummonPoint(m_caster->GetMapId(), x, y, z);
-
- WorldPacket data(SMSG_SUMMON_REQUEST, 8+4+4);
- data << uint64(m_caster->GetGUID()); // summoner guid
- data << uint32(m_caster->GetZoneId()); // summoner zone
- data << uint32(MAX_PLAYER_SUMMON_DELAY*IN_MILLISECONDS); // auto decline after msecs
- unitTarget->ToPlayer()->GetSession()->SendPacket(&data);
+ unitTarget->ToPlayer()->SendSummonRequestFrom(m_caster);
}
void Spell::EffectActivateObject(SpellEffIndex /*effIndex*/)
@@ -4504,7 +4465,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
Map* map = m_caster->GetMap();
if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), go_id, map,
- m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
+ m_caster->GetPhaseMask(), Position(x, y, z, m_caster->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
{
delete go;
return;
@@ -4536,7 +4497,7 @@ void Spell::EffectResurrect(SpellEffIndex effIndex)
Player* target = unitTarget->ToPlayer();
- if (target->isResurrectRequested()) // already have one active request
+ if (target->IsResurrectRequested()) // already have one active request
return;
uint32 health = target->CountPctFromMaxHealth(damage);
@@ -4544,7 +4505,7 @@ void Spell::EffectResurrect(SpellEffIndex effIndex)
ExecuteLogEffectResurrect(effIndex, target);
- target->setResurrectRequestData(m_caster->GetGUID(), m_caster->GetMapId(), m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), health, mana);
+ target->SetResurrectRequestData(m_caster, health, mana, 0);
SendResurrectRequest(target);
}
@@ -5101,7 +5062,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
if (!goinfo)
{
- TC_LOG_ERROR("sql.sql", "Gameobject (Entry: %u) not exist and not created at spell (ID: %u) cast", name_id, m_spellInfo->Id);
+ TC_LOG_ERROR("sql.sql", "Gameobject (Entry: %u) does not exist and is not created by spell (ID: %u) cast.", name_id, m_spellInfo->Id);
return;
}
@@ -5133,7 +5094,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
GameObject* pGameObj = new GameObject;
if (!pGameObj->Create(cMap->GenerateLowGuid<HighGuid::GameObject>(), name_id, cMap,
- m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
+ m_caster->GetPhaseMask(), Position(fx, fy, fz, m_caster->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
{
delete pGameObj;
return;
@@ -5199,7 +5160,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
{
GameObject* linkedGO = new GameObject;
if (linkedGO->Create(cMap->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, cMap,
- m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
+ m_caster->GetPhaseMask(), Position(fx, fy, fz, m_caster->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
{
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
//linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
@@ -5521,7 +5482,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
for (uint32 l = 0; l + 1 < MAX_RUNES && count > 0; ++l)
{
// Check if both runes are on cd as that is the only time when this needs to come into effect
- if ((player->GetRuneCooldown(l) && player->GetCurrentRune(l) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) && (player->GetRuneCooldown(l+1) && player->GetCurrentRune(l+1) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)))
+ if ((player->GetRuneCooldown(l) && player->GetBaseRune(l) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) && (player->GetRuneCooldown(l+1) && player->GetBaseRune(l+1) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)))
{
// Should always update the rune with the lowest cd
if (l + 1 < MAX_RUNES && player->GetRuneCooldown(l) >= player->GetRuneCooldown(l+1))
@@ -5742,7 +5703,7 @@ void Spell::EffectPlayMusic(SpellEffIndex effIndex)
if (!sSoundEntriesStore.LookupEntry(soundid))
{
- TC_LOG_ERROR("spells", "EffectPlayMusic: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
+ TC_LOG_ERROR("spells", "EffectPlayMusic: Sound (Id: %u) does not exist in spell %u.", soundid, m_spellInfo->Id);
return;
}
@@ -5799,7 +5760,7 @@ void Spell::EffectPlaySound(SpellEffIndex effIndex)
if (!sSoundEntriesStore.LookupEntry(soundId))
{
- TC_LOG_ERROR("spells", "EffectPlaySound: Sound (Id: %u) not exist in spell %u.", soundId, m_spellInfo->Id);
+ TC_LOG_ERROR("spells", "EffectPlaySound: Sound (Id: %u) does not exist in spell %u.", soundId, m_spellInfo->Id);
return;
}
diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp
index adf5fc47c77..31490bea29b 100644
--- a/src/server/game/Spells/SpellHistory.cpp
+++ b/src/server/game/Spells/SpellHistory.cpp
@@ -373,7 +373,7 @@ void SpellHistory::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId /
player->SendDirectMessage(&data);
if (startCooldown)
- StartCooldown(sSpellMgr->EnsureSpellInfo(categoryItr->second->SpellId), itemId, spell);
+ StartCooldown(sSpellMgr->AssertSpellInfo(categoryItr->second->SpellId), itemId, spell);
}
WorldPacket data(SMSG_COOLDOWN_EVENT, 4 + 8);
@@ -483,7 +483,7 @@ bool SpellHistory::HasCooldown(SpellInfo const* spellInfo, uint32 itemId /*= 0*/
bool SpellHistory::HasCooldown(uint32 spellId, uint32 itemId /*= 0*/, bool ignoreCategoryCooldown /*= false*/) const
{
- return HasCooldown(sSpellMgr->EnsureSpellInfo(spellId), itemId, ignoreCategoryCooldown);
+ return HasCooldown(sSpellMgr->AssertSpellInfo(spellId), itemId, ignoreCategoryCooldown);
}
uint32 SpellHistory::GetRemainingCooldown(SpellInfo const* spellInfo) const
@@ -533,7 +533,7 @@ void SpellHistory::LockSpellSchool(SpellSchoolMask schoolMask, uint32 lockoutTim
else
{
Creature* creatureOwner = _owner->ToCreature();
- for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
if (creatureOwner->m_spells[i])
knownSpells.insert(creatureOwner->m_spells[i]);
}
@@ -542,7 +542,7 @@ void SpellHistory::LockSpellSchool(SpellSchoolMask schoolMask, uint32 lockoutTim
WorldPacket spellCooldowns;
for (uint32 spellId : knownSpells)
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(spellId);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(spellId);
if (spellInfo->IsCooldownStartedOnEvent())
continue;
@@ -688,7 +688,7 @@ void SpellHistory::RestoreCooldownStateAfterDuel()
// add all profession CDs created while in duel (if any)
for (auto itr = _spellCooldowns.begin(); itr != _spellCooldowns.end(); ++itr)
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
if (spellInfo->RecoveryTime > 10 * MINUTE * IN_MILLISECONDS ||
spellInfo->CategoryRecoveryTime > 10 * MINUTE * IN_MILLISECONDS)
diff --git a/src/server/game/Spells/SpellHistory.h b/src/server/game/Spells/SpellHistory.h
index f0a53fe130d..ccc8a7daa96 100644
--- a/src/server/game/Spells/SpellHistory.h
+++ b/src/server/game/Spells/SpellHistory.h
@@ -31,7 +31,7 @@ class SpellInfo;
class Unit;
struct SpellCategoryEntry;
-class SpellHistory
+class TC_GAME_API SpellHistory
{
public:
typedef std::chrono::system_clock Clock;
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 736bbfb7fa9..ac157b48783 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -418,7 +418,8 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
level = int32(_spellInfo->MaxLevel);
else if (level < int32(_spellInfo->BaseLevel))
level = int32(_spellInfo->BaseLevel);
- level -= int32(_spellInfo->SpellLevel);
+ if (!_spellInfo->IsPassive())
+ level -= int32(_spellInfo->SpellLevel);
basePoints += int32(level * basePointsPerLevel);
}
@@ -524,10 +525,10 @@ float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const
float SpellEffectInfo::CalcDamageMultiplier(Unit* caster, Spell* spell) const
{
- float multiplier = DamageMultiplier;
+ float multiplierPercent = DamageMultiplier * 100.0f;
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL))
- modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_DAMAGE_MULTIPLIER, multiplier, spell);
- return multiplier;
+ modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_DAMAGE_MULTIPLIER, multiplierPercent, spell);
+ return multiplierPercent / 100.0f;
}
bool SpellEffectInfo::HasRadius() const
@@ -754,7 +755,7 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] =
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 157 SPELL_EFFECT_CREATE_ITEM_2
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_ITEM}, // 158 SPELL_EFFECT_MILLING
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 159 SPELL_EFFECT_ALLOW_RENAME_PET
- {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 160 SPELL_EFFECT_160
+ {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 160 SPELL_EFFECT_FORCE_CAST_2
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 161 SPELL_EFFECT_TALENT_SPEC_COUNT
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 162 SPELL_EFFECT_TALENT_SPEC_SELECT
{EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 163 SPELL_EFFECT_163
@@ -1226,18 +1227,14 @@ bool SpellInfo::CanDispelAura(SpellInfo const* aura) const
if (HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) && !aura->IsDeathPersistent())
return true;
- // These auras (Cyclone for example) are not dispelable
- if (aura->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE))
- return false;
-
- // Divine Shield etc can dispel auras if they don't ignore school immunity
- if (HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) && !aura->IsDeathPersistent())
- return true;
-
// These auras (like Divine Shield) can't be dispelled
if (aura->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
return false;
+ // These auras (Cyclone for example) are not dispelable
+ if (aura->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE))
+ return false;
+
return true;
}
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index ba658c885fa..1530235174a 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -187,13 +187,14 @@ enum SpellCustomAttributes
SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER = 0x00010000,
SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET = 0x00020000,
SPELL_ATTR0_CU_ALLOW_INFLIGHT_TARGET = 0x00040000,
+ SPELL_ATTR0_CU_NEEDS_AMMO_DATA = 0x00080000,
SPELL_ATTR0_CU_NEGATIVE = SPELL_ATTR0_CU_NEGATIVE_EFF0 | SPELL_ATTR0_CU_NEGATIVE_EFF1 | SPELL_ATTR0_CU_NEGATIVE_EFF2
};
uint32 GetTargetFlagMask(SpellTargetObjectTypes objType);
-class SpellImplicitTargetInfo
+class TC_GAME_API SpellImplicitTargetInfo
{
private:
Targets _target;
@@ -224,7 +225,7 @@ private:
static StaticData _data[TOTAL_SPELL_TARGETS];
};
-class SpellEffectInfo
+class TC_GAME_API SpellEffectInfo
{
SpellInfo const* _spellInfo;
uint8 _effIndex;
@@ -290,7 +291,7 @@ private:
static StaticData _data[TOTAL_SPELL_EFFECTS];
};
-class SpellInfo
+class TC_GAME_API SpellInfo
{
public:
uint32 Id;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index f5bb1c920fe..ed0d95f0a58 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -353,6 +353,12 @@ SpellMgr::~SpellMgr()
UnloadSpellInfoStore();
}
+SpellMgr* SpellMgr::instance()
+{
+ static SpellMgr instance;
+ return &instance;
+}
+
/// Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc
bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg)
{
@@ -376,29 +382,29 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
{
if (spellInfo->Effects[i].ItemType == 0)
{
- // skip auto-loot crafting spells, its not need explicit item info (but have special fake items sometime)
+ // skip auto-loot crafting spells, it does not need explicit item info (but has special fake items sometimes).
if (!spellInfo->IsLootCrafting())
{
if (msg)
{
if (player)
- ChatHandler(player->GetSession()).PSendSysMessage("Craft spell %u not have create item entry.", spellInfo->Id);
+ ChatHandler(player->GetSession()).PSendSysMessage("The craft spell %u does not have a create item entry.", spellInfo->Id);
else
- TC_LOG_ERROR("sql.sql", "Craft spell %u not have create item entry.", spellInfo->Id);
+ TC_LOG_ERROR("sql.sql", "The craft spell %u does not have a create item entry.", spellInfo->Id);
}
return false;
}
}
- // also possible IsLootCrafting case but fake item must exist anyway
+ // also possible IsLootCrafting case but fake items must exist anyway
else if (!sObjectMgr->GetItemTemplate(spellInfo->Effects[i].ItemType))
{
if (msg)
{
if (player)
- ChatHandler(player->GetSession()).PSendSysMessage("Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
+ ChatHandler(player->GetSession()).PSendSysMessage("Craft spell %u has created a non-existing item in DB (Entry: %u) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
else
- TC_LOG_ERROR("sql.sql", "Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
+ TC_LOG_ERROR("sql.sql", "Craft spell %u has created a non-existing item in DB (Entry: %u) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
}
return false;
}
@@ -434,9 +440,9 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
if (msg)
{
if (player)
- ChatHandler(player->GetSession()).PSendSysMessage("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]);
+ ChatHandler(player->GetSession()).PSendSysMessage("Craft spell %u refers a non-existing reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]);
else
- TC_LOG_ERROR("sql.sql", "Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]);
+ TC_LOG_ERROR("sql.sql", "Craft spell %u refers to a non-existing reagent in DB, item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]);
}
return false;
}
@@ -455,7 +461,7 @@ uint32 SpellMgr::GetSpellDifficultyId(uint32 spellId) const
void SpellMgr::SetSpellDifficultyId(uint32 spellId, uint32 id)
{
if (uint32 i = GetSpellDifficultyId(spellId))
- TC_LOG_ERROR("spells", "SpellMgr::SetSpellDifficultyId: Spell %u has already spellDifficultyId %u. Will override with spellDifficultyId %u.", spellId, i, id);
+ TC_LOG_ERROR("spells", "SpellMgr::SetSpellDifficultyId: The spell %u already has spellDifficultyId %u. Will override with spellDifficultyId %u.", spellId, i, id);
mSpellDifficultySearcherMap[spellId] = id;
}
@@ -470,7 +476,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
uint32 mode = uint32(caster->GetMap()->GetSpawnMode());
if (mode >= MAX_DIFFICULTY)
{
- TC_LOG_ERROR("spells", "SpellMgr::GetSpellIdForDifficulty: Incorrect Difficulty for spell %u.", spellId);
+ TC_LOG_ERROR("spells", "SpellMgr::GetSpellIdForDifficulty: Incorrect difficulty for spell %u.", spellId);
return spellId; //return source spell
}
@@ -481,7 +487,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
SpellDifficultyEntry const* difficultyEntry = sSpellDifficultyStore.LookupEntry(difficultyId);
if (!difficultyEntry)
{
- TC_LOG_ERROR("spells", "SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry not found for spell %u. This should never happen.", spellId);
+ TC_LOG_ERROR("spells", "SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry was not found for spell %u. This should never happen.", spellId);
return spellId; //return source spell
}
@@ -874,7 +880,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, Spell
// For melee triggers
if (procSpell == NULL)
{
- // Check (if set) for school (melee attack have Normal school)
+ // Check (if set) for school (melee attack has Normal school)
if (spellProcEvent->schoolMask && (spellProcEvent->schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0)
return false;
}
@@ -894,7 +900,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, Spell
if (!(spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags))
return false;
hasFamilyMask = true;
- // Some spells are not considered as active even with have spellfamilyflags
+ // Some spells are not considered as active even with spellfamilyflags set
if (!(procEvent_procEx & PROC_EX_ONLY_ACTIVE_SPELL))
active = true;
}
@@ -949,11 +955,11 @@ SpellProcEntry const* SpellMgr::GetSpellProcEntry(uint32 spellId) const
bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const
{
// proc type doesn't match
- if (!(eventInfo.GetTypeMask() & procEntry.typeMask))
+ if (!(eventInfo.GetTypeMask() & procEntry.ProcFlags))
return false;
// check XP or honor target requirement
- if (procEntry.attributesMask & PROC_ATTR_REQ_EXP_OR_HONOR)
+ if (procEntry.AttributesMask & PROC_ATTR_REQ_EXP_OR_HONOR)
if (Player* actor = eventInfo.GetActor()->ToPlayer())
if (eventInfo.GetActionTarget() && !actor->isHonorOrXPTarget(eventInfo.GetActionTarget()))
return false;
@@ -963,7 +969,7 @@ bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcE
return true;
// check school mask (if set) for other trigger types
- if (procEntry.schoolMask && !(eventInfo.GetSchoolMask() & procEntry.schoolMask))
+ if (procEntry.SchoolMask && !(eventInfo.GetSchoolMask() & procEntry.SchoolMask))
return false;
// check spell family name/flags (if set) for spells
@@ -971,31 +977,31 @@ bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcE
{
SpellInfo const* eventSpellInfo = eventInfo.GetSpellInfo();
- if (procEntry.spellFamilyName && eventSpellInfo && (procEntry.spellFamilyName != eventSpellInfo->SpellFamilyName))
+ if (procEntry.SpellFamilyName && eventSpellInfo && (procEntry.SpellFamilyName != eventSpellInfo->SpellFamilyName))
return false;
- if (procEntry.spellFamilyMask && eventSpellInfo && !(procEntry.spellFamilyMask & eventSpellInfo->SpellFamilyFlags))
+ if (procEntry.SpellFamilyMask && eventSpellInfo && !(procEntry.SpellFamilyMask & eventSpellInfo->SpellFamilyFlags))
return false;
}
// check spell type mask (if set)
if (eventInfo.GetTypeMask() & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK))
{
- if (procEntry.spellTypeMask && !(eventInfo.GetSpellTypeMask() & procEntry.spellTypeMask))
+ if (procEntry.SpellTypeMask && !(eventInfo.GetSpellTypeMask() & procEntry.SpellTypeMask))
return false;
}
// check spell phase mask
if (eventInfo.GetTypeMask() & REQ_SPELL_PHASE_PROC_FLAG_MASK)
{
- if (!(eventInfo.GetSpellPhaseMask() & procEntry.spellPhaseMask))
+ if (!(eventInfo.GetSpellPhaseMask() & procEntry.SpellPhaseMask))
return false;
}
// check hit mask (on taken hit or on done hit, but not on spell cast phase)
if ((eventInfo.GetTypeMask() & TAKEN_HIT_PROC_FLAG_MASK) || ((eventInfo.GetTypeMask() & DONE_HIT_PROC_FLAG_MASK) && !(eventInfo.GetSpellPhaseMask() & PROC_SPELL_PHASE_CAST)))
{
- uint32 hitMask = procEntry.hitMask;
+ uint32 hitMask = procEntry.HitMask;
// get default values if hit mask not set
if (!hitMask)
{
@@ -1121,27 +1127,27 @@ SpellAreaForAreaMapBounds SpellMgr::GetSpellAreaForAreaMapBounds(uint32 area_id)
bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 newArea) const
{
- if (gender != GENDER_NONE) // not in expected gender
+ if (gender != GENDER_NONE) // is not expected gender
if (!player || gender != player->getGender())
return false;
- if (raceMask) // not in expected race
+ if (raceMask) // is not expected race
if (!player || !(raceMask & player->getRaceMask()))
return false;
- if (areaId) // not in expected zone
+ if (areaId) // is not in expected zone
if (newZone != areaId && newArea != areaId)
return false;
- if (questStart) // not in expected required quest state
+ if (questStart) // is not in expected required quest state
if (!player || (((1 << player->GetQuestStatus(questStart)) & questStartStatus) == 0))
return false;
- if (questEnd) // not in expected forbidden quest state
+ if (questEnd) // is not in expected forbidden quest state
if (!player || (((1 << player->GetQuestStatus(questEnd)) & questEndStatus) == 0))
return false;
- if (auraSpell) // not have expected aura
+ if (auraSpell) // does not have expected aura
if (!player || (auraSpell > 0 && !player->HasAura(auraSpell)) || (auraSpell < 0 && player->HasAura(-auraSpell)))
return false;
@@ -1341,7 +1347,7 @@ void SpellMgr::LoadSpellRanks()
SpellInfo const* first = GetSpellInfo(lastSpell);
if (!first)
{
- TC_LOG_ERROR("sql.sql", "Spell rank identifier(first_spell_id) %u listed in `spell_ranks` does not exist!", lastSpell);
+ TC_LOG_ERROR("sql.sql", "The spell rank identifier(first_spell_id) %u listed in `spell_ranks` does not exist!", lastSpell);
continue;
}
// check if chain is long enough
@@ -1358,14 +1364,14 @@ void SpellMgr::LoadSpellRanks()
SpellInfo const* spell = GetSpellInfo(itr->first);
if (!spell)
{
- TC_LOG_ERROR("sql.sql", "Spell %u (rank %u) listed in `spell_ranks` for chain %u does not exist!", itr->first, itr->second, lastSpell);
+ TC_LOG_ERROR("sql.sql", "The spell %u (rank %u) listed in `spell_ranks` for chain %u does not exist!", itr->first, itr->second, lastSpell);
valid = false;
break;
}
++curRank;
if (itr->second != curRank)
{
- TC_LOG_ERROR("sql.sql", "Spell %u (rank %u) listed in `spell_ranks` for chain %u does not have proper rank value(should be %u)!", itr->first, itr->second, lastSpell, curRank);
+ TC_LOG_ERROR("sql.sql", "The spell %u (rank %u) listed in `spell_ranks` for chain %u does not have a proper rank value (should be %u)!", itr->first, itr->second, lastSpell, curRank);
valid = false;
break;
}
@@ -1381,7 +1387,7 @@ void SpellMgr::LoadSpellRanks()
int32 addedSpell = itr->first;
if (mSpellInfoMap[addedSpell]->ChainEntry)
- TC_LOG_ERROR("sql.sql", "Spell %u (rank: %u, first: %u) listed in `spell_ranks` has already ChainEntry from dbc.", addedSpell, itr->second, lastSpell);
+ TC_LOG_ERROR("sql.sql", "The spell %u (rank: %u, first: %u) listed in `spell_ranks` already has ChainEntry from dbc.", addedSpell, itr->second, lastSpell);
mSpellChains[addedSpell].first = GetSpellInfo(lastSpell);
mSpellChains[addedSpell].last = GetSpellInfo(rankChain.back().first);
@@ -1435,26 +1441,26 @@ void SpellMgr::LoadSpellRequired()
SpellInfo const* spell = GetSpellInfo(spell_id);
if (!spell)
{
- TC_LOG_ERROR("sql.sql", "spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id);
+ TC_LOG_ERROR("sql.sql", "spell_id %u in `spell_required` table could not be found in dbc, skipped.", spell_id);
continue;
}
SpellInfo const* reqSpell = GetSpellInfo(spell_req);
if (!reqSpell)
{
- TC_LOG_ERROR("sql.sql", "req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req);
+ TC_LOG_ERROR("sql.sql", "req_spell %u in `spell_required` table could not be found in dbc, skipped.", spell_req);
continue;
}
if (spell->IsRankOf(reqSpell))
{
- TC_LOG_ERROR("sql.sql", "req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id);
+ TC_LOG_ERROR("sql.sql", "req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped.", spell_req, spell_id);
continue;
}
if (IsSpellRequiringSpell(spell_id, spell_req))
{
- TC_LOG_ERROR("sql.sql", "duplicated entry of req_spell %u and spell_id %u in `spell_required`, skipped", spell_req, spell_id);
+ TC_LOG_ERROR("sql.sql", "Duplicate entry of req_spell %u and spell_id %u in `spell_required`, skipped.", spell_req, spell_id);
continue;
}
@@ -1532,19 +1538,19 @@ void SpellMgr::LoadSpellLearnSpells()
if (!GetSpellInfo(spell_id))
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_learn_spell` does not exist", spell_id);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_learn_spell` does not exist.", spell_id);
continue;
}
if (!GetSpellInfo(node.spell))
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_learn_spell` learning not existed spell %u", spell_id, node.spell);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_learn_spell` learning non-existing spell %u.", spell_id, node.spell);
continue;
}
if (GetTalentSpellCost(node.spell))
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_learn_spell` attempt learning talent spell %u, skipped", spell_id, node.spell);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_learn_spell` attempts learning talent spell %u, skipped.", spell_id, node.spell);
continue;
}
@@ -1586,7 +1592,7 @@ void SpellMgr::LoadSpellLearnSpells()
{
if (itr->second.spell == dbc_node.spell)
{
- TC_LOG_ERROR("sql.sql", "Spell %u auto-learn spell %u in spell.dbc then the record in `spell_learn_spell` is redundant, please fix DB.",
+ TC_LOG_ERROR("sql.sql", "The spell %u is an auto-learn spell %u in spell.dbc and the record in `spell_learn_spell` is redundant. Please update your DB.",
spell, dbc_node.spell);
found = true;
break;
@@ -1663,7 +1669,7 @@ void SpellMgr::LoadSpellTargetPositions()
}
else
{
- TC_LOG_ERROR("sql.sql", "Spell (Id: %u, effIndex: %u) listed in `spell_target_position` does not have target TARGET_DEST_DB (17).", Spell_ID, effIndex);
+ TC_LOG_ERROR("sql.sql", "Spell (Id: %u, effIndex: %u) listed in `spell_target_position` does not have a target TARGET_DEST_DB (17).", Spell_ID, effIndex);
continue;
}
@@ -1700,7 +1706,7 @@ void SpellMgr::LoadSpellTargetPositions()
if (found)
{
if (!sSpellMgr->GetSpellTargetPosition(i))
- TC_LOG_DEBUG("spells", "Spell (ID: %u) does not have record in `spell_target_position`", i);
+ TC_LOG_DEBUG("spells", "Spell (ID: %u) does not have a record in `spell_target_position`.", i);
}
}*/
@@ -1759,12 +1765,12 @@ void SpellMgr::LoadSpellGroups()
if (!spellInfo)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_group` does not exist", itr->second);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_group` does not exist", itr->second);
mSpellGroupSpell.erase(itr++);
}
else if (spellInfo->GetRank() > 1)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_group` is not first rank of spell", itr->second);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_group` is not the first rank of the spell.", itr->second);
mSpellGroupSpell.erase(itr++);
}
else
@@ -1810,7 +1816,7 @@ void SpellMgr::LoadSpellGroupStackRules()
uint8 stack_rule = fields[1].GetInt8();
if (stack_rule >= SPELL_GROUP_STACK_RULE_MAX)
{
- TC_LOG_ERROR("sql.sql", "SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule);
+ TC_LOG_ERROR("sql.sql", "SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist.", stack_rule);
continue;
}
@@ -1818,7 +1824,7 @@ void SpellMgr::LoadSpellGroupStackRules()
if (spellGroup.first == spellGroup.second)
{
- TC_LOG_ERROR("sql.sql", "SpellGroup id %u listed in `spell_group_stack_rules` does not exist", group_id);
+ TC_LOG_ERROR("sql.sql", "SpellGroup id %u listed in `spell_group_stack_rules` does not exist.", group_id);
continue;
}
@@ -1862,18 +1868,18 @@ void SpellMgr::LoadSpellProcEvents()
SpellInfo const* spellInfo = GetSpellInfo(spellId);
if (!spellInfo)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_proc_event` does not exist", spellId);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc_event` does not exist.", spellId);
continue;
}
if (allRanks)
{
if (!spellInfo->IsRanked())
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_proc_event` with all ranks, but spell has no ranks.", spellId);
+ TC_LOG_ERROR("sql.sql", "The spell %u is listed in `spell_proc_event` with all ranks, but spell has no ranks.", spellId);
if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId))
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_proc_event` is not first rank of spell.", spellId);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc_event` is not first rank of spell.", spellId);
continue;
}
}
@@ -1895,12 +1901,12 @@ void SpellMgr::LoadSpellProcEvents()
{
if (mSpellProcEventMap.find(spellInfo->Id) != mSpellProcEventMap.end())
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_proc_event` already has its first rank in table.", spellInfo->Id);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc_event` already has its first rank in table.", spellInfo->Id);
break;
}
if (!spellInfo->ProcFlags && !spellProcEvent.procFlags)
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_proc_event` probably not triggered spell", spellInfo->Id);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc_event` is probably not a triggered spell.", spellInfo->Id);
mSpellProcEventMap[spellInfo->Id] = spellProcEvent;
@@ -1923,8 +1929,11 @@ void SpellMgr::LoadSpellProcs()
mSpellProcMap.clear(); // need for reload case
- // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
- QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc");
+ // 0 1 2 3 4 5
+ QueryResult result = WorldDatabase.Query("SELECT SpellId, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, "
+ // 6 7 8 9 10 11 12 13 14
+ "ProcFlags, SpellTypeMask, SpellPhaseMask, HitMask, AttributesMask, ProcsPerMinute, Chance, Cooldown, Charges FROM spell_proc");
+
if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
@@ -1948,101 +1957,90 @@ void SpellMgr::LoadSpellProcs()
SpellInfo const* spellInfo = GetSpellInfo(spellId);
if (!spellInfo)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_proc` does not exist", spellId);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` does not exist", spellId);
continue;
}
if (allRanks)
{
if (!spellInfo->IsRanked())
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_proc` with all ranks, but spell has no ranks.", spellId);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` with all ranks, but spell has no ranks.", spellId);
if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId))
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_proc` is not first rank of spell.", spellId);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` is not the first rank of the spell.", spellId);
continue;
}
}
SpellProcEntry baseProcEntry;
- baseProcEntry.schoolMask = fields[1].GetInt8();
- baseProcEntry.spellFamilyName = fields[2].GetUInt16();
- baseProcEntry.spellFamilyMask[0] = fields[3].GetUInt32();
- baseProcEntry.spellFamilyMask[1] = fields[4].GetUInt32();
- baseProcEntry.spellFamilyMask[2] = fields[5].GetUInt32();
- baseProcEntry.typeMask = fields[6].GetUInt32();
- baseProcEntry.spellTypeMask = fields[7].GetUInt32();
- baseProcEntry.spellPhaseMask = fields[8].GetUInt32();
- baseProcEntry.hitMask = fields[9].GetUInt32();
- baseProcEntry.attributesMask = fields[10].GetUInt32();
- baseProcEntry.ratePerMinute = fields[11].GetFloat();
- baseProcEntry.chance = fields[12].GetFloat();
- float cooldown = fields[13].GetFloat();
- baseProcEntry.cooldown = uint32(cooldown);
- baseProcEntry.charges = fields[14].GetUInt32();
+ baseProcEntry.SchoolMask = fields[1].GetInt8();
+ baseProcEntry.SpellFamilyName = fields[2].GetUInt16();
+ baseProcEntry.SpellFamilyMask[0] = fields[3].GetUInt32();
+ baseProcEntry.SpellFamilyMask[1] = fields[4].GetUInt32();
+ baseProcEntry.SpellFamilyMask[2] = fields[5].GetUInt32();
+ baseProcEntry.ProcFlags = fields[6].GetUInt32();
+ baseProcEntry.SpellTypeMask = fields[7].GetUInt32();
+ baseProcEntry.SpellPhaseMask = fields[8].GetUInt32();
+ baseProcEntry.HitMask = fields[9].GetUInt32();
+ baseProcEntry.AttributesMask = fields[10].GetUInt32();
+ baseProcEntry.ProcsPerMinute = fields[11].GetFloat();
+ baseProcEntry.Chance = fields[12].GetFloat();
+ baseProcEntry.Cooldown = Milliseconds(fields[13].GetUInt32());
+ baseProcEntry.Charges = fields[14].GetUInt8();
while (spellInfo)
{
if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end())
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_proc` already has its first rank in table.", spellInfo->Id);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_proc` already has its first rank in the table.", spellInfo->Id);
break;
}
SpellProcEntry procEntry = SpellProcEntry(baseProcEntry);
// take defaults from dbcs
- if (!procEntry.typeMask)
- procEntry.typeMask = spellInfo->ProcFlags;
- if (!procEntry.charges)
- procEntry.charges = spellInfo->ProcCharges;
- if (!procEntry.chance && !procEntry.ratePerMinute)
- procEntry.chance = float(spellInfo->ProcChance);
+ if (!procEntry.ProcFlags)
+ procEntry.ProcFlags = spellInfo->ProcFlags;
+ if (!procEntry.Charges)
+ procEntry.Charges = spellInfo->ProcCharges;
+ if (!procEntry.Chance && !procEntry.ProcsPerMinute)
+ procEntry.Chance = float(spellInfo->ProcChance);
// validate data
- if (procEntry.schoolMask & ~SPELL_SCHOOL_MASK_ALL)
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellInfo->Id, procEntry.schoolMask);
- if (procEntry.spellFamilyName && (procEntry.spellFamilyName < 3 || procEntry.spellFamilyName > 17 || procEntry.spellFamilyName == 14 || procEntry.spellFamilyName == 16))
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellInfo->Id, procEntry.spellFamilyName);
- if (procEntry.chance < 0)
+ if (procEntry.SchoolMask & ~SPELL_SCHOOL_MASK_ALL)
+ TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `SchoolMask` set: %u", spellInfo->Id, procEntry.SchoolMask);
+ if (procEntry.SpellFamilyName && (procEntry.SpellFamilyName < 3 || procEntry.SpellFamilyName > 17 || procEntry.SpellFamilyName == 14 || procEntry.SpellFamilyName == 16))
+ TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `SpellFamilyName` set: %u", spellInfo->Id, procEntry.SpellFamilyName);
+ if (procEntry.Chance < 0)
{
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellInfo->Id);
- procEntry.chance = 0;
+ TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has negative value in the `Chance` field", spellInfo->Id);
+ procEntry.Chance = 0;
}
- if (procEntry.ratePerMinute < 0)
+ if (procEntry.ProcsPerMinute < 0)
{
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellInfo->Id);
- procEntry.ratePerMinute = 0;
+ TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has negative value in the `ProcsPerMinute` field", spellInfo->Id);
+ procEntry.ProcsPerMinute = 0;
}
- if (cooldown < 0)
- {
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellInfo->Id);
- procEntry.cooldown = 0;
- }
- if (procEntry.chance == 0 && procEntry.ratePerMinute == 0)
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellInfo->Id);
- if (procEntry.charges > 99)
- {
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellInfo->Id);
- procEntry.charges = 99;
- }
- if (!procEntry.typeMask)
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellInfo->Id);
- if (procEntry.spellTypeMask & ~PROC_SPELL_TYPE_MASK_ALL)
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellInfo->Id, procEntry.spellTypeMask);
- if (procEntry.spellTypeMask && !(procEntry.typeMask & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK)))
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->Id);
- if (!procEntry.spellPhaseMask && procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK)
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellInfo->Id);
- if (procEntry.spellPhaseMask & ~PROC_SPELL_PHASE_MASK_ALL)
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellInfo->Id, procEntry.spellPhaseMask);
- if (procEntry.spellPhaseMask && !(procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK))
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->Id);
- if (procEntry.hitMask & ~PROC_HIT_MASK_ALL)
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellInfo->Id, procEntry.hitMask);
- if (procEntry.hitMask && !(procEntry.typeMask & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.typeMask & DONE_HIT_PROC_FLAG_MASK && (!procEntry.spellPhaseMask || procEntry.spellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH)))))
- TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellInfo->Id);
+ if (procEntry.Chance == 0 && procEntry.ProcsPerMinute == 0)
+ TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u doesn't have any `Chance` and `ProcsPerMinute` values defined, proc will not be triggered", spellInfo->Id);
+ if (!procEntry.ProcFlags)
+ TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u doesn't have any `ProcFlags` value defined, proc will not be triggered.", spellInfo->Id);
+ if (procEntry.SpellTypeMask & ~PROC_SPELL_TYPE_MASK_ALL)
+ TC_LOG_ERROR("sql.sql", "`spell_proc` table entry for spellId %u has wrong `SpellTypeMask` set: %u", spellInfo->Id, procEntry.SpellTypeMask);
+ if (procEntry.SpellTypeMask && !(procEntry.ProcFlags & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK)))
+ TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `SpellTypeMask` value defined, but it will not be used for the defined `ProcFlags` value.", spellInfo->Id);
+ if (!procEntry.SpellPhaseMask && procEntry.ProcFlags & REQ_SPELL_PHASE_PROC_FLAG_MASK)
+ TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u doesn't have any `SpellPhaseMask` value defined, but it is required for the defined `ProcFlags` value. Proc will not be triggered.", spellInfo->Id);
+ if (procEntry.SpellPhaseMask & ~PROC_SPELL_PHASE_MASK_ALL)
+ TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has wrong `SpellPhaseMask` set: %u", spellInfo->Id, procEntry.SpellPhaseMask);
+ if (procEntry.SpellPhaseMask && !(procEntry.ProcFlags & REQ_SPELL_PHASE_PROC_FLAG_MASK))
+ TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has a `SpellPhaseMask` value defined, but it will not be used for the defined `ProcFlags` value.", spellInfo->Id);
+ if (procEntry.HitMask & ~PROC_HIT_MASK_ALL)
+ TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has wrong `HitMask` set: %u", spellInfo->Id, procEntry.HitMask);
+ if (procEntry.HitMask && !(procEntry.ProcFlags & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.ProcFlags & DONE_HIT_PROC_FLAG_MASK && (!procEntry.SpellPhaseMask || procEntry.SpellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH)))))
+ TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `HitMask` value defined, but it will not be used for defined `ProcFlags` and `SpellPhaseMask` values.", spellInfo->Id);
mSpellProcMap[spellInfo->Id] = procEntry;
@@ -2081,7 +2079,7 @@ void SpellMgr::LoadSpellBonusess()
SpellInfo const* spell = GetSpellInfo(entry);
if (!spell)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_bonus_data` does not exist", entry);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_bonus_data` does not exist.", entry);
continue;
}
@@ -2120,7 +2118,7 @@ void SpellMgr::LoadSpellThreats()
if (!GetSpellInfo(entry))
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_threat` does not exist", entry);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_threat` does not exist.", entry);
continue;
}
@@ -2189,21 +2187,21 @@ void SpellMgr::LoadSpellPetAuras()
SpellInfo const* spellInfo = GetSpellInfo(spell);
if (!spellInfo)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_pet_auras` does not exist", spell);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_pet_auras` does not exist.", spell);
continue;
}
if (spellInfo->Effects[eff].Effect != SPELL_EFFECT_DUMMY &&
(spellInfo->Effects[eff].Effect != SPELL_EFFECT_APPLY_AURA ||
spellInfo->Effects[eff].ApplyAuraName != SPELL_AURA_DUMMY))
{
- TC_LOG_ERROR("spells", "Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell);
+ TC_LOG_ERROR("spells", "The spell %u listed in `spell_pet_auras` does not have any dummy aura or dummy effect.", spell);
continue;
}
SpellInfo const* spellInfo2 = GetSpellInfo(aura);
if (!spellInfo2)
{
- TC_LOG_ERROR("sql.sql", "Aura %u listed in `spell_pet_auras` does not exist", aura);
+ TC_LOG_ERROR("sql.sql", "The aura %u listed in `spell_pet_auras` does not exist.", aura);
continue;
}
@@ -2281,7 +2279,7 @@ void SpellMgr::LoadSpellEnchantProcData()
SpellItemEnchantmentEntry const* ench = sSpellItemEnchantmentStore.LookupEntry(enchantId);
if (!ench)
{
- TC_LOG_ERROR("sql.sql", "Enchancment %u listed in `spell_enchant_proc_data` does not exist", enchantId);
+ TC_LOG_ERROR("sql.sql", "The enchancment %u listed in `spell_enchant_proc_data` does not exist.", enchantId);
continue;
}
@@ -2325,7 +2323,7 @@ void SpellMgr::LoadSpellLinked()
SpellInfo const* spellInfo = GetSpellInfo(abs(trigger));
if (!spellInfo)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_linked_spell` does not exist", abs(trigger));
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_linked_spell` does not exist.", abs(trigger));
continue;
}
@@ -2333,13 +2331,13 @@ void SpellMgr::LoadSpellLinked()
for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
if (spellInfo->Effects[j].CalcValue() == abs(effect))
- TC_LOG_ERROR("sql.sql", "Spell %u Effect: %u listed in `spell_linked_spell` has same bp%u like effect (possible hack)", abs(trigger), abs(effect), j);
+ TC_LOG_ERROR("sql.sql", "The spell %u Effect: %u listed in `spell_linked_spell` has same bp%u like effect (possible hack).", abs(trigger), abs(effect), j);
}
spellInfo = GetSpellInfo(abs(effect));
if (!spellInfo)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_linked_spell` does not exist", abs(effect));
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_linked_spell` does not exist.", abs(effect));
continue;
}
@@ -2584,7 +2582,7 @@ void SpellMgr::LoadSpellAreas()
}
else
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` does not exist", spell);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` does not exist", spell);
continue;
}
@@ -2613,20 +2611,20 @@ void SpellMgr::LoadSpellAreas()
if (!ok)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` already listed with similar requirements.", spell);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` is already listed with similar requirements.", spell);
continue;
}
}
if (spellArea.areaId && !sAreaTableStore.LookupEntry(spellArea.areaId))
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` have wrong area (%u) requirement", spell, spellArea.areaId);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` has a wrong area (%u) requirement.", spell, spellArea.areaId);
continue;
}
if (spellArea.questStart && !sObjectMgr->GetQuestTemplate(spellArea.questStart))
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell, spellArea.questStart);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` has a wrong start quest (%u) requirement.", spell, spellArea.questStart);
continue;
}
@@ -2634,7 +2632,7 @@ void SpellMgr::LoadSpellAreas()
{
if (!sObjectMgr->GetQuestTemplate(spellArea.questEnd))
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell, spellArea.questEnd);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` has a wrong ending quest (%u) requirement.", spell, spellArea.questEnd);
continue;
}
}
@@ -2644,13 +2642,13 @@ void SpellMgr::LoadSpellAreas()
SpellInfo const* spellInfo = GetSpellInfo(abs(spellArea.auraSpell));
if (!spellInfo)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell, abs(spellArea.auraSpell));
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` has wrong aura spell (%u) requirement", spell, abs(spellArea.auraSpell));
continue;
}
if (uint32(abs(spellArea.auraSpell)) == spellArea.spellId)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell));
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` has aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell));
continue;
}
@@ -2670,7 +2668,7 @@ void SpellMgr::LoadSpellAreas()
if (chain)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` has the aura spell (%u) requirement that it autocasts itself from the aura.", spell, spellArea.auraSpell);
continue;
}
@@ -2686,7 +2684,7 @@ void SpellMgr::LoadSpellAreas()
if (chain)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` has the aura spell (%u) requirement that the spell itself autocasts from the aura.", spell, spellArea.auraSpell);
continue;
}
}
@@ -2694,13 +2692,13 @@ void SpellMgr::LoadSpellAreas()
if (spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE) == 0)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell, spellArea.raceMask);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` has wrong race mask (%u) requirement.", spell, spellArea.raceMask);
continue;
}
if (spellArea.gender != GENDER_NONE && spellArea.gender != GENDER_FEMALE && spellArea.gender != GENDER_MALE)
{
- TC_LOG_ERROR("sql.sql", "Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell, spellArea.gender);
+ TC_LOG_ERROR("sql.sql", "The spell %u listed in `spell_area` has wrong gender (%u) requirement.", spell, spellArea.gender);
continue;
}
@@ -3050,6 +3048,7 @@ void SpellMgr::LoadSpellInfoCorrections()
case 48246: // Ball of Flame
case 36327: // Shoot Arcane Explosion Arrow
case 55479: // Force Obedience
+ case 28560: // Summon Blizzard (Sapphiron)
spellInfo->MaxAffectedTargets = 1;
break;
case 36384: // Skartax Purple Beam
@@ -3074,6 +3073,13 @@ void SpellMgr::LoadSpellInfoCorrections()
case 53385: // Divine Storm (Damage)
spellInfo->MaxAffectedTargets = 4;
break;
+ case 53480: // Roar of Sacrifice
+ // missing spell effect 2 data, taken from 4.3.4
+ spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
+ spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_DUMMY;
+ spellInfo->Effects[EFFECT_1].MiscValue = 127;
+ spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
+ break;
case 42005: // Bloodboil
case 38296: // Spitfire Totem
case 37676: // Insidious Whisper
@@ -3235,6 +3241,8 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->AttributesEx4 = 0;
break;
case 8145: // Tremor Totem (instant pulse)
+ spellInfo->AttributesEx2 |= SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS;
+ /*no break*/
case 6474: // Earthbind Totem (instant pulse)
spellInfo->AttributesEx5 |= SPELL_ATTR5_START_PERIODIC_AT_APPLY;
break;
@@ -3337,6 +3345,24 @@ void SpellMgr::LoadSpellInfoCorrections()
//! HACK: This spell break quest complete for alliance and on retail not used °_O
spellInfo->Effects[EFFECT_0].Effect = 0;
break;
+ case 47476: // Deathknight - Strangulate
+ case 15487: // Priest - Silence
+ case 5211: // Druid - Bash - R1
+ case 6798: // Druid - Bash - R2
+ case 8983: // Druid - Bash - R3
+ spellInfo->AttributesEx7 |= SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER;
+ break;
+ case 42490: // Energized!
+ case 42492: // Cast Energized
+ spellInfo->AttributesEx |= SPELL_ATTR1_NO_THREAT;
+ break;
+ case 46842: // Flame Ring
+ case 46836: // Flame Patch
+ spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo();
+ break;
+ case 29726: // Test Ribbon Pole Channel
+ spellInfo->InterruptFlags &= ~AURA_INTERRUPT_FLAG_CAST;
+ break;
// VIOLET HOLD SPELLS
//
case 54258: // Water Globule (Ichoron)
@@ -3695,9 +3721,17 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->AttributesEx6 |= SPELL_ATTR6_CAN_TARGET_INVISIBLE;
spellInfo->AttributesEx2 |= SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS;
break;
- case 75888: // Awaken Flames
- case 75889: // Awaken Flames
- spellInfo->AttributesEx |= SPELL_ATTR1_CANT_TARGET_SELF;
+ case 75875: // Combustion and Consumption Heroic versions lacks radius data
+ spellInfo->Effects[EFFECT_0].Mechanic = MECHANIC_NONE;
+ spellInfo->Effects[EFFECT_1].Mechanic = MECHANIC_SNARE;
+ spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS);
+ break;
+ case 75884:
+ spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS);
+ // No break
+ case 75883:
+ case 75876:
+ spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_6_YARDS);
break;
// ENDOF RUBY SANCTUM SPELLS
//
@@ -3746,12 +3780,6 @@ void SpellMgr::LoadSpellInfoCorrections()
case 24314: // Threatening Gaze
spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_JUMP;
break;
- case 45257: // Using Steam Tonk Controller
- case 45440: // Steam Tonk Controller
- case 60256: // Collect Sample
- // Crashes client on pressing ESC
- spellInfo->AttributesEx4 &= ~SPELL_ATTR4_CAN_CAST_WHILE_CASTING;
- break;
// ISLE OF CONQUEST SPELLS
//
case 66551: // Teleport
diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h
index 651a8cde938..75da933636c 100644
--- a/src/server/game/Spells/SpellMgr.h
+++ b/src/server/game/Spells/SpellMgr.h
@@ -266,7 +266,7 @@ enum ProcFlagsHit
PROC_HIT_REFLECT = 0x0000800,
PROC_HIT_INTERRUPT = 0x0001000, // (not used atm)
PROC_HIT_FULL_BLOCK = 0x0002000,
- PROC_HIT_MASK_ALL = 0x2FFF
+ PROC_HIT_MASK_ALL = 0x0002FFF
};
enum ProcAttributes
@@ -290,18 +290,18 @@ typedef std::unordered_map<uint32, SpellProcEventEntry> SpellProcEventMap;
struct SpellProcEntry
{
- uint32 schoolMask; // if nonzero - bitmask for matching proc condition based on spell's school
- uint32 spellFamilyName; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyName
- flag96 spellFamilyMask; // if nonzero - bitmask for matching proc condition based on candidate spell's SpellFamilyFlags
- uint32 typeMask; // if nonzero - owerwrite procFlags field for given Spell.dbc entry, bitmask for matching proc condition, see enum ProcFlags
- uint32 spellTypeMask; // if nonzero - bitmask for matching proc condition based on candidate spell's damage/heal effects, see enum ProcFlagsSpellType
- uint32 spellPhaseMask; // if nonzero - bitmask for matching phase of a spellcast on which proc occurs, see enum ProcFlagsSpellPhase
- uint32 hitMask; // if nonzero - bitmask for matching proc condition based on hit result, see enum ProcFlagsHit
- uint32 attributesMask; // bitmask, see ProcAttributes
- float ratePerMinute; // if nonzero - chance to proc is equal to value * aura caster's weapon speed / 60
- float chance; // if nonzero - owerwrite procChance field for given Spell.dbc entry, defines chance of proc to occur, not used if perMinuteRate set
- uint32 cooldown; // if nonzero - cooldown in secs for aura proc, applied to aura
- uint32 charges; // if nonzero - owerwrite procCharges field for given Spell.dbc entry, defines how many times proc can occur before aura remove, 0 - infinite
+ uint32 SchoolMask; // if nonzero - bitmask for matching proc condition based on spell's school
+ uint32 SpellFamilyName; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyName
+ flag96 SpellFamilyMask; // if nonzero - bitmask for matching proc condition based on candidate spell's SpellFamilyFlags
+ uint32 ProcFlags; // if nonzero - owerwrite procFlags field for given Spell.dbc entry, bitmask for matching proc condition, see enum ProcFlags
+ uint32 SpellTypeMask; // if nonzero - bitmask for matching proc condition based on candidate spell's damage/heal effects, see enum ProcFlagsSpellType
+ uint32 SpellPhaseMask; // if nonzero - bitmask for matching phase of a spellcast on which proc occurs, see enum ProcFlagsSpellPhase
+ uint32 HitMask; // if nonzero - bitmask for matching proc condition based on hit result, see enum ProcFlagsHit
+ uint32 AttributesMask; // bitmask, see ProcAttributes
+ float ProcsPerMinute; // if nonzero - chance to proc is equal to value * aura caster's weapon speed / 60
+ float Chance; // if nonzero - owerwrite procChance field for given Spell.dbc entry, defines chance of proc to occur, not used if ProcsPerMinute set
+ Milliseconds Cooldown; // if nonzero - cooldown in secs for aura proc, applied to aura
+ uint32 Charges; // if nonzero - owerwrite procCharges field for given Spell.dbc entry, defines how many times proc can occur before aura remove, 0 - infinite
};
typedef std::unordered_map<uint32, SpellProcEntry> SpellProcMap;
@@ -441,7 +441,7 @@ enum EffectRadiusIndex
};
// Spell pet auras
-class PetAura
+class TC_GAME_API PetAura
{
private:
typedef std::unordered_map<uint32, uint32> PetAuraMap;
@@ -488,7 +488,7 @@ class PetAura
};
typedef std::map<uint32, PetAura> SpellPetAuraMap;
-struct SpellArea
+struct TC_GAME_API SpellArea
{
uint32 spellId;
uint32 areaId; // zone/subzone/or 0 is not limited to zone
@@ -593,13 +593,13 @@ inline bool IsProfessionOrRidingSkill(uint32 skill)
bool IsPartOfSkillLine(uint32 skillId, uint32 spellId);
// spell diminishing returns
-DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, bool triggered);
-DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group);
-DiminishingLevels GetDiminishingReturnsMaxLevel(DiminishingGroup group);
-int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellInfo const* spellproto);
-bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group);
+TC_GAME_API DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, bool triggered);
+TC_GAME_API DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group);
+TC_GAME_API DiminishingLevels GetDiminishingReturnsMaxLevel(DiminishingGroup group);
+TC_GAME_API int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellInfo const* spellproto);
+TC_GAME_API bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group);
-class SpellMgr
+class TC_GAME_API SpellMgr
{
// Constructors
private:
@@ -608,11 +608,7 @@ class SpellMgr
// Accessors (const or static functions)
public:
- static SpellMgr* instance()
- {
- static SpellMgr instance;
- return &instance;
- }
+ static SpellMgr* instance();
// Spell correctness for client using
static bool IsSpellValid(SpellInfo const* spellInfo, Player* player = NULL, bool msg = true);
@@ -696,7 +692,7 @@ class SpellMgr
// SpellInfo object management
SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : NULL; }
// Use this only with 100% valid spellIds
- SpellInfo const* EnsureSpellInfo(uint32 spellId) const
+ SpellInfo const* AssertSpellInfo(uint32 spellId) const
{
ASSERT(spellId < GetSpellInfoStoreSize());
SpellInfo const* spellInfo = mSpellInfoMap[spellId];
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index 6876f8fa7ef..e2598386466 100644
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -16,6 +16,7 @@
*/
#include "Spell.h"
+#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellScript.h"
#include "SpellMgr.h"
@@ -50,6 +51,12 @@ void _SpellScript::_Init(std::string const* scriptname, uint32 spellId)
m_currentScriptState = SPELL_SCRIPT_STATE_NONE;
m_scriptName = scriptname;
m_scriptSpellId = spellId;
+
+#ifdef TRINITY_API_USE_DYNAMIC_LINKING
+ // Acquire a strong reference to the binary code
+ // to keep it loaded until all spells are destroyed.
+ m_moduleReference = sScriptMgr->AcquireModuleReferenceOfScriptName(*scriptname);
+#endif // #ifndef TRINITY_API_USE_DYNAMIC_LINKING
}
std::string const* _SpellScript::_GetScriptName() const
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h
index 77a993fffae..539bc54cc94 100644
--- a/src/server/game/Spells/SpellScript.h
+++ b/src/server/game/Spells/SpellScript.h
@@ -22,6 +22,7 @@
#include "SharedDefines.h"
#include "SpellAuraDefines.h"
#include "Spell.h"
+#include "ScriptReloadMgr.h"
#include <stack>
class Unit;
@@ -52,7 +53,7 @@ enum SpellScriptState
#define SPELL_SCRIPT_STATE_END SPELL_SCRIPT_STATE_UNLOADING + 1
// helper class from which SpellScript and SpellAura derive, use these classes instead
-class _SpellScript
+class TC_GAME_API _SpellScript
{
// internal use classes & functions
// DO NOT OVERRIDE THESE IN SCRIPTS
@@ -68,7 +69,7 @@ class _SpellScript
std::string const* _GetScriptName() const;
protected:
- class EffectHook
+ class TC_GAME_API EffectHook
{
public:
EffectHook(uint8 _effIndex);
@@ -82,7 +83,7 @@ class _SpellScript
uint8 effIndex;
};
- class EffectNameCheck
+ class TC_GAME_API EffectNameCheck
{
public:
EffectNameCheck(uint16 _effName) { effName = _effName; }
@@ -92,7 +93,7 @@ class _SpellScript
uint16 effName;
};
- class EffectAuraNameCheck
+ class TC_GAME_API EffectAuraNameCheck
{
public:
EffectAuraNameCheck(uint16 _effAurName) { effAurName = _effAurName; }
@@ -105,6 +106,16 @@ class _SpellScript
uint8 m_currentScriptState;
std::string const* m_scriptName;
uint32 m_scriptSpellId;
+
+ private:
+
+#ifdef TRINITY_API_USE_DYNAMIC_LINKING
+
+ // Strong reference to keep the binary code loaded
+ std::shared_ptr<ModuleReference> m_moduleReference;
+
+#endif // #ifndef TRINITY_API_USE_DYNAMIC_LINKING
+
public:
//
// SpellScript/AuraScript interface base
@@ -149,7 +160,7 @@ enum SpellScriptHookType
#define HOOK_SPELL_END SPELL_SCRIPT_HOOK_CHECK_CAST + 1
#define HOOK_SPELL_COUNT HOOK_SPELL_END - HOOK_SPELL_START
-class SpellScript : public _SpellScript
+class TC_GAME_API SpellScript : public _SpellScript
{
// internal use classes & functions
// DO NOT OVERRIDE THESE IN SCRIPTS
@@ -165,7 +176,7 @@ class SpellScript : public _SpellScript
SPELLSCRIPT_FUNCTION_TYPE_DEFINES(SpellScript)
- class CastHandler
+ class TC_GAME_API CastHandler
{
public:
CastHandler(SpellCastFnType _pCastHandlerScript);
@@ -174,7 +185,7 @@ class SpellScript : public _SpellScript
SpellCastFnType pCastHandlerScript;
};
- class CheckCastHandler
+ class TC_GAME_API CheckCastHandler
{
public:
CheckCastHandler(SpellCheckCastFnType checkCastHandlerScript);
@@ -183,7 +194,7 @@ class SpellScript : public _SpellScript
SpellCheckCastFnType _checkCastHandlerScript;
};
- class EffectHandler : public _SpellScript::EffectNameCheck, public _SpellScript::EffectHook
+ class TC_GAME_API EffectHandler : public _SpellScript::EffectNameCheck, public _SpellScript::EffectHook
{
public:
EffectHandler(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName);
@@ -194,7 +205,7 @@ class SpellScript : public _SpellScript
SpellEffectFnType pEffectHandlerScript;
};
- class HitHandler
+ class TC_GAME_API HitHandler
{
public:
HitHandler(SpellHitFnType _pHitHandlerScript);
@@ -203,7 +214,7 @@ class SpellScript : public _SpellScript
SpellHitFnType pHitHandlerScript;
};
- class TargetHook : public _SpellScript::EffectHook
+ class TC_GAME_API TargetHook : public _SpellScript::EffectHook
{
public:
TargetHook(uint8 _effectIndex, uint16 _targetType, bool _area, bool _dest);
@@ -216,7 +227,7 @@ class SpellScript : public _SpellScript
bool dest;
};
- class ObjectAreaTargetSelectHandler : public TargetHook
+ class TC_GAME_API ObjectAreaTargetSelectHandler : public TargetHook
{
public:
ObjectAreaTargetSelectHandler(SpellObjectAreaTargetSelectFnType _pObjectAreaTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType);
@@ -225,7 +236,7 @@ class SpellScript : public _SpellScript
SpellObjectAreaTargetSelectFnType pObjectAreaTargetSelectHandlerScript;
};
- class ObjectTargetSelectHandler : public TargetHook
+ class TC_GAME_API ObjectTargetSelectHandler : public TargetHook
{
public:
ObjectTargetSelectHandler(SpellObjectTargetSelectFnType _pObjectTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType);
@@ -234,7 +245,7 @@ class SpellScript : public _SpellScript
SpellObjectTargetSelectFnType pObjectTargetSelectHandlerScript;
};
- class DestinationTargetSelectHandler : public TargetHook
+ class TC_GAME_API DestinationTargetSelectHandler : public TargetHook
{
public:
DestinationTargetSelectHandler(SpellDestinationTargetSelectFnType _DestinationTargetSelectHandlerScript, uint8 _effIndex, uint16 _targetType);
@@ -470,7 +481,7 @@ enum AuraScriptHookType
#define HOOK_AURA_EFFECT_END HOOK_AURA_EFFECT_CALC_SPELLMOD + 1
#define HOOK_AURA_EFFECT_COUNT HOOK_AURA_EFFECT_END - HOOK_AURA_EFFECT_START
*/
-class AuraScript : public _SpellScript
+class TC_GAME_API AuraScript : public _SpellScript
{
// internal use classes & functions
// DO NOT OVERRIDE THESE IN SCRIPTS
@@ -493,7 +504,7 @@ class AuraScript : public _SpellScript
AURASCRIPT_FUNCTION_TYPE_DEFINES(AuraScript)
- class CheckAreaTargetHandler
+ class TC_GAME_API CheckAreaTargetHandler
{
public:
CheckAreaTargetHandler(AuraCheckAreaTargetFnType pHandlerScript);
@@ -501,7 +512,7 @@ class AuraScript : public _SpellScript
private:
AuraCheckAreaTargetFnType pHandlerScript;
};
- class AuraDispelHandler
+ class TC_GAME_API AuraDispelHandler
{
public:
AuraDispelHandler(AuraDispelFnType pHandlerScript);
@@ -509,14 +520,14 @@ class AuraScript : public _SpellScript
private:
AuraDispelFnType pHandlerScript;
};
- class EffectBase : public _SpellScript::EffectAuraNameCheck, public _SpellScript::EffectHook
+ class TC_GAME_API EffectBase : public _SpellScript::EffectAuraNameCheck, public _SpellScript::EffectHook
{
public:
EffectBase(uint8 _effIndex, uint16 _effName);
std::string ToString();
bool CheckEffect(SpellInfo const* spellInfo, uint8 effIndex) override;
};
- class EffectPeriodicHandler : public EffectBase
+ class TC_GAME_API EffectPeriodicHandler : public EffectBase
{
public:
EffectPeriodicHandler(AuraEffectPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName);
@@ -524,7 +535,7 @@ class AuraScript : public _SpellScript
private:
AuraEffectPeriodicFnType pEffectHandlerScript;
};
- class EffectUpdatePeriodicHandler : public EffectBase
+ class TC_GAME_API EffectUpdatePeriodicHandler : public EffectBase
{
public:
EffectUpdatePeriodicHandler(AuraEffectUpdatePeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName);
@@ -532,7 +543,7 @@ class AuraScript : public _SpellScript
private:
AuraEffectUpdatePeriodicFnType pEffectHandlerScript;
};
- class EffectCalcAmountHandler : public EffectBase
+ class TC_GAME_API EffectCalcAmountHandler : public EffectBase
{
public:
EffectCalcAmountHandler(AuraEffectCalcAmountFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName);
@@ -540,7 +551,7 @@ class AuraScript : public _SpellScript
private:
AuraEffectCalcAmountFnType pEffectHandlerScript;
};
- class EffectCalcPeriodicHandler : public EffectBase
+ class TC_GAME_API EffectCalcPeriodicHandler : public EffectBase
{
public:
EffectCalcPeriodicHandler(AuraEffectCalcPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName);
@@ -548,7 +559,7 @@ class AuraScript : public _SpellScript
private:
AuraEffectCalcPeriodicFnType pEffectHandlerScript;
};
- class EffectCalcSpellModHandler : public EffectBase
+ class TC_GAME_API EffectCalcSpellModHandler : public EffectBase
{
public:
EffectCalcSpellModHandler(AuraEffectCalcSpellModFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName);
@@ -556,7 +567,7 @@ class AuraScript : public _SpellScript
private:
AuraEffectCalcSpellModFnType pEffectHandlerScript;
};
- class EffectApplyHandler : public EffectBase
+ class TC_GAME_API EffectApplyHandler : public EffectBase
{
public:
EffectApplyHandler(AuraEffectApplicationModeFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName, AuraEffectHandleModes _mode);
@@ -565,7 +576,7 @@ class AuraScript : public _SpellScript
AuraEffectApplicationModeFnType pEffectHandlerScript;
AuraEffectHandleModes mode;
};
- class EffectAbsorbHandler : public EffectBase
+ class TC_GAME_API EffectAbsorbHandler : public EffectBase
{
public:
EffectAbsorbHandler(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex);
@@ -573,7 +584,7 @@ class AuraScript : public _SpellScript
private:
AuraEffectAbsorbFnType pEffectHandlerScript;
};
- class EffectManaShieldHandler : public EffectBase
+ class TC_GAME_API EffectManaShieldHandler : public EffectBase
{
public:
EffectManaShieldHandler(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex);
@@ -581,7 +592,7 @@ class AuraScript : public _SpellScript
private:
AuraEffectAbsorbFnType pEffectHandlerScript;
};
- class EffectSplitHandler : public EffectBase
+ class TC_GAME_API EffectSplitHandler : public EffectBase
{
public:
EffectSplitHandler(AuraEffectSplitFnType _pEffectHandlerScript, uint8 _effIndex);
@@ -589,7 +600,7 @@ class AuraScript : public _SpellScript
private:
AuraEffectSplitFnType pEffectHandlerScript;
};
- class CheckProcHandler
+ class TC_GAME_API CheckProcHandler
{
public:
CheckProcHandler(AuraCheckProcFnType handlerScript);
@@ -597,7 +608,7 @@ class AuraScript : public _SpellScript
private:
AuraCheckProcFnType _HandlerScript;
};
- class AuraProcHandler
+ class TC_GAME_API AuraProcHandler
{
public:
AuraProcHandler(AuraProcFnType handlerScript);
@@ -605,7 +616,7 @@ class AuraScript : public _SpellScript
private:
AuraProcFnType _HandlerScript;
};
- class EffectProcHandler : public EffectBase
+ class TC_GAME_API EffectProcHandler : public EffectBase
{
public:
EffectProcHandler(AuraEffectProcFnType effectHandlerScript, uint8 effIndex, uint16 effName);
@@ -645,7 +656,7 @@ class AuraScript : public _SpellScript
AuraApplication const* m_auraApplication;
bool m_defaultActionPrevented;
- class ScriptStateStore
+ class TC_GAME_API ScriptStateStore
{
public:
AuraApplication const* _auraApplication;
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index 499f0c9cbf0..d8df3310765 100644
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -72,6 +72,12 @@ class PlayerTextBuilder
WorldObject const* _target;
};
+CreatureTextMgr* CreatureTextMgr::instance()
+{
+ static CreatureTextMgr instance;
+ return &instance;
+}
+
void CreatureTextMgr::LoadCreatureTexts()
{
uint32 oldMSTime = getMSTime();
diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h
index 28fd98f21a8..d7953463a97 100644
--- a/src/server/game/Texts/CreatureTextMgr.h
+++ b/src/server/game/Texts/CreatureTextMgr.h
@@ -75,18 +75,14 @@ typedef std::unordered_map<uint32, CreatureTextHolder> CreatureTextMap; // a
typedef std::map<CreatureTextId, CreatureTextLocale> LocaleCreatureTextMap;
-class CreatureTextMgr
+class TC_GAME_API CreatureTextMgr
{
private:
CreatureTextMgr() { }
~CreatureTextMgr() { }
public:
- static CreatureTextMgr* instance()
- {
- static CreatureTextMgr instance;
- return &instance;
- }
+ static CreatureTextMgr* instance();
void LoadCreatureTexts();
void LoadCreatureTextLocales();
diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp
index 1cf68eec9c7..94e4427fe10 100644
--- a/src/server/game/Tickets/TicketMgr.cpp
+++ b/src/server/game/Tickets/TicketMgr.cpp
@@ -284,6 +284,12 @@ void TicketMgr::ResetTickets()
CharacterDatabase.Execute(stmt);
}
+TicketMgr* TicketMgr::instance()
+{
+ static TicketMgr instance;
+ return &instance;
+}
+
void TicketMgr::LoadTickets()
{
uint32 oldMSTime = getMSTime();
diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h
index 9cc1d20b122..ff2cd656dce 100644
--- a/src/server/game/Tickets/TicketMgr.h
+++ b/src/server/game/Tickets/TicketMgr.h
@@ -84,7 +84,7 @@ enum TicketType
TICKET_TYPE_CHARACTER_DELETED = 2,
};
-class GmTicket
+class TC_GAME_API GmTicket
{
public:
GmTicket();
@@ -181,18 +181,14 @@ private:
};
typedef std::map<uint32, GmTicket*> GmTicketList;
-class TicketMgr
+class TC_GAME_API TicketMgr
{
private:
TicketMgr();
~TicketMgr();
public:
- static TicketMgr* instance()
- {
- static TicketMgr instance;
- return &instance;
- }
+ static TicketMgr* instance();
void LoadTickets();
void LoadSurveys();
diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.h b/src/server/game/Tools/CharacterDatabaseCleaner.h
index ecbd6d0a790..f1e6900a6bb 100644
--- a/src/server/game/Tools/CharacterDatabaseCleaner.h
+++ b/src/server/game/Tools/CharacterDatabaseCleaner.h
@@ -30,20 +30,20 @@ namespace CharacterDatabaseCleaner
CLEANING_FLAG_QUESTSTATUS = 0x10
};
- void CleanDatabase();
+ TC_GAME_API void CleanDatabase();
- void CheckUnique(const char* column, const char* table, bool (*check)(uint32));
+ TC_GAME_API void CheckUnique(const char* column, const char* table, bool (*check)(uint32));
- bool AchievementProgressCheck(uint32 criteria);
- bool SkillCheck(uint32 skill);
- bool SpellCheck(uint32 spell_id);
- bool TalentCheck(uint32 talent_id);
+ TC_GAME_API bool AchievementProgressCheck(uint32 criteria);
+ TC_GAME_API bool SkillCheck(uint32 skill);
+ TC_GAME_API bool SpellCheck(uint32 spell_id);
+ TC_GAME_API bool TalentCheck(uint32 talent_id);
- void CleanCharacterAchievementProgress();
- void CleanCharacterSkills();
- void CleanCharacterSpell();
- void CleanCharacterTalent();
- void CleanCharacterQuestStatus();
+ TC_GAME_API void CleanCharacterAchievementProgress();
+ TC_GAME_API void CleanCharacterSkills();
+ TC_GAME_API void CleanCharacterSpell();
+ TC_GAME_API void CleanCharacterTalent();
+ TC_GAME_API void CleanCharacterQuestStatus();
}
#endif
diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp
index 113fea2ea35..4c5ac1dab5e 100644
--- a/src/server/game/Tools/PlayerDump.cpp
+++ b/src/server/game/Tools/PlayerDump.cpp
@@ -315,10 +315,10 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, ObjectGuid::LowType guid, ch
break;
case DTT_CHARACTER:
{
- if (result->GetFieldCount() <= 68) // avoid crashes on next check
+ if (result->GetFieldCount() <= 73) // avoid crashes on next check
TC_LOG_FATAL("misc", "PlayerDumpWriter::DumpTable - Trying to access non-existing or wrong positioned field (`deleteInfos_Account`) in `characters` table.");
- if (result->Fetch()[68].GetUInt32()) // characters.deleteInfos_Account - if filled error
+ if (result->Fetch()[73].GetUInt32()) // characters.deleteInfos_Account - if filled error
return false;
break;
}
@@ -549,11 +549,11 @@ DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, s
ROLLBACK(DUMP_FILE_BROKEN);
const char null[5] = "NULL";
- if (!ChangeNth(line, 69, null)) // characters.deleteInfos_Account
+ if (!ChangeNth(line, 74, null)) // characters.deleteInfos_Account
ROLLBACK(DUMP_FILE_BROKEN);
- if (!ChangeNth(line, 70, null)) // characters.deleteInfos_Name
+ if (!ChangeNth(line, 75, null)) // characters.deleteInfos_Name
ROLLBACK(DUMP_FILE_BROKEN);
- if (!ChangeNth(line, 71, null)) // characters.deleteDate
+ if (!ChangeNth(line, 76, null)) // characters.deleteDate
ROLLBACK(DUMP_FILE_BROKEN);
break;
}
diff --git a/src/server/game/Tools/PlayerDump.h b/src/server/game/Tools/PlayerDump.h
index 95d6ed2d04b..12cafc6ad48 100644
--- a/src/server/game/Tools/PlayerDump.h
+++ b/src/server/game/Tools/PlayerDump.h
@@ -62,7 +62,7 @@ enum DumpReturn
DUMP_CHARACTER_DELETED
};
-class PlayerDump
+class TC_GAME_API PlayerDump
{
public:
typedef std::set<ObjectGuid::LowType> DumpGuidSet;
@@ -72,7 +72,7 @@ class PlayerDump
PlayerDump() { }
};
-class PlayerDumpWriter : public PlayerDump
+class TC_GAME_API PlayerDumpWriter : public PlayerDump
{
public:
PlayerDumpWriter() { }
@@ -90,7 +90,7 @@ class PlayerDumpWriter : public PlayerDump
DumpGuidSet items;
};
-class PlayerDumpReader : public PlayerDump
+class TC_GAME_API PlayerDumpReader : public PlayerDump
{
public:
PlayerDumpReader() { }
diff --git a/src/server/game/Warden/Warden.h b/src/server/game/Warden/Warden.h
index 35ee18d4c02..b0aa496cbe8 100644
--- a/src/server/game/Warden/Warden.h
+++ b/src/server/game/Warden/Warden.h
@@ -92,7 +92,7 @@ struct ClientWardenModule
class WorldSession;
-class Warden
+class TC_GAME_API Warden
{
friend class WardenWin;
friend class WardenMac;
diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp
index 5c4b0fc05b7..13ddae012fe 100644
--- a/src/server/game/Warden/WardenCheckMgr.cpp
+++ b/src/server/game/Warden/WardenCheckMgr.cpp
@@ -189,6 +189,12 @@ void WardenCheckMgr::LoadWardenOverrides()
TC_LOG_INFO("server.loading", ">> Loaded %u warden action overrides.", count);
}
+WardenCheckMgr* WardenCheckMgr::instance()
+{
+ static WardenCheckMgr instance;
+ return &instance;
+}
+
WardenCheck* WardenCheckMgr::GetWardenDataById(uint16 Id)
{
if (Id < CheckStore.size())
diff --git a/src/server/game/Warden/WardenCheckMgr.h b/src/server/game/Warden/WardenCheckMgr.h
index 4107ccc3aff..7349fd5b589 100644
--- a/src/server/game/Warden/WardenCheckMgr.h
+++ b/src/server/game/Warden/WardenCheckMgr.h
@@ -48,18 +48,14 @@ struct WardenCheckResult
BigNumber Result; // MEM_CHECK
};
-class WardenCheckMgr
+class TC_GAME_API WardenCheckMgr
{
private:
WardenCheckMgr();
~WardenCheckMgr();
public:
- static WardenCheckMgr* instance()
- {
- static WardenCheckMgr instance;
- return &instance;
- }
+ static WardenCheckMgr* instance();
// We have a linear key without any gaps, so we use vector for fast access
typedef std::vector<WardenCheck*> CheckContainer;
diff --git a/src/server/game/Warden/WardenMac.h b/src/server/game/Warden/WardenMac.h
index 26a2d86524e..c7435502f63 100644
--- a/src/server/game/Warden/WardenMac.h
+++ b/src/server/game/Warden/WardenMac.h
@@ -28,7 +28,7 @@
class WorldSession;
class Warden;
-class WardenMac : public Warden
+class TC_GAME_API WardenMac : public Warden
{
public:
WardenMac();
diff --git a/src/server/game/Warden/WardenWin.h b/src/server/game/Warden/WardenWin.h
index 4bf1af77c47..b3e6d7c586c 100644
--- a/src/server/game/Warden/WardenWin.h
+++ b/src/server/game/Warden/WardenWin.h
@@ -62,7 +62,7 @@ struct WardenInitModuleRequest
class WorldSession;
class Warden;
-class WardenWin : public Warden
+class TC_GAME_API WardenWin : public Warden
{
public:
WardenWin();
diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp
index f774916f4a5..7ef16e32031 100644
--- a/src/server/game/Weather/Weather.cpp
+++ b/src/server/game/Weather/Weather.cpp
@@ -152,7 +152,7 @@ bool Weather::ReGenerate()
uint32 chance2 = chance1+ m_weatherChances->data[season].snowChance;
uint32 chance3 = chance2+ m_weatherChances->data[season].stormChance;
- uint32 rnd = urand(0, 99);
+ uint32 rnd = urand(1, 100);
if (rnd <= chance1)
m_type = WEATHER_TYPE_RAIN;
else if (rnd <= chance2)
diff --git a/src/server/game/Weather/Weather.h b/src/server/game/Weather/Weather.h
index c1f029d6264..6a770615308 100644
--- a/src/server/game/Weather/Weather.h
+++ b/src/server/game/Weather/Weather.h
@@ -62,7 +62,7 @@ enum WeatherState
};
/// Weather for one zone
-class Weather
+class TC_GAME_API Weather
{
public:
diff --git a/src/server/game/Weather/WeatherMgr.h b/src/server/game/Weather/WeatherMgr.h
index 97c541fd3c0..e3dd4ac9ec4 100644
--- a/src/server/game/Weather/WeatherMgr.h
+++ b/src/server/game/Weather/WeatherMgr.h
@@ -30,15 +30,15 @@ class Player;
namespace WeatherMgr
{
- void LoadWeatherData();
+ TC_GAME_API void LoadWeatherData();
- Weather* FindWeather(uint32 id);
- Weather* AddWeather(uint32 zone_id);
- void RemoveWeather(uint32 zone_id);
+ TC_GAME_API Weather* FindWeather(uint32 id);
+ TC_GAME_API Weather* AddWeather(uint32 zone_id);
+ TC_GAME_API void RemoveWeather(uint32 zone_id);
- void SendFineWeatherUpdateToPlayer(Player* player);
+ TC_GAME_API void SendFineWeatherUpdateToPlayer(Player* player);
- void Update(uint32 diff);
+ TC_GAME_API void Update(uint32 diff);
}
#endif
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 289a4d47666..19abfbe3152 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -38,6 +38,7 @@
#include "DatabaseEnv.h"
#include "DisableMgr.h"
#include "GameEventMgr.h"
+#include "GameObjectModel.h"
#include "GridNotifiersImpl.h"
#include "GroupMgr.h"
#include "GuildMgr.h"
@@ -53,9 +54,11 @@
#include "PoolMgr.h"
#include "GitRevision.h"
#include "ScriptMgr.h"
+#include "ScriptReloadMgr.h"
#include "SkillDiscovery.h"
#include "SkillExtraItems.h"
#include "SmartAI.h"
+#include "Metric.h"
#include "TicketMgr.h"
#include "TransportMgr.h"
#include "Unit.h"
@@ -64,19 +67,20 @@
#include "WaypointMovementGenerator.h"
#include "WeatherMgr.h"
#include "WorldSession.h"
+#include "M2Stores.h"
+TC_GAME_API std::atomic<bool> World::m_stopEvent(false);
+TC_GAME_API uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE;
-std::atomic<bool> World::m_stopEvent(false);
-uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE;
-std::atomic<uint32> World::m_worldLoopCounter(0);
+TC_GAME_API std::atomic<uint32> World::m_worldLoopCounter(0);
-float World::m_MaxVisibleDistanceOnContinents = DEFAULT_VISIBILITY_DISTANCE;
-float World::m_MaxVisibleDistanceInInstances = DEFAULT_VISIBILITY_INSTANCE;
-float World::m_MaxVisibleDistanceInBGArenas = DEFAULT_VISIBILITY_BGARENAS;
+TC_GAME_API float World::m_MaxVisibleDistanceOnContinents = DEFAULT_VISIBILITY_DISTANCE;
+TC_GAME_API float World::m_MaxVisibleDistanceInInstances = DEFAULT_VISIBILITY_INSTANCE;
+TC_GAME_API float World::m_MaxVisibleDistanceInBGArenas = DEFAULT_VISIBILITY_BGARENAS;
-int32 World::m_visibility_notify_periodOnContinents = DEFAULT_VISIBILITY_NOTIFY_PERIOD;
-int32 World::m_visibility_notify_periodInInstances = DEFAULT_VISIBILITY_NOTIFY_PERIOD;
-int32 World::m_visibility_notify_periodInBGArenas = DEFAULT_VISIBILITY_NOTIFY_PERIOD;
+TC_GAME_API int32 World::m_visibility_notify_periodOnContinents = DEFAULT_VISIBILITY_NOTIFY_PERIOD;
+TC_GAME_API int32 World::m_visibility_notify_periodInInstances = DEFAULT_VISIBILITY_NOTIFY_PERIOD;
+TC_GAME_API int32 World::m_visibility_notify_periodInBGArenas = DEFAULT_VISIBILITY_NOTIFY_PERIOD;
/// World constructor
World::World()
@@ -139,6 +143,12 @@ World::~World()
/// @todo free addSessQueue
}
+World* World::instance()
+{
+ static World instance;
+ return &instance;
+}
+
/// Find a player in a specified zone
Player* World::FindPlayerInZone(uint32 zone)
{
@@ -387,6 +397,7 @@ void World::LoadConfigSettings(bool reload)
return;
}
sLog->LoadFromConfig();
+ sMetric->LoadFromConfigs();
}
///- Read the player limit and the Message of the day from the config file
@@ -584,7 +595,10 @@ void World::LoadConfigSettings(bool reload)
}
m_int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Channel", 1);
m_int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Whisper", 1);
+ m_int_configs[CONFIG_CHAT_EMOTE_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Emote", 1);
m_int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Say", 1);
+ m_int_configs[CONFIG_CHAT_YELL_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Yell", 1);
+ m_int_configs[CONFIG_PARTY_LEVEL_REQ] = sConfigMgr->GetIntDefault("PartyLevelReq", 1);
m_int_configs[CONFIG_TRADE_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Trade", 1);
m_int_configs[CONFIG_TICKET_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Ticket", 1);
m_int_configs[CONFIG_AUCTION_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Auction", 1);
@@ -592,6 +606,18 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_PRESERVE_CUSTOM_CHANNELS] = sConfigMgr->GetBoolDefault("PreserveCustomChannels", false);
m_int_configs[CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION] = sConfigMgr->GetIntDefault("PreserveCustomChannelDuration", 14);
m_bool_configs[CONFIG_GRID_UNLOAD] = sConfigMgr->GetBoolDefault("GridUnload", true);
+ m_bool_configs[CONFIG_BASEMAP_LOAD_GRIDS] = sConfigMgr->GetBoolDefault("BaseMapLoadAllGrids", false);
+ if (m_bool_configs[CONFIG_BASEMAP_LOAD_GRIDS] && m_bool_configs[CONFIG_GRID_UNLOAD])
+ {
+ TC_LOG_ERROR("server.loading", "BaseMapLoadAllGrids enabled, but GridUnload also enabled. GridUnload must be disabled to enable base map pre-loading. Base map pre-loading disabled");
+ m_bool_configs[CONFIG_BASEMAP_LOAD_GRIDS] = false;
+ }
+ m_bool_configs[CONFIG_INSTANCEMAP_LOAD_GRIDS] = sConfigMgr->GetBoolDefault("InstanceMapLoadAllGrids", false);
+ if (m_bool_configs[CONFIG_INSTANCEMAP_LOAD_GRIDS] && m_bool_configs[CONFIG_GRID_UNLOAD])
+ {
+ TC_LOG_ERROR("server.loading", "InstanceMapLoadAllGrids enabled, but GridUnload also enabled. GridUnload must be disabled to enable instance map pre-loading. Instance map pre-loading disabled");
+ m_bool_configs[CONFIG_INSTANCEMAP_LOAD_GRIDS] = false;
+ }
m_int_configs[CONFIG_INTERVAL_SAVE] = sConfigMgr->GetIntDefault("PlayerSaveInterval", 15 * MINUTE * IN_MILLISECONDS);
m_int_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfigMgr->GetIntDefault("DisconnectToleranceInterval", 0);
m_bool_configs[CONFIG_STATS_SAVE_ONLY_ON_LOGOUT] = sConfigMgr->GetBoolDefault("PlayerSave.Stats.SaveOnlyOnLogout", true);
@@ -638,9 +664,8 @@ void World::LoadConfigSettings(bool reload)
m_float_configs[CONFIG_GROUP_XP_DISTANCE] = sConfigMgr->GetFloatDefault("MaxGroupXPDistance", 74.0f);
m_float_configs[CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE] = sConfigMgr->GetFloatDefault("MaxRecruitAFriendBonusDistance", 100.0f);
- /// @todo Add MonsterSight and GuarderSight (with meaning) in worldserver.conf or put them as define
+ /// @todo Add MonsterSight (with meaning) in worldserver.conf or put them as define
m_float_configs[CONFIG_SIGHT_MONSTER] = sConfigMgr->GetFloatDefault("MonsterSight", 50.0f);
- m_float_configs[CONFIG_SIGHT_GUARDER] = sConfigMgr->GetFloatDefault("GuarderSight", 50.0f);
if (reload)
{
@@ -879,6 +904,7 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_ALLOW_GM_GROUP] = sConfigMgr->GetBoolDefault("GM.AllowInvite", false);
m_bool_configs[CONFIG_GM_LOWER_SECURITY] = sConfigMgr->GetBoolDefault("GM.LowerSecurity", false);
m_float_configs[CONFIG_CHANCE_OF_GM_SURVEY] = sConfigMgr->GetFloatDefault("GM.TicketSystem.ChanceOfGMSurvey", 50.0f);
+ m_int_configs[CONFIG_FORCE_SHUTDOWN_THRESHOLD] = sConfigMgr->GetIntDefault("GM.ForceShutdownThreshold", 30);
m_int_configs[CONFIG_GROUP_VISIBILITY] = sConfigMgr->GetIntDefault("Visibility.GroupMode", 1);
@@ -1003,7 +1029,7 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_DETECT_POS_COLLISION] = sConfigMgr->GetBoolDefault("DetectPosCollision", true);
m_bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = sConfigMgr->GetBoolDefault("Channel.RestrictedLfg", true);
- m_bool_configs[CONFIG_TALENTS_INSPECTING] = sConfigMgr->GetBoolDefault("TalentsInspecting", true);
+ m_int_configs[CONFIG_TALENTS_INSPECTING] = sConfigMgr->GetIntDefault("TalentsInspecting", 1);
m_bool_configs[CONFIG_CHAT_FAKE_MESSAGE_PREVENTING] = sConfigMgr->GetBoolDefault("ChatFakeMessagePreventing", false);
m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY] = sConfigMgr->GetIntDefault("ChatStrictLinkChecking.Severity", 0);
m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_KICK] = sConfigMgr->GetIntDefault("ChatStrictLinkChecking.Kick", 0);
@@ -1037,6 +1063,17 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false);
m_bool_configs[CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE] = sConfigMgr->GetBoolDefault("Battleground.StoreStatistics.Enable", false);
m_bool_configs[CONFIG_BATTLEGROUND_TRACK_DESERTERS] = sConfigMgr->GetBoolDefault("Battleground.TrackDeserters.Enable", false);
+ m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = sConfigMgr->GetIntDefault("Battleground.ReportAFK", 3);
+ if (m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] < 1)
+ {
+ TC_LOG_ERROR("server.loading", "Battleground.ReportAFK (%d) must be >0. Using 3 instead.", m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]);
+ m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = 3;
+ }
+ if (m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] > 9)
+ {
+ TC_LOG_ERROR("server.loading", "Battleground.ReportAFK (%d) must be <10. Using 3 instead.", m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]);
+ m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = 3;
+ }
m_int_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfigMgr->GetIntDefault ("Battleground.InvitationType", 0);
m_int_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfigMgr->GetIntDefault ("Battleground.PrematureFinishTimer", 5 * MINUTE * IN_MILLISECONDS);
m_int_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfigMgr->GetIntDefault ("Battleground.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS);
@@ -1047,7 +1084,6 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfigMgr->GetBoolDefault("Arena.AutoDistributePoints", false);
m_int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfigMgr->GetIntDefault ("Arena.AutoDistributeInterval", 7);
m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetBoolDefault("Arena.QueueAnnouncer.Enable", false);
- m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetBoolDefault("Arena.QueueAnnouncer.PlayerOnly", false);
m_int_configs[CONFIG_ARENA_SEASON_ID] = sConfigMgr->GetIntDefault ("Arena.ArenaSeason.ID", 1);
m_int_configs[CONFIG_ARENA_START_RATING] = sConfigMgr->GetIntDefault ("Arena.ArenaStartRating", 0);
m_int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = sConfigMgr->GetIntDefault ("Arena.ArenaStartPersonalRating", 1000);
@@ -1062,6 +1098,7 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfigMgr->GetBoolDefault("OffhandCheckAtSpellUnlearn", true);
m_int_configs[CONFIG_CREATURE_PICKPOCKET_REFILL] = sConfigMgr->GetIntDefault("Creature.PickPocketRefillDelay", 10 * MINUTE);
+ m_int_configs[CONFIG_CREATURE_STOP_FOR_PLAYER] = sConfigMgr->GetIntDefault("Creature.MovingStopTimeForPlayer", 3 * MINUTE * IN_MILLISECONDS);
if (int32 clientCacheId = sConfigMgr->GetIntDefault("ClientCacheVersion", 0))
{
@@ -1300,13 +1337,22 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA] = sConfigMgr->GetBoolDefault("Calculate.Creature.Zone.Area.Data", false);
m_bool_configs[CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA] = sConfigMgr->GetBoolDefault("Calculate.Gameoject.Zone.Area.Data", false);
+ // HotSwap
+ m_bool_configs[CONFIG_HOTSWAP_ENABLED] = sConfigMgr->GetBoolDefault("HotSwap.Enabled", true);
+ m_bool_configs[CONFIG_HOTSWAP_RECOMPILER_ENABLED] = sConfigMgr->GetBoolDefault("HotSwap.EnableReCompiler", true);
+ m_bool_configs[CONFIG_HOTSWAP_EARLY_TERMINATION_ENABLED] = sConfigMgr->GetBoolDefault("HotSwap.EnableEarlyTermination", true);
+ m_bool_configs[CONFIG_HOTSWAP_BUILD_FILE_RECREATION_ENABLED] = sConfigMgr->GetBoolDefault("HotSwap.EnableBuildFileRecreation", true);
+ m_bool_configs[CONFIG_HOTSWAP_INSTALL_ENABLED] = sConfigMgr->GetBoolDefault("HotSwap.EnableInstall", true);
+ m_bool_configs[CONFIG_HOTSWAP_PREFIX_CORRECTION_ENABLED] = sConfigMgr->GetBoolDefault("HotSwap.EnablePrefixCorrection", true);
+
+ // prevent character rename on character customization
+ m_bool_configs[CONFIG_PREVENT_RENAME_CUSTOMIZATION] = sConfigMgr->GetBoolDefault("PreventRenameCharacterOnCustomization", false);
+
// call ScriptMgr if we're reloading the configuration
if (reload)
sScriptMgr->OnConfigLoad(reload);
}
-extern void LoadGameObjectModelList(std::string const& dataPath);
-
/// Initialize the World
void World::SetInitialWorldSettings()
{
@@ -1369,13 +1415,16 @@ void World::SetInitialWorldSettings()
uint32 server_type = IsFFAPvPRealm() ? uint32(REALM_TYPE_PVP) : getIntConfig(CONFIG_GAME_TYPE);
uint32 realm_zone = getIntConfig(CONFIG_REALM_ZONE);
- LoginDatabase.PExecute("UPDATE realmlist SET icon = %u, timezone = %u WHERE id = '%d'", server_type, realm_zone, realmID); // One-time query
+ LoginDatabase.PExecute("UPDATE realmlist SET icon = %u, timezone = %u WHERE id = '%d'", server_type, realm_zone, realm.Id.Realm); // One-time query
///- Load the DBC files
TC_LOG_INFO("server.loading", "Initialize data stores...");
LoadDBCStores(m_dataPath);
DetectDBCLang();
+ // Load cinematic cameras
+ LoadM2Cameras(m_dataPath);
+
std::vector<uint32> mapIds;
for (uint32 mapId = 0; mapId < sMapStore.GetNumRows(); mapId++)
if (sMapStore.LookupEntry(mapId))
@@ -1790,7 +1839,7 @@ void World::SetInitialWorldSettings()
m_startTime = m_gameTime;
LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES(%u, %u, 0, '%s')",
- realmID, uint32(m_startTime), GitRevision::GetFullVersion()); // One-time query
+ realm.Id.Realm, uint32(m_startTime), GitRevision::GetFullVersion()); // One-time query
m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS);
m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILLISECONDS);
@@ -1809,6 +1858,8 @@ void World::SetInitialWorldSettings()
m_timers[WUPDATE_PINGDB].SetInterval(getIntConfig(CONFIG_DB_PING_INTERVAL)*MINUTE*IN_MILLISECONDS); // Mysql ping time in minutes
+ m_timers[WUPDATE_CHECK_FILECHANGES].SetInterval(500);
+
//to set mailtimer to return mails every day between 4 and 5 am
//mailtimer is increased when updating auctions
//one second is 1000 -(tested on win system)
@@ -1888,10 +1939,25 @@ void World::SetInitialWorldSettings()
LoadCharacterInfoStore();
+ // Preload all cells, if required for the base maps
+ if (sWorld->getBoolConfig(CONFIG_BASEMAP_LOAD_GRIDS))
+ {
+ sMapMgr->DoForAllMaps([](Map* map)
+ {
+ if (!map->Instanceable())
+ {
+ TC_LOG_INFO("server.loading", "Pre-loading base map data for map %u", map->GetId());
+ map->LoadAllCells();
+ }
+ });
+ }
+
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
TC_LOG_INFO("server.worldserver", "World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000));
+ TC_METRIC_EVENT("events", "World initialized", "World initialized in " + std::to_string(startupDuration / 60000) + " minutes " + std::to_string((startupDuration % 60000) / 1000) + " seconds");
+
if (uint32 realmId = sConfigMgr->GetIntDefault("RealmID", 0)) // 0 reserved for auth
sLog->SetRealmId(realmId);
}
@@ -2079,6 +2145,13 @@ void World::Update(uint32 diff)
m_timers[WUPDATE_AHBOT].Reset();
}
+ /// <li> Handle file changes
+ if (m_timers[WUPDATE_CHECK_FILECHANGES].Passed())
+ {
+ sScriptReloadMgr->Update();
+ m_timers[WUPDATE_CHECK_FILECHANGES].Reset();
+ }
+
/// <li> Handle session updates when the timer has passed
ResetTimeDiffRecord();
UpdateSessions(diff);
@@ -2103,7 +2176,7 @@ void World::Update(uint32 diff)
stmt->setUInt32(0, tmpDiff);
stmt->setUInt16(1, uint16(maxOnlinePlayers));
- stmt->setUInt32(2, realmID);
+ stmt->setUInt32(2, realm.Id.Realm);
stmt->setUInt32(3, uint32(m_startTime));
LoginDatabase.Execute(stmt);
@@ -2199,6 +2272,10 @@ void World::Update(uint32 diff)
ProcessCliCommands();
sScriptMgr->OnWorldUpdate(diff);
+
+ // Stats logger update
+ sMetric->Update();
+ TC_METRIC_VALUE("update_time_diff", diff);
}
void World::ForceGameEventUpdate()
@@ -2824,16 +2901,20 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount)
uint32 accountId = fields[0].GetUInt32();
uint8 charCount = uint8(fields[1].GetUInt64());
+ SQLTransaction trans = LoginDatabase.BeginTransaction();
+
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM);
stmt->setUInt32(0, accountId);
- stmt->setUInt32(1, realmID);
- LoginDatabase.Execute(stmt);
+ stmt->setUInt32(1, realm.Id.Realm);
+ trans->Append(stmt);
stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_REALM_CHARACTERS);
stmt->setUInt8(0, charCount);
stmt->setUInt32(1, accountId);
- stmt->setUInt32(2, realmID);
- LoginDatabase.Execute(stmt);
+ stmt->setUInt32(2, realm.Id.Realm);
+ trans->Append(stmt);
+
+ LoginDatabase.CommitTransaction(trans);
}
}
@@ -2960,7 +3041,7 @@ void World::ResetDailyQuests()
void World::LoadDBAllowedSecurityLevel()
{
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL);
- stmt->setInt32(0, int32(realmID));
+ stmt->setInt32(0, int32(realm.Id.Realm));
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (result)
@@ -3290,3 +3371,4 @@ void World::RemoveOldCorpses()
m_timers[WUPDATE_CORPSES].SetCurrent(m_timers[WUPDATE_CORPSES].GetInterval());
}
+Realm realm;
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index 00b244c9efb..5850063bdc8 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -28,7 +28,8 @@
#include "Timer.h"
#include "SharedDefines.h"
#include "QueryResult.h"
-#include "Callback.h"
+#include "QueryCallback.h"
+#include "Realm/Realm.h"
#include <atomic>
#include <map>
@@ -55,7 +56,8 @@ enum ServerMessageType
enum ShutdownMask
{
SHUTDOWN_MASK_RESTART = 1,
- SHUTDOWN_MASK_IDLE = 2
+ SHUTDOWN_MASK_IDLE = 2,
+ SHUTDOWN_MASK_FORCE = 4
};
enum ShutdownExitCode
@@ -80,6 +82,7 @@ enum WorldTimers
WUPDATE_DELETECHARS,
WUPDATE_AHBOT,
WUPDATE_PINGDB,
+ WUPDATE_CHECK_FILECHANGES,
WUPDATE_COUNT
};
@@ -113,7 +116,6 @@ enum WorldBoolConfigs
CONFIG_QUEST_IGNORE_RAID,
CONFIG_DETECT_POS_COLLISION,
CONFIG_RESTRICTED_LFG_CHANNEL,
- CONFIG_TALENTS_INSPECTING,
CONFIG_CHAT_FAKE_MESSAGE_PREVENTING,
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP,
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE,
@@ -129,7 +131,6 @@ enum WorldBoolConfigs
CONFIG_BG_XP_FOR_KILL,
CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS,
CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE,
- CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY,
CONFIG_ARENA_SEASON_IN_PROGRESS,
CONFIG_ARENA_LOG_EXTENDED_INFO,
CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN,
@@ -166,6 +167,15 @@ enum WorldBoolConfigs
CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA,
CONFIG_RESET_DUEL_COOLDOWNS,
CONFIG_RESET_DUEL_HEALTH_MANA,
+ CONFIG_BASEMAP_LOAD_GRIDS,
+ CONFIG_INSTANCEMAP_LOAD_GRIDS,
+ CONFIG_HOTSWAP_ENABLED,
+ CONFIG_HOTSWAP_RECOMPILER_ENABLED,
+ CONFIG_HOTSWAP_EARLY_TERMINATION_ENABLED,
+ CONFIG_HOTSWAP_BUILD_FILE_RECREATION_ENABLED,
+ CONFIG_HOTSWAP_INSTALL_ENABLED,
+ CONFIG_HOTSWAP_PREFIX_CORRECTION_ENABLED,
+ CONFIG_PREVENT_RENAME_CUSTOMIZATION,
BOOL_CONFIG_VALUE_COUNT
};
@@ -174,7 +184,6 @@ enum WorldFloatConfigs
CONFIG_GROUP_XP_DISTANCE = 0,
CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE,
CONFIG_SIGHT_MONSTER,
- CONFIG_SIGHT_GUARDER,
CONFIG_LISTEN_RANGE_SAY,
CONFIG_LISTEN_RANGE_TEXTEMOTE,
CONFIG_LISTEN_RANGE_YELL,
@@ -244,6 +253,7 @@ enum WorldIntConfigs
CONFIG_GM_LEVEL_IN_GM_LIST,
CONFIG_GM_LEVEL_IN_WHO_LIST,
CONFIG_START_GM_LEVEL,
+ CONFIG_FORCE_SHUTDOWN_THRESHOLD,
CONFIG_GROUP_VISIBILITY,
CONFIG_MAIL_DELIVERY_DELAY,
CONFIG_UPTIME_UPDATE,
@@ -271,7 +281,10 @@ enum WorldIntConfigs
CONFIG_CHAT_STRICT_LINK_CHECKING_KICK,
CONFIG_CHAT_CHANNEL_LEVEL_REQ,
CONFIG_CHAT_WHISPER_LEVEL_REQ,
+ CONFIG_CHAT_EMOTE_LEVEL_REQ,
CONFIG_CHAT_SAY_LEVEL_REQ,
+ CONFIG_CHAT_YELL_LEVEL_REQ,
+ CONFIG_PARTY_LEVEL_REQ,
CONFIG_TRADE_LEVEL_REQ,
CONFIG_TICKET_LEVEL_REQ,
CONFIG_AUCTION_LEVEL_REQ,
@@ -287,6 +300,7 @@ enum WorldIntConfigs
CONFIG_BATTLEGROUND_INVITATION_TYPE,
CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER,
CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH,
+ CONFIG_BATTLEGROUND_REPORT_AFK,
CONFIG_ARENA_MAX_RATING_DIFFERENCE,
CONFIG_ARENA_RATING_DISCARD_TIMER,
CONFIG_ARENA_RATED_UPDATE_TIMER,
@@ -349,6 +363,7 @@ enum WorldIntConfigs
CONFIG_BG_REWARD_LOSER_HONOR_LAST,
CONFIG_BIRTHDAY_TIME,
CONFIG_CREATURE_PICKPOCKET_REFILL,
+ CONFIG_CREATURE_STOP_FOR_PLAYER,
CONFIG_AHBOT_UPDATE_INTERVAL,
CONFIG_CHARTER_COST_GUILD,
CONFIG_CHARTER_COST_ARENA_2v2,
@@ -358,6 +373,7 @@ enum WorldIntConfigs
CONFIG_NO_GRAY_AGGRO_BELOW,
CONFIG_AUCTION_GETALL_DELAY,
CONFIG_AUCTION_SEARCH_DELAY,
+ CONFIG_TALENTS_INSPECTING,
INT_CONFIG_VALUE_COUNT
};
@@ -446,18 +462,6 @@ enum BillingPlanFlags
SESSION_ENABLE_CAIS = 0x80
};
-/// Type of server, this is values from second column of Cfg_Configs.dbc
-enum RealmType
-{
- REALM_TYPE_NORMAL = 0,
- REALM_TYPE_PVP = 1,
- REALM_TYPE_NORMAL2 = 4,
- REALM_TYPE_RP = 6,
- REALM_TYPE_RPPVP = 8,
- REALM_TYPE_FFA_PVP = 16 // custom, free for all pvp mode like arena PvP in all zones except rest activated places and sanctuaries
- // replaced by REALM_PVP in realm list
-};
-
enum RealmZone
{
REALM_ZONE_UNKNOWN = 0, // any language
@@ -546,14 +550,10 @@ struct CharacterInfo
};
/// The World
-class World
+class TC_GAME_API World
{
public:
- static World* instance()
- {
- static World instance;
- return &instance;
- }
+ static World* instance();
static std::atomic<uint32> m_worldLoopCounter;
@@ -882,8 +882,9 @@ class World
std::deque<std::future<PreparedQueryResult>> m_realmCharCallbacks;
};
-extern uint32 realmID;
+TC_GAME_API extern Realm realm;
#define sWorld World::instance()
+
#endif
/// @}
diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt
index a15b6f8ad07..31ba073e77d 100644
--- a/src/server/scripts/CMakeLists.txt
+++ b/src/server/scripts/CMakeLists.txt
@@ -8,138 +8,232 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# Enable precompiled headers when using the GCC compiler.
+message("")
-if (USE_SCRIPTPCH)
- set(scripts_STAT_PCH_HDR PrecompiledHeaders/ScriptPCH.h)
- set(scripts_STAT_PCH_SRC PrecompiledHeaders/ScriptPCH.cpp)
-endif ()
+# Make the script module list available in the current scope
+GetScriptModuleList(SCRIPT_MODULE_LIST)
+
+# Make the native install offset available in this scope
+GetInstallOffset(INSTALL_OFFSET)
-message(STATUS "SCRIPT PREPARATIONS")
-include(Spells/CMakeLists.txt)
-
-include(Commands/CMakeLists.txt)
-
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- ../game/AI/ScriptedAI/ScriptedEscortAI.cpp
- ../game/AI/ScriptedAI/ScriptedCreature.cpp
- ../game/AI/ScriptedAI/ScriptedFollowerAI.cpp
- ../game/Maps/AreaBoundary.cpp
-)
-
-if(SCRIPTS)
- include(Custom/CMakeLists.txt)
- include(World/CMakeLists.txt)
- include(OutdoorPvP/CMakeLists.txt)
- include(EasternKingdoms/CMakeLists.txt)
- include(Kalimdor/CMakeLists.txt)
- include(Outland/CMakeLists.txt)
- include(Northrend/CMakeLists.txt)
- include(Events/CMakeLists.txt)
- include(Pet/CMakeLists.txt)
+# Sets the SCRIPTS_${SCRIPT_MODULE} variables
+# when using predefined templates for script building
+# like dynamic, static, minimal-static...
+# Sets SCRIPTS_DEFAULT_LINKAGE
+if (SCRIPTS MATCHES "dynamic")
+ set(SCRIPTS_DEFAULT_LINKAGE "dynamic")
+elseif(SCRIPTS MATCHES "static")
+ set(SCRIPTS_DEFAULT_LINKAGE "static")
+else()
+ set(SCRIPTS_DEFAULT_LINKAGE "disabled")
+endif()
+# Sets SCRIPTS_USE_WHITELIST
+# Sets SCRIPTS_WHITELIST
+if (SCRIPTS MATCHES "minimal")
+ set(SCRIPTS_USE_WHITELIST ON)
+ # Whitelist which is used when minimal is selected
+ list(APPEND SCRIPTS_WHITELIST Commands Spells)
endif()
-message(STATUS "SCRIPT PREPARATION COMPLETE")
-message("")
+# Set the SCRIPTS_${SCRIPT_MODULE} variables from the
+# variables set above
+foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
+ ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE)
+ if (${SCRIPT_MODULE_VARIABLE} STREQUAL "default")
+ if(SCRIPTS_USE_WHITELIST)
+ list(FIND SCRIPTS_WHITELIST "${SCRIPT_MODULE}" INDEX)
+ if (${INDEX} GREATER -1)
+ set(${SCRIPT_MODULE_VARIABLE} ${SCRIPTS_DEFAULT_LINKAGE})
+ else()
+ set(${SCRIPT_MODULE_VARIABLE} "disabled")
+ endif()
+ else()
+ set(${SCRIPT_MODULE_VARIABLE} ${SCRIPTS_DEFAULT_LINKAGE})
+ endif()
+ endif()
+ # Build the Graph values
+ if (${SCRIPT_MODULE_VARIABLE} MATCHES "dynamic")
+ GetProjectNameOfScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PROJECT_NAME)
+ GetNativeSharedLibraryName(${SCRIPT_MODULE_PROJECT_NAME} SCRIPT_PROJECT_LIBRARY)
+ list(APPEND GRAPH_KEYS ${SCRIPT_MODULE_PROJECT_NAME})
+ set(GRAPH_VALUE_DISPLAY_${SCRIPT_MODULE_PROJECT_NAME} ${SCRIPT_PROJECT_LIBRARY})
+ list(APPEND GRAPH_VALUE_CONTAINS_MODULES_${SCRIPT_MODULE_PROJECT_NAME} ${SCRIPT_MODULE})
+ elseif(${SCRIPT_MODULE_VARIABLE} MATCHES "static")
+ list(APPEND GRAPH_KEYS worldserver)
+ set(GRAPH_VALUE_DISPLAY_worldserver worldserver)
+ list(APPEND GRAPH_VALUE_CONTAINS_MODULES_worldserver ${SCRIPT_MODULE})
+ else()
+ list(APPEND GRAPH_KEYS disabled)
+ set(GRAPH_VALUE_DISPLAY_disabled disabled)
+ list(APPEND GRAPH_VALUE_CONTAINS_MODULES_disabled ${SCRIPT_MODULE})
+ endif()
+endforeach()
+
+list(SORT GRAPH_KEYS)
+list(REMOVE_DUPLICATES GRAPH_KEYS)
-include_directories(
- ${CMAKE_SOURCE_DIR}/dep/cppformat
- ${CMAKE_SOURCE_DIR}/dep/g3dlite/include
- ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour/Include
- ${CMAKE_SOURCE_DIR}/src/common/
- ${CMAKE_SOURCE_DIR}/src/common/Collision
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Management
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Maps
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Models
- ${CMAKE_SOURCE_DIR}/src/common/Configuration
- ${CMAKE_SOURCE_DIR}/src/common/Debugging
- ${CMAKE_SOURCE_DIR}/src/common/Logging
- ${CMAKE_SOURCE_DIR}/src/common/Threading
- ${CMAKE_SOURCE_DIR}/src/common/Utilities
- ${CMAKE_SOURCE_DIR}/src/server/database/Database
- ${CMAKE_SOURCE_DIR}/src/server/game/Accounts
- ${CMAKE_SOURCE_DIR}/src/server/game/Achievements
- ${CMAKE_SOURCE_DIR}/src/server/game/Addons
- ${CMAKE_SOURCE_DIR}/src/server/game/AI
- ${CMAKE_SOURCE_DIR}/src/server/game/AI/CoreAI
- ${CMAKE_SOURCE_DIR}/src/server/game/AI/ScriptedAI
- ${CMAKE_SOURCE_DIR}/src/server/game/AI/SmartScripts
- ${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse
- ${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouseBot
- ${CMAKE_SOURCE_DIR}/src/server/game/Battlefield
- ${CMAKE_SOURCE_DIR}/src/server/game/Battlefield/Zones
- ${CMAKE_SOURCE_DIR}/src/server/game/Battlegrounds
- ${CMAKE_SOURCE_DIR}/src/server/game/Battlegrounds/Zones
- ${CMAKE_SOURCE_DIR}/src/server/game/Chat
- ${CMAKE_SOURCE_DIR}/src/server/game/Chat/Channels
- ${CMAKE_SOURCE_DIR}/src/server/game/Combat
- ${CMAKE_SOURCE_DIR}/src/server/game/Conditions
- ${CMAKE_SOURCE_DIR}/src/server/game/DataStores
- ${CMAKE_SOURCE_DIR}/src/server/game/DungeonFinding
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Corpse
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Creature
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/DynamicObject
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/GameObject
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item/Container
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object/Updates
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Pet
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Player
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Transport
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Unit
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Vehicle
- ${CMAKE_SOURCE_DIR}/src/server/game/Events
- ${CMAKE_SOURCE_DIR}/src/server/game/Globals
- ${CMAKE_SOURCE_DIR}/src/server/game/Grids
- ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Cells
- ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Notifiers
- ${CMAKE_SOURCE_DIR}/src/server/game/Groups
- ${CMAKE_SOURCE_DIR}/src/server/game/Guilds
- ${CMAKE_SOURCE_DIR}/src/server/game/Handlers
- ${CMAKE_SOURCE_DIR}/src/server/game/Instances
- ${CMAKE_SOURCE_DIR}/src/server/game/Loot
- ${CMAKE_SOURCE_DIR}/src/server/game/Mails
- ${CMAKE_SOURCE_DIR}/src/server/game/Maps
- ${CMAKE_SOURCE_DIR}/src/server/game/Miscellaneous
- ${CMAKE_SOURCE_DIR}/src/server/game/Movement
- ${CMAKE_SOURCE_DIR}/src/server/game/Movement/MovementGenerators
- ${CMAKE_SOURCE_DIR}/src/server/game/Movement/Spline
- ${CMAKE_SOURCE_DIR}/src/server/game/Movement/Waypoints
- ${CMAKE_SOURCE_DIR}/src/server/game/OutdoorPvP
- ${CMAKE_SOURCE_DIR}/src/server/game/Pools
- ${CMAKE_SOURCE_DIR}/src/server/game/Quests
- ${CMAKE_SOURCE_DIR}/src/server/game/Reputation
- ${CMAKE_SOURCE_DIR}/src/server/game/Scripting
- ${CMAKE_SOURCE_DIR}/src/server/game/Server
- ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol
- ${CMAKE_SOURCE_DIR}/src/server/game/Skills
- ${CMAKE_SOURCE_DIR}/src/server/game/Spells
- ${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras
- ${CMAKE_SOURCE_DIR}/src/server/game/Texts
- ${CMAKE_SOURCE_DIR}/src/server/game/Tickets
- ${CMAKE_SOURCE_DIR}/src/server/game/Tools
- ${CMAKE_SOURCE_DIR}/src/server/game/Warden
- ${CMAKE_SOURCE_DIR}/src/server/game/Weather
- ${CMAKE_SOURCE_DIR}/src/server/game/World
- ${CMAKE_SOURCE_DIR}/src/server/shared
- ${CMAKE_SOURCE_DIR}/src/server/shared/DataStores
- ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic
- ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference
- ${CMAKE_SOURCE_DIR}/src/server/shared/Packets
- ${MYSQL_INCLUDE_DIR}
- ${VALGRIND_INCLUDE_DIR}
-)
+# Display the script graph
+message("* Script configuration (${SCRIPTS}):
+ |")
+
+foreach(GRAPH_KEY ${GRAPH_KEYS})
+ if (NOT GRAPH_KEY STREQUAL "disabled")
+ message(" +- ${GRAPH_VALUE_DISPLAY_${GRAPH_KEY}}")
+ else()
+ message(" | ${GRAPH_VALUE_DISPLAY_${GRAPH_KEY}}")
+ endif()
+ foreach(GRAPH_PROJECT_ENTRY ${GRAPH_VALUE_CONTAINS_MODULES_${GRAPH_KEY}})
+ message(" | +- ${GRAPH_PROJECT_ENTRY}")
+ endforeach()
+ message(" |")
+endforeach()
+
+# Base sources which are used by every script project
+if (USE_SCRIPTPCH)
+ set(PRIVATE_PCH_HEADER ScriptPCH.h)
+ set(PRIVATE_PCH_SOURCE ScriptPCH.cpp)
+endif ()
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
+# Configures the scriptloader with the given name and stores the output in the LOADER_OUT variable.
+# It is possible to expose multiple subdirectories from the same scriptloader through passing
+# it to the variable arguments
+function(ConfigureScriptLoader SCRIPTLOADER_NAME LOADER_OUT IS_DYNAMIC_SCRIPTLOADER)
+ # Deduces following variables which are referenced by thge template:
+ # TRINITY_IS_DYNAMIC_SCRIPTLOADER
+ # TRINITY_SCRIPTS_FORWARD_DECL
+ # TRINITY_SCRIPTS_INVOKE
+ # TRINITY_CURRENT_SCRIPT_PROJECT
+
+ # To generate export macros
+ set(TRINITY_IS_DYNAMIC_SCRIPTLOADER ${IS_DYNAMIC_SCRIPTLOADER})
+ # To generate forward declarations of the loading functions
+ unset(TRINITY_SCRIPTS_FORWARD_DECL)
+ unset(TRINITY_SCRIPTS_INVOKE)
+ # The current script project which is built in
+ set(TRINITY_CURRENT_SCRIPT_PROJECT ${SCRIPTLOADER_NAME})
+ foreach(LOCALE_SCRIPT_MODULE ${ARGN})
+ # Determine the loader function ("Add##${NameOfDirectory}##Scripts()")
+ set(LOADER_FUNCTION
+ "Add${LOCALE_SCRIPT_MODULE}Scripts()")
+ # Generate the funciton call and the forward declarations
+ set(TRINITY_SCRIPTS_FORWARD_DECL
+ "${TRINITY_SCRIPTS_FORWARD_DECL}void ${LOADER_FUNCTION};\n")
+ set(TRINITY_SCRIPTS_INVOKE
+ "${TRINITY_SCRIPTS_INVOKE} ${LOADER_FUNCTION};\n")
+ endforeach()
+ set(GENERATED_LOADER ${CMAKE_CURRENT_BINARY_DIR}/gen_scriptloader/${SCRIPTLOADER_NAME}/ScriptLoader.cpp)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ScriptLoader.cpp.in.cmake ${GENERATED_LOADER})
+ set(${LOADER_OUT} ${GENERATED_LOADER} PARENT_SCOPE)
+endfunction()
+
+# Generates the actual script projects
+# Fills the STATIC_SCRIPT_MODULES and DYNAMIC_SCRIPT_MODULE_PROJECTS variables
+# which contain the names which scripts are linked statically/dynamically and
+# adds the sources of the static modules to the PRIVATE_SOURCES variable.
+foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
+ GetPathToScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PATH)
+ ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE)
+
+ if ((${SCRIPT_MODULE_VARIABLE} STREQUAL "disabled") OR
+ (${SCRIPT_MODULE_VARIABLE} STREQUAL "static"))
+ # Uninstall disabled modules
+ GetProjectNameOfScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PROJECT_NAME)
+ GetNativeSharedLibraryName(${SCRIPT_MODULE_PROJECT_NAME} SCRIPT_MODULE_OUTPUT_NAME)
+ list(APPEND DISABLED_SCRIPT_MODULE_PROJECTS ${INSTALL_OFFSET}/${SCRIPT_MODULE_OUTPUT_NAME})
+ if (${SCRIPT_MODULE_VARIABLE} STREQUAL "static")
+ # Add the module name to STATIC_SCRIPT_MODULES
+ list(APPEND STATIC_SCRIPT_MODULES ${SCRIPT_MODULE})
+ # Add the module content to the whole static module
+ CollectSourceFiles(${SCRIPT_MODULE_PATH} PRIVATE_SOURCES)
+ endif()
+ elseif(${SCRIPT_MODULE_VARIABLE} STREQUAL "dynamic")
+ # Generate an own dynamic module which is loadable on runtime
+ # Add the module content to the whole static module
+ unset(SCRIPT_MODULE_PRIVATE_SOURCES)
+ CollectSourceFiles(${SCRIPT_MODULE_PATH} SCRIPT_MODULE_PRIVATE_SOURCES)
+ # Configure the scriptloader
+ ConfigureScriptLoader(${SCRIPT_MODULE} SCRIPT_MODULE_PRIVATE_SCRIPTLOADER ON ${SCRIPT_MODULE})
+ GetProjectNameOfScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PROJECT_NAME)
+ # Add the module name to DYNAMIC_SCRIPT_MODULES
+ list(APPEND DYNAMIC_SCRIPT_MODULE_PROJECTS ${SCRIPT_MODULE_PROJECT_NAME})
+ # Create the script module project
+ add_library(${SCRIPT_MODULE_PROJECT_NAME} SHARED
+ ${PRIVATE_PCH_SOURCE}
+ ${SCRIPT_MODULE_PRIVATE_SOURCES}
+ ${SCRIPT_MODULE_PRIVATE_SCRIPTLOADER})
+ target_link_libraries(${SCRIPT_MODULE_PROJECT_NAME}
+ PUBLIC
+ game)
+ set_target_properties(${SCRIPT_MODULE_PROJECT_NAME}
+ PROPERTIES
+ FOLDER
+ "scripts")
+
+ if(UNIX)
+ install(TARGETS ${SCRIPT_MODULE_PROJECT_NAME}
+ DESTINATION ${INSTALL_OFFSET}
+ COMPONENT ${SCRIPT_MODULE_PROJECT_NAME})
+ elseif(WIN32)
+ install(TARGETS ${SCRIPT_MODULE_PROJECT_NAME}
+ RUNTIME DESTINATION ${INSTALL_OFFSET}
+ COMPONENT ${SCRIPT_MODULE_PROJECT_NAME})
+ if(MSVC)
+ # Place the script modules in the script subdirectory
+ set_target_properties(${SCRIPT_MODULE_PROJECT_NAME} PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/scripts
+ RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/scripts
+ RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/bin/RelWithDebInfo/scripts
+ RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/bin/MinSizeRel/scripts)
+ endif()
+ endif()
+ else()
+ message(FATAL_ERROR "Unknown value \"${${SCRIPT_MODULE_VARIABLE}}\"!")
+ endif()
+endforeach()
+
+# Add the dynamic script modules to the worldserver as dependency
+set(WORLDSERVER_DYNAMIC_SCRIPT_MODULES_DEPENDENCIES ${DYNAMIC_SCRIPT_MODULE_PROJECTS} PARENT_SCOPE)
+
+ConfigureScriptLoader("static" SCRIPT_MODULE_PRIVATE_SCRIPTLOADER OFF ${STATIC_SCRIPT_MODULES})
+
add_library(scripts STATIC
- ${scripts_STAT_SRCS}
- ${scripts_STAT_PCH_SRC}
-)
+ ScriptLoader.h
+ ${PRIVATE_PCH_SOURCE}
+ ${SCRIPT_MODULE_PRIVATE_SCRIPTLOADER}
+ ${PRIVATE_SOURCES})
+
+target_link_libraries(scripts
+ PUBLIC
+ game-interface)
+
+target_include_directories(scripts
+ PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR})
+
+set_target_properties(scripts
+ PROPERTIES
+ FOLDER
+ "scripts")
# Generate precompiled header
if (USE_SCRIPTPCH)
- add_cxx_pch(scripts ${scripts_STAT_PCH_HDR} ${scripts_STAT_PCH_SRC})
+ list(APPEND ALL_SCRIPT_PROJECTS scripts ${DYNAMIC_SCRIPT_MODULE_PROJECTS})
+ add_cxx_pch("${ALL_SCRIPT_PROJECTS}" ${PRIVATE_PCH_HEADER} ${PRIVATE_PCH_SOURCE})
+endif()
+
+# Remove all shared libraries in the installl directory which
+# are contained in the static library already.
+if (DISABLED_SCRIPT_MODULE_PROJECTS)
+ install(CODE "
+ foreach(SCRIPT_TO_UNINSTALL ${DISABLED_SCRIPT_MODULE_PROJECTS})
+ if (EXISTS \"\${SCRIPT_TO_UNINSTALL}\")
+ message(STATUS \"Uninstalling: \${SCRIPT_TO_UNINSTALL}\")
+ file(REMOVE \"\${SCRIPT_TO_UNINSTALL}\")
+ endif()
+ endforeach()
+ ")
endif()
+
+message("")
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index f25e91ee3e6..4bce2d168a9 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -121,10 +121,16 @@ public:
if (!accountName || !password)
return false;
- AccountOpResult result = sAccountMgr->CreateAccount(std::string(accountName), std::string(password), email);
- switch (result)
+ if (strchr(accountName, '@'))
+ {
+ handler->PSendSysMessage(LANG_ACCOUNT_USE_BNET_COMMANDS);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ switch (sAccountMgr->CreateAccount(std::string(accountName), std::string(password), email))
{
- case AOR_OK:
+ case AccountOpResult::AOR_OK:
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName);
if (handler->GetSession())
{
@@ -134,15 +140,15 @@ public:
accountName, email.c_str());
}
break;
- case AOR_NAME_TOO_LONG:
+ case AccountOpResult::AOR_NAME_TOO_LONG:
handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG);
handler->SetSentErrorMessage(true);
return false;
- case AOR_NAME_ALREADY_EXIST:
+ case AccountOpResult::AOR_NAME_ALREADY_EXIST:
handler->SendSysMessage(LANG_ACCOUNT_ALREADY_EXIST);
handler->SetSentErrorMessage(true);
return false;
- case AOR_DB_INTERNAL_ERROR:
+ case AccountOpResult::AOR_DB_INTERNAL_ERROR:
handler->PSendSysMessage(LANG_ACCOUNT_NOT_CREATED_SQL_ERROR, accountName);
handler->SetSentErrorMessage(true);
return false;
@@ -168,7 +174,7 @@ public:
return false;
std::string accountName = account;
- if (!AccountMgr::normalizeString(accountName))
+ if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
@@ -192,14 +198,14 @@ public:
AccountOpResult result = AccountMgr::DeleteAccount(accountId);
switch (result)
{
- case AOR_OK:
+ case AccountOpResult::AOR_OK:
handler->PSendSysMessage(LANG_ACCOUNT_DELETED, accountName.c_str());
break;
- case AOR_NAME_NOT_EXIST:
+ case AccountOpResult::AOR_NAME_NOT_EXIST:
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
return false;
- case AOR_DB_INTERNAL_ERROR:
+ case AccountOpResult::AOR_DB_INTERNAL_ERROR:
handler->PSendSysMessage(LANG_ACCOUNT_NOT_DELETED_SQL_ERROR, accountName.c_str());
handler->SetSentErrorMessage(true);
return false;
@@ -415,7 +421,7 @@ public:
AccountOpResult result = AccountMgr::ChangeEmail(handler->GetSession()->GetAccountId(), std::string(email));
switch (result)
{
- case AOR_OK:
+ case AccountOpResult::AOR_OK:
handler->SendSysMessage(LANG_COMMAND_EMAIL);
sScriptMgr->OnEmailChange(handler->GetSession()->GetAccountId());
TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Character:[%s] (GUID: %u) Changed Email from [%s] to [%s].",
@@ -423,7 +429,7 @@ public:
handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().GetCounter(),
oldEmail, email);
break;
- case AOR_EMAIL_TOO_LONG:
+ case AccountOpResult::AOR_EMAIL_TOO_LONG:
handler->SendSysMessage(LANG_EMAIL_TOO_LONG);
sScriptMgr->OnFailedEmailChange(handler->GetSession()->GetAccountId());
handler->SetSentErrorMessage(true);
@@ -505,14 +511,14 @@ public:
AccountOpResult result = AccountMgr::ChangePassword(handler->GetSession()->GetAccountId(), std::string(newPassword));
switch (result)
{
- case AOR_OK:
+ case AccountOpResult::AOR_OK:
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
sScriptMgr->OnPasswordChange(handler->GetSession()->GetAccountId());
TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Character:[%s] (GUID: %u) Changed Password.",
handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(),
handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().GetCounter());
break;
- case AOR_PASS_TOO_LONG:
+ case AccountOpResult::AOR_PASS_TOO_LONG:
handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
sScriptMgr->OnFailedPasswordChange(handler->GetSession()->GetAccountId());
handler->SetSentErrorMessage(true);
@@ -592,7 +598,7 @@ public:
{
///- Convert Account name to Upper Format
accountName = account;
- if (!AccountMgr::normalizeString(accountName))
+ if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
@@ -662,7 +668,7 @@ public:
if (isAccountNameGiven)
{
targetAccountName = arg1;
- if (!AccountMgr::normalizeString(targetAccountName) || !AccountMgr::GetId(targetAccountName))
+ if (!Utf8ToUpperOnlyLatin(targetAccountName) || !AccountMgr::GetId(targetAccountName))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, targetAccountName.c_str());
handler->SetSentErrorMessage(true);
@@ -750,7 +756,7 @@ public:
return false;
std::string accountName = account;
- if (!AccountMgr::normalizeString(accountName))
+ if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
@@ -781,14 +787,14 @@ public:
switch (result)
{
- case AOR_OK:
+ case AccountOpResult::AOR_OK:
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
break;
- case AOR_NAME_NOT_EXIST:
+ case AccountOpResult::AOR_NAME_NOT_EXIST:
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
return false;
- case AOR_PASS_TOO_LONG:
+ case AccountOpResult::AOR_PASS_TOO_LONG:
handler->SendSysMessage(LANG_PASSWORD_TOO_LONG);
handler->SetSentErrorMessage(true);
return false;
@@ -819,7 +825,7 @@ public:
}
std::string accountName = account;
- if (!AccountMgr::normalizeString(accountName))
+ if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
@@ -849,16 +855,16 @@ public:
AccountOpResult result = AccountMgr::ChangeEmail(targetAccountId, email);
switch (result)
{
- case AOR_OK:
+ case AccountOpResult::AOR_OK:
handler->SendSysMessage(LANG_COMMAND_EMAIL);
TC_LOG_INFO("entities.player.character", "ChangeEmail: Account %s [Id: %u] had it's email changed to %s.",
accountName.c_str(), targetAccountId, email);
break;
- case AOR_NAME_NOT_EXIST:
+ case AccountOpResult::AOR_NAME_NOT_EXIST:
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
return false;
- case AOR_EMAIL_TOO_LONG:
+ case AccountOpResult::AOR_EMAIL_TOO_LONG:
handler->SendSysMessage(LANG_EMAIL_TOO_LONG);
handler->SetSentErrorMessage(true);
return false;
@@ -895,7 +901,7 @@ public:
}
std::string accountName = account;
- if (!AccountMgr::normalizeString(accountName))
+ if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
@@ -925,16 +931,16 @@ public:
AccountOpResult result = AccountMgr::ChangeRegEmail(targetAccountId, email);
switch (result)
{
- case AOR_OK:
+ case AccountOpResult::AOR_OK:
handler->SendSysMessage(LANG_COMMAND_EMAIL);
TC_LOG_INFO("entities.player.character", "ChangeRegEmail: Account %s [Id: %u] had it's Registration Email changed to %s.",
accountName.c_str(), targetAccountId, email);
break;
- case AOR_NAME_NOT_EXIST:
+ case AccountOpResult::AOR_NAME_NOT_EXIST:
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
return false;
- case AOR_EMAIL_TOO_LONG:
+ case AccountOpResult::AOR_EMAIL_TOO_LONG:
handler->SendSysMessage(LANG_EMAIL_TOO_LONG);
handler->SetSentErrorMessage(true);
return false;
diff --git a/src/server/scripts/Commands/cs_ahbot.cpp b/src/server/scripts/Commands/cs_ahbot.cpp
index 65e90394261..47553d085b1 100644
--- a/src/server/scripts/Commands/cs_ahbot.cpp
+++ b/src/server/scripts/Commands/cs_ahbot.cpp
@@ -33,7 +33,7 @@ class ahbot_commandscript : public CommandScript
public:
ahbot_commandscript(): CommandScript("ahbot_commandscript") {}
- std::vector<ChatCommand> GetCommands() const
+ std::vector<ChatCommand> GetCommands() const override
{
static std::vector<ChatCommand> ahbotItemsAmountCommandTable =
{
diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp
index 4a1bf71e1d8..ba512dbf8eb 100644
--- a/src/server/scripts/Commands/cs_ban.cpp
+++ b/src/server/scripts/Commands/cs_ban.cpp
@@ -171,7 +171,7 @@ public:
switch (mode)
{
case BAN_ACCOUNT:
- if (!AccountMgr::normalizeString(nameOrIP))
+ if (!Utf8ToUpperOnlyLatin(nameOrIP))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP.c_str());
handler->SetSentErrorMessage(true);
@@ -244,7 +244,7 @@ public:
return false;
std::string accountName = nameStr;
- if (!AccountMgr::normalizeString(accountName))
+ if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
@@ -712,7 +712,7 @@ public:
switch (mode)
{
case BAN_ACCOUNT:
- if (!AccountMgr::normalizeString(nameOrIP))
+ if (!Utf8ToUpperOnlyLatin(nameOrIP))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP.c_str());
handler->SetSentErrorMessage(true);
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index e048aabd4d7..01602e2f24c 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -133,7 +133,7 @@ public:
info.name = fields[1].GetString();
info.accountId = fields[2].GetUInt32();
- // account name will be empty for not existed account
+ // account name will be empty for nonexisting account
AccountMgr::GetName(info.accountId, info.accountName);
info.deleteDate = time_t(fields[3].GetUInt32());
foundList.push_back(info);
@@ -169,11 +169,11 @@ public:
if (!handler->GetSession())
handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE,
- itr->guid.GetCounter(), itr->name.c_str(), itr->accountName.empty() ? "<Not existed>" : itr->accountName.c_str(),
+ itr->guid.GetCounter(), itr->name.c_str(), itr->accountName.empty() ? "<Not existing>" : itr->accountName.c_str(),
itr->accountId, dateStr.c_str());
else
handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT,
- itr->guid.GetCounter(), itr->name.c_str(), itr->accountName.empty() ? "<Not existed>" : itr->accountName.c_str(),
+ itr->guid.GetCounter(), itr->name.c_str(), itr->accountName.empty() ? "<Not existing>" : itr->accountName.c_str(),
itr->accountId, dateStr.c_str());
}
@@ -193,7 +193,7 @@ public:
*/
static void HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo, ChatHandler* handler)
{
- if (delInfo.accountName.empty()) // account not exist
+ if (delInfo.accountName.empty()) // account does not exist
{
handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.guid.GetCounter(), delInfo.accountId);
return;
@@ -436,7 +436,7 @@ public:
if (isalpha(levelStr[0]))
{
nameStr = levelStr;
- levelStr = NULL; // current level will used
+ levelStr = nullptr; // current level will used
}
Player* target;
@@ -660,7 +660,7 @@ public:
if (newCharName.empty())
{
- // Drop not existed account cases
+ // Drop nonexisting account cases
for (DeletedInfoList::iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
HandleCharacterDeletedRestoreHelper(*itr, handler);
}
@@ -810,7 +810,7 @@ public:
if (levelStr && isalpha(levelStr[0]))
{
nameStr = levelStr;
- levelStr = NULL; // current level will used
+ levelStr = NULL; // current level will be used
}
Player* target;
@@ -854,7 +854,7 @@ public:
return false;
std::string accountName = accountStr;
- if (!AccountMgr::normalizeString(accountName))
+ if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index b937fc4e0a4..570f4587ae8 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -34,8 +34,11 @@ EndScriptData */
#include "Transport.h"
#include "Language.h"
#include "MapManager.h"
+#include "M2Stores.h"
+#include "BattlefieldMgr.h"
#include <fstream>
+#include <limits>
class debug_commandscript : public CommandScript
{
@@ -94,7 +97,8 @@ public:
{ "transport", rbac::RBAC_PERM_COMMAND_DEBUG_TRANSPORT, false, &HandleDebugTransportCommand, "" },
{ "loadcells", rbac::RBAC_PERM_COMMAND_DEBUG_LOADCELLS, false, &HandleDebugLoadCellsCommand, "" },
{ "boundary", rbac::RBAC_PERM_COMMAND_DEBUG_BOUNDARY, false, &HandleDebugBoundaryCommand, "" },
- { "raidreset", rbac::RBAC_PERM_COMMAND_INSTANCE_UNBIND, false, &HandleDebugRaidResetCommand, "" }
+ { "raidreset", rbac::RBAC_PERM_COMMAND_INSTANCE_UNBIND, false, &HandleDebugRaidResetCommand, "" },
+ { "neargraveyard", rbac::RBAC_PERM_COMMAND_NEARGRAVEYARD, false, &HandleDebugNearGraveyard, "" },
};
static std::vector<ChatCommand> commandTable =
{
@@ -124,6 +128,23 @@ public:
return false;
}
+ // Dump camera locations
+ if (CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(id))
+ {
+ std::unordered_map<uint32, FlyByCameraCollection>::const_iterator itr = sFlyByCameraStore.find(cineSeq->cinematicCamera);
+ if (itr != sFlyByCameraStore.end())
+ {
+ handler->PSendSysMessage("Waypoints for sequence %u, camera %u", id, cineSeq->cinematicCamera);
+ uint32 count = 1 ;
+ for (FlyByCamera cam : itr->second)
+ {
+ handler->PSendSysMessage("%02u - %7ums [%f, %f, %f] Facing %f (%f degrees)", count, cam.timeStamp, cam.locations.x, cam.locations.y, cam.locations.z, cam.locations.w, cam.locations.w * (180 / M_PI));
+ count++;
+ }
+ handler->PSendSysMessage("%u waypoints dumped", itr->second.size());
+ }
+ }
+
handler->GetSession()->GetPlayer()->SendCinematicStart(id);
return true;
}
@@ -830,7 +851,7 @@ public:
if (Unit* unit = ref->GetSource()->GetOwner())
{
++count;
- handler->PSendSysMessage(" %u. %s (guid %u) - threat %f", count, unit->GetName().c_str(), unit->GetGUID().GetCounter(), ref->getThreat());
+ handler->PSendSysMessage(" %u. %s (current guid %u, DB guid %u) - threat %f", count, unit->GetName().c_str(), unit->GetGUID().GetCounter(), unit->GetTypeId() == TYPEID_UNIT ? unit->ToCreature()->GetSpawnId() : 0, ref->getThreat());
}
ref = ref->next();
}
@@ -1045,7 +1066,8 @@ public:
return false;
uint32 animId = atoi((char*)args);
- handler->GetSession()->GetPlayer()->HandleEmoteCommand(animId);
+ if (Unit* unit = handler->getSelectedUnit())
+ unit->HandleEmoteCommand(animId);
return true;
}
@@ -1409,10 +1431,7 @@ public:
map = player->GetMap();
handler->PSendSysMessage("Loading all cells (mapId: %u). Current next GameObject %u, Creature %u", map->GetId(), map->GetMaxLowGuid<HighGuid::GameObject>(), map->GetMaxLowGuid<HighGuid::Unit>());
- for (uint32 cellX = 0; cellX < TOTAL_NUMBER_OF_CELLS_PER_MAP; cellX++)
- for (uint32 cellY = 0; cellY < TOTAL_NUMBER_OF_CELLS_PER_MAP; cellY++)
- map->LoadGrid((cellX + 0.5f - CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL, (cellY + 0.5f - CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL);
-
+ map->LoadAllCells();
handler->PSendSysMessage("Cells loaded (mapId: %u) After load - Next GameObject %u, Creature %u", map->GetId(), map->GetMaxLowGuid<HighGuid::GameObject>(), map->GetMaxLowGuid<HighGuid::Unit>());
return true;
}
@@ -1436,7 +1455,7 @@ public:
duration = 3 * MINUTE;
bool doFill = fill_str ? (stricmp(fill_str, "FILL") == 0) : false;
-
+
int32 errMsg = target->AI()->VisualizeBoundary(duration, player, doFill);
if (errMsg > 0)
handler->PSendSysMessage(errMsg);
@@ -1469,6 +1488,53 @@ public:
sInstanceSaveMgr->ForceGlobalReset(mEntry->MapID, Difficulty(difficulty));
return true;
}
+
+ static bool HandleDebugNearGraveyard(ChatHandler* handler, char const* args)
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+ const WorldSafeLocsEntry* nearestLoc = nullptr;
+
+ if (stricmp(args, "linked"))
+ {
+ if (Battleground* bg = player->GetBattleground())
+ nearestLoc = bg->GetClosestGraveYard(player);
+ else
+ {
+ if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId()))
+ nearestLoc = bf->GetClosestGraveYard(player);
+ else
+ nearestLoc = sObjectMgr->GetClosestGraveYard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), player->GetTeam());
+ }
+ }
+ else
+ {
+ float x = player->GetPositionX();
+ float y = player->GetPositionY();
+ float z = player->GetPositionZ();
+ float distNearest = std::numeric_limits<float>::max();
+
+ for (uint32 i = 0; i < sWorldSafeLocsStore.GetNumRows(); ++i)
+ {
+ const WorldSafeLocsEntry* loc = sWorldSafeLocsStore.LookupEntry(i);
+ if (loc && loc->map_id == player->GetMapId())
+ {
+ float dist = (loc->x - x) * (loc->x - x) + (loc->y - y) * (loc->y - y) + (loc->z - z) * (loc->z - z);
+ if (dist < distNearest)
+ {
+ distNearest = dist;
+ nearestLoc = loc;
+ }
+ }
+ }
+ }
+
+ if (nearestLoc)
+ handler->PSendSysMessage(LANG_COMMAND_NEARGRAVEYARD, nearestLoc->ID, nearestLoc->x, nearestLoc->y, nearestLoc->z);
+ else
+ handler->PSendSysMessage(LANG_COMMAND_NEARGRAVEYARD_NOTFOUND);
+
+ return true;
+ }
};
void AddSC_debug_commandscript()
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index e03942bc247..ffe8ea67816 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -164,7 +164,7 @@ public:
///- Get the accounts with GM Level >0
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_GM_ACCOUNTS);
stmt->setUInt8(0, uint8(SEC_MODERATOR));
- stmt->setInt32(1, int32(realmID));
+ stmt->setInt32(1, int32(realm.Id.Realm));
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (result)
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 729dac0ad6f..c4ed6f650b9 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -139,16 +139,12 @@ public:
}
Player* player = handler->GetSession()->GetPlayer();
- float x = float(player->GetPositionX());
- float y = float(player->GetPositionY());
- float z = float(player->GetPositionZ());
- float o = float(player->GetOrientation());
Map* map = player->GetMap();
GameObject* object = new GameObject;
ObjectGuid::LowType guidLow = map->GenerateLowGuid<HighGuid::GameObject>();
- if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
+ if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMaskForSpawn(), *player, G3D::Quat(), 255, GO_STATE_READY))
{
delete object;
return false;
@@ -179,7 +175,7 @@ public:
/// @todo is it really necessary to add both the real and DB table guid here ?
sObjectMgr->AddGameobjectToGrid(guidLow, sObjectMgr->GetGOData(guidLow));
- handler->PSendSysMessage(LANG_GAMEOBJECT_ADD, objectId, objectInfo->name.c_str(), guidLow, x, y, z);
+ handler->PSendSysMessage(LANG_GAMEOBJECT_ADD, objectId, objectInfo->name.c_str(), guidLow, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
return true;
}
@@ -201,14 +197,7 @@ public:
if (spawntime)
spawntm = atoi((char*)spawntime);
- float x = player->GetPositionX();
- float y = player->GetPositionY();
- float z = player->GetPositionZ();
- float ang = player->GetOrientation();
-
- float rot2 = std::sin(ang/2);
- float rot3 = std::cos(ang/2);
-
+ G3D::Quat rotation = G3D::Matrix3::fromEulerAnglesZYX(player->GetOrientation(), 0.f, 0.f);
uint32 objectId = atoi(id);
if (!sObjectMgr->GetGameObjectTemplate(objectId))
@@ -218,7 +207,7 @@ public:
return false;
}
- player->SummonGameObject(objectId, x, y, z, ang, 0, 0, rot2, rot3, spawntm);
+ player->SummonGameObject(objectId, *player, rotation, spawntm);
return true;
}
@@ -415,20 +404,30 @@ public:
}
char* orientation = strtok(NULL, " ");
- float o;
+ float oz = 0.f, oy = 0.f, ox = 0.f;
if (orientation)
- o = (float)atof(orientation);
+ {
+ oz = float(atof(orientation));
+
+ orientation = strtok(NULL, " ");
+ if (orientation)
+ {
+ oy = float(atof(orientation));
+ orientation = strtok(NULL, " ");
+ if (orientation)
+ ox = float(atof(orientation));
+ }
+ }
else
{
Player* player = handler->GetSession()->GetPlayer();
- o = player->GetOrientation();
+ oz = player->GetOrientation();
}
Map* map = object->GetMap();
-
- object->Relocate(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), o);
- object->UpdateRotationFields();
+ object->Relocate(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ());
+ object->SetWorldRotationAngles(oz, oy, ox);
object->SaveToDB();
// Generate a completely new spawn with new guid
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index 61e6acfb4d8..161ade1a30f 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -1343,7 +1343,7 @@ public:
char* limitStr = strtok(NULL, " ");
int32 limit = limitStr ? atoi(limitStr) : -1;
- if (!AccountMgr::normalizeString
+ if (!Utf8ToUpperOnlyLatin
(account))
return false;
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index c70246f7fb5..16217fbaea6 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -36,6 +36,7 @@
#include "MMapFactory.h"
#include "DisableMgr.h"
#include "SpellHistory.h"
+#include "Transport.h"
class misc_commandscript : public CommandScript
{
@@ -237,6 +238,10 @@ public:
areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : unknown),
object->GetPhaseMask(),
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation());
+ if (Transport* transport = object->GetTransport())
+ handler->PSendSysMessage(LANG_TRANSPORT_POSITION,
+ transport->GetGOInfo()->moTransport.mapID, object->GetTransOffsetX(), object->GetTransOffsetY(), object->GetTransOffsetZ(), object->GetTransOffsetO(),
+ transport->GetEntry(), transport->GetName().c_str());
handler->PSendSysMessage(LANG_GRID_POSITION,
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap, haveMMap);
@@ -698,7 +703,7 @@ public:
static bool HandleCooldownCommand(ChatHandler* handler, char const* args)
{
- Player* target = handler->getSelectedPlayerOrSelf();
+ Unit* target = handler->getSelectedUnit();
if (!target)
{
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
@@ -706,7 +711,14 @@ public:
return false;
}
- std::string nameLink = handler->GetNameLink(target);
+ Player* owner = target->GetCharmerOrOwnerPlayerOrPlayerItself();
+ if (!owner)
+ {
+ owner = handler->GetSession()->GetPlayer();
+ target = owner;
+ }
+
+ std::string nameLink = handler->GetNameLink(owner);
if (!*args)
{
@@ -723,13 +735,13 @@ public:
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellIid);
if (!spellInfo)
{
- handler->PSendSysMessage(LANG_UNKNOWN_SPELL, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
+ handler->PSendSysMessage(LANG_UNKNOWN_SPELL, owner == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
target->GetSpellHistory()->ResetCooldown(spellIid, true);
- handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spellIid, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
+ handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spellIid, owner == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
}
return true;
}
@@ -791,7 +803,7 @@ public:
target->CleanupAfterTaxiFlight();
}
- target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO);
+ target->Recall();
return true;
}
@@ -1588,7 +1600,7 @@ public:
// Query the prepared statement for login data
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
- stmt->setInt32(0, int32(realmID));
+ stmt->setInt32(0, int32(realm.Id.Realm));
stmt->setUInt32(1, accId);
PreparedQueryResult result = LoginDatabase.Query(stmt);
@@ -1964,7 +1976,7 @@ public:
return false;
std::string accountName = nameStr;
- if (!AccountMgr::normalizeString(accountName))
+ if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SetSentErrorMessage(true);
@@ -2119,17 +2131,9 @@ public:
}
return true;
}
- /*
- ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator
- Without this function 3rd party scripting library will get linking errors (unresolved external)
- when attempting to use the PointMovementGenerator
- */
- static bool HandleComeToMeCommand(ChatHandler* handler, char const* args)
- {
- char const* newFlagStr = strtok((char*)args, " ");
- if (!newFlagStr)
- return false;
+ static bool HandleComeToMeCommand(ChatHandler* handler, char const* /*args*/)
+ {
Creature* caster = handler->getSelectedCreature();
if (!caster)
{
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 761b4c9e0e6..e25018cf1bd 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -80,23 +80,32 @@ public:
return commandTable;
}
- //Edit Player HP
- static bool HandleModifyHPCommand(ChatHandler* handler, const char* args)
+ template<typename... Args>
+ static void NotifyModification(ChatHandler* handler, Unit* target, TrinityStrings resourceMessage, TrinityStrings resourceReportMessage, Args&&... args)
+ {
+ if (Player* player = target->ToPlayer())
+ {
+ handler->PSendSysMessage(resourceMessage, handler->GetNameLink(player).c_str(), args...);
+ if (handler->needReportToTarget(player))
+ ChatHandler(player->GetSession()).PSendSysMessage(resourceReportMessage, handler->GetNameLink().c_str(), std::forward<Args>(args)...);
+ }
+ }
+
+ static bool CheckModifyResources(ChatHandler* handler, const char* args, Player* target, int32& res, int32& resmax, int8 const multiplier = 1)
{
if (!*args)
return false;
- int32 hp = atoi((char*)args);
- int32 hpm = atoi((char*)args);
+ res = atoi((char*)args) * multiplier;
+ resmax = atoi((char*)args) * multiplier;
- if (hp < 1 || hpm < 1 || hpm < hp)
+ if (res < 1 || resmax < 1 || resmax < res)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
- Player* target = handler->getSelectedPlayerOrSelf();
if (!target)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
@@ -107,164 +116,87 @@ public:
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
return false;
- handler->PSendSysMessage(LANG_YOU_CHANGE_HP, handler->GetNameLink(target).c_str(), hp, hpm);
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_HP_CHANGED, handler->GetNameLink().c_str(), hp, hpm);
-
- target->SetMaxHealth(hpm);
- target->SetHealth(hp);
-
return true;
}
- //Edit Player Mana
- static bool HandleModifyManaCommand(ChatHandler* handler, const char* args)
+ //Edit Player HP
+ static bool HandleModifyHPCommand(ChatHandler* handler, const char* args)
{
- if (!*args)
- return false;
-
- int32 mana = atoi((char*)args);
- int32 manam = atoi((char*)args);
-
- if (mana <= 0 || manam <= 0 || manam < mana)
+ int32 hp, hpmax;
+ Player* target = handler->getSelectedPlayerOrSelf();
+ if (CheckModifyResources(handler, args, target, hp, hpmax))
{
- handler->SendSysMessage(LANG_BAD_VALUE);
- handler->SetSentErrorMessage(true);
- return false;
+ NotifyModification(handler, target, LANG_YOU_CHANGE_HP, LANG_YOURS_HP_CHANGED, hp, hpmax);
+ target->SetMaxHealth(hpmax);
+ target->SetHealth(hp);
+ return true;
}
+ return false;
+ }
+ //Edit Player Mana
+ static bool HandleModifyManaCommand(ChatHandler* handler, const char* args)
+ {
+ int32 mana, manamax;
Player* target = handler->getSelectedPlayerOrSelf();
- if (!target)
+
+ if (CheckModifyResources(handler, args, target, mana, manamax))
{
- handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
- handler->SetSentErrorMessage(true);
- return false;
+ NotifyModification(handler, target, LANG_YOU_CHANGE_MANA, LANG_YOURS_MANA_CHANGED, mana, manamax);
+ target->SetMaxPower(POWER_MANA, manamax);
+ target->SetPower(POWER_MANA, mana);
+ return true;
}
-
- // check online security
- if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
- return false;
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_MANA, handler->GetNameLink(target).c_str(), mana, manam);
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MANA_CHANGED, handler->GetNameLink().c_str(), mana, manam);
-
- target->SetMaxPower(POWER_MANA, manam);
- target->SetPower(POWER_MANA, mana);
-
- return true;
+ return false;
}
//Edit Player Energy
static bool HandleModifyEnergyCommand(ChatHandler* handler, const char* args)
{
- if (!*args)
- return false;
-
- int32 energy = atoi((char*)args)*10;
- int32 energym = atoi((char*)args)*10;
-
- if (energy <= 0 || energym <= 0 || energym < energy)
- {
- handler->SendSysMessage(LANG_BAD_VALUE);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
+ int32 energy, energymax;
Player* target = handler->getSelectedPlayerOrSelf();
- if (!target)
+ int8 const energyMultiplier = 10;
+ if (CheckModifyResources(handler, args, target, energy, energymax, energyMultiplier))
{
- handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
- handler->SetSentErrorMessage(true);
- return false;
+ NotifyModification(handler, target, LANG_YOU_CHANGE_ENERGY, LANG_YOURS_ENERGY_CHANGED, energy / energyMultiplier, energymax / energyMultiplier);
+ target->SetMaxPower(POWER_ENERGY, energymax);
+ target->SetPower(POWER_ENERGY, energy);
+ TC_LOG_DEBUG("misc", handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY));
+ return true;
}
-
- // check online security
- if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
- return false;
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_ENERGY, handler->GetNameLink(target).c_str(), energy/10, energym/10);
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink().c_str(), energy/10, energym/10);
-
- target->SetMaxPower(POWER_ENERGY, energym);
- target->SetPower(POWER_ENERGY, energy);
-
- TC_LOG_DEBUG("misc", handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY));
-
- return true;
+ return false;
}
//Edit Player Rage
static bool HandleModifyRageCommand(ChatHandler* handler, const char* args)
{
- if (!*args)
- return false;
-
- int32 rage = atoi((char*)args)*10;
- int32 ragem = atoi((char*)args)*10;
-
- if (rage <= 0 || ragem <= 0 || ragem < rage)
- {
- handler->SendSysMessage(LANG_BAD_VALUE);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
+ int32 rage, ragemax;
Player* target = handler->getSelectedPlayerOrSelf();
- if (!target)
+ int8 const rageMultiplier = 10;
+ if (CheckModifyResources(handler, args, target, rage, ragemax, rageMultiplier))
{
- handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
- handler->SetSentErrorMessage(true);
- return false;
+ NotifyModification(handler, target, LANG_YOU_CHANGE_RAGE, LANG_YOURS_RAGE_CHANGED, rage / rageMultiplier, ragemax / rageMultiplier);
+ target->SetMaxPower(POWER_RAGE, ragemax);
+ target->SetPower(POWER_RAGE, rage);
+ return true;
}
-
- // check online security
- if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
- return false;
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_RAGE, handler->GetNameLink(target).c_str(), rage/10, ragem/10);
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink().c_str(), rage/10, ragem/10);
-
- target->SetMaxPower(POWER_RAGE, ragem);
- target->SetPower(POWER_RAGE, rage);
-
- return true;
+ return false;
}
// Edit Player Runic Power
static bool HandleModifyRunicPowerCommand(ChatHandler* handler, const char* args)
{
- if (!*args)
- return false;
-
- int32 rune = atoi((char*)args)*10;
- int32 runem = atoi((char*)args)*10;
-
- if (rune <= 0 || runem <= 0 || runem < rune)
- {
- handler->SendSysMessage(LANG_BAD_VALUE);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
+ int32 rune, runemax;
Player* target = handler->getSelectedPlayerOrSelf();
- if (!target)
+ int8 const runeMultiplier = 10;
+ if (CheckModifyResources(handler, args, target, rune, runemax, runeMultiplier))
{
- handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
- handler->SetSentErrorMessage(true);
- return false;
+ NotifyModification(handler, target, LANG_YOU_CHANGE_RUNIC_POWER, LANG_YOURS_RUNIC_POWER_CHANGED, rune / runeMultiplier, runemax / runeMultiplier);
+ target->SetMaxPower(POWER_RUNIC_POWER, runemax);
+ target->SetPower(POWER_RUNIC_POWER, rune);
+ return true;
}
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, handler->GetNameLink(target).c_str(), rune/10, runem/10);
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink().c_str(), rune/10, runem/10);
-
- target->SetMaxPower(POWER_RUNIC_POWER, runem);
- target->SetPower(POWER_RUNIC_POWER, rune);
-
- return true;
+ return false;
}
//Edit Player Faction
@@ -437,22 +369,20 @@ public:
return false;
}
- //Edit Player Aspeed
- static bool HandleModifyASpeedCommand(ChatHandler* handler, const char* args)
+ static bool CheckModifySpeed(ChatHandler* handler, const char* args, Unit* target, float& speed, float minimumBound, float maximumBound, bool checkInFlight = true)
{
if (!*args)
return false;
- float ASpeed = (float)atof((char*)args);
+ speed = (float)atof((char*)args);
- if (ASpeed > 50.0f || ASpeed < 0.1f)
+ if (speed > maximumBound || speed < minimumBound)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
- Player* target = handler->getSelectedPlayerOrSelf();
if (!target)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
@@ -460,238 +390,107 @@ public:
return false;
}
- // check online security
- if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
- return false;
-
- std::string targetNameLink = handler->GetNameLink(target);
-
- if (target->IsInFlight())
+ if (Player* player = target->ToPlayer())
{
- handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
- handler->SetSentErrorMessage(true);
- return false;
- }
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_ASPEED, ASpeed, targetNameLink.c_str());
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ASPEED_CHANGED, handler->GetNameLink().c_str(), ASpeed);
+ // check online security
+ if (handler->HasLowerSecurity(player, ObjectGuid::Empty))
+ return false;
- target->SetSpeed(MOVE_WALK, ASpeed, true);
- target->SetSpeed(MOVE_RUN, ASpeed, true);
- target->SetSpeed(MOVE_SWIM, ASpeed, true);
- //target->SetSpeed(MOVE_TURN, ASpeed, true);
- target->SetSpeed(MOVE_FLIGHT, ASpeed, true);
+ if (player->IsInFlight() && checkInFlight)
+ {
+ handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, handler->GetNameLink(player).c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
return true;
}
- //Edit Player Speed
- static bool HandleModifySpeedCommand(ChatHandler* handler, const char* args)
+ //Edit Player Aspeed
+ static bool HandleModifyASpeedCommand(ChatHandler* handler, const char* args)
{
- if (!*args)
- return false;
-
- float Speed = (float)atof((char*)args);
-
- if (Speed > 50.0f || Speed < 0.1f)
- {
- handler->SendSysMessage(LANG_BAD_VALUE);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
+ float allSpeed;
Player* target = handler->getSelectedPlayerOrSelf();
- if (!target)
+ if (CheckModifySpeed(handler, args, target, allSpeed, 0.1f, 50.0f))
{
- handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
- handler->SetSentErrorMessage(true);
- return false;
+ NotifyModification(handler, target, LANG_YOU_CHANGE_ASPEED, LANG_YOURS_ASPEED_CHANGED, allSpeed);
+ target->SetSpeedRate(MOVE_WALK, allSpeed);
+ target->SetSpeedRate(MOVE_RUN, allSpeed);
+ target->SetSpeedRate(MOVE_SWIM, allSpeed);
+ target->SetSpeedRate(MOVE_FLIGHT, allSpeed);
+ return true;
}
+ return false;
+ }
- // check online security
- if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
- return false;
-
- std::string targetNameLink = handler->GetNameLink(target);
-
- if (target->IsInFlight())
+ //Edit Player Speed
+ static bool HandleModifySpeedCommand(ChatHandler* handler, const char* args)
+ {
+ float Speed;
+ Player* target = handler->getSelectedPlayerOrSelf();
+ if (CheckModifySpeed(handler, args, target, Speed, 0.1f, 50.0f))
{
- handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
- handler->SetSentErrorMessage(true);
- return false;
+ NotifyModification(handler, target, LANG_YOU_CHANGE_SPEED, LANG_YOURS_SPEED_CHANGED, Speed);
+ target->SetSpeedRate(MOVE_RUN, Speed);
+ return true;
}
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_SPEED, Speed, targetNameLink.c_str());
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SPEED_CHANGED, handler->GetNameLink().c_str(), Speed);
-
- target->SetSpeed(MOVE_RUN, Speed, true);
-
- return true;
+ return false;
}
//Edit Player Swim Speed
static bool HandleModifySwimCommand(ChatHandler* handler, const char* args)
{
- if (!*args)
- return false;
-
- float Swim = (float)atof((char*)args);
-
- if (Swim > 50.0f || Swim < 0.1f)
- {
- handler->SendSysMessage(LANG_BAD_VALUE);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
+ float swimSpeed;
Player* target = handler->getSelectedPlayerOrSelf();
- if (!target)
+ if (CheckModifySpeed(handler, args, target, swimSpeed, 0.1f, 50.0f))
{
- handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
- // check online security
- if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
- return false;
-
- std::string targetNameLink = handler->GetNameLink(target);
-
- if (target->IsInFlight())
- {
- handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
- handler->SetSentErrorMessage(true);
- return false;
+ NotifyModification(handler, target, LANG_YOU_CHANGE_SWIM_SPEED, LANG_YOURS_SWIM_SPEED_CHANGED, swimSpeed);
+ target->SetSpeedRate(MOVE_SWIM, swimSpeed);
+ return true;
}
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_SWIM_SPEED, Swim, targetNameLink.c_str());
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SWIM_SPEED_CHANGED, handler->GetNameLink().c_str(), Swim);
-
- target->SetSpeed(MOVE_SWIM, Swim, true);
-
- return true;
+ return false;
}
- //Edit Player Walk Speed
+ //Edit Player Backwards Walk Speed
static bool HandleModifyBWalkCommand(ChatHandler* handler, const char* args)
{
- if (!*args)
- return false;
-
- float BSpeed = (float)atof((char*)args);
-
- if (BSpeed > 50.0f || BSpeed < 0.1f)
- {
- handler->SendSysMessage(LANG_BAD_VALUE);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
+ float backSpeed;
Player* target = handler->getSelectedPlayerOrSelf();
- if (!target)
+ if (CheckModifySpeed(handler, args, target, backSpeed, 0.1f, 50.0f))
{
- handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
- // check online security
- if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
- return false;
-
- std::string targetNameLink = handler->GetNameLink(target);
-
- if (target->IsInFlight())
- {
- handler->PSendSysMessage(LANG_CHAR_IN_FLIGHT, targetNameLink.c_str());
- handler->SetSentErrorMessage(true);
- return false;
+ NotifyModification(handler, target, LANG_YOU_CHANGE_BACK_SPEED, LANG_YOURS_BACK_SPEED_CHANGED, backSpeed);
+ target->SetSpeedRate(MOVE_RUN_BACK, backSpeed);
+ return true;
}
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_BACK_SPEED, BSpeed, targetNameLink.c_str());
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_BACK_SPEED_CHANGED, handler->GetNameLink().c_str(), BSpeed);
-
- target->SetSpeed(MOVE_RUN_BACK, BSpeed, true);
-
- return true;
+ return false;
}
//Edit Player Fly
static bool HandleModifyFlyCommand(ChatHandler* handler, const char* args)
{
- if (!*args)
- return false;
-
- float FSpeed = (float)atof((char*)args);
-
- if (FSpeed > 50.0f || FSpeed < 0.1f)
- {
- handler->SendSysMessage(LANG_BAD_VALUE);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
+ float flySpeed;
Player* target = handler->getSelectedPlayerOrSelf();
- if (!target)
+ if (CheckModifySpeed(handler, args, target, flySpeed, 0.1f, 50.0f, false))
{
- handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
- handler->SetSentErrorMessage(true);
- return false;
+ NotifyModification(handler, target, LANG_YOU_CHANGE_FLY_SPEED, LANG_YOURS_FLY_SPEED_CHANGED, flySpeed);
+ target->SetSpeedRate(MOVE_FLIGHT, flySpeed);
+ return true;
}
-
- // check online security
- if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
- return false;
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, handler->GetNameLink(target).c_str());
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, handler->GetNameLink().c_str(), FSpeed);
-
- target->SetSpeed(MOVE_FLIGHT, FSpeed, true);
-
- return true;
+ return false;
}
//Edit Player or Creature Scale
static bool HandleModifyScaleCommand(ChatHandler* handler, const char* args)
{
- if (!*args)
- return false;
-
- float Scale = (float)atof((char*)args);
- if (Scale > 10.0f || Scale < 0.1f)
- {
- handler->SendSysMessage(LANG_BAD_VALUE);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
+ float Scale;
Unit* target = handler->getSelectedUnit();
- if (!target)
+ if (CheckModifySpeed(handler, args, target, Scale, 0.1f, 10.0f, false))
{
- handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
- if (Player* player = target->ToPlayer())
- {
- // check online security
- if (handler->HasLowerSecurity(player, ObjectGuid::Empty))
- return false;
-
- handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, handler->GetNameLink(player).c_str());
- if (handler->needReportToTarget(player))
- ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale);
+ NotifyModification(handler, target, LANG_YOU_CHANGE_SIZE, LANG_YOURS_SIZE_CHANGED, Scale);
+ target->SetObjectScale(Scale);
+ return true;
}
-
- target->SetObjectScale(Scale);
-
- return true;
+ return false;
}
//Enable Player mount
@@ -932,9 +731,7 @@ public:
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
return false;
- handler->PSendSysMessage(LANG_YOU_GIVE_MOUNT, handler->GetNameLink(target).c_str());
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_MOUNT_GIVED, handler->GetNameLink().c_str());
+ NotifyModification(handler, target, LANG_YOU_GIVE_MOUNT, LANG_MOUNT_GIVED);
target->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP);
target->Mount(mId);
@@ -988,10 +785,7 @@ public:
TC_LOG_DEBUG("misc", handler->GetTrinityString(LANG_CURRENT_MONEY), targetMoney, moneyToAdd, newmoney);
if (newmoney <= 0)
{
- handler->PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, handler->GetNameLink(target).c_str());
- if (handler->needReportToTarget(target))
- ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ALL_MONEY_GONE, handler->GetNameLink().c_str());
-
+ NotifyModification(handler, target, LANG_YOU_TAKE_ALL_MONEY, LANG_YOURS_ALL_MONEY_GONE);
target->SetMoney(0);
}
else
@@ -1339,8 +1133,8 @@ public:
}
// Set gender
- target->SetByteValue(UNIT_FIELD_BYTES_0, 2, gender);
- target->SetByteValue(PLAYER_BYTES_3, 0, gender);
+ target->SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, gender);
+ target->SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER, gender);
// Change display ID
target->InitDisplayIds();
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index fbd199b99db..38aa96a6a66 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -113,7 +113,7 @@ EnumName<UnitFlags> const unitFlags[MAX_UNIT_FLAGS] =
{
CREATE_NAMED_ENUM(UNIT_FLAG_SERVER_CONTROLLED),
CREATE_NAMED_ENUM(UNIT_FLAG_NON_ATTACKABLE),
- CREATE_NAMED_ENUM(UNIT_FLAG_DISABLE_MOVE),
+ CREATE_NAMED_ENUM(UNIT_FLAG_REMOVE_CLIENT_CONTROL),
CREATE_NAMED_ENUM(UNIT_FLAG_PVP_ATTACKABLE),
CREATE_NAMED_ENUM(UNIT_FLAG_RENAME),
CREATE_NAMED_ENUM(UNIT_FLAG_PREPARATION),
@@ -125,7 +125,7 @@ EnumName<UnitFlags> const unitFlags[MAX_UNIT_FLAGS] =
CREATE_NAMED_ENUM(UNIT_FLAG_PET_IN_COMBAT),
CREATE_NAMED_ENUM(UNIT_FLAG_PVP),
CREATE_NAMED_ENUM(UNIT_FLAG_SILENCED),
- CREATE_NAMED_ENUM(UNIT_FLAG_UNK_14),
+ CREATE_NAMED_ENUM(UNIT_FLAG_CANNOT_SWIM),
CREATE_NAMED_ENUM(UNIT_FLAG_UNK_15),
CREATE_NAMED_ENUM(UNIT_FLAG_UNK_16),
CREATE_NAMED_ENUM(UNIT_FLAG_PACIFIED),
@@ -220,14 +220,15 @@ public:
{ "whisper", rbac::RBAC_PERM_COMMAND_NPC_WHISPER, false, &HandleNpcWhisperCommand, "" },
{ "yell", rbac::RBAC_PERM_COMMAND_NPC_YELL, false, &HandleNpcYellCommand, "" },
{ "tame", rbac::RBAC_PERM_COMMAND_NPC_TAME, false, &HandleNpcTameCommand, "" },
- { "add", rbac::RBAC_PERM_COMMAND_NPC_ADD, false, NULL, "", npcAddCommandTable },
- { "delete", rbac::RBAC_PERM_COMMAND_NPC_DELETE, false, NULL, "", npcDeleteCommandTable },
- { "follow", rbac::RBAC_PERM_COMMAND_NPC_FOLLOW, false, NULL, "", npcFollowCommandTable },
- { "set", rbac::RBAC_PERM_COMMAND_NPC_SET, false, NULL, "", npcSetCommandTable },
+ { "add", rbac::RBAC_PERM_COMMAND_NPC_ADD, false, nullptr, "", npcAddCommandTable },
+ { "delete", rbac::RBAC_PERM_COMMAND_NPC_DELETE, false, nullptr, "", npcDeleteCommandTable },
+ { "follow", rbac::RBAC_PERM_COMMAND_NPC_FOLLOW, false, nullptr, "", npcFollowCommandTable },
+ { "set", rbac::RBAC_PERM_COMMAND_NPC_SET, false, nullptr, "", npcSetCommandTable },
+ { "evade", rbac::RBAC_PERM_COMMAND_NPC_EVADE, false, &HandleNpcEvadeCommand, "" },
};
static std::vector<ChatCommand> commandTable =
{
- { "npc", rbac::RBAC_PERM_COMMAND_NPC, false, NULL, "", npcCommandTable },
+ { "npc", rbac::RBAC_PERM_COMMAND_NPC, false, nullptr, "", npcCommandTable },
};
return commandTable;
}
@@ -318,17 +319,17 @@ public:
uint32 itemId = item_int;
- char* fmaxcount = strtok(NULL, " "); //add maxcount, default: 0
+ char* fmaxcount = strtok(nullptr, " "); //add maxcount, default: 0
uint32 maxcount = 0;
if (fmaxcount)
maxcount = atoul(fmaxcount);
- char* fincrtime = strtok(NULL, " "); //add incrtime, default: 0
+ char* fincrtime = strtok(nullptr, " "); //add incrtime, default: 0
uint32 incrtime = 0;
if (fincrtime)
incrtime = atoul(fincrtime);
- char* fextendedcost = strtok(NULL, " "); //add ExtendedCost, default: 0
+ char* fextendedcost = strtok(nullptr, " "); //add ExtendedCost, default: 0
uint32 extendedcost = fextendedcost ? atoul(fextendedcost) : 0;
Creature* vendor = handler->getSelectedCreature();
if (!vendor)
@@ -361,7 +362,7 @@ public:
return false;
char* guidStr = strtok((char*)args, " ");
- char* waitStr = strtok((char*)NULL, " ");
+ char* waitStr = strtok((char*)nullptr, " ");
ObjectGuid::LowType lowGuid = atoi((char*)guidStr);
@@ -446,36 +447,24 @@ public:
}
Creature* creature = handler->getSelectedCreature();
- if (!creature)
+ if (!creature || creature->IsPet())
{
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
- if (creature->IsPet())
- {
- if (((Pet*)creature)->getPetType() == HUNTER_PET)
- {
- creature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr->GetXPForLevel(lvl)/4);
- creature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
- }
- ((Pet*)creature)->GivePetLevel(lvl);
- }
- else
- {
- creature->SetMaxHealth(100 + 30*lvl);
- creature->SetHealth(100 + 30*lvl);
- creature->SetLevel(lvl);
- creature->SaveToDB();
- }
+ creature->SetMaxHealth(100 + 30*lvl);
+ creature->SetHealth(100 + 30*lvl);
+ creature->SetLevel(lvl);
+ creature->SaveToDB();
return true;
}
static bool HandleNpcDeleteCommand(ChatHandler* handler, char const* args)
{
- Creature* unit = NULL;
+ Creature* unit = nullptr;
if (*args)
{
@@ -628,7 +617,7 @@ public:
return false;
char* arg1 = strtok((char*)args, " ");
- char* arg2 = strtok((char*)NULL, "");
+ char* arg2 = strtok((char*)nullptr, "");
if (!arg1 || !arg2)
return false;
@@ -926,8 +915,8 @@ public:
// later switched on/off according to special events (like escort
// quests, etc)
char* guid_str = strtok((char*)args, " ");
- char* type_str = strtok((char*)NULL, " ");
- char* dontdel_str = strtok((char*)NULL, " ");
+ char* type_str = strtok((char*)nullptr, " ");
+ char* dontdel_str = strtok((char*)nullptr, " ");
bool doNotDelete = false;
@@ -935,7 +924,7 @@ public:
return false;
ObjectGuid::LowType lowguid = 0;
- Creature* creature = NULL;
+ Creature* creature = nullptr;
if (dontdel_str)
{
@@ -961,7 +950,7 @@ public:
{
//TC_LOG_ERROR("misc", "DEBUG: type_str, NODEL ");
doNotDelete = true;
- type_str = NULL;
+ type_str = nullptr;
}
}
}
@@ -1001,7 +990,7 @@ public:
}
// now lowguid is low guid really existed creature
- // and creature point (maybe) to this creature or NULL
+ // and creature point (maybe) to this creature or nullptr
MovementGeneratorType move_type;
@@ -1260,7 +1249,7 @@ public:
}
char* receiver_str = strtok((char*)args, " ");
- char* text = strtok(NULL, "");
+ char* text = strtok(nullptr, "");
if (!receiver_str || !text)
{
@@ -1319,7 +1308,16 @@ public:
if (!*args)
return false;
- char* charID = handler->extractKeyFromLink((char*)args, "Hcreature_entry");
+ bool loot = false;
+ char const* spawntype_str = strtok((char*)args, " ");
+ char const* entry_str = strtok(nullptr, "");
+ if (stricmp(spawntype_str, "LOOT") == 0)
+ loot = true;
+ else if (stricmp(spawntype_str, "NOLOOT") == 0)
+ loot = false;
+ else
+ entry_str = args;
+ char* charID = handler->extractKeyFromLink((char*)entry_str, "Hcreature_entry");
if (!charID)
return false;
@@ -1332,7 +1330,7 @@ public:
if (!sObjectMgr->GetCreatureTemplate(id))
return false;
- chr->SummonCreature(id, *chr, TEMPSUMMON_CORPSE_DESPAWN, 120);
+ chr->SummonCreature(id, *chr, loot ? TEMPSUMMON_CORPSE_TIMED_DESPAWN : TEMPSUMMON_CORPSE_DESPAWN, 30 * IN_MILLISECONDS);
return true;
}
@@ -1404,6 +1402,51 @@ public:
return true;
}
+ static bool HandleNpcEvadeCommand(ChatHandler* handler, char const* args)
+ {
+ Creature* creatureTarget = handler->getSelectedCreature();
+ if (!creatureTarget || creatureTarget->IsPet())
+ {
+ handler->PSendSysMessage(LANG_SELECT_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (!creatureTarget->IsAIEnabled)
+ {
+ handler->PSendSysMessage(LANG_CREATURE_NOT_AI_ENABLED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* type_str = args ? strtok((char*)args, " ") : nullptr;
+ char* force_str = args ? strtok(nullptr, " ") : nullptr;
+
+ CreatureAI::EvadeReason why = CreatureAI::EVADE_REASON_OTHER;
+ bool force = false;
+ if (type_str)
+ {
+ if (stricmp(type_str, "NO_HOSTILES") == 0 || stricmp(type_str, "EVADE_REASON_NO_HOSTILES") == 0)
+ why = CreatureAI::EVADE_REASON_NO_HOSTILES;
+ else if (stricmp(type_str, "BOUNDARY") == 0 || stricmp(type_str, "EVADE_REASON_BOUNDARY") == 0)
+ why = CreatureAI::EVADE_REASON_BOUNDARY;
+ else if (stricmp(type_str, "SEQUENCE_BREAK") == 0 || stricmp(type_str, "EVADE_REASON_SEQUENCE_BREAK") == 0)
+ why = CreatureAI::EVADE_REASON_SEQUENCE_BREAK;
+ else if (stricmp(type_str, "FORCE") == 0)
+ force = true;
+
+ if (!force && force_str)
+ if (stricmp(force_str, "FORCE") == 0)
+ force = true;
+ }
+
+ if (force)
+ creatureTarget->ClearUnitState(UNIT_STATE_EVADE);
+ creatureTarget->AI()->EnterEvadeMode(why);
+
+ return true;
+ }
+
static bool HandleNpcAddFormationCommand(ChatHandler* handler, char const* args)
{
if (!*args)
@@ -1515,7 +1558,7 @@ public:
if (!pSlotID)
return false;
- char* pItemID = strtok(NULL, " ");
+ char* pItemID = strtok(nullptr, " ");
if (!pItemID)
return false;
diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp
index 4f0a179142d..a86de766117 100644
--- a/src/server/scripts/Commands/cs_pet.cpp
+++ b/src/server/scripts/Commands/cs_pet.cpp
@@ -22,6 +22,19 @@
#include "ObjectMgr.h"
#include "ScriptMgr.h"
+static inline Pet* GetSelectedPlayerPetOrOwn(ChatHandler* handler)
+{
+ if (Unit* target = handler->getSelectedUnit())
+ {
+ if (target->GetTypeId() == TYPEID_PLAYER)
+ return target->ToPlayer()->GetPet();
+ if (target->IsPet())
+ return target->ToPet();
+ return nullptr;
+ }
+ Player* player = handler->GetSession()->GetPlayer();
+ return player ? player->GetPet() : nullptr;
+}
class pet_commandscript : public CommandScript
{
public:
@@ -34,6 +47,7 @@ public:
{ "create", rbac::RBAC_PERM_COMMAND_PET_CREATE, false, &HandlePetCreateCommand, "" },
{ "learn", rbac::RBAC_PERM_COMMAND_PET_LEARN, false, &HandlePetLearnCommand, "" },
{ "unlearn", rbac::RBAC_PERM_COMMAND_PET_UNLEARN, false, &HandlePetUnlearnCommand, "" },
+ { "level", rbac::RBAC_PERM_COMMAND_PET_LEVEL, false, &HandlePetLevelCommand, "" },
};
static std::vector<ChatCommand> commandTable =
@@ -54,11 +68,11 @@ public:
return false;
}
- CreatureTemplate const* creatrueTemplate = creatureTarget->GetCreatureTemplate();
- // Creatures with family 0 crashes the server
- if (!creatrueTemplate->family)
+ CreatureTemplate const* creatureTemplate = creatureTarget->GetCreatureTemplate();
+ // Creatures with family CREATURE_FAMILY_NONE crashes the server
+ if (creatureTemplate->family == CREATURE_FAMILY_NONE)
{
- handler->PSendSysMessage("This creature cannot be tamed. (family id: 0).");
+ handler->PSendSysMessage("This creature cannot be tamed. Family id: 0 (CREATURE_FAMILY_NONE).");
handler->SetSentErrorMessage(true);
return false;
}
@@ -119,12 +133,11 @@ public:
if (!*args)
return false;
- Player* player = handler->GetSession()->GetPlayer();
- Pet* pet = player->GetPet();
+ Pet* pet = GetSelectedPlayerPetOrOwn(handler);
if (!pet)
{
- handler->PSendSysMessage("You have no pet");
+ handler->SendSysMessage(LANG_SELECT_PLAYER_OR_PET);
handler->SetSentErrorMessage(true);
return false;
}
@@ -162,11 +175,10 @@ public:
if (!*args)
return false;
- Player* player = handler->GetSession()->GetPlayer();
- Pet* pet = player->GetPet();
+ Pet* pet = GetSelectedPlayerPetOrOwn(handler);
if (!pet)
{
- handler->PSendSysMessage("You have no pet");
+ handler->SendSysMessage(LANG_SELECT_PLAYER_OR_PET);
handler->SetSentErrorMessage(true);
return false;
}
@@ -180,6 +192,37 @@ public:
return true;
}
+
+ static bool HandlePetLevelCommand(ChatHandler* handler, char const* args)
+ {
+ Pet* pet = GetSelectedPlayerPetOrOwn(handler);
+ Player* owner = pet ? pet->GetOwner() : nullptr;
+ if (!pet || !owner)
+ {
+ handler->SendSysMessage(LANG_SELECT_PLAYER_OR_PET);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ int32 level = args ? atoi(args) : 0;
+ if (level == 0)
+ level = owner->getLevel() - pet->getLevel();
+ if (level == 0 || level < -STRONG_MAX_LEVEL || level > STRONG_MAX_LEVEL)
+ {
+ handler->SendSysMessage(LANG_BAD_VALUE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ int32 newLevel = pet->getLevel() + level;
+ if (newLevel < 1)
+ newLevel = 1;
+ else if (newLevel > owner->getLevel())
+ newLevel = owner->getLevel();
+
+ pet->GivePetLevel(newLevel);
+ return true;
+ }
};
void AddSC_pet_commandscript()
diff --git a/src/server/scripts/Commands/cs_rbac.cpp b/src/server/scripts/Commands/cs_rbac.cpp
index f7c2d21c12d..64692c4d0ed 100644
--- a/src/server/scripts/Commands/cs_rbac.cpp
+++ b/src/server/scripts/Commands/cs_rbac.cpp
@@ -49,7 +49,7 @@ class rbac_commandscript : public CommandScript
public:
rbac_commandscript() : CommandScript("rbac_commandscript") { }
- std::vector<ChatCommand> GetCommands() const
+ std::vector<ChatCommand> GetCommands() const override
{
static std::vector<ChatCommand> rbacAccountCommandTable =
{
@@ -139,7 +139,7 @@ public:
{
accountName = param1;
- if (AccountMgr::normalizeString(accountName))
+ if (Utf8ToUpperOnlyLatin(accountName))
accountId = AccountMgr::GetId(accountName);
if (!accountId)
@@ -157,7 +157,7 @@ public:
if (!rdata)
{
- data->rbac = new rbac::RBACData(accountId, accountName, realmID, AccountMgr::GetSecurity(accountId, realmID));
+ data->rbac = new rbac::RBACData(accountId, accountName, realm.Id.Realm, AccountMgr::GetSecurity(accountId, realm.Id.Realm));
data->rbac->LoadFromDB();
data->needDelete = true;
}
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 56b0dbf43d0..4470fa7de42 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -91,7 +91,7 @@ public:
{ "disenchant_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_DISENCHANT_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesDisenchantCommand, "" },
{ "event_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_EVENT_SCRIPTS, true, &HandleReloadEventScriptsCommand, "" },
{ "fishing_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_FISHING_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesFishingCommand, "" },
- { "game_graveyard_zone", rbac::RBAC_PERM_COMMAND_RELOAD_GAME_GRAVEYARD_ZONE, true, &HandleReloadGameGraveyardZoneCommand, "" },
+ { "graveyard_zone", rbac::RBAC_PERM_COMMAND_RELOAD_GRAVEYARD_ZONE, true, &HandleReloadGameGraveyardZoneCommand, "" },
{ "game_tele", rbac::RBAC_PERM_COMMAND_RELOAD_GAME_TELE, true, &HandleReloadGameTeleCommand, "" },
{ "gameobject_questender", rbac::RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUESTENDER, true, &HandleReloadGOQuestEnderCommand, "" },
{ "gameobject_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_GAMEOBJECT_QUEST_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesGameobjectCommand, "" },
@@ -251,7 +251,7 @@ public:
static bool HandleReloadAllScriptsCommand(ChatHandler* handler, const char* /*args*/)
{
- if (sScriptMgr->IsScriptScheduled())
+ if (sMapMgr->IsScriptScheduled())
{
handler->PSendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
@@ -393,7 +393,7 @@ public:
static bool HandleReloadCommandCommand(ChatHandler* handler, const char* /*args*/)
{
- handler->SetLoadCommandTable(true);
+ ChatHandler::invalidateCommandTable();
handler->SendGlobalGMSysMessage("DB table `command` will be reloaded at next chat command use.");
return true;
}
@@ -893,7 +893,7 @@ public:
static bool HandleReloadEventScriptsCommand(ChatHandler* handler, const char* args)
{
- if (sScriptMgr->IsScriptScheduled())
+ if (sMapMgr->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
@@ -913,7 +913,7 @@ public:
static bool HandleReloadWpScriptsCommand(ChatHandler* handler, const char* args)
{
- if (sScriptMgr->IsScriptScheduled())
+ if (sMapMgr->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
@@ -946,7 +946,7 @@ public:
static bool HandleReloadSpellScriptsCommand(ChatHandler* handler, const char* args)
{
- if (sScriptMgr->IsScriptScheduled())
+ if (sMapMgr->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
index 05941120423..ba1dab28350 100644
--- a/src/server/scripts/Commands/cs_reset.cpp
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -102,7 +102,7 @@ public:
player->setFactionForRace(player->getRace());
- player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powerType << 24)));
+ player->SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE, powerType);
// reset only if player not in some form;
if (player->GetShapeshiftForm() == FORM_NONE)
diff --git a/src/server/scripts/Commands/cs_script_loader.cpp b/src/server/scripts/Commands/cs_script_loader.cpp
new file mode 100644
index 00000000000..449e7053942
--- /dev/null
+++ b/src/server/scripts/Commands/cs_script_loader.cpp
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+void AddSC_account_commandscript();
+void AddSC_achievement_commandscript();
+void AddSC_ahbot_commandscript();
+void AddSC_arena_commandscript();
+void AddSC_ban_commandscript();
+void AddSC_bf_commandscript();
+void AddSC_cast_commandscript();
+void AddSC_character_commandscript();
+void AddSC_cheat_commandscript();
+void AddSC_debug_commandscript();
+void AddSC_deserter_commandscript();
+void AddSC_disable_commandscript();
+void AddSC_event_commandscript();
+void AddSC_gm_commandscript();
+void AddSC_go_commandscript();
+void AddSC_gobject_commandscript();
+void AddSC_group_commandscript();
+void AddSC_guild_commandscript();
+void AddSC_honor_commandscript();
+void AddSC_instance_commandscript();
+void AddSC_learn_commandscript();
+void AddSC_lfg_commandscript();
+void AddSC_list_commandscript();
+void AddSC_lookup_commandscript();
+void AddSC_message_commandscript();
+void AddSC_misc_commandscript();
+void AddSC_mmaps_commandscript();
+void AddSC_modify_commandscript();
+void AddSC_npc_commandscript();
+void AddSC_pet_commandscript();
+void AddSC_quest_commandscript();
+void AddSC_rbac_commandscript();
+void AddSC_reload_commandscript();
+void AddSC_reset_commandscript();
+void AddSC_send_commandscript();
+void AddSC_server_commandscript();
+void AddSC_tele_commandscript();
+void AddSC_ticket_commandscript();
+void AddSC_titles_commandscript();
+void AddSC_wp_commandscript();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddCommandsScripts()
+{
+ AddSC_account_commandscript();
+ AddSC_achievement_commandscript();
+ AddSC_ahbot_commandscript();
+ AddSC_arena_commandscript();
+ AddSC_ban_commandscript();
+ AddSC_bf_commandscript();
+ AddSC_cast_commandscript();
+ AddSC_character_commandscript();
+ AddSC_cheat_commandscript();
+ AddSC_debug_commandscript();
+ AddSC_deserter_commandscript();
+ AddSC_disable_commandscript();
+ AddSC_event_commandscript();
+ AddSC_gm_commandscript();
+ AddSC_go_commandscript();
+ AddSC_gobject_commandscript();
+ AddSC_group_commandscript();
+ AddSC_guild_commandscript();
+ AddSC_honor_commandscript();
+ AddSC_instance_commandscript();
+ AddSC_learn_commandscript();
+ AddSC_lookup_commandscript();
+ AddSC_lfg_commandscript();
+ AddSC_list_commandscript();
+ AddSC_message_commandscript();
+ AddSC_misc_commandscript();
+ AddSC_mmaps_commandscript();
+ AddSC_modify_commandscript();
+ AddSC_npc_commandscript();
+ AddSC_quest_commandscript();
+ AddSC_pet_commandscript();
+ AddSC_rbac_commandscript();
+ AddSC_reload_commandscript();
+ AddSC_reset_commandscript();
+ AddSC_send_commandscript();
+ AddSC_server_commandscript();
+ AddSC_tele_commandscript();
+ AddSC_ticket_commandscript();
+ AddSC_titles_commandscript();
+ AddSC_wp_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_send.cpp b/src/server/scripts/Commands/cs_send.cpp
index 672db3a3ab0..31544543426 100644
--- a/src/server/scripts/Commands/cs_send.cpp
+++ b/src/server/scripts/Commands/cs_send.cpp
@@ -74,7 +74,7 @@ public:
std::string subject = msgSubject;
std::string text = msgText;
- // from console show not existed sender
+ // from console, use non-existing sender
MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : 0, MAIL_STATIONERY_GM);
/// @todo Fix poor design
@@ -173,7 +173,7 @@ public:
}
}
- // from console show not existed sender
+ // from console show nonexisting sender
MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : 0, MAIL_STATIONERY_GM);
// fill mail
@@ -185,7 +185,7 @@ public:
{
if (Item* item = Item::CreateItem(itr->first, itr->second, handler->GetSession() ? handler->GetSession()->GetPlayer() : 0))
{
- item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted
+ item->SaveToDB(trans); // Save to prevent being lost at next mail load. If send fails, the item will be deleted.
draft.AddItem(item);
}
}
@@ -233,7 +233,7 @@ public:
std::string subject = msgSubject;
std::string text = msgText;
- // from console show not existed sender
+ // from console show nonexisting sender
MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : 0, MAIL_STATIONERY_GM);
SQLTransaction trans = CharacterDatabase.BeginTransaction();
@@ -260,7 +260,7 @@ public:
if (!msgStr)
return false;
- ///- Check that he is not logging out.
+ /// - Check if player is logging out.
if (player->GetSession()->isLogingOut())
{
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp
index 83bc2e47674..47239dba720 100644
--- a/src/server/scripts/Commands/cs_server.cpp
+++ b/src/server/scripts/Commands/cs_server.cpp
@@ -29,6 +29,7 @@ EndScriptData */
#include "Player.h"
#include "ScriptMgr.h"
#include "GitRevision.h"
+#include "Util.h"
class server_commandscript : public CommandScript
{
@@ -52,12 +53,14 @@ public:
static std::vector<ChatCommand> serverRestartCommandTable =
{
{ "cancel", rbac::RBAC_PERM_COMMAND_SERVER_RESTART_CANCEL, true, &HandleServerShutDownCancelCommand, "" },
+ { "force", rbac::RBAC_PERM_COMMAND_SERVER_RESTART_FORCE, true, &HandleServerForceRestartCommand, "" },
{ "" , rbac::RBAC_PERM_COMMAND_SERVER_RESTART, true, &HandleServerRestartCommand, "" },
};
static std::vector<ChatCommand> serverShutdownCommandTable =
{
{ "cancel", rbac::RBAC_PERM_COMMAND_SERVER_SHUTDOWN_CANCEL, true, &HandleServerShutDownCancelCommand, "" },
+ { "force", rbac::RBAC_PERM_COMMAND_SERVER_SHUTDOWN_FORCE, true, &HandleServerForceShutDownCommand, "" },
{ "" , rbac::RBAC_PERM_COMMAND_SERVER_SHUTDOWN, true, &HandleServerShutDownCommand, "" },
};
@@ -73,19 +76,19 @@ public:
{
{ "corpses", rbac::RBAC_PERM_COMMAND_SERVER_CORPSES, true, &HandleServerCorpsesCommand, "" },
{ "exit", rbac::RBAC_PERM_COMMAND_SERVER_EXIT, true, &HandleServerExitCommand, "" },
- { "idlerestart", rbac::RBAC_PERM_COMMAND_SERVER_IDLERESTART, true, NULL, "", serverIdleRestartCommandTable },
- { "idleshutdown", rbac::RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN, true, NULL, "", serverIdleShutdownCommandTable },
+ { "idlerestart", rbac::RBAC_PERM_COMMAND_SERVER_IDLERESTART, true, nullptr, "", serverIdleRestartCommandTable },
+ { "idleshutdown", rbac::RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN, true, nullptr, "", serverIdleShutdownCommandTable },
{ "info", rbac::RBAC_PERM_COMMAND_SERVER_INFO, true, &HandleServerInfoCommand, "" },
{ "motd", rbac::RBAC_PERM_COMMAND_SERVER_MOTD, true, &HandleServerMotdCommand, "" },
{ "plimit", rbac::RBAC_PERM_COMMAND_SERVER_PLIMIT, true, &HandleServerPLimitCommand, "" },
- { "restart", rbac::RBAC_PERM_COMMAND_SERVER_RESTART, true, NULL, "", serverRestartCommandTable },
- { "shutdown", rbac::RBAC_PERM_COMMAND_SERVER_SHUTDOWN, true, NULL, "", serverShutdownCommandTable },
- { "set", rbac::RBAC_PERM_COMMAND_SERVER_SET, true, NULL, "", serverSetCommandTable },
+ { "restart", rbac::RBAC_PERM_COMMAND_SERVER_RESTART, true, nullptr, "", serverRestartCommandTable },
+ { "shutdown", rbac::RBAC_PERM_COMMAND_SERVER_SHUTDOWN, true, nullptr, "", serverShutdownCommandTable },
+ { "set", rbac::RBAC_PERM_COMMAND_SERVER_SET, true, nullptr, "", serverSetCommandTable },
};
static std::vector<ChatCommand> commandTable =
{
- { "server", rbac::RBAC_PERM_COMMAND_SERVER, true, NULL, "", serverCommandTable },
+ { "server", rbac::RBAC_PERM_COMMAND_SERVER, true, nullptr, "", serverCommandTable },
};
return commandTable;
}
@@ -192,19 +195,34 @@ public:
return true;
}
- static bool HandleServerShutDownCommand(ChatHandler* /*handler*/, char const* args)
+ static bool IsOnlyUser(WorldSession* mySession)
{
- return ShutdownServer(args, 0, SHUTDOWN_EXIT_CODE);
+ // check if there is any session connected from a different address
+ std::string myAddr = mySession ? mySession->GetRemoteAddress() : "";
+ SessionMap const& sessions = sWorld->GetAllSessions();
+ for (SessionMap::value_type const& session : sessions)
+ if (session.second && myAddr != session.second->GetRemoteAddress())
+ return false;
+ return true;
+ }
+ static bool HandleServerShutDownCommand(ChatHandler* handler, char const* args)
+ {
+ return ShutdownServer(args, IsOnlyUser(handler->GetSession()) ? SHUTDOWN_MASK_FORCE : 0, SHUTDOWN_EXIT_CODE);
}
- static bool HandleServerRestartCommand(ChatHandler* /*handler*/, char const* args)
+ static bool HandleServerRestartCommand(ChatHandler* handler, char const* args)
{
- return ShutdownServer(args, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
+ return ShutdownServer(args, IsOnlyUser(handler->GetSession()) ? (SHUTDOWN_MASK_FORCE | SHUTDOWN_MASK_RESTART) : SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
}
- static bool HandleServerIdleRestartCommand(ChatHandler* /*handler*/, char const* args)
+ static bool HandleServerForceShutDownCommand(ChatHandler* /*handler*/, char const* args)
{
- return ShutdownServer(args, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE);
+ return ShutdownServer(args, SHUTDOWN_MASK_FORCE, SHUTDOWN_EXIT_CODE);
+ }
+
+ static bool HandleServerForceRestartCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ return ShutdownServer(args, SHUTDOWN_MASK_FORCE | SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
}
static bool HandleServerIdleShutDownCommand(ChatHandler* /*handler*/, char const* args)
@@ -212,6 +230,11 @@ public:
return ShutdownServer(args, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE);
}
+ static bool HandleServerIdleRestartCommand(ChatHandler* /*handler*/, char const* args)
+ {
+ return ShutdownServer(args, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE);
+ }
+
// Exit the realm
static bool HandleServerExitCommand(ChatHandler* handler, char const* /*args*/)
{
@@ -256,8 +279,8 @@ public:
return false;
char* type = strtok((char*)args, " ");
- char* name = strtok(NULL, " ");
- char* level = strtok(NULL, " ");
+ char* name = strtok(nullptr, " ");
+ char* level = strtok(nullptr, " ");
if (!type || !name || !level || *name == '\0' || *level == '\0' || (*type != 'a' && *type != 'l'))
return false;
@@ -313,10 +336,26 @@ private:
return false;
// #delay [#exit_code] [reason]
+ int32 delay = 0;
char* delayStr = strtok((char*)args, " ");
- if (!delayStr || !isNumeric(delayStr))
+ if (!delayStr)
return false;
+ if (isNumeric(delayStr))
+ {
+ delay = atoi(delayStr);
+ // Prevent interpret wrong arg value as 0 secs shutdown time
+ if ((delay == 0 && (delayStr[0] != '0' || delayStr[1] != '\0')) || delay < 0)
+ return false;
+ }
+ else
+ {
+ delay = TimeStringToSecs(std::string(delayStr));
+
+ if (delay == 0)
+ return false;
+ }
+
char* exitCodeStr = nullptr;
char reason[256] = { 0 };
@@ -337,17 +376,15 @@ private:
}
}
- int32 delay = atoi(delayStr);
-
- // Prevent interpret wrong arg value as 0 secs shutdown time
- if ((delay == 0 && (delayStr[0] != '0' || delayStr[1] != '\0')) || delay < 0)
- return false;
-
int32 exitCode = defaultExitCode;
if (exitCodeStr)
if (!ParseExitCode(exitCodeStr, exitCode))
return false;
+ // Override parameter "delay" with the configuration value if there are still players connected and "force" parameter was not specified
+ if (delay < (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD) && !(shutdownMask & SHUTDOWN_MASK_FORCE))
+ delay = (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD);
+
sWorld->ShutdownServ(delay, shutdownMask, static_cast<uint8>(exitCode), std::string(reason));
return true;
diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp
index c5c85f5f3cc..26f712eb8ef 100644
--- a/src/server/scripts/Commands/cs_ticket.cpp
+++ b/src/server/scripts/Commands/cs_ticket.cpp
@@ -95,7 +95,7 @@ public:
ObjectGuid targetGuid = sObjectMgr->GetPlayerGUIDByName(target);
uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
// Target must exist and have administrative rights
- if (!AccountMgr::HasPermission(accountId, rbac::RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET, realmID))
+ if (!AccountMgr::HasPermission(accountId, rbac::RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET, realm.Id.Realm))
{
handler->SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A);
return true;
@@ -119,7 +119,7 @@ public:
// Assign ticket
SQLTransaction trans = SQLTransaction(NULL);
- ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(AccountMgr::GetSecurity(accountId, realmID)));
+ ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(AccountMgr::GetSecurity(accountId, realm.Id.Realm)));
ticket->SaveToDB(trans);
sTicketMgr->UpdateLastChange();
@@ -199,7 +199,12 @@ public:
ticket->SaveToDB(trans);
sTicketMgr->UpdateLastChange();
- std::string msg = ticket->FormatMessageString(*handler, NULL, ticket->GetAssignedToName().c_str(), NULL, NULL, NULL);
+ std::string msg = [&] {
+ std::string const assignedName = ticket->GetAssignedToName();
+ return ticket->FormatMessageString(*handler, nullptr,
+ assignedName.empty() ? nullptr : assignedName.c_str(), nullptr, nullptr, nullptr);
+ }();
+
msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName().c_str() : "Console", comment);
handler->SendGlobalGMSysMessage(msg.c_str());
@@ -387,7 +392,7 @@ public:
{
ObjectGuid guid = ticket->GetAssignedToGUID();
uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(guid);
- security = AccountMgr::GetSecurity(accountId, realmID);
+ security = AccountMgr::GetSecurity(accountId, realm.Id.Realm);
}
// Check security
diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp
index 2f5d7b8364c..6309e7279c9 100644
--- a/src/server/scripts/Commands/cs_titles.cpp
+++ b/src/server/scripts/Commands/cs_titles.cpp
@@ -225,7 +225,7 @@ public:
if (CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i))
titles2 &= ~(uint64(1) << tEntry->bit_index);
- titles &= ~titles2; // remove not existed titles
+ titles &= ~titles2; // remove non-existing titles
target->SetUInt64Value(PLAYER__FIELD_KNOWN_TITLES, titles);
handler->SendSysMessage(LANG_DONE);
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index ef61c231104..424f94f7385 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -561,29 +561,24 @@ public:
// -> variable lowguid is filled with the GUID of the NPC
uint32 pathid = 0;
uint32 point = 0;
- uint32 wpGuid = 0;
Creature* target = handler->getSelectedCreature();
PreparedStatement* stmt = NULL;
+ // User did select a visual waypoint?
if (!target || target->GetEntry() != VISUAL_WAYPOINT)
{
handler->SendSysMessage("|cffff33ffERROR: You must select a waypoint.|r");
return false;
}
- // The visual waypoint
- wpGuid = target->GetGUID().GetCounter();
-
- // User did select a visual waypoint?
-
// Check the creature
stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_WPGUID);
- stmt->setUInt32(0, wpGuid);
+ stmt->setUInt32(0, target->GetSpawnId());
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
{
- handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUID().GetCounter());
+ handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetSpawnId());
// Select waypoint number from database
// Since we compare float values, we have to deal with
// some difficulties.
@@ -599,11 +594,11 @@ public:
stmt->setString(3, maxDiff);
stmt->setFloat(4, target->GetPositionZ());
stmt->setString(5, maxDiff);
- PreparedQueryResult queryResult = WorldDatabase.Query(stmt);
+ result = WorldDatabase.Query(stmt);
- if (!queryResult)
+ if (!result)
{
- handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, wpGuid);
+ handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, target->GetSpawnId());
return true;
}
}
@@ -631,13 +626,8 @@ public:
{
handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid);
- if (wpGuid != 0)
- if (Creature* wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HighGuid::Unit, VISUAL_WAYPOINT, wpGuid)))
- {
- wpCreature->CombatStop();
- wpCreature->DeleteFromDB();
- wpCreature->AddObjectToRemoveList();
- }
+ target->DeleteFromDB();
+ target->AddObjectToRemoveList();
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_WAYPOINT_DATA);
stmt->setUInt32(0, pathid);
@@ -659,51 +649,40 @@ public:
Player* chr = handler->GetSession()->GetPlayer();
Map* map = chr->GetMap();
+ // What to do:
+ // Move the visual spawnpoint
+ // Respawn the owner of the waypoints
+ target->DeleteFromDB();
+ target->AddObjectToRemoveList();
+
+ // re-create
+ Creature* wpCreature = new Creature();
+ if (!wpCreature->Create(map->GenerateLowGuid<HighGuid::Unit>(), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
{
- // What to do:
- // Move the visual spawnpoint
- // Respawn the owner of the waypoints
- if (wpGuid != 0)
- {
- if (Creature* wpCreature = map->GetCreature(ObjectGuid(HighGuid::Unit, VISUAL_WAYPOINT, wpGuid)))
- {
- wpCreature->CombatStop();
- wpCreature->DeleteFromDB();
- wpCreature->AddObjectToRemoveList();
- }
- // re-create
- Creature* wpCreature2 = new Creature();
- if (!wpCreature2->Create(map->GenerateLowGuid<HighGuid::Unit>(), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
- {
- handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
- delete wpCreature2;
- wpCreature2 = NULL;
- return false;
- }
+ handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
+ delete wpCreature;
+ return false;
+ }
- wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
- // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
- /// @todo Should we first use "Create" then use "LoadFromDB"?
- if (!wpCreature2->LoadCreatureFromDB(wpCreature2->GetSpawnId(), map))
- {
- handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
- delete wpCreature2;
- wpCreature2 = NULL;
- return false;
- }
- //sMapMgr->GetMap(npcCreature->GetMapId())->Add(wpCreature2);
- }
+ wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
+ // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
+ /// @todo Should we first use "Create" then use "LoadFromDB"?
+ if (!wpCreature->LoadCreatureFromDB(wpCreature->GetSpawnId(), map))
+ {
+ handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
+ delete wpCreature;
+ return false;
+ }
- stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_POSITION);
- stmt->setFloat(0, chr->GetPositionX());
- stmt->setFloat(1, chr->GetPositionY());
- stmt->setFloat(2, chr->GetPositionZ());
- stmt->setUInt32(3, pathid);
- stmt->setUInt32(4, point);
- WorldDatabase.Execute(stmt);
+ stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_POSITION);
+ stmt->setFloat(0, chr->GetPositionX());
+ stmt->setFloat(1, chr->GetPositionY());
+ stmt->setFloat(2, chr->GetPositionZ());
+ stmt->setUInt32(3, pathid);
+ stmt->setUInt32(4, point);
+ WorldDatabase.Execute(stmt);
- handler->PSendSysMessage(LANG_WAYPOINT_CHANGED);
- }
+ handler->PSendSysMessage(LANG_WAYPOINT_CHANGED);
return true;
} // move
@@ -897,14 +876,15 @@ public:
return false;
}
+ wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
+
// Set "wpguid" column to the visual waypoint
stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_WPGUID);
- stmt->setInt32(0, int32(wpCreature->GetGUID().GetCounter()));
+ stmt->setInt32(0, int32(wpCreature->GetSpawnId()));
stmt->setUInt32(1, pathid);
stmt->setUInt32(2, point);
WorldDatabase.Execute(stmt);
- wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
if (!wpCreature->LoadCreatureFromDB(wpCreature->GetSpawnId(), map))
{
diff --git a/src/server/scripts/Custom/custom_script_loader.cpp b/src/server/scripts/Custom/custom_script_loader.cpp
new file mode 100644
index 00000000000..dd4b5e99d77
--- /dev/null
+++ b/src/server/scripts/Custom/custom_script_loader.cpp
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddCustomScripts()
+{
+}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
index 9cd724e5596..7b07c9272da 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
@@ -415,112 +415,12 @@ public:
};
};
-// npc_kharan_mighthammer
-enum KharamQuests
-{
- QUEST_4001 = 4001,
- QUEST_4342 = 4342
-};
-
-#define GOSSIP_ITEM_KHARAN_1 "I need to know where the princess are, Kharan!"
-#define GOSSIP_ITEM_KHARAN_2 "All is not lost, Kharan!"
-#define GOSSIP_ITEM_KHARAN_3 "Gor'shak is my friend, you can trust me."
-#define GOSSIP_ITEM_KHARAN_4 "Not enough, you need to tell me more."
-#define GOSSIP_ITEM_KHARAN_5 "So what happened?"
-#define GOSSIP_ITEM_KHARAN_6 "Continue..."
-#define GOSSIP_ITEM_KHARAN_7 "So you suspect that someone on the inside was involved? That they were tipped off?"
-#define GOSSIP_ITEM_KHARAN_8 "Continue with your story please."
-#define GOSSIP_ITEM_KHARAN_9 "Indeed."
-#define GOSSIP_ITEM_KHARAN_10 "The door is open, Kharan. You are a free man."
-
-class npc_kharan_mighthammer : public CreatureScript
-{
-public:
- npc_kharan_mighthammer() : CreatureScript("npc_kharan_mighthammer") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(2475, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(2476, creature->GetGUID());
- break;
-
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(2477, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(2478, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(2479, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
- player->SEND_GOSSIP_MENU(2480, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
- player->SEND_GOSSIP_MENU(2481, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+8:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
- player->SEND_GOSSIP_MENU(2482, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+9:
- player->CLOSE_GOSSIP_MENU();
- if (player->GetTeam() == HORDE)
- player->AreaExploredOrEventHappens(QUEST_4001);
- else
- player->AreaExploredOrEventHappens(QUEST_4342);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(QUEST_4001) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- if (player->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
-
- if (player->GetTeam() == HORDE)
- player->SEND_GOSSIP_MENU(2473, creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(2474, creature->GetGUID());
-
- return true;
- }
-};
-
// npc_lokhtos_darkbargainer
-enum LokhtosItems
+enum Lokhtos
{
+ QUEST_A_BINDING_CONTRACT = 7604,
+ ITEM_SULFURON_INGOT = 17203,
ITEM_THRORIUM_BROTHERHOOD_CONTRACT = 18628,
- ITEM_SULFURON_INGOT = 17203
-};
-
-enum LokhtosQuests
-{
- QUEST_A_BINDING_CONTRACT = 7604
-};
-
-enum LokhtosSpells
-{
SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND = 23059
};
@@ -570,67 +470,12 @@ public:
}
};
-// npc_dughal_stormwing
-enum DughalQuests
-{
- QUEST_JAIL_BREAK = 4322
-};
-
-#define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!"
-#define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!"
-
-// npc_marshal_windsor
-#define SAY_WINDSOR_AGGRO1 "You locked up the wrong Marshal. Prepare to be destroyed!"
-#define SAY_WINDSOR_AGGRO2 "I bet you're sorry now, aren't you !?!!"
-#define SAY_WINDSOR_AGGRO3 "You better hold me back $N or they are going to feel some prison house beatings."
-#define SAY_WINDSOR_1 "Let's get a move on. My gear should be in the storage area up this way..."
-#define SAY_WINDSOR_4_1 "Check that cell, $N. If someone is alive in there, we need to get them out."
-#define SAY_WINDSOR_4_2 "Get him out of there!"
-#define SAY_WINDSOR_4_3 "Good work! We're almost there, $N. This way."
-#define SAY_WINDSOR_6 "This is it, $N. My stuff should be in that room. Cover me, I'm going in!"
-#define SAY_WINDSOR_9 "Ah, there it is!"
-
-enum MarshalWindsor
-{
- NPC_REGINALD_WINDSOR = 9682
-};
-
-// npc_marshal_reginald_windsor
-#define SAY_REGINALD_WINDSOR_0_1 "Can you feel the power, $N??? It's time to ROCK!"
-#define SAY_REGINALD_WINDSOR_0_2 "Now we just have to free Tobias and we can get out of here. This way!"
-#define SAY_REGINALD_WINDSOR_5_1 "Open it."
-#define SAY_REGINALD_WINDSOR_5_2 "I never did like those two. Let's get moving."
-#define SAY_REGINALD_WINDSOR_7_1 "Open it and be careful this time!"
-#define SAY_REGINALD_WINDSOR_7_2 "That intolerant dirtbag finally got what was coming to him. Good riddance!"
-#define SAY_REGINALD_WINDSOR_7_3 "Alright, let's go."
-#define SAY_REGINALD_WINDSOR_13_1 "Open it. We need to hurry up. I can smell those Dark Irons coming a mile away and I can tell you one thing, they're COMING!"
-#define SAY_REGINALD_WINDSOR_13_2 "Administering fists of fury on Crest Killer!"
-#define SAY_REGINALD_WINDSOR_13_3 "He has to be in the last cell. Unless... they killed him."
-#define SAY_REGINALD_WINDSOR_14_1 "Get him out of there!"
-#define SAY_REGINALD_WINDSOR_14_2 "Excellent work, $N. Let's find the exit. I think I know the way. Follow me!"
-#define SAY_REGINALD_WINDSOR_20_1 "We made it!"
-#define SAY_REGINALD_WINDSOR_20_2 "Meet me at Maxwell's encampment. We'll go over the next stages of the plan there and figure out a way to decode my tablets without the decryption ring."
-
-enum MarshalReginaldWindor
-{
- NPC_SHILL_DINGER = 9678,
- NPC_CREST_KILLER = 9680
-};
-
// npc_rocknot
-enum RocknotSays
-{
- SAY_GOT_BEER = 0
-};
-
-enum RocknotSpells
-{
- SPELL_DRUNKEN_RAGE = 14872
-};
-
-enum RocknotQuests
+enum Rocknot
{
- QUEST_ALE = 4295
+ SAY_GOT_BEER = 0,
+ QUEST_ALE = 4295,
+ SPELL_DRUNKEN_RAGE = 14872
};
class npc_rocknot : public CreatureScript
@@ -771,7 +616,6 @@ void AddSC_blackrock_depths()
new at_ring_of_law();
new npc_grimstone();
new npc_phalanx();
- new npc_kharan_mighthammer();
new npc_lokhtos_darkbargainer();
new npc_rocknot();
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp
index 817aaf0a253..f962a019da6 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp
@@ -187,6 +187,12 @@ public:
events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(17000, 19000));
}
+ void IsSummonedBy(Unit* /*summoner*/) override
+ {
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ DoZoneInCombat();
+ }
+
void JustDied(Unit* /*killer*/) override
{
_JustDied();
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
index 4a6fee12098..995fc44abd0 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
@@ -206,9 +206,10 @@ public:
Talk(SAY_GAMESBEGIN_2);
me->setFaction(103);
- me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
DoCast(me, SPELL_NEFARIANS_BARRIER);
me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
AttackStart(target);
events.ScheduleEvent(EVENT_SHADOW_BOLT, urand(3000, 10000));
events.ScheduleEvent(EVENT_FEAR, urand(10000, 20000));
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp
index e58bded801b..e97b7cba388 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp
@@ -32,6 +32,7 @@ enum Say
enum Spells
{
+ // @todo orb uses the wrong spell, this needs sniffs
SPELL_MINDCONTROL = 42013,
SPELL_CHANNEL = 45537,
SPELL_EGG_DESTROY = 19873,
@@ -103,7 +104,7 @@ public:
secondPhase = true;
me->RemoveAllAuras();
- me->SetHealth(me->GetMaxHealth());
+ me->SetFullHealth();
}
void DoAction(int32 action) override
@@ -114,6 +115,7 @@ public:
void DamageTaken(Unit* /*who*/, uint32& damage) override
{
+ // @todo this is wrong - razorgore should still take damage, he should just nuke the whole room and respawn if he dies during P1
if (!secondPhase)
damage = 0;
}
@@ -146,6 +148,7 @@ public:
break;
case EVENT_CONFLAGRATION:
DoCastVictim(SPELL_CONFLAGRATION);
+ // @todo is this even necessary? pretty sure AI ignores targets with disorient by default
if (me->GetVictim() && me->EnsureVictim()->HasAura(SPELL_CONFLAGRATION))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
me->TauntApply(target);
@@ -175,10 +178,10 @@ public:
{
if (InstanceScript* instance = go->GetInstanceScript())
if (instance->GetData(DATA_EGG_EVENT) != DONE)
- if (Creature* razor = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
+ if (Creature* razorgore = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
{
- razor->Attack(player, true);
- player->CastSpell(razor, SPELL_MINDCONTROL);
+ razorgore->Attack(player, true);
+ player->CastSpell(razorgore, SPELL_MINDCONTROL);
}
return true;
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
index 51bb314968d..ffec32c0619 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
@@ -27,6 +27,8 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "molten_core.h"
+#include "SpellAuraEffects.h"
+#include "SpellScript.h"
enum Emotes
{
@@ -36,9 +38,10 @@ enum Emotes
enum Spells
{
SPELL_INFERNO = 19695,
+ SPELL_INFERNO_DMG = 19698,
SPELL_IGNITE_MANA = 19659,
SPELL_LIVING_BOMB = 20475,
- SPELL_ARMAGEDDON = 20479,
+ SPELL_ARMAGEDDON = 20478,
};
enum Events
@@ -119,7 +122,36 @@ class boss_baron_geddon : public CreatureScript
}
};
+class spell_baron_geddon_inferno : public SpellScriptLoader
+{
+ public:
+ spell_baron_geddon_inferno() : SpellScriptLoader("spell_baron_geddon_inferno") { }
+
+ class spell_baron_geddon_inferno_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_baron_geddon_inferno_AuraScript);
+
+ void OnPeriodic(AuraEffect const* aurEff)
+ {
+ PreventDefaultAction();
+ int32 damageForTick[8] = { 500, 500, 1000, 1000, 2000, 2000, 3000, 5000 };
+ GetTarget()->CastCustomSpell(SPELL_INFERNO_DMG, SPELLVALUE_BASE_POINT0, damageForTick[aurEff->GetTickNumber() - 1], (Unit*)nullptr, TRIGGERED_FULL_MASK, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_baron_geddon_inferno_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_baron_geddon_inferno_AuraScript();
+ }
+};
+
void AddSC_boss_baron_geddon()
{
new boss_baron_geddon();
+ new spell_baron_geddon_inferno();
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
index 9b487f7b5f9..8cff67d9f28 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
@@ -44,16 +44,20 @@ enum Texts
enum Spells
{
- SPELL_MAGIC_REFLECTION = 20619,
- SPELL_DAMAGE_REFLECTION = 21075,
+ SPELL_SUMMON_RAGNAROS = 19774,
SPELL_BLAST_WAVE = 20229,
- SPELL_AEGIS_OF_RAGNAROS = 20620,
SPELL_TELEPORT = 20618,
- SPELL_SUMMON_RAGNAROS = 19774,
+ SPELL_MAGIC_REFLECTION = 20619,
+ SPELL_AEGIS_OF_RAGNAROS = 20620,
+ SPELL_DAMAGE_REFLECTION = 21075
};
-#define GOSSIP_HELLO 4995
-#define GOSSIP_SELECT "Tell me more."
+enum Extras
+{
+ OPTION_ID_YOU_CHALLENGED_US = 0,
+ FACTION_FRIENDLY = 35,
+ MENU_OPTION_YOU_CHALLENGED_US = 4108
+};
enum Events
{
@@ -64,7 +68,7 @@ enum Events
EVENT_OUTRO_1 = 5,
EVENT_OUTRO_2 = 6,
- EVENT_OUTRO_3 = 7,
+ EVENT_OUTRO_3 = 7
};
class boss_majordomo : public CreatureScript
@@ -106,7 +110,7 @@ class boss_majordomo : public CreatureScript
if (!me->FindNearestCreature(NPC_FLAMEWAKER_HEALER, 100.0f) && !me->FindNearestCreature(NPC_FLAMEWAKER_ELITE, 100.0f))
{
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me);
- me->setFaction(35);
+ me->setFaction(FACTION_FRIENDLY);
EnterEvadeMode();
Talk(SAY_DEFEAT);
_JustDied();
@@ -184,25 +188,20 @@ class boss_majordomo : public CreatureScript
}
else if (action == ACTION_START_RAGNAROS_ALT)
{
- me->setFaction(35);
+ me->setFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
}
- };
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(GOSSIP_HELLO, creature->GetGUID());
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
- {
- player->CLOSE_GOSSIP_MENU();
- creature->AI()->DoAction(ACTION_START_RAGNAROS);
- return true;
- }
+ void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
+ {
+ if (menuId == MENU_OPTION_YOU_CHALLENGED_US && gossipListId == OPTION_ID_YOU_CHALLENGED_US)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ DoAction(ACTION_START_RAGNAROS);
+ }
+ }
+ };
CreatureAI* GetAI(Creature* creature) const override
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
index e0cae87051f..a89a6b491e8 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
@@ -159,7 +159,7 @@ class boss_ragnaros : public CreatureScript
break;
case EVENT_INTRO_5:
me->SetReactState(REACT_AGGRESSIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
_introState = 2;
break;
default:
diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt
deleted file mode 100644
index 8e6616347f9..00000000000
--- a/src/server/scripts/EasternKingdoms/CMakeLists.txt
+++ /dev/null
@@ -1,204 +0,0 @@
-# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
-#
-# This file is free software; as a special exception the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- EasternKingdoms/zone_ghostlands.cpp
- EasternKingdoms/AlteracValley/boss_galvangar.cpp
- EasternKingdoms/AlteracValley/boss_balinda.cpp
- EasternKingdoms/AlteracValley/boss_drekthar.cpp
- EasternKingdoms/AlteracValley/boss_vanndar.cpp
- EasternKingdoms/AlteracValley/alterac_valley.cpp
- EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_high_interrogator_gerstahn.cpp
- EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
- EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
- EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_general_angerforge.cpp
- EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_ambassador_flamelash.cpp
- EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp
- EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_moira_bronzebeard.cpp
- EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.h
- EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp
- EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_magmus.cpp
- EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
- EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp
- EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp
- EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp
- EasternKingdoms/BlackrockMountain/BlackwingLair/boss_ebonroc.cpp
- EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp
- EasternKingdoms/BlackrockMountain/BlackwingLair/boss_vaelastrasz.cpp
- EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
- EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp
- EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_pyroguard_emberseer.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_drakkisath.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_warmaster_voone.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_mother_smolderweb.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_quartermaster_zigris.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_halycon.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_overlord_wyrmthalak.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_highlord_omokk.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_urok_doomhowl.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_lord_valthalak.cpp
- EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h
- EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/boss_gehennas.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/boss_lucifron.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/boss_golemagg.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/boss_baron_geddon.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/boss_garr.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/molten_core.h
- EasternKingdoms/BlackrockMountain/MoltenCore/instance_molten_core.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/boss_sulfuron_harbinger.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/boss_magmadar.cpp
- EasternKingdoms/BlackrockMountain/MoltenCore/boss_shazzrah.cpp
- EasternKingdoms/Scholomance/boss_the_ravenian.cpp
- EasternKingdoms/Scholomance/boss_instructor_malicia.cpp
- EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp
- EasternKingdoms/Scholomance/boss_illucia_barov.cpp
- EasternKingdoms/Scholomance/scholomance.h
- EasternKingdoms/Scholomance/boss_vectus.cpp
- EasternKingdoms/Scholomance/boss_jandice_barov.cpp
- EasternKingdoms/Scholomance/boss_kormok.cpp
- EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp
- EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp
- EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp
- EasternKingdoms/Scholomance/instance_scholomance.cpp
- EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
- EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
- EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp
- EasternKingdoms/zone_isle_of_queldanas.cpp
- EasternKingdoms/ZulGurub/boss_hakkar.cpp
- EasternKingdoms/ZulGurub/boss_mandokir.cpp
- EasternKingdoms/ZulGurub/boss_marli.cpp
- EasternKingdoms/ZulGurub/boss_hazzarah.cpp
- EasternKingdoms/ZulGurub/boss_jeklik.cpp
- EasternKingdoms/ZulGurub/boss_grilek.cpp
- EasternKingdoms/ZulGurub/zulgurub.h
- EasternKingdoms/ZulGurub/boss_renataki.cpp
- EasternKingdoms/ZulGurub/boss_arlokk.cpp
- EasternKingdoms/ZulGurub/boss_gahzranka.cpp
- EasternKingdoms/ZulGurub/boss_venoxis.cpp
- EasternKingdoms/ZulGurub/instance_zulgurub.cpp
- EasternKingdoms/ZulGurub/boss_jindo.cpp
- EasternKingdoms/ZulGurub/boss_wushoolay.cpp
- EasternKingdoms/ZulGurub/boss_thekal.cpp
- EasternKingdoms/zone_wetlands.cpp
- EasternKingdoms/zone_arathi_highlands.cpp
- EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
- EasternKingdoms/Gnomeregan/gnomeregan.cpp
- EasternKingdoms/Gnomeregan/gnomeregan.h
- EasternKingdoms/zone_redridge_mountains.cpp
- EasternKingdoms/ScarletEnclave/chapter2.cpp
- EasternKingdoms/ScarletEnclave/chapter5.cpp
- EasternKingdoms/ScarletEnclave/chapter1.cpp
- EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
- EasternKingdoms/zone_eastern_plaguelands.cpp
- EasternKingdoms/Stratholme/boss_baroness_anastari.cpp
- EasternKingdoms/Stratholme/boss_nerubenkan.cpp
- EasternKingdoms/Stratholme/instance_stratholme.cpp
- EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp
- EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp
- EasternKingdoms/Stratholme/boss_baron_rivendare.cpp
- EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp
- EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp
- EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp
- EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp
- EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp
- EasternKingdoms/Stratholme/boss_postmaster_malown.cpp
- EasternKingdoms/Stratholme/stratholme.h
- EasternKingdoms/Stratholme/stratholme.cpp
- EasternKingdoms/zone_tirisfal_glades.cpp
- EasternKingdoms/SunkenTemple/sunken_temple.cpp
- EasternKingdoms/SunkenTemple/sunken_temple.h
- EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
- EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
- EasternKingdoms/MagistersTerrace/magisters_terrace.h
- EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp
- EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp
- EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp
- EasternKingdoms/MagistersTerrace/boss_vexallus.cpp
- EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
- EasternKingdoms/Uldaman/uldaman.cpp
- EasternKingdoms/Uldaman/boss_ironaya.cpp
- EasternKingdoms/Uldaman/uldaman.h
- EasternKingdoms/Uldaman/instance_uldaman.cpp
- EasternKingdoms/Uldaman/boss_archaedas.cpp
- EasternKingdoms/zone_swamp_of_sorrows.cpp
- EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp
- EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
- EasternKingdoms/SunwellPlateau/sunwell_plateau.h
- EasternKingdoms/SunwellPlateau/boss_muru.cpp
- EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp
- EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
- EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
- EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp
- EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
- EasternKingdoms/zone_stranglethorn_vale.cpp
- EasternKingdoms/Deadmines/deadmines.h
- EasternKingdoms/Deadmines/deadmines.cpp
- EasternKingdoms/Deadmines/boss_mr_smite.cpp
- EasternKingdoms/Deadmines/instance_deadmines.cpp
- EasternKingdoms/zone_duskwood.cpp
- EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp
- EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
- EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp
- EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
- EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
- EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp
- EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp
- EasternKingdoms/ScarletMonastery/scarlet_monastery.h
- EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
- EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp
- EasternKingdoms/ScarletMonastery/boss_herod.cpp
- EasternKingdoms/ScarletMonastery/boss_scorn.cpp
- EasternKingdoms/zone_undercity.cpp
- EasternKingdoms/zone_loch_modan.cpp
- EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
- EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
- EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
- EasternKingdoms/zone_burning_steppes.cpp
- EasternKingdoms/zone_blasted_lands.cpp
- EasternKingdoms/zone_stormwind_city.cpp
- EasternKingdoms/ZulAman/boss_halazzi.cpp
- EasternKingdoms/ZulAman/boss_hexlord.cpp
- EasternKingdoms/ZulAman/boss_zuljin.cpp
- EasternKingdoms/ZulAman/boss_akilzon.cpp
- EasternKingdoms/ZulAman/instance_zulaman.cpp
- EasternKingdoms/ZulAman/boss_janalai.cpp
- EasternKingdoms/ZulAman/boss_nalorakk.cpp
- EasternKingdoms/ZulAman/zulaman.cpp
- EasternKingdoms/ZulAman/zulaman.h
- EasternKingdoms/zone_hinterlands.cpp
- EasternKingdoms/zone_western_plaguelands.cpp
- EasternKingdoms/zone_silverpine_forest.cpp
- EasternKingdoms/Karazhan/instance_karazhan.cpp
- EasternKingdoms/Karazhan/boss_nightbane.cpp
- EasternKingdoms/Karazhan/karazhan.cpp
- EasternKingdoms/Karazhan/boss_curator.cpp
- EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
- EasternKingdoms/Karazhan/boss_netherspite.cpp
- EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp
- EasternKingdoms/Karazhan/boss_midnight.cpp
- EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
- EasternKingdoms/Karazhan/bosses_opera.cpp
- EasternKingdoms/Karazhan/boss_moroes.cpp
- EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
- EasternKingdoms/Karazhan/karazhan.h
- EasternKingdoms/TheStockade/instance_the_stockade.cpp
-)
-
-message(" -> Prepared: Eastern Kingdoms")
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
index 541ddc0e1c8..8f246ab9bf0 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
@@ -25,17 +25,25 @@ EndScriptData */
#include "ScriptedCreature.h"
#include "deadmines.h"
-enum Spels
+enum Spells
{
SPELL_TRASH = 3391,
SPELL_SMITE_STOMP = 6432,
SPELL_SMITE_SLAM = 6435,
- SPELL_NIMBLE_REFLEXES = 6264,
+ SPELL_NIMBLE_REFLEXES = 6264
+};
+enum Equips
+{
EQUIP_SWORD = 5191,
- EQUIP_MACE = 7230,
+ EQUIP_AXE = 5196,
+ EQUIP_MACE = 7230
+};
- SAY_AGGRO = 0,
+enum Texts
+{
+ SAY_PHASE_1 = 2,
+ SAY_PHASE_2 = 3
};
class boss_mr_smite : public CreatureScript
@@ -66,6 +74,8 @@ public:
uiPhase = 0;
uiTimer = 0;
+
+ uiIsMoving = false;
}
InstanceScript* instance;
@@ -79,16 +89,19 @@ public:
uint32 uiPhase;
uint32 uiTimer;
+ bool uiIsMoving;
+
void Reset() override
{
Initialize();
SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetReactState(REACT_AGGRESSIVE);
}
void EnterCombat(Unit* /*who*/) override
{
- Talk(SAY_AGGRO);
}
bool bCheckChances()
@@ -105,38 +118,52 @@ public:
if (!UpdateVictim())
return;
- /*START ACID-AI*/
- if (uiTrashTimer <= uiDiff)
+ if (!uiIsMoving) // halt abilities in between phases
{
- if (bCheckChances())
- DoCast(me, SPELL_TRASH);
- uiTrashTimer = urand(6000, 15500);
- } else uiTrashTimer -= uiDiff;
+ if (uiTrashTimer <= uiDiff)
+ {
+ if (bCheckChances())
+ DoCast(me, SPELL_TRASH);
+ uiTrashTimer = urand(6000, 15500);
+ }
+ else uiTrashTimer -= uiDiff;
- if (uiSlamTimer <= uiDiff)
- {
- if (bCheckChances())
- DoCastVictim(SPELL_SMITE_SLAM);
- uiSlamTimer = 11000;
- } else uiSlamTimer -= uiDiff;
+ if (uiSlamTimer <= uiDiff)
+ {
+ if (bCheckChances())
+ DoCastVictim(SPELL_SMITE_SLAM);
+ uiSlamTimer = 11000;
+ }
+ else uiSlamTimer -= uiDiff;
- if (uiNimbleReflexesTimer <= uiDiff)
- {
- if (bCheckChances())
- DoCast(me, SPELL_NIMBLE_REFLEXES);
- uiNimbleReflexesTimer = urand(27300, 60100);
- } else uiNimbleReflexesTimer -= uiDiff;
- /*END ACID-AI*/
+ if (uiNimbleReflexesTimer <= uiDiff)
+ {
+ if (bCheckChances())
+ DoCast(me, SPELL_NIMBLE_REFLEXES);
+ uiNimbleReflexesTimer = urand(27300, 60100);
+ }
+ else uiNimbleReflexesTimer -= uiDiff;
+ }
if ((uiHealth == 0 && !HealthAbovePct(66)) || (uiHealth == 1 && !HealthAbovePct(33)))
{
++uiHealth;
DoCastAOE(SPELL_SMITE_STOMP, false);
SetCombatMovement(false);
- if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_SMITE_CHEST)))
+ me->AttackStop();
+ me->InterruptNonMeleeSpells(false);
+ me->SetReactState(REACT_PASSIVE);
+ uiTimer = 2500;
+ uiPhase = 1;
+
+ switch (uiHealth)
{
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ());
+ case 1:
+ Talk(SAY_PHASE_1);
+ break;
+ case 2:
+ Talk(SAY_PHASE_2);
+ break;
}
}
@@ -147,21 +174,36 @@ public:
switch (uiPhase)
{
case 1:
- me->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work?
- uiTimer = 1000;
- uiPhase = 2;
+ {
+ if (uiIsMoving)
+ break;
+
+ if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_SMITE_CHEST)))
+ {
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 1.5f, go->GetPositionY() + 1.4f, go->GetPositionZ());
+ uiIsMoving = true;
+ }
break;
+ }
case 2:
if (uiHealth == 1)
- SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE);
+ SetEquipmentSlots(false, EQUIP_AXE, EQUIP_AXE, EQUIP_NO_CHANGE);
else
SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
uiTimer = 500;
uiPhase = 3;
break;
case 3:
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ uiTimer = 750;
+ uiPhase = 4;
+ break;
+ case 4:
+ me->SetReactState(REACT_AGGRESSIVE);
SetCombatMovement(true);
me->GetMotionMaster()->MoveChase(me->GetVictim(), me->m_CombatDistance);
+ uiIsMoving = false;
uiPhase = 0;
break;
}
@@ -176,8 +218,11 @@ public:
if (uiType != POINT_MOTION_TYPE)
return;
- uiTimer = 1500;
- uiPhase = 1;
+ me->SetFacingTo(5.47f);
+ me->SetStandState(UNIT_STAND_STATE_KNEEL);
+
+ uiTimer = 2000;
+ uiPhase = 2;
}
};
};
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
index dff4243617e..01ebabb160e 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
@@ -26,6 +26,7 @@ enum CannonState
CANNON_GUNPOWDER_USED,
CANNON_BLAST_INITIATED,
PIRATES_ATTACK,
+ SMITE_ALARMED,
EVENT_DONE
};
@@ -48,4 +49,16 @@ enum GameObjects
GO_DOOR_LEVER = 101833,
GO_MR_SMITE_CHEST = 144111
};
+
+enum CreaturesIds
+{
+ NPC_MR_SMITE = 646
+};
+
+enum InstanceTexts
+{
+ SAY_ALARM1 = 0,
+ SAY_ALARM2 = 1
+};
+
#endif
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
index 6714b243765..7599cf38f08 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
@@ -32,18 +32,14 @@ EndScriptData */
enum Sounds
{
SOUND_CANNONFIRE = 1400,
- SOUND_DESTROYDOOR = 3079,
- SOUND_MR_SMITE_ALARM1 = 5775,
- SOUND_MR_SMITE_ALARM2 = 5777
+ SOUND_DESTROYDOOR = 3079
};
-#define SAY_MR_SMITE_ALARM1 "You there, check out that noise!"
-#define SAY_MR_SMITE_ALARM2 "We're under attack! A vast, ye swabs! Repel the invaders!"
-
enum Misc
{
DATA_CANNON_BLAST_TIMER = 3000,
- DATA_PIRATES_DELAY_TIMER = 1000
+ DATA_PIRATES_DELAY_TIMER = 1000,
+ DATA_SMITE_ALARM_DELAY_TIMER = 5000
};
class instance_deadmines : public InstanceMapScript
@@ -63,6 +59,7 @@ class instance_deadmines : public InstanceMapScript
State = CANNON_NOT_USED;
CannonBlast_Timer = 0;
PiratesDelay_Timer = 0;
+ SmiteAlarmDelay_Timer = 0;
}
ObjectGuid FactoryDoorGUID;
@@ -72,10 +69,12 @@ class instance_deadmines : public InstanceMapScript
ObjectGuid DefiasPirate1GUID;
ObjectGuid DefiasPirate2GUID;
ObjectGuid DefiasCompanionGUID;
+ ObjectGuid MrSmiteGUID;
uint32 State;
uint32 CannonBlast_Timer;
uint32 PiratesDelay_Timer;
+ uint32 SmiteAlarmDelay_Timer;
ObjectGuid uiSmiteChestGUID;
virtual void Update(uint32 diff) override
@@ -91,22 +90,20 @@ class instance_deadmines : public InstanceMapScript
{
case CANNON_GUNPOWDER_USED:
CannonBlast_Timer = DATA_CANNON_BLAST_TIMER;
- // it's a hack - Mr. Smite should do that but his too far away
- //pIronCladDoor->SetName("Mr. Smite");
- //pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, NULL);
- pIronCladDoor->PlayDirectSound(SOUND_MR_SMITE_ALARM1);
State = CANNON_BLAST_INITIATED;
break;
case CANNON_BLAST_INITIATED:
PiratesDelay_Timer = DATA_PIRATES_DELAY_TIMER;
+ SmiteAlarmDelay_Timer = DATA_SMITE_ALARM_DELAY_TIMER;
if (CannonBlast_Timer <= diff)
{
SummonCreatures();
ShootCannon();
BlastOutDoor();
LeverStucked();
- //pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, NULL);
- pIronCladDoor->PlayDirectSound(SOUND_MR_SMITE_ALARM2);
+ instance->LoadGrid(-22.8f, -797.24f); // Loads Mr. Smite's grid.
+ if (Creature* smite = instance->GetCreature(MrSmiteGUID)) // goes off when door blows up
+ smite->AI()->Talk(SAY_ALARM1);
State = PIRATES_ATTACK;
} else CannonBlast_Timer -= diff;
break;
@@ -114,9 +111,17 @@ class instance_deadmines : public InstanceMapScript
if (PiratesDelay_Timer <= diff)
{
MoveCreaturesInside();
- State = EVENT_DONE;
+ State = SMITE_ALARMED;
} else PiratesDelay_Timer -= diff;
break;
+ case SMITE_ALARMED:
+ if (SmiteAlarmDelay_Timer <= diff)
+ {
+ if (Creature* smite = instance->GetCreature(MrSmiteGUID))
+ smite->AI()->Talk(SAY_ALARM2);
+ State = EVENT_DONE;
+ } else SmiteAlarmDelay_Timer -= diff;
+ break;
}
}
@@ -180,6 +185,18 @@ class instance_deadmines : public InstanceMapScript
pDoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4);
}
+ void OnCreatureCreate(Creature* creature) override
+ {
+ switch (creature->GetEntry())
+ {
+ case NPC_MR_SMITE:
+ MrSmiteGUID = creature->GetGUID();
+ break;
+ default:
+ break;
+ }
+ }
+
void OnGameObjectCreate(GameObject* go) override
{
switch (go->GetEntry())
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index 05d964124b1..c8eb645845b 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -305,7 +305,7 @@ public:
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
break;
case 2:
- if (GameObject* go = me->SummonGameObject(183410, -533.140f, -105.322f, -156.016f, 0, 0, 0, 0, 0, 1))
+ if (GameObject* go = me->SummonGameObject(183410, -533.140f, -105.322f, -156.016f, 0.f, G3D::Quat(), 1))
{
GoSummonList.push_back(go->GetGUID());
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
@@ -320,7 +320,7 @@ public:
Talk(SAY_BLASTMASTER_7);
break;
case 4:
- if (GameObject* go = me->SummonGameObject(183410, -542.199f, -96.854f, -155.790f, 0, 0, 0, 0, 0, 1))
+ if (GameObject* go = me->SummonGameObject(183410, -542.199f, -96.854f, -155.790f, 0.f, G3D::Quat(), 1))
{
GoSummonList.push_back(go->GetGUID());
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
@@ -334,7 +334,7 @@ public:
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
break;
case 6:
- if (GameObject* go = me->SummonGameObject(183410, -507.820f, -103.333f, -151.353f, 0, 0, 0, 0, 0, 1))
+ if (GameObject* go = me->SummonGameObject(183410, -507.820f, -103.333f, -151.353f, 0.f, G3D::Quat(), 1))
{
GoSummonList.push_back(go->GetGUID());
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
@@ -342,7 +342,7 @@ public:
}
break;
case 7:
- if (GameObject* go = me->SummonGameObject(183410, -511.829f, -86.249f, -151.431f, 0, 0, 0, 0, 0, 1))
+ if (GameObject* go = me->SummonGameObject(183410, -511.829f, -86.249f, -151.431f, 0.f, G3D::Quat(), 1))
{
GoSummonList.push_back(go->GetGUID());
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
@@ -354,9 +354,9 @@ public:
me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
break;
case 9:
- me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[17].GetPositionX(), SpawnPosition[17].GetPositionY(), SpawnPosition[17].GetPositionZ(), SpawnPosition[17].GetOrientation(), 0, 0, 0, 0, 7200);
- me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[18].GetPositionX(), SpawnPosition[18].GetPositionY(), SpawnPosition[18].GetPositionZ(), SpawnPosition[18].GetOrientation(), 0, 0, 0, 0, 7200);
- me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[19].GetPositionX(), SpawnPosition[19].GetPositionY(), SpawnPosition[19].GetPositionZ(), SpawnPosition[19].GetOrientation(), 0, 0, 0, 0, 7200);
+ me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[17], G3D::Quat(), 7200);
+ me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[18], G3D::Quat(), 7200);
+ me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[19], G3D::Quat(), 7200);
break;
}
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp
index 9f4a31fdbbc..b694c074879 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp
@@ -50,19 +50,9 @@ class boss_maiden_of_virtue : public CreatureScript
public:
boss_maiden_of_virtue() : CreatureScript("boss_maiden_of_virtue") { }
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new boss_maiden_of_virtueAI(creature);
- }
-
struct boss_maiden_of_virtueAI : public BossAI
{
- boss_maiden_of_virtueAI(Creature* creature) : BossAI(creature, TYPE_MAIDEN) { }
-
- void Reset() override
- {
- _Reset();
- }
+ boss_maiden_of_virtueAI(Creature* creature) : BossAI(creature, DATA_MAIDEN_OF_VIRTUE) { }
void KilledUnit(Unit* /*Victim*/) override
{
@@ -132,6 +122,11 @@ public:
DoMeleeAttackIfReady();
}
};
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new boss_maiden_of_virtueAI(creature);
+ }
};
void AddSC_boss_maiden_of_virtue()
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
index ced8dd8f37e..ce3e68d9c48 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp
@@ -26,26 +26,44 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
+#include "karazhan.h"
-enum Midnight
+enum Texts
{
- SAY_MIDNIGHT_KILL = 0,
- SAY_APPEAR = 1,
- SAY_MOUNT = 2,
-
- SAY_KILL = 0,
- SAY_DISARMED = 1,
- SAY_DEATH = 2,
- SAY_RANDOM = 3,
-
- SPELL_SHADOWCLEAVE = 29832,
- SPELL_INTANGIBLE_PRESENCE = 29833,
- SPELL_BERSERKER_CHARGE = 26561, //Only when mounted
+ SAY_KILL = 0,
+ SAY_RANDOM = 1,
+ SAY_DISARMED = 2,
+ SAY_MIDNIGHT_KILL = 3,
+ SAY_APPEAR = 4,
+ SAY_MOUNT = 5,
+
+ SAY_DEATH = 3,
+
+ // Midnight
+ EMOTE_CALL_ATTUMEN = 0,
+ EMOTE_MOUNT_UP = 1
+};
- MOUNTED_DISPLAYID = 16040,
+enum Spells
+{
+ // Attumen
+ SPELL_SHADOWCLEAVE = 29832,
+ SPELL_INTANGIBLE_PRESENCE = 29833,
+ SPELL_SPAWN_SMOKE = 10389,
+ SPELL_CHARGE = 29847,
+
+ // Midnight
+ SPELL_KNOCKDOWN = 29711,
+ SPELL_SUMMON_ATTUMEN = 29714,
+ SPELL_MOUNT = 29770,
+ SPELL_SUMMON_ATTUMEN_MOUNTED = 29799
+};
- //Attumen (@todo Use the summoning spell instead of Creature id. It works, but is not convenient for us)
- SUMMON_ATTUMEN = 15550,
+enum Phases
+{
+ PHASE_NONE,
+ PHASE_ATTUMEN_ENGAGES,
+ PHASE_MOUNTED
};
class boss_attumen : public CreatureScript
@@ -53,72 +71,212 @@ class boss_attumen : public CreatureScript
public:
boss_attumen() : CreatureScript("boss_attumen") { }
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new boss_attumenAI(creature);
- }
-
- struct boss_attumenAI : public ScriptedAI
+ struct boss_attumenAI : public BossAI
{
- boss_attumenAI(Creature* creature) : ScriptedAI(creature)
+ boss_attumenAI(Creature* creature) : BossAI(creature, DATA_ATTUMEN)
{
Initialize();
-
- Phase = 1;
-
- CleaveTimer = urand(10000, 15000);
- CurseTimer = 30000;
- RandomYellTimer = urand(30000, 60000); //Occasionally yell
- ChargeTimer = 20000;
- }
+ }
void Initialize()
{
- ResetTimer = 0;
- Midnight.Clear();
+ _midnightGUID.Clear();
+ _phase = PHASE_NONE;
}
- ObjectGuid Midnight;
- uint8 Phase;
- uint32 CleaveTimer;
- uint32 CurseTimer;
- uint32 RandomYellTimer;
- uint32 ChargeTimer; //only when mounted
- uint32 ResetTimer;
-
void Reset() override
{
Initialize();
+ BossAI::Reset();
+ }
+
+ void EnterEvadeMode(EvadeReason /*why*/) override
+ {
+ if (Creature* midnight = ObjectAccessor::GetCreature(*me, _midnightGUID))
+ BossAI::_DespawnAtEvade(Seconds(10), midnight);
+
+ me->DespawnOrUnsummon();
}
- void EnterEvadeMode(EvadeReason why) override
+ void ScheduleTasks() override
{
- ScriptedAI::EnterEvadeMode(why);
- ResetTimer = 2000;
+ scheduler.Schedule(Seconds(15), Seconds(25), [this](TaskContext task)
+ {
+ DoCastVictim(SPELL_SHADOWCLEAVE);
+ task.Repeat(Seconds(15), Seconds(25));
+ });
+
+ scheduler.Schedule(Seconds(25), Seconds(45), [this](TaskContext task)
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ DoCast(target,SPELL_INTANGIBLE_PRESENCE);
+
+ task.Repeat(Seconds(25), Seconds(45));
+ });
+
+ scheduler.Schedule(Seconds(30), Seconds(60), [this](TaskContext task)
+ {
+ Talk(SAY_RANDOM);
+ task.Repeat(Seconds(30), Seconds(60));
+ });
}
- void EnterCombat(Unit* /*who*/) override { }
+ void DamageTaken(Unit* /*attacker*/, uint32 &damage) override
+ {
+ // Attumen does not die until he mounts Midnight, let health fall to 1 and prevent further damage.
+ if (damage >= me->GetHealth() && _phase != PHASE_MOUNTED)
+ damage = me->GetHealth() - 1;
+
+ if (_phase == PHASE_ATTUMEN_ENGAGES && me->HealthBelowPctDamaged(25, damage))
+ {
+ _phase = PHASE_NONE;
+
+ if (Creature* midnight = ObjectAccessor::GetCreature(*me, _midnightGUID))
+ midnight->AI()->DoCastAOE(SPELL_MOUNT, true);
+ }
+ }
void KilledUnit(Unit* /*victim*/) override
{
Talk(SAY_KILL);
}
- void JustDied(Unit* /*killer*/) override
+ void JustSummoned(Creature* summon) override
+ {
+ if (summon->GetEntry() == NPC_ATTUMEN_MOUNTED)
+ if (Creature* midnight = ObjectAccessor::GetCreature(*me, _midnightGUID))
+ {
+ if (midnight->GetHealth() > me->GetHealth())
+ summon->SetHealth(midnight->GetHealth());
+ else
+ summon->SetHealth(me->GetHealth());
+
+ summon->AI()->DoZoneInCombat();
+ summon->AI()->SetGUID(_midnightGUID, NPC_MIDNIGHT);
+ }
+
+ BossAI::JustSummoned(summon);
+ }
+
+ void IsSummonedBy(Unit* summoner) override
+ {
+ if (summoner->GetEntry() == NPC_MIDNIGHT)
+ _phase = PHASE_ATTUMEN_ENGAGES;
+
+ if (summoner->GetEntry() == NPC_ATTUMEN_UNMOUNTED)
+ {
+ _phase = PHASE_MOUNTED;
+ DoCastSelf(SPELL_SPAWN_SMOKE);
+
+ scheduler.Schedule(Seconds(10), Seconds(25), [this](TaskContext task)
+ {
+ Unit* target = nullptr;
+ ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
+ std::vector<Unit*> target_list;
+
+ for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr != t_list.end(); ++itr)
+ {
+ target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
+ if (target && !target->IsWithinDist(me, 8.00f, false) && target->IsWithinDist(me, 25.0f, false))
+ target_list.push_back(target);
+
+ target = nullptr;
+ }
+
+ if (!target_list.empty())
+ target = Trinity::Containers::SelectRandomContainerElement(target_list);
+
+ DoCast(target, SPELL_CHARGE);
+ task.Repeat(Seconds(10), Seconds(25));
+ });
+
+ scheduler.Schedule(Seconds(25), Seconds(35), [this](TaskContext task)
+ {
+ DoCastVictim(SPELL_KNOCKDOWN);
+ task.Repeat(Seconds(25), Seconds(35));
+ });
+ }
+ }
+
+ void JustDied(Unit* killer) override
{
Talk(SAY_DEATH);
- if (Unit* midnight = ObjectAccessor::GetUnit(*me, Midnight))
+ if (Unit* midnight = ObjectAccessor::GetUnit(*me, _midnightGUID))
midnight->KillSelf();
+
+ BossAI::JustDied(killer);
}
- void UpdateAI(uint32 diff) override;
+ void SetGUID(ObjectGuid guid, int32 data) override
+ {
+ if (data == NPC_MIDNIGHT)
+ _midnightGUID = guid;
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim() && _phase != PHASE_NONE)
+ return;
+
+ scheduler.Update(diff,
+ std::bind(&BossAI::DoMeleeAttackIfReady, this));
+ }
void SpellHit(Unit* /*source*/, const SpellInfo* spell) override
{
if (spell->Mechanic == MECHANIC_DISARM)
Talk(SAY_DISARMED);
+
+ if (spell->Id == SPELL_MOUNT)
+ {
+ if (Creature* midnight = ObjectAccessor::GetCreature(*me, _midnightGUID))
+ {
+ _phase = PHASE_NONE;
+ scheduler.CancelAll();
+
+ midnight->AttackStop();
+ midnight->RemoveAllAttackers();
+ midnight->SetReactState(REACT_PASSIVE);
+ midnight->GetMotionMaster()->MoveChase(me);
+ midnight->AI()->Talk(EMOTE_MOUNT_UP);
+
+ me->AttackStop();
+ me->RemoveAllAttackers();
+ me->SetReactState(REACT_PASSIVE);
+ me->GetMotionMaster()->MoveChase(midnight);
+ Talk(SAY_MOUNT);
+
+ scheduler.Schedule(Seconds(3), [this](TaskContext task)
+ {
+ if (Creature* midnight = ObjectAccessor::GetCreature(*me, _midnightGUID))
+ {
+ if (me->IsWithinMeleeRange(midnight))
+ {
+ DoCastAOE(SPELL_SUMMON_ATTUMEN_MOUNTED);
+ me->SetVisible(false);
+ midnight->SetVisible(false);
+ }
+ else
+ {
+ midnight->GetMotionMaster()->MoveChase(me);
+ me->GetMotionMaster()->MoveChase(midnight);
+ task.Repeat(Seconds(3));
+ }
+ }
+ });
+ }
+ }
}
+
+ private:
+ ObjectGuid _midnightGUID;
+ uint8 _phase;
};
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new boss_attumenAI(creature);
+ }
};
class boss_midnight : public CreatureScript
@@ -126,210 +284,102 @@ class boss_midnight : public CreatureScript
public:
boss_midnight() : CreatureScript("boss_midnight") { }
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new boss_midnightAI(creature);
- }
-
- struct boss_midnightAI : public ScriptedAI
+ struct boss_midnightAI : public BossAI
{
- boss_midnightAI(Creature* creature) : ScriptedAI(creature)
+ boss_midnightAI(Creature* creature) : BossAI(creature, DATA_ATTUMEN)
{
Initialize();
}
void Initialize()
{
- Phase = 1;
- Attumen.Clear();
- Mount_Timer = 0;
+ _phase = PHASE_NONE;
}
- ObjectGuid Attumen;
- uint8 Phase;
- uint32 Mount_Timer;
-
void Reset() override
{
Initialize();
-
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ BossAI::Reset();
me->SetVisible(true);
+ me->SetReactState(REACT_DEFENSIVE);
}
- void EnterCombat(Unit* /*who*/) override { }
-
- void KilledUnit(Unit* /*victim*/) override
- {
- if (Phase == 2)
- {
- if (Unit* unit = ObjectAccessor::GetUnit(*me, Attumen))
- Talk(SAY_MIDNIGHT_KILL, unit);
- }
- }
-
- void UpdateAI(uint32 diff) override
+ void DamageTaken(Unit* /*attacker*/, uint32 &damage) override
{
- if (!UpdateVictim())
- return;
+ // Midnight never dies, let health fall to 1 and prevent further damage.
+ if (damage >= me->GetHealth())
+ damage = me->GetHealth() - 1;
- if (Phase == 1 && HealthBelowPct(95))
+ if (_phase == PHASE_NONE && me->HealthBelowPctDamaged(95, damage))
{
- Phase = 2;
- if (Creature* attumen = me->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000))
- {
- Attumen = attumen->GetGUID();
- attumen->AI()->AttackStart(me->GetVictim());
- SetMidnight(attumen, me->GetGUID());
- Talk(SAY_APPEAR, attumen);
- }
+ _phase = PHASE_ATTUMEN_ENGAGES;
+ Talk(EMOTE_CALL_ATTUMEN);
+ DoCastAOE(SPELL_SUMMON_ATTUMEN);
}
- else if (Phase == 2 && HealthBelowPct(25))
+ else if (_phase == PHASE_ATTUMEN_ENGAGES && me->HealthBelowPctDamaged(25, damage))
{
- if (Unit* pAttumen = ObjectAccessor::GetUnit(*me, Attumen))
- Mount(pAttumen);
+ _phase = PHASE_MOUNTED;
+ DoCastAOE(SPELL_MOUNT, true);
}
- else if (Phase == 3)
+ }
+
+ void JustSummoned(Creature* summon) override
+ {
+ if (summon->GetEntry() == NPC_ATTUMEN_UNMOUNTED)
{
- if (Mount_Timer)
- {
- if (Mount_Timer <= diff)
- {
- Mount_Timer = 0;
- me->SetVisible(false);
- me->GetMotionMaster()->MoveIdle();
- if (Unit* pAttumen = ObjectAccessor::GetUnit(*me, Attumen))
- {
- pAttumen->SetDisplayId(MOUNTED_DISPLAYID);
- pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (pAttumen->GetVictim())
- {
- pAttumen->GetMotionMaster()->MoveChase(pAttumen->GetVictim());
- pAttumen->SetTarget(pAttumen->EnsureVictim()->GetGUID());
- }
- pAttumen->SetObjectScale(1);
- }
- } else Mount_Timer -= diff;
- }
+ _attumenGUID = summon->GetGUID();
+ summon->AI()->SetGUID(me->GetGUID(), NPC_MIDNIGHT);
+ summon->AI()->AttackStart(me->GetVictim());
+ summon->AI()->Talk(SAY_APPEAR);
}
- if (Phase != 3)
- DoMeleeAttackIfReady();
+ BossAI::JustSummoned(summon);
}
- void Mount(Unit* pAttumen)
+ void EnterCombat(Unit* who) override
{
- Talk(SAY_MOUNT, pAttumen);
- Phase = 3;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- float angle = me->GetAngle(pAttumen);
- float distance = me->GetDistance2d(pAttumen);
- float newX = me->GetPositionX() + std::cos(angle)*(distance/2);
- float newY = me->GetPositionY() + std::sin(angle)*(distance/2);
- float newZ = 50;
- //me->Relocate(newX, newY, newZ, angle);
- //me->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
- distance += 10;
- newX = me->GetPositionX() + std::cos(angle)*(distance/2);
- newY = me->GetPositionY() + std::sin(angle)*(distance/2);
- pAttumen->GetMotionMaster()->Clear();
- pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
- //pAttumen->Relocate(newX, newY, newZ, -angle);
- //pAttumen->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
- Mount_Timer = 1000;
+ BossAI::EnterCombat(who);
+
+ scheduler.Schedule(Seconds(15), Seconds(25), [this](TaskContext task)
+ {
+ DoCastVictim(SPELL_KNOCKDOWN);
+ task.Repeat(Seconds(15), Seconds(25));
+ });
}
- void SetMidnight(Creature* pAttumen, ObjectGuid value)
+ void EnterEvadeMode(EvadeReason /*why*/) override
{
- ENSURE_AI(boss_attumen::boss_attumenAI, pAttumen->AI())->Midnight = value;
+ BossAI::_DespawnAtEvade(Seconds(10));
}
- };
-};
-void boss_attumen::boss_attumenAI::UpdateAI(uint32 diff)
-{
- if (ResetTimer)
- {
- if (ResetTimer <= diff)
+ void KilledUnit(Unit* /*victim*/) override
{
- ResetTimer = 0;
- Unit* pMidnight = ObjectAccessor::GetUnit(*me, Midnight);
- if (pMidnight)
+ if (_phase == PHASE_ATTUMEN_ENGAGES)
{
- pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pMidnight->SetVisible(true);
+ if (Unit* unit = ObjectAccessor::GetUnit(*me, _attumenGUID))
+ Talk(SAY_MIDNIGHT_KILL, unit);
}
- Midnight.Clear();
- me->SetVisible(false);
- me->KillSelf();
- } else ResetTimer -= diff;
- }
-
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
- return;
-
- if (CleaveTimer <= diff)
- {
- DoCastVictim(SPELL_SHADOWCLEAVE);
- CleaveTimer = urand(10000, 15000);
- } else CleaveTimer -= diff;
+ }
- if (CurseTimer <= diff)
- {
- DoCastVictim(SPELL_INTANGIBLE_PRESENCE);
- CurseTimer = 30000;
- } else CurseTimer -= diff;
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim() || _phase == PHASE_MOUNTED)
+ return;
- if (RandomYellTimer <= diff)
- {
- Talk(SAY_RANDOM);
- RandomYellTimer = urand(30000, 60000);
- } else RandomYellTimer -= diff;
+ scheduler.Update(diff,
+ std::bind(&BossAI::DoMeleeAttackIfReady, this));
+ }
- if (me->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID)
- {
- if (ChargeTimer <= diff)
- {
- Unit* target = NULL;
- ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
- std::vector<Unit*> target_list;
- for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr != t_list.end(); ++itr)
- {
- target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
- if (target && !target->IsWithinDist(me, ATTACK_DISTANCE, false))
- target_list.push_back(target);
- target = NULL;
- }
- if (!target_list.empty())
- target = *(target_list.begin() + rand32() % target_list.size());
+ private:
+ ObjectGuid _attumenGUID;
+ uint8 _phase;
+ };
- DoCast(target, SPELL_BERSERKER_CHARGE);
- ChargeTimer = 20000;
- } else ChargeTimer -= diff;
- }
- else
+ CreatureAI* GetAI(Creature* creature) const override
{
- if (HealthBelowPct(25))
- {
- Creature* pMidnight = ObjectAccessor::GetCreature(*me, Midnight);
- if (pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT)
- {
- ENSURE_AI(boss_midnight::boss_midnightAI, (pMidnight->AI()))->Mount(me);
- me->SetHealth(pMidnight->GetHealth());
- DoResetThreat();
- }
- }
+ return new boss_midnightAI(creature);
}
-
- DoMeleeAttackIfReady();
-}
+};
void AddSC_boss_attumen()
{
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
index 79e36442f4b..29c78d3b388 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp
@@ -143,12 +143,12 @@ public:
if (me->IsAlive())
SpawnAdds();
- instance->SetData(TYPE_MOROES, NOT_STARTED);
+ instance->SetBossState(DATA_MOROES, NOT_STARTED);
}
void StartEvent()
{
- instance->SetData(TYPE_MOROES, IN_PROGRESS);
+ instance->SetBossState(DATA_MOROES, IN_PROGRESS);
DoZoneInCombat();
}
@@ -171,7 +171,7 @@ public:
{
Talk(SAY_DEATH);
- instance->SetData(TYPE_MOROES, DONE);
+ instance->SetBossState(DATA_MOROES, DONE);
DeSpawnAdds();
@@ -257,12 +257,6 @@ public:
if (!UpdateVictim())
return;
- if (!instance->GetData(TYPE_MOROES))
- {
- EnterEvadeMode();
- return;
- }
-
if (!Enrage && HealthBelowPct(30))
{
DoCast(me, SPELL_FRENZY);
@@ -304,7 +298,7 @@ public:
if (Blind_Timer <= diff)
{
std::list<Unit*> targets;
- SelectTargetList(targets, 5, SELECT_TARGET_RANDOM, me->GetMeleeReach()*5, true);
+ SelectTargetList(targets, 5, SELECT_TARGET_RANDOM, me->GetCombatReach()*5, true);
for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
if (!me->IsWithinMeleeRange(*i))
{
@@ -347,7 +341,7 @@ struct boss_moroes_guestAI : public ScriptedAI
void Reset() override
{
- instance->SetData(TYPE_MOROES, NOT_STARTED);
+ instance->SetBossState(DATA_MOROES, NOT_STARTED);
}
void AcquireGUID()
@@ -373,7 +367,7 @@ struct boss_moroes_guestAI : public ScriptedAI
void UpdateAI(uint32 /*diff*/) override
{
- if (!instance->GetData(TYPE_MOROES))
+ if (instance->GetBossState(DATA_MOROES) != IN_PROGRESS)
EnterEvadeMode();
DoMeleeAttackIfReady();
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
index 6f5f2b8f65f..6ff20e66f7f 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
@@ -138,15 +138,15 @@ public:
{
Initialize();
- me->SetSpeed(MOVE_RUN, 2.0f);
+ me->SetSpeedRate(MOVE_RUN, 2.0f);
me->SetDisableGravity(true);
me->SetWalk(false);
me->setActive(true);
- if (instance->GetData(TYPE_NIGHTBANE) == DONE || instance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
+ if (instance->GetBossState(DATA_NIGHTBANE) == DONE || instance->GetBossState(DATA_NIGHTBANE) == IN_PROGRESS)
me->DisappearAndDie();
else
- instance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
+ instance->SetBossState(DATA_NIGHTBANE, NOT_STARTED);
HandleTerraceDoors(true);
@@ -165,10 +165,10 @@ public:
void EnterCombat(Unit* /*who*/) override
{
- instance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
+ instance->SetBossState(DATA_NIGHTBANE, IN_PROGRESS);
HandleTerraceDoors(false);
- Talk(YELL_AGGRO);
+ Talk(YELL_AGGRO);
}
void AttackStart(Unit* who) override
@@ -179,7 +179,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
- instance->SetData(TYPE_NIGHTBANE, DONE);
+ instance->SetBossState(DATA_NIGHTBANE, DONE);
HandleTerraceDoors(true);
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
index 450678a0f86..17a23a0b2e7 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -154,7 +154,7 @@ public:
Initialize();
// Not in progress
- instance->SetData(TYPE_ARAN, NOT_STARTED);
+ instance->SetBossState(DATA_ARAN, NOT_STARTED);
instance->HandleGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR), true);
}
@@ -167,7 +167,7 @@ public:
{
Talk(SAY_DEATH);
- instance->SetData(TYPE_ARAN, DONE);
+ instance->SetBossState(DATA_ARAN, DONE);
instance->HandleGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR), true);
}
@@ -175,7 +175,7 @@ public:
{
Talk(SAY_AGGRO);
- instance->SetData(TYPE_ARAN, IN_PROGRESS);
+ instance->SetBossState(DATA_ARAN, IN_PROGRESS);
instance->HandleGameObject(instance->GetGuidData(DATA_GO_LIBRARY_DOOR), false);
}
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
index 7bc835dcced..2e33f0933e3 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp
@@ -61,7 +61,6 @@ enum Creatures
NPC_DEMONCHAINS = 17248,
NPC_FIENDISHIMP = 17267,
NPC_PORTAL = 17265,
- NPC_KILREK = 17229
};
@@ -316,7 +315,7 @@ public:
Initialize();
- instance->SetData(TYPE_TERESTIAN, NOT_STARTED);
+ instance->SetBossState(DATA_TERESTIAN, NOT_STARTED);
me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
@@ -371,7 +370,7 @@ public:
Talk(SAY_DEATH);
- instance->SetData(TYPE_TERESTIAN, DONE);
+ instance->SetBossState(DATA_TERESTIAN, DONE);
}
void UpdateAI(uint32 diff) override
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index d4d0e6fa70d..2e4ac11d3fa 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -674,6 +674,12 @@ public:
void Initialize()
{
+ // Hello, developer from the future! It's me again!
+ // This time, you're fixing Karazhan scripts. Awesome. These are a mess of hacks. An amalgamation of hacks, so to speak. Maybe even a Patchwerk thereof.
+ // Anyway, I digress.
+ // @todo This line below is obviously a hack. Duh. I'm just coming in here to hackfix the encounter to actually be completable.
+ // It needs a rewrite. Badly. Please, take good care of it.
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
CycloneTimer = 30000;
ChainLightningTimer = 10000;
}
@@ -701,20 +707,12 @@ public:
void EnterCombat(Unit* /*who*/) override
{
Talk(SAY_CRONE_AGGRO);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_CRONE_DEATH);
-
- instance->SetData(TYPE_OPERA, DONE);
- instance->HandleGameObject(instance->GetGuidData(DATA_GO_STAGEDOORLEFT), true);
- instance->HandleGameObject(instance->GetGuidData(DATA_GO_STAGEDOORRIGHT), true);
-
- if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetGuidData(DATA_GO_SIDE_ENTRANCE_DOOR)))
- pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
+ instance->SetBossState(DATA_OPERA_PERFORMANCE, DONE);
}
void UpdateAI(uint32 diff) override
@@ -722,9 +720,6 @@ public:
if (!UpdateVictim())
return;
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
if (CycloneTimer <= diff)
{
if (Creature* Cyclone = DoSpawnCreature(CREATURE_CYCLONE, float(urand(0, 9)), float(urand(0, 9)), 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
@@ -802,46 +797,43 @@ enum RedRidingHood
SAY_WOLF_AGGRO = 0,
SAY_WOLF_SLAY = 1,
SAY_WOLF_HOOD = 2,
+ OPTION_WHAT_PHAT_LEWTS_YOU_HAVE = 7443,
SOUND_WOLF_DEATH = 9275,
SPELL_LITTLE_RED_RIDING_HOOD = 30768,
SPELL_TERRIFYING_HOWL = 30752,
SPELL_WIDE_SWIPE = 30761,
- CREATURE_BIG_BAD_WOLF = 17521,
+ CREATURE_BIG_BAD_WOLF = 17521
};
-
-#define GOSSIP_GRANDMA "What phat lewtz you have grandmother?"
-
-
-
class npc_grandmother : public CreatureScript
{
-public:
- npc_grandmother() : CreatureScript("npc_grandmother") { }
+ public:
+ npc_grandmother() : CreatureScript("npc_grandmother") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF)
+ struct npc_grandmotherAI : public ScriptedAI
{
- if (Creature* pBigBadWolf = creature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
- pBigBadWolf->AI()->AttackStart(player);
+ npc_grandmotherAI(Creature* creature) : ScriptedAI(creature) { }
- creature->DespawnOrUnsummon();
- }
+ void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
+ {
+ if (menuId == OPTION_WHAT_PHAT_LEWTS_YOU_HAVE && gossipListId == 0)
+ {
+ player->CLOSE_GOSSIP_MENU();
- return true;
- }
+ if (Creature* pBigBadWolf = me->SummonCreature(CREATURE_BIG_BAD_WOLF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
+ pBigBadWolf->AI()->AttackStart(player);
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GRANDMA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(8990, creature->GetGUID());
+ me->DespawnOrUnsummon();
+ }
+ }
+ };
- return true;
- }
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new npc_grandmotherAI(creature);
+ }
};
class boss_bigbadwolf : public CreatureScript
@@ -908,13 +900,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
DoPlaySoundToSet(me, SOUND_WOLF_DEATH);
-
- instance->SetData(TYPE_OPERA, DONE);
- instance->HandleGameObject(instance->GetGuidData(DATA_GO_STAGEDOORLEFT), true);
- instance->HandleGameObject(instance->GetGuidData(DATA_GO_STAGEDOORRIGHT), true);
-
- if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetGuidData(DATA_GO_SIDE_ENTRANCE_DOOR)))
- pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
+ instance->SetBossState(DATA_OPERA_PERFORMANCE, DONE);
}
void UpdateAI(uint32 diff) override
@@ -1158,12 +1144,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_JULIANNE_DEATH02);
-
- instance->SetData(TYPE_OPERA, DONE);
- instance->HandleGameObject(instance->GetGuidData(DATA_GO_STAGEDOORLEFT), true);
- instance->HandleGameObject(instance->GetGuidData(DATA_GO_STAGEDOORRIGHT), true);
- if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetGuidData(DATA_GO_SIDE_ENTRANCE_DOOR)))
- pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
+ instance->SetBossState(DATA_OPERA_PERFORMANCE, DONE);
}
void KilledUnit(Unit* /*victim*/) override
@@ -1316,13 +1297,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_ROMULO_DEATH);
-
- instance->SetData(TYPE_OPERA, DONE);
- instance->HandleGameObject(instance->GetGuidData(DATA_GO_STAGEDOORLEFT), true);
- instance->HandleGameObject(instance->GetGuidData(DATA_GO_STAGEDOORRIGHT), true);
-
- if (GameObject* pSideEntrance = instance->instance->GetGameObject(instance->GetGuidData(DATA_GO_SIDE_ENTRANCE_DOOR)))
- pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
+ instance->SetBossState(DATA_OPERA_PERFORMANCE, DONE);
}
void KilledUnit(Unit* /*victim*/) override
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
index b725f421c8f..ad403e6aeed 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
@@ -27,8 +27,6 @@ EndScriptData */
#include "InstanceScript.h"
#include "karazhan.h"
-#define MAX_ENCOUNTER 12
-
/*
0 - Attumen + Midnight (optional)
1 - Moroes
@@ -47,8 +45,8 @@ EndScriptData */
const Position OptionalSpawn[] =
{
{ -10960.981445f, -1940.138428f, 46.178097f, 4.12f }, // Hyakiss the Lurker
- { -10899.903320f, -2085.573730f, 49.474449f, 1.38f }, // Rokad the Ravager
- { -10945.769531f, -2040.153320f, 49.474438f, 0.077f } // Shadikith the Glider
+ { -10945.769531f, -2040.153320f, 49.474438f, 0.077f }, // Shadikith the Glider
+ { -10899.903320f, -2085.573730f, 49.474449f, 1.38f } // Rokad the Ravager
};
class instance_karazhan : public InstanceMapScript
@@ -66,53 +64,27 @@ public:
instance_karazhan_InstanceMapScript(Map* map) : InstanceScript(map)
{
SetHeaders(DataHeader);
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ SetBossNumber(EncounterCount);
// 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered.
- m_uiOperaEvent = urand(1, 3);
- m_uiOzDeathCount = 0;
+ OperaEvent = urand(EVENT_OZ, EVENT_RAJ);
+ OzDeathCount = 0;
OptionalBossCount = 0;
}
- uint32 m_auiEncounter[MAX_ENCOUNTER];
- std::string strSaveData;
-
- uint32 m_uiOperaEvent;
- uint32 m_uiOzDeathCount;
- uint32 OptionalBossCount;
-
- ObjectGuid m_uiCurtainGUID;
- ObjectGuid m_uiStageDoorLeftGUID;
- ObjectGuid m_uiStageDoorRightGUID;
- ObjectGuid m_uiKilrekGUID;
- ObjectGuid m_uiTerestianGUID;
- ObjectGuid m_uiMoroesGUID;
- ObjectGuid m_uiLibraryDoor; // Door at Shade of Aran
- ObjectGuid m_uiMassiveDoor; // Door at Netherspite
- ObjectGuid m_uiSideEntranceDoor; // Side Entrance
- ObjectGuid m_uiGamesmansDoor; // Door before Chess
- ObjectGuid m_uiGamesmansExitDoor; // Door after Chess
- ObjectGuid m_uiNetherspaceDoor; // Door at Malchezaar
- ObjectGuid MastersTerraceDoor[2];
- ObjectGuid ImageGUID;
- ObjectGuid DustCoveredChest;
-
- bool IsEncounterInProgress() const override
- {
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS)
- return true;
-
- return false;
- }
-
void OnCreatureCreate(Creature* creature) override
{
switch (creature->GetEntry())
{
- case 17229: m_uiKilrekGUID = creature->GetGUID(); break;
- case 15688: m_uiTerestianGUID = creature->GetGUID(); break;
- case 15687: m_uiMoroesGUID = creature->GetGUID(); break;
+ case NPC_KILREK:
+ KilrekGUID = creature->GetGUID();
+ break;
+ case NPC_TERESTIAN_ILLHOOF:
+ TerestianGUID = creature->GetGUID();
+ break;
+ case NPC_MOROES:
+ MoroesGUID = creature->GetGUID();
+ break;
}
}
@@ -132,130 +104,129 @@ public:
case NPC_PHASE_HOUND:
case NPC_DREADBEAST:
case NPC_SHADOWBEAST:
- SetData(TYPE_OPTIONAL_BOSS, NOT_STARTED);
- break;
- default:
- break;
- }
- }
-
- void SetData(uint32 type, uint32 uiData) override
- {
- switch (type)
- {
- case TYPE_ATTUMEN: m_auiEncounter[0] = uiData; break;
- case TYPE_MOROES:
- if (m_auiEncounter[1] == DONE)
- break;
- m_auiEncounter[1] = uiData;
- break;
- case TYPE_MAIDEN: m_auiEncounter[2] = uiData; break;
- case TYPE_OPTIONAL_BOSS:
- m_auiEncounter[3] = uiData;
- if (uiData == NOT_STARTED)
+ if (GetBossState(DATA_OPTIONAL_BOSS) == TO_BE_DECIDED)
{
++OptionalBossCount;
- if (OptionalBossCount == 50)
+ if (OptionalBossCount == OPTIONAL_BOSS_REQUIRED_DEATH_COUNT)
{
- switch (urand(0, 2))
+ switch (urand(NPC_HYAKISS_THE_LURKER, NPC_ROKAD_THE_RAVAGER))
{
- case 0:
+ case NPC_HYAKISS_THE_LURKER:
instance->SummonCreature(NPC_HYAKISS_THE_LURKER, OptionalSpawn[0]);
break;
- case 1:
- instance->SummonCreature(NPC_ROKAD_THE_RAVAGER, OptionalSpawn[1]);
+ case NPC_SHADIKITH_THE_GLIDER:
+ instance->SummonCreature(NPC_SHADIKITH_THE_GLIDER, OptionalSpawn[1]);
break;
- case 2:
- instance->SummonCreature(NPC_SHADIKITH_THE_GLIDER, OptionalSpawn[2]);
+ case NPC_ROKAD_THE_RAVAGER:
+ instance->SummonCreature(NPC_ROKAD_THE_RAVAGER, OptionalSpawn[2]);
break;
}
}
}
break;
- case TYPE_OPERA:
- m_auiEncounter[4] = uiData;
- if (uiData == DONE)
- UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, 16812, NULL);
- break;
- case TYPE_CURATOR: m_auiEncounter[5] = uiData; break;
- case TYPE_ARAN: m_auiEncounter[6] = uiData; break;
- case TYPE_TERESTIAN: m_auiEncounter[7] = uiData; break;
- case TYPE_NETHERSPITE: m_auiEncounter[8] = uiData; break;
- case TYPE_CHESS:
- if (uiData == DONE)
- DoRespawnGameObject(DustCoveredChest, DAY);
- m_auiEncounter[9] = uiData;
- break;
- case TYPE_MALCHEZZAR: m_auiEncounter[10] = uiData; break;
- case TYPE_NIGHTBANE:
- if (m_auiEncounter[11] != DONE)
- m_auiEncounter[11] = uiData;
- break;
- case DATA_OPERA_OZ_DEATHCOUNT:
- if (uiData == SPECIAL)
- ++m_uiOzDeathCount;
- else if (uiData == IN_PROGRESS)
- m_uiOzDeathCount = 0;
+ default:
break;
}
+ }
- if (uiData == DONE)
+ void SetData(uint32 type, uint32 data) override
+ {
+ switch (type)
{
- OUT_SAVE_INST_DATA;
-
- std::ostringstream saveStream;
- saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' '
- << m_auiEncounter[3] << ' ' << m_auiEncounter[4] << ' ' << m_auiEncounter[5] << ' ' << m_auiEncounter[6] << ' '
- << m_auiEncounter[7] << ' ' << m_auiEncounter[8] << ' ' << m_auiEncounter[9] << ' ' << m_auiEncounter[10] << ' ' << m_auiEncounter[11];
+ case DATA_OPERA_OZ_DEATHCOUNT:
+ if (data == SPECIAL)
+ ++OzDeathCount;
+ else if (data == IN_PROGRESS)
+ OzDeathCount = 0;
+ break;
+ }
+ }
- strSaveData = saveStream.str();
+ bool SetBossState(uint32 type, EncounterState state) override
+ {
+ if (!InstanceScript::SetBossState(type, state))
+ return false;
- SaveToDB();
- OUT_SAVE_INST_DATA_COMPLETE;
+ switch (type)
+ {
+ case DATA_OPERA_PERFORMANCE:
+ if (state == DONE)
+ {
+ HandleGameObject(StageDoorLeftGUID, true);
+ HandleGameObject(StageDoorRightGUID, true);
+ if (GameObject* sideEntrance = instance->GetGameObject(SideEntranceDoor))
+ sideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
+ UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, 16812, NULL);
+ }
+ break;
+ case DATA_CHESS:
+ if (state == DONE)
+ DoRespawnGameObject(DustCoveredChest, DAY);
+ break;
+ default:
+ break;
}
+
+ return true;
}
- void SetGuidData(uint32 identifier, ObjectGuid data) override
+ void SetGuidData(uint32 type, ObjectGuid data) override
{
- switch (identifier)
- {
- case DATA_IMAGE_OF_MEDIVH: ImageGUID = data;
- }
+ if (type == DATA_IMAGE_OF_MEDIVH)
+ ImageGUID = data;
}
void OnGameObjectCreate(GameObject* go) override
{
switch (go->GetEntry())
{
- case 183932: m_uiCurtainGUID = go->GetGUID(); break;
- case 184278:
- m_uiStageDoorLeftGUID = go->GetGUID();
- if (m_auiEncounter[4] == DONE)
+ case GO_STAGE_CURTAIN:
+ CurtainGUID = go->GetGUID();
+ break;
+ case GO_STAGE_DOOR_LEFT:
+ StageDoorLeftGUID = go->GetGUID();
+ if (GetBossState(DATA_OPERA_PERFORMANCE) == DONE)
go->SetGoState(GO_STATE_ACTIVE);
break;
- case 184279:
- m_uiStageDoorRightGUID = go->GetGUID();
- if (m_auiEncounter[4] == DONE)
+ case GO_STAGE_DOOR_RIGHT:
+ StageDoorRightGUID = go->GetGUID();
+ if (GetBossState(DATA_OPERA_PERFORMANCE) == DONE)
go->SetGoState(GO_STATE_ACTIVE);
break;
- case 184517: m_uiLibraryDoor = go->GetGUID(); break;
- case 185521: m_uiMassiveDoor = go->GetGUID(); break;
- case 184276: m_uiGamesmansDoor = go->GetGUID(); break;
- case 184277: m_uiGamesmansExitDoor = go->GetGUID(); break;
- case 185134: m_uiNetherspaceDoor = go->GetGUID(); break;
- case 184274: MastersTerraceDoor[0] = go->GetGUID(); break;
- case 184280: MastersTerraceDoor[1] = go->GetGUID(); break;
- case 184275:
- m_uiSideEntranceDoor = go->GetGUID();
- if (m_auiEncounter[4] == DONE)
+ case GO_PRIVATE_LIBRARY_DOOR:
+ LibraryDoor = go->GetGUID();
+ break;
+ case GO_MASSIVE_DOOR:
+ MassiveDoor = go->GetGUID();
+ break;
+ case GO_GAMESMAN_HALL_DOOR:
+ GamesmansDoor = go->GetGUID();
+ break;
+ case GO_GAMESMAN_HALL_EXIT_DOOR:
+ GamesmansExitDoor = go->GetGUID();
+ break;
+ case GO_NETHERSPACE_DOOR:
+ NetherspaceDoor = go->GetGUID();
+ break;
+ case GO_MASTERS_TERRACE_DOOR:
+ MastersTerraceDoor[0] = go->GetGUID();
+ break;
+ case GO_MASTERS_TERRACE_DOOR2:
+ MastersTerraceDoor[1] = go->GetGUID();
+ break;
+ case GO_SIDE_ENTRANCE_DOOR:
+ SideEntranceDoor = go->GetGUID();
+ if (GetBossState(DATA_OPERA_PERFORMANCE) == DONE)
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
else
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
break;
- case 185119: DustCoveredChest = go->GetGUID(); break;
+ case GO_DUST_COVERED_CHEST:
+ DustCoveredChest = go->GetGUID();
+ break;
}
- switch (m_uiOperaEvent)
+ switch (OperaEvent)
{
/// @todo Set Object visibilities for Opera based on performance
case EVENT_OZ:
@@ -269,77 +240,77 @@ public:
}
}
- std::string GetSaveData() override
- {
- return strSaveData;
- }
-
- uint32 GetData(uint32 uiData) const override
+ uint32 GetData(uint32 type) const override
{
- switch (uiData)
+ switch (type)
{
- case TYPE_ATTUMEN: return m_auiEncounter[0];
- case TYPE_MOROES: return m_auiEncounter[1];
- case TYPE_MAIDEN: return m_auiEncounter[2];
- case TYPE_OPTIONAL_BOSS: return m_auiEncounter[3];
- case TYPE_OPERA: return m_auiEncounter[4];
- case TYPE_CURATOR: return m_auiEncounter[5];
- case TYPE_ARAN: return m_auiEncounter[6];
- case TYPE_TERESTIAN: return m_auiEncounter[7];
- case TYPE_NETHERSPITE: return m_auiEncounter[8];
- case TYPE_CHESS: return m_auiEncounter[9];
- case TYPE_MALCHEZZAR: return m_auiEncounter[10];
- case TYPE_NIGHTBANE: return m_auiEncounter[11];
- case DATA_OPERA_PERFORMANCE: return m_uiOperaEvent;
- case DATA_OPERA_OZ_DEATHCOUNT: return m_uiOzDeathCount;
+ case DATA_OPERA_PERFORMANCE:
+ return OperaEvent;
+ case DATA_OPERA_OZ_DEATHCOUNT:
+ return OzDeathCount;
}
return 0;
}
- ObjectGuid GetGuidData(uint32 uiData) const override
+ ObjectGuid GetGuidData(uint32 type) const override
{
- switch (uiData)
+ switch (type)
{
- case DATA_KILREK: return m_uiKilrekGUID;
- case DATA_TERESTIAN: return m_uiTerestianGUID;
- case DATA_MOROES: return m_uiMoroesGUID;
- case DATA_GO_STAGEDOORLEFT: return m_uiStageDoorLeftGUID;
- case DATA_GO_STAGEDOORRIGHT: return m_uiStageDoorRightGUID;
- case DATA_GO_CURTAINS: return m_uiCurtainGUID;
- case DATA_GO_LIBRARY_DOOR: return m_uiLibraryDoor;
- case DATA_GO_MASSIVE_DOOR: return m_uiMassiveDoor;
- case DATA_GO_SIDE_ENTRANCE_DOOR: return m_uiSideEntranceDoor;
- case DATA_GO_GAME_DOOR: return m_uiGamesmansDoor;
- case DATA_GO_GAME_EXIT_DOOR: return m_uiGamesmansExitDoor;
- case DATA_GO_NETHER_DOOR: return m_uiNetherspaceDoor;
- case DATA_MASTERS_TERRACE_DOOR_1: return MastersTerraceDoor[0];
- case DATA_MASTERS_TERRACE_DOOR_2: return MastersTerraceDoor[1];
- case DATA_IMAGE_OF_MEDIVH: return ImageGUID;
+ case DATA_KILREK:
+ return KilrekGUID;
+ case DATA_TERESTIAN:
+ return TerestianGUID;
+ case DATA_MOROES:
+ return MoroesGUID;
+ case DATA_GO_STAGEDOORLEFT:
+ return StageDoorLeftGUID;
+ case DATA_GO_STAGEDOORRIGHT:
+ return StageDoorRightGUID;
+ case DATA_GO_CURTAINS:
+ return CurtainGUID;
+ case DATA_GO_LIBRARY_DOOR:
+ return LibraryDoor;
+ case DATA_GO_MASSIVE_DOOR:
+ return MassiveDoor;
+ case DATA_GO_SIDE_ENTRANCE_DOOR:
+ return SideEntranceDoor;
+ case DATA_GO_GAME_DOOR:
+ return GamesmansDoor;
+ case DATA_GO_GAME_EXIT_DOOR:
+ return GamesmansExitDoor;
+ case DATA_GO_NETHER_DOOR:
+ return NetherspaceDoor;
+ case DATA_MASTERS_TERRACE_DOOR_1:
+ return MastersTerraceDoor[0];
+ case DATA_MASTERS_TERRACE_DOOR_2:
+ return MastersTerraceDoor[1];
+ case DATA_IMAGE_OF_MEDIVH:
+ return ImageGUID;
}
return ObjectGuid::Empty;
}
- void Load(char const* chrIn) override
- {
- if (!chrIn)
- {
- OUT_LOAD_INST_DATA_FAIL;
- return;
- }
-
- OUT_LOAD_INST_DATA(chrIn);
- std::istringstream loadStream(chrIn);
-
- loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]
- >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7]
- >> m_auiEncounter[8] >> m_auiEncounter[9] >> m_auiEncounter[10] >> m_auiEncounter[11];
- for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
- m_auiEncounter[i] = NOT_STARTED;
- OUT_LOAD_INST_DATA_COMPLETE;
- }
+ private:
+ uint32 OperaEvent;
+ uint32 OzDeathCount;
+ uint32 OptionalBossCount;
+ ObjectGuid CurtainGUID;
+ ObjectGuid StageDoorLeftGUID;
+ ObjectGuid StageDoorRightGUID;
+ ObjectGuid KilrekGUID;
+ ObjectGuid TerestianGUID;
+ ObjectGuid MoroesGUID;
+ ObjectGuid LibraryDoor; // Door at Shade of Aran
+ ObjectGuid MassiveDoor; // Door at Netherspite
+ ObjectGuid SideEntranceDoor; // Side Entrance
+ ObjectGuid GamesmansDoor; // Door before Chess
+ ObjectGuid GamesmansExitDoor; // Door after Chess
+ ObjectGuid NetherspaceDoor; // Door at Malchezaar
+ ObjectGuid MastersTerraceDoor[2];
+ ObjectGuid ImageGUID;
+ ObjectGuid DustCoveredChest;
};
};
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
index aa2da8cc391..ace15cc2a7e 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp
@@ -168,7 +168,7 @@ public:
void StartEvent()
{
- instance->SetData(TYPE_OPERA, IN_PROGRESS);
+ instance->SetBossState(DATA_OPERA_PERFORMANCE, IN_PROGRESS);
//resets count for this event, in case earlier failed
if (m_uiEventId == EVENT_OZ)
@@ -377,7 +377,7 @@ public:
if (InstanceScript* instance = creature->GetInstanceScript())
{
// Check for death of Moroes and if opera event is not done already
- if (instance->GetData(TYPE_MOROES) == DONE && instance->GetData(TYPE_OPERA) != DONE)
+ if (instance->GetBossState(DATA_MOROES) == DONE && instance->GetBossState(DATA_OPERA_PERFORMANCE) != DONE)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
@@ -562,7 +562,7 @@ public:
arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f);
arca->setActive(true);
arca->InterruptNonMeleeSpells(true);
- arca->SetSpeed(MOVE_FLIGHT, 2.0f);
+ arca->SetSpeedRate(MOVE_FLIGHT, 2.0f);
}
return 10000;
case 13:
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
index 4d86492257c..2dc3750dc5b 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
+++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h
@@ -21,27 +21,26 @@
#define DataHeader "KZ"
+uint32 const EncounterCount = 12;
+
enum DataTypes
{
- TYPE_ATTUMEN = 1,
- TYPE_MOROES = 2,
- TYPE_MAIDEN = 3,
- TYPE_OPTIONAL_BOSS = 4,
- TYPE_OPERA = 5,
- TYPE_CURATOR = 6,
- TYPE_ARAN = 7,
- TYPE_TERESTIAN = 8,
- TYPE_NETHERSPITE = 9,
- TYPE_CHESS = 10,
- TYPE_MALCHEZZAR = 11,
- TYPE_NIGHTBANE = 12,
+ DATA_ATTUMEN = 0,
+ DATA_MOROES = 1,
+ DATA_MAIDEN_OF_VIRTUE = 2,
+ DATA_OPTIONAL_BOSS = 3,
+ DATA_OPERA_PERFORMANCE = 4,
+ DATA_CURATOR = 5,
+ DATA_ARAN = 6,
+ DATA_TERESTIAN = 7,
+ DATA_NETHERSPITE = 8,
+ DATA_CHESS = 9,
+ DATA_MALCHEZZAR = 10,
+ DATA_NIGHTBANE = 11,
- DATA_OPERA_PERFORMANCE = 13,
DATA_OPERA_OZ_DEATHCOUNT = 14,
DATA_KILREK = 15,
- DATA_TERESTIAN = 16,
- DATA_MOROES = 17,
DATA_GO_CURTAINS = 18,
DATA_GO_STAGEDOORLEFT = 19,
DATA_GO_STAGEDOORRIGHT = 20,
@@ -69,6 +68,11 @@ enum MiscCreatures
NPC_HYAKISS_THE_LURKER = 16179,
NPC_ROKAD_THE_RAVAGER = 16181,
NPC_SHADIKITH_THE_GLIDER = 16180,
+ NPC_TERESTIAN_ILLHOOF = 15688,
+ NPC_MOROES = 15687,
+ NPC_ATTUMEN_UNMOUNTED = 15550,
+ NPC_ATTUMEN_MOUNTED = 16152,
+ NPC_MIDNIGHT = 16151,
// Trash
NPC_COLDMIST_WIDOW = 16171,
@@ -78,6 +82,29 @@ enum MiscCreatures
NPC_GREATER_SHADOWBAT = 16174,
NPC_PHASE_HOUND = 16178,
NPC_DREADBEAST = 16177,
- NPC_SHADOWBEAST = 16176
+ NPC_SHADOWBEAST = 16176,
+ NPC_KILREK = 17229
+};
+
+enum GameObjectIds
+{
+ GO_STAGE_CURTAIN = 183932,
+ GO_STAGE_DOOR_LEFT = 184278,
+ GO_STAGE_DOOR_RIGHT = 184279,
+ GO_PRIVATE_LIBRARY_DOOR = 184517,
+ GO_MASSIVE_DOOR = 185521,
+ GO_GAMESMAN_HALL_DOOR = 184276,
+ GO_GAMESMAN_HALL_EXIT_DOOR = 184277,
+ GO_NETHERSPACE_DOOR = 185134,
+ GO_MASTERS_TERRACE_DOOR = 184274,
+ GO_MASTERS_TERRACE_DOOR2 = 184280,
+ GO_SIDE_ENTRANCE_DOOR = 184275,
+ GO_DUST_COVERED_CHEST = 185119
};
+
+enum Misc
+{
+ OPTIONAL_BOSS_REQUIRED_DEATH_COUNT = 50
+};
+
#endif
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
index b809128e731..ebe406c8909 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
@@ -405,7 +405,7 @@ public:
Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
if (Orb && target)
{
- Orb->SetSpeed(MOVE_RUN, 0.5f);
+ Orb->SetSpeedRate(MOVE_RUN, 0.5f);
Orb->AddThreat(target, 1000000.0f);
Orb->AI()->AttackStart(target);
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index 81044a0dbb1..3cf78b79f67 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -396,7 +396,7 @@ class npc_eye_of_acherus : public CreatureScript
if (Player* owner = me->GetCharmerOrOwner()->ToPlayer())
{
for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
- me->SetSpeed(UnitMoveType(i), owner->GetSpeedRate(UnitMoveType(i)), true);
+ me->SetSpeedRate(UnitMoveType(i), owner->GetSpeedRate(UnitMoveType(i)));
Talk(TALK_MOVE_START, owner);
}
me->GetMotionMaster()->MovePath(me->GetEntry() * 100, false);
@@ -419,7 +419,7 @@ class npc_eye_of_acherus : public CreatureScript
{
owner->RemoveAura(SPELL_EYE_FLIGHT_BOOST);
for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
- me->SetSpeed(UnitMoveType(i), owner->GetSpeedRate(UnitMoveType(i)), true);
+ me->SetSpeedRate(UnitMoveType(i), owner->GetSpeedRate(UnitMoveType(i)));
Talk(TALK_CONTROL, owner);
}
@@ -703,7 +703,7 @@ class npc_dark_rider_of_acherus : public CreatureScript
TargetGUID = who->GetGUID();
me->SetWalk(true);
- me->SetSpeed(MOVE_RUN, 0.4f);
+ me->SetSpeedRate(MOVE_RUN, 0.4f);
me->GetMotionMaster()->MoveChase(who);
me->SetTarget(TargetGUID);
Intro = true;
@@ -1050,7 +1050,7 @@ class npc_scarlet_miner_cart : public CreatureScript
// Not 100% correct, but movement is smooth. Sometimes miner walks faster
// than normal, this speed is fast enough to keep up at those times.
- me->SetSpeed(MOVE_RUN, 1.25f);
+ me->SetSpeedRate(MOVE_RUN, 1.25f);
me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0);
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
index e336ff24382..ea6d2cb0b6f 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -923,7 +923,7 @@ public:
if (ObjectAccessor::GetCreature(*me, uiLichKingGUID))
DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge
// doesn't make it looks well, so workarounds, Darion charges, looks better
- me->SetSpeed(MOVE_RUN, 3.0f);
+ me->SetSpeedRate(MOVE_RUN, 3.0f);
me->SetWalk(false);
SetHoldState(false);
JumpToNextStep(0);
@@ -935,7 +935,7 @@ public:
temp->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
temp->AI()->Talk(SAY_LIGHT_OF_DAWN46);
}
- me->SetSpeed(MOVE_RUN, 6.0f);
+ me->SetSpeedRate(MOVE_RUN, 6.0f);
me->SetStandState(UNIT_STAND_STATE_DEAD);
SetHoldState(false); // Darion got kicked by lich king
JumpToNextStep(0);
@@ -997,7 +997,7 @@ public:
Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
- temp->SetSpeed(MOVE_RUN, 2.0f);
+ temp->SetSpeedRate(MOVE_RUN, 2.0f);
temp->setFaction(me->getFaction());
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
uiDefenderGUID[0] = temp->GetGUID();
@@ -1005,7 +1005,7 @@ public:
temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
- temp->SetSpeed(MOVE_RUN, 2.0f);
+ temp->SetSpeedRate(MOVE_RUN, 2.0f);
temp->setFaction(me->getFaction());
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
uiEarthshatterGUID[0] = temp->GetGUID();
@@ -1014,7 +1014,7 @@ public:
{
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
- temp->SetSpeed(MOVE_RUN, 2.0f);
+ temp->SetSpeedRate(MOVE_RUN, 2.0f);
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
temp->AI()->Talk(SAY_LIGHT_OF_DAWN50);
}
@@ -1022,7 +1022,7 @@ public:
{
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
- temp->SetSpeed(MOVE_RUN, 2.0f);
+ temp->SetSpeedRate(MOVE_RUN, 2.0f);
temp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED);
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
}
@@ -1030,7 +1030,7 @@ public:
{
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
- temp->SetSpeed(MOVE_RUN, 2.0f);
+ temp->SetSpeedRate(MOVE_RUN, 2.0f);
temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
}
}
@@ -1044,33 +1044,33 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiMaxwellGUID))
{
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
- temp->SetSpeed(MOVE_RUN, 6.0f);
+ temp->SetSpeedRate(MOVE_RUN, 6.0f);
temp->SetStandState(UNIT_STAND_STATE_DEAD);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[14]);
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKorfaxGUID))
{
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
- temp->SetSpeed(MOVE_RUN, 6.0f);
+ temp->SetSpeedRate(MOVE_RUN, 6.0f);
temp->SetStandState(UNIT_STAND_STATE_DEAD);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[11]);
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiEligorGUID))
{
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
- temp->SetSpeed(MOVE_RUN, 6.0f);
+ temp->SetSpeedRate(MOVE_RUN, 6.0f);
temp->SetStandState(UNIT_STAND_STATE_DEAD);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[17]);
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiDefenderGUID[0]))
{
- temp->SetSpeed(MOVE_RUN, 6.0f);
+ temp->SetSpeedRate(MOVE_RUN, 6.0f);
temp->SetStandState(UNIT_STAND_STATE_DEAD);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }));
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiEarthshatterGUID[0]))
{
- temp->SetSpeed(MOVE_RUN, 6.0f);
+ temp->SetSpeedRate(MOVE_RUN, 6.0f);
temp->SetStandState(UNIT_STAND_STATE_DEAD);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }));
}
@@ -1093,7 +1093,7 @@ public:
break;
case 46: // Darion stand up, "not today"
- me->SetSpeed(MOVE_RUN, 1.0f);
+ me->SetSpeedRate(MOVE_RUN, 1.0f);
me->SetWalk(true);
me->SetStandState(UNIT_STAND_STATE_STAND);
Talk(SAY_LIGHT_OF_DAWN53);
@@ -1116,7 +1116,7 @@ public:
case 48: // Show the cleansing effect (dawn of light)
//if (GameObject* go = me->GetMap()->GetGameObject(uiDawnofLightGUID))
// go->SetPhaseMask(128, true);
- me->SummonGameObject(GO_LIGHT_OF_DAWN, 2283.896f, -5287.914f, 83.066f, 0, 0, 0, 0, 0, 30);
+ me->SummonGameObject(GO_LIGHT_OF_DAWN, 2283.896f, -5287.914f, 83.066f, 0.f, G3D::Quat(), 30);
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID))
{
if (temp->HasAura(SPELL_REBIRTH_OF_THE_ASHBRINGER))
@@ -1153,7 +1153,7 @@ public:
temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN16);
temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
- temp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running
+ temp->SetSpeedRate(MOVE_RUN, 3.0f); // workarounds, make Tirion still running
temp->SetWalk(false);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2]);
if (Creature* lktemp = ObjectAccessor::GetCreature(*me, uiLichKingGUID))
@@ -1171,7 +1171,7 @@ public:
case 54:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiLichKingGUID))
{
- temp->SetSpeed(MOVE_RUN, 1.0f);
+ temp->SetSpeedRate(MOVE_RUN, 1.0f);
me->SetWalk(true);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29]); // 26
}
@@ -1208,7 +1208,7 @@ public:
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID)) // Tirion runs to Darion
{
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
- temp->SetSpeed(MOVE_RUN, 1.0f);
+ temp->SetSpeedRate(MOVE_RUN, 1.0f);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[6]);
}
JumpToNextStep(2500);
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
index 53b6d2be8dd..9abd0c049d8 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp
@@ -109,7 +109,7 @@ public:
FlyBackTimer = 4500;
break;
case 2:
- if (!player->isResurrectRequested())
+ if (!player->IsResurrectRequested())
{
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01);
DoCast(player, SPELL_REVIVE, true);
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index dff0a66cec0..734b70933aa 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
@@ -134,8 +134,6 @@ static char const* Text[]=
"Now, know demise!"
};
-#define EMOTE_LAUGHS "Headless Horseman laughs" // needs assigned to db.
-
class npc_wisp_invis : public CreatureScript
{
public:
@@ -347,7 +345,6 @@ public:
Creature* speaker = DoSpawnCreature(HELPER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 1000);
if (speaker)
speaker->CastSpell(speaker, SPELL_HEAD_SPEAKS, false);
- me->TextEmote(EMOTE_LAUGHS);
}
else laugh -= diff;
}
@@ -453,7 +450,7 @@ public:
me->SetVisible(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetDisableGravity(true);
- me->SetSpeed(MOVE_WALK, 5.0f, true);
+ me->SetSpeedRate(MOVE_WALK, 5.0f);
wp_reached = false;
count = 0;
say_timer = 3000;
@@ -724,7 +721,6 @@ public:
if (laugh <= diff)
{
laugh = urand(11000, 22000);
- me->TextEmote(EMOTE_LAUGHS);
DoPlaySoundToSet(me, RandomLaugh[rand32() % 3]);
}
else laugh -= diff;
@@ -898,12 +894,12 @@ public:
if (instance->GetBossState(DATA_HORSEMAN_EVENT) == IN_PROGRESS)
return false;
- player->AreaExploredOrEventHappens(11405);
- if (Creature* horseman = go->SummonCreature(HH_MOUNTED, FlightPoint[20].x, FlightPoint[20].y, FlightPoint[20].z, 0, TEMPSUMMON_MANUAL_DESPAWN, 0))
- {
- ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->PlayerGUID = player->GetGUID();
- ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->FlyMode();
- }
+ player->AreaExploredOrEventHappens(11405);
+ if (Creature* horseman = go->SummonCreature(HH_MOUNTED, FlightPoint[20].x, FlightPoint[20].y, FlightPoint[20].z, 0, TEMPSUMMON_MANUAL_DESPAWN, 0))
+ {
+ ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->PlayerGUID = player->GetGUID();
+ ENSURE_AI(boss_headless_horseman::boss_headless_horsemanAI, horseman->AI())->FlyMode();
+ }
return true;
}
};
diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
index 118d28e2142..241710627b0 100644
--- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
+++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
@@ -35,15 +35,25 @@ enum Gameobject
GO_ATALAI_STATUE4 = 148833,
GO_ATALAI_STATUE5 = 148834,
GO_ATALAI_STATUE6 = 148835,
- GO_ATALAI_IDOL = 148836,
GO_ATALAI_LIGHT1 = 148883,
GO_ATALAI_LIGHT2 = 148937
-
};
enum CreatureIds
{
- NPC_MALFURION_STORMRAGE = 15362
+ NPC_ATALALARION = 8580
+};
+
+static Position const atalalarianPos = { -466.5134f, 95.19822f, -189.6463f, 0.03490658f };
+static uint8 const nStatues = 6;
+static Position const statuePositions[nStatues]
+{
+ { -515.553f, 95.25821f, -173.707f, 0.0f },
+ { -419.8487f, 94.48368f, -173.707f, 0.0f },
+ { -491.4003f, 135.9698f, -173.707f, 0.0f },
+ { -491.4909f, 53.48179f, -173.707f, 0.0f },
+ { -443.8549f, 136.1007f, -173.707f, 0.0f },
+ { -443.4171f, 53.83124f, -173.707f, 0.0f }
};
class instance_sunken_temple : public InstanceMapScript
@@ -77,7 +87,6 @@ public:
ObjectGuid GOAtalaiStatue4;
ObjectGuid GOAtalaiStatue5;
ObjectGuid GOAtalaiStatue6;
- ObjectGuid GOAtalaiIdol;
uint32 State;
@@ -98,7 +107,6 @@ public:
case GO_ATALAI_STATUE4: GOAtalaiStatue4 = go->GetGUID(); break;
case GO_ATALAI_STATUE5: GOAtalaiStatue5 = go->GetGUID(); break;
case GO_ATALAI_STATUE6: GOAtalaiStatue6 = go->GetGUID(); break;
- case GO_ATALAI_IDOL: GOAtalaiIdol = go->GetGUID(); break;
}
}
@@ -155,7 +163,10 @@ public:
if (s1 && s2 && s3 && s4 && s5 && !s6)
{
if (GameObject* pAtalaiStatue6 = instance->GetGameObject(GOAtalaiStatue6))
+ {
UseStatue(pAtalaiStatue6);
+ UseLastStatue(pAtalaiStatue6);
+ }
s6 = true;
State = 0;
}
@@ -165,22 +176,17 @@ public:
void UseStatue(GameObject* go)
{
- go->SummonGameObject(GO_ATALAI_LIGHT1, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, 0, 0, 0, 0, 0);
+ go->SummonGameObject(GO_ATALAI_LIGHT1, *go, G3D::Quat(), 0);
go->SetUInt32Value(GAMEOBJECT_FLAGS, 4);
}
- /*
- void UseLastStatue(GameObject* go)
- {
- AtalaiStatue1->SummonGameObject(GO_ATALAI_LIGHT2, AtalaiStatue1->GetPositionX(), AtalaiStatue1->GetPositionY(), AtalaiStatue1->GetPositionZ(), 0, 0, 0, 0, 0, 100);
- AtalaiStatue2->SummonGameObject(GO_ATALAI_LIGHT2, AtalaiStatue2->GetPositionX(), AtalaiStatue2->GetPositionY(), AtalaiStatue2->GetPositionZ(), 0, 0, 0, 0, 0, 100);
- AtalaiStatue3->SummonGameObject(GO_ATALAI_LIGHT2, AtalaiStatue3->GetPositionX(), AtalaiStatue3->GetPositionY(), AtalaiStatue3->GetPositionZ(), 0, 0, 0, 0, 0, 100);
- AtalaiStatue4->SummonGameObject(GO_ATALAI_LIGHT2, AtalaiStatue4->GetPositionX(), AtalaiStatue4->GetPositionY(), AtalaiStatue4->GetPositionZ(), 0, 0, 0, 0, 0, 100);
- AtalaiStatue5->SummonGameObject(GO_ATALAI_LIGHT2, AtalaiStatue5->GetPositionX(), AtalaiStatue5->GetPositionY(), AtalaiStatue5->GetPositionZ(), 0, 0, 0, 0, 0, 100);
- AtalaiStatue6->SummonGameObject(GO_ATALAI_LIGHT2, AtalaiStatue6->GetPositionX(), AtalaiStatue6->GetPositionY(), AtalaiStatue6->GetPositionZ(), 0, 0, 0, 0, 0, 100);
- go->SummonGameObject(148838, -488.997, 96.61, -189.019, -1.52, 0, 0, 0, 0, 100);
- }
- */
+ void UseLastStatue(GameObject* go)
+ {
+ for (uint8 i = 0; i < nStatues; ++i)
+ go->SummonGameObject(GO_ATALAI_LIGHT2, statuePositions[i], G3D::Quat(), 0);
+
+ go->SummonCreature(NPC_ATALALARION, atalalarianPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200);
+ }
void SetData(uint32 type, uint32 data) override
{
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
index d9b481d7b6d..fded249f9ca 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
@@ -249,7 +249,7 @@ public:
me->CastStop(SPELL_FOG_BREATH);
me->RemoveAurasDueToSpell(SPELL_FOG_BREATH);
me->StopMoving();
- me->SetSpeed(MOVE_RUN, 2.0f);
+ me->SetSpeedRate(MOVE_RUN, 2.0f);
events.ScheduleEvent(EVENT_CLEAVE, urand(5000, 10000));
events.ScheduleEvent(EVENT_CORROSION, urand(10000, 20000));
@@ -530,7 +530,7 @@ public:
npc_felmyst_vaporAI(Creature* creature) : ScriptedAI(creature)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetSpeed(MOVE_RUN, 0.8f);
+ me->SetSpeedRate(MOVE_RUN, 0.8f);
}
void Reset() override { }
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index d86b3707606..040d8cb2a37 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -143,11 +143,7 @@ enum Spells
SPELL_RING_OF_BLUE_FLAMES = 45825 //Cast this spell when the go is activated
};
-/*** Error messages ***/
-#define ERROR_KJ_NOT_SUMMONED "TSCR ERROR: Unable to summon Kil'Jaeden for some reason"
-
/*** Others ***/
-#define FLOOR_Z 28.050388f
#define SHIELD_ORB_Z 45.000f
enum Phase
@@ -1365,7 +1361,7 @@ public:
DoCastVictim(SPELL_SR_SHOOT, false);
uiTimer[2] = urand(4000, 6000);
}
- if (me->IsWithinMeleeRange(me->GetVictim(), 6))
+ if (me->IsWithinMeleeRange(me->GetVictim()))
{
if (uiTimer[0] <= diff)
{
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
index 04d23cd7d4e..6c84677708e 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
@@ -15,88 +15,119 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Boss_Muru
-SD%Complete: 80
-SDComment: all sounds, black hole effect triggers to often (46228)
-*/
-
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "sunwell_plateau.h"
-#include "Player.h"
-#include "SpellInfo.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
-// Muru & Entropius's spells
enum Spells
{
- SPELL_ENRAGE = 26662,
-
// Muru's spells
- SPELL_NEGATIVE_ENERGY = 46009, //(this trigger 46008)
- SPELL_DARKNESS = 45999,
- SPELL_OPEN_ALL_PORTALS = 46177,
- SPELL_OPEN_PORTAL = 45977,
- SPELL_OPEN_PORTAL_2 = 45976,
- SPELL_SUMMON_BERSERKER = 46037,
- SPELL_SUMNON_FURY_MAGE = 46038,
- SPELL_SUMMON_VOID_SENTINEL = 45988,
- SPELL_SUMMON_ENTROPIUS = 46217,
+ SPELL_OPEN_PORTAL_PERIODIC = 45994,
+ SPELL_DARKNESS_PERIODIC = 45998,
+ SPELL_NEGATIVE_ENERGY_PERIODIC = 46009,
+ SPELL_SUMMON_VOID_SPAWN = 46071,
+ SPELL_SUMMON_BLOOD_ELVES_SCRIPT = 46050,
+ SPELL_SUMMON_BLOOD_ELVES_PERIODIC = 46041,
+ SPELL_OPEN_ALL_PORTALS = 46177,
+ SPELL_SUMMON_ENTROPIUS = 46217,
+ SPELL_ENRAGE = 26662,
+ SPELL_SUMMON_DARK_FIEND_0 = 46000,
+ SPELL_SUMMON_DARK_FIEND_1 = 46001,
+ SPELL_SUMMON_DARK_FIEND_2 = 46002,
+ SPELL_SUMMON_DARK_FIEND_3 = 46003,
+ SPELL_SUMMON_DARK_FIEND_4 = 46004,
+ SPELL_SUMMON_DARK_FIEND_5 = 46005,
+ SPELL_SUMMON_DARK_FIEND_6 = 46006,
+ SPELL_SUMMON_DARK_FIEND_7 = 46007,
+ SPELL_SUMMON_BERSERKER = 46037,
+ SPELL_SUMMON_BERSERKER_2 = 46040,
+ SPELL_SUMMON_FURY_MAGE = 46038,
+ SPELL_SUMMON_FURY_MAGE_2 = 46039,
// Entropius's spells
- SPELL_DARKNESS_E = 46269,
- SPELL_BLACKHOLE = 46282,
- SPELL_NEGATIVE_ENERGY_E = 46284,
- SPELL_ENTROPIUS_SPAWN = 46223,
-
- // Shadowsword Berserker's spells
- SPELL_FLURRY = 46160,
- SPELL_DUAL_WIELD = 29651,
+ SPELL_ENTROPIUS_COSMETIC_SPAWN = 46223,
+ SPELL_DARKNESS_E = 46269,
+ SPELL_NEGATIVE_ENERGY_PERIODIC_E = 46284,
+ SPELL_BLACKHOLE = 46282,
+ SPELL_SUMMON_DARKFIEND_E = 46263,
+
+ // Myruu's Portal Target
+ SPELL_SUMMON_VOID_SENTINEL_SUMMONER = 45978,
+ SPELL_SUMMON_VOID_SENTINEL_SUMMONER_VISUAL = 45989,
+ SPELL_SUMMON_VOID_SENTINEL = 45988,
+ SPELL_TRANSFORM_VISUAL_MISSILE = 46205,
+ TRANSFORM_VISUAL_MISSILE_1 = 46208,
+ TRANSFORM_VISUAL_MISSILE_2 = 46178,
+ SPELL_OPEN_PORTAL = 45977,
+ SPELL_OPEN_PORTAL_2 = 45976,
- // Shadowsword Fury Mage's spells
- SPELL_FEL_FIREBALL = 46101,
- SPELL_SPELL_FURY = 46102,
+ //Dark Fiend Spells
+ SPELL_DARKFIEND_DAMAGE = 45944,
+ SPELL_DARKFIEND_VISUAL = 45936,
+ SPELL_DARKFIEND_SKIN = 45934,
// Void Sentinel's spells
- SPELL_SHADOW_PULSE = 46087,
- SPELL_VOID_BLAST = 46161,
+ SPELL_SHADOW_PULSE_PERIODIC = 46086,
+ SPELL_VOID_BLAST = 46161,
- // Void Spawn's spells
- SPELL_SHADOW_BOLT_VOLLEY = 46082,
+ //Black Hole Spells
+ SPELL_BLACKHOLE_SUMMON_VISUAL = 46242,
+ SPELL_BLACKHOLE_SUMMON_VISUAL_2 = 46247,
+ SPELL_BLACKHOLE_PASSIVE = 46228,
+ SPELL_BLACK_HOLE_VISUAL_2 = 46235
+};
- //Dark Fiend Spells
- SPELL_DARKFIEND_AOE = 45944,
- SPELL_DARKFIEND_VISUAL = 45936,
- SPELL_DARKFIEND_SKIN = 45934,
+enum Phases
+{
+ PHASE_ONE = 1,
+ PHASE_TWO = 2
+};
- //Black Hole Spells
- SPELL_BLACKHOLE_SPAWN = 46242,
- SPELL_BLACKHOLE_GROW = 46228
+enum Misc
+{
+ MAX_VOID_SPAWNS = 6,
+ MAX_SUMMON_BLOOD_ELVES = 4,
+ MAX_SUMMON_DARK_FIEND = 8
};
-enum Events
+uint32 const SummonDarkFiendSpells[MAX_SUMMON_DARK_FIEND] =
{
- // M'uru
- EVENT_DARKNESS = 1,
- EVENT_SUMMON_HUMANOIDS,
- EVENT_SUMMON_SENTINEL,
- EVENT_PHASE_TRANSITION, // Delayed phase transition.
- EVENT_ENRAGE,
-
- // Entropius
- EVENT_SUMMON_BLACK_HOLE
+ SPELL_SUMMON_DARK_FIEND_0,
+ SPELL_SUMMON_DARK_FIEND_1,
+ SPELL_SUMMON_DARK_FIEND_2,
+ SPELL_SUMMON_DARK_FIEND_3,
+ SPELL_SUMMON_DARK_FIEND_4,
+ SPELL_SUMMON_DARK_FIEND_5,
+ SPELL_SUMMON_DARK_FIEND_6,
+ SPELL_SUMMON_DARK_FIEND_7
};
-enum Phases
+uint32 const SummonBloodElvesSpells[MAX_SUMMON_BLOOD_ELVES] =
{
- PHASE_ONE = 1,
- PHASE_TWO,
+ SPELL_SUMMON_BERSERKER,
+ SPELL_SUMMON_BERSERKER_2,
+ SPELL_SUMMON_FURY_MAGE,
+ SPELL_SUMMON_FURY_MAGE_2
};
-enum CreatureGroups
+class VoidSpawnSummon : public BasicEvent
{
- CREATURE_GROUP_HUMANOIDS,
- CREATURE_GROUP_DARKFIENDS
+ public:
+ explicit VoidSpawnSummon(Creature* owner)
+ : _owner(owner)
+ {
+ }
+
+ bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ {
+ _owner->CastSpell((Unit*)nullptr, SPELL_SUMMON_VOID_SENTINEL, true);
+ return true;
+ }
+
+ private:
+ Creature* _owner;
};
class boss_entropius : public CreatureScript
@@ -110,53 +141,78 @@ public:
void Reset() override
{
- DoCastAOE(SPELL_NEGATIVE_ENERGY_E);
+ _Reset();
+ DoCast(me, SPELL_ENTROPIUS_COSMETIC_SPAWN, true);
}
- void EnterCombat(Unit* /*who*/) override
+ void ScheduleTasks() override
{
- _EnterCombat();
- DoCastAOE(SPELL_NEGATIVE_ENERGY_E, true);
- DoCast(me, SPELL_ENTROPIUS_SPAWN);
- events.ScheduleEvent(EVENT_SUMMON_BLACK_HOLE, 15000);
+ scheduler.Schedule(Milliseconds(2000), [this](TaskContext /*context*/)
+ {
+ DoResetPortals();
+ DoCastAOE(SPELL_NEGATIVE_ENERGY_PERIODIC_E, true);
+ });
+
+ scheduler.Schedule(Seconds(15), [this](TaskContext context)
+ {
+ DoCastAOE(SPELL_DARKNESS_E, true);
+ DoCastAOE(SPELL_BLACKHOLE, true);
+
+ context.Repeat();
+ });
}
- void JustSummoned(Creature* summoned) override
+ void JustSummoned(Creature* summon) override
{
- switch (summoned->GetEntry())
+ switch (summon->GetEntry())
{
case NPC_DARK_FIENDS:
- summoned->CastSpell(summoned, SPELL_DARKFIEND_VISUAL);
+ summon->CastSpell(summon, SPELL_DARKFIEND_VISUAL);
break;
case NPC_DARKNESS:
- summoned->AddUnitState(UNIT_STATE_STUNNED);
- float x, y, z, o;
- summoned->GetHomePosition(x, y, z, o);
- me->SummonCreature(NPC_DARK_FIENDS, x, y, z, o, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ summon->SetReactState(REACT_PASSIVE);
+ summon->CastSpell(summon, SPELL_BLACKHOLE);
+ summon->CastSpell(summon, SPELL_SUMMON_DARKFIEND_E, true);
break;
}
- summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true));
- summons.Summon(summoned);
+ summons.Summon(summon);
}
- void ExecuteEvent(uint32 eventId) override
+ void EnterEvadeMode(EvadeReason /*why*/) override
{
- if (eventId == EVENT_SUMMON_BLACK_HOLE)
- {
- if (Unit* random = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- DoCast(random, SPELL_DARKNESS_E);
- if (Unit* random = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- random->CastSpell(random, SPELL_BLACKHOLE);
- events.ScheduleEvent(EVENT_SUMMON_BLACK_HOLE, 15000);
- }
+ if (Creature* muru = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MURU)))
+ muru->AI()->EnterEvadeMode();
+
+ DoResetPortals();
+ summons.DespawnAll();
+ me->DespawnOrUnsummon();
}
- void EnterEvadeMode(EvadeReason /*why*/) override
+ void JustDied(Unit* /*killer*/) override
{
+ _JustDied();
+
if (Creature* muru = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MURU)))
- muru->AI()->Reset(); // Reset encounter.
- me->DisappearAndDie();
- summons.DespawnAll();
+ muru->DisappearAndDie();
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim())
+ return;
+
+ scheduler.Update(diff, [this]
+ {
+ DoMeleeAttackIfReady();
+ });
+ }
+
+ void DoResetPortals()
+ {
+ std::list<Creature*> portals;
+ me->GetCreatureListWithEntryInGrid(portals, NPC_MURU_PORTAL_TARGET, 100.0f);
+ for (Creature* portal : portals)
+ portal->RemoveAllAuras();
}
};
@@ -181,101 +237,96 @@ public:
void Initialize()
{
- DarkFiend = false;
- HasEnraged = false;
- EntropiusGUID.Clear();
+ _hasEnraged = false;
+ _phase = PHASE_ONE;
+ _entropiusGUID.Clear();
}
void Reset() override
{
- Initialize();
_Reset();
+ Initialize();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisible(true);
}
+ void EnterEvadeMode(EvadeReason /*why*/) override
+ {
+ BossAI::EnterEvadeMode();
+ if (Creature* entropius = ObjectAccessor::GetCreature(*me, _entropiusGUID))
+ entropius->AI()->EnterEvadeMode();
+ }
+
+ void ScheduleTasks() override
+ {
+ scheduler.Schedule(Minutes(10), [this](TaskContext /*context*/)
+ {
+ if (Creature* entropius = ObjectAccessor::GetCreature(*me, _entropiusGUID))
+ entropius->CastSpell(entropius, SPELL_ENRAGE);
+ DoCast(me, SPELL_ENRAGE);
+ _hasEnraged = true;
+ });
+
+ scheduler.Schedule(Seconds(10), [this](TaskContext /*context*/)
+ {
+ DoCast(me, SPELL_SUMMON_BLOOD_ELVES_SCRIPT, true);
+ DoCast(me, SPELL_SUMMON_BLOOD_ELVES_PERIODIC, true);
+ });
+ }
+
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
- events.SetPhase(PHASE_ONE);
- events.ScheduleEvent(EVENT_ENRAGE, 600000);
- events.ScheduleEvent(EVENT_DARKNESS, 45000, 0, PHASE_ONE);
- events.ScheduleEvent(EVENT_SUMMON_HUMANOIDS, 10000, 0, PHASE_ONE);
- events.ScheduleEvent(EVENT_SUMMON_SENTINEL, 31500, 0, PHASE_ONE);
- DoCastAOE(SPELL_NEGATIVE_ENERGY);
+ DoCast(me, SPELL_OPEN_PORTAL_PERIODIC, true);
+ DoCast(me, SPELL_DARKNESS_PERIODIC, true);
+ DoCast(me, SPELL_NEGATIVE_ENERGY_PERIODIC, true);
}
void DamageTaken(Unit* /*done_by*/, uint32 &damage) override
{
- if (damage >= me->GetHealth() && events.IsInPhase(PHASE_ONE))
+ if (damage >= me->GetHealth())
{
- damage = 0;
+ damage = me->GetHealth() - 1;
+ if (_phase != PHASE_ONE)
+ return;
+
+ _phase = PHASE_TWO;
me->RemoveAllAuras();
- DoCast(me, SPELL_OPEN_ALL_PORTALS);
+ DoCast(me, SPELL_OPEN_ALL_PORTALS, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- events.SetPhase(PHASE_TWO);
- events.ScheduleEvent(EVENT_PHASE_TRANSITION, 2000);
+
+ scheduler.Schedule(Seconds(6), [this](TaskContext /*context*/)
+ {
+ DoCast(me, SPELL_SUMMON_ENTROPIUS, true);
+ });
}
}
- void JustSummoned(Creature* summoned) override
+ void JustSummoned(Creature* summon) override
{
- switch (summoned->GetEntry())
+ if (summon->GetEntry() == NPC_ENTROPIUS)
{
- case NPC_ENTROPIUS:
- me->SetVisible(false);
- EntropiusGUID = summoned->GetGUID();
- if (HasEnraged) // If we hit phase transition while enraged, enrage Entropius as well.
- summoned->CastSpell(summoned, SPELL_ENRAGE);
- break;
- case NPC_DARK_FIENDS:
- summoned->CastSpell(summoned, SPELL_DARKFIEND_VISUAL);
- break;
+ me->SetVisible(false);
+ _entropiusGUID = summon->GetGUID();
+ if (_hasEnraged)
+ summon->CastSpell(summon, SPELL_ENRAGE, true);
+ return;
}
- summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true));
- summons.Summon(summoned);
+ BossAI::JustSummoned(summon);
}
- void ExecuteEvent(uint32 eventId) override
+ void UpdateAI(uint32 diff) override
{
- switch (eventId)
- {
- case EVENT_DARKNESS:
- if (!DarkFiend)
- {
- DarkFiend = true;
- DoCastAOE(SPELL_DARKNESS);
- }
- else
- me->SummonCreatureGroup(CREATURE_GROUP_DARKFIENDS);
- events.ScheduleEvent(EVENT_DARKNESS, DarkFiend ? 3000 : 42000, 0, PHASE_ONE);
- break;
- case EVENT_SUMMON_HUMANOIDS:
- me->SummonCreatureGroup(CREATURE_GROUP_HUMANOIDS);
- events.ScheduleEvent(EVENT_SUMMON_HUMANOIDS, 60000, 0, PHASE_ONE);
- break;
- case EVENT_SUMMON_SENTINEL:
- DoCastAOE(SPELL_OPEN_PORTAL_2);
- events.ScheduleEvent(EVENT_SUMMON_SENTINEL, 30000, 0, PHASE_ONE);
- break;
- case EVENT_PHASE_TRANSITION:
- DoCast(me, SPELL_SUMMON_ENTROPIUS);
- break;
- case EVENT_ENRAGE:
- if (Creature* entropius = ObjectAccessor::GetCreature(*me, EntropiusGUID))
- entropius->CastSpell(entropius, SPELL_ENRAGE);
- DoCast(me, SPELL_ENRAGE);
- HasEnraged = true;
- break;
- default:
- break;
- }
+ if (!UpdateVictim())
+ return;
+
+ scheduler.Update(diff);
}
private:
- bool DarkFiend;
- bool HasEnraged;
- ObjectGuid EntropiusGUID;
+ ObjectGuid _entropiusGUID;
+ bool _hasEnraged;
+ uint8 _phase;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -289,89 +340,50 @@ class npc_muru_portal : public CreatureScript
public:
npc_muru_portal() : CreatureScript("npc_muru_portal") { }
- CreatureAI* GetAI(Creature* creature) const override
- {
- return GetInstanceAI<npc_muru_portalAI>(creature);
- }
-
struct npc_muru_portalAI : public ScriptedAI
{
- npc_muru_portalAI(Creature* creature) : ScriptedAI(creature), Summons(creature)
- {
- Initialize();
- SetCombatMovement(false);
- instance = creature->GetInstanceScript();
- }
-
- void Initialize()
- {
- SummonTimer = 5000;
-
- InAction = false;
- SummonSentinel = false;
- }
-
- InstanceScript* instance;
-
- SummonList Summons;
-
- bool SummonSentinel;
- bool InAction;
-
- uint32 SummonTimer;
-
- void Reset() override
- {
- Initialize();
+ npc_muru_portalAI(Creature* creature) : ScriptedAI(creature) { }
- me->AddUnitState(UNIT_STATE_STUNNED);
-
- Summons.DespawnAll();
- }
-
- void JustSummoned(Creature* summoned) override
+ void JustSummoned(Creature* summon) override
{
- if (Player* target = ObjectAccessor::GetPlayer(*me, instance->GetGuidData(DATA_PLAYER_GUID)))
- summoned->AI()->AttackStart(target);
+ DoCast(summon, SPELL_SUMMON_VOID_SENTINEL_SUMMONER_VISUAL, true);
- Summons.Summon(summoned);
+ summon->m_Events.AddEvent(new VoidSpawnSummon(summon), summon->m_Events.CalculateTime(1500));
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) override
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
- float x, y, z, o;
- me->GetHomePosition(x, y, z, o);
- me->NearTeleportTo(x, y, z, o);
- InAction = true;
- switch (Spell->Id)
+ switch (spell->Id)
{
case SPELL_OPEN_ALL_PORTALS:
- DoCastAOE(SPELL_OPEN_PORTAL);
+ DoCastAOE(SPELL_OPEN_PORTAL, true);
+ DoCastAOE(SPELL_TRANSFORM_VISUAL_MISSILE, true);
break;
case SPELL_OPEN_PORTAL_2:
- DoCastAOE(SPELL_OPEN_PORTAL);
- SummonSentinel = true;
+ DoCastAOE(SPELL_OPEN_PORTAL, true);
+ _scheduler.Schedule(Seconds(6), [this](TaskContext /*context*/)
+ {
+ DoCastAOE(SPELL_SUMMON_VOID_SENTINEL_SUMMONER, true);
+ });
+ break;
+ default:
break;
}
}
void UpdateAI(uint32 diff) override
{
- if (!SummonSentinel)
- {
- if (InAction && instance->GetBossState(DATA_MURU) == NOT_STARTED)
- Reset();
- return;
- }
-
- if (SummonTimer <= diff)
- {
- DoCastAOE(SPELL_SUMMON_VOID_SENTINEL, false);
- SummonTimer = 5000;
- SummonSentinel = false;
- } else SummonTimer -= diff;
+ _scheduler.Update(diff);
}
+
+ private:
+ TaskScheduler _scheduler;
};
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetSunwellPlateauAI<npc_muru_portalAI>(creature);
+ }
};
class npc_dark_fiend : public CreatureScript
@@ -379,11 +391,6 @@ class npc_dark_fiend : public CreatureScript
public:
npc_dark_fiend() : CreatureScript("npc_dark_fiend") { }
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_dark_fiendAI(creature);
- }
-
struct npc_dark_fiendAI : public ScriptedAI
{
npc_dark_fiendAI(Creature* creature) : ScriptedAI(creature)
@@ -393,54 +400,56 @@ public:
void Initialize()
{
- WaitTimer = 2000;
- InAction = false;
- }
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
+ me->SetReactState(REACT_PASSIVE);
+ DoCast(me, SPELL_DARKFIEND_SKIN, true);
- uint32 WaitTimer;
- bool InAction;
+ _scheduler.Schedule(Seconds(2), [this](TaskContext /*context*/)
+ {
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- void Reset() override
- {
- Initialize();
+ if (Creature* _summoner = ObjectAccessor::GetCreature(*me, _summonerGUID))
+ if (Unit* target = _summoner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0))
+ AttackStart(target);
+ });
- me->AddUnitState(UNIT_STATE_STUNNED);
+ _scheduler.Schedule(Seconds(3), [this](TaskContext context)
+ {
+ if (me->IsWithinDist(me->GetVictim(), 5.0f) && me->HasAura(SPELL_DARKFIEND_SKIN))
+ {
+ DoCastAOE(SPELL_DARKFIEND_DAMAGE, false);
+ me->DisappearAndDie();
+ }
+
+ context.Repeat(Milliseconds(500));
+ });
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) override
+ void IsSummonedBy(Unit* summoner) override
{
- for (uint8 i = 0; i < 3; ++i)
- if (Spell->Effects[i].Effect == 38)
- me->DisappearAndDie();
+ _summonerGUID = summoner->GetGUID();
}
- void UpdateAI(uint32 diff) override
+ bool CanAIAttack(Unit const* /*target*/) const override
{
- if (!UpdateVictim())
- return;
+ return me->HasAura(SPELL_DARKFIEND_SKIN);
+ }
- if (WaitTimer <= diff)
- {
- if (!InAction)
- {
- me->ClearUnitState(UNIT_STATE_STUNNED);
- DoCastAOE(SPELL_DARKFIEND_SKIN, false);
- AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true));
- InAction = true;
- WaitTimer = 500;
- }
- else
- {
- if (me->IsWithinDist(me->GetVictim(), 5))
- {
- DoCastAOE(SPELL_DARKFIEND_AOE, false);
- me->DisappearAndDie();
- }
- WaitTimer = 500;
- }
- } else WaitTimer -= diff;
+ void UpdateAI(uint32 diff) override
+ {
+ _scheduler.Update(diff);
}
+
+ private:
+ TaskScheduler _scheduler;
+ ObjectGuid _summonerGUID;
};
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetSunwellPlateauAI<npc_dark_fiendAI>(creature);
+ }
};
class npc_void_sentinel : public CreatureScript
@@ -448,63 +457,54 @@ class npc_void_sentinel : public CreatureScript
public:
npc_void_sentinel() : CreatureScript("npc_void_sentinel") { }
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_void_sentinelAI(creature);
- }
-
struct npc_void_sentinelAI : public ScriptedAI
{
npc_void_sentinelAI(Creature* creature) : ScriptedAI(creature)
{
- Initialize();
+ _instance = me->GetInstanceScript();
}
- void Initialize()
+ void IsSummonedBy(Unit* /*summoner*/) override
{
- PulseTimer = 3000;
- VoidBlastTimer = 45000; //is this a correct timer?
+ if (Creature* muru = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_MURU)))
+ muru->AI()->JustSummoned(me);
}
- uint32 PulseTimer;
- uint32 VoidBlastTimer;
-
- void Reset() override
+ void EnterCombat(Unit* /*who*/) override
{
- Initialize();
+ DoCast(me, SPELL_SHADOW_PULSE_PERIODIC, true);
- float x, y, z, o;
- me->GetHomePosition(x, y, z, o);
- me->NearTeleportTo(x, y, 71, o);
+ _scheduler.Schedule(Seconds(45), [this](TaskContext context)
+ {
+ DoCastVictim(SPELL_VOID_BLAST, false);
+
+ context.Repeat();
+ });
}
- void JustDied(Unit* killer) override
+ void JustDied(Unit* /*killer*/) override
{
- for (uint8 i = 0; i < 8; ++i)
- if (Creature* temp = me->SummonCreature(NPC_VOID_SPAWN, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand32() % 6), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000))
- temp->AI()->AttackStart(killer);
+ for (uint8 i = 0; i < MAX_VOID_SPAWNS; ++i)
+ DoCastAOE(SPELL_SUMMON_VOID_SPAWN, true);
}
void UpdateAI(uint32 diff) override
{
- if (!UpdateVictim())
- return;
-
- if (PulseTimer <= diff)
- {
- DoCastAOE(SPELL_SHADOW_PULSE, true);
- PulseTimer = 3000;
- } else PulseTimer -= diff;
-
- if (VoidBlastTimer <= diff)
+ _scheduler.Update(diff, [this]
{
- DoCastVictim(SPELL_VOID_BLAST, false);
- VoidBlastTimer = 45000;
- } else VoidBlastTimer -= diff;
-
- DoMeleeAttackIfReady();
+ DoMeleeAttackIfReady();
+ });
}
+
+ private:
+ TaskScheduler _scheduler;
+ InstanceScript* _instance;
};
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetSunwellPlateauAI<npc_void_sentinelAI>(creature);
+ }
};
class npc_blackhole : public CreatureScript
@@ -512,84 +512,220 @@ class npc_blackhole : public CreatureScript
public:
npc_blackhole() : CreatureScript("npc_blackhole") { }
- CreatureAI* GetAI(Creature* creature) const override
- {
- return GetInstanceAI<npc_blackholeAI>(creature);
- }
-
struct npc_blackholeAI : public ScriptedAI
{
npc_blackholeAI(Creature* creature) : ScriptedAI(creature)
{
- Initialize();
- instance = creature->GetInstanceScript();
+ _instance = creature->GetInstanceScript();
}
- void Initialize()
- {
- DespawnTimer = 15000;
- SpellTimer = 5000;
- Phase = 0;
- NeedForAHack = 0;
- }
-
- InstanceScript* instance;
-
- uint32 DespawnTimer;
- uint32 SpellTimer;
- uint8 Phase;
- uint8 NeedForAHack;
-
void Reset() override
{
- Initialize();
+ me->SetReactState(REACT_PASSIVE);
+ DoCast(SPELL_BLACKHOLE_SUMMON_VISUAL);
- me->AddUnitState(UNIT_STATE_STUNNED);
- DoCastAOE(SPELL_BLACKHOLE_SPAWN, true);
- }
+ _scheduler.Schedule(Seconds(15), [this](TaskContext /*context*/)
+ {
+ me->DisappearAndDie();
+ });
- void UpdateAI(uint32 diff) override
- {
- if (SpellTimer <= diff)
+ _scheduler.Schedule(Seconds(1), [this](TaskContext context)
{
- Unit* Victim = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_PLAYER_GUID));
- switch (NeedForAHack)
+ switch (context.GetRepeatCounter())
{
case 0:
- me->ClearUnitState(UNIT_STATE_STUNNED);
- DoCastAOE(SPELL_BLACKHOLE_GROW, false);
- if (Victim)
- AttackStart(Victim);
- SpellTimer = 700;
- NeedForAHack = 2;
+ me->SetReactState(REACT_AGGRESSIVE);
+ DoCast(SPELL_BLACKHOLE_SUMMON_VISUAL_2);
+ if (Unit* victim = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(DATA_PLAYER_GUID)))
+ AttackStart(victim);
+ context.Repeat(Milliseconds(1200));
break;
case 1:
- me->AddAura(SPELL_BLACKHOLE_GROW, me);
- NeedForAHack = 2;
- SpellTimer = 600;
+ DoCast(SPELL_BLACKHOLE_SUMMON_VISUAL);
+ context.Repeat(Seconds(2));
break;
case 2:
- SpellTimer = 400;
- NeedForAHack = 3;
- me->RemoveAura(SPELL_BLACKHOLE_GROW);
+ DoCast(SPELL_BLACKHOLE_PASSIVE);
+ DoCast(SPELL_BLACK_HOLE_VISUAL_2);
+ break;
+ default:
break;
- case 3:
- SpellTimer = urand(400, 900);
- NeedForAHack = 1;
- if (Unit* Temp = me->GetVictim())
- {
- if (Temp->GetPositionZ() > 73 && Victim)
- AttackStart(Victim);
- } else
- return;
}
- } else SpellTimer -= diff;
+ });
+ }
- if (DespawnTimer <= diff)
- me->DisappearAndDie();
- else DespawnTimer -= diff;
+ void UpdateAI(uint32 diff) override
+ {
+ _scheduler.Update(diff);
}
+
+ private:
+ TaskScheduler _scheduler;
+ InstanceScript* _instance;
};
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetSunwellPlateauAI<npc_blackholeAI>(creature);
+ }
+};
+
+class spell_summon_blood_elves_script : SpellScriptLoader
+{
+ public:
+ spell_summon_blood_elves_script() : SpellScriptLoader("spell_summon_blood_elves_script") { }
+
+ class spell_summon_blood_elves_script_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_summon_blood_elves_script_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ for (uint8 i = 0; i < MAX_SUMMON_BLOOD_ELVES; ++i)
+ if (!sSpellMgr->GetSpellInfo(SummonBloodElvesSpells[i]))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ for (uint8 i = 0; i < MAX_SUMMON_BLOOD_ELVES; ++i)
+ GetCaster()->CastSpell((Unit*)nullptr, SummonBloodElvesSpells[urand(0,3)], true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_summon_blood_elves_script_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_summon_blood_elves_script_SpellScript();
+ }
+};
+
+class spell_muru_darkness : SpellScriptLoader
+{
+ public:
+ spell_muru_darkness() : SpellScriptLoader("spell_muru_darkness") { }
+
+ class spell_muru_darkness_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_muru_darkness_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ for (uint8 i = 0; i < MAX_SUMMON_DARK_FIEND; ++i)
+ if (!sSpellMgr->GetSpellInfo(SummonDarkFiendSpells[i]))
+ return false;
+ return true;
+ }
+
+ void HandleAfterCast()
+ {
+ for (uint8 i = 0; i < MAX_SUMMON_DARK_FIEND; ++i)
+ GetCaster()->CastSpell((Unit*)nullptr, SummonDarkFiendSpells[i], true);
+ }
+
+ void Register() override
+ {
+ AfterCast += SpellCastFn(spell_muru_darkness_SpellScript::HandleAfterCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_muru_darkness_SpellScript();
+ }
+};
+
+class spell_dark_fiend_skin : public SpellScriptLoader
+{
+ public:
+ spell_dark_fiend_skin() : SpellScriptLoader("spell_dark_fiend_skin") { }
+
+ class spell_dark_fiend_skin_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dark_fiend_skin_AuraScript);
+
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
+ return;
+
+ if (Creature* target = GetTarget()->ToCreature())
+ {
+ target->SetReactState(REACT_PASSIVE);
+ target->AttackStop();
+ target->StopMoving();
+ target->CastSpell(target, SPELL_DARKFIEND_VISUAL, true);
+ target->DespawnOrUnsummon(3000);
+ }
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dark_fiend_skin_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_dark_fiend_skin_AuraScript();
+ }
+};
+
+class spell_transform_visual_missile_periodic : public SpellScriptLoader
+{
+ public:
+ spell_transform_visual_missile_periodic() : SpellScriptLoader("spell_transform_visual_missile_periodic") { }
+
+ class spell_transform_visual_missile_periodic_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_transform_visual_missile_periodic_AuraScript);
+
+ void OnPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ GetTarget()->CastSpell((Unit*)nullptr, RAND(TRANSFORM_VISUAL_MISSILE_1, TRANSFORM_VISUAL_MISSILE_2), true);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_transform_visual_missile_periodic_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_transform_visual_missile_periodic_AuraScript();
+ }
+};
+
+class spell_summon_blood_elves_periodic : public SpellScriptLoader
+{
+ public:
+ spell_summon_blood_elves_periodic() : SpellScriptLoader("spell_summon_blood_elves_periodic") { }
+
+ class spell_summon_blood_elves_periodic_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_summon_blood_elves_periodic_AuraScript);
+
+ void OnPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ GetTarget()->CastSpell((Unit*)nullptr, SPELL_SUMMON_BLOOD_ELVES_SCRIPT, true);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_summon_blood_elves_periodic_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_summon_blood_elves_periodic_AuraScript();
+ }
};
void AddSC_boss_muru()
@@ -600,4 +736,9 @@ void AddSC_boss_muru()
new npc_dark_fiend();
new npc_void_sentinel();
new npc_blackhole();
+ new spell_summon_blood_elves_script();
+ new spell_muru_darkness();
+ new spell_dark_fiend_skin();
+ new spell_transform_visual_missile_periodic();
+ new spell_summon_blood_elves_periodic();
}
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
index c6b4ae753a5..7ea0fc4bc7d 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h
@@ -97,7 +97,8 @@ enum CreatureIds
NPC_FURY_MAGE = 25799,
NPC_VOID_SENTINEL = 25772,
NPC_VOID_SPAWN = 25824,
- NPC_BLACK_HOLE = 25855
+ NPC_BLACK_HOLE = 25855,
+ NPC_MURU_PORTAL_TARGET = 25770
};
enum GameObjectIds
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
index a5fed30a6c6..68391c65655 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp
@@ -98,7 +98,7 @@ class boss_archaedas : public CreatureScript
instance->SetData(0, 5); // respawn any dead minions
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
me->AddAura(SPELL_FREEZE_ANIM, me);
}
@@ -111,7 +111,7 @@ class boss_archaedas : public CreatureScript
DoCast(minion, SPELL_AWAKEN_VAULT_WALKER, flag);
minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN, true);
minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
minion->setFaction(14);
minion->RemoveAura(SPELL_MINION_FREEZE_ANIM);
}
@@ -121,7 +121,7 @@ class boss_archaedas : public CreatureScript
{
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
@@ -261,7 +261,7 @@ class npc_archaedas_minions : public CreatureScript
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
me->RemoveAllAuras();
me->AddAura(SPELL_MINION_FREEZE_ANIM, me);
}
@@ -271,7 +271,7 @@ class npc_archaedas_minions : public CreatureScript
me->setFaction (14);
me->RemoveAllAuras();
me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
bAmIAwake = true;
}
@@ -350,7 +350,7 @@ class npc_stonekeepers : public CreatureScript
{
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
me->RemoveAllAuras();
me->AddAura(SPELL_MINION_FREEZE_ANIM, me);
}
@@ -359,7 +359,7 @@ class npc_stonekeepers : public CreatureScript
{
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
}
void UpdateAI(uint32 /*diff*/) override
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
index 8c78fb7ff1b..28a3a4eb4e0 100644
--- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
+++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp
@@ -147,7 +147,7 @@ class instance_uldaman : public InstanceMapScript
creature->setFaction(35);
creature->RemoveAllAuras();
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
creature->AddAura(SPELL_MINION_FREEZE_ANIM, creature);
}
@@ -178,7 +178,7 @@ class instance_uldaman : public InstanceMapScript
Creature* target = instance->GetCreature(*i);
if (!target || !target->IsAlive())
continue;
- target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
target->setFaction(14);
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
target->RemoveAura(SPELL_MINION_FREEZE_ANIM);
@@ -202,7 +202,7 @@ class instance_uldaman : public InstanceMapScript
Creature* target = instance->GetCreature(*i);
if (!target || !target->IsAlive() || target->getFaction() == 14)
continue;
- target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
target->setFaction(14);
target->RemoveAura(SPELL_MINION_FREEZE_ANIM);
@@ -268,7 +268,7 @@ class instance_uldaman : public InstanceMapScript
return;
ironaya->setFaction(415);
- ironaya->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ ironaya->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
ironaya->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
ironaya->GetMotionMaster()->Clear();
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
index 791f68bae31..72e76ba52bf 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
@@ -425,7 +425,7 @@ class npc_akilzon_eagle : public CreatureScript
if (Unit* target = ObjectAccessor::GetUnit(*me, TargetGUID))
DoCast(target, SPELL_EAGLE_SWOOP, true);
TargetGUID.Clear();
- me->SetSpeed(MOVE_RUN, 1.2f);
+ me->SetSpeedRate(MOVE_RUN, 1.2f);
EagleSwoop_Timer = urand(5000, 10000);
}
}
@@ -454,7 +454,7 @@ class npc_akilzon_eagle : public CreatureScript
{
target->GetContactPoint(me, x, y, z);
z += 2;
- me->SetSpeed(MOVE_RUN, 5.0f);
+ me->SetSpeedRate(MOVE_RUN, 5.0f);
TargetGUID = target->GetGUID();
}
me->GetMotionMaster()->MovePoint(0, x, y, z);
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
index cc55f758a22..5ec57fc44b6 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
@@ -29,109 +29,104 @@ EndScriptData */
#include "SpellAuraEffects.h"
#include "zulaman.h"
-#define YELL_AGGRO "Da shadow gonna fall on you... "
-#define SOUND_YELL_AGGRO 12041
-#define YELL_SPIRIT_BOLTS "Your soul gonna bleed!"
-#define SOUND_YELL_SPIRIT_BOLTS 12047
-#define YELL_DRAIN_POWER "Darkness comin\' for you"
-#define SOUND_YELL_DRAIN_POWER 12046
-#define YELL_KILL_ONE "Dis a nightmare ya don\' wake up from!"
-#define SOUND_YELL_KILL_ONE 12043
-#define YELL_KILL_TWO "Azzaga choogo zinn!"
-#define SOUND_YELL_KILL_TWO 12044
-#define YELL_DEATH "Dis not... da end of me..."
-#define SOUND_YELL_DEATH 12051
-
+enum Yells
+{
+ YELL_AGGRO = 0,
+ YELL_KILL_ONE = 1,
+ YELL_KILL_TWO = 2,
+ YELL_DRAIN_POWER = 3,
+ YELL_SPIRIT_BOLTS = 4,
+ YELL_DEATH = 5
+};
enum Creatures
{
- NPC_TEMP_TRIGGER = 23920
+ NPC_TEMP_TRIGGER = 23920
};
enum Spells
{
- SPELL_SPIRIT_BOLTS = 43383,
- SPELL_DRAIN_POWER = 44131,
- SPELL_SIPHON_SOUL = 43501,
+ SPELL_SPIRIT_BOLTS = 43383,
+ SPELL_DRAIN_POWER = 44131,
+ SPELL_SIPHON_SOUL = 43501,
// Druid
- SPELL_DR_THORNS = 43420,
- SPELL_DR_LIFEBLOOM = 43421,
- SPELL_DR_MOONFIRE = 43545,
+ SPELL_DR_THORNS = 43420,
+ SPELL_DR_LIFEBLOOM = 43421,
+ SPELL_DR_MOONFIRE = 43545,
// Hunter
- SPELL_HU_EXPLOSIVE_TRAP = 43444,
- SPELL_HU_FREEZING_TRAP = 43447,
- SPELL_HU_SNAKE_TRAP = 43449,
+ SPELL_HU_EXPLOSIVE_TRAP = 43444,
+ SPELL_HU_FREEZING_TRAP = 43447,
+ SPELL_HU_SNAKE_TRAP = 43449,
// Mage
- SPELL_MG_FIREBALL = 41383,
- SPELL_MG_FROST_NOVA = 43426,
- SPELL_MG_ICE_LANCE = 43427,
- SPELL_MG_FROSTBOLT = 43428,
+ SPELL_MG_FIREBALL = 41383,
+ SPELL_MG_FROST_NOVA = 43426,
+ SPELL_MG_ICE_LANCE = 43427,
+ SPELL_MG_FROSTBOLT = 43428,
// Paladin
- SPELL_PA_CONSECRATION = 43429,
- SPELL_PA_AVENGING_WRATH = 43430,
- SPELL_PA_HOLY_LIGHT = 43451,
+ SPELL_PA_CONSECRATION = 43429,
+ SPELL_PA_AVENGING_WRATH = 43430,
+ SPELL_PA_HOLY_LIGHT = 43451,
// Priest
- SPELL_PR_HEAL = 41372,
- SPELL_PR_MIND_BLAST = 41374,
- SPELL_PR_SW_DEATH = 41375,
- SPELL_PR_PSYCHIC_SCREAM = 43432,
- SPELL_PR_MIND_CONTROL = 43550,
- SPELL_PR_PAIN_SUPP = 44416,
+ SPELL_PR_HEAL = 41372,
+ SPELL_PR_MIND_BLAST = 41374,
+ SPELL_PR_SW_DEATH = 41375,
+ SPELL_PR_PSYCHIC_SCREAM = 43432,
+ SPELL_PR_MIND_CONTROL = 43550,
+ SPELL_PR_PAIN_SUPP = 44416,
// Rogue
- SPELL_RO_BLIND = 43433,
- SPELL_RO_SLICE_DICE = 43457,
- SPELL_RO_WOUND_POISON = 43461,
+ SPELL_RO_BLIND = 43433,
+ SPELL_RO_SLICE_DICE = 43457,
+ SPELL_RO_WOUND_POISON = 43461,
// Shaman
- SPELL_SH_CHAIN_LIGHT = 43435,
- SPELL_SH_FIRE_NOVA = 43436,
- SPELL_SH_HEALING_WAVE = 43548,
+ SPELL_SH_CHAIN_LIGHT = 43435,
+ SPELL_SH_FIRE_NOVA = 43436,
+ SPELL_SH_HEALING_WAVE = 43548,
// Warlock
- SPELL_WL_CURSE_OF_DOOM = 43439,
- SPELL_WL_RAIN_OF_FIRE = 43440,
- SPELL_WL_UNSTABLE_AFFL = 43522,
- SPELL_WL_UNSTABLE_AFFL_DISPEL = 43523,
+ SPELL_WL_CURSE_OF_DOOM = 43439,
+ SPELL_WL_RAIN_OF_FIRE = 43440,
+ SPELL_WL_UNSTABLE_AFFL = 43522,
+ SPELL_WL_UNSTABLE_AFFL_DISPEL = 43523,
// Warrior
- SPELL_WR_MORTAL_STRIKE = 43441,
- SPELL_WR_WHIRLWIND = 43442,
- SPELL_WR_SPELL_REFLECT = 43443,
+ SPELL_WR_MORTAL_STRIKE = 43441,
+ SPELL_WR_WHIRLWIND = 43442,
+ SPELL_WR_SPELL_REFLECT = 43443,
// Thurg
- SPELL_BLOODLUST = 43578,
- SPELL_CLEAVE = 15496,
+ SPELL_BLOODLUST = 43578,
+ SPELL_CLEAVE = 15496,
// Gazakroth
- SPELL_FIREBOLT = 43584,
+ SPELL_FIREBOLT = 43584,
// Alyson Antille
- SPELL_FLASH_HEAL = 43575,
- SPELL_DISPEL_MAGIC = 43577,
+ SPELL_FLASH_HEAL = 43575,
+ SPELL_DISPEL_MAGIC = 43577,
// Lord Raadan
- SPELL_FLAME_BREATH = 43582,
- SPELL_THUNDERCLAP = 43583,
+ SPELL_FLAME_BREATH = 43582,
+ SPELL_THUNDERCLAP = 43583,
// Darkheart
- SPELL_PSYCHIC_WAIL = 43590,
+ SPELL_PSYCHIC_WAIL = 43590,
// Slither
- SPELL_VENOM_SPIT = 43579,
+ SPELL_VENOM_SPIT = 43579,
// Fenstalker
- SPELL_VOLATILE_INFECTION = 43586,
+ SPELL_VOLATILE_INFECTION = 43586,
// Koragg
- SPELL_COLD_STARE = 43593,
- SPELL_MIGHTY_BLOW = 43592
-
+ SPELL_COLD_STARE = 43593,
+ SPELL_MIGHTY_BLOW = 43592
};
#define ORIENT 1.5696f
@@ -306,8 +301,7 @@ class boss_hexlord_malacrass : public CreatureScript
instance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS);
DoZoneInCombat();
- me->Yell(YELL_AGGRO, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_AGGRO);
+ Talk(YELL_AGGRO);
for (uint8 i = 0; i < 4; ++i)
{
@@ -327,12 +321,10 @@ class boss_hexlord_malacrass : public CreatureScript
switch (urand(0, 1))
{
case 0:
- me->Yell(YELL_KILL_ONE, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE);
+ Talk(YELL_KILL_ONE);
break;
case 1:
- me->Yell(YELL_KILL_TWO, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO);
+ Talk(YELL_KILL_TWO);
break;
}
}
@@ -341,8 +333,7 @@ class boss_hexlord_malacrass : public CreatureScript
{
instance->SetData(DATA_HEXLORDEVENT, DONE);
- me->Yell(YELL_DEATH, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_DEATH);
+ Talk(YELL_DEATH);
for (uint8 i = 0; i < 4; ++i)
{
@@ -415,8 +406,7 @@ class boss_hexlord_malacrass : public CreatureScript
if (DrainPower_Timer <= diff)
{
DoCast(me, SPELL_DRAIN_POWER, true);
- me->Yell(YELL_DRAIN_POWER, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_DRAIN_POWER);
+ Talk(YELL_DRAIN_POWER);
DrainPower_Timer = urand(40000, 55000); // must cast in 60 sec, or buff/debuff will disappear
} else DrainPower_Timer -= diff;
@@ -427,8 +417,7 @@ class boss_hexlord_malacrass : public CreatureScript
else
{
DoCast(me, SPELL_SPIRIT_BOLTS, false);
- me->Yell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_SPIRIT_BOLTS);
+ Talk(YELL_SPIRIT_BOLTS);
SpiritBolts_Timer = 40000;
SiphonSoul_Timer = 10000; // ready to drain
PlayerAbility_Timer = 99999;
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
index 37505a8b74d..188f9d0cc03 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
@@ -30,21 +30,41 @@ EndScriptData */
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
-enum Spells
+enum Yells
{
- SPELL_BERSERK = 45078,
+ YELL_NALORAKK_WAVE1 = 0,
+ YELL_NALORAKK_WAVE2 = 1,
+ YELL_NALORAKK_WAVE3 = 2,
+ YELL_NALORAKK_WAVE4 = 3,
+ YELL_AGGRO = 4,
+ YELL_SURGE = 5,
+ YELL_SHIFTEDTOBEAR = 6,
+ YELL_SHIFTEDTOTROLL = 7,
+ YELL_BERSERK = 8,
+ YELL_KILL_ONE = 9,
+ YELL_KILL_TWO = 10,
+ YELL_DEATH = 11
+
+// Not yet implemented
+// YELL_NALORAKK_EVENT1 = 12,
+// YELL_NALORAKK_EVENT2 = 13
+};
+enum Spells
+{
// Troll form
- SPELL_BRUTALSWIPE = 42384,
- SPELL_MANGLE = 42389,
- SPELL_MANGLEEFFECT = 44955,
- SPELL_SURGE = 42402,
- SPELL_BEARFORM = 42377,
+ SPELL_BRUTALSWIPE = 42384,
+ SPELL_MANGLE = 42389,
+ SPELL_MANGLEEFFECT = 44955,
+ SPELL_SURGE = 42402,
+ SPELL_BEARFORM = 42377,
// Bear form
- SPELL_LACERATINGSLASH = 42395,
- SPELL_RENDFLESH = 42397,
- SPELL_DEAFENINGROAR = 42398
+ SPELL_LACERATINGSLASH = 42395,
+ SPELL_RENDFLESH = 42397,
+ SPELL_DEAFENINGROAR = 42398,
+
+ SPELL_BERSERK = 45078
};
// Trash Waves
@@ -57,45 +77,9 @@ float NalorakkWay[8][3] =
{-79.929f, 1395.958f, 27.31f},
{-80.072f, 1374.555f, 40.87f}, // waypoint 3
{-80.072f, 1314.398f, 40.87f},
- {-80.072f, 1295.775f, 48.60f} // waypoint 4
+ {-80.072f, 1295.775f, 48.60f} // waypoint 4
};
-#define YELL_NALORAKK_WAVE1 "Get da move on, guards! It be killin' time!"
-#define SOUND_NALORAKK_WAVE1 12066
-#define YELL_NALORAKK_WAVE2 "Guards, go already! Who you more afraid of, dem... or me?"
-#define SOUND_NALORAKK_WAVE2 12067
-#define YELL_NALORAKK_WAVE3 "Ride now! Ride out dere and bring me back some heads!"
-#define SOUND_NALORAKK_WAVE3 12068
-#define YELL_NALORAKK_WAVE4 "I be losin' me patience! Go on: make dem wish dey was never born!"
-#define SOUND_NALORAKK_WAVE4 12069
-
-//Unimplemented SoundIDs
-/*
-#define SOUND_NALORAKK_EVENT1 12078
-#define SOUND_NALORAKK_EVENT2 12079
-*/
-
-//General defines
-#define YELL_AGGRO "You be dead soon enough!"
-#define SOUND_YELL_AGGRO 12070
-#define YELL_KILL_ONE "Mua-ha-ha! Now whatchoo got to say?"
-#define SOUND_YELL_KILL_ONE 12075
-#define YELL_KILL_TWO "Da Amani gonna rule again!"
-#define SOUND_YELL_KILL_TWO 12076
-#define YELL_DEATH "I... be waitin' on da udda side...."
-#define SOUND_YELL_DEATH 12077
-#define YELL_BERSERK "You had your chance, now it be too late!" //Never seen this being used, so just guessing from what I hear.
-#define SOUND_YELL_BERSERK 12074
-#define YELL_SURGE "I bring da pain!"
-#define SOUND_YELL_SURGE 12071
-
-#define YELL_SHIFTEDTOTROLL "Make way for Nalorakk!"
-#define SOUND_YELL_TOTROLL 12073
-
-
-#define YELL_SHIFTEDTOBEAR "You call on da beast, you gonna get more dan you bargain for!"
-#define SOUND_YELL_TOBEAR 12072
-
class boss_nalorakk : public CreatureScript
{
public:
@@ -158,7 +142,7 @@ class boss_nalorakk : public CreatureScript
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
inMove = false;
waitTimer = 0;
- me->SetSpeed(MOVE_RUN, 2);
+ me->SetSpeedRate(MOVE_RUN, 2);
me->SetWalk(false);
}else
{
@@ -227,8 +211,7 @@ class boss_nalorakk : public CreatureScript
case 0:
if (me->IsWithinDistInMap(who, 50))
{
- me->Yell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE1);
+ Talk(YELL_NALORAKK_WAVE1);
(*me).GetMotionMaster()->MovePoint(1, NalorakkWay[1][0], NalorakkWay[1][1], NalorakkWay[1][2]);
MovePhase ++;
@@ -240,8 +223,7 @@ class boss_nalorakk : public CreatureScript
case 2:
if (me->IsWithinDistInMap(who, 40))
{
- me->Yell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE2);
+ Talk(YELL_NALORAKK_WAVE2);
(*me).GetMotionMaster()->MovePoint(3, NalorakkWay[3][0], NalorakkWay[3][1], NalorakkWay[3][2]);
MovePhase ++;
@@ -253,8 +235,7 @@ class boss_nalorakk : public CreatureScript
case 5:
if (me->IsWithinDistInMap(who, 40))
{
- me->Yell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE3);
+ Talk(YELL_NALORAKK_WAVE3);
(*me).GetMotionMaster()->MovePoint(6, NalorakkWay[6][0], NalorakkWay[6][1], NalorakkWay[6][2]);
MovePhase ++;
@@ -268,8 +249,7 @@ class boss_nalorakk : public CreatureScript
{
SendAttacker(who);
- me->Yell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE4);
+ Talk(YELL_NALORAKK_WAVE4);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -287,8 +267,7 @@ class boss_nalorakk : public CreatureScript
{
instance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS);
- me->Yell(YELL_AGGRO, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_AGGRO);
+ Talk(YELL_AGGRO);
DoZoneInCombat();
}
@@ -296,8 +275,7 @@ class boss_nalorakk : public CreatureScript
{
instance->SetData(DATA_NALORAKKEVENT, DONE);
- me->Yell(YELL_DEATH, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_DEATH);
+ Talk(YELL_DEATH);
}
void KilledUnit(Unit* /*victim*/) override
@@ -305,12 +283,10 @@ class boss_nalorakk : public CreatureScript
switch (urand(0, 1))
{
case 0:
- me->Yell(YELL_KILL_ONE, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE);
+ Talk(YELL_KILL_ONE);
break;
case 1:
- me->Yell(YELL_KILL_TWO, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO);
+ Talk(YELL_KILL_TWO);
break;
}
}
@@ -373,8 +349,7 @@ class boss_nalorakk : public CreatureScript
if (Berserk_Timer <= diff)
{
DoCast(me, SPELL_BERSERK, true);
- me->Yell(YELL_BERSERK, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_BERSERK);
+ Talk(YELL_BERSERK);
Berserk_Timer = 600000;
} else Berserk_Timer -= diff;
@@ -383,8 +358,7 @@ class boss_nalorakk : public CreatureScript
if (inBearForm)
{
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122);
- me->Yell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_TOTROLL);
+ Talk(YELL_SHIFTEDTOTROLL);
me->RemoveAurasDueToSpell(SPELL_BEARFORM);
Surge_Timer = urand(15000, 20000);
BrutalSwipe_Timer = urand(7000, 12000);
@@ -395,8 +369,7 @@ class boss_nalorakk : public CreatureScript
else
{
// me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0);
- me->Yell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_TOBEAR);
+ Talk(YELL_SHIFTEDTOBEAR);
DoCast(me, SPELL_BEARFORM, true);
LaceratingSlash_Timer = 2000; // dur 18s
RendFlesh_Timer = 3000; // dur 5s
@@ -426,8 +399,7 @@ class boss_nalorakk : public CreatureScript
if (Surge_Timer <= diff)
{
- me->Yell(YELL_SURGE, LANG_UNIVERSAL);
- DoPlaySoundToSet(me, SOUND_YELL_SURGE);
+ Talk(YELL_SURGE);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true);
if (target)
DoCast(target, SPELL_SURGE);
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
index 96c0798ae05..a1c2369cf66 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
@@ -347,7 +347,7 @@ class boss_zuljin : public CreatureScript
Vortex->CastSpell(Vortex, SPELL_CYCLONE_PASSIVE, true);
Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true);
Vortex->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Vortex->SetSpeed(MOVE_RUN, 1.0f);
+ Vortex->SetSpeedRate(MOVE_RUN, 1.0f);
Vortex->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0));
DoZoneInCombat(Vortex);
}
@@ -438,7 +438,7 @@ class boss_zuljin : public CreatureScript
{
if (me->GetVictim())
TankGUID = me->EnsureVictim()->GetGUID();
- me->SetSpeed(MOVE_RUN, 5.0f);
+ me->SetSpeedRate(MOVE_RUN, 5.0f);
AttackStart(target); // change victim
Claw_Rage_Timer = 0;
Claw_Loop_Timer = 500;
@@ -462,7 +462,7 @@ class boss_zuljin : public CreatureScript
if (Claw_Counter == 12)
{
Claw_Rage_Timer = urand(15000, 20000);
- me->SetSpeed(MOVE_RUN, 1.2f);
+ me->SetSpeedRate(MOVE_RUN, 1.2f);
AttackStart(ObjectAccessor::GetUnit(*me, TankGUID));
TankGUID.Clear();
return;
@@ -487,7 +487,7 @@ class boss_zuljin : public CreatureScript
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
TankGUID = me->EnsureVictim()->GetGUID();
- me->SetSpeed(MOVE_RUN, 5.0f);
+ me->SetSpeedRate(MOVE_RUN, 5.0f);
AttackStart(target); // change victim
Lynx_Rush_Timer = 0;
Claw_Counter = 0;
@@ -510,7 +510,7 @@ class boss_zuljin : public CreatureScript
if (Claw_Counter == 9)
{
Lynx_Rush_Timer = urand(15000, 20000);
- me->SetSpeed(MOVE_RUN, 1.2f);
+ me->SetSpeedRate(MOVE_RUN, 1.2f);
AttackStart(ObjectAccessor::GetUnit(*me, TankGUID));
TankGUID.Clear();
}
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
index 972acdc3f9f..9b668169dca 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
@@ -162,7 +162,7 @@ class npc_zulaman_hostage : public CreatureScript
{
if (HostageEntry[i] == entry)
{
- creature->SummonGameObject(ChestEntry[i], x-2, y, z, 0, 0, 0, 0, 0, 0);
+ creature->SummonGameObject(ChestEntry[i], Position(x - 2, y, z, 0.f), G3D::Quat(), 0);
break;
}
}
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
index 8c179af2adf..3697b0876c8 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
@@ -148,6 +148,11 @@ class boss_mandokir : public CreatureScript
instance->SaveToDB();
}
+ void JustReachedHome() override
+ {
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ }
+
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
@@ -194,9 +199,9 @@ class boss_mandokir : public CreatureScript
me->SetWalk(false);
if (id == POINT_MANDOKIR_END)
{
- me->SetHomePosition(PosMandokir[0]);
+ me->SetHomePosition(PosMandokir[1]);
+ me->GetMotionMaster()->MoveTargetedHome();
instance->SetBossState(DATA_MANDOKIR, NOT_STARTED);
- me->DespawnOrUnsummon(6000); // No idea how to respawn on wipe.
}
}
}
diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
new file mode 100644
index 00000000000..adcb4f9fc9a
--- /dev/null
+++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
@@ -0,0 +1,368 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+void AddSC_alterac_valley(); //Alterac Valley
+void AddSC_boss_balinda();
+void AddSC_boss_drekthar();
+void AddSC_boss_galvangar();
+void AddSC_boss_vanndar();
+void AddSC_blackrock_depths(); //Blackrock Depths
+void AddSC_boss_ambassador_flamelash();
+void AddSC_boss_draganthaurissan();
+void AddSC_boss_general_angerforge();
+void AddSC_boss_high_interrogator_gerstahn();
+void AddSC_boss_magmus();
+void AddSC_boss_moira_bronzebeard();
+void AddSC_boss_tomb_of_seven();
+void AddSC_instance_blackrock_depths();
+void AddSC_boss_drakkisath(); //Blackrock Spire
+void AddSC_boss_halycon();
+void AddSC_boss_highlordomokk();
+void AddSC_boss_mothersmolderweb();
+void AddSC_boss_overlordwyrmthalak();
+void AddSC_boss_shadowvosh();
+void AddSC_boss_thebeast();
+void AddSC_boss_warmastervoone();
+void AddSC_boss_quatermasterzigris();
+void AddSC_boss_pyroguard_emberseer();
+void AddSC_boss_gyth();
+void AddSC_boss_rend_blackhand();
+void AddSC_boss_gizrul_the_slavener();
+void AddSC_boss_urok_doomhowl();
+void AddSC_boss_lord_valthalak();
+void AddSC_instance_blackrock_spire();
+void AddSC_boss_razorgore(); //Blackwing lair
+void AddSC_boss_vaelastrasz();
+void AddSC_boss_broodlord();
+void AddSC_boss_firemaw();
+void AddSC_boss_ebonroc();
+void AddSC_boss_flamegor();
+void AddSC_boss_chromaggus();
+void AddSC_boss_nefarian();
+void AddSC_instance_blackwing_lair();
+void AddSC_deadmines(); //Deadmines
+void AddSC_instance_deadmines();
+void AddSC_boss_mr_smite();
+void AddSC_gnomeregan(); //Gnomeregan
+void AddSC_instance_gnomeregan();
+void AddSC_boss_attumen(); //Karazhan
+void AddSC_boss_curator();
+void AddSC_boss_maiden_of_virtue();
+void AddSC_boss_shade_of_aran();
+void AddSC_boss_malchezaar();
+void AddSC_boss_terestian_illhoof();
+void AddSC_boss_moroes();
+void AddSC_bosses_opera();
+void AddSC_boss_netherspite();
+void AddSC_instance_karazhan();
+void AddSC_karazhan();
+void AddSC_boss_nightbane();
+void AddSC_boss_felblood_kaelthas(); // Magister's Terrace
+void AddSC_boss_selin_fireheart();
+void AddSC_boss_vexallus();
+void AddSC_boss_priestess_delrissa();
+void AddSC_instance_magisters_terrace();
+void AddSC_magisters_terrace();
+void AddSC_boss_lucifron(); //Molten core
+void AddSC_boss_magmadar();
+void AddSC_boss_gehennas();
+void AddSC_boss_garr();
+void AddSC_boss_baron_geddon();
+void AddSC_boss_shazzrah();
+void AddSC_boss_golemagg();
+void AddSC_boss_sulfuron();
+void AddSC_boss_majordomo();
+void AddSC_boss_ragnaros();
+void AddSC_instance_molten_core();
+void AddSC_the_scarlet_enclave(); //Scarlet Enclave
+void AddSC_the_scarlet_enclave_c1();
+void AddSC_the_scarlet_enclave_c2();
+void AddSC_the_scarlet_enclave_c5();
+void AddSC_boss_arcanist_doan(); //Scarlet Monastery
+void AddSC_boss_azshir_the_sleepless();
+void AddSC_boss_bloodmage_thalnos();
+void AddSC_boss_headless_horseman();
+void AddSC_boss_herod();
+void AddSC_boss_high_inquisitor_fairbanks();
+void AddSC_boss_houndmaster_loksey();
+void AddSC_boss_interrogator_vishas();
+void AddSC_boss_scorn();
+void AddSC_instance_scarlet_monastery();
+void AddSC_boss_mograine_and_whitemane();
+void AddSC_boss_darkmaster_gandling(); //Scholomance
+void AddSC_boss_death_knight_darkreaver();
+void AddSC_boss_theolenkrastinov();
+void AddSC_boss_illuciabarov();
+void AddSC_boss_instructormalicia();
+void AddSC_boss_jandicebarov();
+void AddSC_boss_kormok();
+void AddSC_boss_lordalexeibarov();
+void AddSC_boss_lorekeeperpolkelt();
+void AddSC_boss_rasfrost();
+void AddSC_boss_theravenian();
+void AddSC_boss_vectus();
+void AddSC_boss_kirtonos_the_herald();
+void AddSC_instance_scholomance();
+void AddSC_shadowfang_keep(); //Shadowfang keep
+void AddSC_instance_shadowfang_keep();
+void AddSC_boss_magistrate_barthilas(); //Stratholme
+void AddSC_boss_maleki_the_pallid();
+void AddSC_boss_nerubenkan();
+void AddSC_boss_cannon_master_willey();
+void AddSC_boss_baroness_anastari();
+void AddSC_boss_ramstein_the_gorger();
+void AddSC_boss_timmy_the_cruel();
+void AddSC_boss_postmaster_malown();
+void AddSC_boss_baron_rivendare();
+void AddSC_boss_dathrohan_balnazzar();
+void AddSC_boss_order_of_silver_hand();
+void AddSC_instance_stratholme();
+void AddSC_stratholme();
+void AddSC_sunken_temple(); // Sunken Temple
+void AddSC_instance_sunken_temple();
+void AddSC_instance_sunwell_plateau(); //Sunwell Plateau
+void AddSC_boss_kalecgos();
+void AddSC_boss_brutallus();
+void AddSC_boss_felmyst();
+void AddSC_boss_eredar_twins();
+void AddSC_boss_muru();
+void AddSC_boss_kiljaeden();
+void AddSC_sunwell_plateau();
+void AddSC_boss_archaedas(); //Uldaman
+void AddSC_boss_ironaya();
+void AddSC_uldaman();
+void AddSC_instance_uldaman();
+void AddSC_instance_the_stockade(); //The Stockade
+void AddSC_boss_akilzon(); //Zul'Aman
+void AddSC_boss_halazzi();
+void AddSC_boss_hex_lord_malacrass();
+void AddSC_boss_janalai();
+void AddSC_boss_nalorakk();
+void AddSC_boss_zuljin();
+void AddSC_instance_zulaman();
+void AddSC_zulaman();
+void AddSC_boss_jeklik(); //Zul'Gurub
+void AddSC_boss_venoxis();
+void AddSC_boss_marli();
+void AddSC_boss_mandokir();
+void AddSC_boss_gahzranka();
+void AddSC_boss_thekal();
+void AddSC_boss_arlokk();
+void AddSC_boss_jindo();
+void AddSC_boss_hakkar();
+void AddSC_boss_grilek();
+void AddSC_boss_hazzarah();
+void AddSC_boss_renataki();
+void AddSC_boss_wushoolay();
+void AddSC_instance_zulgurub();
+//void AddSC_alterac_mountains();
+void AddSC_arathi_highlands();
+void AddSC_blasted_lands();
+void AddSC_burning_steppes();
+void AddSC_duskwood();
+void AddSC_eastern_plaguelands();
+void AddSC_ghostlands();
+void AddSC_hinterlands();
+void AddSC_isle_of_queldanas();
+void AddSC_redridge_mountains();
+void AddSC_silverpine_forest();
+void AddSC_stormwind_city();
+void AddSC_stranglethorn_vale();
+void AddSC_swamp_of_sorrows();
+void AddSC_tirisfal_glades();
+void AddSC_undercity();
+void AddSC_western_plaguelands();
+void AddSC_wetlands();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddEasternKingdomsScripts()
+{
+ AddSC_alterac_valley(); //Alterac Valley
+ AddSC_boss_balinda();
+ AddSC_boss_drekthar();
+ AddSC_boss_galvangar();
+ AddSC_boss_vanndar();
+ AddSC_blackrock_depths(); //Blackrock Depths
+ AddSC_boss_ambassador_flamelash();
+ AddSC_boss_draganthaurissan();
+ AddSC_boss_general_angerforge();
+ AddSC_boss_high_interrogator_gerstahn();
+ AddSC_boss_magmus();
+ AddSC_boss_moira_bronzebeard();
+ AddSC_boss_tomb_of_seven();
+ AddSC_instance_blackrock_depths();
+ AddSC_boss_drakkisath(); //Blackrock Spire
+ AddSC_boss_halycon();
+ AddSC_boss_highlordomokk();
+ AddSC_boss_mothersmolderweb();
+ AddSC_boss_overlordwyrmthalak();
+ AddSC_boss_shadowvosh();
+ AddSC_boss_thebeast();
+ AddSC_boss_warmastervoone();
+ AddSC_boss_quatermasterzigris();
+ AddSC_boss_pyroguard_emberseer();
+ AddSC_boss_gyth();
+ AddSC_boss_rend_blackhand();
+ AddSC_boss_gizrul_the_slavener();
+ AddSC_boss_urok_doomhowl();
+ AddSC_boss_lord_valthalak();
+ AddSC_instance_blackrock_spire();
+ AddSC_boss_razorgore(); //Blackwing lair
+ AddSC_boss_vaelastrasz();
+ AddSC_boss_broodlord();
+ AddSC_boss_firemaw();
+ AddSC_boss_ebonroc();
+ AddSC_boss_flamegor();
+ AddSC_boss_chromaggus();
+ AddSC_boss_nefarian();
+ AddSC_instance_blackwing_lair();
+ AddSC_deadmines(); //Deadmines
+ AddSC_boss_mr_smite();
+ AddSC_instance_deadmines();
+ AddSC_gnomeregan(); //Gnomeregan
+ AddSC_instance_gnomeregan();
+ AddSC_boss_attumen(); //Karazhan
+ AddSC_boss_curator();
+ AddSC_boss_maiden_of_virtue();
+ AddSC_boss_shade_of_aran();
+ AddSC_boss_malchezaar();
+ AddSC_boss_terestian_illhoof();
+ AddSC_boss_moroes();
+ AddSC_bosses_opera();
+ AddSC_boss_netherspite();
+ AddSC_instance_karazhan();
+ AddSC_karazhan();
+ AddSC_boss_nightbane();
+ AddSC_boss_felblood_kaelthas(); // Magister's Terrace
+ AddSC_boss_selin_fireheart();
+ AddSC_boss_vexallus();
+ AddSC_boss_priestess_delrissa();
+ AddSC_instance_magisters_terrace();
+ AddSC_magisters_terrace();
+ AddSC_boss_lucifron(); //Molten core
+ AddSC_boss_magmadar();
+ AddSC_boss_gehennas();
+ AddSC_boss_garr();
+ AddSC_boss_baron_geddon();
+ AddSC_boss_shazzrah();
+ AddSC_boss_golemagg();
+ AddSC_boss_sulfuron();
+ AddSC_boss_majordomo();
+ AddSC_boss_ragnaros();
+ AddSC_instance_molten_core();
+ AddSC_the_scarlet_enclave(); //Scarlet Enclave
+ AddSC_the_scarlet_enclave_c1();
+ AddSC_the_scarlet_enclave_c2();
+ AddSC_the_scarlet_enclave_c5();
+ AddSC_boss_arcanist_doan(); //Scarlet Monastery
+ AddSC_boss_azshir_the_sleepless();
+ AddSC_boss_bloodmage_thalnos();
+ AddSC_boss_headless_horseman();
+ AddSC_boss_herod();
+ AddSC_boss_high_inquisitor_fairbanks();
+ AddSC_boss_houndmaster_loksey();
+ AddSC_boss_interrogator_vishas();
+ AddSC_boss_scorn();
+ AddSC_instance_scarlet_monastery();
+ AddSC_boss_mograine_and_whitemane();
+ AddSC_boss_darkmaster_gandling(); //Scholomance
+ AddSC_boss_death_knight_darkreaver();
+ AddSC_boss_theolenkrastinov();
+ AddSC_boss_illuciabarov();
+ AddSC_boss_instructormalicia();
+ AddSC_boss_jandicebarov();
+ AddSC_boss_kormok();
+ AddSC_boss_lordalexeibarov();
+ AddSC_boss_lorekeeperpolkelt();
+ AddSC_boss_rasfrost();
+ AddSC_boss_theravenian();
+ AddSC_boss_vectus();
+ AddSC_boss_kirtonos_the_herald();
+ AddSC_instance_scholomance();
+ AddSC_shadowfang_keep(); //Shadowfang keep
+ AddSC_instance_shadowfang_keep();
+ AddSC_boss_magistrate_barthilas(); //Stratholme
+ AddSC_boss_maleki_the_pallid();
+ AddSC_boss_nerubenkan();
+ AddSC_boss_cannon_master_willey();
+ AddSC_boss_baroness_anastari();
+ AddSC_boss_ramstein_the_gorger();
+ AddSC_boss_timmy_the_cruel();
+ AddSC_boss_postmaster_malown();
+ AddSC_boss_baron_rivendare();
+ AddSC_boss_dathrohan_balnazzar();
+ AddSC_boss_order_of_silver_hand();
+ AddSC_instance_stratholme();
+ AddSC_stratholme();
+ AddSC_sunken_temple(); // Sunken Temple
+ AddSC_instance_sunken_temple();
+ AddSC_instance_sunwell_plateau(); //Sunwell Plateau
+ AddSC_boss_kalecgos();
+ AddSC_boss_brutallus();
+ AddSC_boss_felmyst();
+ AddSC_boss_eredar_twins();
+ AddSC_boss_muru();
+ AddSC_boss_kiljaeden();
+ AddSC_sunwell_plateau();
+ AddSC_instance_the_stockade(); //The Stockade
+ AddSC_boss_archaedas(); //Uldaman
+ AddSC_boss_ironaya();
+ AddSC_uldaman();
+ AddSC_instance_uldaman();
+ AddSC_boss_akilzon(); //Zul'Aman
+ AddSC_boss_halazzi();
+ AddSC_boss_hex_lord_malacrass();
+ AddSC_boss_janalai();
+ AddSC_boss_nalorakk();
+ AddSC_boss_zuljin();
+ AddSC_instance_zulaman();
+ AddSC_zulaman();
+ AddSC_boss_jeklik(); //Zul'Gurub
+ AddSC_boss_venoxis();
+ AddSC_boss_marli();
+ AddSC_boss_mandokir();
+ AddSC_boss_gahzranka();
+ AddSC_boss_thekal();
+ AddSC_boss_arlokk();
+ AddSC_boss_jindo();
+ AddSC_boss_hakkar();
+ AddSC_boss_grilek();
+ AddSC_boss_hazzarah();
+ AddSC_boss_renataki();
+ AddSC_boss_wushoolay();
+ AddSC_instance_zulgurub();
+ //AddSC_alterac_mountains();
+ AddSC_arathi_highlands();
+ AddSC_blasted_lands();
+ AddSC_burning_steppes();
+ AddSC_duskwood();
+ AddSC_eastern_plaguelands();
+ AddSC_ghostlands();
+ AddSC_hinterlands();
+ AddSC_isle_of_queldanas();
+ AddSC_redridge_mountains();
+ AddSC_silverpine_forest();
+ AddSC_stormwind_city();
+ AddSC_stranglethorn_vale();
+ AddSC_swamp_of_sorrows();
+ AddSC_tirisfal_glades();
+ AddSC_undercity();
+ AddSC_western_plaguelands();
+ AddSC_wetlands();
+}
diff --git a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp
index df61a010f84..73b397553a5 100644
--- a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp
@@ -19,7 +19,7 @@
/* ScriptData
SDName: Burning_Steppes
SD%Complete: 100
-SDComment: Quest support: 4224, 4866
+SDComment: Quest support: 4866
SDCategory: Burning Steppes
EndScriptData */
@@ -36,25 +36,11 @@ EndContentData */
## npc_ragged_john
######*/
-#define GOSSIP_HELLO "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him."
-#define GOSSIP_SELECT1 "So what did you do?"
-#define GOSSIP_SELECT2 "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'."
-#define GOSSIP_SELECT3 "Ironfoe?"
-#define GOSSIP_SELECT4 "Interesting... continue John."
-#define GOSSIP_SELECT5 "So that's how Windsor died..."
-#define GOSSIP_SELECT6 "So how did he die?"
-#define GOSSIP_SELECT7 "Ok so where the hell is he? Wait a minute! Are you drunk?"
-#define GOSSIP_SELECT8 "WHY is he in Blackrock Depths?"
-#define GOSSIP_SELECT9 "300? So the Dark Irons killed him and dragged him into the Depths?"
-#define GOSSIP_SELECT10 "Ahh... Ironfoe"
-#define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative"
-
enum RaggedJohn
{
- QUEST_THE_TRUE_MASTERS = 4224,
- QUEST_MOTHERS_MILK = 4866,
- SPELL_MOTHERS_MILK = 16468,
- SPELL_WICKED_MILKING = 16472
+ QUEST_MOTHERS_MILK = 4866,
+ SPELL_MOTHERS_MILK = 16468,
+ SPELL_WICKED_MILKING = 16472
};
class npc_ragged_john : public CreatureScript
@@ -86,72 +72,13 @@ public:
void EnterCombat(Unit* /*who*/) override { }
};
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(2714, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(2715, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2716, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(2717, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(2718, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(2719, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(2720, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(2721, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+8:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->SEND_GOSSIP_MENU(2722, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+9:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->SEND_GOSSIP_MENU(2723, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+10:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(2725, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(QUEST_THE_TRUE_MASTERS);
- break;
- }
- return true;
- }
-
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsQuestGiver())
+ {
player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(QUEST_THE_TRUE_MASTERS) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(2713, creature->GetGUID());
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
+ }
return true;
}
diff --git a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp
index ce0ebf4d129..4cc72715868 100644
--- a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp
@@ -19,7 +19,7 @@
/* ScriptData
SDName: Eastern_Plaguelands
SD%Complete: 100
-SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched
+SDComment: Quest support: 5211. Special vendor Augustus the Touched
SDCategory: Eastern Plaguelands
EndScriptData */
@@ -27,7 +27,6 @@ EndScriptData */
npc_ghoul_flayer
npc_augustus_the_touched
npc_darrowshire_spirit
-npc_tirion_fordring
EndContentData */
#include "ScriptMgr.h"
@@ -133,63 +132,9 @@ public:
};
};
-/*######
-## npc_tirion_fordring
-######*/
-
-#define GOSSIP_HELLO "I am ready to hear your tale, Tirion."
-#define GOSSIP_SELECT1 "Thank you, Tirion. What of your identity?"
-#define GOSSIP_SELECT2 "That is terrible."
-#define GOSSIP_SELECT3 "I will, Tirion."
-
-class npc_tirion_fordring : public CreatureScript
-{
-public:
- npc_tirion_fordring() : CreatureScript("npc_tirion_fordring") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(4493, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(4494, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(4495, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(5742);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == UNIT_STAND_STATE_SIT)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
void AddSC_eastern_plaguelands()
{
new npc_ghoul_flayer();
new npc_augustus_the_touched();
new npc_darrowshire_spirit();
- new npc_tirion_fordring();
}
diff --git a/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp b/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp
deleted file mode 100644
index 151f8270c47..00000000000
--- a/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Loch_Modan
-SD%Complete: 100
-SDComment: Quest support: 3181
-SDCategory: Loch Modan
-EndScriptData */
-
-/* ContentData
-npc_mountaineer_pebblebitty
-EndContentData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "ScriptedGossip.h"
-#include "Player.h"
-
-/*######
-## npc_mountaineer_pebblebitty
-######*/
-
-#define GOSSIP_MP "Open the gate please, i need to get to Searing Gorge"
-
-#define GOSSIP_MP1 "But i need to get there, now open the gate!"
-#define GOSSIP_MP2 "Ok, so what is this other way?"
-#define GOSSIP_MP3 "Doesn't matter, i'm invulnerable."
-#define GOSSIP_MP4 "Yes..."
-#define GOSSIP_MP5 "Ok, i'll try to remember that."
-#define GOSSIP_MP6 "A key? Ok!"
-
-class npc_mountaineer_pebblebitty : public CreatureScript
-{
-public:
- npc_mountaineer_pebblebitty() : CreatureScript("npc_mountaineer_pebblebitty") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(1833, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(1834, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(1835, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(1836, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(1837, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(1838, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->CLOSE_GOSSIP_MENU();
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (!player->GetQuestRewardStatus(3181) == 1)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
-void AddSC_loch_modan()
-{
- new npc_mountaineer_pebblebitty();
-}
diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
index 2d6d4da5aef..4a585bcb267 100644
--- a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
@@ -19,14 +19,12 @@
/* ScriptData
SDName: Stormwind_City
SD%Complete: 100
-SDComment: Quest support: 1640, 1447, 4185, 11223, 434.
+SDComment: Quest support: 1640, 1447, 434.
SDCategory: Stormwind City
EndScriptData */
/* ContentData
-npc_archmage_malin
npc_bartleby
-npc_lady_katrana_prestor
npc_tyrion
npc_tyrion_spybot
npc_marzon_silent_blade
@@ -40,50 +38,13 @@ EndContentData */
#include "Player.h"
/*######
-## npc_archmage_malin
-######*/
-
-#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar."
-
-class npc_archmage_malin : public CreatureScript
-{
-public:
- npc_archmage_malin() : CreatureScript("npc_archmage_malin") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, 42711, true);
- }
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
-/*######
## npc_bartleby
######*/
enum Bartleby
{
- FACTION_ENEMY = 168,
- QUEST_BEAT = 1640
+ FACTION_ENEMY = 168,
+ QUEST_BEAT = 1640
};
class npc_bartleby : public CreatureScript
@@ -148,71 +109,18 @@ public:
};
/*######
-## npc_lady_katrana_prestor
-######*/
-
-#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice."
-#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor."
-#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent."
-#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor."
-
-class npc_lady_katrana_prestor : public CreatureScript
-{
-public:
- npc_lady_katrana_prestor() : CreatureScript("npc_lady_katrana_prestor") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(2694, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(2695, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2696, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(4185);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(2693, creature->GetGUID());
-
- return true;
- }
-};
-
-/*######
## npc_lord_gregor_lescovar
######*/
enum LordGregorLescovar
{
- SAY_GUARD_2 = 0,
- SAY_LESCOVAR_2 = 0,
- SAY_LESCOVAR_3 = 1,
- SAY_LESCOVAR_4 = 2,
- SAY_MARZON_1 = 0,
- SAY_MARZON_2 = 1,
- SAY_TYRION_2 = 1,
+ SAY_GUARD_2 = 0,
+ SAY_LESCOVAR_2 = 0,
+ SAY_LESCOVAR_3 = 1,
+ SAY_LESCOVAR_4 = 2,
+ SAY_MARZON_1 = 0,
+ SAY_MARZON_2 = 1,
+ SAY_TYRION_2 = 1,
NPC_STORMWIND_ROYAL = 1756,
NPC_MARZON_BLADE = 1755,
@@ -650,9 +558,7 @@ public:
void AddSC_stormwind_city()
{
- new npc_archmage_malin();
new npc_bartleby();
- new npc_lady_katrana_prestor();
new npc_tyrion();
new npc_tyrion_spybot();
new npc_lord_gregor_lescovar();
diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp
index 4b93f5b4fbb..f61e175b8fc 100644
--- a/src/server/scripts/Events/childrens_week.cpp
+++ b/src/server/scripts/Events/childrens_week.cpp
@@ -639,6 +639,12 @@ class npc_elder_kekek : public CreatureScript
}
};
+enum TheEtymidian
+{
+ SAY_ACTIVATION = 0,
+ QUEST_THE_ACTIVATION_RUNE = 12547
+};
+
/*######
## npc_the_etymidian
## @todo A red crystal as a gift for the great one should be spawned during the event.
@@ -668,10 +674,20 @@ class npc_the_etymidian : public CreatureScript
Initialize();
}
+ void sQuestReward(Player* /*player*/, Quest const* quest, uint32 /*opt*/) override
+ {
+ if (quest->GetQuestId() != QUEST_THE_ACTIVATION_RUNE)
+ return;
+
+ Talk(SAY_ACTIVATION);
+ }
+
void MoveInLineOfSight(Unit* who) override
{
if (!phase && who && who->GetDistance2d(me) < 10.0f)
+ {
if (Player* player = who->ToPlayer())
+ {
if (player->GetQuestStatus(QUEST_MEETING_A_GREAT_ONE) == QUEST_STATUS_INCOMPLETE)
{
playerGUID = player->GetGUID();
@@ -679,6 +695,8 @@ class npc_the_etymidian : public CreatureScript
if (orphanGUID)
phase = 1;
}
+ }
+ }
}
void UpdateAI(uint32 diff) override
@@ -734,7 +752,6 @@ class npc_the_etymidian : public CreatureScript
int8 phase;
ObjectGuid playerGUID;
ObjectGuid orphanGUID;
-
};
CreatureAI* GetAI(Creature* creature) const override
diff --git a/src/server/scripts/Events/events_script_loader.cpp b/src/server/scripts/Events/events_script_loader.cpp
new file mode 100644
index 00000000000..625c08f5389
--- /dev/null
+++ b/src/server/scripts/Events/events_script_loader.cpp
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+void AddSC_event_childrens_week();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddEventsScripts()
+{
+ AddSC_event_childrens_week();
+}
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
index b0d6e782052..03c957fa221 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
@@ -174,7 +174,7 @@ public:
if (state == DONE)
if (GameObject* go = instance->GetGameObject(shrineOfGelihastGUID))
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
- break;
+ break;
case DATA_AKU_MAI:
if (state == DONE)
if (GameObject* go = instance->GetGameObject(altarOfTheDeepsGUID))
diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt
deleted file mode 100644
index 2d1b4b49649..00000000000
--- a/src/server/scripts/Kalimdor/CMakeLists.txt
+++ /dev/null
@@ -1,121 +0,0 @@
-# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
-#
-# This file is free software; as a special exception the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- Kalimdor/zone_stonetalon_mountains.cpp
- Kalimdor/zone_silithus.cpp
- Kalimdor/zone_moonglade.cpp
- Kalimdor/RazorfenDowns/razorfen_downs.cpp
- Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp
- Kalimdor/RazorfenDowns/boss_tuten_kash.cpp
- Kalimdor/RazorfenDowns/boss_mordresh_fire_eye.cpp
- Kalimdor/RazorfenDowns/boss_glutton.cpp
- Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp
- Kalimdor/RazorfenDowns/razorfen_downs.h
- Kalimdor/ZulFarrak/zulfarrak.cpp
- Kalimdor/ZulFarrak/instance_zulfarrak.cpp
- Kalimdor/ZulFarrak/boss_zum_rah.cpp
- Kalimdor/ZulFarrak/zulfarrak.h
- Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp
- Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h
- Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp
- Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
- Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp
- Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp
- Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp
- Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
- Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
- Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
- Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
- Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
- Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
- Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp
- Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp
- Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
- Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
- Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h
- Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.h
- Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp
- Kalimdor/CavernsOfTime/TheBlackMorass/boss_chrono_lord_deja.cpp
- Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp
- Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp
- Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp
- Kalimdor/BlackfathomDeeps/boss_kelris.cpp
- Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
- Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
- Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
- Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp
- Kalimdor/BlackfathomDeeps/blackfathom_deeps.h
- Kalimdor/zone_azuremyst_isle.cpp
- Kalimdor/zone_orgrimmar.cpp
- Kalimdor/zone_desolace.cpp
- Kalimdor/zone_feralas.cpp
- Kalimdor/Maraudon/boss_princess_theradras.cpp
- Kalimdor/Maraudon/boss_landslide.cpp
- Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
- Kalimdor/Maraudon/boss_noxxion.cpp
- Kalimdor/Maraudon/instance_maraudon.cpp
- Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
- Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp
- Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp
- Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp
- Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
- Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp
- Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp
- Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
- Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h
- Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp
- Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp
- Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp
- Kalimdor/zone_darkshore.cpp
- Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
- Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp
- Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp
- Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
- Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp
- Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp
- Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h
- Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp
- Kalimdor/zone_bloodmyst_isle.cpp
- Kalimdor/zone_thunder_bluff.cpp
- Kalimdor/zone_azshara.cpp
- Kalimdor/RazorfenKraul/razorfen_kraul.h
- Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp
- Kalimdor/RazorfenKraul/razorfen_kraul.cpp
- Kalimdor/zone_the_barrens.cpp
- Kalimdor/zone_ungoro_crater.cpp
- Kalimdor/WailingCaverns/wailing_caverns.h
- Kalimdor/WailingCaverns/instance_wailing_caverns.cpp
- Kalimdor/WailingCaverns/wailing_caverns.cpp
- Kalimdor/zone_durotar.cpp
- Kalimdor/zone_felwood.cpp
- Kalimdor/boss_azuregos.cpp
- Kalimdor/zone_tanaris.cpp
- Kalimdor/zone_dustwallow_marsh.cpp
- Kalimdor/zone_winterspring.cpp
- Kalimdor/zone_thousand_needles.cpp
- Kalimdor/zone_ashenvale.cpp
- Kalimdor/OnyxiasLair/boss_onyxia.cpp
- Kalimdor/OnyxiasLair/onyxias_lair.h
- Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
- Kalimdor/RagefireChasm/instance_ragefire_chasm.cpp
- Kalimdor/DireMaul/instance_dire_maul.cpp
-)
-
-message(" -> Prepared: Kalimdor")
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
index 6b2142a8095..c326710e820 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
@@ -650,7 +650,7 @@ void hyjalAI::SpawnVeins()
return;
for (uint8 i = 0; i < 7; ++i)
{
- GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0);
+ GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], G3D::Quat(VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7]), 0);
if (gem)
VeinGUID[i]=gem->GetGUID();
}
@@ -662,7 +662,7 @@ void hyjalAI::SpawnVeins()
return;
for (uint8 i = 7; i < 14; ++i)
{
- GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0);
+ GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], G3D::Quat(VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7]), 0);
if (gem)
VeinGUID[i] = gem->GetGUID();
}
@@ -725,7 +725,7 @@ void hyjalAI::UpdateAI(uint32 diff)
HideNearPos(me->GetPositionX(), me->GetPositionY());
HideNearPos(5037.76f, -1889.71f);
for (uint8 i = 0; i < 92; ++i)//summon fires
- me->SummonGameObject(GO_ROARING_FLAME, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7], 0);
+ me->SummonGameObject(GO_ROARING_FLAME, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], G3D::Quat(AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7]), 0);
}
else me->SetVisible(true);
@@ -738,7 +738,7 @@ void hyjalAI::UpdateAI(uint32 diff)
HideNearPos(5563, -2763.19f);
HideNearPos(5542.2f, -2629.36f);
for (uint8 i = 0; i < 65; ++i)//summon fires
- me->SummonGameObject(GO_ROARING_FLAME, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7], 0);
+ me->SummonGameObject(GO_ROARING_FLAME, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], G3D::Quat(HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7]), 0);
}
else me->SetVisible(true);
@@ -1042,7 +1042,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
{
case 0://alliance
for (uint8 i = 0; i < 92; ++i)//summon fires
- me->SummonGameObject(GO_ROARING_FLAME, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7], 0);
+ me->SummonGameObject(GO_ROARING_FLAME, AllianceFirePos[i][0], AllianceFirePos[i][1], AllianceFirePos[i][2], AllianceFirePos[i][3], G3D::Quat(AllianceFirePos[i][4], AllianceFirePos[i][5], AllianceFirePos[i][6], AllianceFirePos[i][7]), 0);
for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
{
@@ -1083,7 +1083,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
break;
case 1://horde
for (uint8 i = 0; i < 65; ++i)//summon fires
- me->SummonGameObject(GO_ROARING_FLAME, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7], 0);
+ me->SummonGameObject(GO_ROARING_FLAME, HordeFirePos[i][0], HordeFirePos[i][1], HordeFirePos[i][2], HordeFirePos[i][3], G3D::Quat(HordeFirePos[i][4], HordeFirePos[i][5], HordeFirePos[i][6], HordeFirePos[i][7]), 0);
for (uint8 i = 0; i < 26; ++i)//summon infernals
{
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
index 55b85801652..54d3c53039e 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h
@@ -121,15 +121,15 @@ struct hyjalAI : public npc_escortAI
void Initialize();
- void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat
+ void Reset() override; // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat
- void EnterEvadeMode(EvadeReason /*why*/ = EVADE_REASON_OTHER); // Send creature back to spawn location and evade.
+ void EnterEvadeMode(EvadeReason /*why*/ = EVADE_REASON_OTHER) override; // Send creature back to spawn location and evade.
- void EnterCombat(Unit* /*who*/); // Used to reset cooldowns for our spells and to inform the raid that we're under attack
+ void EnterCombat(Unit* /*who*/) override; // Used to reset cooldowns for our spells and to inform the raid that we're under attack
- void UpdateAI(uint32 diff); // Called to summon waves, check for boss deaths and to cast our spells.
+ void UpdateAI(uint32 diff) override; // Called to summon waves, check for boss deaths and to cast our spells.
- void JustDied(Unit* /*killer*/); // Called on death, informs the raid that they have failed.
+ void JustDied(Unit* /*killer*/) override; // Called on death, informs the raid that they have failed.
void SetFaction(uint32 _faction) // Set the faction to either Alliance or Horde in Hyjal
{
@@ -140,13 +140,13 @@ struct hyjalAI : public npc_escortAI
void SpawnVeins();
void DeSpawnVeins();
- void JustSummoned(Creature* summoned);
- void SummonedCreatureDespawn(Creature* summoned);
+ void JustSummoned(Creature* summoned) override;
+ void SummonedCreatureDespawn(Creature* summoned) override;
void HideNearPos(float x, float y);
void RespawnNearPos(float x, float y);
- void WaypointReached(uint32 waypointId);
+ void WaypointReached(uint32 waypointId) override;
void DoOverrun(uint32 faction, const uint32 diff);
- void MoveInLineOfSight(Unit* who);
+ void MoveInLineOfSight(Unit* who) override;
void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
index 5275c07f63a..f29851e7cea 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h
@@ -25,11 +25,11 @@ struct hyjal_trashAI : public npc_escortAI
{
hyjal_trashAI(Creature* creature);
- void UpdateAI(uint32 diff);
+ void UpdateAI(uint32 diff) override;
- void JustDied(Unit* /*killer*/);
+ void JustDied(Unit* /*killer*/) override;
- void DamageTaken(Unit* done_by, uint32 &damage);
+ void DamageTaken(Unit* done_by, uint32 &damage) override;
public:
InstanceScript* instance;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
index 074ea781838..f76e65c3423 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
@@ -1256,7 +1256,7 @@ class npc_crate_helper : public CreatureScript
instance->SetData(DATA_CRATE_COUNT, instance->GetData(DATA_CRATE_COUNT) + 1);
if (GameObject* crate = me->FindNearestGameObject(GO_SUSPICIOUS_CRATE, 5.0f))
{
- crate->SummonGameObject(GO_PLAGUED_CRATE, crate->GetPositionX(), crate->GetPositionY(), crate->GetPositionZ(), crate->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, DAY);
+ crate->SummonGameObject(GO_PLAGUED_CRATE, *crate, G3D::Quat(), DAY);
crate->Delete();
}
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
index 44cbdec2cb5..8e53ab06ca5 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
@@ -479,12 +479,12 @@ public:
void DoMount()
{
me->Mount(SKARLOC_MOUNT_MODEL);
- me->SetSpeed(MOVE_RUN, SPEED_MOUNT);
+ me->SetSpeedRate(MOVE_RUN, SPEED_MOUNT);
}
void DoUnmount()
{
me->Dismount();
- me->SetSpeed(MOVE_RUN, SPEED_RUN);
+ me->SetSpeedRate(MOVE_RUN, SPEED_RUN);
}
void EnterCombat(Unit* /*who*/) override
{
@@ -535,12 +535,12 @@ public:
if (!UpdateVictim())
return;
- /// @todo add his abilities'n-crap here
- if (!LowHp && HealthBelowPct(20))
- {
- Talk(SAY_TH_RANDOM_LOW_HP);
- LowHp = true;
- }
+ /// @todo add his abilities'n-crap here
+ if (!LowHp && HealthBelowPct(20))
+ {
+ Talk(SAY_TH_RANDOM_LOW_HP);
+ LowHp = true;
+ }
}
};
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp
index 8715f3ca0f6..4d0f80d502d 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp
@@ -106,33 +106,33 @@ public:
if (!UpdateVictim())
return;
- events.Update(diff);
+ events.Update(diff);
- if (me->HasUnitState(UNIT_STATE_CASTING))
- return;
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
- while (uint32 eventId = events.ExecuteEvent())
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
{
- switch (eventId)
- {
- case EVENT_SANDBREATH:
- DoCastVictim(SPELL_SAND_BREATH);
- events.ScheduleEvent(EVENT_SANDBREATH, urand(15000, 25000));
- break;
- case EVENT_TIMESTOP:
- DoCastVictim(SPELL_TIME_STOP);
- events.ScheduleEvent(EVENT_TIMESTOP, urand(20000, 35000));
- break;
- case EVENT_FRENZY:
- Talk(EMOTE_FRENZY);
- DoCast(me, SPELL_ENRAGE);
- events.ScheduleEvent(EVENT_FRENZY, urand(20000, 35000));
- break;
- default:
- break;
- }
+ case EVENT_SANDBREATH:
+ DoCastVictim(SPELL_SAND_BREATH);
+ events.ScheduleEvent(EVENT_SANDBREATH, urand(15000, 25000));
+ break;
+ case EVENT_TIMESTOP:
+ DoCastVictim(SPELL_TIME_STOP);
+ events.ScheduleEvent(EVENT_TIMESTOP, urand(20000, 35000));
+ break;
+ case EVENT_FRENZY:
+ Talk(EMOTE_FRENZY);
+ DoCast(me, SPELL_ENRAGE);
+ events.ScheduleEvent(EVENT_FRENZY, urand(20000, 35000));
+ break;
+ default:
+ break;
}
- DoMeleeAttackIfReady();
+ }
+ DoMeleeAttackIfReady();
}
};
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp
index 2befdabe550..844ce239bdf 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_temporus.cpp
@@ -107,36 +107,36 @@ public:
if (!UpdateVictim())
return;
- events.Update(diff);
+ events.Update(diff);
- if (me->HasUnitState(UNIT_STATE_CASTING))
- return;
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
- while (uint32 eventId = events.ExecuteEvent())
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
{
- switch (eventId)
- {
- case EVENT_HASTE:
- DoCast(me, SPELL_HASTE);
- events.ScheduleEvent(EVENT_HASTE, urand(20000, 25000));
- break;
- case EVENT_MORTAL_WOUND:
- DoCast(me, SPELL_MORTAL_WOUND);
- events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(10000, 20000));
- break;
- case EVENT_WING_BUFFET:
- DoCast(me, SPELL_WING_BUFFET);
- events.ScheduleEvent(EVENT_WING_BUFFET, urand(20000, 30000));
- break;
- case EVENT_SPELL_REFLECTION: // Only in Heroic
- DoCast(me, SPELL_REFLECT);
- events.ScheduleEvent(EVENT_SPELL_REFLECTION, urand(25000, 35000));
- break;
- default:
- break;
- }
+ case EVENT_HASTE:
+ DoCast(me, SPELL_HASTE);
+ events.ScheduleEvent(EVENT_HASTE, urand(20000, 25000));
+ break;
+ case EVENT_MORTAL_WOUND:
+ DoCast(me, SPELL_MORTAL_WOUND);
+ events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(10000, 20000));
+ break;
+ case EVENT_WING_BUFFET:
+ DoCast(me, SPELL_WING_BUFFET);
+ events.ScheduleEvent(EVENT_WING_BUFFET, urand(20000, 30000));
+ break;
+ case EVENT_SPELL_REFLECTION: // Only in Heroic
+ DoCast(me, SPELL_REFLECT);
+ events.ScheduleEvent(EVENT_SPELL_REFLECTION, urand(25000, 35000));
+ break;
+ default:
+ break;
}
- DoMeleeAttackIfReady();
+ }
+ DoMeleeAttackIfReady();
}
};
diff --git a/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp b/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp
index 00a622f1319..558b6c10a61 100644
--- a/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp
+++ b/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp
@@ -25,20 +25,49 @@ gets instead the deserter debuff.
#include "ScriptMgr.h"
#include "InstanceScript.h"
+// Bosses (East)
+// 0 - Pusillin
+// 1 - Lethtendris
+// 2 - Hydrospawn
+// 3 - Zevrim Thornhoof
+// 4 - Alzzin the Wildshaper
+
+// West
+// 5 - Tendris Warpwood
+// 6 - Magister Kalendris
+// 7 - Tsu'zee
+// 8 - Illyanna Ravenoak
+// 9 - Immol'thar
+// 10 - Prince Tortheldrin
+
+// North
+// 11 - Guard Mol'dar
+// 12 - Stomper Kreeg
+// 13 - Guard Fengus
+// 14 - Guard Slip'kik
+// 15 - Captain Kromcrush
+// 16 - King Gordok
+
+uint8 const EncounterCount = 17;
+
class instance_dire_maul : public InstanceMapScript
{
public:
instance_dire_maul() : InstanceMapScript("instance_dire_maul", 429) { }
+ struct instance_dire_maul_InstanceMapScript : public InstanceScript
+ {
+ instance_dire_maul_InstanceMapScript(Map* map) : InstanceScript(map)
+ {
+ SetBossNumber(EncounterCount);
+ }
+ };
+
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
return new instance_dire_maul_InstanceMapScript(map);
}
- struct instance_dire_maul_InstanceMapScript : public InstanceScript
- {
- instance_dire_maul_InstanceMapScript(Map* map) : InstanceScript(map) { }
- };
};
void AddSC_instance_dire_maul()
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
index 7da15b1fdce..71ebe870e3d 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
@@ -205,7 +205,7 @@ public:
PointData = GetMoveData();
MovePoint = PointData->LocIdEnd;
- me->SetSpeed(MOVE_FLIGHT, 1.5f);
+ me->SetSpeedRate(MOVE_FLIGHT, 1.5f);
me->GetMotionMaster()->MovePoint(8, MiddleRoomLocation);
}
}
@@ -220,7 +220,7 @@ public:
PointData = GetMoveData();
if (PointData)
{
- me->SetSpeed(MOVE_FLIGHT, 1.0f);
+ me->SetSpeedRate(MOVE_FLIGHT, 1.0f);
me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ);
}
break;
@@ -250,7 +250,7 @@ public:
if (Creature * trigger = me->SummonCreature(NPC_TRIGGER, MiddleRoomLocation, TEMPSUMMON_CORPSE_DESPAWN))
triggerGUID = trigger->GetGUID();
me->GetMotionMaster()->MoveTakeoff(11, Phase2Floating);
- me->SetSpeed(MOVE_FLIGHT, 1.0f);
+ me->SetSpeedRate(MOVE_FLIGHT, 1.0f);
Talk(SAY_PHASE_2_TRANS);
instance->SetData(DATA_ONYXIA_PHASE, Phase);
events.ScheduleEvent(EVENT_WHELP_SPAWN, 5000);
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
index b579f9fc608..e8b101b5057 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
@@ -204,7 +204,7 @@ public:
case EVENT_COMPLETE:
{
DoCast(me, SPELL_IDOM_ROOM_CAMERA_SHAKE);
- me->SummonGameObject(GO_BELNISTRASZS_BRAZIER, 2577.196f, 947.0781f, 53.16757f, 2.356195f, 0, 0, 0.9238796f, 0.3826832f, 3600);
+ me->SummonGameObject(GO_BELNISTRASZS_BRAZIER, 2577.196f, 947.0781f, 53.16757f, 2.356195f, G3D::Quat(0.f, 0.f, 0.9238796f, 0.3826832f), 3600);
std::list<WorldObject*> ClusterList;
Trinity::AllWorldObjectsInRange objects(me, 50.0f);
Trinity::WorldObjectListSearcher<Trinity::AllWorldObjectsInRange> searcher(me, ClusterList, objects);
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
index b192ff8ef4d..a220468e513 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp
@@ -190,11 +190,7 @@ class boss_ossirian : public CreatureScript
if (Creature* Trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[CrystalIterator]))
{
TriggerGUID = Trigger->GetGUID();
- if (GameObject* Crystal = Trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
- CrystalCoordinates[CrystalIterator].GetPositionX(),
- CrystalCoordinates[CrystalIterator].GetPositionY(),
- CrystalCoordinates[CrystalIterator].GetPositionZ(),
- 0, 0, 0, 0, 0, uint32(-1)))
+ if (GameObject* Crystal = Trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL, CrystalCoordinates[CrystalIterator], G3D::Quat(), uint32(-1)))
{
CrystalGUID = Crystal->GetGUID();
++CrystalIterator;
diff --git a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp
new file mode 100644
index 00000000000..87edf4781d4
--- /dev/null
+++ b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp
@@ -0,0 +1,208 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+void AddSC_blackfathom_deeps(); //Blackfathom Depths
+void AddSC_boss_gelihast();
+void AddSC_boss_kelris();
+void AddSC_boss_aku_mai();
+void AddSC_instance_blackfathom_deeps();
+void AddSC_hyjal(); //CoT Battle for Mt. Hyjal
+void AddSC_boss_archimonde();
+void AddSC_instance_mount_hyjal();
+void AddSC_hyjal_trash();
+void AddSC_boss_rage_winterchill();
+void AddSC_boss_anetheron();
+void AddSC_boss_kazrogal();
+void AddSC_boss_azgalor();
+void AddSC_boss_captain_skarloc(); //CoT Old Hillsbrad
+void AddSC_boss_epoch_hunter();
+void AddSC_boss_lieutenant_drake();
+void AddSC_instance_old_hillsbrad();
+void AddSC_old_hillsbrad();
+void AddSC_boss_aeonus(); //CoT The Black Morass
+void AddSC_boss_chrono_lord_deja();
+void AddSC_boss_temporus();
+void AddSC_the_black_morass();
+void AddSC_instance_the_black_morass();
+void AddSC_boss_epoch(); //CoT Culling Of Stratholme
+void AddSC_boss_infinite_corruptor();
+void AddSC_boss_salramm();
+void AddSC_boss_mal_ganis();
+void AddSC_boss_meathook();
+void AddSC_culling_of_stratholme();
+void AddSC_instance_culling_of_stratholme();
+void AddSC_instance_dire_maul(); //Dire Maul
+void AddSC_instance_ragefire_chasm(); //Ragefire Chasm
+void AddSC_boss_celebras_the_cursed(); //Maraudon
+void AddSC_boss_landslide();
+void AddSC_boss_noxxion();
+void AddSC_boss_ptheradras();
+void AddSC_instance_maraudon();
+void AddSC_boss_onyxia(); //Onyxia's Lair
+void AddSC_instance_onyxias_lair();
+void AddSC_boss_tuten_kash(); //Razorfen Downs
+void AddSC_boss_mordresh_fire_eye();
+void AddSC_boss_glutton();
+void AddSC_boss_amnennar_the_coldbringer();
+void AddSC_razorfen_downs();
+void AddSC_instance_razorfen_downs();
+void AddSC_razorfen_kraul(); //Razorfen Kraul
+void AddSC_instance_razorfen_kraul();
+void AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj
+void AddSC_boss_rajaxx();
+void AddSC_boss_moam();
+void AddSC_boss_buru();
+void AddSC_boss_ayamiss();
+void AddSC_boss_ossirian();
+void AddSC_instance_ruins_of_ahnqiraj();
+void AddSC_boss_cthun(); //Temple of ahn'qiraj
+void AddSC_boss_viscidus();
+void AddSC_boss_fankriss();
+void AddSC_boss_huhuran();
+void AddSC_bug_trio();
+void AddSC_boss_sartura();
+void AddSC_boss_skeram();
+void AddSC_boss_twinemperors();
+void AddSC_boss_ouro();
+void AddSC_npc_anubisath_sentinel();
+void AddSC_instance_temple_of_ahnqiraj();
+void AddSC_wailing_caverns(); //Wailing caverns
+void AddSC_instance_wailing_caverns();
+void AddSC_boss_zum_rah(); //Zul'Farrak
+void AddSC_zulfarrak();
+void AddSC_instance_zulfarrak();
+
+void AddSC_ashenvale();
+void AddSC_azshara();
+void AddSC_azuremyst_isle();
+void AddSC_bloodmyst_isle();
+void AddSC_boss_azuregos();
+void AddSC_darkshore();
+void AddSC_desolace();
+void AddSC_durotar();
+void AddSC_dustwallow_marsh();
+void AddSC_felwood();
+void AddSC_feralas();
+void AddSC_moonglade();
+void AddSC_orgrimmar();
+void AddSC_silithus();
+void AddSC_stonetalon_mountains();
+void AddSC_tanaris();
+void AddSC_the_barrens();
+void AddSC_thousand_needles();
+void AddSC_thunder_bluff();
+void AddSC_ungoro_crater();
+void AddSC_winterspring();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddKalimdorScripts()
+{
+ AddSC_blackfathom_deeps(); //Blackfathom Depths
+ AddSC_boss_gelihast();
+ AddSC_boss_kelris();
+ AddSC_boss_aku_mai();
+ AddSC_instance_blackfathom_deeps();
+ AddSC_hyjal(); //CoT Battle for Mt. Hyjal
+ AddSC_boss_archimonde();
+ AddSC_instance_mount_hyjal();
+ AddSC_hyjal_trash();
+ AddSC_boss_rage_winterchill();
+ AddSC_boss_anetheron();
+ AddSC_boss_kazrogal();
+ AddSC_boss_azgalor();
+ AddSC_boss_captain_skarloc(); //CoT Old Hillsbrad
+ AddSC_boss_epoch_hunter();
+ AddSC_boss_lieutenant_drake();
+ AddSC_instance_old_hillsbrad();
+ AddSC_old_hillsbrad();
+ AddSC_boss_aeonus(); //CoT The Black Morass
+ AddSC_boss_chrono_lord_deja();
+ AddSC_boss_temporus();
+ AddSC_the_black_morass();
+ AddSC_instance_the_black_morass();
+ AddSC_boss_epoch(); //CoT Culling Of Stratholme
+ AddSC_boss_infinite_corruptor();
+ AddSC_boss_salramm();
+ AddSC_boss_mal_ganis();
+ AddSC_boss_meathook();
+ AddSC_culling_of_stratholme();
+ AddSC_instance_culling_of_stratholme();
+ AddSC_instance_dire_maul(); //Dire Maul
+ AddSC_instance_ragefire_chasm(); //Ragefire Chasm
+ AddSC_boss_celebras_the_cursed(); //Maraudon
+ AddSC_boss_landslide();
+ AddSC_boss_noxxion();
+ AddSC_boss_ptheradras();
+ AddSC_instance_maraudon();
+ AddSC_boss_onyxia(); //Onyxia's Lair
+ AddSC_instance_onyxias_lair();
+ AddSC_boss_tuten_kash(); //Razorfen Downs
+ AddSC_boss_mordresh_fire_eye();
+ AddSC_boss_glutton();
+ AddSC_boss_amnennar_the_coldbringer();
+ AddSC_razorfen_downs();
+ AddSC_instance_razorfen_downs();
+ AddSC_razorfen_kraul(); //Razorfen Kraul
+ AddSC_instance_razorfen_kraul();
+ AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj
+ AddSC_boss_rajaxx();
+ AddSC_boss_moam();
+ AddSC_boss_buru();
+ AddSC_boss_ayamiss();
+ AddSC_boss_ossirian();
+ AddSC_instance_ruins_of_ahnqiraj();
+ AddSC_boss_cthun(); //Temple of ahn'qiraj
+ AddSC_boss_viscidus();
+ AddSC_boss_fankriss();
+ AddSC_boss_huhuran();
+ AddSC_bug_trio();
+ AddSC_boss_sartura();
+ AddSC_boss_skeram();
+ AddSC_boss_twinemperors();
+ AddSC_boss_ouro();
+ AddSC_npc_anubisath_sentinel();
+ AddSC_instance_temple_of_ahnqiraj();
+ AddSC_wailing_caverns(); //Wailing caverns
+ AddSC_instance_wailing_caverns();
+ AddSC_boss_zum_rah(); //Zul'Farrak
+ AddSC_zulfarrak();
+ AddSC_instance_zulfarrak();
+
+ AddSC_ashenvale();
+ AddSC_azshara();
+ AddSC_azuremyst_isle();
+ AddSC_bloodmyst_isle();
+ AddSC_boss_azuregos();
+ AddSC_darkshore();
+ AddSC_desolace();
+ AddSC_durotar();
+ AddSC_dustwallow_marsh();
+ AddSC_felwood();
+ AddSC_feralas();
+ AddSC_moonglade();
+ AddSC_orgrimmar();
+ AddSC_silithus();
+ AddSC_stonetalon_mountains();
+ AddSC_tanaris();
+ AddSC_the_barrens();
+ AddSC_thousand_needles();
+ AddSC_thunder_bluff();
+ AddSC_ungoro_crater();
+ AddSC_winterspring();
+}
diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp
index 1ed95c16a0d..4847ac46542 100644
--- a/src/server/scripts/Kalimdor/zone_azshara.cpp
+++ b/src/server/scripts/Kalimdor/zone_azshara.cpp
@@ -404,7 +404,7 @@ public:
DoCast(me, SPELL_PERIODIC_DEPTH_CHARGE);
me->SetHover(true);
me->SetSwim(true);
- me->SetSpeed(MOVE_RUN, 0.85f, true);
+ me->SetSpeedRate(MOVE_RUN, 0.85f);
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]);
Escape = true;
diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
index 273e81d83c0..a7b2b156128 100644
--- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
@@ -240,11 +240,6 @@ class npc_sironas : public CreatureScript
public:
npc_sironas() : CreatureScript("npc_sironas") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_sironasAI(creature);
- }
-
struct npc_sironasAI : public ScriptedAI
{
npc_sironasAI(Creature* creature) : ScriptedAI(creature) { }
@@ -343,6 +338,11 @@ public:
GuidList _beamGuidList;
EventMap _events;
};
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new npc_sironasAI(creature);
+ }
};
/*######
@@ -354,11 +354,6 @@ class npc_demolitionist_legoso : public CreatureScript
public:
npc_demolitionist_legoso() : CreatureScript("npc_demolitionist_legoso") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_demolitionist_legosoAI(creature);
- }
-
struct npc_demolitionist_legosoAI : public npc_escortAI
{
npc_demolitionist_legosoAI(Creature* creature) : npc_escortAI(creature)
@@ -513,7 +508,7 @@ public:
_explosivesGuids.clear();
for (uint8 i = 0; i != MAX_EXPLOSIVES; ++i)
{
- if (GameObject* explosive = me->SummonGameObject(GO_DRAENEI_EXPLOSIVES_1, ExplosivesPos[0][i].m_positionX, ExplosivesPos[0][i].m_positionY, ExplosivesPos[0][i].m_positionZ, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
+ if (GameObject* explosive = me->SummonGameObject(GO_DRAENEI_EXPLOSIVES_1, ExplosivesPos[0][i], G3D::Quat(), 0))
_explosivesGuids.push_back(explosive->GetGUID());
}
me->HandleEmoteCommand(EMOTE_ONESHOT_NONE); // reset anim state
@@ -609,7 +604,7 @@ public:
_explosivesGuids.clear();
for (uint8 i = 0; i != MAX_EXPLOSIVES; ++i)
{
- if (GameObject* explosive = me->SummonGameObject(GO_DRAENEI_EXPLOSIVES_2, ExplosivesPos[1][i].m_positionX, ExplosivesPos[1][i].m_positionY, ExplosivesPos[1][i].m_positionZ, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
+ if (GameObject* explosive = me->SummonGameObject(GO_DRAENEI_EXPLOSIVES_2, ExplosivesPos[1][i], G3D::Quat(), 0))
_explosivesGuids.push_back(explosive->GetGUID());
}
Talk(SAY_LEGOSO_15);
@@ -812,6 +807,11 @@ public:
GuidList _explosivesGuids;
EventMap _events;
};
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new npc_demolitionist_legosoAI(creature);
+ }
};
void AddSC_bloodmyst_isle()
diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp
index 621e0b0a585..3f4a905147f 100644
--- a/src/server/scripts/Kalimdor/zone_desolace.cpp
+++ b/src/server/scripts/Kalimdor/zone_desolace.cpp
@@ -66,7 +66,6 @@ public:
npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { }
void MoveInLineOfSight(Unit* who) override
-
{
if (who->GetEntry() == NPC_SMEED && me->IsWithinDistInMap(who, 10.0f) && !me->HasAura(SPELL_KODO_KOMBO_GOSSIP))
{
@@ -90,7 +89,7 @@ public:
me->UpdateEntry(NPC_TAMED_KODO);
me->CombatStop();
me->DeleteThreatList();
- me->SetSpeed(MOVE_RUN, 0.6f, true);
+ me->SetSpeedRate(MOVE_RUN, 0.6f);
me->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, me->GetFollowAngle());
me->setActive(true);
}
@@ -226,37 +225,9 @@ public:
}
};
-/*######
-## go_demon_portal
-######*/
-
-enum DemonPortal
-{
- NPC_DEMON_GUARDIAN = 11937,
- QUEST_PORTAL_OF_THE_LEGION = 5581
-};
-
-class go_demon_portal : public GameObjectScript
-{
- public:
- go_demon_portal() : GameObjectScript("go_demon_portal") { }
-
- bool OnGossipHello(Player* player, GameObject* go) override
- {
- if (player->GetQuestStatus(QUEST_PORTAL_OF_THE_LEGION) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_GUARDIAN, 5.0f, true))
- {
- if (Creature* guardian = player->SummonCreature(NPC_DEMON_GUARDIAN, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0))
- guardian->AI()->AttackStart(player);
- }
-
- return true;
- }
-};
-
void AddSC_desolace()
{
new npc_aged_dying_ancient_kodo();
new go_iruxos();
new npc_dalinda();
- new go_demon_portal();
}
diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp
index 05caf9cca3a..62a041e7798 100644
--- a/src/server/scripts/Kalimdor/zone_durotar.cpp
+++ b/src/server/scripts/Kalimdor/zone_durotar.cpp
@@ -483,8 +483,8 @@ class spell_mount_check : public SpellScriptLoader
else if (!owner->IsMounted() && target->IsMounted())
target->Dismount();
- target->SetSpeed(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
- target->SetSpeed(MOVE_WALK, owner->GetSpeedRate(MOVE_WALK));
+ target->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
+ target->SetSpeedRate(MOVE_WALK, owner->GetSpeedRate(MOVE_WALK));
}
void Register() override
diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
index 9df9f0b604a..be49778ee4a 100644
--- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
+++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
@@ -24,7 +24,6 @@ SDCategory: Dustwallow Marsh
EndScriptData */
/* ContentData
-npc_lady_jaina_proudmoore
npc_nat_pagle
npc_private_hendel
npc_cassa_crimsonwing - handled by npc_taxi
@@ -39,49 +38,6 @@ EndContentData */
#include "WorldSession.h"
/*######
-## npc_lady_jaina_proudmoore
-######*/
-
-enum LadyJaina
-{
- QUEST_JAINAS_AUTOGRAPH = 558,
- SPELL_JAINAS_AUTOGRAPH = 23122
-};
-
-#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph."
-
-class npc_lady_jaina_proudmoore : public CreatureScript
-{
-public:
- npc_lady_jaina_proudmoore() : CreatureScript("npc_lady_jaina_proudmoore") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_SENDER_INFO)
- {
- player->SEND_GOSSIP_MENU(7012, creature->GetGUID());
- player->CastSpell(player, SPELL_JAINAS_AUTOGRAPH, false);
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
## npc_nat_pagle
######*/
@@ -417,7 +373,6 @@ class spell_energize_aoe : public SpellScriptLoader
void AddSC_dustwallow_marsh()
{
- new npc_lady_jaina_proudmoore();
new npc_nat_pagle();
new npc_private_hendel();
new npc_zelfrax();
diff --git a/src/server/scripts/Kalimdor/zone_felwood.cpp b/src/server/scripts/Kalimdor/zone_felwood.cpp
index bce9d62105c..2b42db4b697 100644
--- a/src/server/scripts/Kalimdor/zone_felwood.cpp
+++ b/src/server/scripts/Kalimdor/zone_felwood.cpp
@@ -19,12 +19,12 @@
/* ScriptData
SDName: Felwood
SD%Complete: 95
-SDComment: Quest support: 4101, 4102
+SDComment: Quest support: 7632
SDCategory: Felwood
EndScriptData */
/* ContentData
-npcs_riverbreeze_and_silversky
+at_ancient_leaf
EndContentData */
#include "ScriptMgr.h"
@@ -33,74 +33,6 @@ EndContentData */
#include "Player.h"
/*######
-## npcs_riverbreeze_and_silversky
-######*/
-
-#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon"
-
-enum RiverbreezeAndSilversky
-{
- SPELL_CENARION_BEACON = 15120,
-
- NPC_ARATHANDRIS_SILVERSKY = 9528,
- NPC_MAYBESS_RIVERBREEZE = 9529,
-
- QUEST_CLEASING_FELWOOD_A = 4101,
- QUEST_CLEASING_FELWOOD_H = 4102
-};
-
-class npcs_riverbreeze_and_silversky : public CreatureScript
-{
-public:
- npcs_riverbreeze_and_silversky() : CreatureScript("npcs_riverbreeze_and_silversky") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, SPELL_CENARION_BEACON, false);
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- uint32 creatureId = creature->GetEntry();
-
- if (creatureId == NPC_ARATHANDRIS_SILVERSKY)
- {
- if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_A))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(2848, creature->GetGUID());
- } else if (player->GetTeam() == HORDE)
- player->SEND_GOSSIP_MENU(2845, creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(2844, creature->GetGUID());
- }
-
- if (creatureId == NPC_MAYBESS_RIVERBREEZE)
- {
- if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_H))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(2849, creature->GetGUID());
- } else if (player->GetTeam() == ALLIANCE)
- player->SEND_GOSSIP_MENU(2843, creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(2842, creature->GetGUID());
- }
-
- return true;
- }
-};
-
-/*######
## at_ancient_leaf
######*/
@@ -138,6 +70,5 @@ class at_ancient_leaf : public AreaTriggerScript
void AddSC_felwood()
{
- new npcs_riverbreeze_and_silversky();
new at_ancient_leaf();
}
diff --git a/src/server/scripts/Kalimdor/zone_feralas.cpp b/src/server/scripts/Kalimdor/zone_feralas.cpp
index 3e67a95b503..3c6ab633f66 100644
--- a/src/server/scripts/Kalimdor/zone_feralas.cpp
+++ b/src/server/scripts/Kalimdor/zone_feralas.cpp
@@ -19,10 +19,15 @@
/* ScriptData
SDName: Feralas
SD%Complete: 100
-SDComment: Quest support: 2767, Special vendor Gregan Brewspewer
+SDComment: Quest support: 2767, 2987
SDCategory: Feralas
EndScriptData */
+/* ContentData
+npc_oox22fe
+spell_gordunni_trap
+EndContentData */
+
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
@@ -32,44 +37,6 @@ EndScriptData */
#include "WorldSession.h"
/*######
-## npc_gregan_brewspewer
-######*/
-
-#define GOSSIP_HELLO "Buy somethin', will ya?"
-
-class npc_gregan_brewspewer : public CreatureScript
-{
-public:
- npc_gregan_brewspewer() : CreatureScript("npc_gregan_brewspewer") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(2434, creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_TRADE)
- player->GetSession()->SendListInventory(creature->GetGUID());
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (creature->IsVendor() && player->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(2433, creature->GetGUID());
- return true;
- }
-
-};
-
-/*######
## npc_oox22fe
######*/
@@ -183,6 +150,10 @@ public:
};
+/*######
+## spell_gordunni_trap
+######*/
+
enum GordunniTrap
{
GO_GORDUNNI_DIRT_MOUND = 144064,
@@ -199,12 +170,12 @@ class spell_gordunni_trap : public SpellScriptLoader
void HandleDummy()
{
- if (Unit* caster = GetCaster())
- if (GameObject* chest = caster->SummonGameObject(GO_GORDUNNI_DIRT_MOUND, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
- {
- chest->SetSpellId(GetSpellInfo()->Id);
- caster->RemoveGameObject(chest, false);
- }
+ Unit* caster = GetCaster();
+ if (GameObject* chest = caster->SummonGameObject(GO_GORDUNNI_DIRT_MOUND, *caster, G3D::Quat(), 0))
+ {
+ chest->SetSpellId(GetSpellInfo()->Id);
+ caster->RemoveGameObject(chest, false);
+ }
}
void Register() override
@@ -225,7 +196,6 @@ class spell_gordunni_trap : public SpellScriptLoader
void AddSC_feralas()
{
- new npc_gregan_brewspewer();
new npc_oox22fe();
new spell_gordunni_trap();
}
diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp
index 99a209b5f0a..531c657e1cb 100644
--- a/src/server/scripts/Kalimdor/zone_moonglade.cpp
+++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp
@@ -19,15 +19,14 @@
/* ScriptData
SDName: Moonglade
SD%Complete: 100
-SDComment: Quest support: 30, 272, 5929, 5930, 10965. Special Flight Paths for Druid class.
+SDComment: Quest support: 10965
SDCategory: Moonglade
EndScriptData */
/* ContentData
-npc_bunthen_plainswind
-npc_silva_filnaveth
npc_clintar_spirit
-npc_clintar_dreamwalker
+npc_omen
+npc_giant_spotlight
EndContentData */
#include "ScriptMgr.h"
@@ -42,128 +41,6 @@ EndContentData */
#include "CellImpl.h"
/*######
-## npc_bunthen_plainswind
-######*/
-
-enum Bunthen
-{
- QUEST_SEA_LION_HORDE = 30,
- QUEST_SEA_LION_ALLY = 272,
- TAXI_PATH_ID_ALLY = 315,
- TAXI_PATH_ID_HORDE = 316
-};
-
-#define GOSSIP_ITEM_THUNDER "I'd like to fly to Thunder Bluff."
-#define GOSSIP_ITEM_AQ_END "Do you know where I can find Half Pendant of Aquatic Endurance?"
-
-class npc_bunthen_plainswind : public CreatureScript
-{
-public:
- npc_bunthen_plainswind() : CreatureScript("npc_bunthen_plainswind") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->CLOSE_GOSSIP_MENU();
- if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE)
- player->ActivateTaxiPathTo(TAXI_PATH_ID_HORDE);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_GOSSIP_MENU(5373, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(5376, creature->GetGUID());
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (player->getClass() != CLASS_DRUID)
- player->SEND_GOSSIP_MENU(4916, creature->GetGUID());
- else if (player->GetTeam() != HORDE)
- {
- if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- player->SEND_GOSSIP_MENU(4917, creature->GetGUID());
- }
- else if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THUNDER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- player->SEND_GOSSIP_MENU(4918, creature->GetGUID());
- }
- return true;
- }
-
-};
-
-/*######
-## npc_silva_filnaveth
-######*/
-
-#define GOSSIP_ITEM_RUTHERAN "I'd like to fly to Rut'theran Village."
-#define GOSSIP_ITEM_AQ_AGI "Do you know where I can find Half Pendant of Aquatic Agility?"
-
-class npc_silva_filnaveth : public CreatureScript
-{
-public:
- npc_silva_filnaveth() : CreatureScript("npc_silva_filnaveth") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->CLOSE_GOSSIP_MENU();
- if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE)
- player->ActivateTaxiPathTo(TAXI_PATH_ID_ALLY);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_GOSSIP_MENU(5374, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(5375, creature->GetGUID());
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (player->getClass() != CLASS_DRUID)
- player->SEND_GOSSIP_MENU(4913, creature->GetGUID());
- else if (player->GetTeam() != ALLIANCE)
- {
- if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- player->SEND_GOSSIP_MENU(4915, creature->GetGUID());
- }
- else if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTHERAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- player->SEND_GOSSIP_MENU(4914, creature->GetGUID());
- }
- return true;
- }
-
-};
-
-/*######
## npc_clintar_spirit
######*/
@@ -652,8 +529,6 @@ public:
void AddSC_moonglade()
{
- new npc_bunthen_plainswind();
- new npc_silva_filnaveth();
new npc_clintar_spirit();
new npc_omen();
new npc_giant_spotlight();
diff --git a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
index ac26aa1f811..9c531c1f1be 100644
--- a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
+++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
@@ -32,6 +32,9 @@ EndContentData */
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Player.h"
+#include "Cell.h"
+#include "CellImpl.h"
+#include "GridNotifiers.h"
/*######
## npc_shenthul
@@ -143,20 +146,30 @@ public:
enum ThrallWarchief
{
- QUEST_6566 = 6566,
-
- SPELL_CHAIN_LIGHTNING = 16033,
- SPELL_SHOCK = 16034
+ GOSSIP_MENU_OPTION_ID_ALL = 0,
+
+ OPTION_PLEASE_SHARE_YOUR = 3664,
+ OPTION_WHAT_DISCOVERIES = 3665,
+ OPTION_USURPER = 3666,
+ OPTION_WITH_ALL_DUE_RESPECT = 3667,
+ OPTION_I_I_DID_NOT_THINK_OF = 3668,
+ OPTION_I_LIVE_ONLY_TO_SERVE = 3669,
+ OPTION_OF_COURSE_WARCHIEF = 3670,
+
+ GOSSIP_MEMBERS_OF_THE_HORDE = 4477,
+ GOSSIP_THE_SHATTERED_HAND = 5733,
+ GOSSIP_IT_WOULD_APPEAR_AS = 5734,
+ GOSSIP_THE_BROOD_MOTHER = 5735,
+ GOSSIP_SO_MUCH_TO_LEARN = 5736,
+ GOSSIP_I_DO_NOT_FAULT_YOU = 5737,
+ GOSSIP_NOW_PAY_ATTENTION = 5738,
+
+ QUEST_WHAT_THE_WIND_CARRIES = 6566,
+
+ SPELL_CHAIN_LIGHTNING = 16033,
+ SPELL_SHOCK = 16034
};
-#define GOSSIP_HTW "Please share your wisdom with me, Warchief."
-#define GOSSIP_STW1 "What discoveries?"
-#define GOSSIP_STW2 "Usurper?"
-#define GOSSIP_STW3 "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?"
-#define GOSSIP_STW4 "I... I did not think of it that way, Warchief."
-#define GOSSIP_STW5 "I live only to serve, Warchief! My life is empty and meaningless without your guidance."
-#define GOSSIP_STW6 "Of course, Warchief!"
-
/// @todo verify abilities/timers
class npc_thrall_warchief : public CreatureScript
{
@@ -169,32 +182,32 @@ public:
switch (action)
{
case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(5733, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(OPTION_WHAT_DISCOVERIES, GOSSIP_MENU_OPTION_ID_ALL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->SEND_GOSSIP_MENU(GOSSIP_THE_SHATTERED_HAND, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(5734, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(OPTION_USURPER, GOSSIP_MENU_OPTION_ID_ALL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->SEND_GOSSIP_MENU(GOSSIP_IT_WOULD_APPEAR_AS, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(5735, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(OPTION_WITH_ALL_DUE_RESPECT, GOSSIP_MENU_OPTION_ID_ALL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
+ player->SEND_GOSSIP_MENU(GOSSIP_THE_BROOD_MOTHER, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(5736, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(OPTION_I_I_DID_NOT_THINK_OF, GOSSIP_MENU_OPTION_ID_ALL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
+ player->SEND_GOSSIP_MENU(GOSSIP_SO_MUCH_TO_LEARN, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(5737, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(OPTION_I_LIVE_ONLY_TO_SERVE, GOSSIP_MENU_OPTION_ID_ALL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
+ player->SEND_GOSSIP_MENU(GOSSIP_I_DO_NOT_FAULT_YOU, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
- player->SEND_GOSSIP_MENU(5738, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(OPTION_OF_COURSE_WARCHIEF, GOSSIP_MENU_OPTION_ID_ALL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
+ player->SEND_GOSSIP_MENU(GOSSIP_NOW_PAY_ATTENTION, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+7:
player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(QUEST_6566);
+ player->AreaExploredOrEventHappens(QUEST_WHAT_THE_WIND_CARRIES);
break;
}
return true;
@@ -205,10 +218,10 @@ public:
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
- if (player->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ if (player->GetQuestStatus(QUEST_WHAT_THE_WIND_CARRIES) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM_DB(OPTION_PLEASE_SHARE_YOUR, GOSSIP_MENU_OPTION_ID_ALL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
+ player->SEND_GOSSIP_MENU(GOSSIP_MEMBERS_OF_THE_HORDE, creature->GetGUID());
return true;
}
@@ -263,8 +276,555 @@ public:
};
+/* --------- Herald of War ------------- */
+enum CitizenEntries
+{
+ NPC_GRYSHKA = 31433,
+ NPC_OLVIA = 31425,
+ NPC_SANA = 31429,
+ NPC_FELIKA = 31427,
+ NPC_THATHUNG = 31430,
+ NPC_KAJA = 31423
+};
+
+enum SceneEvents
+{
+ EVENT_SCENE_1 = 1,
+ EVENT_SCENE_2 = 2,
+ EVENT_SCENE_3 = 3,
+ EVENT_SCENE_4 = 4,
+ EVENT_SCENE_5 = 5,
+ EVENT_SCENE_6 = 6,
+ EVENT_SCENE_7 = 7,
+ EVENT_SCENE_8 = 8,
+ EVENT_SCENE_9 = 9,
+ EVENT_SCENE_10 = 10,
+ EVENT_SCENE_11 = 11,
+ EVENT_SCENE_12 = 12,
+ EVENT_SCENE_13 = 13,
+ EVENT_RESET = 14
+};
+
+enum CitizenTalk
+{
+ SAY_GRYSHKA_1 = 0, // When can we reopen our shops? I'm losing gold here!
+ SAY_GRYSHKA_2 = 1, // "This is an outrage!"
+ SAY_OLVIA_1 = 0, // Where is the Warchief?
+ SAY_OLVIA_2 = 1, // What are all these Forsaken doing here?
+ SAY_FELIKA_1 = 0, // What is going on?
+ SAY_FELIKA_2 = 1, // This is an outrage!
+ SAY_THATHUNG = 0, // What is going on?
+ SAY_KAJA = 0, // Why is Thrall allowing this to happen to our city?
+ SAY_SANA = 0, // We demand answers!
+ SAY_RUNTHAK_1 = 0, // SILENCE!
+ SAY_RUNTHAK_2 = 1, // We are on the brink of all out war with the Alliance!
+ SAY_RUNTHAK_3 = 2, // Tragic events have unfolded in Northrend. The Warchief is doing all that he can to keep us safe.
+ SAY_RUNTHAK_4 = 3 // All services and shops are to remain closed until further notice! That is all!
+};
+
+class npc_overlord_runthak_orgrimmar : public CreatureScript
+{
+public:
+ npc_overlord_runthak_orgrimmar() : CreatureScript("npc_overlord_runthak_orgrimmar") { }
+
+ struct npc_overlord_runthak_orgrimmarAI : public ScriptedAI
+ {
+ npc_overlord_runthak_orgrimmarAI(Creature* creature) : ScriptedAI(creature)
+ {
+ inProgress = false;
+ }
+
+ void Reset() override
+ {
+ inProgress = false;
+ me->GetMotionMaster()->MovePath(me->GetSpawnId() * 10, true);
+ events.Reset();
+ }
+
+ void MoveInLineOfSight(Unit* who) override
+ {
+ if (who->GetTypeId() == TYPEID_PLAYER && who->IsWithinDist(me, 20.0f) && !inProgress)
+ {
+ inProgress = true;
+ events.ScheduleEvent(EVENT_SCENE_1, 2000);
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ events.Update(diff);
+
+ while (uint32 eventID = events.ExecuteEvent())
+ {
+ switch (eventID)
+ {
+ case EVENT_SCENE_1:
+ GetCitizenGuids();
+ me->GetMotionMaster()->MoveIdle();
+ if (Creature* gryshka = ObjectAccessor::GetCreature(*me, gryshkaGUID))
+ {
+ me->SetFacingTo(me->GetAngle(gryshka->GetPositionX(), gryshka->GetPositionY()));
+ gryshka->AI()->Talk(SAY_GRYSHKA_1);
+ }
+ events.ScheduleEvent(EVENT_SCENE_2, 4500);
+ break;
+ case EVENT_SCENE_2:
+ if (Creature* olvia = ObjectAccessor::GetCreature(*me, olviaGUID))
+ olvia->AI()->Talk(SAY_OLVIA_1);
+ events.ScheduleEvent(EVENT_SCENE_3, 4500);
+ break;
+ case EVENT_SCENE_3:
+ if (Creature* felika = ObjectAccessor::GetCreature(*me, felikaGUID))
+ felika->AI()->Talk(SAY_FELIKA_1);
+ events.ScheduleEvent(EVENT_SCENE_4, 4500);
+ break;
+ case EVENT_SCENE_4:
+ if (Creature* thathung = ObjectAccessor::GetCreature(*me, thungGUID))
+ thathung->AI()->Talk(SAY_THATHUNG);
+ events.ScheduleEvent(EVENT_SCENE_5, 4500);
+ break;
+ case EVENT_SCENE_5:
+ if (Creature* sana = ObjectAccessor::GetCreature(*me, sanaGUID))
+ sana->AI()->Talk(SAY_SANA);
+ events.ScheduleEvent(EVENT_SCENE_6, 4500);
+ break;
+ case EVENT_SCENE_6:
+ if (Creature* gryshka = ObjectAccessor::GetCreature(*me, gryshkaGUID))
+ gryshka->AI()->Talk(SAY_GRYSHKA_2);
+ events.ScheduleEvent(EVENT_SCENE_7, 4500);
+ break;
+ case EVENT_SCENE_7:
+ if (Creature* kaja = ObjectAccessor::GetCreature(*me, kajaGUID))
+ kaja->AI()->Talk(SAY_KAJA);
+ events.ScheduleEvent(EVENT_SCENE_8, 4500);
+ break;
+ case EVENT_SCENE_8:
+ if (Creature* felika = ObjectAccessor::GetCreature(*me, felikaGUID))
+ felika->AI()->Talk(SAY_FELIKA_2);
+ events.ScheduleEvent(EVENT_SCENE_9, 4500);
+ break;
+ case EVENT_SCENE_9:
+ if (Creature* olvia = ObjectAccessor::GetCreature(*me, olviaGUID))
+ olvia->AI()->Talk(SAY_OLVIA_2);
+ events.ScheduleEvent(EVENT_SCENE_10, 4500);
+ break;
+ case EVENT_SCENE_10:
+ Talk(SAY_RUNTHAK_1);
+ events.ScheduleEvent(EVENT_SCENE_11, 1500);
+ break;
+ case EVENT_SCENE_11:
+ Talk(SAY_RUNTHAK_2);
+ events.ScheduleEvent(EVENT_SCENE_12, 4500);
+ break;
+ case EVENT_SCENE_12:
+ Talk(SAY_RUNTHAK_3);
+ events.ScheduleEvent(EVENT_SCENE_13, 4500);
+ break;
+ case EVENT_SCENE_13:
+ Talk(SAY_RUNTHAK_4);
+ events.ScheduleEvent(EVENT_RESET, 25000);
+ break;
+ case EVENT_RESET:
+ Reset();
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ void GetCitizenGuids()
+ {
+ // if one GUID is empty it means all the others are empty as well so we should store them
+ // otherwise do not call for grid search since someone else already activated event once before and guids are stored
+ if (gryshkaGUID.IsEmpty())
+ {
+ std::list<Unit*> citizenList;
+ Trinity::AnyFriendlyUnitInObjectRangeCheck checker(me, me, 25.0f);
+ Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(me, citizenList, checker);
+ me->VisitNearbyObject(20.0f, searcher);
+ for (Unit* target : citizenList)
+ {
+ switch (target->GetEntry())
+ {
+ case NPC_GRYSHKA:
+ gryshkaGUID = target->GetGUID();
+ break;
+ case NPC_OLVIA:
+ olviaGUID = target->GetGUID();
+ break;
+ case NPC_SANA:
+ sanaGUID = target->GetGUID();
+ break;
+ case NPC_FELIKA:
+ felikaGUID = target->GetGUID();
+ break;
+ case NPC_THATHUNG:
+ thungGUID = target->GetGUID();
+ break;
+ case NPC_KAJA:
+ kajaGUID = target->GetGUID();
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+ private:
+ EventMap events;
+ bool inProgress;
+ ObjectGuid gryshkaGUID;
+ ObjectGuid olviaGUID;
+ ObjectGuid sanaGUID;
+ ObjectGuid felikaGUID;
+ ObjectGuid thungGUID;
+ ObjectGuid kajaGUID;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new npc_overlord_runthak_orgrimmarAI(creature);
+ }
+};
+
+// Phased out thrall during herald of war chain quest
+enum HeraldEntries
+{
+ NPC_PORTAL_STORMWIND = 31640,
+ NPC_JAINA_PROUDMOORE = 31418,
+ NPC_BANSHEE_SYLVANAS = 31419,
+ NPC_KORKRON_GUARD = 31417,
+ NPC_THRALL_HERALD = 31412,
+
+ GO_PORTAL_UNDERCITY = 193425
+};
+
+enum HeraldMisc
+{
+ QUEST_HERALD_OF_WAR = 13257,
+ GUARDS_SIZE = 4
+};
+
+enum HeraldActions
+{
+ ACTION_START_SCENE = 0
+};
+
+enum HeraldSpell
+{
+ SPELL_JAINA_SPAWNIN = 55761
+};
+
+enum HeraldTalk
+{
+ SAY_THRALL_0 = 0, // Kor'kron, stand down!
+ SAY_THRALL_1 = 1, // Jaina...
+ SAY_THRALL_2 = 2, // Jaina, what happened at the Wrathgate. It was a betrayal from within...
+ SAY_THRALL_3 = 3, // The Horde has lost the Undercity.
+ SAY_THRALL_4 = 4, // We now prepare to lay siege to the city and bring the perpetrators of this unforgivable crime to justice.
+ SAY_THRALL_5 = 5, // If we are forced into a conflict, the Lich King will destroy our divided forces in Northrend.
+ SAY_THRALL_6 = 6, // We will make this right, Jaina. Tell your king all that you have learned here.
+ SAY_THRALL_7 = 7, // Kor'kron, prepare transport to the Undercity.
+
+ SAY_SYLVANAS_0 = 0, // Lady Proudmoore, the Warchief speaks the truth. This subterfuge was set in motion by Varimathras and Grand Apothecary Putress. It was not the Horde's doing.
+ SAY_SYLVANAS_1 = 1, // As the combined Horde and Alliance forces began their assault upon the Wrath Gate, an uprising broke out in the Undercity. Varimathras and hordes of his demonic brethren attacked. Hundreds of my people were slain in the coup. I barely managed to escape with my life.
+
+ SAY_JAINA_0 = 0, // Thrall, what has happened? The King is preparing for war...
+ SAY_JAINA_1 = 1, // I will deliver this information to King Wrynn, Thrall, but...
+ SAY_JAINA_2 = 2, // Bolvar was like a brother to him. In the King's absence, Bolvar kept the Alliance united. He found strength for our people in our darkest hours. He watched over Anduin, raising him as his own.
+ SAY_JAINA_3 = 3, // I fear that the rage will consume him, Thrall. I remain hopeful that reason will prevail, but we must prepare for the worst... for war.
+ SAY_JAINA_4 = 4 // Farewell, Warchief. I pray that the next time we meet it will be as allies.
+};
+
+enum HeraldEvents
+{
+ EVENT_HERALD_SCENE1 = 1,
+ EVENT_HERALD_SCENE2 = 2,
+ EVENT_HERALD_SCENE3 = 3,
+ EVENT_HERALD_SCENE4 = 4,
+ EVENT_HERALD_SCENE5 = 5,
+ EVENT_HERALD_SCENE6 = 6,
+ EVENT_HERALD_SCENE7 = 7,
+ EVENT_HERALD_SCENE8 = 8,
+ EVENT_HERALD_SCENE9 = 9,
+ EVENT_HERALD_SCENE10 = 10,
+ EVENT_HERALD_SCENE11 = 11,
+ EVENT_HERALD_SCENE12 = 12,
+ EVENT_HERALD_SCENE13 = 13,
+ EVENT_HERALD_SCENE14 = 14,
+ EVENT_HERALD_SCENE15 = 15,
+ EVENT_HERALD_RESET = 16
+};
+
+Position const GuardsSpawnPosition[GUARDS_SIZE] =
+{
+ { 1909.39f, -4144.21f, 40.6368f, 0.042239f },
+ { 1910.73f, -4155.26f, 40.6316f, 0.615577f },
+ { 1934.01f, -4141.40f, 40.6375f, 3.61109f },
+ { 1931.11f, -4156.38f, 40.6130f, 2.19737f }
+};
+
+Position const GuardsMovePosition[GUARDS_SIZE] =
+{
+ { 1917.461670f, -4147.514160f, 40.636799f, 5.89346f },
+ { 1916.181274f, -4152.295898f, 40.629120f, 0.497757f },
+ { 1926.435425f, -4146.397461f, 40.618534f, 3.846709f },
+ { 1926.519165f, -4153.216797f, 40.614975f, 2.570434f }
+};
+
+Position const MiscMovePositions[3] =
+{
+ { 1921.719604f, -4143.051270f, 40.623356f, 1.657789f }, // jaina move
+ { 1921.151855f, -4139.343750f, 40.583084f, 4.732627f }, // thrall move
+ { 1918.732422f, -4139.619629f, 40.607685f, 4.803311f } // sylvanas move
+};
+
+Position const PortalSpawnPosition = { 1921.752441f, -4151.148438f, 40.623848f, 1.714324f };
+
+class npc_thrall_herald_of_war : public CreatureScript
+{
+public:
+ npc_thrall_herald_of_war() : CreatureScript("npc_thrall_herald_of_war") { }
+
+ struct npc_thrall_herald_of_warAI : public ScriptedAI
+ {
+ npc_thrall_herald_of_warAI(Creature* creature) : ScriptedAI(creature)
+ {
+ spawnedGuards = false;
+ sceneInProgress = false;
+ }
+
+ void Reset() override
+ {
+ events.Reset();
+ me->GetMotionMaster()->MovePath(me->GetSpawnId() * 10, true);
+ sceneInProgress = false;
+
+ if (!spawnedGuards)
+ {
+ spawnedGuards = true;
+ for (uint8 i = 0; i < GUARDS_SIZE; i++)
+ {
+ if (Creature* korkronGuard = me->SummonCreature(NPC_KORKRON_GUARD, GuardsSpawnPosition[i]))
+ guardsGUIDs[i] = korkronGuard->GetGUID();
+ }
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 pointId) override
+ {
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (pointId == 2)
+ me->GetMotionMaster()->MovePath(me->GetSpawnId() * 10, true);
+ }
+
+ void DoAction(int32 actionId) override
+ {
+ if (actionId == ACTION_START_SCENE && !sceneInProgress)
+ {
+ me->GetMotionMaster()->MoveIdle();
+ sceneInProgress = true;
+
+ if (Creature* jaina = me->SummonCreature(NPC_JAINA_PROUDMOORE, PortalSpawnPosition))
+ {
+ me->SetFacingTo(me->GetAngle(jaina->GetPositionX(), jaina->GetPositionY()));
+ jainaGUID = jaina->GetGUID();
+ jaina->CastSpell(jaina, SPELL_JAINA_SPAWNIN);
+ }
+
+ if (Creature* stormwindPortal = me->SummonCreature(NPC_PORTAL_STORMWIND, PortalSpawnPosition))
+ {
+ stormwindPortal->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ stormwindPortalGUID = stormwindPortal->GetGUID();
+ }
+
+ for (uint8 i = 0; i < GUARDS_SIZE; i++)
+ {
+ if (Creature* guards = ObjectAccessor::GetCreature(*me, guardsGUIDs[i]))
+ {
+ guards->SetWalk(false);
+ guards->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
+ guards->GetMotionMaster()->MovePoint(1, GuardsMovePosition[i]);
+ }
+ }
+
+ if (Creature* sylvanas = me->FindNearestCreature(NPC_BANSHEE_SYLVANAS, 25.0f))
+ sylvanasGUID = sylvanas->GetGUID();
+
+ events.ScheduleEvent(EVENT_HERALD_SCENE1, 4000);
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ events.Update(diff);
+
+ while (uint32 eventID = events.ExecuteEvent())
+ {
+ switch (eventID)
+ {
+ case EVENT_HERALD_SCENE1:
+ Talk(SAY_THRALL_0);
+ me->GetMotionMaster()->MovePoint(1, MiscMovePositions[1]);
+ if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID))
+ {
+ jaina->SetWalk(true);
+ jaina->GetMotionMaster()->MovePoint(1, MiscMovePositions[0]);
+ }
+
+ for (uint8 i = 0; i < GUARDS_SIZE; i++)
+ {
+ if (Creature* guard = ObjectAccessor::GetCreature(*me, guardsGUIDs[i]))
+ {
+ guard->GetMotionMaster()->MoveTargetedHome();
+ guard->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
+ }
+ }
+ events.ScheduleEvent(EVENT_HERALD_SCENE2, 3000);
+ break;
+ case EVENT_HERALD_SCENE2:
+ Talk(SAY_THRALL_1);
+ if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID))
+ me->SetFacingTo(me->GetAngle(jaina->GetPositionX(), jaina->GetPositionY()));
+ events.ScheduleEvent(EVENT_HERALD_SCENE3, 3500);
+ break;
+ case EVENT_HERALD_SCENE3:
+ if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID))
+ jaina->AI()->Talk(SAY_JAINA_0);
+ events.ScheduleEvent(EVENT_HERALD_SCENE4, 5500);
+ break;
+ case EVENT_HERALD_SCENE4:
+ Talk(SAY_THRALL_2);
+ if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasGUID))
+ {
+ sylvanas->SetStandState(UNIT_STAND_STATE_STAND);
+ sylvanas->SetWalk(true);
+ sylvanas->GetMotionMaster()->MovePoint(1, MiscMovePositions[2]);
+ }
+ events.ScheduleEvent(EVENT_HERALD_SCENE5, 6500);
+ break;
+ case EVENT_HERALD_SCENE5:
+ if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasGUID))
+ sylvanas->AI()->Talk(SAY_SYLVANAS_0);
+ events.ScheduleEvent(EVENT_HERALD_SCENE6, 10000);
+ break;
+ case EVENT_HERALD_SCENE6:
+ if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasGUID))
+ sylvanas->AI()->Talk(SAY_SYLVANAS_1);
+ events.ScheduleEvent(EVENT_HERALD_SCENE7, 20000);
+ break;
+ case EVENT_HERALD_SCENE7:
+ Talk(SAY_THRALL_3);
+ events.ScheduleEvent(EVENT_HERALD_SCENE8, 4500);
+ break;
+ case EVENT_HERALD_SCENE8:
+ Talk(SAY_THRALL_4);
+ events.ScheduleEvent(EVENT_HERALD_SCENE9, 10000);
+ break;
+ case EVENT_HERALD_SCENE9:
+ Talk(SAY_THRALL_5);
+ events.ScheduleEvent(EVENT_HERALD_SCENE10, 8000);
+ break;
+ case EVENT_HERALD_SCENE10:
+ Talk(SAY_THRALL_6);
+ events.ScheduleEvent(EVENT_HERALD_SCENE11, 9000);
+ break;
+ case EVENT_HERALD_SCENE11:
+ if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID))
+ jaina->AI()->Talk(SAY_JAINA_1);
+ events.ScheduleEvent(EVENT_HERALD_SCENE12, 6000);
+ break;
+ case EVENT_HERALD_SCENE12:
+ if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID))
+ jaina->AI()->Talk(SAY_JAINA_2);
+ events.ScheduleEvent(EVENT_HERALD_SCENE13, 14000);
+ break;
+ case EVENT_HERALD_SCENE13:
+ if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID))
+ jaina->AI()->Talk(SAY_JAINA_3);
+ events.ScheduleEvent(EVENT_HERALD_SCENE14, 10000);
+ break;
+ case EVENT_HERALD_SCENE14:
+ if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID))
+ {
+ jaina->AI()->Talk(SAY_JAINA_4);
+ jaina->SetWalk(true);
+ jaina->GetMotionMaster()->MovePoint(2, jaina->GetHomePosition());
+ jaina->DespawnOrUnsummon(5000);
+ }
+ events.ScheduleEvent(EVENT_HERALD_SCENE15, 7000);
+ break;
+ case EVENT_HERALD_SCENE15:
+ {
+ me->SetWalk(true);
+ me->GetMotionMaster()->MovePoint(2, me->GetHomePosition());
+ Talk(SAY_THRALL_7);
+
+ if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasGUID))
+ {
+ sylvanas->SetWalk(true);
+ sylvanas->GetMotionMaster()->MovePoint(2, sylvanas->GetHomePosition());
+ }
+
+ if (Creature* portal = ObjectAccessor::GetCreature(*me, stormwindPortalGUID))
+ portal->DespawnOrUnsummon();
+
+ events.ScheduleEvent(EVENT_HERALD_RESET, 60000);
+ break;
+ }
+ case EVENT_HERALD_RESET:
+ Reset();
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ private:
+ EventMap events;
+ ObjectGuid guardsGUIDs[GUARDS_SIZE];
+ ObjectGuid jainaGUID;
+ ObjectGuid sylvanasGUID;
+ ObjectGuid stormwindPortalGUID;
+ bool spawnedGuards;
+ bool sceneInProgress;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new npc_thrall_herald_of_warAI(creature);
+ }
+};
+
+class areatrigger_orgrimmar_herald_of_war : public AreaTriggerScript
+{
+public:
+ areatrigger_orgrimmar_herald_of_war() : AreaTriggerScript("areatrigger_orgrimmar_herald_of_war") { }
+
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) override
+ {
+ if (player->IsAlive() && player->GetQuestStatus(QUEST_HERALD_OF_WAR) == QUEST_STATUS_COMPLETE)
+ {
+ if (Creature* thrall = player->FindNearestCreature(NPC_THRALL_HERALD, 50.0f))
+ {
+ thrall->AI()->DoAction(ACTION_START_SCENE);
+ return true;
+ }
+ }
+ return false;
+ }
+};
+
void AddSC_orgrimmar()
{
new npc_shenthul();
new npc_thrall_warchief();
+ new npc_overlord_runthak_orgrimmar();
+ new npc_thrall_herald_of_war();
+ new areatrigger_orgrimmar_herald_of_war();
}
diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp
index cc285ab991e..db7bd62c5d1 100644
--- a/src/server/scripts/Kalimdor/zone_silithus.cpp
+++ b/src/server/scripts/Kalimdor/zone_silithus.cpp
@@ -19,13 +19,20 @@
/* ScriptData
SDName: Silithus
SD%Complete: 100
-SDComment: Quest support: 8304, 8507.
+SDComment: Quest support: 8348,8352,8361,8519
SDCategory: Silithus
EndScriptData */
/* ContentData
-npcs_rutgar_and_frankal
-quest_a_pawn_on_the_eternal_pawn
+A Pawn on the Eternal Board - creatures, gameobjects and defines
+quest_a_pawn_on_the_eternal_board
+npc_qiraj_war_spawn : Adds that are summoned in the Qiraj gates battle.
+npc_anachronos_the_ancient : Creature that controls the event.
+npc_anachronos_quest_trigger: controls the spawning of the BG War mobs.
+go_crystalline_tear : GameObject that begins the event and hands out quest
+TO DO: get correct spell IDs and timings for spells cast upon dragon transformations
+TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation,
+ but for some unknown reason it doesn't work.
EndContentData */
#include "ScriptMgr.h"
@@ -34,195 +41,66 @@ EndContentData */
#include "Group.h"
#include "Player.h"
-/*###
-## npcs_rutgar_and_frankal
-###*/
-
-//gossip item text best guess
-#define GOSSIP_ITEM1 "I seek information about Natalia"
-
-#define GOSSIP_ITEM2 "That sounds dangerous!"
-#define GOSSIP_ITEM3 "What did you do?"
-#define GOSSIP_ITEM4 "Who?"
-#define GOSSIP_ITEM5 "Women do that. What did she demand?"
-#define GOSSIP_ITEM6 "What do you mean?"
-#define GOSSIP_ITEM7 "What happened next?"
-
-#define GOSSIP_ITEM11 "Yes, please continue"
-#define GOSSIP_ITEM12 "What language?"
-#define GOSSIP_ITEM13 "The Priestess attacked you?!"
-#define GOSSIP_ITEM14 "I should ask the monkey about this"
-#define GOSSIP_ITEM15 "Then what..."
-
-enum RutgarAndFrankal //trigger creatures to kill
-{
- TRIGGER_FRANKAL = 15221,
- TRIGGER_RUTGAR = 15222
-};
-
-class npcs_rutgar_and_frankal : public CreatureScript
-{
-public:
- npcs_rutgar_and_frankal() : CreatureScript("npcs_rutgar_and_frankal") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(7755, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(7756, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(7757, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(7758, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(7759, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(7760, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- player->SEND_GOSSIP_MENU(7761, creature->GetGUID());
- //'kill' our trigger to update quest status
- player->KilledMonsterCredit(TRIGGER_RUTGAR);
- break;
-
- case GOSSIP_ACTION_INFO_DEF + 9:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(7762, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 10:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(7763, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 11:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(7764, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 12:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(7765, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 13:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
- player->SEND_GOSSIP_MENU(7766, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 14:
- player->SEND_GOSSIP_MENU(7767, creature->GetGUID());
- //'kill' our trigger to update quest status
- player->KilledMonsterCredit(TRIGGER_FRANKAL);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE &&
- creature->GetEntry() == 15170 &&
- !player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE &&
- creature->GetEntry() == 15171 &&
- player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
-
- player->SEND_GOSSIP_MENU(7754, creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*####
-# quest_a_pawn_on_the_eternal_board (Defines)
-####*/
-enum EternalBoard
-{
- QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519,
-
- FACTION_HOSTILE = 14,
- FACTION_FRIENDLY = 35,
-
- C_ANACHRONOS = 15381,
- C_FANDRAL_STAGHELM = 15382,
- C_ARYGOS = 15380,
- C_MERITHRA = 15378,
- C_CAELESTRASZ = 15379,
-
- ANACHRONOS_SAY_1 = 0,
- ANACHRONOS_SAY_2 = 1,
- ANACHRONOS_SAY_3 = 2,
- ANACHRONOS_SAY_4 = 3,
- ANACHRONOS_SAY_5 = 4,
- ANACHRONOS_SAY_6 = 5,
- ANACHRONOS_SAY_7 = 6,
- ANACHRONOS_SAY_8 = 7,
- ANACHRONOS_SAY_9 = 8,
- ANACHRONOS_SAY_10 = 9,
- ANACHRONOS_EMOTE_1 = 10,
- ANACHRONOS_EMOTE_2 = 11,
- ANACHRONOS_EMOTE_3 = 12,
-
- FANDRAL_SAY_1 = 0,
- FANDRAL_SAY_2 = 1,
- FANDRAL_SAY_3 = 2,
- FANDRAL_SAY_4 = 3,
- FANDRAL_SAY_5 = 4,
- FANDRAL_SAY_6 = 5,
- FANDRAL_EMOTE_1 = 6,
- FANDRAL_EMOTE_2 = 7,
-
- CAELESTRASZ_SAY_1 = 0,
- CAELESTRASZ_SAY_2 = 1,
- CAELESTRASZ_YELL_1 = 2,
-
- ARYGOS_SAY_1 = 0,
- ARYGOS_YELL_1 = 1,
- ARYGOS_EMOTE_1 = 2,
-
- MERITHRA_SAY_1 = 0,
- MERITHRA_SAY_2 = 1,
- MERITHRA_YELL_1 = 2,
- MERITHRA_EMOTE_1 = 3,
-
- GO_GATE_OF_AHN_QIRAJ = 176146,
- GO_GLYPH_OF_AHN_QIRAJ = 176148,
- GO_ROOTS_OF_AHN_QIRAJ = 176147
-};
/*#####
# Quest: A Pawn on the Eternal Board
#####*/
-/* ContentData
-A Pawn on the Eternal Board - creatures, gameobjects and defines
-npc_qiraj_war_spawn : Adds that are summoned in the Qiraj gates battle.
-npc_anachronos_the_ancient : Creature that controls the event.
-npc_anachronos_quest_trigger: controls the spawning of the BG War mobs.
-go_crystalline_tear : GameObject that begins the event and hands out quest
-TO DO: get correct spell IDs and timings for spells cast upon dragon transformations
-TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work.
-EndContentData */
-
-#define EVENT_AREA_RADIUS 65 //65yds
-#define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time)
+enum EternalBoard
+{
+ QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519,
+
+ FACTION_HOSTILE = 14,
+ FACTION_FRIENDLY = 35,
+
+ EVENT_AREA_RADIUS = 65, // 65yds
+ EVENT_COOLDOWN = 500000, // in ms. appears after event completed or failed (should be = Adds despawn time)
+
+ NPC_ANACHRONOS = 15381,
+ NPC_FANDRAL_STAGHELM = 15382,
+ NPC_ARYGOS = 15380,
+ NPC_MERITHRA_OF_THE_DREAM = 15378,
+ NPC_CAELESTRASZ = 15379,
+
+ ANACHRONOS_SAY_1 = 0,
+ ANACHRONOS_SAY_2 = 1,
+ ANACHRONOS_SAY_3 = 2,
+ ANACHRONOS_SAY_4 = 3,
+ ANACHRONOS_SAY_5 = 4,
+ ANACHRONOS_SAY_6 = 5,
+ ANACHRONOS_SAY_7 = 6,
+ ANACHRONOS_SAY_8 = 7,
+ ANACHRONOS_SAY_9 = 8,
+ ANACHRONOS_SAY_10 = 9,
+ ANACHRONOS_EMOTE_1 = 10,
+ ANACHRONOS_EMOTE_2 = 11,
+ ANACHRONOS_EMOTE_3 = 12,
+
+ FANDRAL_SAY_1 = 0,
+ FANDRAL_SAY_2 = 1,
+ FANDRAL_SAY_3 = 2,
+ FANDRAL_SAY_4 = 3,
+ FANDRAL_SAY_5 = 4,
+ FANDRAL_SAY_6 = 5,
+ FANDRAL_EMOTE_1 = 6,
+ FANDRAL_EMOTE_2 = 7,
+
+ CAELESTRASZ_SAY_1 = 0,
+ CAELESTRASZ_SAY_2 = 1,
+ CAELESTRASZ_YELL_1 = 2,
+
+ ARYGOS_SAY_1 = 0,
+ ARYGOS_YELL_1 = 1,
+ ARYGOS_EMOTE_1 = 2,
+
+ MERITHRA_SAY_1 = 0,
+ MERITHRA_SAY_2 = 1,
+ MERITHRA_YELL_1 = 2,
+ MERITHRA_EMOTE_1 = 3,
+
+ GO_GATE_OF_AHN_QIRAJ = 176146,
+ GO_GLYPH_OF_AHN_QIRAJ = 176148,
+ GO_ROOTS_OF_AHN_QIRAJ = 176147
+};
struct QuestCinematic
{
@@ -233,59 +111,59 @@ struct QuestCinematic
// Creature 0 - Anachronos, 1 - Fandral, 2 - Arygos, 3 - Merithra, 4 - Caelestrasz
static QuestCinematic EventAnim[]=
{
- {ANACHRONOS_SAY_1, 0, 2000},
- {FANDRAL_SAY_1, 1, 4000},
- {MERITHRA_EMOTE_1, 3, 500},
- {MERITHRA_SAY_1, 3, 500},
- {ARYGOS_EMOTE_1, 2, 2000},
+ {ANACHRONOS_SAY_1, 0, 2000},
+ {FANDRAL_SAY_1, 1, 4000},
+ {MERITHRA_EMOTE_1, 3, 500},
+ {MERITHRA_SAY_1, 3, 500},
+ {ARYGOS_EMOTE_1, 2, 2000},
{CAELESTRASZ_SAY_1, 4, 8000},
- {MERITHRA_SAY_2, 3, 6000},
+ {MERITHRA_SAY_2, 3, 6000},
{0, 3, 2000},
- {MERITHRA_YELL_1, 3, 2500},
- {0, 3, 3000}, //Morph
- {0, 3, 4000}, //EmoteLiftoff
- {0, 3, 4000}, // spell
- {0, 3, 1250}, //fly
- {0, 3, 250}, //remove flags
+ {MERITHRA_YELL_1, 3, 2500},
+ {0, 3, 3000}, //Morph
+ {0, 3, 4000}, //EmoteLiftoff
+ {0, 3, 4000}, // spell
+ {0, 3, 1250}, //fly
+ {0, 3, 250}, //remove flags
{ARYGOS_SAY_1, 2, 3000},
{0, 3, 2000},
{ARYGOS_YELL_1, 2, 3000},
- {0, 3, 3000}, //Morph
- {0, 3, 4000}, //EmoteLiftoff
- {0, 3, 4000}, // spell
- {0, 3, 1000}, //fly
- {0, 3, 1000}, //remove flags
+ {0, 3, 3000}, //Morph
+ {0, 3, 4000}, //EmoteLiftoff
+ {0, 3, 4000}, // spell
+ {0, 3, 1000}, //fly
+ {0, 3, 1000}, //remove flags
{CAELESTRASZ_SAY_2, 4, 5000},
{0, 3, 3000},
{CAELESTRASZ_YELL_1, 4, 3000},
- {0, 3, 3000}, //Morph
- {0, 3, 4000}, //EmoteLiftoff
- {0, 3, 2500}, // spell
+ {0, 3, 3000}, //Morph
+ {0, 3, 4000}, //EmoteLiftoff
+ {0, 3, 2500}, // spell
{ANACHRONOS_SAY_2, 0, 2000},
- {0, 3, 250}, //fly
- {0, 3, 25}, //remove flags
+ {0, 3, 250}, //fly
+ {0, 3, 25}, //remove flags
{FANDRAL_SAY_2, 1, 3000},
- {ANACHRONOS_SAY_3, 0, 10000}, //Both run through the armies
- {0, 3, 2000}, // Sands will stop
- {0, 3, 8000}, // Summon Gate
+ {ANACHRONOS_SAY_3, 0, 10000}, //Both run through the armies
+ {0, 3, 2000}, // Sands will stop
+ {0, 3, 8000}, // Summon Gate
{ANACHRONOS_SAY_4, 0, 4000},
- {0, 0, 2000}, //spell 1-> Arcane cosmetic (Mobs freeze)
- {0, 0, 5000}, //Spell 2-> Arcane long cosmetic (barrier appears) (Barrier -> Glyphs)
- {0, 0, 7000}, //BarrieR
- {0, 0, 4000}, //Glyphs
+ {0, 0, 2000}, //spell 1-> Arcane cosmetic (Mobs freeze)
+ {0, 0, 5000}, //Spell 2-> Arcane long cosmetic (barrier appears) (Barrier -> Glyphs)
+ {0, 0, 7000}, //BarrieR
+ {0, 0, 4000}, //Glyphs
{ANACHRONOS_SAY_5, 0, 2000},
- {0, 0, 4000}, // Roots
- {FANDRAL_SAY_3, 1, 3000}, //Root Text
- {FANDRAL_EMOTE_1, 1, 3000}, //falls knee
+ {0, 0, 4000}, // Roots
+ {FANDRAL_SAY_3, 1, 3000}, //Root Text
+ {FANDRAL_EMOTE_1, 1, 3000}, //falls knee
{ANACHRONOS_SAY_6, 0, 3000},
{ANACHRONOS_SAY_7, 0, 3000},
{ANACHRONOS_SAY_8, 0, 8000},
- {ANACHRONOS_EMOTE_1, 0, 1000}, //Give Scepter
+ {ANACHRONOS_EMOTE_1, 0, 1000}, //Give Scepter
{FANDRAL_SAY_4, 1, 3000},
- {FANDRAL_SAY_5, 1, 3000}, //->Equip hammer~Scepter, throw it at door
- {FANDRAL_EMOTE_2, 1, 3000}, //Throw hammer at door.
+ {FANDRAL_SAY_5, 1, 3000}, //->Equip hammer~Scepter, throw it at door
+ {FANDRAL_EMOTE_2, 1, 3000}, //Throw hammer at door.
{ANACHRONOS_SAY_9, 0, 3000},
- {FANDRAL_SAY_6, 1, 3000}, //fandral goes away
+ {FANDRAL_SAY_6, 1, 3000}, //fandral goes away
{ANACHRONOS_EMOTE_2, 0, 3000},
{ANACHRONOS_EMOTE_3, 0, 3000},
{0, 0, 2000},
@@ -348,30 +226,30 @@ Position const SpawnLocation[] =
{-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
{-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8088.0f, 1510.0f, 2.61f, 0.0f}, //Anubisath Conqueror
- {-8084.0f, 1520.0f, 2.61f, 0.0f}, //Anubisath Conqueror
- {-8088.0f, 1530.0f, 2.61f, 0.0f}, //Anubisath Conqueror
-
- {-8080.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8082.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8085.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8082.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8085.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8080.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Wasp
-
- {-8082.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8079.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8080.0f, 1531.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8079.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8080.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp
-
- {-8081.0f, 1514.0f, 2.61f, 0.0f}, //Qiraj Tank
- {-8081.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank
- {-8081.0f, 1526.0f, 2.61f, 0.0f}, //Qiraj Tank
- {-8081.0f, 1512.0f, 2.61f, 0.0f}, //Qiraj Tank
- {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank
- {-8081.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Tank
+ {-8088.0f, 1510.0f, 2.61f, 0.0f}, //Anubisath Conqueror
+ {-8084.0f, 1520.0f, 2.61f, 0.0f}, //Anubisath Conqueror
+ {-8088.0f, 1530.0f, 2.61f, 0.0f}, //Anubisath Conqueror
+
+ {-8080.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp
+ {-8082.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp
+ {-8085.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp
+ {-8082.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp
+ {-8085.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp
+ {-8080.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Wasp
+
+ {-8082.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp
+ {-8079.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp
+ {-8080.0f, 1531.0f, 2.61f, 0.0f}, //Qiraj Wasp
+ {-8079.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp
+ {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp
+ {-8080.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp
+
+ {-8081.0f, 1514.0f, 2.61f, 0.0f}, //Qiraj Tank
+ {-8081.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank
+ {-8081.0f, 1526.0f, 2.61f, 0.0f}, //Qiraj Tank
+ {-8081.0f, 1512.0f, 2.61f, 0.0f}, //Qiraj Tank
+ {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank
+ {-8081.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Tank
{-8082.0f, 1513.0f, 2.61f, 3.141592f}, //Anubisath Conqueror
{-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Anubisath Conqueror
@@ -402,14 +280,36 @@ struct SpawnSpells
static SpawnSpells SpawnCast[4] =
{
- {100000, 2000, 33652}, // Stop Time
+ {100000, 2000, 33652}, // Stoned
{38500, 300000, 28528}, // Poison Cloud
{58000, 300000, 35871}, // Frost Debuff (need correct spell)
{80950, 300000, 42075}, // Fire Explosion (need correct spell however this one looks cool)
};
+
/*#####
# npc_anachronos_the_ancient
######*/
+
+enum AnachronosTheAncient
+{
+ NPC_QIRAJI_WASP = 15414,
+ NPC_QIRAJI_TANK = 15422,
+ NPC_KALDOREI_INFANTRY = 15423,
+ NPC_ANUBISATH_CONQUEROR = 15424,
+ SPELL_ARCANE_CHANNELING = 23017,
+ SPELL_NOXIOUS_BREATH = 24818,
+ SPELL_GREEN_DRAGON_TRANSFORM_DND = 25105,
+ SPELL_RED_DRAGON_TRANSFORM_DND = 25106,
+ SPELL_BLUE_DRAGON_TRANSFORM_DND = 25107,
+ SPELL_TIME_STOP = 25158,
+ SPELL_CALL_PRISMATIC_BARRIER = 25159,
+ SPELL_CALL_GLYPHS_OF_WARDING = 25166,
+ SPELL_CALL_ANCIENTS = 25167,
+ SPELL_THROW_HAMMER = 33806,
+ SPELL_FROST_BREATH = 50505,
+ SPELL_FLAME_BREATH = 54293
+};
+
class npc_anachronos_the_ancient : public CreatureScript
{
public:
@@ -464,10 +364,10 @@ public:
if (!player)
return;
- Creature* Fandral = player->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f);
- Creature* Arygos = player->FindNearestCreature(C_ARYGOS, 100.0f);
- Creature* Caelestrasz = player->FindNearestCreature(C_CAELESTRASZ, 100.0f);
- Creature* Merithra = player->FindNearestCreature(C_MERITHRA, 100.0f);
+ Creature* Fandral = player->FindNearestCreature(NPC_FANDRAL_STAGHELM, 100.0f);
+ Creature* Arygos = player->FindNearestCreature(NPC_ARYGOS, 100.0f);
+ Creature* Caelestrasz = player->FindNearestCreature(NPC_CAELESTRASZ, 100.0f);
+ Creature* Merithra = player->FindNearestCreature(NPC_MERITHRA_OF_THE_DREAM, 100.0f);
if (!Fandral || !Arygos || !Caelestrasz || !Merithra)
return;
@@ -509,7 +409,7 @@ public:
Merithra->AI()->Talk(MERITHRA_YELL_1);
break;
case 9:
- Merithra->CastSpell(Merithra, 25105, true);
+ Merithra->CastSpell(Merithra, SPELL_GREEN_DRAGON_TRANSFORM_DND, true);
break;
case 10:
Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
@@ -517,7 +417,7 @@ public:
Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 3);
break;
case 11:
- Merithra->CastSpell(Merithra, 24818, false);
+ Merithra->CastSpell(Merithra, SPELL_NOXIOUS_BREATH, false);
break;
case 12:
Merithra->GetMotionMaster()->MoveCharge(-8100, 1530, 50, 42);
@@ -536,7 +436,7 @@ public:
Arygos->AI()->Talk(ARYGOS_YELL_1);
break;
case 17:
- Arygos->CastSpell(Arygos, 25107, true);
+ Arygos->CastSpell(Arygos, SPELL_BLUE_DRAGON_TRANSFORM_DND, true);
break;
case 18:
Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
@@ -544,7 +444,7 @@ public:
Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 42);
break;
case 19:
- Arygos->CastSpell(Arygos, 50505, false);
+ Arygos->CastSpell(Arygos, SPELL_FROST_BREATH, false);
break;
case 20:
Arygos->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42);
@@ -563,15 +463,15 @@ public:
Caelestrasz->AI()->Talk(CAELESTRASZ_YELL_1);
break;
case 25:
- Caelestrasz->CastSpell(Caelestrasz, 25106, true);
+ Caelestrasz->CastSpell(Caelestrasz, SPELL_RED_DRAGON_TRANSFORM_DND, true);
break;
case 26:
- Caelestrasz->HandleEmoteCommand(254);
+ Caelestrasz->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
Caelestrasz->SetDisableGravity(true);
Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 7.61f, 4);
break;
case 27:
- Caelestrasz->CastSpell(Caelestrasz, 54293, false);
+ Caelestrasz->CastSpell(Caelestrasz, SPELL_FLAME_BREATH, false);
break;
case 28:
Talk(ANACHRONOS_SAY_2, Fandral);
@@ -596,29 +496,29 @@ public:
Caelestrasz->GetMotionMaster()->MoveCharge(-8050, 1473, 65, 15);
break; //Text: sands will stop
case 34:
- DoCast(player, 23017, true);//Arcane Channeling
+ DoCast(player, SPELL_ARCANE_CHANNELING, true);//Arcane Channeling
break;
case 35:
- me->CastSpell(-8088, 1520.43f, 2.67f, 25158, true);
+ me->CastSpell(-8088, 1520.43f, 2.67f, SPELL_TIME_STOP, true);
break;
case 36:
- DoCast(player, 25159, true);
+ DoCast(player, SPELL_CALL_PRISMATIC_BARRIER, true);
break;
case 37:
- me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0);
+ me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ, Position(-8130.f, 1525.f, 17.5f, 0.f), G3D::Quat(), 0);
break;
case 38:
- DoCast(player, 25166, true);
- me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0);
+ DoCast(player, SPELL_CALL_GLYPHS_OF_WARDING, true);
+ me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ, Position(-8130.f, 1525.f, 17.5f, 0.f), G3D::Quat(), 0);
break;
case 39:
Talk(ANACHRONOS_SAY_5, Fandral);
break;
case 40:
- Fandral->CastSpell(me, 25167, true);
+ Fandral->CastSpell(me, SPELL_CALL_ANCIENTS, true);
break;
case 41:
- Fandral->SummonGameObject(GO_ROOTS_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0);
+ Fandral->SummonGameObject(GO_ROOTS_OF_AHN_QIRAJ, Position(-8130.f, 1525.f, 17.5f, 0.f), G3D::Quat(), 0);
Fandral->AI()->Talk(FANDRAL_SAY_3);
break;
case 42:
@@ -649,11 +549,11 @@ public:
break;
case 50:
Fandral->AI()->Talk(FANDRAL_EMOTE_2);
- Fandral->CastSpell(-8127, 1525, 17.5f, 33806, true);
+ Fandral->CastSpell(-8127, 1525, 17.5f, SPELL_THROW_HAMMER, true);
break;
case 51:
{
- uint32 entries[4] = { 15423, 15424, 15414, 15422 };
+ uint32 entries[4] = { NPC_KALDOREI_INFANTRY, NPC_ANUBISATH_CONQUEROR, NPC_QIRAJI_WASP, NPC_QIRAJI_TANK };
Unit* mob = NULL;
for (uint8 i = 0; i < 4; ++i)
{
@@ -661,7 +561,7 @@ public:
while (mob)
{
mob->RemoveFromWorld();
- mob = player->FindNearestCreature(15423, 50);
+ mob = player->FindNearestCreature(NPC_KALDOREI_INFANTRY, 50);
}
}
break;
@@ -706,7 +606,7 @@ public:
me->SetDisplayId(15500);
break;
case 63:
- me->HandleEmoteCommand(254);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
me->SetDisableGravity(true);
break;
case 64:
@@ -746,6 +646,13 @@ public:
# npc_qiraj_war_spawn
######*/
+enum QirajWarSpawn
+{
+ SPELL_STONED_CHANNEL_CAST_VISUAL = 15533,
+ SPELL_SUMMON_POISON_CLOUD = 24319,
+ SPELL_STONED = 33652
+};
+
class npc_qiraj_war_spawn : public CreatureScript
{
public:
@@ -793,22 +700,22 @@ public:
{
if (!Timers)
{
- if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) //all but Kaldorei Soldiers
+ if (me->GetEntry() == NPC_ANUBISATH_CONQUEROR || me->GetEntry() == NPC_QIRAJI_TANK || me->GetEntry() == NPC_QIRAJI_WASP) //all but Kaldorei Soldiers
{
SpellTimer1 = SpawnCast[1].Timer1;
SpellTimer2 = SpawnCast[2].Timer1;
SpellTimer3 = SpawnCast[3].Timer1;
}
- if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
+ if (me->GetEntry() == NPC_KALDOREI_INFANTRY || me->GetEntry() == NPC_ANUBISATH_CONQUEROR || me->GetEntry() == NPC_QIRAJI_TANK || me->GetEntry() == NPC_QIRAJI_WASP)
SpellTimer4 = SpawnCast[0].Timer1;
Timers = true;
}
- if (me->GetEntry() == 15424 || me->GetEntry() == 15422|| me->GetEntry() == 15414)
+ if (me->GetEntry() == NPC_ANUBISATH_CONQUEROR || me->GetEntry() == NPC_QIRAJI_TANK || me->GetEntry() == NPC_QIRAJI_WASP)
{
if (SpellTimer1 <= diff)
{
DoCast(me, SpawnCast[1].SpellId);
- DoCast(me, 24319);
+ DoCast(me, SPELL_SUMMON_POISON_CLOUD);
SpellTimer1 = SpawnCast[1].Timer2;
} else SpellTimer1 -= diff;
if (SpellTimer2 <= diff)
@@ -822,38 +729,38 @@ public:
SpellTimer3 = SpawnCast[3].Timer2;
} else SpellTimer3 -= diff;
}
- if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
+ if (me->GetEntry() == NPC_KALDOREI_INFANTRY || me->GetEntry() == NPC_ANUBISATH_CONQUEROR || me->GetEntry() == NPC_QIRAJI_TANK || me->GetEntry() == NPC_QIRAJI_WASP)
{
if (SpellTimer4 <= diff)
{
me->RemoveAllAttackers();
me->AttackStop();
- DoCast(me, 15533);
+ DoCast(me, SPELL_STONED_CHANNEL_CAST_VISUAL);
SpellTimer4 = SpawnCast[0].Timer2;
} else SpellTimer4 -= diff;
}
if (!hasTarget)
{
Unit* target = NULL;
- if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
- target = me->FindNearestCreature(15423, 20, true);
- if (me->GetEntry() == 15423)
+ if (me->GetEntry() == NPC_ANUBISATH_CONQUEROR || me->GetEntry() == NPC_QIRAJI_TANK || me->GetEntry() == NPC_QIRAJI_WASP)
+ target = me->FindNearestCreature(NPC_KALDOREI_INFANTRY, 20, true);
+ if (me->GetEntry() == NPC_KALDOREI_INFANTRY)
{
uint8 tar = urand(0, 2);
if (tar == 0)
- target = me->FindNearestCreature(15422, 20, true);
+ target = me->FindNearestCreature(NPC_QIRAJI_TANK, 20, true);
else if (tar == 1)
- target = me->FindNearestCreature(15424, 20, true);
+ target = me->FindNearestCreature(NPC_ANUBISATH_CONQUEROR, 20, true);
else if (tar == 2)
- target = me->FindNearestCreature(15414, 20, true);
+ target = me->FindNearestCreature(NPC_QIRAJI_WASP, 20, true);
}
hasTarget = true;
if (target)
AttackStart(target);
}
- if (!(me->FindNearestCreature(15379, 60)))
- DoCast(me, 33652);
+ if (!(me->FindNearestCreature(NPC_CAELESTRASZ, 60)))
+ DoCast(me, SPELL_STONED);
if (!UpdateVictim())
{
@@ -932,7 +839,7 @@ public:
if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer))
{
- if (spawn->GetEntry() == 15423)
+ if (spawn->GetEntry() == NPC_KALDOREI_INFANTRY)
spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427 + rand32() % 4);
if (i >= 30) WaveCount = 1;
if (i >= 33) WaveCount = 2;
@@ -1040,6 +947,14 @@ void npc_qiraj_war_spawn::npc_qiraj_war_spawnAI::JustDied(Unit* /*slayer*/)
# go_crystalline_tear
######*/
+enum CrystallineTear
+{
+ ARYGOS_GNOME_FORM = 15418,
+ CAELESTRASZ_NIGHT_ELF_FORM = 15419,
+ MERITHRA_NIGHT_ELF_FORM = 15420,
+ ANACHRONOS_QUEST_TRIGGER_INVISIBLE = 15454
+};
+
class go_crystalline_tear : public GameObjectScript
{
public:
@@ -1049,35 +964,35 @@ public:
{
if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD)
{
- if (Creature* trigger = go->FindNearestCreature(15454, 100))
+ if (Creature* trigger = go->FindNearestCreature(ANACHRONOS_QUEST_TRIGGER_INVISIBLE, 100))
{
- Unit* Merithra = trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
- Unit* Caelestrasz = trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
- Unit* Arygos = trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
- /* Unit* Fandral = */ trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
- Creature* Anachronos = trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
+ Unit* Merithra = trigger->SummonCreature(NPC_MERITHRA_OF_THE_DREAM, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
+ Unit* Caelestrasz = trigger->SummonCreature(NPC_CAELESTRASZ, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
+ Unit* Arygos = trigger->SummonCreature(NPC_ARYGOS, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
+ /* Unit* Fandral = */ trigger->SummonCreature(NPC_FANDRAL_STAGHELM, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
+ Creature* Anachronos = trigger->SummonCreature(NPC_ANACHRONOS, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
if (Merithra)
{
- Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ Merithra->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15420);
+ Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, MERITHRA_NIGHT_ELF_FORM);
Merithra->setFaction(35);
}
if (Caelestrasz)
{
- Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15419);
+ Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, CAELESTRASZ_NIGHT_ELF_FORM);
Caelestrasz->setFaction(35);
}
if (Arygos)
{
- Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ Arygos->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15418);
+ Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, ARYGOS_GNOME_FORM);
Arygos->setFaction(35);
}
@@ -1107,112 +1022,107 @@ public:
enum WSSpells
{
- SPELL_PUNISHMENT = 24803,
- SPELL_SPAWN_IN = 25035,
-
- AURA_TWILIGHT_SET = 24746,
- AURA_MEDALLION = 24748,
- AURA_RING = 24782,
-
- SPELL_TEMPLAR_RANDOM = 24745,
- SPELL_TEMPLAR_FIRE = 24747,
- SPELL_TEMPLAR_AIR = 24757,
- SPELL_TEMPLAR_EARTH = 24759,
- SPELL_TEMPLAR_WATER = 24761,
-
- SPELL_DUKE_RANDOM = 24762,
- SPELL_DUKE_FIRE = 24766,
- SPELL_DUKE_AIR = 24769,
- SPELL_DUKE_EARTH = 24771,
- SPELL_DUKE_WATER = 24773,
-
- SPELL_ROYAL_RANDOM = 24785,
- SPELL_ROYAL_FIRE = 24787,
- SPELL_ROYAL_AIR = 24791,
- SPELL_ROYAL_EARTH = 24792,
- SPELL_ROYAL_WATER = 24793
+ AURA_TWILIGHT_SET = 24746,
+ AURA_MEDALLION = 24748,
+ AURA_RING = 24782,
+
+ SPELL_TEMPLAR_RANDOM = 24745,
+ SPELL_TEMPLAR_FIRE = 24747,
+ SPELL_TEMPLAR_AIR = 24757,
+ SPELL_TEMPLAR_EARTH = 24759,
+ SPELL_TEMPLAR_WATER = 24761,
+
+ SPELL_DUKE_RANDOM = 24762,
+ SPELL_DUKE_FIRE = 24766,
+ SPELL_DUKE_AIR = 24769,
+ SPELL_DUKE_EARTH = 24771,
+ SPELL_DUKE_WATER = 24773,
+
+ SPELL_ROYAL_RANDOM = 24785,
+ SPELL_ROYAL_FIRE = 24787,
+ SPELL_ROYAL_AIR = 24791,
+ SPELL_ROYAL_EARTH = 24792,
+ SPELL_ROYAL_WATER = 24793,
+
+ SPELL_PUNISHMENT = 24803,
+ SPELL_SPAWN_IN = 25035
};
enum WSGossip
{
- GOSSIPID_LESSER_WS = 6540,
- GOSSIPID_WS = 6542,
- GOSSIPID_GREATER_WS = 6543
+ OPTION_ID_WS_RANDOM = 0,
+ OPTION_ID_1_CRIMSON = 1,
+ OPTION_ID_2_AZURE = 2,
+ OPTION_ID_3_EARTHEN = 3,
+ OPTION_ID_4_HOARY = 4,
+ OPTION_ID_1_CYNDERS = 1,
+ OPTION_ID_2_FATHOMS = 2,
+ OPTION_ID_3_SHARDS = 3,
+ OPTION_ID_4_ZEPHYRS = 4,
+ OPTION_ID_1_SKALDRENOX = 1,
+ OPTION_ID_2_SKWOL = 2,
+ OPTION_ID_3_KAZUM = 3,
+ OPTION_ID_4_WHIRLAXIS = 4,
+ GOSSIP_ID_LESSER_WS = 6540,
+ GOSSIP_ID_WIND_STONE = 6542,
+ GOSSIP_ID_GREATER_WS = 6543
};
enum WSCreatures
{
- NPC_TEMPLAR_FIRE = 15209,
- NPC_TEMPLAR_WATER = 15211,
- NPC_TEMPLAR_AIR = 15212,
- NPC_TEMPLAR_EARTH = 15307,
-
- NPC_DUKE_FIRE = 15206,
- NPC_DUKE_WATER = 15207,
- NPC_DUKE_EARTH = 15208,
- NPC_DUKE_AIR = 15220,
-
- NPC_ROYAL_FIRE = 15203,
- NPC_ROYAL_AIR = 15204,
- NPC_ROYAL_EARTH = 15205,
- NPC_ROYAL_WATER = 15305
+ NPC_TEMPLAR_FIRE = 15209,
+ NPC_TEMPLAR_WATER = 15211,
+ NPC_TEMPLAR_AIR = 15212,
+ NPC_TEMPLAR_EARTH = 15307,
+
+ NPC_DUKE_FIRE = 15206,
+ NPC_DUKE_WATER = 15207,
+ NPC_DUKE_EARTH = 15208,
+ NPC_DUKE_AIR = 15220,
+
+ NPC_ROYAL_FIRE = 15203,
+ NPC_ROYAL_AIR = 15204,
+ NPC_ROYAL_EARTH = 15205,
+ NPC_ROYAL_WATER = 15305
};
enum WSItems
{
- ITEM_TEMPLAR_FIRE = 20416,
- ITEM_TEMPLAR_EARTH = 20419,
- ITEM_TEMPLAR_WATER = 20420,
- ITEM_TEMPLAR_AIR = 20418,
-
- ITEM_DUKE_FIRE = 20432,
- ITEM_DUKE_EARTH = 20435,
- ITEM_DUKE_WATER = 20436,
- ITEM_DUKE_AIR = 20433,
-
- ITEM_ROYAL_FIRE = 20447,
- ITEM_ROYAL_EARTH = 20449,
- ITEM_ROYAL_WATER = 20450,
- ITEM_ROYAL_AIR = 20448,
+ ITEM_TEMPLAR_FIRE = 20416,
+ ITEM_TEMPLAR_AIR = 20418,
+ ITEM_TEMPLAR_EARTH = 20419,
+ ITEM_TEMPLAR_WATER = 20420,
+
+ ITEM_DUKE_FIRE = 20432,
+ ITEM_DUKE_AIR = 20433,
+ ITEM_DUKE_EARTH = 20435,
+ ITEM_DUKE_WATER = 20436,
+
+ ITEM_ROYAL_FIRE = 20447,
+ ITEM_ROYAL_AIR = 20448,
+ ITEM_ROYAL_EARTH = 20449,
+ ITEM_ROYAL_WATER = 20450
};
enum WS
{
- TEMPLAR = 0,
- DUKE = 1,
- ROYAL = 2,
-
- FIRE = 0x1,
- WATER = 0x2,
- EARTH = 0x4,
- AIR = 0x8
-};
+ TEMPLAR = 0,
+ DUKE = 1,
+ ROYAL = 2,
+
+ FIRE = 0x1,
+ WATER = 0x2,
+ EARTH = 0x4,
+ AIR = 0x8
+};
enum WSTexts
{
- SAY_TEMPLAR_AGGRO = 0,
- SAY_DUKE_AGGRO = 0,
- YELL_ROYAL_AGGRO = 0
+ SAY_TEMPLAR_AGGRO = 0,
+ SAY_DUKE_AGGRO = 0,
+ YELL_ROYAL_AGGRO = 0
};
-#define GOSSIP_TEMPLAR_RANDOM "I am no cultist, you monster! Come to me and face your destruction!"
-#define GOSSIP_TEMPLAR_FIRE "Crimson Templar! I hold your signet! Heed my call!"
-#define GOSSIP_TEMPLAR_EARTH "Earthen Templar! I hold your signet! Heed my call!"
-#define GOSSIP_TEMPLAR_AIR "Hoary Templar! I hold your signet! Heed my call!"
-#define GOSSIP_TEMPLAR_WATER "Azure Templar! I hold your signet! Heed my call!"
-
-#define GOSSIP_DUKE_RANDOM "You will listen to this, vile duke! I am not your Twilight's Hammer lapdog! I am here to challenge you! Come! Come, and meet your death..."
-#define GOSSIP_DUKE_FIRE "Duke of Cynders! I hold your signet! Heed my call!"
-#define GOSSIP_DUKE_EARTH "The Duke of Shards! I hold your signet! Heed my call!"
-#define GOSSIP_DUKE_AIR "The Duke of Zephyrs! I hold your signet! Heed my call!"
-#define GOSSIP_DUKE_WATER "The Duke of Fathoms! I hold your signet! Heed my call!"
-
-#define GOSSIP_ROYAL_RANDOM "The day of the judgement has come, fiend! I challenge you to battle!"
-#define GOSSIP_ROYAL_FIRE "Prince Skaldrenox! I hold your signet! Heed my call!"
-#define GOSSIP_ROYAL_EARTH "Baron Kazum! I hold your signet! Heed my call!"
-#define GOSSIP_ROYAL_AIR "High Marshal Whirlaxis! I hold your signet! Heed my call!"
-#define GOSSIP_ROYAL_WATER "Lord Skwol! I hold your signet! Heed my call!"
-
class go_wind_stone : public GameObjectScript
{
public:
@@ -1294,7 +1204,7 @@ class go_wind_stone : public GameObjectScript
case NPC_TEMPLAR_WATER:
case NPC_TEMPLAR_AIR:
case NPC_TEMPLAR_EARTH:
- summons->AI()->Talk(SAY_TEMPLAR_AGGRO);
+ summons->AI()->Talk(SAY_TEMPLAR_AGGRO, player);
break;
case NPC_DUKE_FIRE:
@@ -1323,10 +1233,10 @@ class go_wind_stone : public GameObjectScript
uint32 gossipId = go->GetGOInfo()->GetGossipMenuId();
switch (gossipId)
{
- case GOSSIPID_LESSER_WS:
+ case GOSSIP_ID_LESSER_WS:
{
if (rank >= 1) // 1 or 2 or 3
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_LESSER_WS, OPTION_ID_WS_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
else
{
go->CastSpell(player, SPELL_PUNISHMENT);
@@ -1335,19 +1245,19 @@ class go_wind_stone : public GameObjectScript
uint8 item = GetItems(player, TEMPLAR);
if (item & FIRE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_FIRE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_LESSER_WS, OPTION_ID_1_CRIMSON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
if (item & WATER)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_WATER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_LESSER_WS, OPTION_ID_2_AZURE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
if (item & EARTH)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_EARTH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_LESSER_WS, OPTION_ID_3_EARTHEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
if (item & AIR)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_LESSER_WS, OPTION_ID_4_HOARY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
break;
}
- case GOSSIPID_WS:
+ case GOSSIP_ID_WIND_STONE:
{
if (rank >= 2) // 2 or 3
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_WIND_STONE, OPTION_ID_WS_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
else
{
go->CastSpell(player, SPELL_PUNISHMENT);
@@ -1356,19 +1266,19 @@ class go_wind_stone : public GameObjectScript
uint8 item = GetItems(player, DUKE);
if (item & FIRE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_FIRE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_WIND_STONE, OPTION_ID_1_CYNDERS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
if (item & WATER)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_WATER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_WIND_STONE, OPTION_ID_2_FATHOMS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
if (item & EARTH)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_EARTH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_WIND_STONE, OPTION_ID_3_SHARDS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
if (item & AIR)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_WIND_STONE, OPTION_ID_4_ZEPHYRS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
break;
}
- case GOSSIPID_GREATER_WS:
+ case GOSSIP_ID_GREATER_WS:
{
if (rank == 3) // 3
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_GREATER_WS, OPTION_ID_WS_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
else
{
go->CastSpell(player, SPELL_PUNISHMENT);
@@ -1377,13 +1287,13 @@ class go_wind_stone : public GameObjectScript
uint8 item = GetItems(player, ROYAL);
if (item & FIRE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_FIRE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_GREATER_WS, OPTION_ID_1_SKALDRENOX, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
if (item & WATER)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_WATER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_GREATER_WS, OPTION_ID_2_SKWOL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
if (item & EARTH)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_EARTH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_GREATER_WS, OPTION_ID_3_KAZUM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
if (item & AIR)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_ID_GREATER_WS, OPTION_ID_4_WHIRLAXIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
break;
}
default:
@@ -1462,6 +1372,5 @@ void AddSC_silithus()
new npc_anachronos_quest_trigger();
new npc_anachronos_the_ancient();
new npc_qiraj_war_spawn();
- new npcs_rutgar_and_frankal();
new go_wind_stone();
}
diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp
index 22b4c86cbcd..966bbaec1da 100644
--- a/src/server/scripts/Kalimdor/zone_tanaris.cpp
+++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp
@@ -19,15 +19,13 @@
/* ScriptData
SDName: Tanaris
SD%Complete: 80
-SDComment: Quest support: 648, 1560, 2954, 4005, 10277, 10279(Special flight path).
+SDComment: Quest support: 648, 1560, 4005, 10277
SDCategory: Tanaris
EndScriptData */
/* ContentData
npc_aquementas
npc_custodian_of_time
-npc_steward_of_time
-npc_stone_watcher_of_norgannon
npc_OOX17
npc_tooga
EndContentData */
@@ -298,116 +296,6 @@ public:
};
/*######
-## npc_steward_of_time
-######*/
-
-#define GOSSIP_ITEM_FLIGHT "Please take me to the master's lair."
-
-class npc_steward_of_time : public CreatureScript
-{
-public:
- npc_steward_of_time() : CreatureScript("npc_steward_of_time") { }
-
- bool OnQuestAccept(Player* player, Creature* /*creature*/, Quest const* quest) override
- {
- if (quest->GetQuestId() == 10279) //Quest: To The Master's Lair
- player->CastSpell(player, 34891, true); //(Flight through Caverns)
-
- return false;
- }
-
- bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF + 1)
- player->CastSpell(player, 34891, true); //(Flight through Caverns)
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(10279) == QUEST_STATUS_INCOMPLETE || player->GetQuestRewardStatus(10279))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(9978, creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(9977, creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
-## npc_stone_watcher_of_norgannon
-######*/
-
-#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?"
-#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?"
-#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?"
-#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!"
-#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?"
-#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum."
-
-class npc_stone_watcher_of_norgannon : public CreatureScript
-{
-public:
- npc_stone_watcher_of_norgannon() : CreatureScript("npc_stone_watcher_of_norgannon") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(1675, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(1676, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(1677, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(1678, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(1679, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(2954);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(1674, creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
## npc_OOX17
######*/
@@ -672,8 +560,6 @@ void AddSC_tanaris()
{
new npc_aquementas();
new npc_custodian_of_time();
- new npc_steward_of_time();
- new npc_stone_watcher_of_norgannon();
new npc_OOX17();
new npc_tooga();
}
diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp
index 852cd62c277..7a963d066b6 100644
--- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp
+++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp
@@ -43,38 +43,37 @@ EndContentData */
## npc_beaten_corpse
######*/
-#define GOSSIP_CORPSE "Examine corpse in detail..."
-
enum BeatenCorpse
{
- QUEST_LOST_IN_BATTLE = 4921
+ GOSSIP_OPTION_ID_BEATEN_CORPSE = 0,
+ GOSSIP_MENU_OPTION_INSPECT_BODY = 2871
};
class npc_beaten_corpse : public CreatureScript
{
-public:
- npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { }
+ public:
+ npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF +1)
+ struct npc_beaten_corpseAI : public ScriptedAI
{
- player->SEND_GOSSIP_MENU(3558, creature->GetGUID());
- player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ npc_beaten_corpseAI(Creature* creature) : ScriptedAI(creature)
+ {
+ }
- player->SEND_GOSSIP_MENU(3557, creature->GetGUID());
- return true;
- }
+ void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
+ {
+ if (menuId == GOSSIP_MENU_OPTION_INSPECT_BODY && gossipListId == GOSSIP_OPTION_ID_BEATEN_CORPSE)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ player->TalkedToCreature(me->GetEntry(), me->GetGUID());
+ }
+ }
+ };
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new npc_beaten_corpseAI(creature);
+ }
};
/*######
@@ -552,7 +551,7 @@ public:
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
{
- if (me->getStandState() == UNIT_STAND_STATE_DEAD)
+ if (me->GetStandState() == UNIT_STAND_STATE_DEAD)
me->SetStandState(UNIT_STAND_STATE_STAND);
IsPostEvent = false;
diff --git a/src/server/scripts/Kalimdor/zone_thousand_needles.cpp b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp
index 85c3a621239..2a606856af6 100644
--- a/src/server/scripts/Kalimdor/zone_thousand_needles.cpp
+++ b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp
@@ -19,7 +19,7 @@
/* ScriptData
SDName: Thousand Needles
SD%Complete: 100
-SDComment: Support for Quest: 1950, 4770, 4904, 4966, 5151.
+SDComment: Support for Quest: 4770, 4904, 4966, 5151.
SDCategory: Thousand Needles
EndScriptData */
@@ -27,7 +27,6 @@ EndScriptData */
npc_kanati
npc_lakota_windsong
npc_swiftmountain
-npc_plucky
npc_enraged_panther
go_panther_cage
EndContentData */
@@ -44,10 +43,9 @@ EndContentData */
enum Kanati
{
- SAY_KAN_START = 0,
-
- QUEST_PROTECT_KANATI = 4966,
- NPC_GALAK_ASS = 10720
+ SAY_KAN_START = 0,
+ QUEST_PROTECT_KANATI = 4966,
+ NPC_GALAK_ASS = 10720
};
Position const GalakLoc = {-4867.387695f, -1357.353760f, -48.226f, 0.0f};
@@ -112,19 +110,19 @@ public:
enum Lakota
{
- SAY_LAKO_START = 0,
- SAY_LAKO_LOOK_OUT = 1,
- SAY_LAKO_HERE_COME = 2,
- SAY_LAKO_MORE = 3,
- SAY_LAKO_END = 4,
-
- QUEST_FREE_AT_LAST = 4904,
- NPC_GRIM_BANDIT = 10758,
- FACTION_ESCORTEE_LAKO = 232, //guessed
-
- ID_AMBUSH_1 = 0,
- ID_AMBUSH_2 = 2,
- ID_AMBUSH_3 = 4
+ SAY_LAKO_START = 0,
+ SAY_LAKO_LOOK_OUT = 1,
+ SAY_LAKO_HERE_COME = 2,
+ SAY_LAKO_MORE = 3,
+ SAY_LAKO_END = 4,
+
+ QUEST_FREE_AT_LAST = 4904,
+ NPC_GRIM_BANDIT = 10758,
+ FACTION_ESCORTEE_LAKO = 232, //guessed
+
+ ID_AMBUSH_1 = 0,
+ ID_AMBUSH_2 = 2,
+ ID_AMBUSH_3 = 4
};
Position const BanditLoc[6] =
@@ -183,6 +181,7 @@ public:
DoSpawnBandits(ID_AMBUSH_3);
break;
case 45:
+ Talk(SAY_LAKO_END);
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_FREE_AT_LAST, me);
break;
@@ -195,7 +194,6 @@ public:
me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i+AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
}
};
-
};
/*######
@@ -204,13 +202,13 @@ public:
enum Packa
{
- SAY_START = 0,
- SAY_WYVERN = 1,
- SAY_COMPLETE = 2,
+ SAY_START = 0,
+ SAY_WYVERN = 1,
+ SAY_COMPLETE = 2,
- QUEST_HOMEWARD = 4770,
- NPC_WYVERN = 4107,
- FACTION_ESCORTEE = 232 //guessed
+ QUEST_HOMEWARD = 4770,
+ NPC_WYVERN = 4107,
+ FACTION_ESCORTEE = 232 //guessed
};
Position const WyvernLoc[3] =
@@ -275,137 +273,10 @@ public:
};
};
-/*#####
-# npc_plucky
-######*/
-
-#define GOSSIP_P "Please tell me the Phrase.."
-
-enum Plucky
-{
- FACTION_FRIENDLY = 35,
- QUEST_SCOOP = 1950,
- SPELL_PLUCKY_HUMAN = 9192,
- SPELL_PLUCKY_CHICKEN = 9220
-};
-
-class npc_plucky : public CreatureScript
-{
-public:
- npc_plucky() : CreatureScript("npc_plucky") { }
-
- bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->CLOSE_GOSSIP_MENU();
- player->CompleteQuest(QUEST_SCOOP);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(738, creature->GetGUID());
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_pluckyAI(creature);
- }
-
- struct npc_pluckyAI : public ScriptedAI
- {
- npc_pluckyAI(Creature* creature) : ScriptedAI(creature)
- {
- Initialize();
- NormFaction = creature->getFaction();
- }
-
- void Initialize()
- {
- ResetTimer = 120000;
- }
-
- uint32 NormFaction;
- uint32 ResetTimer;
-
- void Reset() override
- {
- Initialize();
-
- if (me->getFaction() != NormFaction)
- me->setFaction(NormFaction);
-
- if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- DoCast(me, SPELL_PLUCKY_CHICKEN, false);
- }
-
- void ReceiveEmote(Player* player, uint32 TextEmote) override
- {
- if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE)
- {
- if (TextEmote == TEXT_EMOTE_BECKON)
- {
- me->setFaction(FACTION_FRIENDLY);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DoCast(me, SPELL_PLUCKY_HUMAN, false);
- }
- }
-
- if (TextEmote == TEXT_EMOTE_CHICKEN)
- {
- if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
- return;
- else
- {
- me->setFaction(FACTION_FRIENDLY);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DoCast(me, SPELL_PLUCKY_HUMAN, false);
- me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
- }
- }
- }
-
- void UpdateAI(uint32 Diff) override
- {
- if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
- {
- if (ResetTimer <= Diff)
- {
- if (!me->GetVictim())
- EnterEvadeMode();
- else
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- return;
- }
- else
- ResetTimer -= Diff;
- }
-
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
enum PantherCage
{
- ENRAGED_PANTHER = 10992
+ QUEST_HYPERCAPACITOR_GIZMO = 5151,
+ ENRAGED_PANTHER = 10992
};
class go_panther_cage : public GameObjectScript
@@ -416,7 +287,7 @@ public:
bool OnGossipHello(Player* player, GameObject* go) override
{
go->UseDoorOrButton();
- if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE)
+ if (player->GetQuestStatus(QUEST_HYPERCAPACITOR_GIZMO) == QUEST_STATUS_INCOMPLETE)
{
if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true))
{
@@ -466,7 +337,6 @@ void AddSC_thousand_needles()
new npc_kanati();
new npc_lakota_windsong();
new npc_paoka_swiftmountain();
- new npc_plucky();
new npc_enraged_panther();
new go_panther_cage();
}
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
index ab09dd45710..2f97b5a8055 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
@@ -16,7 +16,8 @@
*/
/*
- * Comment: Complete - BUT THE TRIGGER NEEDS DATA WHETHER THE PRISON OF TALDARAM IS OFFLINE !
+ * Comment: Visuals missing, de-germanize code, wow 3.3.5a-ize
+ * Patch 3.3.2 (2010-01-02): Jedoga Shadowseeker now only ascends once during the encounter.
*/
#include "ScriptMgr.h"
@@ -454,11 +455,11 @@ public:
float distance = me->GetDistance(JedogaPosition[1]);
if (distance < 9.0f)
- me->SetSpeed(MOVE_WALK, 0.5f, true);
+ me->SetSpeedRate(MOVE_WALK, 0.5f);
else if (distance < 15.0f)
- me->SetSpeed(MOVE_WALK, 0.75f, true);
+ me->SetSpeedRate(MOVE_WALK, 0.75f);
else if (distance < 20.0f)
- me->SetSpeed(MOVE_WALK, 1.0f, true);
+ me->SetSpeedRate(MOVE_WALK, 1.0f);
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MovePoint(1, JedogaPosition[1]);
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
index e25f64f61aa..04b62f77e9a 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
@@ -178,7 +178,7 @@ class boss_prince_taldaram : public CreatureScript
if (Unit* embraceTarget = GetEmbraceTarget())
{
me->GetMotionMaster()->Clear();
- me->SetSpeed(MOVE_WALK, 2.0f, true);
+ me->SetSpeedRate(MOVE_WALK, 2.0f);
me->GetMotionMaster()->MoveChase(embraceTarget);
}
events.ScheduleEvent(EVENT_VANISHED, 1300);
@@ -188,7 +188,7 @@ class boss_prince_taldaram : public CreatureScript
DoCast(embraceTarget, SPELL_EMBRACE_OF_THE_VAMPYR);
Talk(SAY_FEED);
me->GetMotionMaster()->Clear();
- me->SetSpeed(MOVE_WALK, 1.0f, true);
+ me->SetSpeedRate(MOVE_WALK, 1.0f);
me->GetMotionMaster()->MoveChase(me->GetVictim());
events.ScheduleEvent(EVENT_FEEDING, 20000);
break;
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
index 16cfb30e2dc..2df0fceab9c 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
@@ -156,7 +156,7 @@ public:
ImpaleTarget = impaleTarget->GetGUID();
impaleTarget->SetReactState(REACT_PASSIVE);
impaleTarget->SetDisplayId(DISPLAY_INVISIBLE);
- impaleTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
+ impaleTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
return impaleTarget;
}
diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt
deleted file mode 100644
index 1dc453ad416..00000000000
--- a/src/server/scripts/Northrend/CMakeLists.txt
+++ /dev/null
@@ -1,199 +0,0 @@
-# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
-#
-# This file is free software; as a special exception the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- Northrend/zone_wintergrasp.cpp
- Northrend/isle_of_conquest.cpp
- Northrend/zone_storm_peaks.cpp
- Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
- Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
- Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h
- Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
- Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
- Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
- Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
- Northrend/Ulduar/Ulduar/boss_thorim.cpp
- Northrend/Ulduar/Ulduar/boss_ignis.cpp
- Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
- Northrend/Ulduar/Ulduar/instance_ulduar.cpp
- Northrend/Ulduar/Ulduar/boss_auriaya.cpp
- Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
- Northrend/Ulduar/Ulduar/boss_hodir.cpp
- Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp
- Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
- Northrend/Ulduar/Ulduar/boss_xt002.cpp
- Northrend/Ulduar/Ulduar/boss_mimiron.cpp
- Northrend/Ulduar/Ulduar/ulduar.h
- Northrend/Ulduar/Ulduar/boss_freya.cpp
- Northrend/Ulduar/Ulduar/boss_razorscale.cpp
- Northrend/Ulduar/Ulduar/boss_kologarn.cpp
- Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
- Northrend/Ulduar/HallsOfStone/halls_of_stone.h
- Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp
- Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp
- Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp
- Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
- Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp
- Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h
- Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
- Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp
- Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
- Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
- Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
- Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp
- Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
- Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
- Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
- Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.h
- Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp
- Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
- Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
- Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp
- Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp
- Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
- Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp
- Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
- Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h
- Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp
- Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp
- Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
- Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp
- Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
- Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.h
- Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
- Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
- Northrend/Nexus/EyeOfEternity/eye_of_eternity.h
- Northrend/Nexus/Oculus/boss_eregos.cpp
- Northrend/Nexus/Oculus/boss_drakos.cpp
- Northrend/Nexus/Oculus/oculus.h
- Northrend/Nexus/Oculus/boss_varos.cpp
- Northrend/Nexus/Oculus/boss_urom.cpp
- Northrend/Nexus/Oculus/oculus.cpp
- Northrend/Nexus/Oculus/instance_oculus.cpp
- Northrend/Nexus/Nexus/boss_nexus_commanders.cpp
- Northrend/Nexus/Nexus/boss_ormorok.cpp
- Northrend/Nexus/Nexus/boss_magus_telestra.cpp
- Northrend/Nexus/Nexus/instance_nexus.cpp
- Northrend/Nexus/Nexus/boss_keristrasza.cpp
- Northrend/Nexus/Nexus/boss_anomalus.cpp
- Northrend/Nexus/Nexus/nexus.h
- Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
- Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
- Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
- Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h
- Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
- Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
- Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
- Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp
- Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h
- Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp
- Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
- Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
- Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
- Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
- Northrend/Naxxramas/boss_loatheb.cpp
- Northrend/Naxxramas/boss_anubrekhan.cpp
- Northrend/Naxxramas/boss_maexxna.cpp
- Northrend/Naxxramas/boss_patchwerk.cpp
- Northrend/Naxxramas/boss_gothik.cpp
- Northrend/Naxxramas/boss_faerlina.cpp
- Northrend/Naxxramas/boss_gluth.cpp
- Northrend/Naxxramas/boss_four_horsemen.cpp
- Northrend/Naxxramas/naxxramas.h
- Northrend/Naxxramas/boss_kelthuzad.cpp
- Northrend/Naxxramas/boss_heigan.cpp
- Northrend/Naxxramas/boss_thaddius.cpp
- Northrend/Naxxramas/boss_razuvious.cpp
- Northrend/Naxxramas/boss_sapphiron.cpp
- Northrend/Naxxramas/instance_naxxramas.cpp
- Northrend/Naxxramas/boss_grobbulus.cpp
- Northrend/Naxxramas/boss_noth.cpp
- Northrend/zone_crystalsong_forest.cpp
- Northrend/VaultOfArchavon/boss_archavon.cpp
- Northrend/VaultOfArchavon/boss_koralon.cpp
- Northrend/VaultOfArchavon/vault_of_archavon.h
- Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp
- Northrend/VaultOfArchavon/boss_emalon.cpp
- Northrend/VaultOfArchavon/boss_toravon.cpp
- Northrend/zone_sholazar_basin.cpp
- Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
- Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
- Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
- Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
- Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp
- Northrend/UtgardeKeep/UtgardePinnacle/utgarde_pinnacle.h
- Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp
- Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
- Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.h
- Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp
- Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp
- Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
- Northrend/zone_dragonblight.cpp
- Northrend/zone_grizzly_hills.cpp
- Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h
- Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp
- Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp
- Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
- Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
- Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
- Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
- Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
- Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp
- Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp
- Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp
- Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
- Northrend/VioletHold/boss_zuramat.cpp
- Northrend/VioletHold/instance_violet_hold.cpp
- Northrend/VioletHold/boss_lavanthor.cpp
- Northrend/VioletHold/boss_cyanigosa.cpp
- Northrend/VioletHold/violet_hold.h
- Northrend/VioletHold/boss_ichoron.cpp
- Northrend/VioletHold/boss_moragg.cpp
- Northrend/VioletHold/boss_xevozz.cpp
- Northrend/VioletHold/boss_erekem.cpp
- Northrend/VioletHold/violet_hold.cpp
- Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
- Northrend/IcecrownCitadel/icecrown_citadel.cpp
- Northrend/IcecrownCitadel/icecrown_citadel.h
- Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp
- Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
- Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
- Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
- Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
- Northrend/IcecrownCitadel/boss_festergut.cpp
- Northrend/IcecrownCitadel/boss_rotface.cpp
- Northrend/IcecrownCitadel/boss_professor_putricide.cpp
- Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
- Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
- Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
- Northrend/IcecrownCitadel/boss_sindragosa.cpp
- Northrend/IcecrownCitadel/boss_the_lich_king.cpp
- Northrend/zone_zuldrak.cpp
- Northrend/zone_icecrown.cpp
- Northrend/Gundrak/boss_slad_ran.cpp
- Northrend/Gundrak/instance_gundrak.cpp
- Northrend/Gundrak/boss_drakkari_colossus.cpp
- Northrend/Gundrak/gundrak.h
- Northrend/Gundrak/boss_gal_darah.cpp
- Northrend/Gundrak/boss_moorabi.cpp
- Northrend/Gundrak/boss_eck.cpp
- Northrend/zone_borean_tundra.cpp
- Northrend/zone_howling_fjord.cpp
- Northrend/zone_dalaran.cpp
- Northrend/DraktharonKeep/boss_trollgore.cpp
- Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp
- Northrend/DraktharonKeep/boss_novos.cpp
- Northrend/DraktharonKeep/drak_tharon_keep.h
- Northrend/DraktharonKeep/boss_tharon_ja.cpp
- Northrend/DraktharonKeep/boss_king_dred.cpp
-)
-
-message(" -> Prepared: Northrend")
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
index 7b8ca41772f..d6682e272fd 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
@@ -137,7 +137,8 @@ enum Events
EVENT_CHECK_CORPOREALITY = 13,
EVENT_SHADOW_PULSARS_SHOOT = 14,
EVENT_TRIGGER_BERSERK = 15,
- EVENT_TWILIGHT_MENDING = 16
+ EVENT_TWILIGHT_MENDING = 16,
+ EVENT_ACTIVATE_EMBERS = 17
};
enum Actions
@@ -150,7 +151,9 @@ enum Actions
ACTION_MONITOR_CORPOREALITY = 3,
// Orb Carrier
- ACTION_SHOOT = 4
+ ACTION_WARNING_SHOOT = 4,
+ ACTION_SHOOT = 5,
+ ACTION_ACTIVATE_EMBERS = 6
};
enum Phases
@@ -168,8 +171,7 @@ enum Misc
DATA_MATERIAL_DAMAGE_TAKEN = 2,
DATA_STACKS_DISPELLED = 3,
DATA_FIGHT_PHASE = 4,
- DATA_EVADE_METHOD = 5,
- DATA_SPAWNED_FLAMES = 6,
+ DATA_SPAWNED_FLAMES = 5,
};
enum OrbCarrierSeats
@@ -189,6 +191,7 @@ enum CorporealityEvent
};
Position const HalionSpawnPos = {3156.67f, 533.8108f, 72.98822f, 3.159046f};
+Position const HalionRespawnPos = {3156.625f, 533.2674f, 72.97205f, 0.0f};
uint8 const MAX_CORPOREALITY_STATE = 11;
@@ -212,132 +215,39 @@ CorporealityEntry const _corporealityReference[MAX_CORPOREALITY_STATE] = {
{74831, 74836}
};
-struct generic_halionAI : public BossAI
-{
- generic_halionAI(Creature* creature, uint32 bossId) : BossAI(creature, bossId), _canEvade(false) { }
-
- void EnterCombat(Unit* /*who*/) override
- {
- _EnterCombat();
- me->AddAura(SPELL_TWILIGHT_PRECISION, me);
- _canEvade = false;
- events.ScheduleEvent(EVENT_CLEAVE, urand(8000, 10000));
- events.ScheduleEvent(EVENT_TAIL_LASH, 10000);
- events.ScheduleEvent(EVENT_BREATH, urand(10000, 15000));
- }
-
- void Reset() override
- {
- _canEvade = false;
- _Reset();
- }
-
- void JustReachedHome() override
- {
- instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
- _JustReachedHome();
- }
-
- void ExecuteEvent(uint32 eventId) override
- {
- switch (eventId)
- {
- case EVENT_CLEAVE:
- DoCastVictim(SPELL_CLEAVE);
- events.ScheduleEvent(EVENT_CLEAVE, urand(8000, 10000));
- break;
- case EVENT_TAIL_LASH:
- DoCastAOE(SPELL_TAIL_LASH);
- events.ScheduleEvent(EVENT_TAIL_LASH, 10000);
- break;
- case EVENT_BREATH:
- DoCast(me, me->GetEntry() == NPC_HALION ? SPELL_FLAME_BREATH : SPELL_DARK_BREATH);
- events.ScheduleEvent(EVENT_BREATH, urand(10000, 12000));
- break;
- }
- }
-
- void UpdateAI(uint32 diff) override
- {
- if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
- return;
-
- events.Update(diff);
-
- while (uint32 eventId = events.ExecuteEvent())
- ExecuteEvent(eventId);
-
- DoMeleeAttackIfReady();
- }
-
- void SetData(uint32 index, uint32 dataValue) override
- {
- switch (index)
- {
- case DATA_EVADE_METHOD:
- _canEvade = (dataValue == 1);
- break;
- default:
- break;
- }
- }
-
- void SpellHit(Unit* /*who*/, SpellInfo const* spellInfo) override
- {
- if (spellInfo->Id == SPELL_TWILIGHT_MENDING)
- Talk(SAY_REGENERATE);
- }
-
-protected:
- bool _canEvade;
-};
-
class boss_halion : public CreatureScript
{
public:
boss_halion() : CreatureScript("boss_halion") { }
- struct boss_halionAI : public generic_halionAI
+ struct boss_halionAI : public BossAI
{
- boss_halionAI(Creature* creature) : generic_halionAI(creature, DATA_HALION)
- {
- me->SetHomePosition(HalionSpawnPos);
- }
-
- void Reset() override
- {
- generic_halionAI::Reset();
- me->SetReactState(REACT_DEFENSIVE);
- me->RemoveAurasDueToSpell(SPELL_TWILIGHT_PHASING);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
+ boss_halionAI(Creature* creature) : BossAI(creature, DATA_HALION) { }
void EnterEvadeMode(EvadeReason why) override
{
- if (why == EVADE_REASON_BOUNDARY)
+ if (why == EVADE_REASON_BOUNDARY || events.IsInPhase(PHASE_ONE))
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HALION_CONTROLLER)))
- controller->AI()->EnterEvadeMode();
-
- // Phase 1: We always can evade. Phase 2 & 3: We can evade if and only if the controller tells us to.
- if (events.IsInPhase(PHASE_ONE) || _canEvade)
- generic_halionAI::EnterEvadeMode(why);
+ controller->AI()->EnterEvadeMode(why);
}
- void EnterCombat(Unit* who) override
+ void EnterCombat(Unit* /*who*/) override
{
Talk(SAY_AGGRO);
events.Reset();
events.SetPhase(PHASE_ONE);
- generic_halionAI::EnterCombat(who);
+ _EnterCombat();
+ me->AddAura(SPELL_TWILIGHT_PRECISION, me);
+ events.ScheduleEvent(EVENT_ACTIVATE_FIREWALL, Seconds(5));
+ events.ScheduleEvent(EVENT_BREATH, randtime(Seconds(5), Seconds(15)));
+ events.ScheduleEvent(EVENT_CLEAVE, randtime(Seconds(6), Seconds(10)));
+ events.ScheduleEvent(EVENT_TAIL_LASH, randtime(Seconds(7), Seconds(12)));
+ events.ScheduleEvent(EVENT_FIERY_COMBUSTION, randtime(Seconds(15), Seconds(18)));
+ events.ScheduleEvent(EVENT_METEOR_STRIKE, Seconds(18));
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1);
- instance->SetBossState(DATA_HALION, IN_PROGRESS);
-
- events.ScheduleEvent(EVENT_ACTIVATE_FIREWALL, 5000);
- events.ScheduleEvent(EVENT_METEOR_STRIKE, urand(20000, 25000));
- events.ScheduleEvent(EVENT_FIERY_COMBUSTION, urand(15000, 18000));
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HALION_CONTROLLER)))
controller->AI()->SetData(DATA_FIGHT_PHASE, PHASE_ONE);
@@ -388,58 +298,76 @@ class boss_halion : public CreatureScript
}
}
+ void SpellHit(Unit* /*who*/, SpellInfo const* spellInfo) override
+ {
+ if (spellInfo->Id == SPELL_TWILIGHT_MENDING)
+ Talk(SAY_REGENERATE);
+ }
+
void UpdateAI(uint32 diff) override
{
if (events.IsInPhase(PHASE_TWO))
return;
- generic_halionAI::UpdateAI(diff);
- }
+ if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
+ return;
- void ExecuteEvent(uint32 eventId) override
- {
- switch (eventId)
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
{
- case EVENT_ACTIVATE_FIREWALL:
- // Flame ring is activated 5 seconds after starting encounter, DOOR_TYPE_ROOM is only instant.
- for (uint8 i = DATA_FLAME_RING; i <= DATA_TWILIGHT_FLAME_RING; ++i)
- if (GameObject* flameRing = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(i)))
- instance->HandleGameObject(instance->GetGuidData(DATA_FLAME_RING), false, flameRing);
- break;
- case EVENT_METEOR_STRIKE:
+ switch (eventId)
{
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_TWILIGHT_REALM))
+ case EVENT_CLEAVE:
+ DoCastVictim(SPELL_CLEAVE);
+ events.ScheduleEvent(EVENT_CLEAVE, randtime(Seconds(8), Seconds(10)));
+ break;
+ case EVENT_TAIL_LASH:
+ DoCastAOE(SPELL_TAIL_LASH);
+ events.ScheduleEvent(EVENT_TAIL_LASH, randtime(Seconds(11), Seconds(16)));
+ break;
+ case EVENT_BREATH:
+ DoCast(me, SPELL_FLAME_BREATH);
+ events.ScheduleEvent(EVENT_BREATH, randtime(Seconds(16), Seconds(25)));
+ break;
+ case EVENT_ACTIVATE_FIREWALL:
+ // Flame ring is activated 5 seconds after starting encounter, DOOR_TYPE_ROOM is only instant.
+ for (uint8 i = DATA_FLAME_RING; i <= DATA_TWILIGHT_FLAME_RING; ++i)
+ if (GameObject* flameRing = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(i)))
+ instance->HandleGameObject(instance->GetGuidData(DATA_FLAME_RING), false, flameRing);
+ break;
+ case EVENT_METEOR_STRIKE:
{
- _meteorStrikePos = target->GetPosition();
- me->CastSpell(_meteorStrikePos.GetPositionX(), _meteorStrikePos.GetPositionY(), _meteorStrikePos.GetPositionZ(), SPELL_METEOR_STRIKE, true, NULL, NULL, me->GetGUID());
- Talk(SAY_METEOR_STRIKE);
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_TWILIGHT_REALM))
+ {
+ _meteorStrikePos = target->GetPosition();
+ me->CastSpell(_meteorStrikePos.GetPositionX(), _meteorStrikePos.GetPositionY(), _meteorStrikePos.GetPositionZ(), SPELL_METEOR_STRIKE, true, nullptr, nullptr, me->GetGUID());
+ Talk(SAY_METEOR_STRIKE);
+ }
+ events.ScheduleEvent(EVENT_METEOR_STRIKE, Seconds(38));
+ break;
}
- events.ScheduleEvent(EVENT_METEOR_STRIKE, 40000);
- break;
- }
- case EVENT_FIERY_COMBUSTION:
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_TWILIGHT_REALM))
- DoCast(target, SPELL_FIERY_COMBUSTION);
- events.ScheduleEvent(EVENT_FIERY_COMBUSTION, 25000);
- break;
+ case EVENT_FIERY_COMBUSTION:
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_TWILIGHT_REALM))
+ me->CastSpell(target, SPELL_FIERY_COMBUSTION, TRIGGERED_IGNORE_SET_FACING);
+ events.ScheduleEvent(EVENT_FIERY_COMBUSTION, Seconds(25));
+ break;
+ }
+ default:
+ break;
}
- default:
- generic_halionAI::ExecuteEvent(eventId);
- break;
}
+
+ DoMeleeAttackIfReady();
}
void SetData(uint32 index, uint32 value) override
{
- switch (index)
- {
- case DATA_FIGHT_PHASE:
- events.SetPhase(value);
- break;
- default:
- generic_halionAI::SetData(index, value);
- }
+ if (index != DATA_FIGHT_PHASE)
+ return;
+
+ events.SetPhase(value);
}
private:
@@ -459,9 +387,9 @@ class boss_twilight_halion : public CreatureScript
public:
boss_twilight_halion() : CreatureScript("boss_twilight_halion") { }
- struct boss_twilight_halionAI : public generic_halionAI
+ struct boss_twilight_halionAI : public BossAI
{
- boss_twilight_halionAI(Creature* creature) : generic_halionAI(creature, DATA_TWILIGHT_HALION)
+ boss_twilight_halionAI(Creature* creature) : BossAI(creature, DATA_TWILIGHT_HALION)
{
Creature* halion = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HALION));
if (!halion)
@@ -470,26 +398,29 @@ class boss_twilight_halion : public CreatureScript
// Using AddAura because no spell cast packet in sniffs.
halion->AddAura(SPELL_COPY_DAMAGE, me); // We use explicit targeting here to avoid conditions + SPELL_ATTR6_CANT_TARGET_SELF.
me->AddAura(SPELL_COPY_DAMAGE, halion);
- me->AddAura(SPELL_DUSK_SHROUD, me);
+ DoCast(me, SPELL_DUSK_SHROUD, true);
me->SetHealth(halion->GetHealth());
me->SetPhaseMask(0x20, true);
- me->SetReactState(REACT_AGGRESSIVE);
+ me->SetReactState(REACT_DEFENSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
+ events.ScheduleEvent(EVENT_TAIL_LASH, Seconds(12));
+ events.ScheduleEvent(EVENT_SOUL_CONSUMPTION, Seconds(15));
}
- void EnterCombat(Unit* who) override
+ void EnterCombat(Unit* /*who*/) override
{
- events.Reset();
events.SetPhase(PHASE_TWO);
- generic_halionAI::EnterCombat(who);
-
- events.ScheduleEvent(EVENT_SOUL_CONSUMPTION, 20000);
+ _EnterCombat();
+ me->AddAura(SPELL_TWILIGHT_PRECISION, me);
+ events.ScheduleEvent(EVENT_CLEAVE, Seconds(3));
+ events.ScheduleEvent(EVENT_BREATH, Seconds(12));
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 2);
}
- // Never evade
+ void Reset() override { }
void EnterEvadeMode(EvadeReason /*why*/) override { }
void KilledUnit(Unit* victim) override
@@ -522,6 +453,10 @@ class boss_twilight_halion : public CreatureScript
void DamageTaken(Unit* attacker, uint32& damage) override
{
+ //Needed because we already have UNIT_FLAG_IN_COMBAT, otherwise EnterCombat won't ever be called
+ if (!events.IsInPhase(PHASE_TWO) && !events.IsInPhase(PHASE_THREE))
+ EnterCombat(attacker);
+
if (me->HealthBelowPctDamaged(50, damage) && events.IsInPhase(PHASE_TWO))
{
events.SetPhase(PHASE_THREE);
@@ -542,7 +477,7 @@ class boss_twilight_halion : public CreatureScript
}
}
- void SpellHit(Unit* who, SpellInfo const* spell) override
+ void SpellHit(Unit* /*who*/, SpellInfo const* spell) override
{
switch (spell->Id)
{
@@ -550,25 +485,51 @@ class boss_twilight_halion : public CreatureScript
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HALION_CONTROLLER)))
controller->AI()->DoAction(ACTION_MONITOR_CORPOREALITY);
break;
+ case SPELL_TWILIGHT_MENDING:
+ Talk(SAY_REGENERATE);
+ break;
default:
- generic_halionAI::SpellHit(who, spell);
break;
}
}
- void ExecuteEvent(uint32 eventId) override
+ void UpdateAI(uint32 diff) override
{
- switch (eventId)
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
{
- case EVENT_SOUL_CONSUMPTION:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, SPELL_TWILIGHT_REALM))
- DoCast(target, SPELL_SOUL_CONSUMPTION);
- events.ScheduleEvent(EVENT_SOUL_CONSUMPTION, 20000);
- break;
- default:
- generic_halionAI::ExecuteEvent(eventId);
- break;
+ switch (eventId)
+ {
+ case EVENT_CLEAVE:
+ DoCastVictim(SPELL_CLEAVE);
+ events.ScheduleEvent(EVENT_CLEAVE, randtime(Seconds(7), Seconds(10)));
+ break;
+ case EVENT_TAIL_LASH:
+ DoCastAOE(SPELL_TAIL_LASH);
+ events.ScheduleEvent(EVENT_TAIL_LASH, randtime(Seconds(12), Seconds(16)));
+ break;
+ case EVENT_BREATH:
+ DoCast(me, SPELL_DARK_BREATH);
+ events.ScheduleEvent(EVENT_BREATH, randtime(Seconds(10), Seconds(14)));
+ break;
+ case EVENT_SOUL_CONSUMPTION:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, SPELL_TWILIGHT_REALM))
+ me->CastSpell(target, SPELL_SOUL_CONSUMPTION, TRIGGERED_IGNORE_SET_FACING);
+ events.ScheduleEvent(EVENT_SOUL_CONSUMPTION, Seconds(20));
+ break;
+ default:
+ break;
+ }
}
+
+ DoMeleeAttackIfReady();
}
};
@@ -589,7 +550,6 @@ class npc_halion_controller : public CreatureScript
_instance(creature->GetInstanceScript()), _summons(me)
{
Initialize();
- me->SetPhaseMask(me->GetPhaseMask() | 0x20, true);
}
void Initialize()
@@ -599,6 +559,15 @@ class npc_halion_controller : public CreatureScript
_twilightDamageTaken = 0;
}
+ void JustRespawned() override
+ {
+ if (_instance->GetGuidData(DATA_HALION))
+ return;
+
+ Reset();
+ me->GetMap()->SummonCreature(NPC_HALION, HalionRespawnPos);
+ }
+
void Reset() override
{
_summons.DespawnAll();
@@ -626,21 +595,36 @@ class npc_halion_controller : public CreatureScript
_twilightDamageTaken = 0;
_materialDamageTaken = 0;
- _events.ScheduleEvent(EVENT_TRIGGER_BERSERK, 8 * MINUTE * IN_MILLISECONDS);
+ _events.ScheduleEvent(EVENT_TRIGGER_BERSERK, Minutes(8));
}
- void JustReachedHome() override
+ void EnterEvadeMode(EvadeReason /*why*/) override
{
if (Creature* twilightHalion = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_TWILIGHT_HALION)))
+ {
twilightHalion->DespawnOrUnsummon();
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, twilightHalion);
+ }
if (Creature* halion = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_HALION)))
{
- halion->AI()->SetData(DATA_EVADE_METHOD, 1);
- halion->AI()->EnterEvadeMode();
+ halion->DespawnOrUnsummon();
+ _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, halion);
}
_instance->SetBossState(DATA_HALION, FAIL);
+ _summons.DespawnAll();
+
+ uint32 corpseDelay = me->GetCorpseDelay();
+ uint32 respawnDelay = me->GetRespawnDelay();
+
+ me->SetCorpseDelay(1);
+ me->SetRespawnDelay(30);
+
+ me->DespawnOrUnsummon();
+
+ me->SetCorpseDelay(corpseDelay);
+ me->SetRespawnDelay(respawnDelay);
}
void DoAction(int32 action) override
@@ -650,7 +634,16 @@ class npc_halion_controller : public CreatureScript
case ACTION_INTRO_HALION:
_events.Reset();
_events.SetPhase(PHASE_INTRO);
- _events.ScheduleEvent(EVENT_START_INTRO, 2000);
+ _events.ScheduleEvent(EVENT_START_INTRO, Seconds(2));
+ break;
+ case ACTION_INTRO_HALION_2:
+ if (_instance->GetGuidData(DATA_HALION))
+ return;
+
+ for (uint8 i = DATA_BURNING_TREE_1; i <= DATA_BURNING_TREE_4; ++i)
+ if (GameObject* tree = ObjectAccessor::GetGameObject(*me, _instance->GetGuidData(i)))
+ _instance->HandleGameObject(_instance->GetGuidData(i), true, tree);
+ me->GetMap()->SummonCreature(NPC_HALION, HalionRespawnPos);
break;
case ACTION_MONITOR_CORPOREALITY:
{
@@ -678,8 +671,12 @@ class npc_halion_controller : public CreatureScript
_instance->DoUpdateWorldState(WORLDSTATE_CORPOREALITY_MATERIAL, 50);
_instance->DoUpdateWorldState(WORLDSTATE_CORPOREALITY_TWILIGHT, 50);
- _events.ScheduleEvent(EVENT_CHECK_CORPOREALITY, 7500);
+ _events.ScheduleEvent(EVENT_CHECK_CORPOREALITY, Seconds(7));
+ break;
}
+ case ACTION_ACTIVATE_EMBERS:
+ _events.ScheduleEvent(EVENT_ACTIVATE_EMBERS, Seconds(6));
+ break;
default:
break;
}
@@ -692,7 +689,7 @@ class npc_halion_controller : public CreatureScript
// combat state.
if (!_events.IsInPhase(PHASE_INTRO) && me->IsInCombat() && !UpdateVictim())
{
- EnterEvadeMode();
+ EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
return;
}
@@ -704,29 +701,31 @@ class npc_halion_controller : public CreatureScript
{
case EVENT_START_INTRO:
DoCast(me, SPELL_COSMETIC_FIRE_PILLAR, true);
- _events.ScheduleEvent(EVENT_INTRO_PROGRESS_1, 4000);
+ _events.ScheduleEvent(EVENT_INTRO_PROGRESS_1, Seconds(4));
break;
case EVENT_INTRO_PROGRESS_1:
for (uint8 i = DATA_BURNING_TREE_3; i <= DATA_BURNING_TREE_4; ++i)
if (GameObject* tree = ObjectAccessor::GetGameObject(*me, _instance->GetGuidData(i)))
_instance->HandleGameObject(_instance->GetGuidData(i), true, tree);
- _events.ScheduleEvent(EVENT_INTRO_PROGRESS_2, 4000);
+ _events.ScheduleEvent(EVENT_INTRO_PROGRESS_2, Seconds(4));
break;
case EVENT_INTRO_PROGRESS_2:
for (uint8 i = DATA_BURNING_TREE_1; i <= DATA_BURNING_TREE_2; ++i)
if (GameObject* tree = ObjectAccessor::GetGameObject(*me, _instance->GetGuidData(i)))
_instance->HandleGameObject(_instance->GetGuidData(i), true, tree);
- _events.ScheduleEvent(EVENT_INTRO_PROGRESS_3, 4000);
+ _events.ScheduleEvent(EVENT_INTRO_PROGRESS_3, Seconds(4));
break;
case EVENT_INTRO_PROGRESS_3:
DoCast(me, SPELL_FIERY_EXPLOSION);
+ if (_instance->GetGuidData(DATA_HALION))
+ return;
if (Creature* halion = me->GetMap()->SummonCreature(NPC_HALION, HalionSpawnPos))
halion->AI()->Talk(SAY_INTRO);
break;
case EVENT_TWILIGHT_MENDING:
if (ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_HALION))) // Just check if physical Halion is spawned
if (Creature* twilightHalion = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_TWILIGHT_HALION)))
- twilightHalion->CastSpell((Unit*)NULL, SPELL_TWILIGHT_MENDING, true);
+ twilightHalion->CastSpell((Unit*)nullptr, SPELL_TWILIGHT_MENDING, true);
break;
case EVENT_TRIGGER_BERSERK:
for (uint8 i = DATA_HALION; i <= DATA_TWILIGHT_HALION; i++)
@@ -734,17 +733,16 @@ class npc_halion_controller : public CreatureScript
halion->CastSpell(halion, SPELL_BERSERK, true);
break;
case EVENT_SHADOW_PULSARS_SHOOT:
- if (Creature* twilightHalion = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_TWILIGHT_HALION)))
- twilightHalion->AI()->Talk(SAY_SPHERE_PULSE);
-
if (Creature* orbCarrier = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_ORB_CARRIER)))
- orbCarrier->AI()->DoAction(ACTION_SHOOT);
-
- _events.ScheduleEvent(EVENT_SHADOW_PULSARS_SHOOT, 29000);
+ orbCarrier->AI()->DoAction(ACTION_WARNING_SHOOT);
+ _events.ScheduleEvent(EVENT_SHADOW_PULSARS_SHOOT, Seconds(30));
break;
case EVENT_CHECK_CORPOREALITY:
UpdateCorporeality();
- _events.ScheduleEvent(EVENT_CHECK_CORPOREALITY, 5000);
+ _events.ScheduleEvent(EVENT_CHECK_CORPOREALITY, Seconds(5));
+ break;
+ case EVENT_ACTIVATE_EMBERS:
+ _summons.DoZoneInCombat(NPC_LIVING_EMBER);
break;
default:
break;
@@ -770,7 +768,7 @@ class npc_halion_controller : public CreatureScript
DoZoneInCombat();
break;
case PHASE_TWO:
- _events.ScheduleEvent(EVENT_SHADOW_PULSARS_SHOOT, 29000);
+ _events.ScheduleEvent(EVENT_SHADOW_PULSARS_SHOOT, Seconds(35));
break;
default:
break;
@@ -793,7 +791,7 @@ class npc_halion_controller : public CreatureScript
uint8 oldValue = _materialCorporealityValue;
if (_twilightDamageTaken == 0 || _materialDamageTaken == 0)
{
- _events.ScheduleEvent(EVENT_TWILIGHT_MENDING, 100);
+ _events.ScheduleEvent(EVENT_TWILIGHT_MENDING, Milliseconds(100));
_twilightDamageTaken = 0;
_materialDamageTaken = 0;
return;
@@ -833,7 +831,7 @@ class npc_halion_controller : public CreatureScript
}
case CORPOREALITY_TWILIGHT_MENDING:
{
- _events.ScheduleEvent(EVENT_TWILIGHT_MENDING, 100);
+ _events.ScheduleEvent(EVENT_TWILIGHT_MENDING, Milliseconds(100));
_materialDamageTaken = 0;
_twilightDamageTaken = 0;
return;
@@ -889,52 +887,73 @@ class npc_orb_carrier : public CreatureScript
struct npc_orb_carrierAI : public ScriptedAI
{
npc_orb_carrierAI(Creature* creature) : ScriptedAI(creature),
- instance(creature->GetInstanceScript())
+ _instance(creature->GetInstanceScript())
{
ASSERT(creature->GetVehicleKit());
}
- void UpdateAI(uint32 /*diff*/) override
+ void UpdateAI(uint32 diff) override
{
/// According to sniffs this spell is cast every 1 or 2 seconds.
/// However, refreshing it looks bad, so just cast the spell if
/// we are not channeling it.
if (!me->HasUnitState(UNIT_STATE_CASTING))
- me->CastSpell((Unit*)NULL, SPELL_TRACK_ROTATION, false);
+ me->CastSpell((Unit*)nullptr, SPELL_TRACK_ROTATION, false);
+
+ scheduler.Update(diff);
/// Workaround: This is here because even though the above spell has SPELL_ATTR1_CHANNEL_TRACK_TARGET,
/// we are having two creatures involded here. This attribute is handled clientside, meaning the client
/// sends orientation update itself. Here, no packet is sent, and the creature does not rotate. By
/// forcing the carrier to always be facing the rotation focus, we ensure everything works as it should.
- if (Creature* rotationFocus = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ORB_ROTATION_FOCUS)))
+ if (Creature* rotationFocus = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_ORB_ROTATION_FOCUS)))
me->SetFacingToObject(rotationFocus); // setInFront
}
void DoAction(int32 action) override
{
- if (action == ACTION_SHOOT)
+ switch (action)
{
- Vehicle* vehicle = me->GetVehicleKit();
- Unit* southOrb = vehicle->GetPassenger(SEAT_SOUTH);
- Unit* northOrb = vehicle->GetPassenger(SEAT_NORTH);
- if (southOrb && northOrb)
+ case ACTION_WARNING_SHOOT:
{
- if (northOrb->GetTypeId() == TYPEID_UNIT)
+ Vehicle* vehicle = me->GetVehicleKit();
+ Unit* northOrb = vehicle->GetPassenger(SEAT_NORTH);
+ if (northOrb && northOrb->GetTypeId() == TYPEID_UNIT)
northOrb->ToCreature()->AI()->Talk(EMOTE_WARN_LASER);
- TriggerCutter(northOrb, southOrb);
+
+ scheduler.Schedule(Seconds(5), [this](TaskContext /*context*/)
+ {
+ DoAction(ACTION_SHOOT);
+ });
+ break;
}
+ case ACTION_SHOOT:
+ {
+ Vehicle* vehicle = me->GetVehicleKit();
+ Unit* southOrb = vehicle->GetPassenger(SEAT_SOUTH);
+ Unit* northOrb = vehicle->GetPassenger(SEAT_NORTH);
+ if (southOrb && northOrb)
+ TriggerCutter(northOrb, southOrb);
- if (!IsHeroic())
- return;
+ if (Creature* twilightHalion = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_TWILIGHT_HALION)))
+ twilightHalion->AI()->Talk(SAY_SPHERE_PULSE);
+
+ if (!IsHeroic())
+ return;
- Unit* eastOrb = vehicle->GetPassenger(SEAT_EAST);
- Unit* westOrb = vehicle->GetPassenger(SEAT_WEST);
- if (eastOrb && westOrb)
- TriggerCutter(eastOrb, westOrb);
+ Unit* eastOrb = vehicle->GetPassenger(SEAT_EAST);
+ Unit* westOrb = vehicle->GetPassenger(SEAT_WEST);
+ if (eastOrb && westOrb)
+ TriggerCutter(eastOrb, westOrb);
+ break;
+ }
+ default:
+ break;
}
}
private:
- InstanceScript* instance;
+ InstanceScript* _instance;
+ TaskScheduler scheduler;
void TriggerCutter(Unit* caster, Unit* target)
{
@@ -987,12 +1006,12 @@ class npc_meteor_strike_initial : public CreatureScript
controller->AI()->JustSummoned(me);
DoCast(me, SPELL_METEOR_STRIKE_COUNTDOWN);
- DoCast(me, SPELL_BIRTH_NO_VISUAL); // Unknown purpose
+ DoCast(me, SPELL_BIRTH_NO_VISUAL);
if (HalionAI* halionAI = CAST_AI(HalionAI, owner->AI()))
{
Position const* ownerPos = halionAI->GetMeteorStrikePosition();
- float randomAdjustment = frand(0.0f, static_cast<float>(M_PI / 5.0f));
+ float randomAdjustment = frand(static_cast<float>(M_PI / 5.0f), static_cast<float>(M_PI / 2.0f));
float angle[4];
angle[0] = me->GetAngle(ownerPos);
angle[1] = angle[0] + randomAdjustment;
@@ -1006,10 +1025,7 @@ class npc_meteor_strike_initial : public CreatureScript
me->SetOrientation(angle[i]);
Position newPos = me->GetNearPosition(10.0f, 0.0f); // Exact distance
if (Creature* meteor = me->SummonCreature(NPC_METEOR_STRIKE_NORTH + i, newPos, TEMPSUMMON_TIMED_DESPAWN, 30000))
- {
- meteor->SetOrientation(angle[i]);
_meteorList.push_back(meteor);
- }
}
}
}
@@ -1046,7 +1062,7 @@ class npc_meteor_strike : public CreatureScript
{
DoCast(me, SPELL_METEOR_STRIKE_FIRE_AURA_2, true);
me->setActive(true);
- _events.ScheduleEvent(EVENT_SPAWN_METEOR_FLAME, 500);
+ _events.ScheduleEvent(EVENT_SPAWN_METEOR_FLAME, Milliseconds(500));
}
}
@@ -1110,7 +1126,7 @@ class npc_meteor_strike_flame : public CreatureScript
void SetGUID(ObjectGuid guid, int32 /*id = 0 */) override
{
_rootOwnerGuid = guid;
- _events.ScheduleEvent(EVENT_SPAWN_METEOR_FLAME, 800);
+ _events.ScheduleEvent(EVENT_SPAWN_METEOR_FLAME, Milliseconds(800));
}
void IsSummonedBy(Unit* /*summoner*/) override
@@ -1202,7 +1218,7 @@ class npc_combustion_consumption : public CreatureScript
if (type != DATA_STACKS_DISPELLED || !_damageSpell || !_explosionSpell || !summoner)
return;
- me->CastCustomSpell(SPELL_SCALE_AURA, SPELLVALUE_AURA_STACK, stackAmount, me);
+ me->CastCustomSpell(SPELL_SCALE_AURA, SPELLVALUE_AURA_STACK, stackAmount + 1, me);
DoCast(me, _damageSpell);
int32 damage = 1200 + (stackAmount * 1290); // Needs more research.
@@ -1240,17 +1256,32 @@ class npc_living_inferno : public CreatureScript
// SMSG_SPELL_GO for the living ember stuff isn't even sent to the client - Blizzard on drugs.
if (me->GetMap()->GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC)
- me->CastSpell(me, SPELL_SPAWN_LIVING_EMBERS, true);
+ scheduler.Schedule(Seconds(3), [this](TaskContext /*context*/)
+ {
+ me->CastSpell(me, SPELL_SPAWN_LIVING_EMBERS, true);
+ });
if (InstanceScript* instance = me->GetInstanceScript())
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HALION_CONTROLLER)))
+ {
+ controller->AI()->DoAction(ACTION_ACTIVATE_EMBERS);
controller->AI()->JustSummoned(me);
+ }
}
void JustDied(Unit* /*killer*/) override
{
me->DespawnOrUnsummon(1);
}
+
+ void UpdateAI(uint32 diff) override
+ {
+ scheduler.Update(diff);
+ ScriptedAI::UpdateAI(diff);
+ }
+
+ private:
+ TaskScheduler scheduler;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -1266,27 +1297,7 @@ class npc_living_ember : public CreatureScript
struct npc_living_emberAI : public ScriptedAI
{
- npc_living_emberAI(Creature* creature) : ScriptedAI(creature)
- {
- Initialize();
- _enrageTimer = 0;
- }
-
- void Initialize()
- {
- _hasEnraged = false;
- }
-
- void Reset() override
- {
- Initialize();
- }
-
- void EnterCombat(Unit* /*who*/) override
- {
- _enrageTimer = 20000;
- _hasEnraged = false;
- }
+ npc_living_emberAI(Creature* creature) : ScriptedAI(creature) { }
void IsSummonedBy(Unit* /*summoner*/) override
{
@@ -1299,25 +1310,6 @@ class npc_living_ember : public CreatureScript
{
me->DespawnOrUnsummon(1);
}
-
- void UpdateAI(uint32 diff) override
- {
- if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
- return;
-
- if (!_hasEnraged && _enrageTimer <= diff)
- {
- _hasEnraged = true;
- DoCast(me, SPELL_BERSERK);
- }
- else _enrageTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
-
- private:
- uint32 _enrageTimer;
- bool _hasEnraged;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -1473,6 +1465,47 @@ class spell_halion_combustion_consumption : public SpellScriptLoader
uint32 _spellID;
};
+class spell_halion_combustion_consumption_periodic : public SpellScriptLoader
+{
+ public:
+ spell_halion_combustion_consumption_periodic() : SpellScriptLoader("spell_halion_combustion_consumption_periodic") { }
+
+ class spell_halion_combustion_consumption_periodic_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_halion_combustion_consumption_periodic_AuraScript);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell))
+ return false;
+ return true;
+ }
+
+ void HandleTick(AuraEffect const* aurEff)
+ {
+ PreventDefaultAction();
+ Unit* caster = GetCaster();
+ if (!caster)
+ return;
+
+ uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
+ int32 radius = caster->GetObjectScale() * M_PI * 10000 / 3;
+
+ caster->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, radius, (Unit*)nullptr, TRIGGERED_FULL_MASK, nullptr, aurEff, caster->GetGUID());
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_halion_combustion_consumption_periodic_AuraScript::HandleTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_halion_combustion_consumption_periodic_AuraScript();
+ }
+};
+
class spell_halion_marks : public SpellScriptLoader
{
public:
@@ -1511,7 +1544,7 @@ class spell_halion_marks : public SpellScriptLoader
return;
// Stacks marker
- GetTarget()->CastCustomSpell(_summonSpellId, SPELLVALUE_BASE_POINT1, aurEff->GetBase()->GetStackAmount(), GetTarget(), TRIGGERED_FULL_MASK, NULL, NULL, GetCasterGUID());
+ GetTarget()->CastCustomSpell(_summonSpellId, SPELLVALUE_BASE_POINT1, aurEff->GetBase()->GetStackAmount(), GetTarget(), TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
}
void Register() override
@@ -1819,6 +1852,35 @@ class spell_halion_spawn_living_embers : public SpellScriptLoader
}
};
+class spell_halion_blazing_aura : public SpellScriptLoader
+{
+ public:
+ spell_halion_blazing_aura() : SpellScriptLoader("spell_halion_blazing_aura") { }
+
+ class spell_halion_blazing_aura_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_halion_blazing_aura_SpellScript);
+
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+ GetHitUnit()->CastSpell(GetHitUnit(), GetSpellInfo()->Effects[EFFECT_1].TriggerSpell);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_halion_blazing_aura_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_FORCE_CAST);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_halion_blazing_aura_SpellScript();
+ }
+};
+
+
+
void AddSC_boss_halion()
{
new boss_halion();
@@ -1840,6 +1902,7 @@ void AddSC_boss_halion()
new spell_halion_combustion_consumption("spell_halion_fiery_combustion", SPELL_MARK_OF_COMBUSTION);
new spell_halion_marks("spell_halion_mark_of_combustion", SPELL_FIERY_COMBUSTION_SUMMON, SPELL_FIERY_COMBUSTION);
new spell_halion_marks("spell_halion_mark_of_consumption", SPELL_SOUL_CONSUMPTION_SUMMON, SPELL_SOUL_CONSUMPTION);
+ new spell_halion_combustion_consumption_periodic();
new spell_halion_damage_aoe_summon();
new spell_halion_twilight_realm_handlers("spell_halion_leave_twilight_realm", SPELL_SOUL_CONSUMPTION, false);
new spell_halion_twilight_realm_handlers("spell_halion_enter_twilight_realm", SPELL_FIERY_COMBUSTION, true);
@@ -1848,4 +1911,5 @@ void AddSC_boss_halion()
new spell_halion_twilight_cutter();
new spell_halion_clear_debuffs();
new spell_halion_spawn_living_embers();
+ new spell_halion_blazing_aura();
}
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
index a6cd8362db3..be85d3dc99c 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
@@ -23,7 +23,7 @@
#include "WorldPacket.h"
#include "ruby_sanctum.h"
-BossBoundaryData const boundaries =
+BossBoundaryData const boundaries =
{
{ DATA_GENERAL_ZARITHRIAN, new EllipseBoundary(Position(3013.409f, 529.492f), 45.0, 100.0) },
{ DATA_HALION, new CircleBoundary(Position(3156.037f, 533.2656f), 48.5) }
@@ -53,11 +53,11 @@ class instance_ruby_sanctum : public InstanceMapScript
void OnPlayerEnter(Player* /*player*/) override
{
- if (!GetGuidData(DATA_HALION_CONTROLLER) && GetBossState(DATA_HALION) != DONE && GetBossState(DATA_GENERAL_ZARITHRIAN) == DONE)
+ if (!GetGuidData(DATA_HALION) && GetBossState(DATA_HALION) != DONE && GetBossState(DATA_GENERAL_ZARITHRIAN) == DONE)
{
instance->LoadGrid(HalionControllerSpawnPos.GetPositionX(), HalionControllerSpawnPos.GetPositionY());
- if (Creature* halionController = instance->SummonCreature(NPC_HALION_CONTROLLER, HalionControllerSpawnPos))
- halionController->AI()->DoAction(ACTION_INTRO_HALION);
+ if (Creature* halionController = instance->GetCreature(GetGuidData(DATA_HALION_CONTROLLER)))
+ halionController->AI()->DoAction(ACTION_INTRO_HALION_2);
}
}
@@ -161,6 +161,12 @@ class instance_ruby_sanctum : public InstanceMapScript
}
}
+ void OnCreatureRemove(Creature* creature) override
+ {
+ if (creature->GetEntry() == NPC_HALION)
+ HalionGUID = ObjectGuid::Empty;
+ }
+
void OnUnitDeath(Unit* unit) override
{
Creature* creature = unit->ToCreature();
@@ -170,7 +176,7 @@ class instance_ruby_sanctum : public InstanceMapScript
if (creature->GetEntry() == NPC_GENERAL_ZARITHRIAN && GetBossState(DATA_HALION) != DONE)
{
instance->LoadGrid(HalionControllerSpawnPos.GetPositionX(), HalionControllerSpawnPos.GetPositionY());
- if (Creature* halionController = instance->SummonCreature(NPC_HALION_CONTROLLER, HalionControllerSpawnPos))
+ if (Creature* halionController = instance->GetCreature(GetGuidData(DATA_HALION_CONTROLLER)))
halionController->AI()->DoAction(ACTION_INTRO_HALION);
}
}
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
index ae4a5e2a69a..9235b75d53e 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp
@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
+#include "SpellScript.h"
#include "ruby_sanctum.h"
#include "Player.h"
@@ -45,6 +46,11 @@ enum Events
EVENT_XERESTRASZA_EVENT_7 = 7,
};
+enum Spells
+{
+ SPELL_RALLY = 75416
+};
+
Position const xerestraszaMovePos = {3151.236f, 379.8733f, 86.31996f, 0.0f};
class npc_xerestrasza : public CreatureScript
@@ -165,8 +171,53 @@ class at_baltharus_plateau : public AreaTriggerScript
}
};
+// 75415 - Rallying Shout
+class spell_ruby_sanctum_rallying_shout : public SpellScriptLoader
+{
+ public:
+ spell_ruby_sanctum_rallying_shout() : SpellScriptLoader("spell_ruby_sanctum_rallying_shout") { }
+
+ class spell_ruby_sanctum_rallying_shout_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_ruby_sanctum_rallying_shout_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_RALLY))
+ return false;
+ return true;
+ }
+
+ void CountTargets(std::list<WorldObject*>& targets)
+ {
+ _targetCount = targets.size();
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (_targetCount && !GetCaster()->HasAura(SPELL_RALLY))
+ GetCaster()->CastCustomSpell(SPELL_RALLY, SPELLVALUE_AURA_STACK, _targetCount, GetCaster(), TRIGGERED_FULL_MASK);
+ }
+
+ void Register() override
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ruby_sanctum_rallying_shout_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
+ OnEffectHit += SpellEffectFn(spell_ruby_sanctum_rallying_shout_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+
+ private:
+ uint32 _targetCount = 0;
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_ruby_sanctum_rallying_shout_SpellScript();
+ }
+};
+
void AddSC_ruby_sanctum()
{
new npc_xerestrasza();
new at_baltharus_plateau();
+ new spell_ruby_sanctum_rallying_shout();
}
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
index 69c27a22ea0..333fef1dc85 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
@@ -56,6 +56,7 @@ enum SharedActions
ACTION_INTRO_BALTHARUS = -3975101,
ACTION_BALTHARUS_DEATH = -3975102,
ACTION_INTRO_HALION = -4014601,
+ ACTION_INTRO_HALION_2 = -4014602,
};
enum CreaturesIds
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
index 00900d440c9..f6726d60db3 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
@@ -180,7 +180,7 @@ public:
{
pAnnouncer->GetMotionMaster()->MovePoint(0, 748.309f, 619.487f, 411.171f);
pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000);
+ pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, G3D::Quat(), 90000);
}
}
}
@@ -203,7 +203,7 @@ public:
{
pAnnouncer->GetMotionMaster()->MovePoint(0, 748.309f, 619.487f, 411.171f);
pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_EADRIC_LOOT_H : GO_EADRIC_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000);
+ pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_EADRIC_LOOT_H : GO_EADRIC_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, G3D::Quat(), 90000);
}
break;
case BOSS_ARGENT_CHALLENGE_P:
@@ -212,7 +212,7 @@ public:
{
pAnnouncer->GetMotionMaster()->MovePoint(0, 748.309f, 619.487f, 411.171f);
pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_PALETRESS_LOOT_H : GO_PALETRESS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000);
+ pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_PALETRESS_LOOT_H : GO_PALETRESS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, G3D::Quat(), 90000);
}
break;
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
index c89510211b9..dfe0cacdef7 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
@@ -222,10 +222,10 @@ class boss_anubarak_trial : public CreatureScript
instance->SetBossState(BOSS_ANUBARAK, FAIL);
//Summon Scarab Swarms neutral at random places
for (int i = 0; i < 10; i++)
- if (Creature* temp = me->SummonCreature(NPC_SCARAB, AnubarakLoc[1].GetPositionX()+urand(0, 50)-25, AnubarakLoc[1].GetPositionY()+urand(0, 50)-25, AnubarakLoc[1].GetPositionZ()))
+ if (Creature* scarab = me->SummonCreature(NPC_SCARAB, AnubarakLoc[1].GetPositionX()+urand(0, 50)-25, AnubarakLoc[1].GetPositionY()+urand(0, 50)-25, AnubarakLoc[1].GetPositionZ()))
{
- temp->setFaction(31);
- temp->GetMotionMaster()->MoveRandom(10);
+ scarab->setFaction(31);
+ scarab->GetMotionMaster()->MoveRandom(10);
}
}
@@ -804,7 +804,7 @@ class npc_anubarak_spike : public CreatureScript
void StartChase(Unit* who)
{
DoCast(who, SPELL_MARK);
- me->SetSpeed(MOVE_RUN, 0.5f);
+ me->SetSpeedRate(MOVE_RUN, 0.5f);
// make sure the Spine will really follow the one he should
me->getThreatManager().clearReferences();
me->SetInCombatWithZone();
@@ -881,9 +881,9 @@ class spell_anubarak_leeching_swarm : public SpellScriptLoader
if (lifeLeeched < 250)
lifeLeeched = 250;
// Damage
- caster->CastCustomSpell(target, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false);
+ caster->CastCustomSpell(target, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, true);
// Heal
- caster->CastCustomSpell(caster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, false);
+ caster->CastCustomSpell(caster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, true);
}
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
index 6c1b516c7de..ee44e1391b4 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
@@ -453,22 +453,22 @@ class boss_toc_champion_controller : public CreatureScript
for (uint8 i = 0; i < vChampionEntries.size(); ++i)
{
uint8 pos = urand(0, vChampionJumpTarget.size()-1);
- if (Creature* temp = me->SummonCreature(vChampionEntries[i], vChampionJumpOrigin[urand(0, vChampionJumpOrigin.size()-1)], TEMPSUMMON_MANUAL_DESPAWN))
+ if (Creature* champion = me->SummonCreature(vChampionEntries[i], vChampionJumpOrigin[urand(0, vChampionJumpOrigin.size()-1)], TEMPSUMMON_MANUAL_DESPAWN))
{
- _summons.Summon(temp);
- temp->SetReactState(REACT_PASSIVE);
- temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ _summons.Summon(champion);
+ champion->SetReactState(REACT_PASSIVE);
+ champion->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
if (playerTeam == ALLIANCE)
{
- temp->SetHomePosition(vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 0);
- temp->GetMotionMaster()->MoveJump(vChampionJumpTarget[pos], 20.0f, 20.0f);
- temp->SetOrientation(0);
+ champion->SetHomePosition(vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 0);
+ champion->GetMotionMaster()->MoveJump(vChampionJumpTarget[pos], 20.0f, 20.0f);
+ champion->SetOrientation(0);
}
else
{
- temp->SetHomePosition((ToCCommonLoc[1].GetPositionX()*2)-vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 3);
- temp->GetMotionMaster()->MoveJump((ToCCommonLoc[1].GetPositionX() * 2) - vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), vChampionJumpTarget[pos].GetOrientation(), 20.0f, 20.0f);
- temp->SetOrientation(3);
+ champion->SetHomePosition((ToCCommonLoc[1].GetPositionX()*2)-vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 3);
+ champion->GetMotionMaster()->MoveJump((ToCCommonLoc[1].GetPositionX() * 2) - vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), vChampionJumpTarget[pos].GetOrientation(), 20.0f, 20.0f);
+ champion->SetOrientation(3);
}
}
vChampionJumpTarget.erase(vChampionJumpTarget.begin()+pos);
@@ -485,10 +485,10 @@ class boss_toc_champion_controller : public CreatureScript
case 1:
for (SummonList::iterator i = _summons.begin(); i != _summons.end(); ++i)
{
- if (Creature* temp = ObjectAccessor::GetCreature(*me, *i))
+ if (Creature* summon = ObjectAccessor::GetCreature(*me, *i))
{
- temp->SetReactState(REACT_AGGRESSIVE);
- temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ summon->SetReactState(REACT_AGGRESSIVE);
+ summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
}
}
break;
@@ -640,12 +640,12 @@ struct boss_faction_championsAI : public BossAI
if (TeamInInstance == ALLIANCE)
{
- if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_VARIAN)))
- temp->AI()->Talk(SAY_KILL_PLAYER);
+ if (Creature* varian = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_VARIAN)))
+ varian->AI()->Talk(SAY_KILL_PLAYER);
}
else
- if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_GARROSH)))
- temp->AI()->Talk(SAY_KILL_PLAYER);
+ if (Creature* garrosh = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_GARROSH)))
+ garrosh->AI()->Talk(SAY_KILL_PLAYER);
}
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
index 2fba0c2af42..93823987d78 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
@@ -67,10 +67,12 @@ enum BossSpells
SPELL_SHIVAN_SLASH = 67098,
SPELL_SPINNING_STRIKE = 66283,
SPELL_MISTRESS_KISS = 66336,
- SPELL_FEL_INFERNO = 67047,
- SPELL_FEL_STREAK = 66494,
SPELL_LORD_HITTIN = 66326, // special effect preventing more specific spells be cast on the same player within 10 seconds
- SPELL_MISTRESS_KISS_DAMAGE_SILENCE = 66359
+ SPELL_MISTRESS_KISS_DAMAGE_SILENCE = 66359,
+
+ // Felflame Infernal
+ SPELL_FEL_STREAK_VISUAL = 66493,
+ SPELL_FEL_STREAK = 66494,
};
enum Events
@@ -116,7 +118,7 @@ class boss_jaraxxus : public CreatureScript
_JustReachedHome();
instance->SetBossState(BOSS_JARAXXUS, FAIL);
DoCast(me, SPELL_JARAXXUS_CHAINS);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
}
void KilledUnit(Unit* who) override
@@ -305,18 +307,17 @@ class npc_fel_infernal : public CreatureScript
{
npc_fel_infernalAI(Creature* creature) : ScriptedAI(creature)
{
- Initialize();
_instance = creature->GetInstanceScript();
}
- void Initialize()
- {
- _felStreakTimer = 30 * IN_MILLISECONDS;
- }
-
void Reset() override
{
- Initialize();
+ _scheduler.Schedule(Seconds(2), [this](TaskContext context)
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
+ DoCast(target, SPELL_FEL_STREAK_VISUAL);
+ context.Repeat(Seconds(15));
+ });
me->SetInCombatWithZone();
}
@@ -328,23 +329,20 @@ class npc_fel_infernal : public CreatureScript
return;
}
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
if (!UpdateVictim())
return;
- if (_felStreakTimer <= diff)
+ _scheduler.Update(diff, [this]
{
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
- DoCast(target, SPELL_FEL_STREAK);
- _felStreakTimer = 30*IN_MILLISECONDS;
- }
- else
- _felStreakTimer -= diff;
-
- DoMeleeAttackIfReady();
+ DoMeleeAttackIfReady();
+ });
}
private:
- uint32 _felStreakTimer;
InstanceScript* _instance;
+ TaskScheduler _scheduler;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -579,6 +577,39 @@ class spell_mistress_kiss_area : public SpellScriptLoader
}
};
+class spell_fel_streak_visual : public SpellScriptLoader
+{
+public:
+ spell_fel_streak_visual() : SpellScriptLoader("spell_fel_streak_visual") { }
+
+ class spell_fel_streak_visual_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_fel_streak_visual_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_FEL_STREAK))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_fel_streak_visual_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_fel_streak_visual_SpellScript();
+ }
+};
+
void AddSC_boss_jaraxxus()
{
new boss_jaraxxus();
@@ -590,4 +621,5 @@ void AddSC_boss_jaraxxus()
new spell_mistress_kiss();
new spell_mistress_kiss_area();
+ new spell_fel_streak_visual();
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
index e3720503d0a..b2283ec6fde 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
@@ -25,6 +25,7 @@
#include "Vehicle.h"
#include "Player.h"
#include "SpellScript.h"
+#include "SpellAuraEffects.h"
enum Yells
{
@@ -33,6 +34,7 @@ enum Yells
// Acidmaw & Dreadscale
EMOTE_ENRAGE = 0,
+ SAY_SPECIAL = 1,
// Icehowl
EMOTE_TRAMPLE_START = 0,
@@ -78,22 +80,29 @@ enum BossSpells
SPELL_FIRE_BOMB_DOT = 66318,
SPELL_HEAD_CRACK = 66407,
- //Acidmaw & Dreadscale
+ //Acidmaw & Dreadscale Generic
+ SPELL_SWEEP = 66794,
+ SUMMON_SLIME_POOL = 66883,
+ SPELL_EMERGE = 66947,
+ SPELL_SUBMERGE = 66948,
+ SPELL_ENRAGE = 68335,
+ SPELL_SLIME_POOL_EFFECT = 66882, //In 60s it diameter grows from 10y to 40y (r=r+0.25 per second)
+ SPELL_GROUND_VISUAL_0 = 66969,
+ SPELL_GROUND_VISUAL_1 = 68302,
+ SPELL_HATE_TO_ZERO = 63984,
+ //Acidmaw
SPELL_ACID_SPIT = 66880,
SPELL_PARALYTIC_SPRAY = 66901,
- SPELL_ACID_SPEW = 66819,
- SPELL_PARALYTIC_BITE = 66824,
- SPELL_SWEEP_0 = 66794,
- SUMMON_SLIME_POOL = 66883,
- SPELL_FIRE_SPIT = 66796,
+ SPELL_PARALYTIC_BITE = 66824, //Paralytic Toxin
+ SPELL_ACID_SPEW = 66818,
+ SPELL_PARALYSIS = 66830,
+ SPELL_PARALYTIC_TOXIN = 66823,
+ //Dreadscale
+ SPELL_BURNING_BITE = 66879, // Burning Bile
SPELL_MOLTEN_SPEW = 66821,
- SPELL_BURNING_BITE = 66879,
+ SPELL_FIRE_SPIT = 66796,
SPELL_BURNING_SPRAY = 66902,
- SPELL_SWEEP_1 = 67646,
- SPELL_EMERGE_0 = 66947,
- SPELL_SUBMERGE_0 = 66948,
- SPELL_ENRAGE = 68335,
- SPELL_SLIME_POOL_EFFECT = 66882, //In 60s it diameter grows from 10y to 40y (r=r+0.25 per second)
+ SPELL_BURNING_BILE = 66869,
//Icehowl
SPELL_FEROCIOUS_BUTT = 66770,
@@ -182,7 +191,7 @@ class boss_gormok : public CreatureScript
{
case 0:
instance->DoUseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
break;
@@ -549,7 +558,7 @@ struct boss_jormungarAI : public BossAI
if (!Enraged && instance->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL)
{
- me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0);
+ me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
DoCast(SPELL_ENRAGE);
Enraged = true;
@@ -586,10 +595,11 @@ struct boss_jormungarAI : public BossAI
case EVENT_SUMMON_ACIDMAW:
if (Creature* acidmaw = me->SummonCreature(NPC_ACIDMAW, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN))
{
- acidmaw->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ acidmaw->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
acidmaw->SetReactState(REACT_AGGRESSIVE);
acidmaw->SetInCombatWithZone();
- acidmaw->CastSpell(acidmaw, SPELL_EMERGE_0);
+ acidmaw->CastSpell(acidmaw, SPELL_EMERGE);
+ acidmaw->CastSpell(acidmaw, SPELL_GROUND_VISUAL_1, true);
}
return;
case EVENT_SPRAY:
@@ -598,7 +608,7 @@ struct boss_jormungarAI : public BossAI
events.ScheduleEvent(EVENT_SPRAY, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS), 0, PHASE_STATIONARY);
return;
case EVENT_SWEEP:
- DoCastAOE(SPELL_SWEEP_0);
+ DoCastAOE(SPELL_SWEEP);
events.ScheduleEvent(EVENT_SWEEP, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS), 0, PHASE_STATIONARY);
return;
default:
@@ -608,13 +618,14 @@ struct boss_jormungarAI : public BossAI
if (events.IsInPhase(PHASE_MOBILE))
DoMeleeAttackIfReady();
if (events.IsInPhase(PHASE_STATIONARY))
- DoSpellAttackIfReady(SpitSpell);
+ DoCastVictim(SpitSpell);
}
void Submerge()
{
- DoCast(me, SPELL_SUBMERGE_0);
- me->RemoveAurasDueToSpell(SPELL_EMERGE_0);
+ DoCast(me, SPELL_SUBMERGE);
+ DoCast(me, SPELL_GROUND_VISUAL_0, true);
+ me->RemoveAurasDueToSpell(SPELL_EMERGE);
me->SetInCombatWithZone();
events.SetPhase(PHASE_SUBMERGED);
events.ScheduleEvent(EVENT_EMERGE, 5*IN_MILLISECONDS, 0, PHASE_SUBMERGED);
@@ -625,17 +636,20 @@ struct boss_jormungarAI : public BossAI
void Emerge()
{
- DoCast(me, SPELL_EMERGE_0);
+ DoCast(me, SPELL_EMERGE);
+ DoCastAOE(SPELL_HATE_TO_ZERO, true);
me->SetDisplayId(ModelMobile);
- me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0);
+ me->RemoveAurasDueToSpell(SPELL_SUBMERGE);
+ me->RemoveAurasDueToSpell(SPELL_GROUND_VISUAL_0);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
// if the worm was mobile before submerging, make him stationary now
if (WasMobile)
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
SetCombatMovement(false);
me->SetDisplayId(ModelStationary);
+ me->CastSpell(me, SPELL_GROUND_VISUAL_1, true);
events.SetPhase(PHASE_STATIONARY);
events.ScheduleEvent(EVENT_SUBMERGE, 45*IN_MILLISECONDS, 0, PHASE_STATIONARY);
events.ScheduleEvent(EVENT_SPIT, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS), 0, PHASE_STATIONARY);
@@ -644,10 +658,11 @@ struct boss_jormungarAI : public BossAI
}
else
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
SetCombatMovement(true);
me->GetMotionMaster()->MoveChase(me->GetVictim());
me->SetDisplayId(ModelMobile);
+ me->RemoveAurasDueToSpell(SPELL_GROUND_VISUAL_1);
events.SetPhase(PHASE_MOBILE);
events.ScheduleEvent(EVENT_SUBMERGE, 45*IN_MILLISECONDS, 0, PHASE_MOBILE);
events.ScheduleEvent(EVENT_BITE, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS), 0, PHASE_MOBILE);
@@ -737,7 +752,7 @@ class boss_dreadscale : public CreatureScript
{
case 0:
instance->DoCloseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
break;
@@ -910,7 +925,7 @@ class boss_icehowl : public CreatureScript
break;
case 2:
instance->DoUseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
break;
@@ -1008,7 +1023,7 @@ class boss_icehowl : public CreatureScript
me->SetTarget(_trampleTargetGUID);
_trampleCast = false;
SetCombatMovement(false);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_REMOVE_CLIENT_CONTROL);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
events.ScheduleEvent(EVENT_TRAMPLE, 4*IN_MILLISECONDS);
@@ -1092,7 +1107,7 @@ class boss_icehowl : public CreatureScript
Talk(EMOTE_TRAMPLE_FAIL);
}
_movementStarted = false;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_REMOVE_CLIENT_CONTROL);
SetCombatMovement(true);
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->Clear();
@@ -1122,6 +1137,148 @@ class boss_icehowl : public CreatureScript
}
};
+class spell_jormungars_paralytic_toxin : public SpellScriptLoader
+{
+public:
+ spell_jormungars_paralytic_toxin() : SpellScriptLoader("spell_jormungars_paralytic_toxin") { }
+
+ class spell_jormungars_paralytic_toxin_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_jormungars_paralytic_toxin_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PARALYSIS))
+ return false;
+ return true;
+ }
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* caster = GetCaster();
+ if (caster && caster->GetEntry() == NPC_ACIDMAW)
+ {
+ if (Creature* acidMaw = caster->ToCreature())
+ acidMaw->AI()->Talk(SAY_SPECIAL, GetTarget());
+ }
+ }
+
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveAurasDueToSpell(SPELL_PARALYSIS);
+ }
+
+ void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated)
+ {
+ if (!canBeRecalculated)
+ amount = aurEff->GetAmount();
+
+ canBeRecalculated = false;
+ }
+
+ void HandleDummy(AuraEffect const* /*aurEff*/)
+ {
+ if (AuraEffect* slowEff = GetEffect(EFFECT_0))
+ {
+ int32 newAmount = slowEff->GetAmount() - 10;
+ if (newAmount < -100)
+ newAmount = -100;
+ slowEff->ChangeAmount(newAmount);
+
+ if (newAmount <= -100 && !GetTarget()->HasAura(SPELL_PARALYSIS))
+ GetTarget()->CastSpell(GetTarget(), SPELL_PARALYSIS, true, NULL, slowEff, GetCasterGUID());
+ }
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_jormungars_paralytic_toxin_AuraScript::OnApply, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_jormungars_paralytic_toxin_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_jormungars_paralytic_toxin_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_jormungars_paralytic_toxin_AuraScript::HandleDummy, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_jormungars_paralytic_toxin_AuraScript();
+ }
+};
+
+class spell_jormungars_snakes_spray : public SpellScriptLoader
+{
+public:
+ spell_jormungars_snakes_spray(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
+
+ class spell_jormungars_snakes_spray_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_jormungars_snakes_spray_SpellScript);
+
+ public:
+ spell_jormungars_snakes_spray_SpellScript(uint32 spellId) : SpellScript(), _spellId(spellId) { }
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(_spellId))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Player* target = GetHitPlayer())
+ GetCaster()->CastSpell(target, _spellId, true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_jormungars_snakes_spray_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
+ }
+
+ private:
+ uint32 _spellId;
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_jormungars_snakes_spray_SpellScript(_spellId);
+ }
+
+private:
+ uint32 _spellId;
+};
+
+class spell_jormungars_paralysis : public SpellScriptLoader
+{
+public:
+ spell_jormungars_paralysis() : SpellScriptLoader("spell_jormungars_paralysis") { }
+
+ class spell_jormungars_paralysis_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_jormungars_paralysis_AuraScript);
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ if (InstanceScript* instance = caster->GetInstanceScript())
+ if (instance->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_IN_PROGRESS || instance->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL)
+ return;
+
+ Remove();
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_jormungars_paralysis_AuraScript::OnApply, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_jormungars_paralysis_AuraScript();
+ }
+};
+
void AddSC_boss_northrend_beasts()
{
new boss_gormok();
@@ -1132,6 +1289,10 @@ void AddSC_boss_northrend_beasts()
new boss_acidmaw();
new boss_dreadscale();
new npc_slime_pool();
+ new spell_jormungars_paralytic_toxin();
+ new spell_jormungars_snakes_spray("spell_jormungars_burning_spray", SPELL_BURNING_BILE);
+ new spell_jormungars_snakes_spray("spell_jormungars_paralytic_spray", SPELL_PARALYTIC_TOXIN);
+ new spell_jormungars_paralysis();
new boss_icehowl();
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
index eb1e769c07e..c6ac59218ea 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
@@ -132,7 +132,7 @@ class OrbsDespawner : public BasicEvent
{
}
- bool Execute(uint64 /*currTime*/, uint32 /*diff*/)
+ bool Execute(uint64 /*currTime*/, uint32 /*diff*/) override
{
Trinity::CreatureWorker<OrbsDespawner> worker(_creature, *this);
_creature->VisitNearbyGridObject(5000.0f, worker);
@@ -440,10 +440,8 @@ class boss_fjola : public CreatureScript
// Allocate an unique random stage to each position in the array.
for (int i = 0; i < MAX_STAGES - 1; ++i)
{
- int random = i + (rand32() % (MAX_STAGES - i));
- int temp = Stage[i];
- Stage[i] = Stage[random];
- Stage[random] = temp;
+ int random = i + urand(0, MAX_STAGES - i);
+ std::swap(Stage[i], Stage[random]);
}
}
private:
@@ -804,8 +802,8 @@ class spell_valkyr_essences : public SpellScriptLoader
else
{
owner->CastSpell(owner, poweringUp, true);
- if (Aura* pTemp = owner->GetAura(poweringUp))
- pTemp->ModStackAmount(stacksCount);
+ if ((pAura = owner->GetAura(poweringUp)))
+ pAura->ModStackAmount(stacksCount);
}
}
}
@@ -829,8 +827,8 @@ class spell_valkyr_essences : public SpellScriptLoader
else
{
owner->CastSpell(owner, poweringUp, true);
- if (Aura* pTemp = owner->GetAura(poweringUp))
- pTemp->ModStackAmount(stacksCount);
+ if ((pAura = owner->GetAura(poweringUp)))
+ pAura->ModStackAmount(stacksCount);
}
}
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp
index b1a0f0217c4..eb4840f3b8b 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp
@@ -314,7 +314,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
if (tributeChest)
if (Creature* tirion = instance->GetCreature(TirionGUID))
- if (GameObject* chest = tirion->SummonGameObject(tributeChest, 805.62f, 134.87f, 142.16f, 3.27f, 0, 0, 0, 0, WEEK))
+ if (GameObject* chest = tirion->SummonGameObject(tributeChest, 805.62f, 134.87f, 142.16f, 3.27f, G3D::Quat(), WEEK))
chest->SetRespawnTime(chest->GetRespawnDelay());
break;
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
index 0ffe74932e0..8ea292d1de5 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
@@ -174,7 +174,7 @@ class npc_announcer_toc10 : public CreatureScript
if (Creature* jaraxxus = ObjectAccessor::GetCreature(*player, instance->GetGuidData(NPC_JARAXXUS)))
{
jaraxxus->RemoveAurasDueToSpell(SPELL_JARAXXUS_CHAINS);
- jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
jaraxxus->SetReactState(REACT_DEFENSIVE);
jaraxxus->SetInCombatWithZone();
}
@@ -360,11 +360,11 @@ class npc_fizzlebang_toc : public CreatureScript
{
Talk(SAY_STAGE_1_06, killer);
_instance->SetData(TYPE_EVENT, 1180);
- if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS)))
+ if (Creature* jaraxxus = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS)))
{
- temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- temp->SetReactState(REACT_AGGRESSIVE);
- temp->SetInCombatWithZone();
+ jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ jaraxxus->SetReactState(REACT_AGGRESSIVE);
+ jaraxxus->SetInCombatWithZone();
}
}
@@ -457,18 +457,18 @@ class npc_fizzlebang_toc : public CreatureScript
break;
case 1140:
Talk(SAY_STAGE_1_04);
- if (Creature* temp = me->SummonCreature(NPC_JARAXXUS, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 5.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
+ if (Creature* jaraxxus = me->SummonCreature(NPC_JARAXXUS, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 5.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
{
- temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- temp->SetReactState(REACT_PASSIVE);
- temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY()-10, ToCCommonLoc[1].GetPositionZ());
+ jaraxxus->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ jaraxxus->SetReactState(REACT_PASSIVE);
+ jaraxxus->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY()-10, ToCCommonLoc[1].GetPositionZ());
}
_instance->SetData(TYPE_EVENT, 1142);
_updateTimer = 5*IN_MILLISECONDS;
break;
case 1142:
- if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS)))
- temp->SetTarget(me->GetGUID());
+ if (Creature* jaraxxus = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS)))
+ jaraxxus->SetTarget(me->GetGUID());
if (Creature* pTrigger = ObjectAccessor::GetCreature(*me, _triggerGUID))
pTrigger->DespawnOrUnsummon();
if (Creature* pPortal = ObjectAccessor::GetCreature(*me, _portalGUID))
@@ -477,19 +477,19 @@ class npc_fizzlebang_toc : public CreatureScript
_updateTimer = 10*IN_MILLISECONDS;
break;
case 1144:
- if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS)))
- temp->AI()->Talk(SAY_STAGE_1_05);
+ if (Creature* jaraxxus = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS)))
+ jaraxxus->AI()->Talk(SAY_STAGE_1_05);
_instance->SetData(TYPE_EVENT, 1150);
_updateTimer = 5*IN_MILLISECONDS;
break;
case 1150:
- if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS)))
+ if (Creature* jaraxxus = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS)))
{
//1-shot Fizzlebang
- temp->CastSpell(me, 67888, false);
- me->SetInCombatWith(temp);
- temp->AddThreat(me, 1000.0f);
- temp->AI()->AttackStart(me);
+ jaraxxus->CastSpell(me, 67888, false); // 67888 - Fel Lightning
+ me->SetInCombatWith(jaraxxus);
+ jaraxxus->AddThreat(me, 1000.0f);
+ jaraxxus->AI()->AttackStart(me);
}
_instance->SetData(TYPE_EVENT, 1160);
_updateTimer = 3*IN_MILLISECONDS;
@@ -561,11 +561,11 @@ class npc_tirion_toc : public CreatureScript
{
_instance->DoUseDoorOrButton(_instance->GetGuidData(GO_MAIN_GATE_DOOR));
- if (Creature* temp = me->SummonCreature(NPC_GORMOK, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30*IN_MILLISECONDS))
+ if (Creature* gormok = me->SummonCreature(NPC_GORMOK, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30*IN_MILLISECONDS))
{
- temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
- temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
- temp->SetReactState(REACT_PASSIVE);
+ gormok->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
+ gormok->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ gormok->SetReactState(REACT_PASSIVE);
}
}
_updateTimer = 3*IN_MILLISECONDS;
@@ -582,11 +582,11 @@ class npc_tirion_toc : public CreatureScript
if (_instance->GetBossState(BOSS_BEASTS) != DONE)
{
_instance->DoUseDoorOrButton(_instance->GetGuidData(GO_MAIN_GATE_DOOR));
- if (Creature* temp = me->SummonCreature(NPC_DREADSCALE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN))
+ if (Creature* dreadscale = me->SummonCreature(NPC_DREADSCALE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN))
{
- temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
- temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
- temp->SetReactState(REACT_PASSIVE);
+ dreadscale->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
+ dreadscale->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ dreadscale->SetReactState(REACT_PASSIVE);
}
}
_updateTimer = 5*IN_MILLISECONDS;
@@ -600,9 +600,9 @@ class npc_tirion_toc : public CreatureScript
if (_instance->GetBossState(BOSS_BEASTS) != DONE)
{
_instance->DoUseDoorOrButton(_instance->GetGuidData(GO_MAIN_GATE_DOOR));
- if (Creature* temp = me->SummonCreature(NPC_ICEHOWL, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_DEAD_DESPAWN))
+ if (Creature* icehowl = me->SummonCreature(NPC_ICEHOWL, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_DEAD_DESPAWN))
{
- temp->GetMotionMaster()->MovePoint(2, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
+ icehowl->GetMotionMaster()->MovePoint(2, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
}
@@ -698,34 +698,34 @@ class npc_tirion_toc : public CreatureScript
break;
case 4010:
Talk(SAY_STAGE_3_02);
- if (Creature* temp = me->SummonCreature(NPC_LIGHTBANE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
+ if (Creature* lightbane = me->SummonCreature(NPC_LIGHTBANE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
{
- temp->SetVisible(false);
- temp->SetReactState(REACT_PASSIVE);
- temp->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[0].GetPositionX(), TwinValkyrsLoc[0].GetPositionY(), TwinValkyrsLoc[0].GetPositionZ());
- temp->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[1].GetPositionX(), TwinValkyrsLoc[1].GetPositionY(), TwinValkyrsLoc[1].GetPositionZ());
+ lightbane->SetVisible(false);
+ lightbane->SetReactState(REACT_PASSIVE);
+ lightbane->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[0].GetPositionX(), TwinValkyrsLoc[0].GetPositionY(), TwinValkyrsLoc[0].GetPositionZ());
+ lightbane->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[1].GetPositionX(), TwinValkyrsLoc[1].GetPositionY(), TwinValkyrsLoc[1].GetPositionZ());
}
- if (Creature* temp = me->SummonCreature(NPC_DARKBANE, ToCSpawnLoc[2].GetPositionX(), ToCSpawnLoc[2].GetPositionY(), ToCSpawnLoc[2].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
+ if (Creature* darkbane = me->SummonCreature(NPC_DARKBANE, ToCSpawnLoc[2].GetPositionX(), ToCSpawnLoc[2].GetPositionY(), ToCSpawnLoc[2].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
{
- temp->SetVisible(false);
- temp->SetReactState(REACT_PASSIVE);
- temp->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[2].GetPositionX(), TwinValkyrsLoc[2].GetPositionY(), TwinValkyrsLoc[2].GetPositionZ());
- temp->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[3].GetPositionX(), TwinValkyrsLoc[3].GetPositionY(), TwinValkyrsLoc[3].GetPositionZ());
+ darkbane->SetVisible(false);
+ darkbane->SetReactState(REACT_PASSIVE);
+ darkbane->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[2].GetPositionX(), TwinValkyrsLoc[2].GetPositionY(), TwinValkyrsLoc[2].GetPositionZ());
+ darkbane->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[3].GetPositionX(), TwinValkyrsLoc[3].GetPositionY(), TwinValkyrsLoc[3].GetPositionZ());
}
_updateTimer = 3*IN_MILLISECONDS;
_instance->SetData(TYPE_EVENT, 4015);
break;
case 4015:
_instance->DoUseDoorOrButton(_instance->GetGuidData(GO_MAIN_GATE_DOOR));
- if (Creature* temp = ObjectAccessor::GetCreature((*me), _instance->GetGuidData(NPC_LIGHTBANE)))
+ if (Creature* lightbane = ObjectAccessor::GetCreature((*me), _instance->GetGuidData(NPC_LIGHTBANE)))
{
- temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ());
- temp->SetVisible(true);
+ lightbane->GetMotionMaster()->MovePoint(1, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ());
+ lightbane->SetVisible(true);
}
- if (Creature* temp = ObjectAccessor::GetCreature((*me), _instance->GetGuidData(NPC_DARKBANE)))
+ if (Creature* darkbane = ObjectAccessor::GetCreature((*me), _instance->GetGuidData(NPC_DARKBANE)))
{
- temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ());
- temp->SetVisible(true);
+ darkbane->GetMotionMaster()->MovePoint(1, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ());
+ darkbane->SetVisible(true);
}
_updateTimer = 10*IN_MILLISECONDS;
_instance->SetData(TYPE_EVENT, 4016);
@@ -754,9 +754,9 @@ class npc_tirion_toc : public CreatureScript
_instance->SetData(TYPE_EVENT, 0);
break;
case 6000:
- me->SummonCreature(NPC_TIRION_FORDRING, EndSpawnLoc[0].GetPositionX(), EndSpawnLoc[0].GetPositionY(), EndSpawnLoc[0].GetPositionZ());
- me->SummonCreature(NPC_ARGENT_MAGE, EndSpawnLoc[1].GetPositionX(), EndSpawnLoc[1].GetPositionY(), EndSpawnLoc[1].GetPositionZ());
- me->SummonGameObject(GO_PORTAL_TO_DALARAN, EndSpawnLoc[2].GetPositionX(), EndSpawnLoc[2].GetPositionY(), EndSpawnLoc[2].GetPositionZ(), 5, 0, 0, 0, 0, 0);
+ me->SummonCreature(NPC_TIRION_FORDRING, EndSpawnLoc[0]);
+ me->SummonCreature(NPC_ARGENT_MAGE, EndSpawnLoc[1]);
+ me->SummonGameObject(GO_PORTAL_TO_DALARAN, EndSpawnLoc[2], G3D::Quat(), 0);
_updateTimer = 20*IN_MILLISECONDS;
_instance->SetData(TYPE_EVENT, 6005);
break;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h
index 90b9781954f..d53d6705400 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h
@@ -140,9 +140,9 @@ const Position AnubarakLoc[]=
const Position EndSpawnLoc[]=
{
- {648.9167f, 131.0208f, 141.6161f, 0}, // 0 - Highlord Tirion Fordring
- {649.1614f, 142.0399f, 141.3057f, 0}, // 1 - Argent Mage
- {644.6250f, 149.2743f, 140.6015f, 0} // 2 - Portal to Dalaran
+ {648.9167f, 131.0208f, 141.6161f, 0.f}, // 0 - Highlord Tirion Fordring
+ {649.1614f, 142.0399f, 141.3057f, 0.f}, // 1 - Argent Mage
+ {644.6250f, 149.2743f, 140.6015f, 5.f} // 2 - Portal to Dalaran
};
enum WorldStateIds
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
index ce722e391d1..292f1d7074f 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
@@ -198,8 +198,6 @@ public:
{
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
if (me->HasUnitState(UNIT_STATE_CASTING))
me->CastStop();
}
@@ -207,8 +205,6 @@ public:
{
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
DoCast(SPELL_ARCANE_FIELD);
}
}
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
index 055d0a07f41..94d1d93225c 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp
@@ -144,7 +144,7 @@ class boss_devourer_of_souls : public CreatureScript
void Reset() override
{
_Reset();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
me->SetDisplayId(DISPLAY_ANGER);
me->SetReactState(REACT_AGGRESSIVE);
@@ -297,7 +297,7 @@ class boss_devourer_of_souls : public CreatureScript
me->SetTarget(ObjectGuid::Empty);
me->GetMotionMaster()->Clear();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
wailingSoulTick = 15;
events.DelayEvents(18000); // no other events during wailing souls
@@ -317,7 +317,7 @@ class boss_devourer_of_souls : public CreatureScript
{
me->SetReactState(REACT_AGGRESSIVE);
me->SetDisplayId(DISPLAY_ANGER);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
me->GetMotionMaster()->MoveChase(me->GetVictim());
events.ScheduleEvent(EVENT_WAILING_SOULS, urand(60000, 70000));
}
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
index 4c2b92da0ea..6b20ae6a373 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
@@ -1921,6 +1921,7 @@ class npc_frostsworn_general : public CreatureScript
{
if (Creature* reflection = me->SummonCreature(NPC_REFLECTION, *target, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000))
{
+ reflection->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
target->CastSpell(reflection, SPELL_CLONE, true);
target->CastSpell(reflection, SPELL_GHOST_VISUAL, true);
reflection->AI()->AttackStart(target);
@@ -2155,6 +2156,7 @@ struct npc_escape_event_trash : public ScriptedAI
DoZoneInCombat(me, 0.0f);
if (Creature* leader = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_ESCAPE_LEADER)))
{
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetInCombatWith(leader);
leader->SetInCombatWith(me);
me->AddThreat(leader, 0.0f);
@@ -2580,7 +2582,7 @@ class npc_quel_delar_sword : public CreatureScript
void Reset() override
{
_events.Reset();
- me->SetSpeed(MOVE_FLIGHT, 4.5f, true);
+ me->SetSpeedRate(MOVE_FLIGHT, 4.5f);
DoCast(SPELL_WHIRLWIND_VISUAL);
if (_intro)
_events.ScheduleEvent(EVENT_QUEL_DELAR_INIT, 0);
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
index 03f12e46bc3..b24a36da3fb 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
@@ -418,7 +418,7 @@ class boss_krick : public CreatureScript
case EVENT_OUTRO_6:
if (Creature* tyrannus = ObjectAccessor::GetCreature(*me, _instanceScript->GetGuidData(DATA_TYRANNUS_EVENT)))
{
- tyrannus->SetSpeed(MOVE_FLIGHT, 3.5f, true);
+ tyrannus->SetSpeedRate(MOVE_FLIGHT, 3.5f);
tyrannus->GetMotionMaster()->MovePoint(1, outroPos[4]);
_tyrannusGUID = tyrannus->GetGUID();
}
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
index 96bd0aaa35e..5410f403ab9 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp
@@ -22,6 +22,7 @@
#include "pit_of_saron.h"
#include "Vehicle.h"
#include "Player.h"
+#include "PlayerAI.h"
enum Yells
{
@@ -438,9 +439,10 @@ class spell_tyrannus_overlord_brand : public SpellScriptLoader
if (GetTarget()->GetTypeId() != TYPEID_PLAYER)
return;
- oldAI = GetTarget()->GetAI();
- oldAIState = GetTarget()->IsAIEnabled;
- GetTarget()->SetAI(new player_overlord_brandAI(GetTarget()->ToPlayer(), GetCasterGUID()));
+ Player* pTarget = GetTarget()->ToPlayer();
+ oldAI = pTarget->AI();
+ oldAIState = pTarget->IsAIEnabled;
+ GetTarget()->SetAI(new player_overlord_brandAI(pTarget, GetCasterGUID()));
GetTarget()->IsAIEnabled = true;
}
@@ -450,7 +452,7 @@ class spell_tyrannus_overlord_brand : public SpellScriptLoader
return;
GetTarget()->IsAIEnabled = oldAIState;
- UnitAI* thisAI = GetTarget()->GetAI();
+ PlayerAI* thisAI = GetTarget()->ToPlayer()->AI();
GetTarget()->SetAI(oldAI);
delete thisAI;
}
@@ -461,7 +463,7 @@ class spell_tyrannus_overlord_brand : public SpellScriptLoader
AfterEffectRemove += AuraEffectRemoveFn(spell_tyrannus_overlord_brand_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
- UnitAI* oldAI;
+ PlayerAI* oldAI;
bool oldAIState;
};
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
index f59701b9c25..51711f9ded5 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
@@ -160,7 +160,7 @@ class StandUpEvent : public BasicEvent
public:
StandUpEvent(Creature& owner) : BasicEvent(), _owner(owner) { }
- bool Execute(uint64 /*eventTime*/, uint32 /*diff*/)
+ bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
{
_owner.HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
_owner.SetReactState(REACT_AGGRESSIVE);
@@ -1069,7 +1069,7 @@ class npc_blood_queen_lana_thel : public CreatureScript
if (Creature* summon = DoSummon(NPC_FLOATING_TRIGGER, triggerPos, 15000, TEMPSUMMON_TIMED_DESPAWN))
{
summon->CastSpell(summon, SPELL_OOC_INVOCATION_VISUAL, true);
- summon->SetSpeed(MOVE_FLIGHT, 0.15f, true); // todo: creature is swimming, check if this is blizzlike or not.
+ summon->SetSpeedRate(MOVE_FLIGHT, 0.15f); // todo: creature is swimming, check if this is blizzlike or not.
summon->GetMotionMaster()->MovePoint(0, triggerEndPos);
}
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
index bc8c7f877a9..3d21388ca11 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp
@@ -809,7 +809,7 @@ class spell_blood_queen_pact_of_the_darkfallen_dmg : public SpellScriptLoader
// this is an additional effect to be executed
void PeriodicTick(AuraEffect const* aurEff)
{
- SpellInfo const* damageSpell = sSpellMgr->EnsureSpellInfo(SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE);
+ SpellInfo const* damageSpell = sSpellMgr->AssertSpellInfo(SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE);
int32 damage = damageSpell->Effects[EFFECT_0].CalcValue();
float multiplier = 0.3375f + 0.1f * uint32(aurEff->GetTickNumber()/10); // do not convert to 0.01f - we need tick number/10 as INT (damage increases every 10 ticks)
damage = int32(damage * multiplier);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
index 9b0693ec95e..73a7de36580 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
@@ -1843,7 +1843,7 @@ class spell_igb_rocket_pack : public SpellScriptLoader
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
- SpellInfo const* damageInfo = sSpellMgr->EnsureSpellInfo(SPELL_ROCKET_PACK_DAMAGE);
+ SpellInfo const* damageInfo = sSpellMgr->AssertSpellInfo(SPELL_ROCKET_PACK_DAMAGE);
GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetAmplitude()), NULL, TRIGGERED_FULL_MASK);
GetTarget()->CastSpell(NULL, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK);
}
@@ -2461,6 +2461,33 @@ class spell_igb_teleport_players_on_victory : public SpellScriptLoader
}
};
+// 71201 - Battle Experience - proc should never happen, handled in script
+class spell_igb_battle_experience_check : public SpellScriptLoader
+{
+public:
+ spell_igb_battle_experience_check() : SpellScriptLoader("spell_igb_battle_experience_check") { }
+
+ class spell_igb_battle_experience_check_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_igb_battle_experience_check_AuraScript);
+
+ bool CheckProc(ProcEventInfo& /*eventInfo*/)
+ {
+ return false;
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_igb_battle_experience_check_AuraScript::CheckProc);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_igb_battle_experience_check_AuraScript();
+ }
+};
+
class achievement_im_on_a_boat : public AchievementCriteriaScript
{
public:
@@ -2500,5 +2527,6 @@ void AddSC_boss_icecrown_gunship_battle()
new spell_igb_gunship_fall_teleport();
new spell_igb_check_for_players();
new spell_igb_teleport_players_on_victory();
+ new spell_igb_battle_experience_check();
new achievement_im_on_a_boat();
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
index d3cf6495aa7..b3a11b8eb31 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
@@ -203,7 +203,7 @@ class DaranavanMoveEvent : public BasicEvent
public:
DaranavanMoveEvent(Creature& darnavan) : _darnavan(darnavan) { }
- bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_darnavan.GetMotionMaster()->MovePoint(POINT_DESPAWN, SummonPositions[6]);
return true;
@@ -421,7 +421,7 @@ class boss_lady_deathwhisper : public CreatureScript
void UpdateAI(uint32 diff) override
{
- if ((!UpdateVictim() && !events.IsInPhase(PHASE_INTRO)))
+ if (!UpdateVictim() && !events.IsInPhase(PHASE_INTRO))
return;
events.Update(diff);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
index 056231285e2..9f20799df82 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
@@ -142,7 +142,7 @@ class boss_lord_marrowgar : public CreatureScript
void Reset() override
{
_Reset();
- me->SetSpeed(MOVE_RUN, _baseSpeed, true);
+ me->SetSpeedRate(MOVE_RUN, _baseSpeed);
me->RemoveAurasDueToSpell(SPELL_BONE_STORM);
me->RemoveAurasDueToSpell(SPELL_BERSERK);
events.ScheduleEvent(EVENT_ENABLE_BONE_SLICE, 10000);
@@ -224,7 +224,7 @@ class boss_lord_marrowgar : public CreatureScript
case EVENT_BONE_STORM_BEGIN:
if (Aura* pStorm = me->GetAura(SPELL_BONE_STORM))
pStorm->SetDuration(int32(_boneStormDuration));
- me->SetSpeed(MOVE_RUN, _baseSpeed*3.0f, true);
+ me->SetSpeedRate(MOVE_RUN, _baseSpeed*3.0f);
Talk(SAY_BONE_STORM);
events.ScheduleEvent(EVENT_BONE_STORM_END, _boneStormDuration+1);
// no break here
@@ -242,7 +242,7 @@ class boss_lord_marrowgar : public CreatureScript
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MoveChase(me->GetVictim());
- me->SetSpeed(MOVE_RUN, _baseSpeed, true);
+ me->SetSpeedRate(MOVE_RUN, _baseSpeed);
events.CancelEvent(EVENT_BONE_STORM_MOVE);
events.ScheduleEvent(EVENT_ENABLE_BONE_SLICE, 10000);
if (!IsHeroic())
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index 2db9d206a00..fe6e4081326 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -369,21 +369,21 @@ class boss_professor_putricide : public CreatureScript
{
case POINT_FESTERGUT:
instance->SetBossState(DATA_FESTERGUT, IN_PROGRESS); // needed here for delayed gate close
- me->SetSpeed(MOVE_RUN, _baseSpeed, true);
+ me->SetSpeedRate(MOVE_RUN, _baseSpeed);
DoAction(ACTION_FESTERGUT_GAS);
if (Creature* festergut = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FESTERGUT)))
festergut->CastSpell(festergut, SPELL_GASEOUS_BLIGHT_LARGE, false, NULL, NULL, festergut->GetGUID());
break;
case POINT_ROTFACE:
instance->SetBossState(DATA_ROTFACE, IN_PROGRESS); // needed here for delayed gate close
- me->SetSpeed(MOVE_RUN, _baseSpeed, true);
+ me->SetSpeedRate(MOVE_RUN, _baseSpeed);
DoAction(ACTION_ROTFACE_OOZE);
events.ScheduleEvent(EVENT_ROTFACE_OOZE_FLOOD, 25000, 0, PHASE_ROTFACE);
break;
case POINT_TABLE:
// stop attack
me->GetMotionMaster()->MoveIdle();
- me->SetSpeed(MOVE_RUN, _baseSpeed, true);
+ me->SetSpeedRate(MOVE_RUN, _baseSpeed);
if (GameObject* table = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_PUTRICIDE_TABLE)))
me->SetFacingToObject(table);
// operating on new phase already
@@ -418,7 +418,7 @@ class boss_professor_putricide : public CreatureScript
{
case ACTION_FESTERGUT_COMBAT:
SetPhase(PHASE_FESTERGUT);
- me->SetSpeed(MOVE_RUN, _baseSpeed*2.0f, true);
+ me->SetSpeedRate(MOVE_RUN, _baseSpeed*2.0f);
me->GetMotionMaster()->MovePoint(POINT_FESTERGUT, festergutWatchPos);
me->SetReactState(REACT_PASSIVE);
DoZoneInCombat(me);
@@ -435,7 +435,7 @@ class boss_professor_putricide : public CreatureScript
case ACTION_ROTFACE_COMBAT:
{
SetPhase(PHASE_ROTFACE);
- me->SetSpeed(MOVE_RUN, _baseSpeed*2.0f, true);
+ me->SetSpeedRate(MOVE_RUN, _baseSpeed*2.0f);
me->GetMotionMaster()->MovePoint(POINT_ROTFACE, rotfaceWatchPos);
me->SetReactState(REACT_PASSIVE);
_oozeFloodStage = 0;
@@ -477,7 +477,7 @@ class boss_professor_putricide : public CreatureScript
events.ScheduleEvent(EVENT_ROTFACE_DIES, 4500, 0, PHASE_ROTFACE);
break;
case ACTION_CHANGE_PHASE:
- me->SetSpeed(MOVE_RUN, _baseSpeed*2.0f, true);
+ me->SetSpeedRate(MOVE_RUN, _baseSpeed*2.0f);
events.DelayEvents(30000);
me->AttackStop();
if (!IsHeroic())
@@ -562,7 +562,7 @@ class boss_professor_putricide : public CreatureScript
void UpdateAI(uint32 diff) override
{
- if ((!(events.IsInPhase(PHASE_ROTFACE) || events.IsInPhase(PHASE_FESTERGUT)) && !UpdateVictim()))
+ if (!(events.IsInPhase(PHASE_ROTFACE) || events.IsInPhase(PHASE_FESTERGUT)) && !UpdateVictim())
return;
events.Update(diff);
@@ -776,7 +776,7 @@ class npc_volatile_ooze : public CreatureScript
{
}
- void CastMainSpell()
+ void CastMainSpell() override
{
me->CastSpell(me, SPELL_VOLATILE_OOZE_ADHESIVE, false);
}
@@ -800,7 +800,7 @@ class npc_gas_cloud : public CreatureScript
_newTargetSelectTimer = 0;
}
- void CastMainSpell()
+ void CastMainSpell() override
{
me->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, me, false);
}
@@ -1257,7 +1257,7 @@ class spell_putricide_mutated_plague : public SpellScriptLoader
return;
uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
- SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(triggerSpell);
+ SpellInfo const* spell = sSpellMgr->AssertSpellInfo(triggerSpell);
spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, caster);
int32 damage = spell->Effects[EFFECT_0].CalcValue(caster);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
index 683dd976b7a..bf69a49055c 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
@@ -856,14 +856,14 @@ class spell_rotface_vile_gas_trigger : public SpellScriptLoader
GetCaster()->CastSpell(GetHitUnit(), SPELL_VILE_GAS_TRIGGER_SUMMON);
}
- void Register()
+ void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_vile_gas_trigger_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_rotface_vile_gas_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
- SpellScript* GetSpellScript() const
+ SpellScript* GetSpellScript() const override
{
return new spell_rotface_vile_gas_trigger_SpellScript();
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
index ac094588d35..aa5060e83b4 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
@@ -134,6 +134,7 @@ enum FrostwingData
DATA_WHELP_MARKER = 2,
DATA_LINKED_GAMEOBJECT = 3,
DATA_TRAPPED_PLAYER = 4,
+ DATA_IS_THIRD_PHASE = 5
};
enum MovementPoints
@@ -168,7 +169,7 @@ class FrostwyrmLandEvent : public BasicEvent
public:
FrostwyrmLandEvent(Creature& owner, Position const& dest) : _owner(owner), _dest(dest) { }
- bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
+ bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override
{
_owner.GetMotionMaster()->MoveLand(POINT_FROSTWYRM_LAND, _dest);
return true;
@@ -184,7 +185,7 @@ class FrostBombExplosion : public BasicEvent
public:
FrostBombExplosion(Creature* owner, ObjectGuid sindragosaGUID) : _owner(owner), _sindragosaGUID(sindragosaGUID) { }
- bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
+ bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override
{
_owner->CastSpell((Unit*)NULL, SPELL_FROST_BOMB, false, NULL, NULL, _sindragosaGUID);
_owner->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL);
@@ -196,20 +197,19 @@ class FrostBombExplosion : public BasicEvent
ObjectGuid _sindragosaGUID;
};
-class FrostBeaconSelector
+class FrostBeaconSelector : NonTankTargetSelector
{
public:
- FrostBeaconSelector(Unit* source) : _source(source) { }
+ FrostBeaconSelector(Unit* source) : NonTankTargetSelector(source, true) { }
- bool operator()(Unit* target) const
+ bool operator()(WorldObject* target) const
{
- return target->GetTypeId() == TYPEID_PLAYER &&
- target != _source->GetVictim() &&
- !target->HasAura(SPELL_ICE_TOMB_UNTARGETABLE);
- }
+ if (Unit* unitTarget = target->ToUnit())
+ return !NonTankTargetSelector::operator()(unitTarget) ||
+ unitTarget->HasAura(SPELL_ICE_TOMB_UNTARGETABLE);
- private:
- Unit* _source;
+ return false;
+ }
};
class boss_sindragosa : public CreatureScript
@@ -315,7 +315,7 @@ class boss_sindragosa : public CreatureScript
me->SetCanFly(true);
me->SetDisableGravity(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
- me->SetSpeed(MOVE_FLIGHT, 4.0f);
+ me->SetSpeedRate(MOVE_FLIGHT, 4.0f);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
float moveTime = me->GetExactDist(&SindragosaFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, SindragosaLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250));
@@ -326,9 +326,15 @@ class boss_sindragosa : public CreatureScript
uint32 GetData(uint32 type) const override
{
- if (type == DATA_MYSTIC_BUFFET_STACK)
- return _mysticBuffetStack;
- return 0xFFFFFFFF;
+ switch (type)
+ {
+ case DATA_MYSTIC_BUFFET_STACK:
+ return _mysticBuffetStack;
+ case DATA_IS_THIRD_PHASE:
+ return _isThirdPhase;
+ default:
+ return 0xFFFFFFFF;
+ }
}
void MovementInform(uint32 type, uint32 point) override
@@ -345,7 +351,7 @@ class boss_sindragosa : public CreatureScript
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetHomePosition(SindragosaLandPos);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->SetSpeed(MOVE_FLIGHT, 2.5f);
+ me->SetSpeedRate(MOVE_FLIGHT, 2.5f);
// Sindragosa enters combat as soon as she lands
DoZoneInCombat();
@@ -419,7 +425,6 @@ class boss_sindragosa : public CreatureScript
if (spellId == spell->Id)
if (Aura const* mysticBuffet = target->GetAura(spell->Id))
_mysticBuffetStack = std::max<uint8>(_mysticBuffetStack, mysticBuffet->GetStackAmount());
-
}
void UpdateAI(uint32 diff) override
@@ -494,11 +499,7 @@ class boss_sindragosa : public CreatureScript
me->GetMotionMaster()->MovePoint(POINT_AIR_PHASE_FAR, SindragosaAirPosFar);
break;
case EVENT_ICE_TOMB:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, FrostBeaconSelector(me)))
- {
- Talk(EMOTE_WARN_FROZEN_ORB, target);
- me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, 1, nullptr, TRIGGERED_FULL_MASK);
- }
+ me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, 1, nullptr, TRIGGERED_FULL_MASK);
events.ScheduleEvent(EVENT_ICE_TOMB, urand(16000, 23000));
break;
case EVENT_FROST_BOMB:
@@ -603,6 +604,7 @@ class npc_ice_tomb : public CreatureScript
_trappedPlayerGUID.Clear();
player->RemoveAurasDueToSpell(SPELL_ICE_TOMB_DAMAGE);
player->RemoveAurasDueToSpell(SPELL_ASPHYXIATION);
+ player->RemoveAurasDueToSpell(SPELL_ICE_TOMB_UNTARGETABLE);
}
}
@@ -696,7 +698,7 @@ class npc_spinestalker : public CreatureScript
return;
me->setActive(true);
- me->SetSpeed(MOVE_FLIGHT, 2.0f);
+ me->SetSpeedRate(MOVE_FLIGHT, 2.0f);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
float moveTime = me->GetExactDist(&SpinestalkerFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, SpinestalkerLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250));
@@ -833,7 +835,7 @@ class npc_rimefang : public CreatureScript
return;
me->setActive(true);
- me->SetSpeed(MOVE_FLIGHT, 2.0f);
+ me->SetSpeedRate(MOVE_FLIGHT, 2.0f);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
float moveTime = me->GetExactDist(&RimefangFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, RimefangLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250));
@@ -1283,9 +1285,9 @@ class spell_sindragosa_ice_tomb : public SpellScriptLoader
public:
spell_sindragosa_ice_tomb() : SpellScriptLoader("spell_sindragosa_ice_tomb_trap") { }
- class spell_sindragosa_ice_tomb_SpellScript : public SpellScript
+ class spell_sindragosa_ice_tomb_AuraScript : public AuraScript
{
- PrepareSpellScript(spell_sindragosa_ice_tomb_SpellScript);
+ PrepareAuraScript(spell_sindragosa_ice_tomb_AuraScript);
bool Validate(SpellInfo const* /*spell*/) override
{
@@ -1296,46 +1298,42 @@ class spell_sindragosa_ice_tomb : public SpellScriptLoader
return true;
}
- void SummonTomb()
+ void PeriodicTick(AuraEffect const* aurEff)
{
- Position pos = GetHitUnit()->GetPosition();
- if (TempSummon* summon = GetCaster()->SummonCreature(NPC_ICE_TOMB, pos))
+ PreventDefaultAction();
+
+ if (aurEff->GetTickNumber() == 1)
{
- summon->AI()->SetGUID(GetHitUnit()->GetGUID(), DATA_TRAPPED_PLAYER);
- if (GameObject* go = summon->SummonGameObject(GO_ICE_BLOCK, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0))
+ if (Unit* caster = GetCaster())
{
- go->SetSpellId(SPELL_ICE_TOMB_DAMAGE);
- summon->AddGameObject(go);
+ Position pos = GetTarget()->GetPosition();
+
+ if (TempSummon* summon = caster->SummonCreature(NPC_ICE_TOMB, pos))
+ {
+ summon->AI()->SetGUID(GetTarget()->GetGUID(), DATA_TRAPPED_PLAYER);
+ GetTarget()->CastSpell(GetTarget(), SPELL_ICE_TOMB_UNTARGETABLE);
+ if (GameObject* go = summon->SummonGameObject(GO_ICE_BLOCK, pos, G3D::Quat(), 0))
+ {
+ go->SetSpellId(SPELL_ICE_TOMB_DAMAGE);
+ summon->AddGameObject(go);
+ }
+ }
}
}
}
- void Register() override
+ void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- AfterHit += SpellHitFn(spell_sindragosa_ice_tomb_SpellScript::SummonTomb);
- }
- };
-
- class spell_sindragosa_ice_tomb_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_sindragosa_ice_tomb_AuraScript);
-
- void PeriodicTick(AuraEffect const* /*aurEff*/)
- {
- PreventDefaultAction();
+ GetTarget()->RemoveAurasDueToSpell(SPELL_ICE_TOMB_UNTARGETABLE);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sindragosa_ice_tomb_AuraScript::PeriodicTick, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_sindragosa_ice_tomb_AuraScript::HandleRemove, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
- SpellScript* GetSpellScript() const override
- {
- return new spell_sindragosa_ice_tomb_SpellScript();
- }
-
AuraScript* GetAuraScript() const override
{
return new spell_sindragosa_ice_tomb_AuraScript();
@@ -1576,6 +1574,41 @@ class spell_frostwarden_handler_focus_fire : public SpellScriptLoader
}
};
+class spell_sindragosa_ice_tomb_target : public SpellScriptLoader
+{
+public:
+ spell_sindragosa_ice_tomb_target() : SpellScriptLoader("spell_sindragosa_ice_tomb_target") { }
+
+ class spell_sindragosa_ice_tomb_target_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_sindragosa_ice_tomb_target_SpellScript);
+
+ void FilterTargets(std::list<WorldObject*>& unitList)
+ {
+ Unit* caster = GetCaster();
+ unitList.remove_if(FrostBeaconSelector(caster));
+ }
+
+ void HandleSindragosaTalk(SpellEffIndex /*effIndex*/)
+ {
+ if (Creature* creatureCaster = GetCaster()->ToCreature())
+ if (creatureCaster->GetAI()->GetData(DATA_IS_THIRD_PHASE))
+ creatureCaster->AI()->Talk(EMOTE_WARN_FROZEN_ORB, GetHitUnit());
+ }
+
+ void Register() override
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_ice_tomb_target_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnEffectLaunchTarget += SpellEffectFn(spell_sindragosa_ice_tomb_target_SpellScript::HandleSindragosaTalk, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_sindragosa_ice_tomb_target_SpellScript();
+ }
+};
+
class at_sindragosa_lair : public AreaTriggerScript
{
public:
@@ -1641,6 +1674,7 @@ void AddSC_boss_sindragosa()
new spell_frostwarden_handler_focus_fire();
new spell_trigger_spell_from_caster("spell_sindragosa_ice_tomb", SPELL_ICE_TOMB_DUMMY, TRIGGERED_IGNORE_SET_FACING);
new spell_trigger_spell_from_caster("spell_sindragosa_ice_tomb_dummy", SPELL_FROST_BEACON);
+ new spell_sindragosa_ice_tomb_target();
new at_sindragosa_lair();
new achievement_all_you_can_eat();
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
index a598b09c71b..de8d65693b9 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -285,6 +285,7 @@ enum Phases
#define PHASE_TWO_THREE (events.IsInPhase(PHASE_TWO) ? PHASE_TWO : PHASE_THREE)
Position const CenterPosition = {503.6282f, -2124.655f, 840.8569f, 0.0f};
+Position const TirionSpawn = {505.2118f, -2124.353f, 840.9403f, 3.141593f};
Position const TirionIntro = {489.2970f, -2124.840f, 840.8569f, 0.0f};
Position const TirionCharge = {482.9019f, -2124.479f, 840.8570f, 0.0f};
Position const LichKingIntro[3] =
@@ -436,7 +437,7 @@ class StartMovementEvent : public BasicEvent
{
}
- bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_owner->SetReactState(REACT_AGGRESSIVE);
if (Creature* _summoner = ObjectAccessor::GetCreature(*_owner, _summonerGuid))
@@ -458,7 +459,7 @@ class VileSpiritActivateEvent : public BasicEvent
{
}
- bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_owner->SetReactState(REACT_AGGRESSIVE);
_owner->CastSpell(_owner, SPELL_VILE_SPIRIT_MOVE_SEARCH, true);
@@ -478,7 +479,7 @@ class TriggerWickedSpirit : public BasicEvent
{
}
- bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_owner->CastCustomSpell(SPELL_TRIGGER_VILE_SPIRIT_HEROIC, SPELLVALUE_MAX_TARGETS, 1, NULL, true);
@@ -514,13 +515,34 @@ class boss_the_lich_king : public CreatureScript
_vileSpiritExplosions = 0;
}
- void Reset() override
+ void InitializeAI() override
+ {
+ SetupEncounter();
+ }
+
+ void JustRespawned() override
+ {
+ SetupEncounter();
+ }
+
+ void SetupEncounter()
{
_Reset();
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_PASSIVE);
events.SetPhase(PHASE_INTRO);
Initialize();
SetEquipmentSlots(true);
+
+ // Reset The Frozen Throne gameobjects
+ FrozenThroneResetWorker reset;
+ Trinity::GameObjectWorker<FrozenThroneResetWorker> worker(me, reset);
+ me->VisitNearbyGridObject(333.0f, worker);
+
+ // Reset any light override
+ me->GetMap()->SetZoneOverrideLight(AREA_THE_FROZEN_THRONE, 0, 5000);
+
+ me->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING_LK, TirionSpawn, TEMPSUMMON_MANUAL_DESPAWN);
}
void JustDied(Unit* /*killer*/) override
@@ -556,40 +578,21 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_SHADOW_TRAP, 15500, 0, PHASE_ONE);
}
- void JustReachedHome() override
- {
- _JustReachedHome();
- instance->SetBossState(DATA_THE_LICH_KING, NOT_STARTED);
-
- // Reset The Frozen Throne gameobjects
- FrozenThroneResetWorker reset;
- Trinity::GameObjectWorker<FrozenThroneResetWorker> worker(me, reset);
- me->VisitNearbyGridObject(333.0f, worker);
-
- // Restore Tirion's gossip only after The Lich King fully resets to prevent
- // restarting the encounter while LK still runs back to spawn point
- if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HIGHLORD_TIRION_FORDRING)))
- tirion->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- // Reset any light override
- me->GetMap()->SetZoneOverrideLight(AREA_THE_FROZEN_THRONE, 0, 5000);
- }
-
bool CanAIAttack(Unit const* target) const override
{
// The Lich King must not select targets in frostmourne room if he killed everyone outside
return !target->HasAura(SPELL_IN_FROSTMOURNE_ROOM) && BossAI::CanAIAttack(target);
}
- void EnterEvadeMode(EvadeReason why) override
+ void EnterEvadeMode(EvadeReason /*why*/) override
{
- instance->SetBossState(DATA_THE_LICH_KING, FAIL);
- BossAI::EnterEvadeMode(why);
if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HIGHLORD_TIRION_FORDRING)))
- tirion->AI()->EnterEvadeMode();
+ tirion->DespawnOrUnsummon();
DoCastAOE(SPELL_KILL_FROSTMOURNE_PLAYERS);
EntryCheckPredicate pred(NPC_STRANGULATE_VEHICLE);
summons.DoAction(ACTION_TELEPORT_BACK, pred);
+ summons.DespawnAll();
+ _DespawnAtEvade();
}
void KilledUnit(Unit* victim) override
@@ -761,7 +764,7 @@ class boss_the_lich_king : public CreatureScript
{
summons.Summon(summon);
summon->SetReactState(REACT_PASSIVE);
- summon->SetSpeed(MOVE_FLIGHT, 0.5f);
+ summon->SetSpeedRate(MOVE_FLIGHT, 0.5f);
summon->GetMotionMaster()->MoveRandom(10.0f);
if (!events.IsInPhase(PHASE_FROSTMOURNE))
summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(15000));
@@ -770,6 +773,8 @@ class boss_the_lich_king : public CreatureScript
case NPC_STRANGULATE_VEHICLE:
summons.Summon(summon);
return;
+ case NPC_HIGHLORD_TIRION_FORDRING_LK:
+ return;
default:
break;
}
@@ -1153,6 +1158,7 @@ class npc_tirion_fordring_tft : public CreatureScript
_events.Reset();
if (_instance->GetBossState(DATA_THE_LICH_KING) == DONE)
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->LoadEquipment(1);
}
void MovementInform(uint32 type, uint32 id) override
@@ -1443,7 +1449,7 @@ class npc_valkyr_shadowguard : public CreatureScript
_events.Reset();
me->SetReactState(REACT_PASSIVE);
DoCast(me, SPELL_WINGS_OF_THE_DAMNED, false);
- me->SetSpeed(MOVE_FLIGHT, 0.642857f, true);
+ me->SetSpeedRate(MOVE_FLIGHT, 0.642857f);
}
void IsSummonedBy(Unit* /*summoner*/) override
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
index 4f35f848927..b07de3457bd 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
@@ -179,7 +179,7 @@ class DelayedCastEvent : public BasicEvent
{
}
- bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_trigger->CastSpell(_trigger, _spellId, false, NULL, NULL, _originalCaster);
if (_despawnTime)
@@ -201,7 +201,7 @@ class AuraRemoveEvent : public BasicEvent
{
}
- bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_trigger->RemoveAurasDueToSpell(_spellId);
return true;
@@ -219,7 +219,7 @@ class ValithriaDespawner : public BasicEvent
{
}
- bool Execute(uint64 /*currTime*/, uint32 /*diff*/)
+ bool Execute(uint64 /*currTime*/, uint32 /*diff*/) override
{
Trinity::CreatureWorker<ValithriaDespawner> worker(_creature, *this);
_creature->VisitNearbyGridObject(333.0f, worker);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index 25ca99f6a20..abb9c025771 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -365,7 +365,7 @@ class CaptainSurviveTalk : public BasicEvent
public:
explicit CaptainSurviveTalk(Creature const& owner) : _owner(owner) { }
- bool Execute(uint64 /*currTime*/, uint32 /*diff*/)
+ bool Execute(uint64 /*currTime*/, uint32 /*diff*/) override
{
_owner.AI()->Talk(SAY_CAPTAIN_SURVIVE_TALK);
return true;
diff --git a/src/server/scripts/Northrend/IsleOfConquest/boss_ioc_horde_alliance.cpp b/src/server/scripts/Northrend/IsleOfConquest/boss_ioc_horde_alliance.cpp
new file mode 100644
index 00000000000..71d90da21a1
--- /dev/null
+++ b/src/server/scripts/Northrend/IsleOfConquest/boss_ioc_horde_alliance.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "BattlegroundIC.h"
+
+enum BossSpells
+{
+ SPELL_BRUTAL_STRIKE = 58460,
+ SPELL_DAGGER_THROW = 67280,
+ SPELL_CRUSHING_LEAP = 68506,
+ SPELL_RAGE = 66776
+};
+
+enum BossEvents
+{
+ EVENT_BRUTAL_STRIKE = 1,
+ EVENT_DAGGER_THROW = 2,
+ EVENT_CRUSHING_LEAP = 3,
+ EVENT_CHECK_RANGE = 4
+};
+
+class boss_ioc_horde_alliance : public CreatureScript
+{
+public:
+ boss_ioc_horde_alliance() : CreatureScript("boss_ioc_horde_alliance") { }
+
+ struct boss_ioc_horde_allianceAI : public ScriptedAI
+ {
+ boss_ioc_horde_allianceAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void Reset() override
+ {
+ _events.Reset();
+
+ uint32 _npcGuard;
+ if (me->GetEntry() == NPC_HIGH_COMMANDER_HALFORD_WYRMBANE)
+ _npcGuard = NPC_SEVEN_TH_LEGION_INFANTRY;
+ else
+ _npcGuard = NPC_KOR_KRON_GUARD;
+
+ std::list<Creature*> guardsList;
+ me->GetCreatureListWithEntryInGrid(guardsList, _npcGuard, 100.0f);
+ for (std::list<Creature*>::const_iterator itr = guardsList.begin(); itr != guardsList.end(); ++itr)
+ (*itr)->Respawn();
+ };
+
+ void EnterCombat(Unit* /*who*/) override
+ {
+ _events.ScheduleEvent(EVENT_BRUTAL_STRIKE, 5 * IN_MILLISECONDS);
+ _events.ScheduleEvent(EVENT_DAGGER_THROW, 7 * IN_MILLISECONDS);
+ _events.ScheduleEvent(EVENT_CHECK_RANGE, 1 * IN_MILLISECONDS);
+ _events.ScheduleEvent(EVENT_CRUSHING_LEAP, 15 * IN_MILLISECONDS);
+ }
+
+ void SpellHit(Unit* caster, SpellInfo const* /*spell*/) override
+ {
+ if (caster->IsVehicle())
+ me->Kill(caster);
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ _events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_BRUTAL_STRIKE:
+ DoCastVictim(SPELL_BRUTAL_STRIKE);
+ _events.ScheduleEvent(EVENT_BRUTAL_STRIKE, 5 * IN_MILLISECONDS);
+ break;
+ case EVENT_DAGGER_THROW:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
+ DoCast(target, SPELL_DAGGER_THROW);
+ _events.ScheduleEvent(EVENT_DAGGER_THROW, 7 * IN_MILLISECONDS);
+ break;
+ case EVENT_CRUSHING_LEAP:
+ DoCastVictim(SPELL_CRUSHING_LEAP);
+ _events.ScheduleEvent(EVENT_CRUSHING_LEAP, 25 * IN_MILLISECONDS);
+ break;
+ case EVENT_CHECK_RANGE:
+ if (me->GetDistance(me->GetHomePosition()) > 25.0f)
+ DoCast(me, SPELL_RAGE);
+ else
+ me->RemoveAurasDueToSpell(SPELL_RAGE);
+ _events.ScheduleEvent(EVENT_CHECK_RANGE, 1 * IN_MILLISECONDS);
+ break;
+ default:
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ EventMap _events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new boss_ioc_horde_allianceAI(creature);
+ }
+};
+
+void AddSC_boss_ioc_horde_alliance()
+{
+ new boss_ioc_horde_alliance();
+}
diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp
index 68121e940c9..f7e83ff1f42 100644
--- a/src/server/scripts/Northrend/isle_of_conquest.cpp
+++ b/src/server/scripts/Northrend/IsleOfConquest/isle_of_conquest.cpp
@@ -210,7 +210,7 @@ class StartLaunchEvent : public BasicEvent
{
}
- bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
Player* player = sObjectMgr->GetPlayerByLowGUID(_lowGuid);
if (!player || !player->GetVehicle())
@@ -259,6 +259,58 @@ class spell_ioc_launch : public SpellScriptLoader
}
};
+enum SeaforiumBombSpells
+{
+ SPELL_SEAFORIUM_BLAST = 66676,
+ SPELL_HUGE_SEAFORIUM_BLAST = 66672,
+ SPELL_A_BOMB_INABLE_CREDIT = 68366,
+ SPELL_A_BOMB_INATION_CREDIT = 68367
+};
+
+class spell_ioc_seaforium_blast_credit : public SpellScriptLoader
+{
+ public:
+ spell_ioc_seaforium_blast_credit() : SpellScriptLoader("spell_ioc_seaforium_blast_credit") { }
+
+ class spell_ioc_seaforium_blast_credit_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_ioc_seaforium_blast_credit_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_A_BOMB_INABLE_CREDIT) || !sSpellMgr->GetSpellInfo(SPELL_A_BOMB_INATION_CREDIT))
+ return false;
+ return true;
+ }
+
+ void HandleAchievementCredit(SpellEffIndex /*effIndex*/)
+ {
+ uint32 _creditSpell = 0;
+ Unit* caster = GetOriginalCaster();
+ if (!caster)
+ return;
+
+ if (GetSpellInfo()->Id == SPELL_SEAFORIUM_BLAST)
+ _creditSpell = SPELL_A_BOMB_INABLE_CREDIT;
+ else if (GetSpellInfo()->Id == SPELL_HUGE_SEAFORIUM_BLAST)
+ _creditSpell = SPELL_A_BOMB_INATION_CREDIT;
+
+ if (GetHitGObj() && GetHitGObj()->IsDestructibleBuilding())
+ caster->CastSpell(caster, _creditSpell, true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_ioc_seaforium_blast_credit_SpellScript::HandleAchievementCredit, EFFECT_1, SPELL_EFFECT_GAMEOBJECT_DAMAGE);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_ioc_seaforium_blast_credit_SpellScript();
+ }
+};
+
void AddSC_isle_of_conquest()
{
new npc_four_car_garage();
@@ -266,4 +318,5 @@ void AddSC_isle_of_conquest()
new spell_ioc_gunship_portal();
new spell_ioc_parachute_ic();
new spell_ioc_launch();
+ new spell_ioc_seaforium_blast_credit();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
index e8c4216b00e..60c60640c04 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
@@ -162,13 +162,13 @@ public:
summons.DoZoneInCombat();
events.SetPhase(PHASE_NORMAL);
- events.ScheduleEvent(EVENT_IMPALE, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, PHASE_NORMAL);
- events.ScheduleEvent(EVENT_SCARABS, urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS), 0, PHASE_NORMAL);
- events.ScheduleEvent(EVENT_LOCUST, urand(80,120) * IN_MILLISECONDS, 0, PHASE_NORMAL);
- events.ScheduleEvent(EVENT_BERSERK, 10 * MINUTE * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_IMPALE, randtime(Seconds(10), Seconds(20)), 0, PHASE_NORMAL);
+ events.ScheduleEvent(EVENT_SCARABS, randtime(Seconds(20), Seconds(30)), 0, PHASE_NORMAL);
+ events.ScheduleEvent(EVENT_LOCUST, Minutes(1)+randtime(Seconds(40), Seconds(60)), 0, PHASE_NORMAL);
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(10));
if (!Is25ManRaid())
- events.ScheduleEvent(EVENT_SPAWN_GUARD, urand(15, 20) * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_SPAWN_GUARD, randtime(Seconds(15), Seconds(20)));
}
void UpdateAI(uint32 diff) override
@@ -189,11 +189,9 @@ public:
else
EnterEvadeMode();
- events.ScheduleEvent(EVENT_IMPALE, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, PHASE_NORMAL);
+ events.Repeat(randtime(Seconds(10), Seconds(20)));
break;
case EVENT_SCARABS:
- events.ScheduleEvent(EVENT_SCARABS, urand(40 * IN_MILLISECONDS, 60 * IN_MILLISECONDS), 0, PHASE_NORMAL);
-
if (!guardCorpses.empty())
{
if (ObjectGuid target = Trinity::Containers::SelectRandomContainerElement(guardCorpses))
@@ -204,27 +202,28 @@ public:
creatureTarget->DespawnOrUnsummon();
}
}
+ events.Repeat(randtime(Seconds(40), Seconds(60)));
break;
case EVENT_LOCUST:
Talk(EMOTE_LOCUST);
+ events.SetPhase(PHASE_SWARM);
DoCast(me, SPELL_LOCUST_SWARM);
- events.ScheduleEvent(EVENT_SPAWN_GUARD, 3 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_LOCUST_ENDS, RAID_MODE(19, 23) * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_LOCUST, 90000);
- events.SetPhase(PHASE_SWARM);
+ events.ScheduleEvent(EVENT_SPAWN_GUARD, Seconds(3));
+ events.ScheduleEvent(EVENT_LOCUST_ENDS, RAID_MODE(Seconds(19), Seconds(23)));
+ events.Repeat(Minutes(1)+Seconds(30));
break;
case EVENT_LOCUST_ENDS:
- events.ScheduleEvent(EVENT_IMPALE, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, PHASE_NORMAL);
- events.ScheduleEvent(EVENT_SCARABS, urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS), 0, PHASE_NORMAL);
events.SetPhase(PHASE_NORMAL);
+ events.ScheduleEvent(EVENT_IMPALE, randtime(Seconds(10), Seconds(20)), 0, PHASE_NORMAL);
+ events.ScheduleEvent(EVENT_SCARABS, randtime(Seconds(20), Seconds(30)), 0, PHASE_NORMAL);
break;
case EVENT_SPAWN_GUARD:
me->SummonCreatureGroup(GROUP_SINGLE_SPAWN);
break;
case EVENT_BERSERK:
DoCast(me, SPELL_BERSERK, true);
- events.ScheduleEvent(EVENT_BERSERK, 600000);
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(10));
break;
}
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
index 39c41c935bf..8a7bdd293ba 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
@@ -100,9 +100,9 @@ class boss_faerlina : public CreatureScript
_EnterCombat();
Talk(SAY_AGGRO);
summons.DoZoneInCombat();
- events.ScheduleEvent(EVENT_POISON, urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS));
- events.ScheduleEvent(EVENT_FIRE, urand(6 * IN_MILLISECONDS, 18 * IN_MILLISECONDS));
- events.ScheduleEvent(EVENT_FRENZY, urand(60 * IN_MILLISECONDS, 80 * IN_MILLISECONDS));
+ events.ScheduleEvent(EVENT_POISON, randtime(Seconds(10), Seconds(15)));
+ events.ScheduleEvent(EVENT_FIRE, randtime(Seconds(6), Seconds(18)));
+ events.ScheduleEvent(EVENT_FRENZY, Minutes(1)+randtime(Seconds(0), Seconds(20)));
}
void Reset() override
@@ -111,9 +111,9 @@ class boss_faerlina : public CreatureScript
_frenzyDispels = 0;
}
- void KilledUnit(Unit* /*victim*/) override
+ void KilledUnit(Unit* victim) override
{
- if (!urand(0, 2))
+ if (victim->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_SLAY);
}
@@ -158,21 +158,21 @@ class boss_faerlina : public CreatureScript
case EVENT_POISON:
if (!me->HasAura(SPELL_WIDOWS_EMBRACE_HELPER))
DoCastAOE(SPELL_POISON_BOLT_VOLLEY);
- events.ScheduleEvent(EVENT_POISON, urand(8000, 15000));
+ events.Repeat(randtime(Seconds(8), Seconds(15)));
break;
case EVENT_FIRE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_RAIN_OF_FIRE);
- events.ScheduleEvent(EVENT_FIRE, urand(6000, 18000));
+ events.Repeat(randtime(Seconds(6), Seconds(18)));
break;
case EVENT_FRENZY:
if (Aura* widowsEmbrace = me->GetAura(SPELL_WIDOWS_EMBRACE_HELPER))
- events.ScheduleEvent(EVENT_FRENZY, widowsEmbrace->GetDuration()+1 * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_FRENZY, Milliseconds(widowsEmbrace->GetDuration()+1));
else
{
DoCast(SPELL_FRENZY);
Talk(EMOTE_FRENZY);
- events.ScheduleEvent(EVENT_FRENZY, urand(60 * IN_MILLISECONDS, 80 * IN_MILLISECONDS));
+ events.Repeat(Minutes(1) + randtime(Seconds(0), Seconds(20)));
}
break;
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
index a7a89f44d81..0de1c4785b8 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
@@ -285,7 +285,7 @@ struct boss_four_horsemen_baseAI : public BossAI
void EnterCombat(Unit* /*who*/) override
{
- if (instance->GetBossState(BOSS_HORSEMEN) != NOT_STARTED) // another horseman already did it
+ if (instance->GetBossState(BOSS_HORSEMEN) == IN_PROGRESS || instance->GetBossState(BOSS_HORSEMEN) == DONE) // another horseman already did it
return;
Talk(SAY_AGGRO);
BeginEncounter();
@@ -411,9 +411,9 @@ class boss_four_horsemen_baron : public CreatureScript
else
AttackStart(threat.getHostilTarget());
- events.ScheduleEvent(EVENT_BERSERK, 10 * MINUTE * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_MARK, 24 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_UNHOLYSHADOW, urandms(3,7));
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(10));
+ events.ScheduleEvent(EVENT_MARK, Seconds(24));
+ events.ScheduleEvent(EVENT_UNHOLYSHADOW, randtime(Seconds(3), Seconds(7)));
}
void _UpdateAI(uint32 diff) override
@@ -431,11 +431,11 @@ class boss_four_horsemen_baron : public CreatureScript
break;
case EVENT_MARK:
DoCastAOE(SPELL_BARON_MARK, true);
- events.ScheduleEvent(EVENT_MARK, 12 * IN_MILLISECONDS);
+ events.Repeat(Seconds(12));
break;
case EVENT_UNHOLYSHADOW:
DoCastVictim(SPELL_UNHOLY_SHADOW);
- events.ScheduleEvent(EVENT_UNHOLYSHADOW, urandms(10,30));
+ events.Repeat(randtime(Seconds(10), Seconds(30)));
break;
}
}
@@ -484,9 +484,9 @@ class boss_four_horsemen_thane : public CreatureScript
else
AttackStart(threat.getHostilTarget());
- events.ScheduleEvent(EVENT_BERSERK, 10 * MINUTE * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_MARK, 24 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_METEOR, urandms(10,15));
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(10));
+ events.ScheduleEvent(EVENT_MARK, Seconds(24));
+ events.ScheduleEvent(EVENT_METEOR, randtime(Seconds(10), Seconds(25)));
}
void _UpdateAI(uint32 diff) override
{
@@ -503,7 +503,7 @@ class boss_four_horsemen_thane : public CreatureScript
break;
case EVENT_MARK:
DoCastAOE(SPELL_THANE_MARK, true);
- events.ScheduleEvent(EVENT_MARK, 12 * IN_MILLISECONDS);
+ events.Repeat(Seconds(12));
break;
case EVENT_METEOR:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, true))
@@ -511,7 +511,7 @@ class boss_four_horsemen_thane : public CreatureScript
DoCast(target, SPELL_METEOR);
_shouldSay = true;
}
- events.ScheduleEvent(EVENT_METEOR, urandms(13,17));
+ events.Repeat(randtime(Seconds(13), Seconds(17)));
break;
}
}
@@ -550,9 +550,9 @@ class boss_four_horsemen_lady : public CreatureScript
boss_four_horsemen_ladyAI(Creature* creature) : boss_four_horsemen_baseAI(creature, LADY, ladyPath) { }
void BeginFighting() override
{
- events.ScheduleEvent(EVENT_BERSERK, 10 * MINUTE * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_MARK, 24 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_VOIDZONE, urandms(5,10));
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(10));
+ events.ScheduleEvent(EVENT_MARK, Seconds(24));
+ events.ScheduleEvent(EVENT_VOIDZONE, randtime(Seconds(5), Seconds(10)));
}
void _UpdateAI(uint32 diff) override
@@ -578,7 +578,7 @@ class boss_four_horsemen_lady : public CreatureScript
break;
case EVENT_MARK:
DoCastAOE(SPELL_LADY_MARK, true);
- events.ScheduleEvent(EVENT_MARK, 15 * IN_MILLISECONDS);
+ events.Repeat(Seconds(15));
break;
case EVENT_VOIDZONE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))
@@ -586,7 +586,7 @@ class boss_four_horsemen_lady : public CreatureScript
DoCast(target, SPELL_VOID_ZONE, true);
Talk(SAY_SPECIAL);
}
- events.ScheduleEvent(EVENT_VOIDZONE, urandms(12, 18));
+ events.Repeat(randtime(Seconds(12), Seconds(18)));
break;
}
}
@@ -620,9 +620,9 @@ class boss_four_horsemen_sir : public CreatureScript
boss_four_horsemen_sirAI(Creature* creature) : boss_four_horsemen_baseAI(creature, SIR, sirPath), _shouldSay(true) { }
void BeginFighting() override
{
- events.ScheduleEvent(EVENT_BERSERK, 10 * MINUTE * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_MARK, 24 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_HOLYWRATH, urandms(13,18));
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(10));
+ events.ScheduleEvent(EVENT_MARK, Seconds(24));
+ events.ScheduleEvent(EVENT_HOLYWRATH, randtime(Seconds(13), Seconds(18)));
}
void _UpdateAI(uint32 diff) override
@@ -648,7 +648,7 @@ class boss_four_horsemen_sir : public CreatureScript
break;
case EVENT_MARK:
DoCastAOE(SPELL_SIR_MARK, true);
- events.ScheduleEvent(EVENT_MARK, 15 * IN_MILLISECONDS);
+ events.Repeat(Seconds(15));
break;
case EVENT_HOLYWRATH:
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 45.0f, true))
@@ -656,7 +656,7 @@ class boss_four_horsemen_sir : public CreatureScript
DoCast(target, SPELL_HOLY_WRATH, true);
_shouldSay = true;
}
- events.ScheduleEvent(EVENT_HOLYWRATH, urandms(10,18));
+ events.Repeat(randtime(Seconds(10), Seconds(18)));
break;
}
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
index ec47b0db101..6ec9af68723 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
@@ -18,38 +18,74 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "naxxramas.h"
+#include "SpellScript.h"
+#include <math.h>
-enum Spells
+enum Texts
{
- SPELL_MORTAL_WOUND = 25646,
- SPELL_ENRAGE = 28371,
- SPELL_DECIMATE = 28374,
- SPELL_BERSERK = 26662,
- SPELL_INFECTED_WOUND = 29306
+ EMOTE_SPOTS_ONE = 0,
+ EMOTE_DECIMATE = 1,
+ EMOTE_ENRAGE = 2,
+ EMOTE_DEVOURS_ALL = 3,
+ EMOTE_BERSERKER = 4
};
-enum Creatures
+enum Spells
{
- NPC_ZOMBIE = 16360
+ // Gluth
+ SPELL_MORTAL_WOUND = 54378, // spell effect dummy unused. what its supposed to do is unkown.
+ SPELL_ENRAGE = 28371, // 54427 in 25 man.
+ SPELL_DECIMATE = 28374, // 54426 in 25 man. Effect0 is handled by SpellScript (see below) and 2 rows in conditions table. Effect2 is handled by SpellScript (see below).
+ SPELL_DECIMATE_DMG = 28375,
+ SPELL_BERSERK = 26662,
+ SPELL_ZOMBIE_CHOW_SEARCH_SINGLE = 28239, // Insta kill spell. Single target. See spell script below.
+ SPELL_ZOMBIE_CHOW_SEARCH_MULTI = 28404, // Insta kill spell. Affect all zombies 10 yards around Gluth's center. See one row conditions table + spell script below.
+
+ // Zombies
+ SPELL_INFECTED_WOUND = 29307 // Used by the zombies on self.
};
Position const PosSummon[3] =
{
- {3267.9f, -3172.1f, 297.42f, 0.94f},
- {3253.2f, -3132.3f, 297.42f, 0},
- {3308.3f, -3185.8f, 297.42f, 1.58f},
+ { 3270.132f, -3169.948f, 297.5891f, 5.88176f },
+ { 3307.298f, -3183.449f, 297.5891f, 5.742133f },
+ { 3255.708f, -3135.677f, 297.5891f, 1.867502f }
};
enum Events
{
- EVENT_WOUND = 1,
+ EVENT_WOUND = 1,
EVENT_ENRAGE,
EVENT_DECIMATE,
EVENT_BERSERK,
EVENT_SUMMON,
+ EVENT_SEARCH_ZOMBIE_SINGLE,
+ EVENT_KILL_ZOMBIE_SINGLE,
+ EVENT_SEARCH_ZOMBIE_MULTI
};
-#define EMOTE_NEARBY " spots a nearby zombie to devour!"
+enum States
+{
+ STATE_GLUTH_NORMAL = 1,
+ STATE_GLUTH_EATING = 2,
+
+ STATE_ZOMBIE_NORMAL = 1,
+ STATE_ZOMBIE_DECIMATED = 2,
+ STATE_ZOMBIE_TOBE_EATEN = 3
+};
+
+enum SummonGroups
+{
+ SUMMON_GROUP_CHOW_10MAN = 1,
+ SUMMON_GROUP_CHOW_25MAN = 2
+};
+
+enum Misc
+{
+ EVENT_GLUTH_ZOMBIE_BEHAVIOR = 10495, // unused. event handled by spell_gluth_decimate_SpellScript::HandleEvent
+ DATA_ZOMBIE_STATE = 1,
+ ACTION_DECIMATE_EVENT = 2,
+};
class boss_gluth : public CreatureScript
{
@@ -58,99 +94,390 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
- return new boss_gluthAI(creature);
+ return GetInstanceAI<boss_gluthAI>(creature);
}
struct boss_gluthAI : public BossAI
{
- boss_gluthAI(Creature* creature) : BossAI(creature, BOSS_GLUTH)
- {
- // Do not let Gluth be affected by zombies' debuff
- me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true);
- }
- void MoveInLineOfSight(Unit* who) override
+ boss_gluthAI(Creature* creature) : BossAI(creature, BOSS_GLUTH), state(STATE_GLUTH_NORMAL) {}
+
+ void Reset() override
{
- if (who->GetEntry() == NPC_ZOMBIE && me->IsWithinDistInMap(who, 7))
- {
- SetGazeOn(who);
- /// @todo use a script text
- me->TextEmote(EMOTE_NEARBY, nullptr, true);
- }
- else
- BossAI::MoveInLineOfSight(who);
+ _Reset();
+ zombieToBeEatenGUID.Clear();
+ state = STATE_GLUTH_NORMAL;
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->SetSpeed(UnitMoveType::MOVE_RUN, 12.0f);
}
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
- events.ScheduleEvent(EVENT_WOUND, 10000);
- events.ScheduleEvent(EVENT_ENRAGE, 15000);
- events.ScheduleEvent(EVENT_DECIMATE, 105000);
- events.ScheduleEvent(EVENT_BERSERK, 8*60000);
- events.ScheduleEvent(EVENT_SUMMON, 15000);
+ events.ScheduleEvent(EVENT_WOUND, Seconds(10));
+ events.ScheduleEvent(EVENT_ENRAGE, randtime(Seconds(16), Seconds(22)));
+ events.ScheduleEvent(EVENT_DECIMATE, randtime(Minutes(1)+Seconds(50), Minutes(2)));
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(8));
+ events.ScheduleEvent(EVENT_SUMMON, Seconds(15));
+ events.ScheduleEvent(EVENT_SEARCH_ZOMBIE_SINGLE, Seconds(12));
}
- void JustSummoned(Creature* summon) override
+ void SummonedCreatureDies(Creature* summoned, Unit* /* who */) override
{
- if (summon->GetEntry() == NPC_ZOMBIE)
- summon->AI()->AttackStart(me);
- summons.Summon(summon);
+ summons.Despawn(summoned); // needed or else dead zombies not despawned yet will still be in the list
}
void UpdateAI(uint32 diff) override
{
- if (!UpdateVictimWithGaze())
+ if (!UpdateVictim() || !CheckInRoom())
return;
events.Update(diff);
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_WOUND:
+ if (state == STATE_GLUTH_EATING)
+ {
+ events.Repeat(Seconds(3));
+ break;
+ }
+
DoCastVictim(SPELL_MORTAL_WOUND);
- events.ScheduleEvent(EVENT_WOUND, 10000);
+ events.Repeat(Seconds(10));
break;
case EVENT_ENRAGE:
- /// @todo Add missing text
+ if (state == STATE_GLUTH_EATING)
+ {
+ events.Repeat(Seconds(5));
+ break;
+ }
+
+ Talk(EMOTE_ENRAGE);
DoCast(me, SPELL_ENRAGE);
- events.ScheduleEvent(EVENT_ENRAGE, 15000);
+ events.Repeat(randtime(Seconds(16), Seconds(22)));
break;
case EVENT_DECIMATE:
- /// @todo Add missing text
+ if (state == STATE_GLUTH_EATING)
+ {
+ events.Repeat(Seconds(4));
+ break;
+ }
+
+ Talk(EMOTE_DECIMATE);
DoCastAOE(SPELL_DECIMATE);
- events.ScheduleEvent(EVENT_DECIMATE, 105000);
+ for (int i = 1; i <= 20; i++)
+ events.ScheduleEvent(EVENT_SEARCH_ZOMBIE_MULTI, Seconds(3*i));
+ events.ScheduleEvent(EVENT_DECIMATE, randtime(Minutes(1)+Seconds(50), Minutes(2)));
break;
case EVENT_BERSERK:
+ Talk(EMOTE_BERSERKER);
DoCast(me, SPELL_BERSERK);
- events.ScheduleEvent(EVENT_BERSERK, 5*60000);
+ events.Repeat(Minutes(5)); //refresh the hard enrage buff
break;
case EVENT_SUMMON:
- for (int32 i = 0; i < RAID_MODE(1, 2); ++i)
- DoSummon(NPC_ZOMBIE, PosSummon[rand32() % RAID_MODE(1, 3)]);
- events.ScheduleEvent(EVENT_SUMMON, 10000);
+ if (Is25ManRaid()) // one wave each 10s. one wave=1 zombie in 10man and 2 zombies in 25man.
+ me->SummonCreatureGroup(SUMMON_GROUP_CHOW_25MAN);
+ else
+ me->SummonCreatureGroup(SUMMON_GROUP_CHOW_10MAN);
+ events.Repeat(Seconds(10));
+ break;
+ case EVENT_SEARCH_ZOMBIE_SINGLE:
+ {
+ Creature* zombie = nullptr;
+ for (SummonList::const_iterator itr = summons.begin(); !zombie && itr != summons.end(); ++itr)
+ {
+ zombie=ObjectAccessor::GetCreature(*me, *itr);
+ if (!zombie || !zombie->IsAlive() || !zombie->IsWithinDistInMap(me, 10.0))
+ zombie = nullptr;
+ }
+
+ if (zombie)
+ {
+ zombieToBeEatenGUID = zombie->GetGUID(); // save for later use
+
+ // the soon-to-be-eaten zombie should stop moving and stop attacking
+ zombie->AI()->SetData(DATA_ZOMBIE_STATE, STATE_ZOMBIE_TOBE_EATEN);
+
+ // gluth should stop AAs on his primary target and turn toward the zombie (2 yards away). He then pauses for a few seconds.
+ me->SetSpeed(MOVE_RUN, 36.0f);
+
+ me->SetReactState(ReactStates::REACT_PASSIVE);
+ me->AttackStop();
+
+ Talk(EMOTE_SPOTS_ONE);
+
+ //me->SetTarget(ObjectGuid::Empty);
+
+ me->GetMotionMaster()->MoveCloserAndStop(1, zombie, 2.0f);
+
+ state = STATE_GLUTH_EATING;
+ }
+
+ events.Repeat(RAID_MODE(Seconds(7), Seconds(5)));
+ break;
+ }
+ case EVENT_KILL_ZOMBIE_SINGLE:
+ {
+ Creature* zombieToBeEaten = ObjectAccessor::GetCreature(*me, zombieToBeEatenGUID);
+ if (zombieToBeEaten && zombieToBeEaten->IsAlive() && zombieToBeEaten->IsWithinDistInMap(me, 10.0))
+ DoCast(zombieToBeEaten, SPELL_ZOMBIE_CHOW_SEARCH_SINGLE); // do the killing + healing in done inside by spell script see below.
+
+ zombieToBeEatenGUID = ObjectGuid::Empty;
+ state = STATE_GLUTH_NORMAL;
+ me->SetSpeed(UnitMoveType::MOVE_RUN, 12.0f);
+
+ // and then return on primary target
+ me->SetReactState(REACT_AGGRESSIVE);
+
+ break;
+ }
+ case EVENT_SEARCH_ZOMBIE_MULTI:
+ {
+ if (state == STATE_GLUTH_EATING) // skip and simply wait for the next occurence
+ break;
+
+ Creature* zombie = nullptr;
+ for (SummonList::const_iterator itr = summons.begin(); !zombie && itr != summons.end(); ++itr)
+ {
+ zombie = ObjectAccessor::GetCreature(*me, *itr);
+ if (zombie && zombie->IsAlive() && zombie->GetExactDist2d(me) > 18.0)
+ zombie = nullptr;
+ }
+
+ if (zombie) // cast the aoe spell only if at least one zombie is found nearby
+ {
+ Talk(EMOTE_DEVOURS_ALL);
+ DoCastAOE(SPELL_ZOMBIE_CHOW_SEARCH_MULTI);
+ }
break;
+ }
}
}
- if (me->GetVictim() && me->EnsureVictim()->GetEntry() == NPC_ZOMBIE)
+ DoMeleeAttackIfReady();
+ }
+
+ void MovementInform(uint32 /*type*/, uint32 id) override
+ {
+ if (id == 1){
+ me->GetMotionMaster()->MoveIdle();
+ events.ScheduleEvent(EVENT_KILL_ZOMBIE_SINGLE, Seconds(1));
+ }
+
+ }
+
+ void DoAction(int32 action) override
+ {
+ switch (action)
+ {
+ case ACTION_DECIMATE_EVENT:
+ for (ObjectGuid zombieGuid : summons)
+ {
+ Creature* zombie = ObjectAccessor::GetCreature(*me, zombieGuid);
+ if (zombie && zombie->IsAlive())
+ zombie->AI()->SetData(DATA_ZOMBIE_STATE, STATE_ZOMBIE_DECIMATED);
+ }
+ break;
+ }
+ }
+
+ private:
+ ObjectGuid zombieToBeEatenGUID;
+ uint8 state;
+ };
+
+};
+
+// spell 28374 (10man) / 54426 (25man) - Decimate
+class spell_gluth_decimate : public SpellScriptLoader
+{
+public:
+ spell_gluth_decimate() : SpellScriptLoader("spell_gluth_decimate") { }
+
+ class spell_gluth_decimate_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gluth_decimate_SpellScript);
+
+ // handles the damaging effect of the decimate spell.
+ void HandleScriptEffect(SpellEffIndex /* index */)
+ {
+ if (Unit *unit = GetHitUnit())
{
- if (me->IsWithinMeleeRange(me->GetVictim()))
+ int32 damage = int32(unit->GetHealth()) - int32(unit->CountPctFromMaxHealth(5));
+ if (damage > 0)
+ GetCaster()->CastCustomSpell(SPELL_DECIMATE_DMG, SPELLVALUE_BASE_POINT0, damage, unit);
+ }
+ }
+
+ // handles the change of zombies behavior after the decimate spell
+ void HandleEvent(SpellEffIndex /* index */)
+ {
+ GetCaster()->GetAI()->DoAction(ACTION_DECIMATE_EVENT);
+ }
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return (sSpellMgr->GetSpellInfo(SPELL_DECIMATE_DMG) != nullptr);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gluth_decimate_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ OnEffectHit += SpellEffectFn(spell_gluth_decimate_SpellScript::HandleEvent, EFFECT_2, SPELL_EFFECT_SEND_EVENT);
+ }
+
+ bool Load() override
+ {
+ return GetCaster() && GetCaster()->GetEntry() == NPC_GLUTH;
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gluth_decimate_SpellScript();
+ }
+
+};
+
+// used by both 28239 & 28404 (single target and aoe zombie-kill spell) to heal Gluth on each target hit.
+
+class spell_gluth_zombiechow_search : public SpellScriptLoader
+{
+public:
+ spell_gluth_zombiechow_search() : SpellScriptLoader("spell_gluth_zombiechow_search") { }
+
+ class spell_gluth_zombiechow_search_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gluth_zombiechow_search_SpellScript);
+
+ void HealForEachTargetHit()
+ {
+ GetCaster()->ModifyHealth(int32(GetCaster()->CountPctFromMaxHealth(5)));
+ }
+
+ void Register() override
+ {
+ AfterHit += SpellHitFn(spell_gluth_zombiechow_search_SpellScript::HealForEachTargetHit);
+ }
+
+ bool Load() override
+ {
+ return GetCaster() && GetCaster()->GetEntry() == NPC_GLUTH;
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gluth_zombiechow_search_SpellScript();
+ }
+
+};
+
+// creature 16360 (10man) / 30303 (25man)
+class npc_zombie_chow : public CreatureScript
+{
+public:
+
+ npc_zombie_chow() : CreatureScript("npc_zombie_chow") { }
+
+ struct npc_zombie_chowAI : public ScriptedAI
+ {
+ npc_zombie_chowAI(Creature* creature) : ScriptedAI(creature)
+ {
+ GluthGUID = creature->GetInstanceScript()->GetGuidData(DATA_GLUTH);
+
+ DoCast(me, SPELL_INFECTED_WOUND);
+ timer = 0;
+ state = STATE_ZOMBIE_NORMAL;
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (state == STATE_ZOMBIE_DECIMATED)
+ {
+ timer += diff;
+ if (Creature* gluth = ObjectAccessor::GetCreature(*me, GluthGUID))
{
- me->Kill(me->GetVictim());
- me->ModifyHealth(int32(me->CountPctFromMaxHealth(5)));
+ // Putting this in the UpdateAI loop fixes an issue where death gripping a decimated zombie would make the zombie stand still until the rest of the fight.
+ // Also fix the issue where if one or more zombie is rooted when decimates hits (and MovePoint() is called), the zombie teleport to the boss. pretty weird behavior.
+ if (timer > 1600 && me->GetExactDist2d(gluth) > 10.0f && me->CanFreeMove()) // it takes about 1600 ms for the animation to cycle. This way, the animation looks relatively smooth.
+ {
+ me->GetMotionMaster()->MovePoint(0, gluth->GetPosition()); // isn't dynamic. So, to take into account Gluth's movement, it must be called periodicly.
+ timer = 0;
+ }
+
+ if (me->GetExactDist2d(gluth) <= 10.0f)
+ me->StopMoving();
}
}
- else
+ else if (state == STATE_ZOMBIE_NORMAL)
DoMeleeAttackIfReady();
}
+
+ void SetData(uint32 id, uint32 value) override
+ {
+ if (id == DATA_ZOMBIE_STATE) // change of state
+ {
+ state = value;
+ if (value == STATE_ZOMBIE_DECIMATED)
+ {
+ me->SetReactState(ReactStates::REACT_PASSIVE);
+ me->AttackStop();
+ me->SetTarget(ObjectGuid::Empty);
+ // at this point, the zombie should be non attacking and non moving.
+
+ me->SetWalk(true); // it doesnt seem to work with MoveFollow() (but it does work with MovePoint()).
+
+ timer = 1000;
+ }
+ else if (value == STATE_ZOMBIE_TOBE_EATEN)
+ {
+ // forced to stand still
+ me->GetMotionMaster()->Clear();
+ me->StopMoving();
+
+ // and loose aggro behavior
+ me->SetReactState(ReactStates::REACT_PASSIVE);
+ me->AttackStop();
+ me->SetTarget(ObjectGuid::Empty);
+
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); // not sure if this is blizz-like but this is very convenient
+ }
+ }
+ }
+
+ uint32 GetData(uint32 index) const override
+ {
+ if (index == DATA_ZOMBIE_STATE)
+ return state;
+ return 0;
+ }
+
+ private:
+ uint32 timer;
+ uint8 state;
+ ObjectGuid GluthGUID;
};
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetInstanceAI<npc_zombie_chowAI>(creature);
+ }
};
void AddSC_boss_gluth()
{
new boss_gluth();
+ new spell_gluth_decimate();
+ new spell_gluth_zombiechow_search();
+ new npc_zombie_chow();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
index 81f1e071da0..30c05c9dca9 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
@@ -65,7 +65,7 @@ enum Spells
/* gothik phase two spells */
SPELL_HARVEST_SOUL = 28679,
SPELL_SHADOW_BOLT = 29317,
-
+
/* visual spells */
SPELL_ANCHOR_1_TRAINEE = 27892,
SPELL_ANCHOR_1_DK = 27928,
@@ -324,13 +324,13 @@ class boss_gothik : public CreatureScript
{
_EnterCombat();
events.SetPhase(PHASE_ONE);
- events.ScheduleEvent(EVENT_SUMMON, 25 * IN_MILLISECONDS, 0, PHASE_ONE);
- events.ScheduleEvent(EVENT_DOORS_UNLOCK, 205 * IN_MILLISECONDS, 0, PHASE_ONE);
- events.ScheduleEvent(EVENT_PHASE_TWO, 270 * IN_MILLISECONDS, 0, PHASE_ONE);
+ events.ScheduleEvent(EVENT_SUMMON, Seconds(25), 0, PHASE_ONE);
+ events.ScheduleEvent(EVENT_DOORS_UNLOCK, Minutes(3) + Seconds(25), 0, PHASE_ONE);
+ events.ScheduleEvent(EVENT_PHASE_TWO, Minutes(4) + Seconds(30), 0, PHASE_ONE);
Talk(SAY_INTRO_1);
- events.ScheduleEvent(EVENT_INTRO_2, 4 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_INTRO_3, 9 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_INTRO_4, 14 * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_INTRO_2, Seconds(4));
+ events.ScheduleEvent(EVENT_INTRO_3, Seconds(9));
+ events.ScheduleEvent(EVENT_INTRO_4, Seconds(14));
instance->SetData(DATA_GOTHIK_GATE, GO_STATE_READY);
_gateIsOpen = false;
}
@@ -373,10 +373,14 @@ class boss_gothik : public CreatureScript
instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE);
Talk(EMOTE_GATE_OPENED);
_gateIsOpen = true;
-
+
for (ObjectGuid summonGuid : summons)
+ {
if (Creature* summon = ObjectAccessor::GetCreature(*me, summonGuid))
summon->AI()->DoAction(ACTION_GATE_OPENED);
+ if (summons.empty()) // ACTION_GATE_OPENED may cause an evade, despawning summons and invalidating our iterator
+ break;
+ }
}
void DamageTaken(Unit* /*who*/, uint32& damage) override
@@ -440,7 +444,7 @@ class boss_gothik : public CreatureScript
TC_LOG_INFO("scripts", "GothikAI: Wave count %d is out of range for difficulty %d.", _waveCount, GetDifficulty());
break;
}
-
+
std::list<Creature*> triggers;
me->GetCreatureListWithEntryInGrid(triggers, NPC_TRIGGER, 150.0f);
for (GothikWaveEntry entry : RAID_MODE(waves10, waves25)[_waveCount].first)
@@ -466,7 +470,7 @@ class boss_gothik : public CreatureScript
default:
targetDBGuid = 0;
}
-
+
for (Creature* trigger : triggers)
if (trigger && trigger->GetSpawnId() == targetDBGuid)
{
@@ -476,7 +480,7 @@ class boss_gothik : public CreatureScript
}
if (uint8 timeToNext = RAID_MODE(waves10, waves25)[_waveCount].second)
- events.ScheduleEvent(EVENT_SUMMON, timeToNext * IN_MILLISECONDS, 0, PHASE_ONE);
+ events.Repeat(Seconds(timeToNext));
++_waveCount;
break;
@@ -493,9 +497,9 @@ class boss_gothik : public CreatureScript
break;
case EVENT_PHASE_TWO:
events.SetPhase(PHASE_TWO);
- events.ScheduleEvent(EVENT_TELEPORT, 20 * IN_MILLISECONDS, 0, PHASE_TWO);
- events.ScheduleEvent(EVENT_HARVEST, 15 * IN_MILLISECONDS, 0, PHASE_TWO);
- events.ScheduleEvent(EVENT_RESUME_ATTACK, 2 * IN_MILLISECONDS, 0, PHASE_TWO);
+ events.ScheduleEvent(EVENT_TELEPORT, Seconds(20), 0, PHASE_TWO);
+ events.ScheduleEvent(EVENT_HARVEST, Seconds(15), 0, PHASE_TWO);
+ events.ScheduleEvent(EVENT_RESUME_ATTACK, Seconds(2), 0, PHASE_TWO);
Talk(SAY_PHASE_TWO);
Talk(EMOTE_PHASE_TWO);
me->SetReactState(REACT_PASSIVE);
@@ -514,23 +518,23 @@ class boss_gothik : public CreatureScript
_lastTeleportDead = !_lastTeleportDead;
events.CancelEvent(EVENT_BOLT);
- events.ScheduleEvent(EVENT_TELEPORT, 20 * IN_MILLISECONDS, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_RESUME_ATTACK, 2 * IN_MILLISECONDS, 0, PHASE_TWO);
+ events.Repeat(Seconds(20));
}
break;
case EVENT_HARVEST:
DoCastAOE(SPELL_HARVEST_SOUL, true); // triggered allows this to go "through" shadow bolt
- events.ScheduleEvent(EVENT_HARVEST, 15 * IN_MILLISECONDS, 0, PHASE_TWO);
+ events.Repeat(Seconds(15));
break;
case EVENT_RESUME_ATTACK:
me->SetReactState(REACT_AGGRESSIVE);
- events.ScheduleEvent(EVENT_BOLT, 0, 0, PHASE_TWO);
+ events.ScheduleEvent(EVENT_BOLT, Seconds(0), 0, PHASE_TWO);
// return to the start of this method so victim side etc is re-evaluated
return UpdateAI(0u); // tail recursion for efficiency
case EVENT_BOLT:
DoCastVictim(SPELL_SHADOW_BOLT);
- events.ScheduleEvent(EVENT_BOLT, 1 * IN_MILLISECONDS, 0, PHASE_TWO);
+ events.Repeat(Seconds(2));
break;
case EVENT_INTRO_2:
Talk(SAY_INTRO_2);
@@ -544,7 +548,7 @@ class boss_gothik : public CreatureScript
}
}
}
-
+
private:
uint32 _waveCount;
bool _gateCanOpen;
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
index a1d8f6e5e02..cf38d659d40 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
@@ -57,10 +57,10 @@ class boss_grobbulus : public CreatureScript
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
- events.ScheduleEvent(EVENT_CLOUD, 15000);
- events.ScheduleEvent(EVENT_INJECT, 20000);
- events.ScheduleEvent(EVENT_SPRAY, urand(15000, 30000)); // not sure
- events.ScheduleEvent(EVENT_BERSERK, 12 * 60000);
+ events.ScheduleEvent(EVENT_CLOUD, Seconds(15));
+ events.ScheduleEvent(EVENT_INJECT, Seconds(20));
+ events.ScheduleEvent(EVENT_SPRAY, randtime(Seconds(15), Seconds(30))); // not sure
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(12));
}
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
@@ -82,19 +82,19 @@ class boss_grobbulus : public CreatureScript
{
case EVENT_CLOUD:
DoCastAOE(SPELL_POISON_CLOUD);
- events.ScheduleEvent(EVENT_CLOUD, 15000);
+ events.Repeat(Seconds(15));
return;
case EVENT_BERSERK:
DoCastAOE(SPELL_BERSERK, true);
return;
case EVENT_SPRAY:
DoCastAOE(SPELL_SLIME_SPRAY);
- events.ScheduleEvent(EVENT_SPRAY, urand(15000, 30000));
+ events.Repeat(randtime(Seconds(15), Seconds(30)));
return;
case EVENT_INJECT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_MUTATING_INJECTION))
DoCast(target, SPELL_MUTATING_INJECTION);
- events.ScheduleEvent(EVENT_INJECT, 8000 + uint32(120 * me->GetHealthPct()));
+ events.Repeat(Seconds(8) + Milliseconds(uint32(std::round(120 * me->GetHealthPct()))));
return;
default:
break;
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
index 9b9619fe5b9..41d718d188d 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
@@ -27,6 +27,7 @@ enum Spells
SPELL_SPELL_DISRUPTION = 29310,
SPELL_PLAGUE_CLOUD = 29350,
SPELL_TELEPORT_SELF = 30211,
+ SPELL_ERUPTION = 29371
};
enum Yells
@@ -60,6 +61,15 @@ enum Misc
DATA_SAFETY_DANCE = 19962139
};
+static const uint32 firstEruptionDBGUID = 84980;
+static const uint8 numSections = 4;
+static const uint8 numEruptions[numSections] = { // count of sequential GO DBGUIDs in the respective section of the room
+ 15,
+ 25,
+ 23,
+ 13
+};
+
class boss_heigan : public CreatureScript
{
public:
@@ -72,7 +82,7 @@ public:
struct boss_heiganAI : public BossAI
{
- boss_heiganAI(Creature* creature) : BossAI(creature, BOSS_HEIGAN), eruptSection(0), eruptDirection(false), safetyDance(false) { }
+ boss_heiganAI(Creature* creature) : BossAI(creature, BOSS_HEIGAN), _safeSection(0), _danceDirection(false), _safetyDance(false) { }
void Reset() override
{
@@ -82,15 +92,16 @@ public:
void KilledUnit(Unit* who) override
{
- Talk(SAY_SLAY);
-
if (who->GetTypeId() == TYPEID_PLAYER)
- safetyDance = false;
+ {
+ Talk(SAY_SLAY);
+ _safetyDance = false;
+ }
}
uint32 GetData(uint32 type) const override
{
- return (type == DATA_SAFETY_DANCE && safetyDance) ? 1u : 0u;
+ return (type == DATA_SAFETY_DANCE && _safetyDance) ? 1u : 0u;
}
void JustDied(Unit* /*killer*/) override
@@ -104,13 +115,27 @@ public:
_EnterCombat();
Talk(SAY_AGGRO);
- eruptSection = 3;
- events.ScheduleEvent(EVENT_DISRUPT, urand(15 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, PHASE_FIGHT);
- events.ScheduleEvent(EVENT_FEVER, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, PHASE_FIGHT);
- events.ScheduleEvent(EVENT_DANCE, 90 * IN_MILLISECONDS, 0, PHASE_FIGHT);
- events.ScheduleEvent(EVENT_ERUPT, 15 * IN_MILLISECONDS, 0, PHASE_FIGHT);
+ _safeSection = 0;
+ events.ScheduleEvent(EVENT_DISRUPT, randtime(Seconds(15), Seconds(20)), 0, PHASE_FIGHT);
+ events.ScheduleEvent(EVENT_FEVER, randtime(Seconds(10), Seconds(20)), 0, PHASE_FIGHT);
+ events.ScheduleEvent(EVENT_DANCE, Minutes(1) + Seconds(30), 0, PHASE_FIGHT);
+ events.ScheduleEvent(EVENT_ERUPT, Seconds(15), 0, PHASE_FIGHT);
+
+ _safetyDance = true;
- safetyDance = true;
+ // figure out the current GUIDs of our eruption tiles and which segment they belong in
+ std::unordered_multimap<uint32, GameObject*> const& mapGOs = me->GetMap()->GetGameObjectBySpawnIdStore();
+ uint32 spawnId = firstEruptionDBGUID;
+ for (uint8 section = 0; section < numSections; ++section)
+ {
+ _eruptTiles[section].clear();
+ for (uint8 i = 0; i < numEruptions[section]; ++i)
+ {
+ std::pair<std::unordered_multimap<uint32, GameObject*>::const_iterator, std::unordered_multimap<uint32, GameObject*>::const_iterator> tileIt = mapGOs.equal_range(spawnId++);
+ for (std::unordered_multimap<uint32, GameObject*>::const_iterator it = tileIt.first; it != tileIt.second; ++it)
+ _eruptTiles[section].push_back(it->second->GetGUID());
+ }
+ }
}
void UpdateAI(uint32 diff) override
@@ -126,52 +151,56 @@ public:
{
case EVENT_DISRUPT:
DoCastAOE(SPELL_SPELL_DISRUPTION);
- events.ScheduleEvent(EVENT_DISRUPT, 11 * IN_MILLISECONDS);
+ events.Repeat(Seconds(11));
break;
case EVENT_FEVER:
DoCastAOE(SPELL_DECREPIT_FEVER);
- events.ScheduleEvent(EVENT_FEVER, urand(20 * IN_MILLISECONDS, 25 * IN_MILLISECONDS));
+ events.Repeat(randtime(Seconds(20), Seconds(25)));
break;
case EVENT_DANCE:
events.SetPhase(PHASE_DANCE);
Talk(SAY_TAUNT);
Talk(EMOTE_DANCE);
- eruptSection = 3;
+ _safeSection = 0;
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
me->StopMoving();
DoCast(SPELL_TELEPORT_SELF);
DoCastAOE(SPELL_PLAGUE_CLOUD);
- events.ScheduleEvent(EVENT_DANCE_END, 45 * IN_MILLISECONDS, 0, PHASE_DANCE);
- events.ScheduleEvent(EVENT_ERUPT, 10 * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_DANCE_END, Seconds(45), 0, PHASE_DANCE);
+ events.ScheduleEvent(EVENT_ERUPT, Seconds(10));
break;
case EVENT_DANCE_END:
events.SetPhase(PHASE_FIGHT);
Talk(EMOTE_DANCE_END);
- eruptSection = 3;
- events.ScheduleEvent(EVENT_DISRUPT, urand(10, 25) * IN_MILLISECONDS, 0, PHASE_FIGHT);
- events.ScheduleEvent(EVENT_FEVER, urand(15, 20) * IN_MILLISECONDS, 0, PHASE_FIGHT);
- events.ScheduleEvent(EVENT_DANCE, 90 * IN_MILLISECONDS, 0, PHASE_FIGHT);
- events.ScheduleEvent(EVENT_ERUPT, 15 * IN_MILLISECONDS, 0, PHASE_FIGHT);
+ _safeSection = 0;
+ events.ScheduleEvent(EVENT_DISRUPT, randtime(Seconds(10), Seconds(25)), 0, PHASE_FIGHT);
+ events.ScheduleEvent(EVENT_FEVER, randtime(Seconds(15), Seconds(20)), 0, PHASE_FIGHT);
+ events.ScheduleEvent(EVENT_DANCE, Minutes(1) + Seconds(30), 0, PHASE_FIGHT);
+ events.ScheduleEvent(EVENT_ERUPT, Seconds(15), 0, PHASE_FIGHT);
me->CastStop();
me->SetReactState(REACT_AGGRESSIVE);
DoZoneInCombat();
break;
case EVENT_ERUPT:
- instance->SetData(DATA_HEIGAN_ERUPT, eruptSection);
TeleportCheaters();
-
- if (eruptSection == 0)
- eruptDirection = true;
- else if (eruptSection == 3)
- eruptDirection = false;
-
- eruptDirection ? ++eruptSection : --eruptSection;
-
- if (events.IsInPhase(PHASE_DANCE))
- events.ScheduleEvent(EVENT_ERUPT, 3 * IN_MILLISECONDS, 0, PHASE_DANCE);
- else
- events.ScheduleEvent(EVENT_ERUPT, 10 * IN_MILLISECONDS, 0, PHASE_FIGHT);
+ for (uint8 section = 0; section < numSections; ++section)
+ if (section != _safeSection)
+ for (ObjectGuid tileGUID : _eruptTiles[section])
+ if (GameObject* tile = ObjectAccessor::GetGameObject(*me, tileGUID))
+ {
+ tile->SendCustomAnim(0);
+ tile->CastSpell(nullptr, SPELL_ERUPTION);
+ }
+
+ if (_safeSection == 0)
+ _danceDirection = true;
+ else if (_safeSection == numSections-1)
+ _danceDirection = false;
+
+ _danceDirection ? ++_safeSection : --_safeSection;
+
+ events.Repeat(events.IsInPhase(PHASE_DANCE) ? Seconds(3) : Seconds(10));
break;
}
}
@@ -180,10 +209,11 @@ public:
}
private:
- uint32 eruptSection;
- bool eruptDirection;
+ std::vector<ObjectGuid> _eruptTiles[numSections]; // populated on encounter start
- bool safetyDance; // is achievement still possible? (= no player deaths yet)
+ uint32 _safeSection; // 0 is next to the entrance
+ bool _danceDirection; // true is counter-clockwise, false is clock-wise
+ bool _safetyDance; // is achievement still possible? (= no player deaths yet)
};
};
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
index 47807ec28cb..42efdfbfe67 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
@@ -309,7 +309,7 @@ public:
_Reset();
me->setFaction(35);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_NOT_SELECTABLE);
ResetPlayerScale();
spawns.DespawnAll();
@@ -356,7 +356,7 @@ public:
}
DoCast(me, SPELL_KELTHUZAD_CHANNEL, false);
Talk(SAY_SUMMON_MINIONS);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_NOT_SELECTABLE);
me->SetFloatValue(UNIT_FIELD_COMBATREACH, 4);
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 4);
events.SetPhase(PHASE_ONE);
@@ -426,7 +426,7 @@ public:
Talk(SAY_AGGRO);
Talk(EMOTE_PHASE_TWO);
spawns.DespawnAll();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_NOT_SELECTABLE);
me->CastStop();
DoStartMovement(me->GetVictim());
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
index 086d21120e8..c6c9c76bed4 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
@@ -24,7 +24,6 @@
enum Spells
{
SPELL_NECROTIC_AURA = 55593,
- SPELL_WARN_NECROTIC_AURA = 59481,
SPELL_SUMMON_SPORE = 29234,
SPELL_DEATHBLOOM = 29865,
SPELL_INEVITABLE_DOOM = 29204,
@@ -42,11 +41,12 @@ enum Texts
enum Events
{
- EVENT_NECROTIC_AURA = 1,
- EVENT_DEATHBLOOM = 2,
- EVENT_INEVITABLE_DOOM = 3,
- EVENT_SPORE = 4,
- EVENT_NECROTIC_AURA_FADING = 5,
+ EVENT_NECROTIC_AURA = 1,
+ EVENT_DEATHBLOOM,
+ EVENT_INEVITABLE_DOOM,
+ EVENT_SPORE,
+ EVENT_NECROTIC_AURA_FADING,
+ EVENT_NECROTIC_AURA_FADED
};
enum Achievement
@@ -82,10 +82,10 @@ class boss_loatheb : public CreatureScript
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
- events.ScheduleEvent(EVENT_NECROTIC_AURA, 17 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_DEATHBLOOM, 5 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_SPORE, RAID_MODE(36,18) * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_INEVITABLE_DOOM, 2 * MINUTE * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_NECROTIC_AURA, Seconds(17));
+ events.ScheduleEvent(EVENT_DEATHBLOOM, Seconds(5));
+ events.ScheduleEvent(EVENT_SPORE, Seconds(18));
+ events.ScheduleEvent(EVENT_INEVITABLE_DOOM, Minutes(2));
}
void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override
@@ -94,13 +94,6 @@ class boss_loatheb : public CreatureScript
summon->CastSpell(summon,SPELL_FUNGAL_CREEP,true);
}
- void SummonedCreatureDespawn(Creature* summon) override
- {
- summons.Despawn(summon);
- if (summon->IsAlive())
- summon->CastSpell(summon,SPELL_FUNGAL_CREEP,true);
- }
-
uint32 GetData(uint32 id) const override
{
return (_sporeLoserData && id == DATA_ACHIEVEMENT_SPORE_LOSER) ? 1u : 0u;
@@ -119,34 +112,33 @@ class boss_loatheb : public CreatureScript
{
case EVENT_NECROTIC_AURA:
DoCastAOE(SPELL_NECROTIC_AURA);
- DoCast(me, SPELL_WARN_NECROTIC_AURA);
- events.ScheduleEvent(EVENT_NECROTIC_AURA, 20 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_NECROTIC_AURA_FADING, 14 * IN_MILLISECONDS);
+ Talk(SAY_NECROTIC_AURA_APPLIED);
+ events.ScheduleEvent(EVENT_NECROTIC_AURA_FADING, Seconds(14));
+ events.ScheduleEvent(EVENT_NECROTIC_AURA_FADED, Seconds(17));
+ events.Repeat(Seconds(20));
break;
case EVENT_DEATHBLOOM:
DoCastAOE(SPELL_DEATHBLOOM);
- events.ScheduleEvent(EVENT_DEATHBLOOM, 30 * IN_MILLISECONDS);
+ events.Repeat(Seconds(30));
break;
case EVENT_INEVITABLE_DOOM:
_doomCounter++;
DoCastAOE(SPELL_INEVITABLE_DOOM);
if (_doomCounter > 6)
- {
- if (_doomCounter & 1) // odd
- events.ScheduleEvent(EVENT_INEVITABLE_DOOM, 14 * IN_MILLISECONDS);
- else
- events.ScheduleEvent(EVENT_INEVITABLE_DOOM, 17 * IN_MILLISECONDS);
- }
+ events.Repeat((_doomCounter & 1) ? Seconds(14) : Seconds(17));
else
- events.ScheduleEvent(EVENT_INEVITABLE_DOOM, 30 * IN_MILLISECONDS);
+ events.Repeat(30);
break;
case EVENT_SPORE:
DoCast(me, SPELL_SUMMON_SPORE, false);
- events.ScheduleEvent(EVENT_SPORE, RAID_MODE(36,18) * IN_MILLISECONDS);
+ events.Repeat(RAID_MODE(Seconds(36), Seconds(15)));
break;
case EVENT_NECROTIC_AURA_FADING:
Talk(SAY_NECROTIC_AURA_FADING);
break;
+ case EVENT_NECROTIC_AURA_FADED:
+ Talk(SAY_NECROTIC_AURA_REMOVED);
+ break;
default:
break;
}
@@ -177,49 +169,6 @@ class achievement_spore_loser : public AchievementCriteriaScript
}
};
-typedef boss_loatheb::boss_loathebAI LoathebAI;
-
-class spell_loatheb_necrotic_aura_warning : public SpellScriptLoader
-{
- public:
- spell_loatheb_necrotic_aura_warning() : SpellScriptLoader("spell_loatheb_necrotic_aura_warning") { }
-
- class spell_loatheb_necrotic_aura_warning_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_loatheb_necrotic_aura_warning_AuraScript);
-
- bool Validate(SpellInfo const* /*spell*/) override
- {
- if (!sSpellStore.LookupEntry(SPELL_WARN_NECROTIC_AURA))
- return false;
- return true;
- }
-
- void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- if (GetTarget()->IsAIEnabled)
- ENSURE_AI(LoathebAI, GetTarget()->GetAI())->Talk(SAY_NECROTIC_AURA_APPLIED);
- }
-
- void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- if (GetTarget()->IsAIEnabled)
- ENSURE_AI(LoathebAI, GetTarget()->GetAI())->Talk(SAY_NECROTIC_AURA_REMOVED);
- }
-
- void Register() override
- {
- AfterEffectApply += AuraEffectApplyFn(spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
- AfterEffectRemove += AuraEffectRemoveFn(spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
- }
- };
-
- AuraScript* GetAuraScript() const override
- {
- return new spell_loatheb_necrotic_aura_warning_AuraScript();
- }
-};
-
class spell_loatheb_deathbloom : public SpellScriptLoader
{
public:
@@ -260,6 +209,5 @@ void AddSC_boss_loatheb()
{
new boss_loatheb();
new achievement_spore_loser();
- new spell_loatheb_necrotic_aura_warning();
new spell_loatheb_deathbloom();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
index 9d8f1365afb..9502193884a 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp
@@ -73,6 +73,8 @@ struct WebTargetSelector : public std::unary_function<Unit*, bool>
WebTargetSelector(Unit* maexxna) : _maexxna(maexxna) {}
bool operator()(Unit const* target) const
{
+ if (target->GetTypeId() != TYPEID_PLAYER) // never web nonplayers (pets, guardians, etc.)
+ return false;
if (_maexxna->GetVictim() == target) // never target tank
return false;
if (target->HasAura(SPELL_WEB_WRAP)) // never target targets that are already webbed
@@ -101,11 +103,11 @@ public:
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
- events.ScheduleEvent(EVENT_WRAP, 20 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_SPRAY, 40 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_SHOCK, urandms(5, 10));
- events.ScheduleEvent(EVENT_POISON, urandms(10, 15));
- events.ScheduleEvent(EVENT_SUMMON, 30 * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_WRAP, Seconds(20));
+ events.ScheduleEvent(EVENT_SPRAY, Seconds(40));
+ events.ScheduleEvent(EVENT_SHOCK, randtime(Seconds(5), Seconds(10)));
+ events.ScheduleEvent(EVENT_POISON, randtime(Seconds(10), Seconds(15)));
+ events.ScheduleEvent(EVENT_SUMMON, Seconds(30));
}
void Reset() override
@@ -153,28 +155,28 @@ public:
}
}
}
- events.ScheduleEvent(EVENT_WRAP, 40000);
+ events.Repeat(Seconds(40));
break;
}
case EVENT_SPRAY:
Talk(EMOTE_WEB_SPRAY);
DoCastAOE(SPELL_WEB_SPRAY);
- events.ScheduleEvent(EVENT_SPRAY, 40000);
+ events.Repeat(Seconds(40));
break;
case EVENT_SHOCK:
DoCastAOE(SPELL_POISON_SHOCK);
- events.ScheduleEvent(EVENT_SHOCK, urandms(10, 20));
+ events.Repeat(randtime(Seconds(10), Seconds(20)));
break;
case EVENT_POISON:
DoCastVictim(SPELL_NECROTIC_POISON);
- events.ScheduleEvent(EVENT_POISON, urandms(10, 20));
+ events.Repeat(randtime(Seconds(10), Seconds(20)));
break;
case EVENT_SUMMON:
Talk(EMOTE_SPIDERS);
uint8 amount = urand(8, 10);
for (uint8 i = 0; i < amount; ++i)
DoSummon(NPC_SPIDERLING, me, 4.0f, 5 * IN_MILLISECONDS, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
- events.ScheduleEvent(EVENT_SUMMON, 40000);
+ events.Repeat(Seconds(40));
break;
}
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
index 8ee3936dee3..2108b4ce102 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
@@ -131,25 +131,25 @@ public:
Reset();
else
{
- uint8 secondsGround;
+ uint8 timeGround;
switch (balconyCount)
{
case 0:
- secondsGround = 90;
+ timeGround = 90;
break;
case 1:
- secondsGround = 110;
+ timeGround = 110;
break;
case 2:
default:
- secondsGround = 180;
+ timeGround = 180;
}
- events.ScheduleEvent(EVENT_GROUND_ATTACKABLE, 2 * IN_MILLISECONDS, 0, PHASE_GROUND);
- events.ScheduleEvent(EVENT_BALCONY, secondsGround * IN_MILLISECONDS, 0, PHASE_GROUND);
- events.ScheduleEvent(EVENT_CURSE, urand(10,25) * IN_MILLISECONDS, 0, PHASE_GROUND);
- events.ScheduleEvent(EVENT_WARRIOR, urand(20,30) * IN_MILLISECONDS, 0, PHASE_GROUND);
+ events.ScheduleEvent(EVENT_GROUND_ATTACKABLE, Seconds(2), 0, PHASE_GROUND);
+ events.ScheduleEvent(EVENT_BALCONY, Seconds(timeGround), 0, PHASE_GROUND);
+ events.ScheduleEvent(EVENT_CURSE, randtime(Seconds(10), Seconds(25)), 0, PHASE_GROUND);
+ events.ScheduleEvent(EVENT_WARRIOR, randtime(Seconds(20), Seconds(30)), 0, PHASE_GROUND);
if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)
- events.ScheduleEvent(EVENT_BLINK, urand(20,30) * IN_MILLISECONDS, 0, PHASE_GROUND);
+ events.ScheduleEvent(EVENT_BLINK, randtime(Seconds(20), Seconds(30)), 0, PHASE_GROUND);
}
}
@@ -220,7 +220,7 @@ public:
case EVENT_CURSE:
{
DoCastAOE(SPELL_CURSE);
- events.ScheduleEvent(EVENT_CURSE, urand(50, 70) * IN_MILLISECONDS, 0, PHASE_GROUND);
+ events.Repeat(randtime(Seconds(50), Seconds(70)));
break;
}
case EVENT_WARRIOR:
@@ -229,7 +229,7 @@ public:
CastSummon(RAID_MODE(2, 3), 0, 0);
- events.ScheduleEvent(EVENT_WARRIOR, 40 * IN_MILLISECONDS, 0, PHASE_GROUND);
+ events.Repeat(Seconds(40));
break;
case EVENT_BLINK:
DoCastAOE(SPELL_CRIPPLE, true);
@@ -237,7 +237,7 @@ public:
DoResetThreat();
justBlinked = true;
- events.ScheduleEvent(EVENT_BLINK, 40000, 0, PHASE_GROUND);
+ events.Repeat(Seconds(40));
break;
case EVENT_BALCONY:
events.SetPhase(PHASE_BALCONY);
@@ -247,24 +247,24 @@ public:
me->StopMoving();
me->RemoveAllAuras();
- events.ScheduleEvent(EVENT_BALCONY_TELEPORT, 3 * IN_MILLISECONDS, 0, PHASE_BALCONY);
- events.ScheduleEvent(EVENT_WAVE, urand(5 * IN_MILLISECONDS, 8 * IN_MILLISECONDS), 0, PHASE_BALCONY);
+ events.ScheduleEvent(EVENT_BALCONY_TELEPORT, Seconds(3), 0, PHASE_BALCONY);
+ events.ScheduleEvent(EVENT_WAVE, randtime(Seconds(5), Seconds(8)), 0, PHASE_BALCONY);
- uint8 secondsBalcony;
+ uint8 timeBalcony;
switch (balconyCount)
{
case 0:
- secondsBalcony = 70;
+ timeBalcony = 70;
break;
case 1:
- secondsBalcony = 97;
+ timeBalcony = 97;
break;
case 2:
default:
- secondsBalcony = 120;
+ timeBalcony = 120;
break;
}
- events.ScheduleEvent(EVENT_GROUND, secondsBalcony * IN_MILLISECONDS, 0, PHASE_BALCONY);
+ events.ScheduleEvent(EVENT_GROUND, Seconds(timeBalcony), 0, PHASE_BALCONY);
break;
case EVENT_BALCONY_TELEPORT:
Talk(EMOTE_TELEPORT_1);
@@ -287,7 +287,7 @@ public:
CastSummon(0, RAID_MODE(5, 10), RAID_MODE(5, 10));
break;
}
- events.ScheduleEvent(EVENT_WAVE, urand(30, 45) * IN_MILLISECONDS, 0, PHASE_BALCONY);
+ events.Repeat(randtime(Seconds(30), Seconds(45)));
break;
case EVENT_GROUND:
++balconyCount;
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
index b8ce402a939..cfa6e2e9f30 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
@@ -97,8 +97,8 @@ public:
_EnterCombat();
Enraged = false;
Talk(SAY_AGGRO);
- events.ScheduleEvent(EVENT_HATEFUL, 1 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_BERSERK, 6 * MINUTE * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_HATEFUL, Seconds(1));
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(6));
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_MAKE_QUICK_WERK_OF_HIM_STARTING_EVENT);
}
@@ -167,17 +167,17 @@ public:
if (thirdThreatTarget)
me->getThreatManager().addThreat(thirdThreatTarget, HATEFUL_THREAT_AMT); // this will only ever be used in 25m
- events.ScheduleEvent(EVENT_HATEFUL, 1 * IN_MILLISECONDS);
+ events.Repeat(Seconds(1));
break;
}
case EVENT_BERSERK:
DoCast(me, SPELL_BERSERK, true);
Talk(EMOTE_BERSERK);
- events.ScheduleEvent(EVENT_SLIME, 2 * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_SLIME, Seconds(2));
break;
case EVENT_SLIME:
- DoCastVictim(SPELL_SLIME_BOLT, true);
- events.ScheduleEvent(EVENT_SLIME, 2 * IN_MILLISECONDS);
+ DoCastAOE(SPELL_SLIME_BOLT, true);
+ events.Repeat(Seconds(2));
break;
}
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
index 1d12f64a949..548f8086eb8 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp
@@ -104,6 +104,9 @@ public:
void JustDied(Unit* /*killer*/) override
{
+ for (ObjectGuid summonGuid : summons)
+ if (Creature* summon = ObjectAccessor::GetCreature(*me, summonGuid))
+ summon->RemoveCharmAuras();
Talk(SAY_DEATH);
DoCastAOE(SPELL_HOPELESS, true);
@@ -117,10 +120,10 @@ public:
me->StopMoving();
summons.DoZoneInCombat();
Talk(SAY_AGGRO);
- events.ScheduleEvent(EVENT_ATTACK, 7 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_STRIKE, 21 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_SHOUT, 16 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_KNIFE, 10 * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_ATTACK, Seconds(7));
+ events.ScheduleEvent(EVENT_STRIKE, Seconds(21));
+ events.ScheduleEvent(EVENT_SHOUT, Seconds(16));
+ events.ScheduleEvent(EVENT_KNIFE, Seconds(10));
}
void UpdateAI(uint32 diff) override
@@ -141,16 +144,16 @@ public:
break;
case EVENT_STRIKE:
DoCastVictim(SPELL_UNBALANCING_STRIKE);
- events.ScheduleEvent(EVENT_STRIKE, 6 * IN_MILLISECONDS);
+ events.Repeat(Seconds(6));
return;
case EVENT_SHOUT:
DoCastAOE(SPELL_DISRUPTING_SHOUT);
- events.ScheduleEvent(EVENT_SHOUT, 16 * IN_MILLISECONDS);
+ events.Repeat(Seconds(16));
return;
case EVENT_KNIFE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f))
DoCast(target, SPELL_JAGGED_KNIFE);
- events.ScheduleEvent(EVENT_KNIFE, urandms(10,15));
+ events.Repeat(randtime(Seconds(10), Seconds(15)));
return;
}
}
@@ -174,7 +177,10 @@ class npc_dk_understudy : public CreatureScript
struct npc_dk_understudyAI : public ScriptedAI
{
- npc_dk_understudyAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), bloodStrikeTimer(0) { }
+ npc_dk_understudyAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), bloodStrikeTimer(0)
+ {
+ creature->LoadEquipment(1);
+ }
void EnterCombat(Unit* /*who*/) override
{
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
index 68b9e252150..0c9a236e196 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
@@ -16,7 +16,9 @@
*/
#include "ScriptMgr.h"
+#include "GameObjectAI.h"
#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "Player.h"
#include "SpellInfo.h"
#include "naxxramas.h"
@@ -31,25 +33,24 @@ enum Yells
enum Spells
{
- SPELL_FROST_AURA = 28531,
- SPELL_CLEAVE = 19983,
- SPELL_TAIL_SWEEP = 55697,
- SPELL_SUMMON_BLIZZARD = 28560,
- SPELL_LIFE_DRAIN = 28542,
- SPELL_ICEBOLT = 28522,
- SPELL_FROST_BREATH = 29318,
- SPELL_FROST_EXPLOSION = 28524,
- SPELL_FROST_MISSILE = 30101,
- SPELL_BERSERK = 26662,
- SPELL_DIES = 29357,
- SPELL_CHILL = 28547,
- SPELL_CHECK_RESISTS = 60539,
+ SPELL_FROST_AURA = 28531,
+ SPELL_CLEAVE = 19983,
+ SPELL_TAIL_SWEEP = 55697,
+ SPELL_SUMMON_BLIZZARD = 28560,
+ SPELL_LIFE_DRAIN = 28542,
+ SPELL_ICEBOLT = 28522,
+ SPELL_FROST_BREATH_ANTICHEAT = 29318, // damage effect ignoring LoS on the entrance platform to prevent cheese
+ SPELL_FROST_BREATH = 28524, // damage effect below sapphiron
+ SPELL_FROST_MISSILE = 30101, // visual only
+ SPELL_BERSERK = 26662,
+ SPELL_DIES = 29357,
+ SPELL_CHECK_RESISTS = 60539,
+ SPELL_SAPPHIRON_WING_BUFFET = 29328
};
enum Phases
{
- PHASE_NULL = 0,
- PHASE_BIRTH,
+ PHASE_BIRTH = 1,
PHASE_GROUND,
PHASE_FLIGHT
};
@@ -72,9 +73,15 @@ enum Events
EVENT_CHECK_RESISTS
};
+enum Actions
+{
+ ACTION_BIRTH = 1
+};
+
enum Misc
{
NPC_BLIZZARD = 16474,
+ NPC_WING_BUFFET = 17025,
GO_ICEBLOCK = 181247,
// The Hundred Club
@@ -92,77 +99,74 @@ class boss_sapphiron : public CreatureScript
struct boss_sapphironAI : public BossAI
{
boss_sapphironAI(Creature* creature) :
- BossAI(creature, BOSS_SAPPHIRON), _iceboltCount(0), _map(me->GetMap())
+ BossAI(creature, BOSS_SAPPHIRON)
{
Initialize();
}
void Initialize()
{
- _phase = PHASE_NULL;
-
+ _delayedDrain = false;
_canTheHundredClub = true;
}
void InitializeAI() override
{
+ if (instance->GetBossState(BOSS_SAPPHIRON) == DONE)
+ return;
+
_canTheHundredClub = true;
- float x, y, z;
- me->GetPosition(x, y, z);
- me->SummonGameObject(GO_BIRTH, x, y, z, 0, 0, 0, 0, 0, 0);
- me->SetVisible(false);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->SetReactState(REACT_PASSIVE);
+ if (!instance->GetData(DATA_HAD_SAPPHIRON_BIRTH))
+ {
+ me->SetVisible(false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetReactState(REACT_PASSIVE);
+ }
BossAI::InitializeAI();
}
void Reset() override
{
- _Reset();
-
- if (_phase == PHASE_FLIGHT)
+ if (events.IsInPhase(PHASE_FLIGHT))
{
- ClearIceBlock();
+ instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_ICEBOLT);
me->SetReactState(REACT_AGGRESSIVE);
if (me->IsHovering())
{
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
me->SetHover(false);
}
- me->SetDisableGravity(false);
}
+ _Reset();
Initialize();
}
+ void DamageTaken(Unit* /*who*/, uint32& damage) override
+ {
+ if (damage < me->GetHealth() || !events.IsInPhase(PHASE_FLIGHT))
+ return;
+ damage = me->GetHealth()-1; // don't die during air phase
+ }
+
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
me->CastSpell(me, SPELL_FROST_AURA, true);
- DoCast(me, SPELL_CHECK_RESISTS);
- events.ScheduleEvent(EVENT_CHECK_RESISTS, 30 * IN_MILLISECONDS);
- events.ScheduleEvent(EVENT_BERSERK, 15 * MINUTE * IN_MILLISECONDS);
- EnterPhaseGround();
+ events.SetPhase(PHASE_GROUND);
+ events.ScheduleEvent(EVENT_CHECK_RESISTS, Seconds(0));
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(15));
+ EnterPhaseGround(true);
}
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch(spell->Id)
{
- case SPELL_ICEBOLT:
- {
- IceBlockMap::iterator itr = _iceblocks.find(target->GetGUID());
- if (itr != _iceblocks.end() && !itr->second)
- {
- if (GameObject* iceblock = me->SummonGameObject(GO_ICEBLOCK, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, 0, 0, 0, 0, 25))
- itr->second = iceblock->GetGUID();
- }
- break;
- }
case SPELL_CHECK_RESISTS:
if (target && target->GetResistance(SPELL_SCHOOL_FROST) > MAX_FROST_RESISTANCE)
_canTheHundredClub = false;
@@ -179,41 +183,37 @@ class boss_sapphiron : public CreatureScript
void MovementInform(uint32 /*type*/, uint32 id) override
{
if (id == 1)
- events.ScheduleEvent(EVENT_LIFTOFF, 0);
+ events.ScheduleEvent(EVENT_LIFTOFF, Seconds(0), 0, PHASE_FLIGHT);
}
void DoAction(int32 param) override
{
- if (param == DATA_SAPPHIRON_BIRTH)
+ if (param == ACTION_BIRTH)
{
- _phase = PHASE_BIRTH;
- events.ScheduleEvent(EVENT_BIRTH, 23 * IN_MILLISECONDS);
+ events.SetPhase(PHASE_BIRTH);
+ events.ScheduleEvent(EVENT_BIRTH, Seconds(23));
}
}
- void EnterPhaseGround()
+ void EnterPhaseGround(bool initial)
{
- _phase = PHASE_GROUND;
me->SetReactState(REACT_AGGRESSIVE);
- events.SetPhase(PHASE_GROUND);
- events.ScheduleEvent(EVENT_CLEAVE, urand(5, 15) * IN_MILLISECONDS, 0, PHASE_GROUND);
- events.ScheduleEvent(EVENT_TAIL, urand(5, 15) * IN_MILLISECONDS, 0, PHASE_GROUND);
- events.ScheduleEvent(EVENT_DRAIN, 24 * IN_MILLISECONDS, 0, PHASE_GROUND);
- events.ScheduleEvent(EVENT_BLIZZARD, urand(5, 10) * IN_MILLISECONDS, 0, PHASE_GROUND);
- events.ScheduleEvent(EVENT_FLIGHT, 45 * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_CLEAVE, randtime(Seconds(5), Seconds(15)), 0, PHASE_GROUND);
+ events.ScheduleEvent(EVENT_TAIL, randtime(Seconds(7), Seconds(10)), 0, PHASE_GROUND);
+ events.ScheduleEvent(EVENT_BLIZZARD, randtime(Seconds(5), Seconds(10)), 0, PHASE_GROUND);
+ if (initial)
+ {
+ events.ScheduleEvent(EVENT_DRAIN, randtime(Seconds(22), Seconds(28)));
+ events.ScheduleEvent(EVENT_FLIGHT, Seconds(48) + Milliseconds(500), 0, PHASE_GROUND);
+ }
+ else
+ events.ScheduleEvent(EVENT_FLIGHT, Minutes(1), 0, PHASE_GROUND);
}
- void ClearIceBlock()
+ inline void CastDrain()
{
- for (IceBlockMap::const_iterator itr = _iceblocks.begin(); itr != _iceblocks.end(); ++itr)
- {
- if (Player* player = ObjectAccessor::GetPlayer(*me, itr->first))
- player->RemoveAura(SPELL_ICEBOLT);
-
- if (GameObject* go = ObjectAccessor::GetGameObject(*me, itr->second))
- go->Delete();
- }
- _iceblocks.clear();
+ DoCastAOE(SPELL_LIFE_DRAIN);
+ events.ScheduleEvent(EVENT_DRAIN, randtime(Seconds(22), Seconds(28)));
}
uint32 GetData(uint32 data) const override
@@ -226,15 +226,12 @@ class boss_sapphiron : public CreatureScript
void UpdateAI(uint32 diff) override
{
- if (!_phase)
- return;
-
events.Update(diff);
- if (_phase != PHASE_BIRTH && !UpdateVictim())
+ if (!events.IsInPhase(PHASE_BIRTH) && !UpdateVictim())
return;
- if (_phase == PHASE_GROUND)
+ if (events.IsInPhase(PHASE_GROUND))
{
while (uint32 eventId = events.ExecuteEvent())
{
@@ -242,7 +239,10 @@ class boss_sapphiron : public CreatureScript
{
case EVENT_CHECK_RESISTS:
DoCast(me, SPELL_CHECK_RESISTS);
- events.ScheduleEvent(EVENT_CHECK_RESISTS, 30 * IN_MILLISECONDS);
+ events.Repeat(Seconds(30));
+ return;
+ case EVENT_GROUND:
+ EnterPhaseGround(false);
return;
case EVENT_BERSERK:
Talk(EMOTE_ENRAGE);
@@ -250,27 +250,26 @@ class boss_sapphiron : public CreatureScript
return;
case EVENT_CLEAVE:
DoCastVictim(SPELL_CLEAVE);
- events.ScheduleEvent(EVENT_CLEAVE, urand(5, 15) * IN_MILLISECONDS, 0, PHASE_GROUND);
+ events.ScheduleEvent(EVENT_CLEAVE, randtime(Seconds(5), Seconds(15)), 0, PHASE_GROUND);
return;
case EVENT_TAIL:
DoCastAOE(SPELL_TAIL_SWEEP);
- events.ScheduleEvent(EVENT_TAIL, urand(5, 15) * IN_MILLISECONDS, 0, PHASE_GROUND);
+ events.ScheduleEvent(EVENT_TAIL, randtime(Seconds(7), Seconds(10)), 0, PHASE_GROUND);
return;
case EVENT_DRAIN:
- DoCastAOE(SPELL_LIFE_DRAIN);
- events.ScheduleEvent(EVENT_DRAIN, 24 * IN_MILLISECONDS, 0, PHASE_GROUND);
+ if (events.IsInPhase(PHASE_FLIGHT))
+ _delayedDrain = true;
+ else
+ CastDrain();
return;
case EVENT_BLIZZARD:
- {
- if (Creature* summon = DoSummon(NPC_BLIZZARD, me, 0.0f, urand(25, 30) * IN_MILLISECONDS, TEMPSUMMON_TIMED_DESPAWN))
- summon->GetMotionMaster()->MoveRandom(40);
- events.ScheduleEvent(EVENT_BLIZZARD, RAID_MODE(20, 7) * IN_MILLISECONDS, 0, PHASE_GROUND);
+ DoCastAOE(SPELL_SUMMON_BLIZZARD);
+ events.ScheduleEvent(EVENT_BLIZZARD, RAID_MODE(Seconds(20), Seconds(7)), 0, PHASE_GROUND);
break;
- }
case EVENT_FLIGHT:
if (HealthAbovePct(10))
{
- _phase = PHASE_FLIGHT;
+ _delayedDrain = false;
events.SetPhase(PHASE_FLIGHT);
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
@@ -293,61 +292,69 @@ class boss_sapphiron : public CreatureScript
{
case EVENT_CHECK_RESISTS:
DoCast(me, SPELL_CHECK_RESISTS);
- events.ScheduleEvent(EVENT_CHECK_RESISTS, 30 * IN_MILLISECONDS);
+ events.Repeat(Seconds(30));
return;
case EVENT_LIFTOFF:
+ {
Talk(EMOTE_AIR_PHASE);
- me->SetDisableGravity(true);
+ if (Creature* buffet = DoSummon(NPC_WING_BUFFET, me, 0.0f, 0, TEMPSUMMON_MANUAL_DESPAWN))
+ _buffet = buffet->GetGUID();
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
me->SetHover(true);
- events.ScheduleEvent(EVENT_ICEBOLT, 1500);
- _iceboltCount = RAID_MODE(2, 3);
+ events.ScheduleEvent(EVENT_ICEBOLT, Seconds(7), 0, PHASE_FLIGHT);
+
+ _iceboltTargets.clear();
+ std::list<Unit*> targets;
+ SelectTargetList(targets, RAID_MODE(2, 3), SELECT_TARGET_RANDOM, 200.0f, true);
+ for (Unit* target : targets)
+ if (target)
+ _iceboltTargets.push_back(target->GetGUID());
return;
+ }
case EVENT_ICEBOLT:
{
- std::vector<Unit*> targets;
- std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
- for (; i != me->getThreatManager().getThreatList().end(); ++i)
- if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT))
- targets.push_back((*i)->getTarget());
-
- if (targets.empty())
- _iceboltCount = 0;
- else
+ if (_iceboltTargets.empty())
{
- std::vector<Unit*>::const_iterator itr = targets.begin();
- advance(itr, rand32() % targets.size());
- _iceblocks.insert(std::make_pair((*itr)->GetGUID(), ObjectGuid::Empty));
- DoCast(*itr, SPELL_ICEBOLT);
- --_iceboltCount;
+ events.ScheduleEvent(EVENT_BREATH, Seconds(2), 0, PHASE_FLIGHT);
+ return;
}
-
- if (_iceboltCount)
- events.ScheduleEvent(EVENT_ICEBOLT, 1 * IN_MILLISECONDS);
+ ObjectGuid target = _iceboltTargets.back();
+ if (Player* pTarget = ObjectAccessor::GetPlayer(*me, target))
+ if (pTarget->IsAlive())
+ DoCast(pTarget, SPELL_ICEBOLT);
+ _iceboltTargets.pop_back();
+
+ if (_iceboltTargets.empty())
+ events.ScheduleEvent(EVENT_BREATH, Seconds(2), 0, PHASE_FLIGHT);
else
- events.ScheduleEvent(EVENT_BREATH, 1 * IN_MILLISECONDS);
+ events.Repeat(Seconds(3));
return;
}
case EVENT_BREATH:
{
Talk(EMOTE_BREATH);
DoCastAOE(SPELL_FROST_MISSILE);
- events.ScheduleEvent(EVENT_EXPLOSION, 8 * IN_MILLISECONDS);
+ events.ScheduleEvent(EVENT_EXPLOSION, Seconds(8), 0, PHASE_FLIGHT);
return;
}
case EVENT_EXPLOSION:
- CastExplosion();
- ClearIceBlock();
- events.ScheduleEvent(EVENT_LAND, 3 * IN_MILLISECONDS);
+ DoCastAOE(SPELL_FROST_BREATH);
+ DoCastAOE(SPELL_FROST_BREATH_ANTICHEAT);
+ events.ScheduleEvent(EVENT_LAND, Seconds(3) + Milliseconds(500), 0, PHASE_FLIGHT);
return;
case EVENT_LAND:
+ if (_delayedDrain)
+ CastDrain();
+ if (Creature* cBuffet = ObjectAccessor::GetCreature(*me, _buffet))
+ {
+ cBuffet->DespawnOrUnsummon(1 * IN_MILLISECONDS);
+ _buffet.Clear();
+ }
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
Talk(EMOTE_GROUND_PHASE);
me->SetHover(false);
- me->SetDisableGravity(false);
- events.ScheduleEvent(EVENT_GROUND, 1500);
- return;
- case EVENT_GROUND:
- EnterPhaseGround();
+ events.SetPhase(PHASE_GROUND);
+ events.ScheduleEvent(EVENT_GROUND, Seconds(3) + Milliseconds(500), 0, PHASE_GROUND);
return;
case EVENT_BIRTH:
me->SetVisible(true);
@@ -359,56 +366,261 @@ class boss_sapphiron : public CreatureScript
}
}
- void CastExplosion()
+ private:
+ std::vector<ObjectGuid> _iceboltTargets;
+ ObjectGuid _buffet;
+ bool _delayedDrain;
+ bool _canTheHundredClub;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new boss_sapphironAI(creature);
+ }
+};
+
+class go_sapphiron_birth : public GameObjectScript
+{
+ public:
+ go_sapphiron_birth() : GameObjectScript("go_sapphiron_birth") { }
+
+ struct go_sapphiron_birthAI : public GameObjectAI
+ {
+ go_sapphiron_birthAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
+
+ void OnStateChanged(uint32 state, Unit* who) override
+ {
+ if (state == GO_ACTIVATED)
+ {
+ if (who)
+ {
+ if (Creature* sapphiron = ObjectAccessor::GetCreature(*go, instance->GetGuidData(DATA_SAPPHIRON)))
+ sapphiron->AI()->DoAction(ACTION_BIRTH);
+ instance->SetData(DATA_HAD_SAPPHIRON_BIRTH, 1u);
+ }
+ }
+ else if (state == GO_JUST_DEACTIVATED)
+ { // prevent ourselves from going back to _READY and resetting the client anim
+ go->SetRespawnTime(0);
+ go->Delete();
+ }
+ }
+
+ InstanceScript* instance;
+ };
+
+ GameObjectAI* GetAI(GameObject* go) const override
+ {
+ return GetInstanceAI<go_sapphiron_birthAI>(go);
+ }
+};
+
+
+class spell_sapphiron_change_blizzard_target : public SpellScriptLoader
+{
+ public:
+ spell_sapphiron_change_blizzard_target() : SpellScriptLoader("spell_sapphiron_change_blizzard_target") { }
+
+ class spell_sapphiron_change_blizzard_target_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_sapphiron_change_blizzard_target_AuraScript);
+
+ void HandlePeriodic(AuraEffect const* /*eff*/)
+ {
+ TempSummon* me = GetTarget()->ToTempSummon();
+ if (Creature* owner = me ? me->GetSummonerCreatureBase() : nullptr)
+ {
+ Unit* newTarget = owner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true);
+ if (!newTarget)
+ newTarget = owner->getAttackerForHelper();
+ if (newTarget)
+ me->GetMotionMaster()->MoveFollow(newTarget, 0.1f, 0.0f);
+ else
+ {
+ me->StopMoving();
+ me->GetMotionMaster()->Clear();
+ }
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_sapphiron_change_blizzard_target_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_sapphiron_change_blizzard_target_AuraScript();
+ }
+};
+
+class spell_sapphiron_icebolt : public SpellScriptLoader
+{
+ public:
+ spell_sapphiron_icebolt() : SpellScriptLoader("spell_sapphiron_icebolt") { }
+
+ class spell_sapphiron_icebolt_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_sapphiron_icebolt_AuraScript);
+
+ void HandleApply(AuraEffect const* /*eff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->ApplySpellImmune(SPELL_ICEBOLT, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_FROST, true);
+ }
+
+ void HandleRemove(AuraEffect const* /*eff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (_block)
+ if (GameObject* oBlock = ObjectAccessor::GetGameObject(*GetTarget(), _block))
+ oBlock->Delete();
+ GetTarget()->ApplySpellImmune(SPELL_ICEBOLT, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_FROST, false);
+ }
+
+ void HandlePeriodic(AuraEffect const* /*eff*/)
+ {
+ if (_block)
+ return;
+ if (GetTarget()->isMoving())
+ return;
+ float x, y, z;
+ GetTarget()->GetPosition(x, y, z);
+ if (GameObject* block = GetTarget()->SummonGameObject(GO_ICEBLOCK, x, y, z, 0.f, G3D::Quat(), 25))
+ _block = block->GetGUID();
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_sapphiron_icebolt_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_sapphiron_icebolt_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_sapphiron_icebolt_AuraScript::HandlePeriodic, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+
+ ObjectGuid _block;
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_sapphiron_icebolt_AuraScript();
+ }
+};
+
+// @hack Hello, developer from the future! How has your day been?
+// Anyway, this is, as you can undoubtedly see, a hack to emulate line of sight checks on a spell that abides line of sight anyway.
+// In the current core, line of sight is not properly checked for people standing behind an ice block. This is not a good thing and kills people.
+// Thus, we have this hack to check for ice block LoS in a "safe" way. Kind of. It's inaccurate, but in a good way (tends to save people when it shouldn't in edge cases).
+// If LoS handling is better in whatever the current revision is when you read this, please get rid of the hack. Thanks!
+class spell_sapphiron_frost_breath : public SpellScriptLoader
+{
+ public:
+ spell_sapphiron_frost_breath() : SpellScriptLoader("spell_sapphiron_frost_breath") { }
+
+ class spell_sapphiron_frost_breath_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_sapphiron_frost_breath_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ return !!sSpellMgr->GetSpellInfo(SPELL_FROST_BREATH);
+ }
+
+ void HandleTargets(std::list<WorldObject*>& targetList)
{
- DoZoneInCombat(); // make sure everyone is in threatlist
- std::vector<Unit*> targets;
- std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
- for (; i != me->getThreatManager().getThreatList().end(); ++i)
+ std::list<GameObject*> blocks;
+ if (GetCaster())
+ GetCaster()->GetGameObjectListWithEntryInGrid(blocks, GO_ICEBLOCK, 200.0f);
+
+ std::vector<Unit*> toRemove;
+ toRemove.reserve(3);
+ std::list<WorldObject*>::iterator it = targetList.begin();
+ while (it != targetList.end())
{
- Unit* target = (*i)->getTarget();
- if (target->GetTypeId() != TYPEID_PLAYER)
+ Unit* target = (*it)->ToUnit();
+ if (!target)
+ {
+ it = targetList.erase(it);
continue;
+ }
if (target->HasAura(SPELL_ICEBOLT))
{
- target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true);
- targets.push_back(target);
+ it = targetList.erase(it);
+ toRemove.push_back(target);
+ continue;
+ }
+
+ bool found = false;
+ for (GameObject* block : blocks)
+ if (block->IsInBetween(GetCaster(), target, 2.0f) && GetCaster()->GetExactDist2d(block) + 5 >= GetCaster()->GetExactDist2d(target))
+ {
+ found = true;
+ break;
+ }
+ if (found)
+ {
+ it = targetList.erase(it);
continue;
}
+ ++it;
+ }
+
+ for (Unit* block : toRemove)
+ block->RemoveAura(SPELL_ICEBOLT);
+ }
+
+ void Register() override
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sapphiron_frost_breath_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
+ }
+ };
- for (IceBlockMap::const_iterator itr = _iceblocks.begin(); itr != _iceblocks.end(); ++itr)
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_sapphiron_frost_breath_SpellScript();
+ }
+};
+
+class spell_sapphiron_summon_blizzard : public SpellScriptLoader
+{
+ public:
+ spell_sapphiron_summon_blizzard() : SpellScriptLoader("spell_sapphiron_summon_blizzard") { }
+
+ class spell_sapphiron_summon_blizzard_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_sapphiron_summon_blizzard_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ return !!sSpellMgr->GetSpellInfo(SPELL_SUMMON_BLIZZARD);
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ if (Creature* blizzard = GetCaster()->SummonCreature(NPC_BLIZZARD, *target, TEMPSUMMON_TIMED_DESPAWN, urandms(25, 30)))
{
- if (GameObject* go = ObjectAccessor::GetGameObject(*me, itr->second))
+ blizzard->CastSpell(nullptr, blizzard->m_spells[0], TRIGGERED_NONE);
+ if (Creature* creatureCaster = GetCaster()->ToCreature())
{
- if (go->IsInBetween(me, target, 2.0f)
- && me->GetExactDist2d(target->GetPositionX(), target->GetPositionY()) - me->GetExactDist2d(go->GetPositionX(), go->GetPositionY()) < 5.0f)
+ if (Unit* newTarget = creatureCaster->AI()->SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
{
- target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true);
- targets.push_back(target);
- break;
+ blizzard->GetMotionMaster()->MoveFollow(newTarget, 0.1f, 0.0f);
+ return;
}
}
+ blizzard->GetMotionMaster()->MoveFollow(target, 0.1f, 0.0f);
}
- }
-
- me->CastSpell(me, SPELL_FROST_EXPLOSION, true);
-
- for (std::vector<Unit*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
- (*itr)->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, false);
}
- private:
- Phases _phase;
- uint32 _iceboltCount;
- IceBlockMap _iceblocks;
- bool _canTheHundredClub;
- Map* _map;
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_sapphiron_summon_blizzard_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
};
- CreatureAI* GetAI(Creature* creature) const override
+ SpellScript* GetSpellScript() const override
{
- return new boss_sapphironAI(creature);
+ return new spell_sapphiron_summon_blizzard_SpellScript();
}
};
@@ -426,5 +638,10 @@ class achievement_the_hundred_club : public AchievementCriteriaScript
void AddSC_boss_sapphiron()
{
new boss_sapphiron();
+ new go_sapphiron_birth();
+ new spell_sapphiron_change_blizzard_target();
+ new spell_sapphiron_icebolt();
+ new spell_sapphiron_frost_breath();
+ new spell_sapphiron_summon_blizzard();
new achievement_the_hundred_club();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
index 7330f90e585..2cf3a4664dd 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
@@ -109,6 +109,10 @@ enum PetSpells
SPELL_MAGNETIC_PULL = 54517,
SPELL_MAGNETIC_PULL_EFFECT = 28337,
+ // @hack feugen/stalagg use this in P1 after gripping tanks to prevent mmaps from pathing them off the platform once they approach the ramp
+ // developer from the future, if you read this and mmaps in the room has been fixed, then get rid of the hackfix, please
+ SPELL_ROOT_SELF = 75215,
+
SPELL_TESLA_SHOCK = 28099
};
@@ -166,10 +170,12 @@ public:
struct boss_thaddiusAI : public BossAI
{
public:
- boss_thaddiusAI(Creature* creature) : BossAI(creature, BOSS_THADDIUS), stalaggAlive(true), feugenAlive(true), ballLightningEnabled(false), shockingEligibility(true)
+ boss_thaddiusAI(Creature* creature) : BossAI(creature, BOSS_THADDIUS), stalaggAlive(true), feugenAlive(true), ballLightningUnlocked(false), ballLightningEnabled(false), shockingEligibility(true) {}
+
+ void InitializeAI() override
{
if (instance->GetBossState(BOSS_THADDIUS) != DONE)
- {
+ {
events.SetPhase(PHASE_NOT_ENGAGED);
SetCombatMovement(false);
@@ -184,12 +190,33 @@ public:
Talk(SAY_SLAY);
}
- void Reset() override
+ void Reset() override { }
+
+ void EnterEvadeMode(EvadeReason why) override
{
+ if (!ballLightningEnabled && why == EVADE_REASON_NO_HOSTILES)
+ {
+ ballLightningEnabled = true;
+ return; // try again
+ }
if (events.IsInPhase(PHASE_TRANSITION) || (events.IsInPhase(PHASE_THADDIUS) && me->IsAlive()))
BeginResetEncounter();
}
+ bool CanAIAttack(Unit const* who) const override
+ {
+ if (ballLightningEnabled || me->IsWithinMeleeRange(who))
+ return BossAI::CanAIAttack(who);
+ else
+ return false;
+ }
+
+ void JustRespawned() override
+ {
+ if (events.IsInPhase(PHASE_RESETTING))
+ ResetEncounter();
+ }
+
void JustDied(Unit* /*killer*/) override
{
_JustDied();
@@ -217,18 +244,25 @@ public:
case ACTION_FEUGEN_AGGRO:
case ACTION_STALAGG_AGGRO:
if (events.IsInPhase(PHASE_RESETTING))
- return BeginResetEncounter();
+ {
+ BeginResetEncounter();
+ return;
+ }
if (!events.IsInPhase(PHASE_NOT_ENGAGED))
return;
events.SetPhase(PHASE_PETS);
shockingEligibility = true;
-
+
if (!instance->CheckRequiredBosses(BOSS_THADDIUS))
- return BeginResetEncounter();
+ {
+ BeginResetEncounter();
+ return;
+ }
instance->SetBossState(BOSS_THADDIUS, IN_PROGRESS);
me->setActive(true);
+ DoZoneInCombat();
if (Creature* stalagg = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_STALAGG)))
stalagg->setActive(true);
if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN)))
@@ -239,7 +273,7 @@ public:
feugen->AI()->DoAction(ACTION_FEUGEN_REVIVING_FX);
feugenAlive = false;
if (stalaggAlive)
- events.ScheduleEvent(EVENT_REVIVE_FEUGEN, 5 * IN_MILLISECONDS, 0, PHASE_PETS);
+ events.ScheduleEvent(EVENT_REVIVE_FEUGEN, Seconds(5), 0, PHASE_PETS);
else
Transition();
@@ -249,7 +283,7 @@ public:
stalagg->AI()->DoAction(ACTION_STALAGG_REVIVING_FX);
stalaggAlive = false;
if (feugenAlive)
- events.ScheduleEvent(EVENT_REVIVE_STALAGG, 5 * IN_MILLISECONDS, 0, PHASE_PETS);
+ events.ScheduleEvent(EVENT_REVIVE_STALAGG, Seconds(5), 0, PHASE_PETS);
else
Transition();
@@ -274,9 +308,9 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- events.ScheduleEvent(EVENT_TRANSITION_1, 10 * IN_MILLISECONDS, 0, PHASE_TRANSITION);
- events.ScheduleEvent(EVENT_TRANSITION_2, 12 * IN_MILLISECONDS, 0, PHASE_TRANSITION);
- events.ScheduleEvent(EVENT_TRANSITION_3, 14 * IN_MILLISECONDS, 0, PHASE_TRANSITION);
+ events.ScheduleEvent(EVENT_TRANSITION_1, Seconds(10), 0, PHASE_TRANSITION);
+ events.ScheduleEvent(EVENT_TRANSITION_2, Seconds(12), 0, PHASE_TRANSITION);
+ events.ScheduleEvent(EVENT_TRANSITION_3, Seconds(14), 0, PHASE_TRANSITION);
}
void BeginResetEncounter(bool initial = false)
@@ -286,16 +320,12 @@ public:
if (events.IsInPhase(PHASE_RESETTING))
return;
- if (initial) // signal shorter spawn timer to instance script
- instance->SetBossState(BOSS_THADDIUS, SPECIAL);
- instance->ProcessEvent(me, EVENT_THADDIUS_BEGIN_RESET);
- instance->SetBossState(BOSS_THADDIUS, NOT_STARTED);
-
// remove polarity shift debuffs on reset
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POSITIVE_CHARGE_APPLY);
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_NEGATIVE_CHARGE_APPLY);
me->DespawnOrUnsummon();
+ me->SetRespawnTime(initial ? 5 : 30);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
events.SetPhase(PHASE_RESETTING);
@@ -312,11 +342,9 @@ public:
feugenAlive = true;
stalaggAlive = true;
- me->Respawn(true);
_Reset();
events.SetPhase(PHASE_NOT_ENGAGED);
-
- me->CastSpell(me, SPELL_THADDIUS_INACTIVE_VISUAL, true);
+ me->SetReactState(REACT_PASSIVE);
if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN)))
feugen->AI()->DoAction(ACTION_RESET_ENCOUNTER);
@@ -361,16 +389,20 @@ public:
break;
case EVENT_TRANSITION_3: // thaddius becomes active
me->CastSpell(me, SPELL_THADDIUS_SPARK_VISUAL, true);
- ballLightningEnabled = false;
+ ballLightningUnlocked = false;
me->RemoveAura(SPELL_THADDIUS_INACTIVE_VISUAL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
-
+ me->SetReactState(REACT_AGGRESSIVE);
+
DoZoneInCombat();
if (Unit* closest = SelectTarget(SELECT_TARGET_NEAREST, 0, 500.0f))
AttackStart(closest);
else // if there is no nearest target, then there is no target, meaning we should reset
- return BeginResetEncounter();
+ {
+ BeginResetEncounter();
+ return;
+ }
if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN)))
feugen->AI()->DoAction(ACTION_TRANSITION_3);
@@ -381,20 +413,20 @@ public:
Talk(SAY_AGGRO);
- events.ScheduleEvent(EVENT_ENABLE_BALL_LIGHTNING, 5 * IN_MILLISECONDS, 0, PHASE_THADDIUS);
- events.ScheduleEvent(EVENT_SHIFT, 10 * IN_MILLISECONDS, 0, PHASE_THADDIUS);
- events.ScheduleEvent(EVENT_CHAIN, urand(10, 20) * IN_MILLISECONDS, 0, PHASE_THADDIUS);
- events.ScheduleEvent(EVENT_BERSERK, 6 * MINUTE * IN_MILLISECONDS, 0, PHASE_THADDIUS);
+ events.ScheduleEvent(EVENT_ENABLE_BALL_LIGHTNING, Seconds(5), 0, PHASE_THADDIUS);
+ events.ScheduleEvent(EVENT_SHIFT, Seconds(10), 0, PHASE_THADDIUS);
+ events.ScheduleEvent(EVENT_CHAIN, randtime(Seconds(10), Seconds(20)), 0, PHASE_THADDIUS);
+ events.ScheduleEvent(EVENT_BERSERK, Minutes(6), 0, PHASE_THADDIUS);
break;
case EVENT_ENABLE_BALL_LIGHTNING:
- ballLightningEnabled = true;
+ ballLightningUnlocked = true;
break;
case EVENT_SHIFT:
me->CastStop(); // shift overrides all other spells
DoCastAOE(SPELL_POLARITY_SHIFT);
- events.ScheduleEvent(EVENT_SHIFT_TALK, 3 * IN_MILLISECONDS, PHASE_THADDIUS);
- events.ScheduleEvent(EVENT_SHIFT, 30 * IN_MILLISECONDS, PHASE_THADDIUS);
+ events.ScheduleEvent(EVENT_SHIFT_TALK, Seconds(3), PHASE_THADDIUS);
+ events.ScheduleEvent(EVENT_SHIFT, Seconds(30), PHASE_THADDIUS);
break;
case EVENT_SHIFT_TALK:
Talk(SAY_ELECT);
@@ -402,12 +434,12 @@ public:
break;
case EVENT_CHAIN:
if (me->FindCurrentSpellBySpellId(SPELL_POLARITY_SHIFT)) // delay until shift is over
- events.ScheduleEvent(EVENT_CHAIN, 3 * IN_MILLISECONDS, 0, PHASE_THADDIUS);
+ events.Repeat(Seconds(3));
else
{
me->CastStop();
DoCastVictim(SPELL_CHAIN_LIGHTNING);
- events.ScheduleEvent(EVENT_CHAIN, urand(10, 20) * IN_MILLISECONDS, PHASE_THADDIUS);
+ events.Repeat(randtime(Seconds(10), Seconds(20)));
}
break;
case EVENT_BERSERK:
@@ -418,22 +450,24 @@ public:
break;
}
}
-
- if (events.IsInPhase(PHASE_THADDIUS))
+ if (events.IsInPhase(PHASE_THADDIUS) && !me->HasUnitState(UNIT_STATE_CASTING) && me->isAttackReady())
{
if (me->IsWithinMeleeRange(me->GetVictim()))
+ {
+ ballLightningEnabled = false;
DoMeleeAttackIfReady();
- else
- if (ballLightningEnabled)
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
- DoCast(target, SPELL_BALL_LIGHTNING);
+ }
+ else if (ballLightningUnlocked)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
+ DoCast(target, SPELL_BALL_LIGHTNING);
}
}
private:
bool stalaggAlive;
bool feugenAlive;
- bool ballLightningEnabled;
+ bool ballLightningUnlocked; // whether the initial ball lightning grace period has expired and we should proceed to exterminate with extreme prejudice
+ bool ballLightningEnabled; // switch that is flipped to true if we try to evade due to no eligible targets in melee range
bool shockingEligibility;
};
@@ -521,7 +555,7 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Talk(EMOTE_FEIGN_REVIVE);
isFeignDeath = false;
-
+
refreshBeam = true; // force beam refresh
if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN)))
@@ -586,7 +620,7 @@ public:
damage = 0;
return;
}
-
+
isFeignDeath = true;
isOverloading = false;
@@ -652,7 +686,7 @@ public:
else
{
DoCast(me, SPELL_STALAGG_POWERSURGE);
- powerSurgeTimer = urand(25, 30) * IN_MILLISECONDS;
+ powerSurgeTimer = urandms(25, 30);
}
}
else
@@ -790,7 +824,7 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Talk(EMOTE_FEIGN_REVIVE);
isFeignDeath = false;
-
+
refreshBeam = true; // force beam refresh
if (Creature* stalagg = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_STALAGG)))
@@ -836,7 +870,7 @@ public:
Talk(SAY_FEUGEN_AGGRO);
if (Creature* thaddius = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THADDIUS)))
- thaddius->AI()->DoAction(ACTION_STALAGG_AGGRO);
+ thaddius->AI()->DoAction(ACTION_FEUGEN_AGGRO);
if (Creature* stalagg = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_STALAGG)))
if (!stalagg->IsInCombat())
@@ -922,7 +956,7 @@ public:
magneticPullTimer = 20 * IN_MILLISECONDS;
}
else magneticPullTimer -= uiDiff;
-
+
if (staticFieldTimer <= uiDiff)
{
DoCast(me, SPELL_FEUGEN_STATICFIELD);
@@ -971,7 +1005,7 @@ public:
ObjectGuid _myCoil;
ObjectGuid _myCoilGO;
-
+
bool isOverloading;
bool refreshBeam;
bool isFeignDeath;
@@ -1094,7 +1128,7 @@ class spell_thaddius_polarity_charge : public SpellScriptLoader
SpellScript* GetSpellScript() const override
{
- return new spell_thaddius_polarity_charge_SpellScript;
+ return new spell_thaddius_polarity_charge_SpellScript();
}
};
@@ -1169,7 +1203,7 @@ class spell_thaddius_magnetic_pull : public SpellScriptLoader
Unit* feugen = GetCaster();
if (!feugen || feugen->GetEntry() != NPC_FEUGEN)
return;
-
+
Unit* stalagg = ObjectAccessor::GetCreature(*feugen, feugen->GetInstanceScript()->GetGuidData(DATA_STALAGG));
if (!stalagg)
return;
@@ -1212,6 +1246,10 @@ class spell_thaddius_magnetic_pull : public SpellScriptLoader
feugenTank->CastSpell(stalaggTank, SPELL_MAGNETIC_PULL_EFFECT, true);
stalaggTank->CastSpell(feugenTank, SPELL_MAGNETIC_PULL_EFFECT, true);
+ // @hack prevent mmaps clusterfucks from breaking tesla while tanks are midair
+ feugen->AddAura(SPELL_ROOT_SELF, feugen);
+ stalagg->AddAura(SPELL_ROOT_SELF, stalagg);
+
// and make both attack their respective new tanks
if (feugen->GetAI())
feugen->GetAI()->AttackStart(stalaggTank);
diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
index c8a4eb7fbc8..720549de0b2 100644
--- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
@@ -20,7 +20,7 @@
#include "InstanceScript.h"
#include "naxxramas.h"
-BossBoundaryData const boundaries =
+BossBoundaryData const boundaries =
{
/* Arachnid Quarter */
{ BOSS_ANUBREKHAN, new CircleBoundary(Position(3273.376709f, -3475.876709f), Position(3195.668213f, -3475.930176f)) },
@@ -100,36 +100,6 @@ ObjectData const objectData[] =
{ 0, 0, }
};
-// from P2 teleport spell stored target
-float const HeiganPos[2] = { 2793.86f, -3707.38f };
-float const HeiganEruptionSlope[3] =
-{
- (-3703.303223f - HeiganPos[1]) / (2777.494141f - HeiganPos[0]), // between right center and far right
- (-3696.948242f - HeiganPos[1]) / (2785.624268f - HeiganPos[0]), // between left and right halves
- (-3691.880615f - HeiganPos[1]) / (2790.280029f - HeiganPos[0]) // between far left and left center
-};
-
-// 0 H x
-// 1 ^
-// 2 |
-// 3 y<--o
-inline uint32 GetEruptionSection(float x, float y)
-{
- y -= HeiganPos[1];
- if (y < 1.0f)
- return 0;
-
- x -= HeiganPos[0];
- if (x > -1.0f)
- return 3;
-
- float slope = y/x;
- for (uint32 i = 0; i < 3; ++i)
- if (slope > HeiganEruptionSlope[i])
- return i;
- return 3;
-}
-
class instance_naxxramas : public InstanceMapScript
{
public:
@@ -149,9 +119,13 @@ class instance_naxxramas : public InstanceMapScript
hadAnubRekhanGreet = false;
hadFaerlinaGreet = false;
hadThaddiusGreet = false;
+ hadSapphironBirth = false;
CurrentWingTaunt = SAY_KELTHUZAD_FIRST_WING_TAUNT;
playerDied = 0;
+
+ nextFroggerWave = 0;
+ events.ScheduleEvent(EVENT_SUMMON_FROGGER_WAVE, Seconds(1));
}
void OnCreatureCreate(Creature* creature) override
@@ -182,6 +156,9 @@ class instance_naxxramas : public InstanceMapScript
case NPC_SIR:
SirGUID = creature->GetGUID();
break;
+ case NPC_GLUTH:
+ GluthGUID = creature->GetGUID();
+ break;
case NPC_HEIGAN:
HeiganGUID = creature->GetGUID();
break;
@@ -208,28 +185,8 @@ class instance_naxxramas : public InstanceMapScript
}
}
- void ProcessEvent(WorldObject* /*source*/, uint32 eventId) override
- {
- switch (eventId)
- {
- case EVENT_THADDIUS_BEGIN_RESET:
- if (GetBossState(BOSS_THADDIUS) == SPECIAL) // this is the initial spawn, we want a shorter spawn time
- events.ScheduleEvent(EVENT_THADDIUS_RESET, 5 * IN_MILLISECONDS);
- else
- events.ScheduleEvent(EVENT_THADDIUS_RESET, 30 * IN_MILLISECONDS);
- break;
- }
- }
-
void OnGameObjectCreate(GameObject* go) override
{
- if (go->GetGOInfo()->displayId == 6785 || go->GetGOInfo()->displayId == 1287)
- {
- uint32 section = GetEruptionSection(go->GetPositionX(), go->GetPositionY());
- HeiganEruptionGUID[section].insert(go->GetGUID());
- return;
- }
-
switch (go->GetEntry())
{
case GO_GOTHIK_GATE:
@@ -273,37 +230,18 @@ class instance_naxxramas : public InstanceMapScript
if (GetBossState(BOSS_HORSEMEN) == DONE)
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
break;
- default:
- break;
- }
-
- InstanceScript::OnGameObjectCreate(go);
- }
-
- void OnGameObjectRemove(GameObject* go) override
- {
- if (go->GetGOInfo()->displayId == 6785 || go->GetGOInfo()->displayId == 1287)
- {
- uint32 section = GetEruptionSection(go->GetPositionX(), go->GetPositionY());
- HeiganEruptionGUID[section].erase(go->GetGUID());
- return;
- }
-
- switch (go->GetEntry())
- {
case GO_BIRTH:
- if (SapphironGUID)
+ if (hadSapphironBirth || GetBossState(BOSS_SAPPHIRON) == DONE)
{
- if (Creature* sapphiron = instance->GetCreature(SapphironGUID))
- sapphiron->AI()->DoAction(DATA_SAPPHIRON_BIRTH);
- return;
+ hadSapphironBirth = true;
+ go->Delete();
}
break;
default:
break;
}
- InstanceScript::OnGameObjectRemove(go);
+ InstanceScript::OnGameObjectCreate(go);
}
void OnUnitDeath(Unit* unit) override
@@ -328,9 +266,6 @@ class instance_naxxramas : public InstanceMapScript
{
switch (id)
{
- case DATA_HEIGAN_ERUPT:
- HeiganErupt(value);
- break;
case DATA_GOTHIK_GATE:
if (GameObject* gate = instance->GetGameObject(GothikGateGUID))
gate->SetGoState(GOState(value));
@@ -347,6 +282,9 @@ class instance_naxxramas : public InstanceMapScript
case DATA_HAD_THADDIUS_GREET:
hadThaddiusGreet = (value == 1u);
break;
+ case DATA_HAD_SAPPHIRON_BIRTH:
+ hadSapphironBirth = (value == 1u);
+ break;
default:
break;
}
@@ -364,6 +302,8 @@ class instance_naxxramas : public InstanceMapScript
return hadFaerlinaGreet ? 1u : 0u;
case DATA_HAD_THADDIUS_GREET:
return hadThaddiusGreet ? 1u : 0u;
+ case DATA_HAD_SAPPHIRON_BIRTH:
+ return hadSapphironBirth ? 1u : 0u;
default:
break;
}
@@ -393,12 +333,16 @@ class instance_naxxramas : public InstanceMapScript
return SirGUID;
case DATA_HEIGAN:
return HeiganGUID;
+ case DATA_GLUTH:
+ return GluthGUID;
case DATA_FEUGEN:
return FeugenGUID;
case DATA_STALAGG:
return StalaggGUID;
case DATA_THADDIUS:
return ThaddiusGUID;
+ case DATA_SAPPHIRON:
+ return SapphironGUID;
case DATA_KELTHUZAD:
return KelthuzadGUID;
case DATA_KELTHUZAD_PORTAL01:
@@ -431,7 +375,7 @@ class instance_naxxramas : public InstanceMapScript
if (GameObject* teleporter = GetGameObject(DATA_NAXX_PORTAL_ARACHNID))
teleporter->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
- events.ScheduleEvent(EVENT_KELTHUZAD_WING_TAUNT, 6000);
+ events.ScheduleEvent(EVENT_KELTHUZAD_WING_TAUNT, Seconds(6));
}
break;
case BOSS_LOATHEB:
@@ -440,7 +384,7 @@ class instance_naxxramas : public InstanceMapScript
if (GameObject* teleporter = GetGameObject(DATA_NAXX_PORTAL_PLAGUE))
teleporter->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
- events.ScheduleEvent(EVENT_KELTHUZAD_WING_TAUNT, 6000);
+ events.ScheduleEvent(EVENT_KELTHUZAD_WING_TAUNT, Seconds(6));
}
break;
case BOSS_THADDIUS:
@@ -449,12 +393,12 @@ class instance_naxxramas : public InstanceMapScript
if (GameObject* teleporter = GetGameObject(DATA_NAXX_PORTAL_CONSTRUCT))
teleporter->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
- events.ScheduleEvent(EVENT_KELTHUZAD_WING_TAUNT, 6000);
+ events.ScheduleEvent(EVENT_KELTHUZAD_WING_TAUNT, Seconds(6));
}
break;
case BOSS_GOTHIK:
if (state == DONE)
- events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_KORTHAZZ, 10000);
+ events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_KORTHAZZ, Seconds(10));
break;
case BOSS_HORSEMEN:
if (state == DONE)
@@ -468,12 +412,12 @@ class instance_naxxramas : public InstanceMapScript
if (GameObject* teleporter = GetGameObject(DATA_NAXX_PORTAL_MILITARY))
teleporter->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
- events.ScheduleEvent(EVENT_KELTHUZAD_WING_TAUNT, 6000);
+ events.ScheduleEvent(EVENT_KELTHUZAD_WING_TAUNT, Seconds(6));
}
break;
case BOSS_SAPPHIRON:
if (state == DONE)
- events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD, 6000);
+ events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD, Seconds(6));
break;
default:
break;
@@ -493,37 +437,37 @@ class instance_naxxramas : public InstanceMapScript
case EVENT_DIALOGUE_GOTHIK_KORTHAZZ:
if (Creature* korthazz = instance->GetCreature(ThaneGUID))
korthazz->AI()->Talk(SAY_DIALOGUE_GOTHIK_HORSEMAN);
- events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_ZELIEK, 5000);
+ events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_ZELIEK, Seconds(5));
break;
case EVENT_DIALOGUE_GOTHIK_ZELIEK:
if (Creature* zeliek = instance->GetCreature(SirGUID))
zeliek->AI()->Talk(SAY_DIALOGUE_GOTHIK_HORSEMAN);
- events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_BLAUMEUX, 6000);
+ events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_BLAUMEUX, Seconds(6));
break;
case EVENT_DIALOGUE_GOTHIK_BLAUMEUX:
if (Creature* blaumeux = instance->GetCreature(LadyGUID))
blaumeux->AI()->Talk(SAY_DIALOGUE_GOTHIK_HORSEMAN);
- events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_RIVENDARE, 6000);
+ events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_RIVENDARE, Seconds(6));
break;
case EVENT_DIALOGUE_GOTHIK_RIVENDARE:
if (Creature* rivendare = instance->GetCreature(BaronGUID))
rivendare->AI()->Talk(SAY_DIALOGUE_GOTHIK_HORSEMAN);
- events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_BLAUMEUX2, 6000);
+ events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_BLAUMEUX2, Seconds(6));
break;
case EVENT_DIALOGUE_GOTHIK_BLAUMEUX2:
if (Creature* blaumeux = instance->GetCreature(LadyGUID))
blaumeux->AI()->Talk(SAY_DIALOGUE_GOTHIK_HORSEMAN2);
- events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_ZELIEK2, 6000);
+ events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_ZELIEK2, Seconds(6));
break;
case EVENT_DIALOGUE_GOTHIK_ZELIEK2:
if (Creature* zeliek = instance->GetCreature(SirGUID))
zeliek->AI()->Talk(SAY_DIALOGUE_GOTHIK_HORSEMAN2);
- events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_KORTHAZZ2, 6000);
+ events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_KORTHAZZ2, Seconds(6));
break;
case EVENT_DIALOGUE_GOTHIK_KORTHAZZ2:
if (Creature* korthazz = instance->GetCreature(ThaneGUID))
korthazz->AI()->Talk(SAY_DIALOGUE_GOTHIK_HORSEMAN2);
- events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_RIVENDARE2, 6000);
+ events.ScheduleEvent(EVENT_DIALOGUE_GOTHIK_RIVENDARE2, Seconds(6));
break;
case EVENT_DIALOGUE_GOTHIK_RIVENDARE2:
if (Creature* rivendare = instance->GetCreature(BaronGUID))
@@ -536,66 +480,53 @@ class instance_naxxramas : public InstanceMapScript
kelthuzad->AI()->Talk(CurrentWingTaunt);
++CurrentWingTaunt;
break;
+ case EVENT_SUMMON_FROGGER_WAVE:
+ {
+ std::list<TempSummon*> spawns;
+ instance->SummonCreatureGroup(nextFroggerWave, &spawns);
+ if (!spawns.empty())
+ (*spawns.begin())->GetMotionMaster()->MovePath(10 * NPC_FROGGER + nextFroggerWave, false);
+ events.Repeat(Seconds(1) + Milliseconds(666));
+ nextFroggerWave = (nextFroggerWave+1) % 3;
+ break;
+ }
case EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD:
if (Creature* kelthuzad = instance->GetCreature(KelthuzadGUID))
kelthuzad->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_KELTHUZAD);
HandleGameObject(KelthuzadDoorGUID, false);
- events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_LICHKING, 6000);
+ events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_LICHKING, Seconds(6));
break;
case EVENT_DIALOGUE_SAPPHIRON_LICHKING:
if (Creature* lichKing = instance->GetCreature(LichKingGUID))
lichKing->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_LICH_KING);
- events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD2, 16000);
+ events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD2, Seconds(16));
break;
case EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD2:
if (Creature* kelthuzad = instance->GetCreature(KelthuzadGUID))
kelthuzad->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_KELTHUZAD2);
- events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_LICHKING2, 9000);
+ events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_LICHKING2, Seconds(9));
break;
case EVENT_DIALOGUE_SAPPHIRON_LICHKING2:
if (Creature* lichKing = instance->GetCreature(LichKingGUID))
lichKing->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_LICH_KING2);
- events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD3, 12000);
+ events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD3, Seconds(12));
break;
case EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD3:
if (Creature* kelthuzad = instance->GetCreature(KelthuzadGUID))
kelthuzad->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_KELTHUZAD3);
- events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD4, 6000);
+ events.ScheduleEvent(EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD4, Seconds(6));
break;
case EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD4:
if (Creature* kelthuzad = instance->GetCreature(KelthuzadGUID))
kelthuzad->AI()->Talk(SAY_DIALOGUE_SAPPHIRON_KELTHUZAD4);
HandleGameObject(KelthuzadDoorGUID, true);
break;
- case EVENT_THADDIUS_RESET:
- if (GetBossState(BOSS_THADDIUS) != DONE)
- if (Creature* thaddius = instance->GetCreature(ThaddiusGUID))
- thaddius->AI()->DoAction(-1);
- break;
default:
break;
}
}
}
- void HeiganErupt(uint32 section)
- {
- for (uint32 i = 0; i < 4; ++i)
- {
- if (i == section)
- continue;
-
- for (ObjectGuid guid : HeiganEruptionGUID[i])
- {
- if (GameObject* heiganEruption = instance->GetGameObject(guid))
- {
- heiganEruption->SendCustomAnim(heiganEruption->GetGoAnimProgress());
- heiganEruption->CastSpell(NULL, SPELL_ERUPTION);
- }
- }
- }
- }
-
// This Function is called in CheckAchievementCriteriaMeet and CheckAchievementCriteriaMeet is called before SetBossState(bossId, DONE),
// so to check if all bosses are done the checker must exclude 1 boss, the last done, if there is at most 1 encouter in progress when is
// called this function then all bosses are done. The one boss that check is the boss that calls this function, so it is dead.
@@ -653,7 +584,6 @@ class instance_naxxramas : public InstanceMapScript
/* The Plague Quarter */
// Heigan the Unclean
- GuidSet HeiganEruptionGUID[4];
ObjectGuid HeiganGUID;
/* The Military Quarter */
@@ -670,6 +600,8 @@ class instance_naxxramas : public InstanceMapScript
ObjectGuid HorsemenChestGUID;
/* The Construct Quarter */
+ // Gluth
+ ObjectGuid GluthGUID;
// Thaddius
ObjectGuid ThaddiusGUID;
ObjectGuid FeugenGUID;
@@ -688,11 +620,14 @@ class instance_naxxramas : public InstanceMapScript
bool hadAnubRekhanGreet;
bool hadFaerlinaGreet;
bool hadThaddiusGreet;
+ bool hadSapphironBirth;
uint8 CurrentWingTaunt;
/* The Immortal / The Undying */
uint32 playerDied;
+ int8 nextFroggerWave;
+
EventMap events;
};
diff --git a/src/server/scripts/Northrend/Naxxramas/naxxramas.h b/src/server/scripts/Northrend/Naxxramas/naxxramas.h
index c0caa86e93f..75e7314c5d0 100644
--- a/src/server/scripts/Northrend/Naxxramas/naxxramas.h
+++ b/src/server/scripts/Northrend/Naxxramas/naxxramas.h
@@ -43,12 +43,11 @@ enum Encounter
enum Data
{
- DATA_HEIGAN_ERUPT,
DATA_GOTHIK_GATE,
- DATA_SAPPHIRON_BIRTH,
DATA_HAD_ANUBREKHAN_GREET,
DATA_HAD_FAERLINA_GREET,
DATA_HAD_THADDIUS_GREET,
+ DATA_HAD_SAPPHIRON_BIRTH,
DATA_HORSEMEN_CHECK_ACHIEVEMENT_CREDIT,
DATA_ABOMINATION_KILLED,
@@ -69,10 +68,12 @@ enum Data64
DATA_LADY,
DATA_BARON,
DATA_SIR,
+ DATA_GLUTH,
DATA_THADDIUS,
DATA_HEIGAN,
DATA_FEUGEN,
DATA_STALAGG,
+ DATA_SAPPHIRON,
DATA_KELTHUZAD,
DATA_KELTHUZAD_PORTAL01,
DATA_KELTHUZAD_PORTAL02,
@@ -92,6 +93,7 @@ enum CreaturesIds
NPC_LADY = 16065,
NPC_BARON = 30549,
NPC_SIR = 16063,
+ NPC_GLUTH = 15932,
NPC_HEIGAN = 15936,
NPC_THADDIUS = 15928,
NPC_FEUGEN = 15930,
@@ -105,7 +107,8 @@ enum CreaturesIds
NPC_DK_UNDERSTUDY = 16803,
NPC_BIGGLESWORTH = 16998,
NPC_LICH_KING = 16980,
- NPC_OLD_WORLD_TRIGGER = 15384
+ NPC_OLD_WORLD_TRIGGER = 15384,
+ NPC_FROGGER = 16027
};
enum GameObjectsIds
@@ -158,12 +161,6 @@ enum GameObjectsIds
GO_NAXX_PORTAL_MILITARY = 181578
};
-enum SpellIds
-{
- SPELL_ERUPTION = 29371,
- SPELL_SLIME = 28801
-};
-
enum InstanceEvents
{
// Dialogue that happens after Gothik's death.
@@ -176,13 +173,12 @@ enum InstanceEvents
EVENT_DIALOGUE_GOTHIK_KORTHAZZ2,
EVENT_DIALOGUE_GOTHIK_RIVENDARE2,
- // Thaddius AI requesting timed encounter (re-)spawn
- EVENT_THADDIUS_BEGIN_RESET,
- EVENT_THADDIUS_RESET,
-
// Dialogue that happens after each wing.
EVENT_KELTHUZAD_WING_TAUNT,
+ // Periodic Frogger summon
+ EVENT_SUMMON_FROGGER_WAVE,
+
// Dialogue that happens after Sapphiron's death.
EVENT_DIALOGUE_SAPPHIRON_KELTHUZAD,
EVENT_DIALOGUE_SAPPHIRON_LICHKING,
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
index 277ca793a8f..914a1a8bbb0 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
@@ -376,8 +376,10 @@ public:
me->SetDisableGravity(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
// TO DO: find what in core is making boss slower than in retail (when correct speed data) or find missing movement flag update or forced spline change
- me->SetSpeed(MOVE_FLIGHT, _flySpeed * 0.25f);
+ me->SetSpeedRate(MOVE_FLIGHT, _flySpeed * 0.25f);
if (_despawned)
DoAction(ACTION_HANDLE_RESPAWN);
@@ -464,7 +466,7 @@ public:
pos.m_positionZ = alexstraszaBunny->GetPositionZ();
alexstraszaBunny->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 30.0f, alexstraszaBunny->GetAngle(me));
me->GetMotionMaster()->MoveLand(POINT_LAND_P_ONE, pos);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
events.ScheduleEvent(EVENT_LAND_START_ENCOUNTER, 7*IN_MILLISECONDS, 1, PHASE_NOT_STARTED);
@@ -603,9 +605,7 @@ public:
me->SetRespawnDelay(respawnDelay);
// Set speed to normal value
- me->SetSpeed(MOVE_FLIGHT, _flySpeed);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetSpeedRate(MOVE_FLIGHT, _flySpeed);
me->RemoveAllAuras();
me->CombatStop(); // Sometimes threat can remain, so it's a safety measure
@@ -1001,14 +1001,7 @@ public:
_JustDied();
Talk(SAY_DEATH);
if (Creature* alexstraszaGiftBoxBunny = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_GIFT_BOX_BUNNY_GUID)))
- {
- if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)
- alexstraszaGiftBoxBunny->SummonGameObject(GO_HEART_OF_MAGIC_10, HeartOfMagicSpawnPos.GetPositionX(), HeartOfMagicSpawnPos.GetPositionY(),
- HeartOfMagicSpawnPos.GetPositionZ(), HeartOfMagicSpawnPos.GetOrientation(), 0.0f, 0.0f, 0.0f, 1.0f, 0);
- else if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)
- alexstraszaGiftBoxBunny->SummonGameObject(GO_HEART_OF_MAGIC_25, HeartOfMagicSpawnPos.GetPositionX(), HeartOfMagicSpawnPos.GetPositionY(),
- HeartOfMagicSpawnPos.GetPositionZ(), HeartOfMagicSpawnPos.GetOrientation(), 0.0f, 0.0f, 0.0f, 1.0f, 0);
- }
+ alexstraszaGiftBoxBunny->SummonGameObject(RAID_MODE(GO_HEART_OF_MAGIC_10, GO_HEART_OF_MAGIC_25), HeartOfMagicSpawnPos, G3D::Quat(), 0);
me->SummonCreature(NPC_ALEXSTRASZA, AlexstraszaSpawnPos, TEMPSUMMON_MANUAL_DESPAWN);
me->DespawnOrUnsummon(5*IN_MILLISECONDS);
@@ -1165,7 +1158,7 @@ public:
_instance = creature->GetInstanceScript();
me->SetReactState(REACT_PASSIVE);
// TO DO: These were a bit faster than what they should be. Not sure what is the reason.
- me->SetSpeed(MOVE_FLIGHT, 1.25f);
+ me->SetSpeedRate(MOVE_FLIGHT, 1.25f);
}
void Initialize()
@@ -1224,13 +1217,15 @@ public:
void DoAction(int32 /*action*/) override
{
if (Vehicle* vehicleTemp = me->GetVehicleKit())
+ {
if (vehicleTemp->GetPassenger(0) && vehicleTemp->GetPassenger(0)->GetTypeId() == TYPEID_PLAYER)
{
vehicleTemp->RemoveAllPassengers();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
+ }
- me->DespawnOrUnsummon(3*IN_MILLISECONDS);
+ me->DespawnOrUnsummon(3*IN_MILLISECONDS);
}
void MovementInform(uint32 type, uint32 id) override
@@ -1274,7 +1269,7 @@ public:
me->SetReactState(REACT_PASSIVE);
// TO DO: Something is wrong with calculations for flying creatures that are on WP/Cyclic path.
// They should get the same difference as to when at ground from run creature switch to walk.
- me->SetSpeed(MOVE_FLIGHT, 0.45f);
+ me->SetSpeedRate(MOVE_FLIGHT, 0.45f);
}
void Reset() override
@@ -1566,7 +1561,7 @@ public:
{
me->DespawnOrUnsummon(2050);
me->SetOrientation(2.5f);
- me->SetSpeed(MOVE_FLIGHT, 1.0f, true);
+ me->SetSpeedRate(MOVE_FLIGHT, 1.0f);
Position pos = me->GetPosition();
pos.m_positionX += 10.0f;
pos.m_positionY += 10.0f;
@@ -2437,9 +2432,9 @@ class spell_alexstrasza_gift_beam_visual : public SpellScriptLoader
if (Creature* target = GetTarget()->ToCreature())
{
if (target->GetMap()->GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)
- _alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_10, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0);
+ _alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_10, *target, G3D::Quat(), 0);
else if (target->GetMap()->GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)
- _alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_25, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0);
+ _alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_25, *target, G3D::Quat(), 0);
}
}
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
index e87115dd8e2..eb8a92f7b28 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
@@ -86,9 +86,7 @@ public:
void SpawnGameObject(uint32 entry, Position const& pos)
{
GameObject* go = new GameObject();
- if (!go->Create(instance->GenerateLowGuid<HighGuid::GameObject>(), entry, instance,
- PHASEMASK_NORMAL, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(),
- 0, 0, 0, 0, 120, GO_STATE_READY))
+ if (!go->Create(instance->GenerateLowGuid<HighGuid::GameObject>(), entry, instance, PHASEMASK_NORMAL, pos, G3D::Quat(), 255, GO_STATE_READY))
{
delete go;
return;
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
index e1a4a6ed7b8..3d9ea97b136 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
@@ -375,7 +375,7 @@ class npc_ruby_emerald_amber_drake : public CreatureScript
{
me->DespawnOrUnsummon(2050);
me->SetOrientation(2.5f);
- me->SetSpeed(MOVE_FLIGHT, 1.0f, true);
+ me->SetSpeedRate(MOVE_FLIGHT, 1.0f);
Talk(SAY_DRAKES_TAKEOFF);
Position pos = me->GetPosition();
Position offset = { 10.0f, 10.0f, 12.0f, 0.0f };
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
index a98da2c6e3d..55295a534e1 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
@@ -113,7 +113,7 @@ public:
Initialize();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_REMOVE_CLIENT_CONTROL);
if (!me->IsVisible())
me->SetVisible(true);
@@ -152,7 +152,7 @@ public:
me->AttackStop();
me->SetVisible(false);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_REMOVE_CLIENT_CONTROL);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
@@ -174,7 +174,7 @@ public:
{
if (pSpark->IsAlive())
{
- pSpark->SetSpeed(MOVE_RUN, 2.0f);
+ pSpark->SetSpeedRate(MOVE_RUN, 2.0f);
pSpark->GetMotionMaster()->Clear();
pSpark->GetMotionMaster()->MovePoint(DATA_POINT_CALLBACK, pos);
}
@@ -236,7 +236,7 @@ public:
else if (lSparkList.empty())
{
me->SetVisible(true);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_DISABLE_MOVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_REMOVE_CLIENT_CONTROL);
DoCast(me, SPELL_SPARK_DESPAWN, false);
@@ -355,7 +355,7 @@ public:
{
Position pos = ionar->GetPosition();
- me->SetSpeed(MOVE_RUN, 2.0f);
+ me->SetSpeedRate(MOVE_RUN, 2.0f);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(DATA_POINT_CALLBACK, pos);
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
index 89868fc7bf2..b2a1bb70077 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
@@ -1164,6 +1164,7 @@ class spell_algalon_trigger_3_adds : public SpellScriptLoader
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_trigger_3_adds_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
+ OnEffectHitTarget += SpellEffectFn(spell_algalon_trigger_3_adds_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
index 6dfc3bf01e7..98827fb3e00 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
@@ -334,7 +334,8 @@ class boss_flame_leviathan : public CreatureScript
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_START_THE_ENGINE)
- ASSERT_NOTNULL(me->GetVehicleKit())->InstallAllAccessories(false);
+ if (Vehicle* vehicleKit = me->GetVehicleKit())
+ vehicleKit->InstallAllAccessories(false);
if (spell->Id == SPELL_ELECTROSHOCK)
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
index 05beacca638..fa59c021cad 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
@@ -171,8 +171,7 @@ enum FreyaNpcs
enum FreyaActions
{
- ACTION_ELDER_DEATH = 1,
- ACTION_ELDER_FREYA_KILLED = 2
+ ACTION_ELDER_FREYA_KILLED = 1
};
enum FreyaEvents
@@ -619,7 +618,7 @@ class boss_freya : public CreatureScript
Elder->AttackStop();
Elder->CombatStop(true);
Elder->DeleteThreatList();
- Elder->GetAI()->DoAction(ACTION_ELDER_FREYA_KILLED);
+ Elder->AI()->DoAction(ACTION_ELDER_FREYA_KILLED);
}
}
}
@@ -705,19 +704,10 @@ class boss_elder_brightleaf : public CreatureScript
Talk(SAY_ELDER_SLAY);
}
- void JustDied(Unit* killer) override
+ void JustDied(Unit* /*killer*/) override
{
_JustDied();
Talk(SAY_ELDER_DEATH);
-
- if (killer->GetTypeId() == TYPEID_PLAYER)
- {
- if (Creature* Ironbranch = ObjectAccessor::GetCreature(*me, instance->GetGuidData(BOSS_IRONBRANCH)))
- Ironbranch->AI()->DoAction(ACTION_ELDER_DEATH);
-
- if (Creature* Stonebark = ObjectAccessor::GetCreature(*me, instance->GetGuidData(BOSS_STONEBARK)))
- Stonebark->AI()->DoAction(ACTION_ELDER_DEATH);
- }
}
void EnterCombat(Unit* /*who*/) override
@@ -812,19 +802,10 @@ class boss_elder_stonebark : public CreatureScript
Talk(SAY_ELDER_SLAY);
}
- void JustDied(Unit* killer) override
+ void JustDied(Unit* /*killer*/) override
{
_JustDied();
Talk(SAY_ELDER_DEATH);
-
- if (killer->GetTypeId() == TYPEID_PLAYER)
- {
- if (Creature* Ironbranch = ObjectAccessor::GetCreature(*me, instance->GetGuidData(BOSS_IRONBRANCH)))
- Ironbranch->AI()->DoAction(ACTION_ELDER_DEATH);
-
- if (Creature* Brightleaf = ObjectAccessor::GetCreature(*me, instance->GetGuidData(BOSS_BRIGHTLEAF)))
- Brightleaf->AI()->DoAction(ACTION_ELDER_DEATH);
- }
}
void EnterCombat(Unit* /*who*/) override
@@ -925,19 +906,10 @@ class boss_elder_ironbranch : public CreatureScript
Talk(SAY_ELDER_SLAY);
}
- void JustDied(Unit* killer) override
+ void JustDied(Unit* /*killer*/) override
{
_JustDied();
Talk(SAY_ELDER_DEATH);
-
- if (killer->GetTypeId() == TYPEID_PLAYER)
- {
- if (Creature* Brightleaf = ObjectAccessor::GetCreature(*me, instance->GetGuidData(BOSS_BRIGHTLEAF)))
- Brightleaf->AI()->DoAction(ACTION_ELDER_DEATH);
-
- if (Creature* Stonebark = ObjectAccessor::GetCreature(*me, instance->GetGuidData(BOSS_STONEBARK)))
- Stonebark->AI()->DoAction(ACTION_ELDER_DEATH);
- }
}
void EnterCombat(Unit* /*who*/) override
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
index 09d95b34521..cbd24141bdf 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
@@ -415,7 +415,7 @@ class npc_saronite_vapors : public CreatureScript
if (damage >= me->GetHealth())
{
damage = 0;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_REMOVE_CLIENT_CONTROL);
me->SetStandState(UNIT_STAND_STATE_DEAD);
me->SetHealth(me->GetMaxHealth());
me->RemoveAllAuras();
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
index c35a5936822..c03a1c6fbc1 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
@@ -30,6 +30,8 @@
Destroying of Toasty Fires
*/
+/* @todo Hodir aggro behavior is wonky. He gets set to _PASSIVE, but never to _AGGRESSIVE unless you kill an ice block which doesn't spawn unless you have*/
+
enum HodirYells
{
SAY_AGGRO = 0,
@@ -184,7 +186,7 @@ class npc_flash_freeze : public CreatureScript
Initialize();
instance = me->GetInstanceScript();
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
}
void Initialize()
@@ -259,7 +261,7 @@ class npc_ice_block : public CreatureScript
{
instance = me->GetInstanceScript();
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
}
InstanceScript* instance;
@@ -269,7 +271,7 @@ class npc_ice_block : public CreatureScript
void IsSummonedBy(Unit* summoner) override
{
targetGUID = summoner->GetGUID();
- summoner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
+ summoner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
me->SetInCombatWith(summoner);
me->AddThreat(summoner, 250.0f);
summoner->AddThreat(me, 250.0f);
@@ -285,7 +287,7 @@ class npc_ice_block : public CreatureScript
{
if (Creature* Helper = ObjectAccessor::GetCreature(*me, targetGUID))
{
- Helper->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
+ Helper->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
if (Creature* Hodir = ObjectAccessor::GetCreature(*me, instance->GetGuidData(BOSS_HODIR)))
{
@@ -375,7 +377,7 @@ class boss_hodir : public CreatureScript
Talk(SAY_SLAY);
}
- void DamageTaken(Unit* /*who*/, uint32& damage) override
+ void DamageTaken(Unit* who, uint32& damage) override
{
if (damage >= me->GetHealth())
{
@@ -388,7 +390,7 @@ class boss_hodir : public CreatureScript
me->RemoveAllAttackers();
me->AttackStop();
me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_REMOVE_CLIENT_CONTROL);
me->InterruptNonMeleeSpells(true);
me->StopMoving();
me->GetMotionMaster()->Clear();
@@ -403,6 +405,12 @@ class boss_hodir : public CreatureScript
_JustDied();
}
+ else if (!me->IsInCombat())
+ {
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->AI()->DoZoneInCombat();
+ me->AI()->AttackStart(who);
+ }
}
void UpdateAI(uint32 diff) override
@@ -539,7 +547,7 @@ class npc_icicle : public CreatureScript
{
Initialize();
me->SetDisplayId(me->GetCreatureTemplate()->Modelid1);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
}
@@ -593,7 +601,7 @@ class npc_snowpacked_icicle : public CreatureScript
{
Initialize();
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
me->SetReactState(REACT_PASSIVE);
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
index cd214a0114f..a50643c5deb 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
@@ -178,7 +178,7 @@ class boss_ignis : public CreatureScript
{
summon->setFaction(16);
summon->SetReactState(REACT_AGGRESSIVE);
- summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | UNIT_FLAG_DISABLE_MOVE);
+ summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_IMMUNE_TO_PC);
}
summon->AI()->AttackStart(me->GetVictim());
@@ -375,7 +375,7 @@ class npc_scorch_ground : public CreatureScript
npc_scorch_groundAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE |UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL |UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
creature->SetDisplayId(16925); //model 2 in db cannot overwrite wdb fields
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
index 470ad388fff..45d4fa58a03 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
@@ -104,7 +104,7 @@ class boss_kologarn : public CreatureScript
left(false), right(false)
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
DoCast(SPELL_KOLOGARN_REDUCE_PARRY);
SetCombatMovement(false);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
index e694433c614..a965f8b39ff 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
@@ -359,9 +359,9 @@ static bool IsEncounterFinished(Unit* who)
if (!mkii || !vx001 || !aerial)
return false;
- if (mkii->getStandState() == UNIT_STAND_STATE_DEAD &&
- vx001->getStandState() == UNIT_STAND_STATE_DEAD &&
- aerial->getStandState() == UNIT_STAND_STATE_DEAD)
+ if (mkii->GetStandState() == UNIT_STAND_STATE_DEAD &&
+ vx001->GetStandState() == UNIT_STAND_STATE_DEAD &&
+ aerial->GetStandState() == UNIT_STAND_STATE_DEAD)
{
who->Kill(mkii);
who->Kill(vx001);
@@ -644,10 +644,10 @@ class boss_mimiron : public CreatureScript
{
if (Creature* computer = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_COMPUTER)))
computer->AI()->DoAction(DO_DEACTIVATE_COMPUTER);
- me->SummonGameObject(RAID_MODE(GO_CACHE_OF_INNOVATION_FIREFIGHTER, GO_CACHE_OF_INNOVATION_FIREFIGHTER_HERO), 2744.040f, 2569.352f, 364.3135f, 3.124123f, 0.f, 0.f, 0.9999619f, 0.008734641f, 604800);
+ me->SummonGameObject(RAID_MODE(GO_CACHE_OF_INNOVATION_FIREFIGHTER, GO_CACHE_OF_INNOVATION_FIREFIGHTER_HERO), 2744.040f, 2569.352f, 364.3135f, 3.124123f, G3D::Quat(0.f, 0.f, 0.9999619f, 0.008734641f), 604800);
}
else
- me->SummonGameObject(RAID_MODE(GO_CACHE_OF_INNOVATION, GO_CACHE_OF_INNOVATION_HERO), 2744.040f, 2569.352f, 364.3135f, 3.124123f, 0.f, 0.f, 0.9999619f, 0.008734641f, 604800);
+ me->SummonGameObject(RAID_MODE(GO_CACHE_OF_INNOVATION, GO_CACHE_OF_INNOVATION_HERO), 2744.040f, 2569.352f, 364.3135f, 3.124123f, G3D::Quat(0.f, 0.f, 0.9999619f, 0.008734641f), 604800);
events.ScheduleEvent(EVENT_OUTTRO_3, 11000);
break;
case EVENT_OUTTRO_3:
@@ -703,7 +703,7 @@ class boss_leviathan_mk_ii : public CreatureScript
if (Unit* turret = me->GetVehicleKit()->GetPassenger(3))
turret->KillSelf();
- me->SetSpeed(MOVE_RUN, 1.5f, true);
+ me->SetSpeedRate(MOVE_RUN, 1.5f);
me->GetMotionMaster()->MovePoint(WP_MKII_P1_IDLE, VehicleRelocation[WP_MKII_P1_IDLE]);
}
else if (events.IsInPhase(PHASE_VOL7RON))
@@ -972,7 +972,7 @@ class boss_vx_001 : public CreatureScript
events.ScheduleEvent(EVENT_FLAME_SUPPRESSANT_VX, 6000);
// Missing break intended.
case DO_START_VX001:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); // Remove emotestate.
//me->SetUInt32Value(UNIT_FIELD_BYTES_1, 33554432); Blizzard handles hover animation like this it seems.
@@ -1145,7 +1145,7 @@ class boss_aerial_command_unit : public CreatureScript
events.ScheduleEvent(EVENT_SUMMON_FIRE_BOTS, 1000, 0, PHASE_AERIAL_COMMAND_UNIT);
// Missing break intended.
case DO_START_AERIAL:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
events.SetPhase(PHASE_AERIAL_COMMAND_UNIT);
@@ -2759,7 +2759,7 @@ class achievement_setup_boom : public AchievementCriteriaScript
public:
achievement_setup_boom() : AchievementCriteriaScript("achievement_setup_boom") { }
- bool OnCheck(Player* /*source*/, Unit* target)
+ bool OnCheck(Player* /*source*/, Unit* target) override
{
return target && target->GetAI()->GetData(DATA_SETUP_BOMB);
}
@@ -2770,7 +2770,7 @@ class achievement_setup_mine : public AchievementCriteriaScript
public:
achievement_setup_mine() : AchievementCriteriaScript("achievement_setup_mine") { }
- bool OnCheck(Player* /*source*/, Unit* target)
+ bool OnCheck(Player* /*source*/, Unit* target) override
{
return target && target->GetAI()->GetData(DATA_SETUP_MINE);
}
@@ -2781,7 +2781,7 @@ class achievement_setup_rocket : public AchievementCriteriaScript
public:
achievement_setup_rocket() : AchievementCriteriaScript("achievement_setup_rocket") { }
- bool OnCheck(Player* /*source*/, Unit* target)
+ bool OnCheck(Player* /*source*/, Unit* target) override
{
return target && target->GetAI()->GetData(DATA_SETUP_ROCKET);
}
@@ -2792,7 +2792,7 @@ class achievement_firefighter : public AchievementCriteriaScript
public:
achievement_firefighter() : AchievementCriteriaScript("achievement_firefighter") { }
- bool OnCheck(Player* /*source*/, Unit* target)
+ bool OnCheck(Player* /*source*/, Unit* target) override
{
return target && target->GetAI()->GetData(DATA_FIREFIGHTER);
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
index f5337b2dca5..a0ea2bd3d57 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
@@ -242,7 +242,7 @@ class boss_razorscale_controller : public CreatureScript
break;
case ACTION_PLACE_BROKEN_HARPOON:
for (uint8 n = 0; n < RAID_MODE(2, 4); n++)
- me->SummonGameObject(GO_RAZOR_BROKEN_HARPOON, PosHarpoon[n].GetPositionX(), PosHarpoon[n].GetPositionY(), PosHarpoon[n].GetPositionZ(), 2.286f, 0, 0, 0, 0, 180);
+ me->SummonGameObject(GO_RAZOR_BROKEN_HARPOON, PosHarpoon[n].GetPositionX(), PosHarpoon[n].GetPositionY(), PosHarpoon[n].GetPositionZ(), 2.286f, G3D::Quat(), 180);
break;
}
}
@@ -257,7 +257,7 @@ class boss_razorscale_controller : public CreatureScript
{
case EVENT_BUILD_HARPOON_1:
Talk(EMOTE_HARPOON);
- if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_1, PosHarpoon[0].GetPositionX(), PosHarpoon[0].GetPositionY(), PosHarpoon[0].GetPositionZ(), 4.790f, 0.0f, 0.0f, 0.0f, 0.0f, uint32(me->GetRespawnTime())))
+ if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_1, PosHarpoon[0].GetPositionX(), PosHarpoon[0].GetPositionY(), PosHarpoon[0].GetPositionZ(), 4.790f, G3D::Quat(), uint32(me->GetRespawnTime())))
{
if (GameObject* BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f)) //only nearest broken harpoon
BrokenHarpoon->RemoveFromWorld();
@@ -267,7 +267,7 @@ class boss_razorscale_controller : public CreatureScript
return;
case EVENT_BUILD_HARPOON_2:
Talk(EMOTE_HARPOON);
- if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_2, PosHarpoon[1].GetPositionX(), PosHarpoon[1].GetPositionY(), PosHarpoon[1].GetPositionZ(), 4.659f, 0, 0, 0, 0, uint32(me->GetRespawnTime())))
+ if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_2, PosHarpoon[1].GetPositionX(), PosHarpoon[1].GetPositionY(), PosHarpoon[1].GetPositionZ(), 4.659f, G3D::Quat(), uint32(me->GetRespawnTime())))
{
if (GameObject* BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
BrokenHarpoon->RemoveFromWorld();
@@ -276,7 +276,7 @@ class boss_razorscale_controller : public CreatureScript
return;
case EVENT_BUILD_HARPOON_3:
Talk(EMOTE_HARPOON);
- if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_3, PosHarpoon[2].GetPositionX(), PosHarpoon[2].GetPositionY(), PosHarpoon[2].GetPositionZ(), 5.382f, 0, 0, 0, 0, uint32(me->GetRespawnTime())))
+ if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_3, PosHarpoon[2].GetPositionX(), PosHarpoon[2].GetPositionY(), PosHarpoon[2].GetPositionZ(), 5.382f, G3D::Quat(), uint32(me->GetRespawnTime())))
{
if (GameObject* BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
BrokenHarpoon->RemoveFromWorld();
@@ -286,7 +286,7 @@ class boss_razorscale_controller : public CreatureScript
return;
case EVENT_BUILD_HARPOON_4:
Talk(EMOTE_HARPOON);
- if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_4, PosHarpoon[3].GetPositionX(), PosHarpoon[3].GetPositionY(), PosHarpoon[3].GetPositionZ(), 4.266f, 0, 0, 0, 0, uint32(me->GetRespawnTime())))
+ if (GameObject* Harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_4, PosHarpoon[3].GetPositionX(), PosHarpoon[3].GetPositionY(), PosHarpoon[3].GetPositionZ(), 4.266f, G3D::Quat(), uint32(me->GetRespawnTime())))
{
if (GameObject* BrokenHarpoon = Harpoon->FindNearestGameObject(GO_RAZOR_BROKEN_HARPOON, 5.0f))
BrokenHarpoon->RemoveFromWorld();
@@ -366,7 +366,7 @@ class boss_razorscale : public CreatureScript
_EnterCombat();
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_RAZORSCALE_CONTROL)))
controller->AI()->DoAction(ACTION_HARPOON_BUILD);
- me->SetSpeed(MOVE_FLIGHT, 3.0f, true);
+ me->SetSpeedRate(MOVE_FLIGHT, 3.0f);
me->SetReactState(REACT_PASSIVE);
phase = PHASE_GROUND;
events.SetPhase(PHASE_GROUND);
@@ -550,7 +550,7 @@ class boss_razorscale : public CreatureScript
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
me->SetReactState(REACT_AGGRESSIVE);
me->RemoveAurasDueToSpell(SPELL_HARPOON_TRIGGER);
- me->SetSpeed(MOVE_FLIGHT, 1.0f, true);
+ me->SetSpeedRate(MOVE_FLIGHT, 1.0f);
PermaGround = true;
DoCastAOE(SPELL_FLAMEBREATH);
events.ScheduleEvent(EVENT_FLAME, 15000, 0, PHASE_PERMAGROUND);
@@ -677,7 +677,7 @@ class npc_expedition_commander : public CreatureScript
if (Creature* summonedEngineer = me->SummonCreature(NPC_ENGINEER, PosEngSpawn, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000))
{
summonedEngineer->SetWalk(false);
- summonedEngineer->SetSpeed(MOVE_RUN, 0.5f);
+ summonedEngineer->SetSpeedRate(MOVE_RUN, 0.5f);
summonedEngineer->SetHomePosition(PosEngRepair[n]);
summonedEngineer->GetMotionMaster()->MoveTargetedHome();
Engineer[n] = summonedEngineer->GetGUID();
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
index 8cb20eadc9f..f3aeec85af2 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
@@ -637,7 +637,7 @@ class BoomEvent : public BasicEvent
{
}
- bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
// This hack is here because we suspect our implementation of spell effect execution on targets
// is done in the wrong order. We suspect that EFFECT_0 needs to be applied on all targets,
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
index 7da67171b5c..675268b4e93 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
@@ -230,6 +230,9 @@ enum Spells
// Descend Into Madness
SPELL_TELEPORT_PORTAL_VISUAL = 64416,
+ SPELL_TELEPORT_TO_STORMWIND_ILLUSION = 63989,
+ SPELL_TELEPORT_TO_CHAMBER_ILLUSION = 63997,
+ SPELL_TELEPORT_TO_ICECROWN_ILLUSION = 63998,
// Illusions
SPELL_GRIM_REPRISAL = 63305,
@@ -395,6 +398,14 @@ enum MiscData
{
ACHIEV_TIMED_START_EVENT = 21001,
SOUND_LUNATIC_GAZE = 15757,
+ MAX_ILLUSION_ROOMS = 3
+};
+
+uint32 const IllusionSpells[MAX_ILLUSION_ROOMS]
+{
+ SPELL_TELEPORT_TO_CHAMBER_ILLUSION,
+ SPELL_TELEPORT_TO_ICECROWN_ILLUSION,
+ SPELL_TELEPORT_TO_STORMWIND_ILLUSION
};
class StartAttackEvent : public BasicEvent
@@ -405,7 +416,7 @@ class StartAttackEvent : public BasicEvent
{
}
- bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_owner->SetReactState(REACT_AGGRESSIVE);
if (Creature* _summoner = ObjectAccessor::GetCreature(*_owner, _summonerGuid))
@@ -1419,7 +1430,11 @@ class npc_descend_into_madness : public CreatureScript
{
if (!result)
return;
+
clicker->RemoveAurasDueToSpell(SPELL_BRAIN_LINK);
+ uint32 illusion = _instance->GetData(DATA_ILLUSION);
+ if (illusion < MAX_ILLUSION_ROOMS)
+ DoCast(clicker, IllusionSpells[illusion], true);
me->DespawnOrUnsummon();
}
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
index 1af45f3031a..3dec0c60991 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
@@ -102,7 +102,7 @@ public:
Sequence[i] = Phase(i);
/// This ensures a random order and only executes each phase once.
- std::random_shuffle(Sequence, Sequence + PHASE_GORTOK_PALEHOOF);
+ Trinity::Containers::RandomShuffle(Sequence);
uiArcingSmashTimer = 15000;
uiImpaleTimer = 12000;
@@ -118,7 +118,7 @@ public:
uint32 uiWhiteringRoarTimer;
Phase currentPhase;
uint8 AddCount;
- Phase Sequence[4];
+ std::array<Phase, 4> Sequence;
void Reset() override
{
@@ -746,7 +746,7 @@ public:
//! HACK: Creature's can't have MOVEMENTFLAG_FLYING
me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
me->RemoveAurasDueToSpell(SPELL_ORB_VISUAL);
- me->SetSpeed(MOVE_FLIGHT, 0.5f);
+ me->SetSpeedRate(MOVE_FLIGHT, 0.5f);
}
void UpdateAI(uint32 diff) override
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
index d7b65093898..7615217a794 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
@@ -209,7 +209,7 @@ public:
Initialize();
Summons.DespawnAll();
- me->SetSpeed(MOVE_FLIGHT, 3.0f);
+ me->SetSpeedRate(MOVE_FLIGHT, 3.0f);
if ((ObjectAccessor::GetCreature(*me, m_uiGraufGUID) == NULL) && !me->IsMounted())
me->SummonCreature(NPC_GRAUF, Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 3.0f);
instance->SetBossState(DATA_SKADI_THE_RUTHLESS, NOT_STARTED);
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp
index 8f2d5a61770..28ca7f4ef3b 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp
@@ -19,9 +19,9 @@
#include "InstanceScript.h"
#include "utgarde_pinnacle.h"
-BossBoundaryData const boundaries =
+BossBoundaryData const boundaries =
{
- { DATA_KING_YMIRON, new RectangleBoundary(340.0f, 450.0f, -412.0f, -275.0f) }
+ { DATA_KING_YMIRON, new RectangleBoundary(340.0f, 443.0f, -412.0f, -275.0f) }
};
DoorData const doorData[] =
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp
index b89c11147b6..df3fa266191 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp
@@ -115,6 +115,7 @@ class boss_archavon : public CreatureScript
DoCastVictim(SPELL_STOMP);
events.ScheduleEvent(EVENT_IMPALE, 3000);
events.ScheduleEvent(EVENT_STOMP, 45000);
+ Talk(EMOTE_LEAP, me->GetVictim());
break;
case EVENT_IMPALE:
DoCastVictim(SPELL_IMPALE);
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
index 06ebcbdc2fb..e7305e53808 100644
--- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
+++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp
@@ -247,7 +247,7 @@ class npc_frozen_orb_stalker : public CreatureScript
npc_frozen_orb_stalkerAI(Creature* creature) : ScriptedAI(creature)
{
creature->SetVisible(false);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
+ creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_REMOVE_CLIENT_CONTROL);
creature->SetReactState(REACT_PASSIVE);
instance = creature->GetInstanceScript();
diff --git a/src/server/scripts/Northrend/northrend_script_loader.cpp b/src/server/scripts/Northrend/northrend_script_loader.cpp
new file mode 100644
index 00000000000..d84bb1c4072
--- /dev/null
+++ b/src/server/scripts/Northrend/northrend_script_loader.cpp
@@ -0,0 +1,376 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+void AddSC_boss_slad_ran();
+void AddSC_boss_moorabi();
+void AddSC_boss_drakkari_colossus();
+void AddSC_boss_gal_darah();
+void AddSC_boss_eck();
+void AddSC_instance_gundrak();
+
+// Azjol-Nerub - Azjol-Nerub
+void AddSC_boss_krik_thir();
+void AddSC_boss_hadronox();
+void AddSC_boss_anub_arak();
+void AddSC_instance_azjol_nerub();
+
+// Azjol-Nerub - Ahn'kahet
+void AddSC_boss_elder_nadox();
+void AddSC_boss_taldaram();
+void AddSC_boss_amanitar();
+void AddSC_boss_jedoga_shadowseeker();
+void AddSC_boss_volazj();
+void AddSC_instance_ahnkahet();
+
+// Drak'Tharon Keep
+void AddSC_boss_trollgore();
+void AddSC_boss_novos();
+void AddSC_boss_king_dred();
+void AddSC_boss_tharon_ja();
+void AddSC_instance_drak_tharon_keep();
+
+void AddSC_boss_argent_challenge(); //Trial of the Champion
+void AddSC_boss_black_knight();
+void AddSC_boss_grand_champions();
+void AddSC_instance_trial_of_the_champion();
+void AddSC_trial_of_the_champion();
+void AddSC_boss_anubarak_trial(); //Trial of the Crusader
+void AddSC_boss_faction_champions();
+void AddSC_boss_jaraxxus();
+void AddSC_boss_northrend_beasts();
+void AddSC_boss_twin_valkyr();
+void AddSC_trial_of_the_crusader();
+void AddSC_instance_trial_of_the_crusader();
+void AddSC_boss_anubrekhan(); //Naxxramas
+void AddSC_boss_maexxna();
+void AddSC_boss_patchwerk();
+void AddSC_boss_grobbulus();
+void AddSC_boss_razuvious();
+void AddSC_boss_kelthuzad();
+void AddSC_boss_loatheb();
+void AddSC_boss_noth();
+void AddSC_boss_gluth();
+void AddSC_boss_sapphiron();
+void AddSC_boss_four_horsemen();
+void AddSC_boss_faerlina();
+void AddSC_boss_heigan();
+void AddSC_boss_gothik();
+void AddSC_boss_thaddius();
+void AddSC_instance_naxxramas();
+void AddSC_boss_nexus_commanders(); // The Nexus Nexus
+void AddSC_boss_magus_telestra();
+void AddSC_boss_anomalus();
+void AddSC_boss_ormorok();
+void AddSC_boss_keristrasza();
+void AddSC_instance_nexus();
+void AddSC_boss_drakos(); //The Nexus The Oculus
+void AddSC_boss_urom();
+void AddSC_boss_varos();
+void AddSC_boss_eregos();
+void AddSC_instance_oculus();
+void AddSC_oculus();
+void AddSC_boss_malygos(); // The Nexus: Eye of Eternity
+void AddSC_instance_eye_of_eternity();
+void AddSC_boss_sartharion(); //Obsidian Sanctum
+void AddSC_obsidian_sanctum();
+void AddSC_instance_obsidian_sanctum();
+void AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning
+void AddSC_boss_loken();
+void AddSC_boss_ionar();
+void AddSC_boss_volkhan();
+void AddSC_instance_halls_of_lightning();
+void AddSC_boss_maiden_of_grief(); //Ulduar Halls of Stone
+void AddSC_boss_krystallus();
+void AddSC_boss_sjonnir();
+void AddSC_instance_halls_of_stone();
+void AddSC_halls_of_stone();
+void AddSC_boss_auriaya(); //Ulduar Ulduar
+void AddSC_boss_flame_leviathan();
+void AddSC_boss_ignis();
+void AddSC_boss_razorscale();
+void AddSC_boss_xt002();
+void AddSC_boss_kologarn();
+void AddSC_boss_assembly_of_iron();
+void AddSC_boss_general_vezax();
+void AddSC_boss_mimiron();
+void AddSC_boss_hodir();
+void AddSC_boss_freya();
+void AddSC_boss_yogg_saron();
+void AddSC_boss_algalon_the_observer();
+void AddSC_instance_ulduar();
+
+// Utgarde Keep - Utgarde Keep
+void AddSC_boss_keleseth();
+void AddSC_boss_skarvald_dalronn();
+void AddSC_boss_ingvar_the_plunderer();
+void AddSC_instance_utgarde_keep();
+void AddSC_utgarde_keep();
+
+// Utgarde Keep - Utgarde Pinnacle
+void AddSC_boss_svala();
+void AddSC_boss_palehoof();
+void AddSC_boss_skadi();
+void AddSC_boss_ymiron();
+void AddSC_instance_utgarde_pinnacle();
+
+// Vault of Archavon
+void AddSC_boss_archavon();
+void AddSC_boss_emalon();
+void AddSC_boss_koralon();
+void AddSC_boss_toravon();
+void AddSC_instance_vault_of_archavon();
+
+void AddSC_boss_cyanigosa(); //Violet Hold
+void AddSC_boss_erekem();
+void AddSC_boss_ichoron();
+void AddSC_boss_lavanthor();
+void AddSC_boss_moragg();
+void AddSC_boss_xevozz();
+void AddSC_boss_zuramat();
+void AddSC_instance_violet_hold();
+void AddSC_violet_hold();
+void AddSC_instance_forge_of_souls(); //Forge of Souls
+void AddSC_forge_of_souls();
+void AddSC_boss_bronjahm();
+void AddSC_boss_devourer_of_souls();
+void AddSC_instance_pit_of_saron(); //Pit of Saron
+void AddSC_pit_of_saron();
+void AddSC_boss_garfrost();
+void AddSC_boss_ick();
+void AddSC_boss_tyrannus();
+void AddSC_instance_halls_of_reflection(); // Halls of Reflection
+void AddSC_halls_of_reflection();
+void AddSC_boss_falric();
+void AddSC_boss_marwyn();
+void AddSC_boss_lord_marrowgar(); // Icecrown Citadel
+void AddSC_boss_lady_deathwhisper();
+void AddSC_boss_icecrown_gunship_battle();
+void AddSC_boss_deathbringer_saurfang();
+void AddSC_boss_festergut();
+void AddSC_boss_rotface();
+void AddSC_boss_professor_putricide();
+void AddSC_boss_blood_prince_council();
+void AddSC_boss_blood_queen_lana_thel();
+void AddSC_boss_valithria_dreamwalker();
+void AddSC_boss_sindragosa();
+void AddSC_boss_the_lich_king();
+void AddSC_icecrown_citadel_teleport();
+void AddSC_instance_icecrown_citadel();
+void AddSC_icecrown_citadel();
+void AddSC_instance_ruby_sanctum(); // Ruby Sanctum
+void AddSC_ruby_sanctum();
+void AddSC_boss_baltharus_the_warborn();
+void AddSC_boss_saviana_ragefire();
+void AddSC_boss_general_zarithrian();
+void AddSC_boss_halion();
+void AddSC_isle_of_conquest(); // Isle of Conquest
+void AddSC_boss_ioc_horde_alliance();
+
+void AddSC_dalaran();
+void AddSC_borean_tundra();
+void AddSC_dragonblight();
+void AddSC_grizzly_hills();
+void AddSC_howling_fjord();
+void AddSC_icecrown();
+void AddSC_sholazar_basin();
+void AddSC_storm_peaks();
+void AddSC_wintergrasp();
+void AddSC_zuldrak();
+void AddSC_crystalsong_forest();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddNorthrendScripts()
+{
+ AddSC_boss_slad_ran(); //Gundrak
+ AddSC_boss_moorabi();
+ AddSC_boss_drakkari_colossus();
+ AddSC_boss_gal_darah();
+ AddSC_boss_eck();
+ AddSC_instance_gundrak();
+
+ // Azjol-Nerub - Ahn'kahet
+ AddSC_boss_elder_nadox();
+ AddSC_boss_taldaram();
+ AddSC_boss_amanitar();
+ AddSC_boss_jedoga_shadowseeker();
+ AddSC_boss_volazj();
+ AddSC_instance_ahnkahet();
+
+ // Azjol-Nerub - Azjol-Nerub
+ AddSC_boss_krik_thir();
+ AddSC_boss_hadronox();
+ AddSC_boss_anub_arak();
+ AddSC_instance_azjol_nerub();
+
+ // Drak'Tharon Keep
+ AddSC_boss_trollgore();
+ AddSC_boss_novos();
+ AddSC_boss_king_dred();
+ AddSC_boss_tharon_ja();
+ AddSC_instance_drak_tharon_keep();
+
+ AddSC_boss_argent_challenge(); //Trial of the Champion
+ AddSC_boss_black_knight();
+ AddSC_boss_grand_champions();
+ AddSC_instance_trial_of_the_champion();
+ AddSC_trial_of_the_champion();
+ AddSC_boss_anubarak_trial(); //Trial of the Crusader
+ AddSC_boss_faction_champions();
+ AddSC_boss_jaraxxus();
+ AddSC_trial_of_the_crusader();
+ AddSC_boss_twin_valkyr();
+ AddSC_boss_northrend_beasts();
+ AddSC_instance_trial_of_the_crusader();
+ AddSC_boss_anubrekhan(); //Naxxramas
+ AddSC_boss_maexxna();
+ AddSC_boss_patchwerk();
+ AddSC_boss_grobbulus();
+ AddSC_boss_razuvious();
+ AddSC_boss_kelthuzad();
+ AddSC_boss_loatheb();
+ AddSC_boss_noth();
+ AddSC_boss_gluth();
+ AddSC_boss_sapphiron();
+ AddSC_boss_four_horsemen();
+ AddSC_boss_faerlina();
+ AddSC_boss_heigan();
+ AddSC_boss_gothik();
+ AddSC_boss_thaddius();
+ AddSC_instance_naxxramas();
+ AddSC_boss_nexus_commanders(); // The Nexus Nexus
+ AddSC_boss_magus_telestra();
+ AddSC_boss_anomalus();
+ AddSC_boss_ormorok();
+ AddSC_boss_keristrasza();
+ AddSC_instance_nexus();
+ AddSC_boss_drakos(); //The Nexus The Oculus
+ AddSC_boss_urom();
+ AddSC_boss_varos();
+ AddSC_boss_eregos();
+ AddSC_instance_oculus();
+ AddSC_oculus();
+ AddSC_boss_malygos(); // The Nexus: Eye of Eternity
+ AddSC_instance_eye_of_eternity();
+ AddSC_boss_sartharion(); //Obsidian Sanctum
+ AddSC_obsidian_sanctum();
+ AddSC_instance_obsidian_sanctum();
+ AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning
+ AddSC_boss_loken();
+ AddSC_boss_ionar();
+ AddSC_boss_volkhan();
+ AddSC_instance_halls_of_lightning();
+ AddSC_boss_maiden_of_grief(); //Ulduar Halls of Stone
+ AddSC_boss_krystallus();
+ AddSC_boss_sjonnir();
+ AddSC_instance_halls_of_stone();
+ AddSC_halls_of_stone();
+ AddSC_boss_auriaya(); //Ulduar Ulduar
+ AddSC_boss_flame_leviathan();
+ AddSC_boss_ignis();
+ AddSC_boss_razorscale();
+ AddSC_boss_xt002();
+ AddSC_boss_general_vezax();
+ AddSC_boss_assembly_of_iron();
+ AddSC_boss_kologarn();
+ AddSC_boss_mimiron();
+ AddSC_boss_hodir();
+ AddSC_boss_freya();
+ AddSC_boss_yogg_saron();
+ AddSC_boss_algalon_the_observer();
+ AddSC_instance_ulduar();
+
+ // Utgarde Keep - Utgarde Keep
+ AddSC_boss_keleseth();
+ AddSC_boss_skarvald_dalronn();
+ AddSC_boss_ingvar_the_plunderer();
+ AddSC_instance_utgarde_keep();
+ AddSC_utgarde_keep();
+
+ // Utgarde Keep - Utgarde Pinnacle
+ AddSC_boss_svala();
+ AddSC_boss_palehoof();
+ AddSC_boss_skadi();
+ AddSC_boss_ymiron();
+ AddSC_instance_utgarde_pinnacle();
+
+ // Vault of Archavon
+ AddSC_boss_archavon();
+ AddSC_boss_emalon();
+ AddSC_boss_koralon();
+ AddSC_boss_toravon();
+ AddSC_instance_vault_of_archavon();
+
+ AddSC_boss_cyanigosa(); //Violet Hold
+ AddSC_boss_erekem();
+ AddSC_boss_ichoron();
+ AddSC_boss_lavanthor();
+ AddSC_boss_moragg();
+ AddSC_boss_xevozz();
+ AddSC_boss_zuramat();
+ AddSC_instance_violet_hold();
+ AddSC_violet_hold();
+ AddSC_instance_forge_of_souls(); //Forge of Souls
+ AddSC_forge_of_souls();
+ AddSC_boss_bronjahm();
+ AddSC_boss_devourer_of_souls();
+ AddSC_instance_pit_of_saron(); //Pit of Saron
+ AddSC_pit_of_saron();
+ AddSC_boss_garfrost();
+ AddSC_boss_ick();
+ AddSC_boss_tyrannus();
+ AddSC_instance_halls_of_reflection(); // Halls of Reflection
+ AddSC_halls_of_reflection();
+ AddSC_boss_falric();
+ AddSC_boss_marwyn();
+ AddSC_boss_lord_marrowgar(); // Icecrown Citadel
+ AddSC_boss_lady_deathwhisper();
+ AddSC_boss_icecrown_gunship_battle();
+ AddSC_boss_deathbringer_saurfang();
+ AddSC_boss_festergut();
+ AddSC_boss_rotface();
+ AddSC_boss_professor_putricide();
+ AddSC_boss_blood_prince_council();
+ AddSC_boss_blood_queen_lana_thel();
+ AddSC_boss_valithria_dreamwalker();
+ AddSC_boss_sindragosa();
+ AddSC_boss_the_lich_king();
+ AddSC_icecrown_citadel_teleport();
+ AddSC_instance_icecrown_citadel();
+ AddSC_icecrown_citadel();
+ AddSC_instance_ruby_sanctum(); // Ruby Sanctum
+ AddSC_ruby_sanctum();
+ AddSC_boss_baltharus_the_warborn();
+ AddSC_boss_saviana_ragefire();
+ AddSC_boss_general_zarithrian();
+ AddSC_boss_halion();
+ AddSC_isle_of_conquest(); // Isle of Conquest
+ AddSC_boss_ioc_horde_alliance();
+
+ AddSC_dalaran();
+ AddSC_borean_tundra();
+ AddSC_dragonblight();
+ AddSC_grizzly_hills();
+ AddSC_howling_fjord();
+ AddSC_icecrown();
+ AddSC_sholazar_basin();
+ AddSC_storm_peaks();
+ AddSC_wintergrasp();
+ AddSC_zuldrak();
+ AddSC_crystalsong_forest();
+}
diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp
index 698fd510411..d9315315c58 100644
--- a/src/server/scripts/Northrend/zone_borean_tundra.cpp
+++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp
@@ -2274,7 +2274,8 @@ public:
void DoAction(int32 /*iParam*/) override
{
me->StopMoving();
- me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
if (Player* player = ObjectAccessor::GetPlayer(*me, uiPlayerGUID))
me->SetFacingToObject(player);
uiEventTimer = 3000;
@@ -2303,7 +2304,6 @@ public:
switch (me->GetEntry())
{
case NPC_SALTY_JOHN_THORPE:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Talk(SAY_HIDDEN_CULTIST_1);
uiEventTimer = 5000;
uiEventPhase = 2;
@@ -2314,7 +2314,8 @@ public:
uiEventPhase = 2;
break;
case NPC_TOM_HEGGER:
- Talk(SAY_HIDDEN_CULTIST_3);
+ if (Player* player = ObjectAccessor::GetPlayer(*me, uiPlayerGUID))
+ Talk(SAY_HIDDEN_CULTIST_3, player);
uiEventTimer = 5000;
uiEventPhase = 2;
break;
diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp
index 2ec2af80624..d7ff1e5cb4d 100644
--- a/src/server/scripts/Northrend/zone_dragonblight.cpp
+++ b/src/server/scripts/Northrend/zone_dragonblight.cpp
@@ -360,7 +360,7 @@ class npc_commander_eligor_dawnbringer : public CreatureScript
uint8 talkWing;
};
- CreatureAI* GetAI(Creature* creature) const
+ CreatureAI* GetAI(Creature* creature) const override
{
return new npc_commander_eligor_dawnbringerAI(creature);
}
@@ -695,7 +695,7 @@ class npc_torturer_lecraft : public CreatureScript
ObjectGuid _playerGUID;
};
- CreatureAI* GetAI(Creature* creature) const
+ CreatureAI* GetAI(Creature* creature) const override
{
return new npc_torturer_lecraftAI(creature);
}
diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
index 59802165a94..adade245c2b 100644
--- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
@@ -22,6 +22,7 @@
#include "Player.h"
#include "SpellScript.h"
#include "CreatureTextMgr.h"
+#include "CombatAI.h"
/*######
## Quest 12027: Mr. Floppy's Perilous Adventure
@@ -854,6 +855,260 @@ class spell_infected_worgen_bite : public SpellScriptLoader
}
};
+/*######
+## Quest: Riding the Red Rocket
+######*/
+
+enum RedRocket
+{
+ SPELL_VEHICLE_WARHEAD_FUSE = 49107,
+ SPELL_ALLIANCE_KILL_CREDIT_TORPEDO = 49510,
+ SPELL_HORDE_KILL_CREDIT_TORPEDO = 49340,
+ NPC_HORDE_LUMBERBOAT = 27702,
+ NPC_ALLIANCE_LUMBERBOAT = 27688,
+ SPELL_DETONATE = 49250
+};
+
+class npc_rocket_propelled_warhead : public CreatureScript
+{
+public:
+ npc_rocket_propelled_warhead() : CreatureScript("npc_rocket_propelled_warhead") { }
+
+ struct npc_rocket_propelled_warheadAI : public VehicleAI
+ {
+ npc_rocket_propelled_warheadAI(Creature* creature) : VehicleAI(creature)
+ {
+ _finished = false;
+ _faction = ALLIANCE;
+ }
+
+ void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) override
+ {
+ if (apply && who->ToPlayer())
+ {
+ DoCast(me, SPELL_VEHICLE_WARHEAD_FUSE);
+ _faction = who->ToPlayer()->GetTeam();
+ }
+ }
+
+ void JustReachedHome() override
+ {
+ _finished = false;
+ me->SetVisible(true);
+ me->GetMotionMaster()->Clear(true);
+ }
+
+ void DoAction(int32 /*action*/) override
+ {
+ FinishQuest(false, _faction);
+ }
+
+ void SpellHit(Unit* caster, SpellInfo const* /*spellInfo*/) override
+ {
+ if (caster->GetEntry() == NPC_HORDE_LUMBERBOAT || caster->GetEntry() == NPC_ALLIANCE_LUMBERBOAT)
+ FinishQuest(true, _faction);
+ }
+
+ void FinishQuest(bool success, uint32 faction)
+ {
+ if (_finished)
+ return;
+
+ _finished = true;
+
+ if (success)
+ DoCast(me, faction == ALLIANCE ? SPELL_ALLIANCE_KILL_CREDIT_TORPEDO : SPELL_HORDE_KILL_CREDIT_TORPEDO);
+
+ DoCast(me, SPELL_DETONATE);
+ me->RemoveAllAuras();
+ me->SetVisible(false);
+ me->GetMotionMaster()->MoveTargetedHome();
+ }
+
+ private:
+ uint32 _faction;
+ bool _finished;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new npc_rocket_propelled_warheadAI(creature);
+ }
+};
+
+enum WarheadSpells
+{
+ SPELL_WARHEAD_Z_CHECK = 61678,
+ SPELL_WARHEAD_SEEKING_LUMBERSHIP = 49331,
+ SPELL_WARHEAD_FUSE = 49181
+};
+// 49107 - Vehicle: Warhead Fuse
+class spell_vehicle_warhead_fuse : public SpellScriptLoader
+{
+public:
+ spell_vehicle_warhead_fuse() : SpellScriptLoader("spell_vehicle_warhead_fuse") { }
+
+ class spell_vehicle_warhead_fuse_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_vehicle_warhead_fuse_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_WARHEAD_Z_CHECK) || !sSpellMgr->GetSpellInfo(SPELL_WARHEAD_SEEKING_LUMBERSHIP) || !sSpellMgr->GetSpellInfo(SPELL_WARHEAD_FUSE))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+
+ caster->CastSpell(caster, SPELL_WARHEAD_Z_CHECK, true);
+ caster->CastSpell(caster, SPELL_WARHEAD_SEEKING_LUMBERSHIP, true);
+ caster->CastSpell(caster, SPELL_WARHEAD_FUSE, true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_vehicle_warhead_fuse_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_vehicle_warhead_fuse_SpellScript();
+ }
+};
+
+enum WarheadDenonate
+{
+ SPELL_PARACHUTE = 66154,
+ SPELL_TORPEDO_EXPLOSION = 49290,
+ NPC_ALLIANCE_LUMBERBOAT_EXPLOSIONS = 27689
+};
+// 49250 - Detonate
+class spell_warhead_detonate : public SpellScriptLoader
+{
+public:
+ spell_warhead_detonate() : SpellScriptLoader("spell_warhead_detonate") { }
+
+ class spell_warhead_detonate_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warhead_detonate_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || !sSpellMgr->GetSpellInfo(SPELL_TORPEDO_EXPLOSION))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ Player* player = GetHitPlayer();
+ if (!player)
+ return;
+
+ player->ExitVehicle();
+ float horizontalSpeed = 3.0f;
+ float verticalSpeed = 40.0f;
+ player->KnockbackFrom(caster->GetPositionX(), caster->GetPositionY(), horizontalSpeed, verticalSpeed);
+ caster->CastSpell(player, SPELL_PARACHUTE, true);
+
+ std::list<Creature*> explosionBunnys;
+ caster->GetCreatureListWithEntryInGrid(explosionBunnys, NPC_ALLIANCE_LUMBERBOAT_EXPLOSIONS, 90.0f);
+ for (std::list<Creature*>::const_iterator itr = explosionBunnys.begin(); itr != explosionBunnys.end(); ++itr)
+ (*itr)->CastSpell((*itr), SPELL_TORPEDO_EXPLOSION, true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warhead_detonate_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_warhead_detonate_SpellScript();
+ }
+};
+
+// 61678 - Z Check
+class spell_z_check : public SpellScriptLoader
+{
+public:
+ spell_z_check() : SpellScriptLoader("spell_z_check") { }
+
+ class spell_z_check_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_z_check_AuraScript);
+
+ public:
+ spell_z_check_AuraScript()
+ {
+ _posZ = 0.0f;
+ }
+
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ _posZ = GetTarget()->GetPositionZ();
+ }
+
+ void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ PreventDefaultAction();
+
+ if (_posZ != GetTarget()->GetPositionZ())
+ if (Creature* target = GetTarget()->ToCreature())
+ target->AI()->DoAction(0);
+ }
+
+ private:
+ float _posZ;
+
+ void Register() override
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_z_check_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_z_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_z_check_AuraScript();
+ }
+};
+
+// 49181 - Warhead Fuse
+class spell_warhead_fuse : public SpellScriptLoader
+{
+public:
+ spell_warhead_fuse() : SpellScriptLoader("spell_warhead_fuse") { }
+
+ class spell_warhead_fuse_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warhead_fuse_AuraScript);
+
+ void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* rocketUnit = GetTarget()->GetVehicleBase())
+ if (Creature* rocketCrea = rocketUnit->ToCreature())
+ rocketCrea->AI()->DoAction(0);
+ }
+
+ void Register() override
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_warhead_fuse_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_warhead_fuse_AuraScript();
+ }
+};
+
void AddSC_grizzly_hills()
{
new npc_emily();
@@ -866,4 +1121,9 @@ void AddSC_grizzly_hills()
new npc_lake_frog();
new spell_shredder_delivery();
new spell_infected_worgen_bite();
+ new npc_rocket_propelled_warhead();
+ new spell_z_check();
+ new spell_warhead_detonate();
+ new spell_vehicle_warhead_fuse();
+ new spell_warhead_fuse();
}
diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp
index 1e020edd10a..3d801cc2fbb 100644
--- a/src/server/scripts/Northrend/zone_icecrown.cpp
+++ b/src/server/scripts/Northrend/zone_icecrown.cpp
@@ -712,7 +712,7 @@ enum BorrowedTechnologyAndVolatility
SPELL_PING_BUNNY = 59375,
SPELL_IMMOLATION = 54690,
SPELL_EXPLOSION = 59335,
- SPELL_RIDE = 56687,
+ SPELL_RIDE = 59319,
// Points
POINT_GRAB_DECOY = 1,
diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
index f2edccd99b5..41785f76d9a 100644
--- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp
+++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
@@ -253,7 +253,7 @@ public:
case 1:
Talk(SAY_WP_3);
me->CastSpell(5918.33f, 5372.91f, -98.770f, SPELL_EXPLODE_CRYSTAL, true);
- me->SummonGameObject(184743, 5918.33f, 5372.91f, -98.770f, 0, 0, 0, 0, 0, TEMPSUMMON_MANUAL_DESPAWN); //approx 3 to 4 seconds
+ me->SummonGameObject(184743, 5918.33f, 5372.91f, -98.770f, 0, G3D::Quat(), TEMPSUMMON_MANUAL_DESPAWN); //approx 3 to 4 seconds
me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
break;
case 2:
@@ -264,7 +264,7 @@ public:
break;
case 8:
me->CastSpell(5887.37f, 5379.39f, -91.289f, SPELL_EXPLODE_CRYSTAL, true);
- me->SummonGameObject(184743, 5887.37f, 5379.39f, -91.289f, 0, 0, 0, 0, 0, TEMPSUMMON_MANUAL_DESPAWN); //approx 3 to 4 seconds
+ me->SummonGameObject(184743, 5887.37f, 5379.39f, -91.289f, 0, G3D::Quat(), TEMPSUMMON_MANUAL_DESPAWN); //approx 3 to 4 seconds
me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
break;
case 9:
@@ -780,7 +780,7 @@ public:
bird->KillSelf();
crunchy->GetMotionMaster()->MovePoint(0, bird->GetPositionX(), bird->GetPositionY(),
- bird->GetMap()->GetWaterOrGroundLevel(bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ()));
+ bird->GetMap()->GetWaterOrGroundLevel(bird->GetPhaseMask(), bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ()));
/// @todo Make crunchy perform emote eat when he reaches the bird
break;
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index e5263a8630a..490c72c5cba 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -516,7 +516,7 @@ public:
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
voice->AI()->Talk(SAY_VOICE_1, player);
}
- if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_1, 7860.273f, -1383.622f, 1538.302f, -1.658062f, 0, 0, -0.737277f, 0.6755905f, 0))
+ if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_1, 7860.273f, -1383.622f, 1538.302f, -1.658062f, G3D::Quat(0.f, 0.f, -0.737277f, 0.6755905f), 0))
objectGUID[objectCounter++] = go->GetGUID();
events.ScheduleEvent(EVENT_SCRIPT_5, 6000);
break;
@@ -524,7 +524,7 @@ public:
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
voice->AI()->Talk(SAY_VOICE_2, player);
- if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_2, 7875.67f, -1387.266f, 1538.323f, -2.373644f, 0, 0, -0.9271832f, 0.3746083f, 0))
+ if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_2, 7875.67f, -1387.266f, 1538.323f, -2.373644f, G3D::Quat(0.f, 0.f, -0.9271832f, 0.3746083f), 0))
objectGUID[objectCounter++] = go->GetGUID();
events.ScheduleEvent(EVENT_SCRIPT_6, 6000);
break;
@@ -532,7 +532,7 @@ public:
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
voice->AI()->Talk(SAY_VOICE_3, player);
- if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_3, 7879.212f, -1401.175f, 1538.279f, 2.967041f, 0, 0, 0.9961939f, 0.08716504f, 0))
+ if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_3, 7879.212f, -1401.175f, 1538.279f, 2.967041f, G3D::Quat(0.f, 0.f, 0.9961939f, 0.08716504f), 0))
objectGUID[objectCounter++] = go->GetGUID();
events.ScheduleEvent(EVENT_SCRIPT_7, 6000);
break;
@@ -540,7 +540,7 @@ public:
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
voice->AI()->Talk(SAY_VOICE_4, player);
- if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_4, 7868.944f, -1411.18f, 1538.213f, 2.111848f, 0, 0, 0.8703556f, 0.4924237f, 0))
+ if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_4, 7868.944f, -1411.18f, 1538.213f, 2.111848f, G3D::Quat(0.f, 0.f, 0.8703556f, 0.4924237f), 0))
objectGUID[objectCounter++] = go->GetGUID();
events.ScheduleEvent(EVENT_SCRIPT_8, 6000);
break;
@@ -548,7 +548,7 @@ public:
if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID))
if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID))
voice->AI()->Talk(SAY_VOICE_5, player);
- if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_5, 7855.11f, -1406.839f, 1538.42f, 1.151916f, 0, 0, 0.5446386f, 0.8386708f, 0))
+ if (GameObject* go = me->SummonGameObject(OBJECT_TOL_SIGNAL_5, 7855.11f, -1406.839f, 1538.42f, 1.151916f, G3D::Quat(0.f, 0.f, 0.5446386f, 0.8386708f), 0))
objectGUID[objectCounter] = go->GetGUID();
events.ScheduleEvent(EVENT_SCRIPT_9, 6000);
break;
diff --git a/src/server/scripts/OutdoorPvP/CMakeLists.txt b/src/server/scripts/OutdoorPvP/CMakeLists.txt
deleted file mode 100644
index 91ce4ce4186..00000000000
--- a/src/server/scripts/OutdoorPvP/CMakeLists.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
-#
-# This file is free software; as a special exception the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- OutdoorPvP/OutdoorPvPTF.cpp
- OutdoorPvP/OutdoorPvPSI.cpp
- OutdoorPvP/OutdoorPvPSI.h
- OutdoorPvP/OutdoorPvPZM.cpp
- OutdoorPvP/OutdoorPvPNA.cpp
- OutdoorPvP/OutdoorPvPHP.cpp
- OutdoorPvP/OutdoorPvPTF.h
- OutdoorPvP/OutdoorPvPEP.h
- OutdoorPvP/OutdoorPvPEP.cpp
- OutdoorPvP/OutdoorPvPHP.h
- OutdoorPvP/OutdoorPvPZM.h
- OutdoorPvP/OutdoorPvPNA.h
-)
-
-message(" -> Prepared: Outdoor PVP Zones")
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
index 71dbd139ea0..4fd608ccd1c 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
@@ -96,9 +96,9 @@ class OPvPCapturePointHP : public OPvPCapturePoint
public:
OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType type);
- void ChangeState();
+ void ChangeState() override;
- void FillInitialWorldStates(WorldPacket & data);
+ void FillInitialWorldStates(WorldPacket & data) override;
private:
OutdoorPvPHPTowerType m_TowerType;
@@ -109,18 +109,18 @@ class OutdoorPvPHP : public OutdoorPvP
public:
OutdoorPvPHP();
- bool SetupOutdoorPvP();
+ bool SetupOutdoorPvP() override;
- void HandlePlayerEnterZone(Player* player, uint32 zone);
- void HandlePlayerLeaveZone(Player* player, uint32 zone);
+ void HandlePlayerEnterZone(Player* player, uint32 zone) override;
+ void HandlePlayerLeaveZone(Player* player, uint32 zone) override;
- bool Update(uint32 diff);
+ bool Update(uint32 diff) override;
- void FillInitialWorldStates(WorldPacket &data);
+ void FillInitialWorldStates(WorldPacket &data) override;
- void SendRemoveWorldStates(Player* player);
+ void SendRemoveWorldStates(Player* player) override;
- void HandleKillImpl(Player* player, Unit* killed);
+ void HandleKillImpl(Player* player, Unit* killed) override;
uint32 GetAllianceTowersControlled() const;
void SetAllianceTowersControlled(uint32 count);
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
index 4ed47c42206..80878828d44 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
@@ -311,18 +311,18 @@ class OutdoorPvPNA : public OutdoorPvP
public:
OutdoorPvPNA();
- bool SetupOutdoorPvP();
+ bool SetupOutdoorPvP() override;
- void HandlePlayerEnterZone(Player* player, uint32 zone);
- void HandlePlayerLeaveZone(Player* player, uint32 zone);
+ void HandlePlayerEnterZone(Player* player, uint32 zone) override;
+ void HandlePlayerLeaveZone(Player* player, uint32 zone) override;
- bool Update(uint32 diff);
+ bool Update(uint32 diff) override;
- void FillInitialWorldStates(WorldPacket &data);
+ void FillInitialWorldStates(WorldPacket &data) override;
- void SendRemoveWorldStates(Player* player);
+ void SendRemoveWorldStates(Player* player) override;
- void HandleKillImpl(Player* player, Unit* killed);
+ void HandleKillImpl(Player* player, Unit* killed) override;
private:
OPvPCapturePointNA * m_obj;
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
index a0b9351fb75..05ed405cc6e 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
@@ -163,7 +163,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
GameObject* go = new GameObject;
Map* map = player->GetMap();
- if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
+ if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), *player, G3D::Quat(), 255, GO_STATE_READY))
{
delete go;
return true;
@@ -192,7 +192,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
GameObject* go = new GameObject;
Map* map = player->GetMap();
- if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
+ if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), *player, G3D::Quat(), 255, GO_STATE_READY))
{
delete go;
return true;
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h
index f28fea926fc..fae2ea9738e 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.h
@@ -56,22 +56,22 @@ class OutdoorPvPSI : public OutdoorPvP
public:
OutdoorPvPSI();
- bool SetupOutdoorPvP();
+ bool SetupOutdoorPvP() override;
- void HandlePlayerEnterZone(Player* player, uint32 zone);
- void HandlePlayerLeaveZone(Player* player, uint32 zone);
+ void HandlePlayerEnterZone(Player* player, uint32 zone) override;
+ void HandlePlayerLeaveZone(Player* player, uint32 zone) override;
- bool Update(uint32 diff);
+ bool Update(uint32 diff) override;
- void FillInitialWorldStates(WorldPacket &data);
+ void FillInitialWorldStates(WorldPacket &data) override;
- void SendRemoveWorldStates(Player* player);
+ void SendRemoveWorldStates(Player* player) override;
- bool HandleAreaTrigger(Player* player, uint32 trigger);
+ bool HandleAreaTrigger(Player* player, uint32 trigger) override;
- bool HandleDropFlag(Player* player, uint32 spellId);
+ bool HandleDropFlag(Player* player, uint32 spellId) override;
- bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go);
+ bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go) override;
void UpdateWorldState();
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPScriptLoader.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPScriptLoader.cpp
new file mode 100644
index 00000000000..ebf29910046
--- /dev/null
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPScriptLoader.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+void AddSC_outdoorpvp_ep();
+void AddSC_outdoorpvp_hp();
+void AddSC_outdoorpvp_na();
+void AddSC_outdoorpvp_si();
+void AddSC_outdoorpvp_tf();
+void AddSC_outdoorpvp_zm();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddOutdoorPvPScripts()
+{
+ AddSC_outdoorpvp_ep();
+ AddSC_outdoorpvp_hp();
+ AddSC_outdoorpvp_na();
+ AddSC_outdoorpvp_si();
+ AddSC_outdoorpvp_tf();
+ AddSC_outdoorpvp_zm();
+}
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
index 237fee3283b..ebbccfd63cb 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
@@ -132,11 +132,11 @@ class OPvPCapturePointTF : public OPvPCapturePoint
public:
OPvPCapturePointTF(OutdoorPvP* pvp, OutdoorPvPTF_TowerType type);
- bool Update(uint32 diff);
+ bool Update(uint32 diff) override;
- void ChangeState();
+ void ChangeState() override;
- void FillInitialWorldStates(WorldPacket & data);
+ void FillInitialWorldStates(WorldPacket & data) override;
void UpdateTowerState();
@@ -151,16 +151,16 @@ class OutdoorPvPTF : public OutdoorPvP
public:
OutdoorPvPTF();
- bool SetupOutdoorPvP();
+ bool SetupOutdoorPvP() override;
- void HandlePlayerEnterZone(Player* player, uint32 zone);
- void HandlePlayerLeaveZone(Player* player, uint32 zone);
+ void HandlePlayerEnterZone(Player* player, uint32 zone) override;
+ void HandlePlayerLeaveZone(Player* player, uint32 zone) override;
- bool Update(uint32 diff);
+ bool Update(uint32 diff) override;
- void FillInitialWorldStates(WorldPacket &data);
+ void FillInitialWorldStates(WorldPacket &data) override;
- void SendRemoveWorldStates(Player* player);
+ void SendRemoveWorldStates(Player* player) override;
uint32 GetAllianceTowersControlled() const;
void SetAllianceTowersControlled(uint32 count);
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
index e71fbf79280..352e6f108ea 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
@@ -161,9 +161,9 @@ class OPvPCapturePointZM_Beacon : public OPvPCapturePoint
public:
OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type);
- void ChangeState();
+ void ChangeState() override;
- void FillInitialWorldStates(WorldPacket & data);
+ void FillInitialWorldStates(WorldPacket & data) override;
void UpdateTowerState();
@@ -218,18 +218,18 @@ class OutdoorPvPZM : public OutdoorPvP
public:
OutdoorPvPZM();
- bool SetupOutdoorPvP();
+ bool SetupOutdoorPvP() override;
- void HandlePlayerEnterZone(Player* player, uint32 zone);
- void HandlePlayerLeaveZone(Player* player, uint32 zone);
+ void HandlePlayerEnterZone(Player* player, uint32 zone) override;
+ void HandlePlayerLeaveZone(Player* player, uint32 zone) override;
- bool Update(uint32 diff);
+ bool Update(uint32 diff) override;
- void FillInitialWorldStates(WorldPacket &data);
+ void FillInitialWorldStates(WorldPacket &data) override;
- void SendRemoveWorldStates(Player* player);
+ void SendRemoveWorldStates(Player* player) override;
- void HandleKillImpl(Player* player, Unit* killed);
+ void HandleKillImpl(Player* player, Unit* killed) override;
uint32 GetAllianceTowersControlled() const;
void SetAllianceTowersControlled(uint32 count);
diff --git a/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
index 9c16379c9f1..236f5bac403 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
@@ -64,12 +64,11 @@ public:
return GetInstanceAI<boss_gurtogg_bloodboilAI>(creature);
}
- struct boss_gurtogg_bloodboilAI : public ScriptedAI
+ struct boss_gurtogg_bloodboilAI : public BossAI
{
- boss_gurtogg_bloodboilAI(Creature* creature) : ScriptedAI(creature)
+ boss_gurtogg_bloodboilAI(Creature* creature) : BossAI(creature, DATA_GURTOGG_BLOODBOIL)
{
Initialize();
- instance = creature->GetInstanceScript();
}
void Initialize()
@@ -91,8 +90,6 @@ public:
Phase1 = true;
}
- InstanceScript* instance;
-
ObjectGuid TargetGUID;
float TargetThreat;
@@ -112,8 +109,7 @@ public:
void Reset() override
{
- instance->SetBossState(DATA_GURTOGG_BLOODBOIL, NOT_STARTED);
-
+ _Reset();
Initialize();
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
@@ -122,9 +118,8 @@ public:
void EnterCombat(Unit* /*who*/) override
{
- DoZoneInCombat();
Talk(SAY_AGGRO);
- instance->SetBossState(DATA_GURTOGG_BLOODBOIL, IN_PROGRESS);
+ _EnterCombat();
}
void KilledUnit(Unit* /*victim*/) override
@@ -134,9 +129,8 @@ public:
void JustDied(Unit* /*killer*/) override
{
- instance->SetBossState(DATA_GURTOGG_BLOODBOIL, DONE);
-
Talk(SAY_DEATH);
+ _JustDied();
}
void RevertThreatOnTarget(ObjectGuid guid)
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index 7902c585509..a63d984d849 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -473,12 +473,11 @@ class boss_illidan_stormrage : public CreatureScript
public:
boss_illidan_stormrage() : CreatureScript("boss_illidan_stormrage") { }
- struct boss_illidan_stormrageAI : public ScriptedAI
+ struct boss_illidan_stormrageAI : public BossAI
{
- boss_illidan_stormrageAI(Creature* creature) : ScriptedAI(creature), Summons(me)
+ boss_illidan_stormrageAI(Creature* creature) : BossAI(creature, DATA_ILLIDAN_STORMRAGE)
{
Initialize();
- instance = creature->GetInstanceScript();
DoCast(me, SPELL_DUAL_WIELD, true);
}
@@ -519,7 +518,7 @@ public:
EnterPhase(PHASE_FLIGHT_SEQUENCE);
}
}
- Summons.Despawn(summon);
+ summons.Despawn(summon);
}
void MovementInform(uint32 /*MovementType*/, uint32 /*Data*/) override
@@ -539,6 +538,7 @@ public:
void EnterCombat(Unit* /*who*/) override
{
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->setActive(true);
DoZoneInCombat();
}
@@ -561,10 +561,10 @@ public:
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- instance->SetBossState(DATA_ILLIDAN_STORMRAGE, DONE);
-
for (uint8 i = DATA_GO_ILLIDAN_DOOR_R; i < DATA_GO_ILLIDAN_DOOR_L + 1; ++i)
instance->HandleGameObject(instance->GetGuidData(i), true);
+
+ _JustDied();
}
void KilledUnit(Unit* victim) override
@@ -585,7 +585,7 @@ public:
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
{
- if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades!
+ if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warglaives!
{
if (!me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID))
SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
@@ -673,7 +673,7 @@ public:
Timer[EVENT_TALK_SEQUENCE] = 100;
me->RemoveAllAuras();
me->InterruptNonMeleeSpells(false);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->GetMotionMaster()->Clear(false);
me->AttackStop();
break;
@@ -745,7 +745,7 @@ public:
if (!Trigger)
return;
- Trigger->SetSpeed(MOVE_WALK, 3);
+ Trigger->SetSpeedRate(MOVE_WALK, 3);
Trigger->SetWalk(true);
Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
@@ -791,99 +791,99 @@ public:
{
switch (FlightCount)
{
- case 1: // lift off
- me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- me->SetDisableGravity(true);
- me->StopMoving();
- Talk(SAY_ILLIDAN_TAKEOFF);
- Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
- break;
- case 2: // move to center
- me->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); // +5, for SPELL_THROW_GLAIVE bug
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 3: // throw one glaive
- {
- uint8 i=1;
- Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (Glaive)
+ case 1: // lift off
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ me->SetDisableGravity(true);
+ me->StopMoving();
+ Talk(SAY_ILLIDAN_TAKEOFF);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
+ break;
+ case 2: // move to center
+ me->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); // +5, for SPELL_THROW_GLAIVE bug
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 3: // throw one glaive
{
- GlaiveGUID[i] = Glaive->GetGUID();
- Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Glaive->SetDisplayId(MODEL_INVISIBLE);
- Glaive->setFaction(me->getFaction());
- DoCast(Glaive, SPELL_THROW_GLAIVE2);
+ uint8 i=1;
+ Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (Glaive)
+ {
+ GlaiveGUID[i] = Glaive->GetGUID();
+ Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Glaive->SetDisplayId(MODEL_INVISIBLE);
+ Glaive->setFaction(me->getFaction());
+ DoCast(Glaive, SPELL_THROW_GLAIVE2);
+ }
}
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 700;
- break;
- case 4: // throw another
- SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
- {
- uint8 i=0;
- Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (Glaive)
+ Timer[EVENT_FLIGHT_SEQUENCE] = 700;
+ break;
+ case 4: // throw another
+ SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
{
- GlaiveGUID[i] = Glaive->GetGUID();
- Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Glaive->SetDisplayId(MODEL_INVISIBLE);
- Glaive->setFaction(me->getFaction());
- DoCast(Glaive, SPELL_THROW_GLAIVE, true);
+ uint8 i=0;
+ Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (Glaive)
+ {
+ GlaiveGUID[i] = Glaive->GetGUID();
+ Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ Glaive->SetDisplayId(MODEL_INVISIBLE);
+ Glaive->setFaction(me->getFaction());
+ DoCast(Glaive, SPELL_THROW_GLAIVE, true);
+ }
}
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 5000;
- break;
- case 5: // summon flames
- SummonFlamesOfAzzinoth();
- Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
- break;
- case 6: // fly to hover point
- me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 7: // return to center
- me->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z);
- Timer[EVENT_FLIGHT_SEQUENCE] = 0;
- break;
- case 8: // glaive return
- for (uint8 i = 0; i < 2; ++i)
- {
- if (GlaiveGUID[i])
+ Timer[EVENT_FLIGHT_SEQUENCE] = 5000;
+ break;
+ case 5: // summon flames
+ SummonFlamesOfAzzinoth();
+ Timer[EVENT_FLIGHT_SEQUENCE] = 3000;
+ break;
+ case 6: // fly to hover point
+ me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 7: // return to center
+ me->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z);
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0;
+ break;
+ case 8: // glaive return
+ for (uint8 i = 0; i < 2; ++i)
{
- Unit* Glaive = ObjectAccessor::GetUnit(*me, GlaiveGUID[i]);
- if (Glaive)
+ if (GlaiveGUID[i])
{
- Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us
- Glaive->SetDisplayId(MODEL_INVISIBLE); // disappear but not die for now
+ Unit* Glaive = ObjectAccessor::GetUnit(*me, GlaiveGUID[i]);
+ if (Glaive)
+ {
+ Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us
+ Glaive->SetDisplayId(MODEL_INVISIBLE); // disappear but not die for now
+ }
}
}
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- break;
- case 9: // land
- me->SetDisableGravity(false);
- me->StopMoving();
- me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
- for (uint8 i = 0; i < 2; ++i)
- {
- if (GlaiveGUID[i])
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
+ break;
+ case 9: // land
+ me->SetDisableGravity(false);
+ me->StopMoving();
+ me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ for (uint8 i = 0; i < 2; ++i)
{
- if (Creature* glaive = ObjectAccessor::GetCreature(*me, GlaiveGUID[i]))
- glaive->DespawnOrUnsummon();
+ if (GlaiveGUID[i])
+ {
+ if (Creature* glaive = ObjectAccessor::GetCreature(*me, GlaiveGUID[i]))
+ glaive->DespawnOrUnsummon();
- GlaiveGUID[i].Clear();
+ GlaiveGUID[i].Clear();
+ }
}
- }
- Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
- break;
- case 10: // attack
- DoResetThreat();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
- me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
- EnterPhase(PHASE_NORMAL_2);
- break;
- default:
- break;
+ Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
+ break;
+ case 10: // attack
+ DoResetThreat();
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
+ EnterPhase(PHASE_NORMAL_2);
+ break;
+ default:
+ break;
}
++FlightCount;
}
@@ -913,23 +913,23 @@ public:
switch (TransformCount)
{
- case 2:
- DoResetThreat();
- break;
- case 4:
- EnterPhase(PHASE_DEMON);
- break;
- case 7:
- DoResetThreat();
- break;
- case 9:
- if (MaievGUID)
- EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3
- else
- EnterPhase(PHASE_NORMAL_2);
- break;
- default:
- break;
+ case 2:
+ DoResetThreat();
+ break;
+ case 4:
+ EnterPhase(PHASE_DEMON);
+ break;
+ case 7:
+ DoResetThreat();
+ break;
+ case 9:
+ if (MaievGUID)
+ EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3
+ else
+ EnterPhase(PHASE_NORMAL_2);
+ break;
+ default:
+ break;
}
if (Phase == PHASE_TRANSFORM_SEQUENCE)
Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer;
@@ -957,37 +957,37 @@ public:
switch (Phase)
{
- case PHASE_NORMAL:
- if (HealthBelowPct(65))
- EnterPhase(PHASE_FLIGHT_SEQUENCE);
- break;
+ case PHASE_NORMAL:
+ if (HealthBelowPct(65))
+ EnterPhase(PHASE_FLIGHT_SEQUENCE);
+ break;
- case PHASE_NORMAL_2:
- if (HealthBelowPct(30))
- EnterPhase(PHASE_TALK_SEQUENCE);
- break;
+ case PHASE_NORMAL_2:
+ if (HealthBelowPct(30))
+ EnterPhase(PHASE_TALK_SEQUENCE);
+ break;
- case PHASE_NORMAL_MAIEV:
- if (HealthBelowPct(1))
- EnterPhase(PHASE_TALK_SEQUENCE);
- break;
+ case PHASE_NORMAL_MAIEV:
+ if (HealthBelowPct(1))
+ EnterPhase(PHASE_TALK_SEQUENCE);
+ break;
- case PHASE_TALK_SEQUENCE:
- if (Event == EVENT_TALK_SEQUENCE)
- HandleTalkSequence();
- break;
+ case PHASE_TALK_SEQUENCE:
+ if (Event == EVENT_TALK_SEQUENCE)
+ HandleTalkSequence();
+ break;
- case PHASE_FLIGHT_SEQUENCE:
- if (Event == EVENT_FLIGHT_SEQUENCE)
- HandleFlightSequence();
- break;
+ case PHASE_FLIGHT_SEQUENCE:
+ if (Event == EVENT_FLIGHT_SEQUENCE)
+ HandleFlightSequence();
+ break;
- case PHASE_TRANSFORM_SEQUENCE:
- if (Event == EVENT_TRANSFORM_SEQUENCE)
- HandleTransformSequence();
- break;
- default:
- break;
+ case PHASE_TRANSFORM_SEQUENCE:
+ if (Event == EVENT_TRANSFORM_SEQUENCE)
+ HandleTransformSequence();
+ break;
+ default:
+ break;
}
if (me->IsNonMeleeSpellCast(false))
@@ -998,63 +998,63 @@ public:
switch (Event)
{
// PHASE_NORMAL
- case EVENT_BERSERK:
- Talk(SAY_ILLIDAN_ENRAGE);
- DoCast(me, SPELL_BERSERK, true);
- Timer[EVENT_BERSERK] = 5000; // The buff actually lasts forever.
- break;
-
- case EVENT_TAUNT:
- Talk(SAY_ILLIDAN_TAUNT);
- Timer[EVENT_TAUNT] = urand(25000, 35000);
- break;
-
- case EVENT_SHEAR:
- // no longer exists in 3.0f.2
- // DoCastVictim(SPELL_SHEAR);
- Timer[EVENT_SHEAR] = 25000 + (rand32() % 16 * 1000);
- break;
-
- case EVENT_FLAME_CRASH:
- DoCastVictim(SPELL_FLAME_CRASH);
- Timer[EVENT_FLAME_CRASH] = urand(30000, 40000);
- break;
-
- case EVENT_PARASITIC_SHADOWFIEND:
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true))
- DoCast(target, SPELL_PARASITIC_SHADOWFIEND, true);
- Timer[EVENT_PARASITIC_SHADOWFIEND] = urand(35000, 45000);
- }
- break;
-
- case EVENT_PARASITE_CHECK:
- Timer[EVENT_PARASITE_CHECK] = 0;
- break;
-
- case EVENT_DRAW_SOUL:
- DoCastVictim(SPELL_DRAW_SOUL);
- Timer[EVENT_DRAW_SOUL] = urand(50000, 60000);
- break;
-
- // PHASE_NORMAL_2
- case EVENT_AGONIZING_FLAMES:
- DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_AGONIZING_FLAMES);
- Timer[EVENT_AGONIZING_FLAMES] = 0;
- break;
-
- case EVENT_TRANSFORM_NORMAL:
- EnterPhase(PHASE_TRANSFORM_SEQUENCE);
- break;
-
- // PHASE_NORMAL_MAIEV
- case EVENT_ENRAGE:
- DoCast(me, SPELL_ENRAGE);
- Timer[EVENT_ENRAGE] = 0;
- break;
-
- default:
- break;
+ case EVENT_BERSERK:
+ Talk(SAY_ILLIDAN_ENRAGE);
+ DoCast(me, SPELL_BERSERK, true);
+ Timer[EVENT_BERSERK] = 5000; // The buff actually lasts forever.
+ break;
+
+ case EVENT_TAUNT:
+ Talk(SAY_ILLIDAN_TAUNT);
+ Timer[EVENT_TAUNT] = urand(25000, 35000);
+ break;
+
+ case EVENT_SHEAR:
+ // no longer exists in 3.0f.2
+ // DoCastVictim(SPELL_SHEAR);
+ Timer[EVENT_SHEAR] = 25000 + (rand32() % 16 * 1000);
+ break;
+
+ case EVENT_FLAME_CRASH:
+ DoCastVictim(SPELL_FLAME_CRASH);
+ Timer[EVENT_FLAME_CRASH] = urand(30000, 40000);
+ break;
+
+ case EVENT_PARASITIC_SHADOWFIEND:
+ {
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true))
+ DoCast(target, SPELL_PARASITIC_SHADOWFIEND, true);
+ Timer[EVENT_PARASITIC_SHADOWFIEND] = urand(35000, 45000);
+ }
+ break;
+
+ case EVENT_PARASITE_CHECK:
+ Timer[EVENT_PARASITE_CHECK] = 0;
+ break;
+
+ case EVENT_DRAW_SOUL:
+ DoCastVictim(SPELL_DRAW_SOUL);
+ Timer[EVENT_DRAW_SOUL] = urand(50000, 60000);
+ break;
+
+ // PHASE_NORMAL_2
+ case EVENT_AGONIZING_FLAMES:
+ DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_AGONIZING_FLAMES);
+ Timer[EVENT_AGONIZING_FLAMES] = 0;
+ break;
+
+ case EVENT_TRANSFORM_NORMAL:
+ EnterPhase(PHASE_TRANSFORM_SEQUENCE);
+ break;
+
+ // PHASE_NORMAL_MAIEV
+ case EVENT_ENRAGE:
+ DoCast(me, SPELL_ENRAGE);
+ Timer[EVENT_ENRAGE] = 0;
+ break;
+
+ default:
+ break;
}
DoMeleeAttackIfReady();
}
@@ -1063,32 +1063,32 @@ public:
{
switch (Event)
{
- case EVENT_FIREBALL:
- DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL);
- Timer[EVENT_FIREBALL] = 3000;
- break;
-
- case EVENT_DARK_BARRAGE:
- DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE);
- Timer[EVENT_DARK_BARRAGE] = 0;
- break;
-
- case EVENT_EYE_BLAST:
- CastEyeBlast();
- Timer[EVENT_EYE_BLAST] = 0;
- break;
-
- case EVENT_MOVE_POINT:
- Phase = PHASE_FLIGHT_SEQUENCE;
- Timer[EVENT_FLIGHT_SEQUENCE] = 0; // do not start Event when changing hover point
- HoverPoint += (rand32() % 3 + 1);
- if (HoverPoint > 3)
- HoverPoint -= 4;
- me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
- break;
-
- default:
- break;
+ case EVENT_FIREBALL:
+ DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL);
+ Timer[EVENT_FIREBALL] = 3000;
+ break;
+
+ case EVENT_DARK_BARRAGE:
+ DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE);
+ Timer[EVENT_DARK_BARRAGE] = 0;
+ break;
+
+ case EVENT_EYE_BLAST:
+ CastEyeBlast();
+ Timer[EVENT_EYE_BLAST] = 0;
+ break;
+
+ case EVENT_MOVE_POINT:
+ Phase = PHASE_FLIGHT_SEQUENCE;
+ Timer[EVENT_FLIGHT_SEQUENCE] = 0; // do not start Event when changing hover point
+ HoverPoint += (rand32() % 3 + 1);
+ if (HoverPoint > 3)
+ HoverPoint -= 4;
+ me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z);
+ break;
+
+ default:
+ break;
}
}
@@ -1096,29 +1096,29 @@ public:
{
switch (Event)
{
- case EVENT_SHADOW_BLAST:
- me->GetMotionMaster()->Clear(false);
- if (me->GetVictim() && (!me->IsWithinDistInMap(me->GetVictim(), 50) || !me->IsWithinLOSInMap(me->GetVictim())))
- me->GetMotionMaster()->MoveChase(me->GetVictim(), 30);
- else
- me->GetMotionMaster()->MoveIdle();
- DoCastVictim(SPELL_SHADOW_BLAST);
- Timer[EVENT_SHADOW_BLAST] = 4000;
- break;
- case EVENT_SHADOWDEMON:
- DoCast(me, SPELL_SUMMON_SHADOWDEMON);
- Timer[EVENT_SHADOWDEMON] = 0;
- Timer[EVENT_FLAME_BURST] += 10000;
- break;
- case EVENT_FLAME_BURST:
- DoCast(me, SPELL_FLAME_BURST);
- Timer[EVENT_FLAME_BURST] = 15000;
- break;
- case EVENT_TRANSFORM_DEMON:
- EnterPhase(PHASE_TRANSFORM_SEQUENCE);
- break;
- default:
- break;
+ case EVENT_SHADOW_BLAST:
+ me->GetMotionMaster()->Clear(false);
+ if (me->GetVictim() && (!me->IsWithinDistInMap(me->GetVictim(), 50) || !me->IsWithinLOSInMap(me->GetVictim())))
+ me->GetMotionMaster()->MoveChase(me->GetVictim(), 30);
+ else
+ me->GetMotionMaster()->MoveIdle();
+ DoCastVictim(SPELL_SHADOW_BLAST);
+ Timer[EVENT_SHADOW_BLAST] = 4000;
+ break;
+ case EVENT_SHADOWDEMON:
+ DoCast(me, SPELL_SUMMON_SHADOWDEMON);
+ Timer[EVENT_SHADOWDEMON] = 0;
+ Timer[EVENT_FLAME_BURST] += 10000;
+ break;
+ case EVENT_FLAME_BURST:
+ DoCast(me, SPELL_FLAME_BURST);
+ Timer[EVENT_FLAME_BURST] = 15000;
+ break;
+ case EVENT_TRANSFORM_DEMON:
+ EnterPhase(PHASE_TRANSFORM_SEQUENCE);
+ break;
+ default:
+ break;
}
}
}
@@ -1128,7 +1128,6 @@ public:
uint32 Timer[EVENT_ENRAGE + 1];
PhaseIllidan Phase;
private:
- InstanceScript* instance;
EventIllidan Event;
uint32 TalkCount;
uint32 TransformCount;
@@ -1137,7 +1136,6 @@ public:
ObjectGuid MaievGUID;
ObjectGuid FlameGUID[2];
ObjectGuid GlaiveGUID[2];
- SummonList Summons;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -1148,7 +1146,7 @@ public:
/********************************** End of Illidan AI* *****************************************/
-/******* Functions and vars for Akama's AI* *****/
+/******* Functions and vars for Maiev's AI* *****/
class boss_maiev_shadowsong : public CreatureScript
{
public:
@@ -1301,15 +1299,17 @@ public:
EventMaiev Event = EVENT_MAIEV_NULL;
for (uint8 i = 1; i <= MaxTimer; ++i)
+ {
if (Timer[i])
{
if (Timer[i] <= diff)
Event = (EventMaiev)i;
else Timer[i] -= diff;
}
+ }
- switch (Event)
- {
+ switch (Event)
+ {
case EVENT_MAIEV_STEALTH:
{
me->SetFullHealth();
@@ -1345,21 +1345,21 @@ public:
break;
default:
break;
- }
+ }
- if (HealthBelowPct(50))
- {
- me->SetVisible(false);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (Creature* illidan = ObjectAccessor::GetCreature(*me, IllidanGUID))
- ENSURE_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, illidan->AI())->DeleteFromThreatList(me->GetGUID());
- me->AttackStop();
- Timer[EVENT_MAIEV_STEALTH] = 60000; // reappear after 1 minute
- MaxTimer = 1;
- }
+ if (HealthBelowPct(50))
+ {
+ me->SetVisible(false);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ if (Creature* illidan = ObjectAccessor::GetCreature(*me, IllidanGUID))
+ ENSURE_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, illidan->AI())->DeleteFromThreatList(me->GetGUID());
+ me->AttackStop();
+ Timer[EVENT_MAIEV_STEALTH] = 60000; // reappear after 1 minute
+ MaxTimer = 1;
+ }
- if (Phase == PHASE_NORMAL_MAIEV)
- DoMeleeAttackIfReady();
+ if (Phase == PHASE_NORMAL_MAIEV)
+ DoMeleeAttackIfReady();
}
private:
@@ -1375,6 +1375,7 @@ public:
}
};
+/******* Functions and vars for Akama's AI* *****/
class npc_akama_illidan : public CreatureScript
{
public:
@@ -1432,7 +1433,7 @@ public:
KillAllElites();
- me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values..
+ me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); // Database sometimes has strange values..
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->setActive(false);
me->SetVisible(false);
@@ -1524,7 +1525,7 @@ public:
void BeginWalk()
{
me->SetWalk(false);
- me->SetSpeed(MOVE_RUN, 1.0f);
+ me->SetSpeedRate(MOVE_RUN, 1.0f);
me->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z);
}
@@ -1809,7 +1810,7 @@ public:
void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset()
{
- instance->SetBossState(DATA_ILLIDAN_STORMRAGE, NOT_STARTED);
+ _Reset();
if (Creature* akama = ObjectAccessor::GetCreature(*me, AkamaGUID))
{
@@ -1828,12 +1829,11 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset()
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
me->SetDisableGravity(false);
me->setActive(false);
- Summons.DespawnAll();
}
void boss_illidan_stormrage::boss_illidan_stormrageAI::JustSummoned(Creature* summon)
{
- Summons.Summon(summon);
+ summons.Summon(summon);
switch (summon->GetEntry())
{
case PARASITIC_SHADOWFIEND:
@@ -1926,7 +1926,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence()
break;
case 15:
DoCast(me, SPELL_DEATH); // Animate his kneeling + stun him
- Summons.DespawnAll();
+ summons.DespawnAll();
break;
case 17:
if (Creature* akama = ObjectAccessor::GetCreature(*me, AkamaGUID))
diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
index aaf72512ae9..9412067f77e 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp
@@ -149,7 +149,7 @@ public:
void TeleportPlayers()
{
- uint32 random = urand(0, 7);
+ uint32 random = urand(0, 6);
float X = TeleportPoint[random].x;
float Y = TeleportPoint[random].y;
float Z = TeleportPoint[random].z;
@@ -210,7 +210,7 @@ public:
break;
case EVENT_PRISMATIC_SHIELD:
// Random Prismatic Shield every 15 seconds.
- DoCast(me, PrismaticAuras[urand(0, 6)]);
+ DoCast(me, PrismaticAuras[urand(0, 5)]);
events.ScheduleEvent(EVENT_PRISMATIC_SHIELD, 15000);
break;
case EVENT_FATAL_ATTRACTION:
diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
index afc7d3d0fd7..d89437c2816 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
@@ -135,12 +135,11 @@ public:
return GetInstanceAI<boss_reliquary_of_soulsAI>(creature);
}
- struct boss_reliquary_of_soulsAI : public ScriptedAI
+ struct boss_reliquary_of_soulsAI : public BossAI
{
- boss_reliquary_of_soulsAI(Creature* creature) : ScriptedAI(creature)
+ boss_reliquary_of_soulsAI(Creature* creature) : BossAI(creature, DATA_RELIQUARY_OF_SOULS)
{
Initialize();
- instance = creature->GetInstanceScript();
Counter = 0;
Timer = 0;
SoulCount = 0;
@@ -152,8 +151,6 @@ public:
Phase = 0;
}
- InstanceScript* instance;
-
ObjectGuid EssenceGUID;
uint32 Phase;
@@ -165,7 +162,7 @@ public:
void Reset() override
{
- instance->SetBossState(DATA_RELIQUARY_OF_SOULS, NOT_STARTED);
+ _Reset();
if (EssenceGUID)
{
@@ -202,8 +199,7 @@ public:
void EnterCombat(Unit* who) override
{
me->AddThreat(who, 10000.0f);
- DoZoneInCombat();
- instance->SetBossState(DATA_RELIQUARY_OF_SOULS, IN_PROGRESS);
+ _EnterCombat();
Phase = 1;
Counter = 0;
@@ -246,11 +242,6 @@ public:
}
}
- void JustDied(Unit* /*killer*/) override
- {
- instance->SetBossState(DATA_RELIQUARY_OF_SOULS, DONE);
- }
-
void UpdateAI(uint32 diff) override
{
if (!Phase)
diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
index 7e1215488e1..c9e08176ad6 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
@@ -15,45 +15,45 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/*
-Name: Boss_Shade_of_Akama
-%Complete: 80
-Comment: WIP A few more adds to script, ending script, and bugs.
-Category: Black Temple
-*/
-
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "PassiveAI.h"
#include "ScriptedGossip.h"
#include "GridNotifiers.h"
#include "black_temple.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
enum Says
{
- // Akama Ending cinematic text
+ // Akama
SAY_BROKEN_FREE_0 = 0,
SAY_BROKEN_FREE_1 = 1,
- SAY_BROKEN_FREE_2 = 2
+ SAY_BROKEN_FREE_2 = 2,
+ SAY_LOW_HEALTH = 3,
+ SAY_DEAD = 4,
+ // Ashtongue Broken
+ SAY_BROKEN_SPECIAL = 0,
+ SAY_BROKEN_HAIL = 1
};
enum Spells
{
// Akama
- SPELL_STEALTH = 34189, // On Spawn
- SPELL_AKAMA_SOUL_CHANNEL = 40447, // Cast on self hits Shade
- SPELL_FIXATE = 40607, // Cast on self hits Shade
- SPELL_CHAIN_LIGHTNING = 39945, // Combat
- SPELL_DESTRUCTIVE_POISON = 40874, // Combat
+ SPELL_STEALTH = 34189,
+ SPELL_AKAMA_SOUL_CHANNEL = 40447,
+ SPELL_FIXATE = 40607,
+ SPELL_CHAIN_LIGHTNING = 39945,
+ SPELL_DESTRUCTIVE_POISON = 40874,
+ SPELL_AKAMA_SOUL_EXPEL = 40902,
// Shade
- SPELL_THREAT = 41602, // self cast hits Akama
- SPELL_SHADE_OF_AKAMA_TRIGGER = 40955, // Cast on death
- SPELL_AKAMA_SOUL_EXPEL_CHANNEL = 40927, // must hit shade
- SPELL_AKAMA_SOUL_EXPEL = 40902, // the one he cast
+ SPELL_THREAT = 41602,
+ SPELL_SHADE_OF_AKAMA_TRIGGER = 40955,
+ SPELL_AKAMA_SOUL_EXPEL_CHANNEL = 40927,
// Ashtongue Channeler
SPELL_SHADE_SOUL_CHANNEL = 40401,
SPELL_SHADE_SOUL_CHANNEL_2 = 40520,
- SPELL_SHADOWFORM = 40973, // Cast on Shade
// Creature Spawner
SPELL_ASHTONGUE_WAVE_B = 42035,
SPELL_SUMMON_ASHTONGUE_SORCERER = 40476,
@@ -78,11 +78,6 @@ enum Spells
enum Creatures
{
NPC_ASHTONGUE_CHANNELER = 23421,
- NPC_ASHTONGUE_SORCERER = 23215,
- NPC_ASHTONGUE_DEFENDER = 23216,
- NPC_ASHTONGUE_ELEMENTALIST = 23523,
- NPC_ASHTONGUE_ROGUE = 23318,
- NPC_ASHTONGUE_SPIRITBINDER = 23524,
NPC_ASHTONGUE_BROKEN = 23319,
NPC_CREATURE_SPAWNER_AKAMA = 23210
};
@@ -95,60 +90,114 @@ enum Factions
enum Actions
{
- ACTION_CHANNELER_DIED = 1,
- ACTION_START_SPAWNING = 2,
- ACTION_STOP_SPAWNING = 3,
- ACTION_DESPAWN_ALL_SPAWNS = 4,
+ ACTION_START_SPAWNING = 0,
+ ACTION_STOP_SPAWNING = 1,
+ ACTION_DESPAWN_ALL_SPAWNS = 2,
+ ACTION_SHADE_OF_AKAMA_DEAD = 3,
+ ACTION_BROKEN_SPECIAL = 4,
+ ACTION_BROKEN_EMOTE = 5,
+ ACTION_BROKEN_HAIL = 6
};
enum Events
{
// Akama
- EVENT_SHADE_START = 1,
- EVENT_SHADE_CHANNEL = 2,
- EVENT_FIXATE = 3,
- EVENT_CHAIN_LIGHTNING = 4,
- EVENT_DESTRUCTIVE_POISON = 5,
- // Shade
- EVENT_RESET_ENCOUNTER = 6,
- EVENT_FIND_CHANNELERS_SPAWNERS = 7,
- EVENT_SET_CHANNELERS_SPAWNERS = 8,
- EVENT_START_ATTACK_AKAMA = 9,
- EVENT_ADD_THREAT = 10,
+ EVENT_SHADE_START = 1,
+ EVENT_SHADE_CHANNEL = 2,
+ EVENT_FIXATE = 3,
+ EVENT_CHAIN_LIGHTNING = 4,
+ EVENT_DESTRUCTIVE_POISON = 5,
+ EVENT_START_BROKEN_FREE = 6,
+ EVENT_START_SOUL_EXPEL = 7,
+ EVENT_EVADE_CHECK = 8,
+ EVENT_BROKEN_FREE_1 = 9,
+ EVENT_BROKEN_FREE_2 = 10,
+ EVENT_BROKEN_FREE_3 = 11,
+ EVENT_BROKEN_FREE_4 = 12,
+ // Shade of Akama
+ EVENT_INITIALIZE_SPAWNERS = 13,
+ EVENT_START_CHANNELERS_AND_SPAWNERS = 14,
+ EVENT_ADD_THREAT = 15,
// Creature spawner
- EVENT_SPAWN_WAVE_B = 11,
- EVENT_SUMMON_ASHTONGUE_SORCERER = 12,
- EVENT_SUMMON_ASHTONGUE_DEFENDER = 13,
- // Channeler
- EVENT_CHANNEL = 14,
- // Ashtongue Sorcerer
- EVENT_SORCERER_CHANNEL = 15,
+ EVENT_SPAWN_WAVE_B = 16,
+ EVENT_SUMMON_ASHTONGUE_SORCERER = 17,
+ EVENT_SUMMON_ASHTONGUE_DEFENDER = 18,
// Ashtongue Defender
- EVENT_DEBILITATING_STRIKE = 16,
- EVENT_HEROIC_STRIKE = 17,
- EVENT_SHIELD_BASH = 18,
- EVENT_WINDFURY = 29,
+ EVENT_DEBILITATING_STRIKE = 19,
+ EVENT_HEROIC_STRIKE = 20,
+ EVENT_SHIELD_BASH = 21,
+ EVENT_WINDFURY = 22,
// Ashtongue Rogue
- EVENT_DEBILITATING_POISON = 20,
- EVENT_EVISCERATE = 21,
+ EVENT_DEBILITATING_POISON = 23,
+ EVENT_EVISCERATE = 24,
// Ashtongue Elementalist
- EVENT_RAIN_OF_FIRE = 22,
- EVENT_LIGHTNING_BOLT = 23,
+ EVENT_RAIN_OF_FIRE = 25,
+ EVENT_LIGHTNING_BOLT = 26,
// Ashtongue Spiritbinder
- EVENT_SPIRIT_HEAL = 24
+ EVENT_SPIRIT_HEAL = 27,
+ EVENT_SPIRIT_MEND_RESET = 28,
+ EVENT_CHAIN_HEAL_RESET = 29
};
-G3D::Vector3 const ShadeWP = { 512.4877f, 400.7993f, 112.7837f };
+enum Misc
+{
+ AKAMA_CHANNEL_WAYPOINT = 0,
+ AKAMA_INTRO_WAYPOINT = 1,
+
+ SUMMON_GROUP_RESET = 1
+};
-G3D::Vector3 const AkamaWP[] =
+Position const AkamaWP[2] =
{
{ 517.4877f, 400.7993f, 112.7837f },
{ 468.4435f, 401.1062f, 118.5379f }
};
-// ########################################################
-// Shade of Akama
-// ########################################################
+Position const BrokenPos[18] =
+{
+ { 495.5628f, 462.7089f, 112.8169f, 4.1808090f },
+ { 498.3421f, 463.8384f, 112.8673f, 4.5634810f },
+ { 501.6708f, 463.8806f, 112.8673f, 3.7157850f },
+ { 532.4264f, 448.4718f, 112.8563f, 3.9813020f },
+ { 532.9113f, 451.6227f, 112.8671f, 4.6479530f },
+ { 532.8243f, 453.9475f, 112.8671f, 4.7032810f },
+ { 521.5317f, 402.3790f, 112.8671f, 3.1138120f },
+ { 521.9184f, 404.6848f, 112.8671f, 4.0787760f },
+ { 522.4290f, 406.5160f, 112.8671f, 3.3869470f },
+ { 521.0833f, 393.1852f, 112.8611f, 3.0750830f },
+ { 521.9014f, 395.6381f, 112.8671f, 4.0157140f },
+ { 522.2610f, 397.7423f, 112.8671f, 3.4417790f },
+ { 532.4565f, 345.3987f, 112.8585f, 1.7232640f },
+ { 532.5565f, 346.8792f, 112.8671f, 1.8325960f },
+ { 532.5491f, 348.6840f, 112.8671f, 0.2054047f },
+ { 501.4669f, 338.5967f, 112.8504f, 1.7038430f },
+ { 499.0937f, 337.9894f, 112.8673f, 1.8586250f },
+ { 496.8722f, 338.0152f, 112.8673f, 0.5428222f }
+};
+
+Position const BrokenWP[18] =
+{
+ { 479.1884f, 434.8635f, 112.7838f },
+ { 479.7349f, 435.9843f, 112.7838f },
+ { 480.5328f, 436.8310f, 112.7838f },
+ { 493.1714f, 420.1136f, 112.7838f },
+ { 494.7830f, 417.4830f, 112.7838f },
+ { 492.9280f, 423.1891f, 112.7838f },
+ { 491.8618f, 403.2035f, 112.7838f },
+ { 491.7784f, 400.2046f, 112.7838f },
+ { 491.9451f, 406.2023f, 112.7838f },
+ { 488.3535f, 395.3652f, 112.7838f },
+ { 488.8324f, 392.3267f, 112.7838f },
+ { 489.2300f, 398.3135f, 112.7838f },
+ { 491.9286f, 383.0433f, 112.7838f },
+ { 491.1526f, 380.0966f, 112.7839f },
+ { 493.6747f, 385.5407f, 112.7838f },
+ { 476.2499f, 369.0865f, 112.7839f },
+ { 473.7637f, 367.8766f, 112.7839f },
+ { 478.8986f, 370.1895f, 112.7839f }
+};
+
+static float const MIDDLE_OF_ROOM = 400.0f;
class boss_shade_of_akama : public CreatureScript
{
@@ -160,233 +209,144 @@ public:
boss_shade_of_akamaAI(Creature* creature) : BossAI(creature, DATA_SHADE_OF_AKAMA)
{
Initialize();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void Initialize()
{
- combatStarted = false;
- akamaReached = false;
- HasKilledAkama = false;
- HasKilledAkamaAndReseting = false;
+ _spawners.clear();
+ _isInPhaseOne = true;
}
void Reset() override
{
- _Reset();
- if (!HasKilledAkamaAndReseting)
- {
- for (GuidList::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- if (Creature* Channeler = ObjectAccessor::GetCreature(*me, *itr))
- Channeler->DespawnOrUnsummon();
-
- for (GuidList::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
- if (Creature* Spawner = ObjectAccessor::GetCreature(*me, *itr))
- Spawner->AI()->DoAction(ACTION_DESPAWN_ALL_SPAWNS);
-
- events.ScheduleEvent(EVENT_FIND_CHANNELERS_SPAWNERS, 3000);
- events.ScheduleEvent(EVENT_RESET_ENCOUNTER, 5000);
- }
-
+ Initialize();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
-
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
me->SetWalk(true);
- Initialize();
+ events.ScheduleEvent(EVENT_INITIALIZE_SPAWNERS, Seconds(1));
+ me->SummonCreatureGroup(SUMMON_GROUP_RESET);
}
- void EnterCombat(Unit* /*who*/) override { }
-
- void AttackStart(Unit* who) override
+ void EnterEvadeMode(EvadeReason /*why*/) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
- {
- if (Creature* Akama = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
- if (Akama->IsAlive())
- ScriptedAI::AttackStart(Akama);
- }
- else
- ScriptedAI::AttackStart(who);
- }
+ _Reset();
- void DoAction(int32 actionId) override
- {
- if (actionId == ACTION_CHANNELER_DIED)
- me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2);
+ for (ObjectGuid const& spawnerGuid : _spawners)
+ if (Creature* spawner = ObjectAccessor::GetCreature(*me, spawnerGuid))
+ spawner->AI()->DoAction(ACTION_DESPAWN_ALL_SPAWNS);
- UpdateSpeed();
+ _DespawnAtEvade();
}
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_AKAMA_SOUL_CHANNEL)
{
- combatStarted = true;
- events.ScheduleEvent(EVENT_START_ATTACK_AKAMA, 500);
- events.ScheduleEvent(EVENT_SET_CHANNELERS_SPAWNERS, 1000);
+ events.ScheduleEvent(EVENT_START_CHANNELERS_AND_SPAWNERS, Seconds(1));
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
- if (Creature* Akama = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
- me->AddThreat(Akama, 10000000.0f);
+ events.ScheduleEvent(EVENT_EVADE_CHECK, Seconds(10));
+ if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
+ AttackStart(akama);
}
- else if (spell->Id == SPELL_SHADE_SOUL_CHANNEL_2)
- UpdateSpeed();
+
+ if (spell->Id == SPELL_AKAMA_SOUL_EXPEL)
+ DoCastSelf(SPELL_AKAMA_SOUL_EXPEL_CHANNEL);
}
- void UpdateSpeed()
+ void MovementInform(uint32 motionType, uint32 /*pointId*/) override
{
- float moveSpeed = 0.2f;
-
- if (me->GetAuraCount(SPELL_SHADE_SOUL_CHANNEL_2) <= 3)
+ if (_isInPhaseOne && motionType == CHASE_MOTION_TYPE)
{
- moveSpeed = (2.0f - (0.6f * me->GetAuraCount(SPELL_SHADE_SOUL_CHANNEL_2)));
- me->SetSpeed(MOVE_WALK, moveSpeed / 2.5f);
- me->SetSpeed(MOVE_RUN, (moveSpeed * 2) / 7);
- me->ClearUnitState(UNIT_STATE_ROOT);
+ _isInPhaseOne = false;
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetWalk(false);
+ events.ScheduleEvent(EVENT_ADD_THREAT, Milliseconds(100));
+
+ for (ObjectGuid const& spawnerGuid : _spawners)
+ if (Creature* spawner = ObjectAccessor::GetCreature(*me, spawnerGuid))
+ spawner->AI()->DoAction(ACTION_STOP_SPAWNING);
}
- else
- me->AddUnitState(UNIT_STATE_ROOT);
}
- void UpdateAI(uint32 diff) override
+ void JustDied(Unit* /*killer*/) override
{
- if (HasKilledAkamaAndReseting)
- return;
+ DoCastSelf(SPELL_SHADE_OF_AKAMA_TRIGGER);
+
+ if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
+ akama->AI()->DoAction(ACTION_SHADE_OF_AKAMA_DEAD);
+ for (ObjectGuid const& spawnerGuid : _spawners)
+ if (Creature* spawner = ObjectAccessor::GetCreature(*me, spawnerGuid))
+ spawner->AI()->DoAction(ACTION_DESPAWN_ALL_SPAWNS);
+
+ events.Reset();
+ summons.DespawnEntry(NPC_ASHTONGUE_CHANNELER);
+ instance->SetBossState(DATA_SHADE_OF_AKAMA, DONE);
+ }
+
+ void EnterEvadeModeIfNeeded()
+ {
+ Map::PlayerList const &players = me->GetMap()->GetPlayers();
+ for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
+ if (Player* player = i->GetSource())
+ if (player->IsAlive() && !player->IsGameMaster() && CheckBoundary(player))
+ return;
+
+ EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
events.Update(diff);
- if (!combatStarted)
- {
- while (uint32 eventId = events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_RESET_ENCOUNTER:
- if (Creature* Akama = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
- if (!Akama->IsAlive())
- Akama->Respawn();
- break;
- case EVENT_FIND_CHANNELERS_SPAWNERS:
- {
- std::list<Creature*> ChannelerList;
- me->GetCreatureListWithEntryInGrid(ChannelerList, NPC_ASHTONGUE_CHANNELER, 15.0f);
-
- if (!ChannelerList.empty())
- for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
- {
- Channelers.push_back((*itr)->GetGUID());
- if ((*itr)->isDead())
- (*itr)->Respawn();
- }
-
- std::list<Creature*> SpawnerList;
- me->GetCreatureListWithEntryInGrid(SpawnerList, NPC_CREATURE_SPAWNER_AKAMA, 90.0f);
-
- if (!SpawnerList.empty())
- for (std::list<Creature*>::const_iterator itr = SpawnerList.begin(); itr != SpawnerList.end(); ++itr)
- Spawners.push_back((*itr)->GetGUID());
-
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
- break;
- }
- default:
- break;
- }
- }
- }
- else
+ if (!UpdateVictim())
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
{
- while (uint32 eventId = events.ExecuteEvent())
+ switch (eventId)
{
- switch (eventId)
+ case EVENT_INITIALIZE_SPAWNERS:
{
- case EVENT_SET_CHANNELERS_SPAWNERS:
- {
- for (GuidList::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- if (Creature* Channeler = ObjectAccessor::GetCreature(*me, *itr))
- Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- for (GuidList::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
- if (Creature* Spawner = ObjectAccessor::GetCreature(*me, *itr))
- Spawner->AI()->DoAction(ACTION_START_SPAWNING);
- break;
- }
- case EVENT_START_ATTACK_AKAMA:
- me->GetMotionMaster()->MovePoint(0, ShadeWP.x, ShadeWP.y, ShadeWP.z, false);
- events.ScheduleEvent(EVENT_START_ATTACK_AKAMA, 1000);
- break;
- case EVENT_ADD_THREAT:
- DoCast(SPELL_THREAT);
- events.ScheduleEvent(EVENT_ADD_THREAT, 3500);
- break;
- default:
- break;
- }
- }
+ std::list<Creature*> SpawnerList;
+ me->GetCreatureListWithEntryInGrid(SpawnerList, NPC_CREATURE_SPAWNER_AKAMA);
+ for (Creature* spawner : SpawnerList)
+ _spawners.push_back(spawner->GetGUID());
- if (HasKilledAkama)
- {
- if (!HasKilledAkamaAndReseting)
- {
- HasKilledAkamaAndReseting = true;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- instance->SetBossState(DATA_SHADE_OF_AKAMA, NOT_STARTED);
- me->RemoveAllAurasExceptType(SPELL_AURA_DUMMY);
- me->DeleteThreatList();
- me->CombatStop();
- me->GetMotionMaster()->MoveTargetedHome();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- combatStarted = false;
-
- if (Creature* Akama = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
- Akama->DespawnOrUnsummon();
-
- for (GuidList::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- if (Creature* Channeler = ObjectAccessor::GetCreature(*me, *itr))
- Channeler->DespawnOrUnsummon();
-
- for (GuidList::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
- if (Creature* Spawner = ObjectAccessor::GetCreature(*me, *itr))
- Spawner->AI()->DoAction(ACTION_DESPAWN_ALL_SPAWNS);
-
- events.ScheduleEvent(EVENT_FIND_CHANNELERS_SPAWNERS, 10000);
- events.ScheduleEvent(EVENT_RESET_ENCOUNTER, 20000);
+ break;
}
- }
-
- if (!akamaReached)
- {
- if (Creature* Akama = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
+ case EVENT_START_CHANNELERS_AND_SPAWNERS:
{
- if (me->IsWithinDist(Akama, 2.0f, false))
- {
- akamaReached = true;
- me->GetMotionMaster()->Clear(true);
- me->GetMotionMaster()->MoveIdle();
- me->SetWalk(false);
+ for (ObjectGuid const& summonGuid : summons)
+ if (Creature* channeler = ObjectAccessor::GetCreature(*me, summonGuid))
+ channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ for (ObjectGuid const& spawnerGuid : _spawners)
+ if (Creature* spawner = ObjectAccessor::GetCreature(*me, spawnerGuid))
+ spawner->AI()->DoAction(ACTION_START_SPAWNING);
- events.CancelEvent(EVENT_START_ATTACK_AKAMA);
- events.ScheduleEvent(EVENT_ADD_THREAT, 100);
-
- for (GuidList::const_iterator itr = Spawners.begin(); itr != Spawners.end(); ++itr)
- if (Creature* Spawner = ObjectAccessor::GetCreature(*me, *itr))
- Spawner->AI()->DoAction(ACTION_STOP_SPAWNING);
- }
+ break;
}
+ case EVENT_ADD_THREAT:
+ DoCast(SPELL_THREAT);
+ events.Repeat(Seconds(3) + Milliseconds(500));
+ break;
+ case EVENT_EVADE_CHECK:
+ EnterEvadeModeIfNeeded();
+ events.Repeat(Seconds(10));
+ break;
+ default:
+ break;
}
- else
- DoMeleeAttackIfReady();
}
+
+ DoMeleeAttackIfReady();
}
- public:
- bool HasKilledAkama;
private:
- GuidList Channelers;
- GuidList Spawners;
- bool akamaReached;
- bool combatStarted;
- bool HasKilledAkamaAndReseting;
+ GuidVector _spawners;
+ bool _isInPhaseOne;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -395,10 +355,6 @@ public:
}
};
-// ########################################################
-// Akama
-// ########################################################
-
class npc_akama_shade : public CreatureScript
{
public:
@@ -406,117 +362,188 @@ public:
struct npc_akamaAI : public ScriptedAI
{
- npc_akamaAI(Creature* creature) : ScriptedAI(creature)
+ npc_akamaAI(Creature* creature) : ScriptedAI(creature), _summons(me)
{
Initialize();
- instance = creature->GetInstanceScript();
+ _instance = creature->GetInstanceScript();
}
void Initialize()
{
- StartChannel = false;
- StartCombat = false;
- HasYelledOnce = false;
- ShadeHasDied = false;
+ _isInCombat = false;
+ _hasYelledOnce = false;
+ _chosen.Clear();
+ _summons.DespawnAll();
+ _events.Reset();
}
void Reset() override
{
- me->setFaction(FACTION_FRIENDLY);
- DoCast(me, SPELL_STEALTH);
Initialize();
+ me->setFaction(FACTION_FRIENDLY);
+ DoCastSelf(SPELL_STEALTH);
- if (instance->GetBossState(DATA_SHADE_OF_AKAMA) != DONE)
+ if (_instance->GetBossState(DATA_SHADE_OF_AKAMA) != DONE)
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
- void JustDied(Unit* /*killer*/) override
+ void JustSummoned(Creature* summon) override
{
- if (Creature* Shade = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
- if (Shade->IsAlive())
- ENSURE_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true;
- me->GetMotionMaster()->Clear(true);
- me->GetMotionMaster()->MoveIdle();
+ _summons.Summon(summon);
}
+ void EnterEvadeMode(EvadeReason /*why*/) override { }
+
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
- if (spell->Id == SPELL_THREAT && !StartCombat)
+ if (spell->Id == SPELL_THREAT && !_isInCombat)
{
- me->ClearUnitState(UNIT_STATE_ROOT);
- me->RemoveAura(SPELL_AKAMA_SOUL_CHANNEL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
- if (Creature* Shade = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
- Shade->RemoveAura(SPELL_AKAMA_SOUL_CHANNEL);
- StartCombat = true;
+ _isInCombat = true;
+ me->SetWalk(false);
+ me->RemoveAurasDueToSpell(SPELL_AKAMA_SOUL_CHANNEL);
+ if (Creature* shade = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ {
+ shade->RemoveAurasDueToSpell(SPELL_AKAMA_SOUL_CHANNEL);
+ AttackStart(shade);
+ _events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, Seconds(2));
+ _events.ScheduleEvent(EVENT_DESTRUCTIVE_POISON, Seconds(5));
+ }
}
}
- void EnterCombat(Unit* /*who*/) override
+ void DamageTaken(Unit* /*who*/, uint32& /*damage*/) override
{
- events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 2000);
- events.ScheduleEvent(EVENT_DESTRUCTIVE_POISON, 5000);
+ if (me->HealthBelowPct(20) && !_hasYelledOnce)
+ {
+ _hasYelledOnce = true;
+ Talk(SAY_LOW_HEALTH);
+ }
}
- void UpdateAI(uint32 diff) override
+ void DoAction(int32 actionId) override
{
- if (StartChannel)
+ if (actionId == ACTION_SHADE_OF_AKAMA_DEAD)
{
- events.Update(diff);
+ _isInCombat = false;
+ me->CombatStop(true);
+ me->setFaction(FACTION_FRIENDLY);
+ me->SetWalk(true);
+ _events.Reset();
+ me->GetMotionMaster()->MovePoint(AKAMA_INTRO_WAYPOINT, AkamaWP[1]);
+ }
+ }
- while (uint32 eventId = events.ExecuteEvent())
+ void MovementInform(uint32 motionType, uint32 pointId) override
+ {
+ if (motionType != POINT_MOTION_TYPE)
+ return;
+
+ if (pointId == AKAMA_CHANNEL_WAYPOINT)
+ _events.ScheduleEvent(EVENT_SHADE_CHANNEL, Seconds(1));
+
+ else if (pointId == AKAMA_INTRO_WAYPOINT)
+ {
+ me->SetWalk(false);
+ me->SetFacingTo(0.08726646f);
+ _events.ScheduleEvent(EVENT_START_SOUL_EXPEL, Seconds(1));
+ }
+ }
+
+ void SummonBrokens()
+ {
+ for (uint8 i = 0; i < 18; i++)
+ {
+ if (TempSummon* summoned = me->SummonCreature(NPC_ASHTONGUE_BROKEN, BrokenPos[i]))
{
- switch (eventId)
- {
- case EVENT_SHADE_START:
- instance->SetBossState(DATA_SHADE_OF_AKAMA, IN_PROGRESS);
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- me->RemoveAura(SPELL_STEALTH);
- me->SetWalk(true);
- me->GetMotionMaster()->MovePoint(0, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z, false);
- events.ScheduleEvent(EVENT_SHADE_CHANNEL, 10000);
- break;
- case EVENT_SHADE_CHANNEL:
- me->AddUnitState(UNIT_STATE_ROOT);
- me->SetFacingTo(3.118662f);
- DoCast(me, SPELL_AKAMA_SOUL_CHANNEL);
- me->setFaction(FACTION_COMBAT);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
- events.ScheduleEvent(EVENT_FIXATE, 5000);
- break;
- case EVENT_FIXATE:
- DoCast(SPELL_FIXATE);
- StartChannel = false;
- break;
- default:
- break;
- }
+ summoned->SetWalk(true);
+ summoned->GetMotionMaster()->MovePoint(0, BrokenWP[i]);
+ if (i == 9) //On Sniffs, npc that Yell "Special" is the tenth to be created
+ _chosen = summoned->GetGUID();
}
}
+ }
- if (!UpdateVictim())
- return;
-
- events.Update(diff);
+ void UpdateAI(uint32 diff) override
+ {
+ _events.Update(diff);
- while (uint32 eventId = events.ExecuteEvent())
+ while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
+ case EVENT_SHADE_START:
+ _instance->SetBossState(DATA_SHADE_OF_AKAMA, IN_PROGRESS);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->RemoveAurasDueToSpell(SPELL_STEALTH);
+ me->SetWalk(true);
+ me->GetMotionMaster()->MovePoint(AKAMA_CHANNEL_WAYPOINT, AkamaWP[0], false);
+ break;
+ case EVENT_SHADE_CHANNEL:
+ me->SetFacingTo(3.118662f);
+ DoCastSelf(SPELL_AKAMA_SOUL_CHANNEL);
+ me->setFaction(FACTION_COMBAT);
+ _events.ScheduleEvent(EVENT_FIXATE, Seconds(5));
+ break;
+ case EVENT_FIXATE:
+ DoCast(SPELL_FIXATE);
+ break;
case EVENT_CHAIN_LIGHTNING:
DoCastVictim(SPELL_CHAIN_LIGHTNING);
- events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, urand(10000, 15000));
+ _events.Repeat(randtime(Seconds(8), Seconds(15)));
break;
case EVENT_DESTRUCTIVE_POISON:
- DoCast(me, SPELL_DESTRUCTIVE_POISON);
- events.ScheduleEvent(EVENT_DESTRUCTIVE_POISON, urand(4000, 5000));
+ DoCastSelf(SPELL_DESTRUCTIVE_POISON);
+ _events.Repeat(randtime(Seconds(3), Seconds(7)));
+ break;
+ case EVENT_START_SOUL_EXPEL:
+ DoCast(SPELL_AKAMA_SOUL_EXPEL);
+ _events.ScheduleEvent(EVENT_START_BROKEN_FREE, Seconds(15));
+ break;
+ case EVENT_START_BROKEN_FREE:
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
+ Talk(SAY_BROKEN_FREE_0);
+ SummonBrokens();
+ _events.ScheduleEvent(EVENT_BROKEN_FREE_1, Seconds(10));
+ break;
+ case EVENT_BROKEN_FREE_1:
+ Talk(SAY_BROKEN_FREE_1);
+ _events.ScheduleEvent(EVENT_BROKEN_FREE_2, Seconds(12));
+ break;
+ case EVENT_BROKEN_FREE_2:
+ Talk(SAY_BROKEN_FREE_2);
+ _events.ScheduleEvent(EVENT_BROKEN_FREE_3, Seconds(15));
+ break;
+ case EVENT_BROKEN_FREE_3:
+ if (Creature* special = ObjectAccessor::GetCreature(*me, _chosen))
+ special->AI()->Talk(SAY_BROKEN_SPECIAL);
+
+ _summons.DoAction(ACTION_BROKEN_EMOTE, _pred);
+ _events.ScheduleEvent(EVENT_BROKEN_FREE_4, Seconds(5));
+ break;
+ case EVENT_BROKEN_FREE_4:
+ _summons.DoAction(ACTION_BROKEN_HAIL, _pred);
break;
default:
break;
}
}
- DoMeleeAttackIfReady();
+ if (me->getFaction() == FACTION_COMBAT)
+ {
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+ }
+
+ void JustDied(Unit* /*killer*/) override
+ {
+ _summons.DespawnAll();
+ Talk(SAY_DEAD);
+ if (Creature* shade = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ if (shade->IsAlive())
+ shade->AI()->EnterEvadeMode(EVADE_REASON_OTHER);
}
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
@@ -524,19 +551,18 @@ public:
if (gossipListId == 0)
{
player->CLOSE_GOSSIP_MENU();
- StartChannel = true;
- events.ScheduleEvent(EVENT_SHADE_START, 500);
+ _events.ScheduleEvent(EVENT_SHADE_START, Milliseconds(500));
}
}
private:
- InstanceScript* instance;
- EventMap events;
- bool StartChannel;
- bool ShadeHasDied;
- bool StartCombat;
- bool HasYelledOnce;
-
+ InstanceScript* _instance;
+ EventMap _events;
+ SummonList _summons;
+ DummyEntryCheckPredicate _pred;
+ ObjectGuid _chosen; //Creature that should yell the speech special.
+ bool _isInCombat;
+ bool _hasYelledOnce;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -545,70 +571,44 @@ public:
}
};
-// ########################################################
-// Ashtongue Channeler
-// ########################################################
-
class npc_ashtongue_channeler : public CreatureScript
{
public:
npc_ashtongue_channeler() : CreatureScript("npc_ashtongue_channeler") { }
- struct npc_ashtongue_channelerAI : public ScriptedAI
+ struct npc_ashtongue_channelerAI : public PassiveAI
{
- npc_ashtongue_channelerAI(Creature* creature) : ScriptedAI(creature)
+ npc_ashtongue_channelerAI(Creature* creature) : PassiveAI(creature)
{
- instance = creature->GetInstanceScript();
+ _instance = creature->GetInstanceScript();
}
void Reset() override
{
- me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
- me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
+ _scheduler.Schedule(Seconds(2), [this](TaskContext channel)
+ {
+ if (Creature* shade = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ {
+ if (shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
+ DoCastSelf(SPELL_SHADE_SOUL_CHANNEL);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- events.ScheduleEvent(EVENT_CHANNEL, 2000);
- }
+ else
+ me->DespawnOrUnsummon(Seconds(3));
+ }
- void JustDied(Unit* /*killer*/) override
- {
- if (Creature* Shade = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
- Shade->AI()->DoAction(ACTION_CHANNELER_DIED);
+ channel.Repeat(Seconds(2));
+ });
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
- void EnterCombat(Unit* /*who*/) override { }
- void AttackStart(Unit* /*who*/) override { }
-
void UpdateAI(uint32 diff) override
{
- events.Update(diff);
-
- while (uint32 eventId = events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_CHANNEL:
- if (Creature* Shade = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
- {
- if (Shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
- DoCast(me, SPELL_SHADE_SOUL_CHANNEL);
- else
- {
- me->InterruptSpell(CURRENT_CHANNELED_SPELL);
- Shade->AI()->DoAction(ACTION_CHANNELER_DIED);
- }
- }
- events.ScheduleEvent(EVENT_CHANNEL, 2000);
- break;
- default:
- break;
- }
- }
+ _scheduler.Update(diff);
}
private:
- InstanceScript* instance;
- EventMap events;
+ InstanceScript* _instance;
+ TaskScheduler _scheduler;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -617,10 +617,6 @@ public:
}
};
-// ########################################################
-// Creature Generator Akama
-// ########################################################
-
class npc_creature_generator_akama : public CreatureScript
{
public:
@@ -628,57 +624,53 @@ public:
struct npc_creature_generator_akamaAI : public ScriptedAI
{
- npc_creature_generator_akamaAI(Creature* creature) : ScriptedAI(creature), Summons(me)
+ npc_creature_generator_akamaAI(Creature* creature) : ScriptedAI(creature), _summons(me)
{
Initialize();
- instance = creature->GetInstanceScript();
}
void Initialize()
{
- doSpawning = false;
- leftSide = false;
+ _leftSide = false;
+ _events.Reset();
+ _summons.DespawnAll();
}
void Reset() override
{
- Summons.DespawnAll();
-
Initialize();
- if (me->GetPositionY() < 400.0f)
- leftSide = true;
+ if (me->GetPositionY() < MIDDLE_OF_ROOM)
+ _leftSide = true;
}
void JustSummoned(Creature* summon) override
{
- Summons.Summon(summon);
+ _summons.Summon(summon);
}
void DoAction(int32 actionId) override
{
- doSpawning = true;
-
switch (actionId)
{
case ACTION_START_SPAWNING:
- if (leftSide)
+ if (_leftSide)
{
- events.ScheduleEvent(EVENT_SPAWN_WAVE_B, 100);
- events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_SORCERER, urand(2000, 5000));
+ _events.ScheduleEvent(EVENT_SPAWN_WAVE_B, Milliseconds(100));
+ _events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_SORCERER, randtime(Seconds(2), Seconds(5)));
}
else
{
- events.ScheduleEvent(EVENT_SPAWN_WAVE_B, 10000);
- events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_DEFENDER, urand(2000, 5000));
+ _events.ScheduleEvent(EVENT_SPAWN_WAVE_B, Seconds(10));
+ _events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_DEFENDER, randtime(Seconds(2), Seconds(5)));
}
break;
case ACTION_STOP_SPAWNING:
- doSpawning = false;
+ _events.Reset();
break;
case ACTION_DESPAWN_ALL_SPAWNS:
- doSpawning = false;
- Summons.DespawnAll();
+ _events.Reset();
+ _summons.DespawnAll();
break;
default:
break;
@@ -687,39 +679,34 @@ public:
void UpdateAI(uint32 diff) override
{
- if (doSpawning)
- {
- events.Update(diff);
+ _events.Update(diff);
- while (uint32 eventId = events.ExecuteEvent())
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
{
- switch (eventId)
- {
- case EVENT_SPAWN_WAVE_B:
- DoCast(me, SPELL_ASHTONGUE_WAVE_B);
- events.ScheduleEvent(EVENT_SPAWN_WAVE_B, urand(45000, 50000));
- break;
- case EVENT_SUMMON_ASHTONGUE_SORCERER: // left
- DoCast(me, SPELL_SUMMON_ASHTONGUE_SORCERER);
- events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_SORCERER, urand(30000, 35000));
- break;
- case EVENT_SUMMON_ASHTONGUE_DEFENDER: // right
- DoCast(me, SPELL_SUMMON_ASHTONGUE_DEFENDER);
- events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_DEFENDER, urand(30000, 35000));
- break;
- default:
- break;
- }
+ case EVENT_SPAWN_WAVE_B:
+ DoCastSelf(SPELL_ASHTONGUE_WAVE_B);
+ _events.Repeat(randtime(Seconds(50), Seconds(60)));
+ break;
+ case EVENT_SUMMON_ASHTONGUE_SORCERER: // left
+ DoCastSelf(SPELL_SUMMON_ASHTONGUE_SORCERER);
+ _events.Repeat(randtime(Seconds(30), Seconds(35)));
+ break;
+ case EVENT_SUMMON_ASHTONGUE_DEFENDER: // right
+ DoCastSelf(SPELL_SUMMON_ASHTONGUE_DEFENDER);
+ _events.Repeat(randtime(Seconds(30), Seconds(40)));
+ break;
+ default:
+ break;
}
}
}
private:
- InstanceScript* instance;
- EventMap events;
- SummonList Summons;
- bool leftSide;
- bool doSpawning;
+ EventMap _events;
+ SummonList _summons;
+ bool _leftSide;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -728,10 +715,6 @@ public:
}
};
-// ########################################################
-// Ashtongue Sorcerer
-// ########################################################
-
class npc_ashtongue_sorcerer : public CreatureScript
{
public:
@@ -742,103 +725,96 @@ public:
npc_ashtongue_sorcererAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
- instance = creature->GetInstanceScript();
+ _instance = creature->GetInstanceScript();
}
void Initialize()
{
- startedBanishing = false;
- switchToCombat = false;
+ _switchToCombat = false;
+ _inBanish = false;
}
void Reset() override
{
- if (!startedBanishing)
+ if (Creature* shade = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
{
- if (Creature* Shade = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ if (shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
+ me->GetMotionMaster()->MovePoint(0, shade->GetPosition());
+
+ else
{
- if (Shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
- me->GetMotionMaster()->MovePoint(0, Shade->GetPositionX(), Shade->GetPositionY(), Shade->GetPositionZ(), false);
- else
- {
- if (Unit* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
- AttackStart(target);
- }
+ if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ AttackStart(akama);
}
}
-
Initialize();
}
void JustDied(Unit* /*killer*/) override
{
- if (Creature* Shade = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
- Shade->AI()->DoAction(ACTION_CHANNELER_DIED);
- me->DespawnOrUnsummon(5000);
+ me->DespawnOrUnsummon(Seconds(5));
}
+ void EnterEvadeMode(EvadeReason /*why*/) override { }
void EnterCombat(Unit* /*who*/) override { }
void AttackStart(Unit* who) override
{
- if (!switchToCombat)
+ if (!_switchToCombat)
return;
+
ScriptedAI::AttackStart(who);
}
- void UpdateAI(uint32 diff) override
+ void MoveInLineOfSight(Unit* who) override
{
- events.Update(diff);
-
- while (uint32 eventId = events.ExecuteEvent())
+ if (!_inBanish && who->GetGUID() == _instance->GetGuidData(DATA_SHADE_OF_AKAMA) && me->IsWithinDist(who, 20.0f, false))
{
- switch (eventId)
+ _inBanish = true;
+ me->StopMoving();
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MovePoint(1, me->GetPositionX() + frand(-8.0f, 8.0f), me->GetPositionY() + frand(-8.0f, 8.0f), me->GetPositionZ());
+
+ _scheduler.Schedule(Seconds(1) + Milliseconds(500), [this](TaskContext sorcer_channel)
{
- case EVENT_SORCERER_CHANNEL:
- if (Creature* Shade = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ if (Creature* shade = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ {
+ if (shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
{
- if (Shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
- {
- me->SetFacingToObject(Shade);
- DoCast(me, SPELL_SHADE_SOUL_CHANNEL);
- events.ScheduleEvent(EVENT_SORCERER_CHANNEL, 2000);
- }
- else
- {
- me->InterruptSpell(CURRENT_CHANNELED_SPELL);
- Shade->AI()->DoAction(ACTION_CHANNELER_DIED);
- switchToCombat = true;
- if (Unit* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
- AttackStart(target);
- }
+ me->SetFacingToObject(shade);
+ DoCastSelf(SPELL_SHADE_SOUL_CHANNEL);
+ sorcer_channel.Repeat(Seconds(2));
}
- break;
- default:
- break;
- }
+ else
+ {
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ _switchToCombat = true;
+ if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ AttackStart(akama);
+ }
+ }
+ });
}
+ }
- if (!startedBanishing)
- {
- Creature* Shade = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SHADE_OF_AKAMA));
- if (me->IsWithinDist(Shade, 20.0f, false))
- {
- me->StopMoving();
- me->GetMotionMaster()->Clear(false);
- me->GetMotionMaster()->MovePoint(1, me->GetPositionX() + frand (-8.0f, 8.0f), me->GetPositionY() + frand (-8.0f, 8.0f), me->GetPositionZ(), false);
- events.ScheduleEvent(EVENT_SORCERER_CHANNEL, 1500);
- startedBanishing = true;
- }
- }
+ void UpdateAI(uint32 diff) override
+ {
+ _scheduler.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ if (!UpdateVictim())
+ return;
DoMeleeAttackIfReady();
}
private:
- InstanceScript* instance;
- EventMap events;
- bool startedBanishing;
- bool switchToCombat;
+ InstanceScript* _instance;
+ TaskScheduler _scheduler;
+ bool _switchToCombat;
+ bool _inBanish;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -847,10 +823,6 @@ public:
}
};
-// ########################################################
-// Ashtongue Defender
-// ########################################################
-
class npc_ashtongue_defender : public CreatureScript
{
public:
@@ -860,54 +832,55 @@ public:
{
npc_ashtongue_defenderAI(Creature* creature) : ScriptedAI(creature)
{
- instance = creature->GetInstanceScript();
+ _instance = creature->GetInstanceScript();
}
void Reset() override
{
- if (Unit* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
- AttackStart(target);
+ if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ AttackStart(akama);
}
void JustDied(Unit* /*killer*/) override
{
- me->DespawnOrUnsummon(5000);
+ me->DespawnOrUnsummon(Seconds(5));
}
void EnterCombat(Unit* /*who*/) override
{
- events.ScheduleEvent(EVENT_HEROIC_STRIKE, 5000);
- events.ScheduleEvent(EVENT_SHIELD_BASH, urand(10000, 16000));
- events.ScheduleEvent(EVENT_DEBILITATING_STRIKE, urand(10000, 16000));
- events.ScheduleEvent(EVENT_WINDFURY, urand(8000, 12000));
+ _events.ScheduleEvent(EVENT_HEROIC_STRIKE, Seconds(5));
+ _events.ScheduleEvent(EVENT_SHIELD_BASH, randtime(Seconds(10), Seconds(16)));
+ _events.ScheduleEvent(EVENT_DEBILITATING_STRIKE, randtime(Seconds(10), Seconds(16)));
+ _events.ScheduleEvent(EVENT_WINDFURY, randtime(Seconds(8), Seconds(12)));
}
+
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
- events.Update(diff);
+ _events.Update(diff);
- while (uint32 eventId = events.ExecuteEvent())
+ while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_DEBILITATING_STRIKE:
DoCastVictim(SPELL_DEBILITATING_STRIKE);
- events.ScheduleEvent(EVENT_DEBILITATING_STRIKE, urand(8000, 16000));
+ _events.Repeat(randtime(Seconds(20), Seconds(25)));
break;
case EVENT_HEROIC_STRIKE:
- DoCast(me, SPELL_HEROIC_STRIKE);
- events.ScheduleEvent(EVENT_HEROIC_STRIKE, urand(50000, 60000));
+ DoCastSelf(SPELL_HEROIC_STRIKE);
+ _events.Repeat(randtime(Seconds(5), Seconds(15)));
break;
case EVENT_SHIELD_BASH:
DoCastVictim(SPELL_SHIELD_BASH);
- events.ScheduleEvent(EVENT_SHIELD_BASH, urand(8000, 16000));
+ _events.Repeat(randtime(Seconds(10), Seconds(20)));
break;
case EVENT_WINDFURY:
DoCastVictim(SPELL_WINDFURY);
- events.ScheduleEvent(EVENT_WINDFURY, urand(6000 , 8000));
+ _events.Repeat(randtime(Seconds(6), Seconds(8)));
break;
default:
break;
@@ -918,8 +891,8 @@ public:
}
private:
- InstanceScript* instance;
- EventMap events;
+ InstanceScript* _instance;
+ EventMap _events;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -928,10 +901,6 @@ public:
}
};
-// ########################################################
-// Ashtongue Rogue
-// ########################################################
-
class npc_ashtongue_rogue : public CreatureScript
{
public:
@@ -941,44 +910,46 @@ public:
{
npc_ashtongue_rogueAI(Creature* creature) : ScriptedAI(creature)
{
- instance = creature->GetInstanceScript();
+ _instance = creature->GetInstanceScript();
}
void Reset() override
{
- if (Unit* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
- AttackStart(target);
+ if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ AttackStart(akama);
}
void JustDied(Unit* /*killer*/) override
{
- me->DespawnOrUnsummon(5000);
+ me->DespawnOrUnsummon(Seconds(5));
}
void EnterCombat(Unit* /*who*/) override
{
- events.ScheduleEvent(EVENT_DEBILITATING_POISON, urand(500, 2000));
- events.ScheduleEvent(EVENT_EVISCERATE, urand(2000, 5000));
+ _events.ScheduleEvent(EVENT_DEBILITATING_POISON, randtime(Milliseconds(500), Seconds(2)));
+ _events.ScheduleEvent(EVENT_EVISCERATE, randtime(Seconds(2), Seconds(5)));
}
+ void EnterEvadeMode(EvadeReason /*why*/) override { }
+
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
- events.Update(diff);
+ _events.Update(diff);
- while (uint32 eventId = events.ExecuteEvent())
+ while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_DEBILITATING_POISON:
DoCastVictim(SPELL_DEBILITATING_POISON);
- events.ScheduleEvent(EVENT_DEBILITATING_POISON, urand(14000, 18000));
+ _events.Repeat(randtime(Seconds(15), Seconds(20)));
break;
case EVENT_EVISCERATE:
DoCastVictim(SPELL_EVISCERATE);
- events.ScheduleEvent(EVENT_EVISCERATE, urand(12000, 16000));
+ _events.Repeat(randtime(Seconds(12), Seconds(20)));
break;
default:
break;
@@ -989,8 +960,8 @@ public:
}
private:
- InstanceScript* instance;
- EventMap events;
+ InstanceScript* _instance;
+ EventMap _events;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -999,10 +970,6 @@ public:
}
};
-// ########################################################
-// Ashtongue Elementalist
-// ########################################################
-
class npc_ashtongue_elementalist : public CreatureScript
{
public:
@@ -1012,44 +979,46 @@ public:
{
npc_ashtongue_elementalistAI(Creature* creature) : ScriptedAI(creature)
{
- instance = creature->GetInstanceScript();
+ _instance = creature->GetInstanceScript();
}
void Reset() override
{
- if (Unit* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
- AttackStart(target);
+ if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ AttackStart(akama);
}
void JustDied(Unit* /*killer*/) override
{
- me->DespawnOrUnsummon(5000);
+ me->DespawnOrUnsummon(Seconds(5));
}
void EnterCombat(Unit* /*who*/) override
{
- events.ScheduleEvent(EVENT_RAIN_OF_FIRE, 18000);
- events.ScheduleEvent(EVENT_LIGHTNING_BOLT, 6000);
+ _events.ScheduleEvent(EVENT_RAIN_OF_FIRE, Seconds(18));
+ _events.ScheduleEvent(EVENT_LIGHTNING_BOLT, Seconds(6));
}
+ void EnterEvadeMode(EvadeReason /*why*/) override { }
+
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
- events.Update(diff);
+ _events.Update(diff);
- while (uint32 eventId = events.ExecuteEvent())
+ while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_RAIN_OF_FIRE:
DoCastVictim(SPELL_RAIN_OF_FIRE);
- events.ScheduleEvent(EVENT_RAIN_OF_FIRE, 20000);
+ _events.Repeat(randtime(Seconds(15), Seconds(20)));
break;
case EVENT_LIGHTNING_BOLT:
DoCastVictim(SPELL_LIGHTNING_BOLT);
- events.ScheduleEvent(EVENT_LIGHTNING_BOLT, 15000);
+ _events.Repeat(randtime(Seconds(8), Seconds(15)));
break;
default:
break;
@@ -1060,8 +1029,8 @@ public:
}
private:
- InstanceScript* instance;
- EventMap events;
+ InstanceScript* _instance;
+ EventMap _events;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -1070,10 +1039,6 @@ public:
}
};
-// ########################################################
-// Ashtongue Spiritbinder
-// ########################################################
-
class npc_ashtongue_spiritbinder : public CreatureScript
{
public:
@@ -1084,44 +1049,72 @@ public:
npc_ashtongue_spiritbinderAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
- instance = creature->GetInstanceScript();
+ _instance = creature->GetInstanceScript();
}
void Initialize()
{
- spiritMend = false;
- chainHeal = false;
+ _spiritMend = false;
+ _chainHeal = false;
}
void Reset() override
{
Initialize();
- if (Unit* target = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
- AttackStart(target);
+ if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ AttackStart(akama);
}
void JustDied(Unit* /*killer*/) override
{
- me->DespawnOrUnsummon(5000);
+ me->DespawnOrUnsummon(Seconds(5));
}
void EnterCombat(Unit* /*who*/) override
{
- events.ScheduleEvent(EVENT_SPIRIT_HEAL, urand (5000, 6000));
+ _events.ScheduleEvent(EVENT_SPIRIT_HEAL, randtime(Seconds(5), Seconds(6)));
}
+ void DamageTaken(Unit* /*who*/, uint32& /*damage*/) override
+ {
+ if (!_spiritMend)
+ if (HealthBelowPct(30))
+ {
+ DoCastSelf(SPELL_SPIRIT_MEND);
+ _spiritMend = true;
+ _events.ScheduleEvent(EVENT_SPIRIT_MEND_RESET, randtime(Seconds(10),Seconds(15)));
+ }
+
+ if (!_chainHeal)
+ if (HealthBelowPct(50))
+ {
+ DoCastSelf(SPELL_CHAIN_HEAL);
+ _chainHeal = true;
+ _events.ScheduleEvent(EVENT_CHAIN_HEAL_RESET, randtime(Seconds(10), Seconds(15)));
+ }
+
+ }
+
+ void EnterEvadeMode(EvadeReason /*why*/) override { }
+
void UpdateAI(uint32 diff) override
{
- events.Update(diff);
+ _events.Update(diff);
- while (uint32 eventId = events.ExecuteEvent())
+ while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SPIRIT_HEAL:
- DoCast(me, SPELL_SPIRITBINDER_SPIRIT_HEAL);
- events.ScheduleEvent(EVENT_SPIRIT_HEAL, urand (13000, 16000));
+ DoCastSelf(SPELL_SPIRITBINDER_SPIRIT_HEAL);
+ _events.Repeat(randtime(Seconds(13), Seconds(16)));
+ break;
+ case EVENT_SPIRIT_MEND_RESET:
+ _spiritMend = false;
+ break;
+ case EVENT_CHAIN_HEAL_RESET:
+ _chainHeal = false;
break;
default:
break;
@@ -1131,32 +1124,14 @@ public:
if (!UpdateVictim())
return;
- if (!spiritMend)
- {
- if (HealthBelowPct(25))
- {
- DoCast(me, SPELL_SPIRIT_MEND);
- spiritMend = true;
- }
- }
-
- if (!chainHeal)
- {
- if (HealthBelowPct(40))
- {
- DoCast(me, SPELL_CHAIN_HEAL);
- chainHeal = true;
- }
- }
-
DoMeleeAttackIfReady();
}
private:
- InstanceScript* instance;
- EventMap events;
- bool spiritMend;
- bool chainHeal;
+ InstanceScript* _instance;
+ EventMap _events;
+ bool _spiritMend;
+ bool _chainHeal;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -1165,6 +1140,119 @@ public:
}
};
+class npc_ashtongue_broken : public CreatureScript
+{
+public:
+ npc_ashtongue_broken() : CreatureScript("npc_ashtongue_broken") { }
+
+ struct npc_ashtongue_brokenAI : public ScriptedAI
+ {
+ npc_ashtongue_brokenAI(Creature* creature) : ScriptedAI(creature)
+ {
+ _instance = me->GetInstanceScript();
+ }
+
+ void MovementInform(uint32 motionType, uint32 /*pointId*/) override
+ {
+ if (motionType != POINT_MOTION_TYPE)
+ return;
+
+ if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ me->SetFacingToObject(akama);
+ }
+
+ void DoAction(int32 actionId) override
+ {
+ switch (actionId)
+ {
+ case ACTION_BROKEN_SPECIAL:
+ Talk(SAY_BROKEN_SPECIAL);
+ break;
+ case ACTION_BROKEN_HAIL:
+ me->setFaction(FACTION_FRIENDLY);
+ Talk(SAY_BROKEN_HAIL);
+ break;
+ case ACTION_BROKEN_EMOTE:
+ me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_KNEEL);
+ break;
+ default:
+ break;
+ }
+ }
+
+ private:
+ InstanceScript* _instance;
+ };
+
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetInstanceAI<npc_ashtongue_brokenAI>(creature);
+ }
+};
+
+class spell_shade_soul_channel_serverside : public SpellScriptLoader
+{
+public:
+ spell_shade_soul_channel_serverside() : SpellScriptLoader("spell_shade_soul_channel_serverside") { }
+
+ class spell_shade_soul_channel_serverside_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_shade_soul_channel_serverside_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SHADE_SOUL_CHANNEL_2))
+ return false;
+ return true;
+ }
+
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2);
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_shade_soul_channel_serverside_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_shade_soul_channel_serverside_AuraScript();
+ }
+};
+
+class spell_shade_soul_channel : public SpellScriptLoader
+{
+public:
+ spell_shade_soul_channel() : SpellScriptLoader("spell_shade_soul_channel") { }
+
+ class spell_shade_soul_channel_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_shade_soul_channel_AuraScript);
+
+ void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ int32 const maxSlowEff = -99;
+ if (aurEff->GetAmount() < maxSlowEff)
+ if (AuraEffect* slowEff = GetEffect(EFFECT_0))
+ slowEff->ChangeAmount(maxSlowEff);
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_shade_soul_channel_AuraScript::OnApply, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_shade_soul_channel_AuraScript();
+ }
+};
+
void AddSC_boss_shade_of_akama()
{
new boss_shade_of_akama();
@@ -1176,4 +1264,7 @@ void AddSC_boss_shade_of_akama()
new npc_ashtongue_rogue();
new npc_ashtongue_elementalist();
new npc_ashtongue_spiritbinder();
+ new npc_ashtongue_broken();
+ new spell_shade_soul_channel_serverside();
+ new spell_shade_soul_channel();
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
index ae4d17bdad4..0999f1fcd6b 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp
@@ -117,7 +117,7 @@ public:
DummyEntryCheckPredicate pred;
summons.DoAction(EVENT_VOLCANO, pred);
events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE);
- me->SetSpeed(MOVE_RUN, 1.2f);
+ me->SetSpeedRate(MOVE_RUN, 1.2f);
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
}
@@ -126,7 +126,7 @@ public:
phase = PHASE_CHASE;
events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE);
events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE);
- me->SetSpeed(MOVE_RUN, 0.9f);
+ me->SetSpeedRate(MOVE_RUN, 0.9f);
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
index 72eb99bd7dc..56d333b2dda 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp
@@ -91,7 +91,7 @@ public:
void Despawn()
{
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
me->RemoveCorpse();
}
@@ -218,7 +218,7 @@ public:
{
Creature* Teron = (ObjectAccessor::GetCreature((*me), TeronGUID));
if (!Teron || !Teron->IsAlive() || Teron->IsInEvadeMode())
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
CheckTeronTimer = 5000;
} else CheckTeronTimer -= diff;
@@ -236,9 +236,9 @@ public:
return GetInstanceAI<boss_teron_gorefiendAI>(creature);
}
- struct boss_teron_gorefiendAI : public ScriptedAI
+ struct boss_teron_gorefiendAI : public BossAI
{
- boss_teron_gorefiendAI(Creature* creature) : ScriptedAI(creature)
+ boss_teron_gorefiendAI(Creature* creature) : BossAI(creature, DATA_TERON_GOREFIEND)
{
Initialize();
instance = creature->GetInstanceScript();
@@ -277,8 +277,7 @@ public:
void Reset() override
{
- instance->SetBossState(DATA_TERON_GOREFIEND, NOT_STARTED);
-
+ _Reset();
Initialize();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -316,9 +315,8 @@ public:
void JustDied(Unit* /*killer*/) override
{
- instance->SetBossState(DATA_TERON_GOREFIEND, DONE);
-
Talk(SAY_DEATH);
+ _JustDied();
}
float CalculateRandomLocation(float Loc, uint32 radius)
@@ -363,7 +361,7 @@ public:
/** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/
/************************************************************************/
- Unit* ghost = NULL;
+ Unit* ghost = nullptr;
if (GhostGUID)
ghost = ObjectAccessor::GetUnit(*me, GhostGUID);
if (ghost && ghost->IsAlive() && ghost->HasAura(SPELL_SHADOW_OF_DEATH))
@@ -379,7 +377,7 @@ public:
}*/
for (uint8 i = 0; i < 4; ++i)
{
- Creature* Construct = NULL;
+ Creature* Construct = nullptr;
float X = CalculateRandomLocation(ghost->GetPositionX(), 10);
float Y = CalculateRandomLocation(ghost->GetPositionY(), 10);
Construct = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
@@ -435,17 +433,13 @@ public:
for (uint8 i = 0; i < 2; ++i)
{
- Creature* Shadow = NULL;
float X = CalculateRandomLocation(me->GetPositionX(), 10);
- Shadow = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0);
- if (Shadow)
+ if (Creature* shadow = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0))
{
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
- if (!target)
- target = me->GetVictim();
-
- if (target)
- Shadow->AI()->AttackStart(target);
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
+ shadow->AI()->AttackStart(target);
+ else if (Unit* victim = me->GetVictim())
+ shadow->AI()->AttackStart(victim);
}
}
SummonShadowsTimer = 60000;
diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
index 9b33ea88ca7..b9627856ae6 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp
@@ -150,7 +150,7 @@ public:
DoCast(target, SPELL_IMPALING_SPINE, true);
SpineTargetGUID = target->GetGUID();
//must let target summon, otherwise you cannot click the spine
- target->SummonGameObject(GO_NAJENTUS_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 30);
+ target->SummonGameObject(GO_NAJENTUS_SPINE, *target, G3D::Quat(), 30);
Talk(SAY_NEEDLE);
events.DelayEvents(1500, GCD_CAST);
events.DelayEvents(15000, GCD_YELL);
diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
index d883a48b630..06b492e32d7 100644
--- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
+++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp
@@ -90,8 +90,6 @@ enum IllidariCouncil
SPELL_BERSERK = 45078
};
-#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly."
-
struct CouncilYells
{
int32 entry;
@@ -165,7 +163,7 @@ public:
Council[1] = instance->GetGuidData(DATA_VERAS_DARKSHADOW);
Council[2] = instance->GetGuidData(DATA_LADY_MALANDE);
Council[3] = instance->GetGuidData(DATA_HIGH_NETHERMANCER_ZEREVOR);
- } else TC_LOG_ERROR("scripts", ERROR_INST_DATA);
+ }
}
void EnterCombat(Unit* /*who*/) override { }
@@ -231,6 +229,7 @@ public:
{
Initialize();
instance = creature->GetInstanceScript();
+ SetBoundary(instance->GetBossBoundary(DATA_ILLIDARI_COUNCIL));
}
void Initialize()
@@ -257,7 +256,7 @@ public:
{
Initialize();
- Creature* pMember = NULL;
+ Creature* pMember = nullptr;
for (uint8 i = 0; i < 4; ++i)
{
pMember = ObjectAccessor::GetCreature((*me), Council[i]);
@@ -330,16 +329,16 @@ public:
if (DeathCount > 3)
{
if (Creature* VoiceTrigger = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_BLOOD_ELF_COUNCIL_VOICE)))
- VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
instance->SetBossState(DATA_ILLIDARI_COUNCIL, DONE);
//me->SummonCreature(AKAMAID, 746.466980f, 304.394989f, 311.90208f, 6.272870f, TEMPSUMMON_DEAD_DESPAWN, 0);
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ me->DealDamage(me, me->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
return;
}
Creature* pMember = (ObjectAccessor::GetCreature(*me, Council[DeathCount]));
if (pMember && pMember->IsAlive())
- pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ pMember->DealDamage(pMember, pMember->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
++DeathCount;
EndEventTimer = 1500;
} else EndEventTimer -= diff;
@@ -922,7 +921,7 @@ public:
if (dmgInfo.GetAttacker() == target)
return;
int32 bp = absorbAmount / 2;
- target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_REFLECTIVE_SHIELD_T, &bp, NULL, NULL, true, NULL, aurEff);
+ target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_REFLECTIVE_SHIELD_T, &bp, nullptr, nullptr, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
index 86ad7958957..bac996918ac 100644
--- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
@@ -35,6 +35,20 @@ DoorData const doorData[] =
{ 0, 0, DOOR_TYPE_ROOM } // END
};
+BossBoundaryData const boundaries =
+{
+ { DATA_HIGH_WARLORD_NAJENTUS, new RectangleBoundary(394.0f, 479.4f, 707.8f, 859.1f) },
+ { DATA_SUPREMUS, new RectangleBoundary(556.1f, 850.2f, 542.0f, 1001.0f) },
+ { DATA_SHADE_OF_AKAMA, new RectangleBoundary(406.8f, 564.0f, 327.9f, 473.5f) },
+ { DATA_TERON_GOREFIEND, new RectangleBoundary(512.5f, 613.3f, 373.2f, 432.0f) },
+ { DATA_TERON_GOREFIEND, new ZRangeBoundary(179.5f, 223.6f) },
+ { DATA_GURTOGG_BLOODBOIL, new RectangleBoundary(720.5f, 864.5f, 159.3f, 316.0f) },
+ { DATA_RELIQUARY_OF_SOULS, new RectangleBoundary(435.9f, 558.8f, 113.3f, 229.6f) },
+ { DATA_MOTHER_SHAHRAZ, new RectangleBoundary(903.4f, 982.1f, 92.4f, 476.7f) },
+ { DATA_ILLIDARI_COUNCIL, new EllipseBoundary(Position(696.6f, 305.0f), 70.0 , 85.0) },
+ { DATA_ILLIDAN_STORMRAGE, new EllipseBoundary(Position(694.8f, 309.0f), 70.0 , 85.0) }
+};
+
class instance_black_temple : public InstanceMapScript
{
public:
@@ -47,6 +61,7 @@ class instance_black_temple : public InstanceMapScript
SetHeaders(DataHeader);
SetBossNumber(EncounterCount);
LoadDoorData(doorData);
+ LoadBossBoundaries(boundaries);
}
void OnCreatureCreate(Creature* creature) override
diff --git a/src/server/scripts/Outland/CMakeLists.txt b/src/server/scripts/Outland/CMakeLists.txt
deleted file mode 100644
index 55b0452fb0b..00000000000
--- a/src/server/scripts/Outland/CMakeLists.txt
+++ /dev/null
@@ -1,128 +0,0 @@
-# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
-#
-# This file is free software; as a special exception the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- Outland/zone_nagrand.cpp
- Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
- Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
- Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
- Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
- Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp
- Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp
- Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
- Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
- Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
- Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
- Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
- Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
- Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
- Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
- Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
- Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
- Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
- Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
- Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
- Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
- Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
- Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
- Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
- Outland/CoilfangReservoir/SteamVault/steam_vault.h
- Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
- Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
- Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
- Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h
- Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
- Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
- Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
- Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
- Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp
- Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
- Outland/CoilfangReservoir/TheSlavePens/boss_mennu_the_betrayer.cpp
- Outland/CoilfangReservoir/TheSlavePens/boss_rokmar_the_crackler.cpp
- Outland/CoilfangReservoir/TheSlavePens/boss_quagmirran.cpp
- Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp
- Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp
- Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp
- Outland/zone_shattrath_city.cpp
- Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
- Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
- Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
- Outland/TempestKeep/Mechanar/mechanar.h
- Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp
- Outland/TempestKeep/Mechanar/instance_mechanar.cpp
- Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp
- Outland/TempestKeep/Eye/the_eye.h
- Outland/TempestKeep/Eye/instance_the_eye.cpp
- Outland/TempestKeep/Eye/boss_void_reaver.cpp
- Outland/TempestKeep/Eye/boss_astromancer.cpp
- Outland/TempestKeep/Eye/boss_alar.cpp
- Outland/TempestKeep/Eye/boss_kaelthas.cpp
- Outland/TempestKeep/Eye/the_eye.cpp
- Outland/TempestKeep/botanica/the_botanica.h
- Outland/TempestKeep/botanica/instance_the_botanica.cpp
- Outland/TempestKeep/botanica/boss_commander_sarannis.cpp
- Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp
- Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
- Outland/TempestKeep/botanica/boss_warp_splinter.cpp
- Outland/TempestKeep/botanica/boss_laj.cpp
- Outland/TempestKeep/arcatraz/boss_zereketh_the_unbound.cpp
- Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp
- Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp
- Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
- Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
- Outland/TempestKeep/arcatraz/arcatraz.h
- Outland/TempestKeep/arcatraz/arcatraz.cpp
- Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
- Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
- Outland/Auchindoun/AuchenaiCrypts/instance_auchenai_crypts.cpp
- Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
- Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
- Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
- Outland/Auchindoun/ManaTombs/instance_mana_tombs.cpp
- Outland/Auchindoun/ManaTombs/mana_tombs.h
- Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp
- Outland/Auchindoun/SethekkHalls/boss_talon_king_ikiss.cpp
- Outland/Auchindoun/SethekkHalls/boss_anzu.cpp
- Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
- Outland/Auchindoun/SethekkHalls/sethekk_halls.h
- Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
- Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
- Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
- Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
- Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
- Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h
- Outland/boss_doomwalker.cpp
- Outland/zone_terokkar_forest.cpp
- Outland/zone_hellfire_peninsula.cpp
- Outland/boss_doomlord_kazzak.cpp
- Outland/BlackTemple/boss_teron_gorefiend.cpp
- Outland/BlackTemple/black_temple.h
- Outland/BlackTemple/illidari_council.cpp
- Outland/BlackTemple/boss_shade_of_akama.cpp
- Outland/BlackTemple/boss_supremus.cpp
- Outland/BlackTemple/black_temple.cpp
- Outland/BlackTemple/boss_mother_shahraz.cpp
- Outland/BlackTemple/instance_black_temple.cpp
- Outland/BlackTemple/boss_reliquary_of_souls.cpp
- Outland/BlackTemple/boss_warlord_najentus.cpp
- Outland/BlackTemple/boss_gurtogg_bloodboil.cpp
- Outland/BlackTemple/boss_illidan.cpp
- Outland/zone_shadowmoon_valley.cpp
- Outland/zone_blades_edge_mountains.cpp
- Outland/GruulsLair/boss_high_king_maulgar.cpp
- Outland/GruulsLair/boss_gruul.cpp
- Outland/GruulsLair/gruuls_lair.h
- Outland/GruulsLair/instance_gruuls_lair.cpp
- Outland/zone_netherstorm.cpp
- Outland/zone_zangarmarsh.cpp
-)
-
-message(" -> Prepared: Outland")
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
index e24499c3aee..3ddf0fec416 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
@@ -585,8 +585,8 @@ public:
void Reset() override
{
- me->SetSpeed(MOVE_WALK, 0.6f); // walk
- me->SetSpeed(MOVE_RUN, 0.6f); // run
+ me->SetSpeedRate(MOVE_WALK, 0.6f); // walk
+ me->SetSpeedRate(MOVE_RUN, 0.6f); // run
Initialize();
//search for nearest waypoint (up on stairs)
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
index 8d117f7c3ef..f72b9a8d2ca 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
@@ -244,7 +244,7 @@ public:
CheckChannelers();
Initialize();
me->SetCanDualWield(true);
- me->SetSpeed(MOVE_RUN, 2.0f, true);
+ me->SetSpeedRate(MOVE_RUN, 2.0f);
me->SetDisplayId(MODEL_NIGHTELF);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
new file mode 100644
index 00000000000..62552a3bf61
--- /dev/null
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
@@ -0,0 +1,1046 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "CreatureTextMgr.h"
+#include "LFGMgr.h"
+#include "ScriptedGossip.h"
+#include "ScriptedCreature.h"
+#include "ScriptMgr.h"
+#include "SpellAuraEffects.h"
+#include "SpellScript.h"
+#include "the_slave_pens.h"
+
+enum Spells
+{
+ // Ahune
+ SPELL_SYNCH_HEALTH = 46430,
+ SPELL_AHUNES_SHIELD = 45954,
+ SPELL_STAY_SUBMERGED = 46981,
+ SPELL_AHUNE_SELF_STUN = 46416,
+ SPELL_AHUNE_ACHIEVEMENT = 62043,
+ SPELL_AHUNE_SPANKY_HANDS = 46146,
+ SPELL_COLD_SLAP = 46145,
+ SPELL_RESURFACE = 46402,
+ SPELL_SUBMERGED = 37751,
+ SPELL_STAND = 37752,
+
+ //Earther Ring Flamecaller
+ SPELL_FIND_OPENING_VISUAL = 45964,
+ SPELL_FIND_OPENING_BEAM_END = 46333,
+ SPELL_FIND_OPENING_TRIGGER = 46341,
+ SPELL_FIND_OPENING_CHANNEL = 46345,
+ SPELL_BONFIRE_VISUAL = 46339,
+ SPELL_FOUND_OPENING = 46421,
+
+ //Ahune Bunny
+ SPELL_SUMMON_COLDWEAVE = 46143,
+ SPELL_SUMMON_FROSTWIND = 46382,
+ SPELL_SUMMON_HAILSTONE = 46176,
+ SPELL_SUMMONING_VISUAL_1 = 45937,
+ SPELL_SUMMONING_RHYME_AURA = 45926,
+ SPELL_SUMMONING_RHYME_BONFIRE = 45930,
+ SPELL_FORCE_WHISP_FLIGHT = 46603,
+ SPELL_SHAMANS_LOOK_FOR_OPENING = 46422,
+ SPELL_CLOSE_OPENING_VISUAL = 46236,
+ SPELL_ICE_BOMBARD = 46397,
+ SPELL_ICE_BOMBARDMENT_DEST_PICKER = 46398,
+ SPELL_ICE_BOMBARDMENT = 46396,
+
+ // Ice Spear
+ SPELL_SUMMON_ICE_SPEAR_BUNNY = 46359,
+ SPELL_ICE_SPEAR_KNOCKBACK = 46360,
+ SPELL_SUMMON_ICE_SPEAR_GO = 46369,
+ SPELL_ICE_SPEAR_AURA = 46371,
+ SPELL_ICE_SPEAR_TARGET_PICKER = 46372,
+ SPELL_ICE_SPEAR_DELAY = 46878,
+ SPELL_ICE_SPEAR_VISUAL = 75498,
+
+ // Slippery Floor
+ SPELL_SLIPPERY_FLOOR_AMBIENT = 46314,
+ SPELL_SLIPPERY_FLOOR_PERIODIC = 46320,
+ SPELL_SLIPPERY_FLOOR_SLIP = 45947,
+ SPELL_SLIPPERY_FLOOR_YOU_SLIPPED = 45946,
+
+ // Frozen Core
+ SPELL_SUICIDE = 45254,
+ SPELL_SUMMON_LOOT_MISSILE = 45941,
+ SPELL_FROZEN_CORE_GETS_HIT = 46810,
+ SPELL_MINION_DESPAWNER = 46843,
+ SPELL_GHOST_DISGUISE = 46786
+};
+
+enum Emotes
+{
+ EMOTE_EARTHEN_ASSAULT = 0,
+ EMOTE_RETREAT = 0,
+ EMOTE_RESURFACE = 1
+};
+
+enum Says
+{
+ SAY_PLAYER_TEXT_1 = 0,
+ SAY_PLAYER_TEXT_2 = 1,
+ SAY_PLAYER_TEXT_3 = 2
+};
+
+enum Events
+{
+ EVENT_EMERGE = 1,
+ EVENT_INITIAL_EMERGE = 2,
+ EVENT_SYNCH_HEALTH = 3,
+ EVENT_LOOKFOROPENING_0 = 4,
+ EVENT_LOOKFOROPENING_1 = 5,
+ EVENT_LOOKFOROPENING_2 = 6,
+ EVENT_SUMMON_HAILSTONE = 7,
+ EVENT_SUMMON_COLDWEAVE = 8,
+ EVENT_SUMMON_FROSTWIND = 9,
+ EVENT_SUMMON_AHUNE = 10,
+ EVENT_CLOSE_OPENING = 11,
+ EVENT_AHUNE_PHASE_ONE = 12,
+ EVENT_AHUNE_PHASE_TWO = 13,
+ EVENT_START_LOOKING_FOR_OPENING = 14,
+ EVENT_STOP_LOOKING_FOR_OPENING = 15
+};
+
+enum Actions
+{
+ ACTION_START_EVENT = -2574500,
+ ACTION_AHUNE_RETREAT = -2586500,
+ ACTION_AHUNE_RESURFACE = -2586501,
+ ACTION_EMOTE_RESURFACE = -2575400
+};
+
+enum Phases
+{
+ PHASE_ONE = 0,
+ PHASE_TWO = 1
+};
+
+enum Points
+{
+ POINT_FLAMECALLER_000,
+ POINT_FLAMECALLER_001,
+ POINT_FLAMECALLER_002
+};
+
+enum Misc
+{
+ MAX_FLAMECALLERS = 3
+};
+
+Position const SummonPositions[] =
+{
+ { -99.1021f, -233.7526f, -1.22307f, 1.588250f }, // Ahune
+ { -98.0151f, -230.4555f, -1.21089f, 1.797689f }, // Frozen Core
+ { -143.172f, -147.6801f, -3.16113f, 4.852015f }, // Bonfire Bunny 000
+ { -134.304f, -145.7803f, -1.70332f, 4.677482f }, // Bonfire Bunny 001
+ { -125.036f, -144.2065f, -1.91660f, 4.991642f }, // Bonfire Bunny 002
+ { -69.8121f, -162.4954f, -2.30451f, 1.710423f }, // Wisp Source Bunny
+ { -98.1029f, -230.7864f, -10.8085f, 1.448623f } // Wisp Dest Bunny
+};
+
+Position const FlameCallerSpots[] =
+{
+ { -145.2233f, -137.5543f, -1.59056f, 5.427049f },
+ { -137.4383f, -136.4050f, -1.72384f, 5.336747f },
+ { -129.0413f, -132.1494f, -2.09285f, 5.460842f }
+};
+
+class boss_ahune : public CreatureScript
+{
+public:
+ boss_ahune() : CreatureScript("boss_ahune") { }
+
+ struct boss_ahuneAI : public BossAI
+ {
+ boss_ahuneAI(Creature* creature) : BossAI(creature, DATA_AHUNE)
+ {
+ me->SetControlled(true, UNIT_STATE_ROOT);
+ }
+
+ void EnterCombat(Unit* /*who*/) override
+ {
+ _EnterCombat();
+ events.ScheduleEvent(EVENT_INITIAL_EMERGE, Milliseconds(4));
+ events.ScheduleEvent(EVENT_SYNCH_HEALTH, Seconds(3));
+ }
+
+ void EnterEvadeMode(EvadeReason /*why*/) override
+ {
+ if (Creature* ahuneBunny = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AHUNE_BUNNY)))
+ ahuneBunny->AI()->EnterEvadeMode();
+ summons.DespawnAll();
+ me->DespawnOrUnsummon();
+ }
+
+ void JustDied(Unit* /*killer*/) override
+ {
+ instance->DoCastSpellOnPlayers(SPELL_AHUNE_ACHIEVEMENT);
+
+ if (Creature* ahuneBunny = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AHUNE_BUNNY)))
+ me->Kill(ahuneBunny);
+ if (Creature* frozenCore = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FROZEN_CORE)))
+ me->Kill(frozenCore);
+
+ Map::PlayerList const& players = me->GetMap()->GetPlayers();
+ if (!players.isEmpty())
+ {
+ if (Group* group = players.begin()->GetSource()->GetGroup())
+ if (group->isLFGGroup())
+ sLFGMgr->FinishDungeon(group->GetGUID(), 286);
+ }
+
+ _JustDied();
+ }
+
+ void DoAction(int32 action) override
+ {
+ if (action == ACTION_AHUNE_RETREAT)
+ {
+ Submerge();
+ events.ScheduleEvent(EVENT_EMERGE, Seconds(35));
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_INITIAL_EMERGE:
+ DoCast(me, SPELL_STAND);
+ DoCast(me, SPELL_AHUNE_SPANKY_HANDS);
+ DoCast(me, SPELL_AHUNES_SHIELD);
+ break;
+ case EVENT_EMERGE:
+ Emerge();
+ break;
+ case EVENT_SYNCH_HEALTH:
+ if (Creature* frozenCore = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FROZEN_CORE)))
+ DoCast(frozenCore, SPELL_SYNCH_HEALTH, true);
+ else
+ DoCast(me, SPELL_SUICIDE);
+ events.Repeat(Seconds(3));
+ break;
+ default:
+ break;
+ }
+ }
+ DoMeleeAttackIfReady();
+ }
+
+ void Emerge()
+ {
+ if (Creature* frozenCore = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FROZEN_CORE)))
+ frozenCore->AI()->DoAction(ACTION_AHUNE_RESURFACE);
+
+ DoCast(me, SPELL_AHUNES_SHIELD);
+ me->RemoveAurasDueToSpell(SPELL_AHUNE_SELF_STUN);
+ me->RemoveAurasDueToSpell(SPELL_STAY_SUBMERGED);
+ DoCast(me, SPELL_STAND);
+ DoCast(me, SPELL_RESURFACE, true);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ events.ScheduleEvent(EVENT_SYNCH_HEALTH, Seconds(3));
+ }
+
+ void Submerge()
+ {
+ if (Creature* frozenCore = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FROZEN_CORE)))
+ frozenCore->AI()->DoAction(ACTION_AHUNE_RETREAT);
+ me->RemoveAurasDueToSpell(SPELL_AHUNES_SHIELD);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_31);
+ DoCast(me, SPELL_SUBMERGED, true);
+ DoCast(me, SPELL_AHUNE_SELF_STUN, true);
+ DoCast(me, SPELL_STAY_SUBMERGED, true);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
+ events.Reset();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetInstanceAI<boss_ahuneAI>(creature);
+ }
+};
+
+class npc_frozen_core : public CreatureScript
+{
+public:
+ npc_frozen_core() : CreatureScript("npc_frozen_core") { }
+
+ struct npc_frozen_coreAI : public ScriptedAI
+ {
+ npc_frozen_coreAI(Creature* creature) : ScriptedAI(creature)
+ {
+ _instance = me->GetInstanceScript();
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ me->SetReactState(REACT_PASSIVE);
+ me->setRegeneratingHealth(false);
+ DoCast(me, SPELL_FROZEN_CORE_GETS_HIT);
+ DoCast(me, SPELL_ICE_SPEAR_AURA);
+ }
+
+ void JustDied(Unit* /*killer*/) override
+ {
+ if (Creature* ahune = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AHUNE)))
+ me->Kill(ahune);
+
+ DoCast(SPELL_SUMMON_LOOT_MISSILE);
+ DoCast(SPELL_MINION_DESPAWNER);
+ }
+
+ void DoAction(int32 action) override
+ {
+ if (action == ACTION_AHUNE_RETREAT)
+ {
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveAurasDueToSpell(SPELL_ICE_SPEAR_AURA);
+ _events.ScheduleEvent(EVENT_SYNCH_HEALTH, Seconds(3), 0, PHASE_TWO);
+ }
+ else if (action == ACTION_AHUNE_RESURFACE)
+ {
+ _events.Reset();
+ DoCast(me, SPELL_ICE_SPEAR_AURA);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_SYNCH_HEALTH:
+ if (Creature* ahune = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AHUNE)))
+ DoCast(ahune, SPELL_SYNCH_HEALTH, true);
+ else
+ DoCast(me, SPELL_SUICIDE);
+ _events.Repeat(Seconds(3));
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ private:
+ InstanceScript* _instance;
+ EventMap _events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetInstanceAI<npc_frozen_coreAI>(creature);
+ }
+};
+
+class npc_ahune_bunny : public CreatureScript
+{
+public:
+ npc_ahune_bunny() : CreatureScript("npc_ahune_bunny") { }
+
+ struct npc_ahune_bunnyAI : public ScriptedAI
+ {
+ npc_ahune_bunnyAI(Creature* creature) : ScriptedAI(creature), _summons(me)
+ {
+ _instance = me->GetInstanceScript();
+ _submerged = false;
+ }
+
+ void JustSummoned(Creature* summon) override
+ {
+ if (summon->GetEntry() == NPC_AHUNE)
+ return;
+
+ summon->SetInCombatWithZone();
+ _summons.Summon(summon);
+ }
+
+ void JustDied(Unit* /*killer*/) override
+ {
+ _summons.DespawnAll();
+ ResetFlameCallers();
+ }
+
+ void EnterEvadeMode(EvadeReason /*why*/) override
+ {
+ _EnterEvadeMode();
+ _summons.DespawnAll();
+ ResetFlameCallers();
+
+ me->SummonGameObject(GO_ICE_STONE, -69.90455f, -162.2449f, -2.366563f, 2.426008f, G3D::Quat(0.0f, 0.0f, 0.9366722f, 0.3502074f), 0);
+ }
+
+ void DoAction(int32 action) override
+ {
+ if (action == ACTION_START_EVENT)
+ {
+ DoCast(me, SPELL_SUMMONING_VISUAL_1);
+ me->SummonCreature(NPC_WHISP_SOURCE_BUNNY, SummonPositions[5], TEMPSUMMON_MANUAL_DESPAWN);
+ me->SummonCreature(NPC_WHISP_DEST_BUNNY, SummonPositions[6], TEMPSUMMON_MANUAL_DESPAWN);
+ me->SummonCreature(NPC_SHAMAN_BONFIRE_BUNNY_000, SummonPositions[2], TEMPSUMMON_MANUAL_DESPAWN);
+ me->SummonCreature(NPC_SHAMAN_BONFIRE_BUNNY_001, SummonPositions[3], TEMPSUMMON_MANUAL_DESPAWN);
+ me->SummonCreature(NPC_SHAMAN_BONFIRE_BUNNY_002, SummonPositions[4], TEMPSUMMON_MANUAL_DESPAWN);
+
+ for (uint8 counter = 0; counter < MAX_FLAMECALLERS; ++counter)
+ if (Creature* flameCaller = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_FLAMECALLER_000 + counter)))
+ flameCaller->GetMotionMaster()->MovePoint(counter, FlameCallerSpots[counter].GetPosition());
+
+ _submerged = false;
+ _events.Reset();
+ _events.SetPhase(PHASE_ONE);
+ _events.ScheduleEvent(EVENT_SUMMON_AHUNE, Seconds(10));
+ _events.ScheduleEvent(EVENT_START_LOOKING_FOR_OPENING, Seconds(14), 0, PHASE_ONE);
+ _events.ScheduleEvent(EVENT_SUMMON_COLDWEAVE, Seconds(22), 0, PHASE_ONE);
+ _events.ScheduleEvent(EVENT_SUMMON_HAILSTONE, Seconds(14), 0, PHASE_ONE);
+ _events.ScheduleEvent(EVENT_AHUNE_PHASE_TWO, Seconds(108), 0, PHASE_ONE);
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim())
+ return;
+
+ _events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_START_LOOKING_FOR_OPENING:
+ Talk(EMOTE_EARTHEN_ASSAULT);
+ for (uint8 counter = 0; counter < MAX_FLAMECALLERS; ++counter)
+ if (Creature* flamecaller = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_FLAMECALLER_000 + counter)))
+ DoCast(flamecaller, SPELL_SHAMANS_LOOK_FOR_OPENING, true);
+ break;
+ case EVENT_SUMMON_HAILSTONE:
+ DoCast(SPELL_SUMMON_HAILSTONE);
+ break;
+ case EVENT_SUMMON_COLDWEAVE:
+ DoCast(SPELL_SUMMON_COLDWEAVE);
+ DoCast(SPELL_SUMMON_COLDWEAVE);
+ _events.Repeat(Seconds(8));
+ if (_submerged)
+ _events.ScheduleEvent(EVENT_SUMMON_FROSTWIND, Seconds(4), 0, PHASE_ONE);
+ break;
+ case EVENT_SUMMON_FROSTWIND:
+ DoCast(SPELL_SUMMON_FROSTWIND);
+ break;
+ case EVENT_SUMMON_AHUNE:
+ if (TempSummon* ahune = me->SummonCreature(NPC_AHUNE, SummonPositions[0], TEMPSUMMON_DEAD_DESPAWN))
+ {
+ ahune->SummonCreature(NPC_FROZEN_CORE, SummonPositions[1], TEMPSUMMON_CORPSE_DESPAWN);
+ ahune->SetInCombatWithZone();
+ DoCast(ahune, SPELL_RESURFACE);
+ }
+ break;
+ case EVENT_CLOSE_OPENING:
+ if (Creature* flamecaller = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_FLAMECALLER_000)))
+ flamecaller->AI()->DoAction(ACTION_EMOTE_RESURFACE);
+ DoCast(SPELL_CLOSE_OPENING_VISUAL);
+ DoCast(me, SPELL_ICE_BOMBARD);
+ break;
+ case EVENT_AHUNE_PHASE_TWO:
+ if (Creature* flamecaller = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_FLAMECALLER_000)))
+ DoCast(flamecaller, SPELL_FOUND_OPENING);
+ if (Creature* ahune = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AHUNE)))
+ ahune->AI()->DoAction(ACTION_AHUNE_RETREAT);
+ _events.Reset();
+ _events.SetPhase(PHASE_TWO);
+ _events.ScheduleEvent(EVENT_CLOSE_OPENING, Seconds(25), 0, PHASE_TWO);
+ _events.ScheduleEvent(EVENT_AHUNE_PHASE_ONE, Seconds(35), 0, PHASE_TWO);
+ break;
+ case EVENT_AHUNE_PHASE_ONE:
+ _submerged = true;
+ _events.Reset();
+ _events.SetPhase(PHASE_ONE);
+ _events.ScheduleEvent(EVENT_SUMMON_COLDWEAVE, Seconds(8), 0, PHASE_ONE);
+ _events.ScheduleEvent(EVENT_SUMMON_HAILSTONE, Seconds(5), 0, PHASE_ONE);
+ _events.ScheduleEvent(EVENT_START_LOOKING_FOR_OPENING, Seconds(5), 0, PHASE_ONE);
+ _events.ScheduleEvent(EVENT_AHUNE_PHASE_TWO, Seconds(100), 0, PHASE_ONE);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ void ResetFlameCallers()
+ {
+ for (uint8 counter = 0; counter < MAX_FLAMECALLERS; ++counter)
+ if (Creature* flamecaller = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_FLAMECALLER_000 + counter)))
+ flamecaller->AI()->EnterEvadeMode();
+ }
+
+ private:
+ InstanceScript* _instance;
+ EventMap _events;
+ SummonList _summons;
+ bool _submerged;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetInstanceAI<npc_ahune_bunnyAI>(creature);
+ }
+};
+
+class npc_earthen_ring_flamecaller : public CreatureScript
+{
+public:
+ npc_earthen_ring_flamecaller() : CreatureScript("npc_earthen_ring_flamecaller") { }
+
+ struct npc_earthen_ring_flamecallerAI : public ScriptedAI
+ {
+ npc_earthen_ring_flamecallerAI(Creature* creature) : ScriptedAI(creature)
+ {
+ _instance = me->GetInstanceScript();
+ _mySpot = 0;
+ }
+
+ void Reset() override
+ {
+ _events.Reset();
+ }
+
+ void MovementInform(uint32 motionType, uint32 pointId) override
+ {
+ if (motionType != POINT_MOTION_TYPE)
+ return;
+
+ switch (pointId)
+ {
+ case POINT_FLAMECALLER_000:
+ _mySpot = POINT_FLAMECALLER_000;
+ me->SetOrientation(FlameCallerSpots[_mySpot].GetOrientation());
+ break;
+ case POINT_FLAMECALLER_001:
+ _mySpot = POINT_FLAMECALLER_001;
+ me->SetOrientation(FlameCallerSpots[_mySpot].GetOrientation());
+ break;
+ case POINT_FLAMECALLER_002:
+ _mySpot = POINT_FLAMECALLER_002;
+ me->SetOrientation(FlameCallerSpots[_mySpot].GetOrientation());
+ break;
+ default:
+ break;
+ }
+
+ DoCast(me, SPELL_FIND_OPENING_CHANNEL);
+ }
+
+ void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
+ {
+ switch (spellInfo->Id)
+ {
+ case SPELL_SHAMANS_LOOK_FOR_OPENING:
+ _events.ScheduleEvent(EVENT_LOOKFOROPENING_0, Seconds(17));
+ break;
+ case SPELL_FOUND_OPENING:
+ Talk(EMOTE_RETREAT);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void DoAction(int action) override
+ {
+ if (action == ACTION_EMOTE_RESURFACE)
+ Talk(EMOTE_RESURFACE);
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_LOOKFOROPENING_0:
+ LookOpening(true, 0);
+ _events.ScheduleEvent(EVENT_LOOKFOROPENING_1, Seconds(26));
+ break;
+ case EVENT_LOOKFOROPENING_1:
+ LookOpening(true, 1);
+ _events.ScheduleEvent(EVENT_LOOKFOROPENING_2, Seconds(25));
+ break;
+ case EVENT_LOOKFOROPENING_2:
+ LookOpening(true, 2);
+ _events.ScheduleEvent(EVENT_STOP_LOOKING_FOR_OPENING, Seconds(27));
+ break;
+ case EVENT_STOP_LOOKING_FOR_OPENING:
+ LookOpening(false, _mySpot);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ void LookOpening(bool activate, uint8 spot)
+ {
+ if (_mySpot != spot)
+ return;
+
+ if (Creature* bonfireBunny = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_BONFIRE_BUNNY_000 + spot)))
+ if (Creature* beamBunny = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_BEAM_BUNNY_000 + spot)))
+ {
+ if (activate)
+ {
+ DoCast(bonfireBunny, SPELL_FIND_OPENING_TRIGGER);
+ bonfireBunny->CastSpell(beamBunny, SPELL_FIND_OPENING_VISUAL, true);
+ }
+ else
+ {
+ DoCast(me, SPELL_FIND_OPENING_CHANNEL);
+ bonfireBunny->CastStop();
+ beamBunny->RemoveAurasDueToSpell(SPELL_FIND_OPENING_BEAM_END);
+ }
+ }
+ }
+
+ private:
+ EventMap _events;
+ InstanceScript* _instance;
+ uint8 _mySpot;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetInstanceAI<npc_earthen_ring_flamecallerAI>(creature);
+ }
+};
+
+class go_ahune_ice_stone : public GameObjectScript
+{
+public:
+ go_ahune_ice_stone() : GameObjectScript("go_ahune_ice_stone") { }
+
+ bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 /*action*/)
+ {
+ InstanceScript* instance = go->GetInstanceScript();
+ if (!instance)
+ return false;
+
+ player->PlayerTalkClass->ClearMenus();
+
+ if (Creature* ahuneBunny = ObjectAccessor::GetCreature(*go, instance->GetGuidData(DATA_AHUNE_BUNNY)))
+ {
+ ahuneBunny->AI()->DoAction(ACTION_START_EVENT);
+ ahuneBunny->SetInCombatWithZone();
+ }
+ if (Creature* luma = ObjectAccessor::GetCreature(*go, instance->GetGuidData(DATA_LUMA_SKYMOTHER)))
+ luma->CastSpell(player, SPELL_SUMMONING_RHYME_AURA, true);
+ player->CLOSE_GOSSIP_MENU();
+ go->Delete();
+
+ return true;
+ }
+};
+
+// 46430 - Synch Health
+class spell_ahune_synch_health : public SpellScriptLoader
+{
+public:
+ spell_ahune_synch_health() : SpellScriptLoader("spell_ahune_synch_health") { }
+
+ class spell_ahune_synch_health_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_ahune_synch_health_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SYNCH_HEALTH))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ if (Unit* caster = GetCaster())
+ target->SetHealth(caster->GetHealth());
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_ahune_synch_health_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_ahune_synch_health_SpellScript();
+ }
+};
+
+// 45926 - Summoning Rhyme Aura
+class spell_summoning_rhyme_aura : public SpellScriptLoader
+{
+public:
+ spell_summoning_rhyme_aura() : SpellScriptLoader("spell_summoning_rhyme_aura") { }
+
+ class spell_summoning_rhyme_aura_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_summoning_rhyme_aura_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_FORCE_WHISP_FLIGHT) || !sSpellMgr->GetSpellInfo(SPELL_SUMMONING_RHYME_BONFIRE))
+ return false;
+ return true;
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ Creature* caster = GetCaster()->ToCreature();
+ Player* player = GetTarget()->ToPlayer();
+
+ if (!caster || !player)
+ return;
+
+ player->CastSpell(player, SPELL_FORCE_WHISP_FLIGHT);
+
+ switch (aurEff->GetTickNumber())
+ {
+ case 1:
+ sCreatureTextMgr->SendChat(caster, SAY_PLAYER_TEXT_1, NULL, CHAT_MSG_SAY, LANG_UNIVERSAL, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
+ player->CastSpell(player, SPELL_SUMMONING_RHYME_BONFIRE, true);
+ break;
+ case 2:
+ sCreatureTextMgr->SendChat(caster, SAY_PLAYER_TEXT_2, NULL, CHAT_MSG_SAY, LANG_UNIVERSAL, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
+ break;
+ case 3:
+ sCreatureTextMgr->SendChat(caster, SAY_PLAYER_TEXT_3, NULL, CHAT_MSG_SAY, LANG_UNIVERSAL, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, player);
+ Remove();
+ break;
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_summoning_rhyme_aura_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_summoning_rhyme_aura_AuraScript();
+ }
+};
+
+// 46878 - Summon Ice Spear Delayer
+class spell_summon_ice_spear_delayer : public SpellScriptLoader
+{
+public:
+ spell_summon_ice_spear_delayer() : SpellScriptLoader("spell_summon_ice_spear_delayer") { }
+
+ class spell_summon_ice_spear_delayer_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_summon_ice_spear_delayer_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ICE_SPEAR_GO) || !sSpellMgr->GetSpellInfo(SPELL_ICE_SPEAR_KNOCKBACK))
+ return false;
+ return true;
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ if (Unit* tmpCaster = GetCaster())
+ if (Creature* caster = tmpCaster->ToCreature())
+ switch (aurEff->GetTickNumber())
+ {
+ case 1:
+ caster->CastSpell(caster, SPELL_SUMMON_ICE_SPEAR_GO);
+ break;
+ case 3:
+ if (GameObject* spike = caster->FindNearestGameObject(GO_ICE_SPEAR, 3.0f))
+ spike->UseDoorOrButton();
+ caster->AI()->DoCastAOE(SPELL_ICE_SPEAR_KNOCKBACK, true);
+ break;
+ case 5:
+ if (GameObject* spike = caster->FindNearestGameObject(GO_ICE_SPEAR, 3.0f))
+ spike->Delete();
+ caster->DespawnOrUnsummon();
+ break;
+ default:
+ break;
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_summon_ice_spear_delayer_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_summon_ice_spear_delayer_AuraScript();
+ }
+};
+
+// 46371 - Ice Spear Control Aura
+class spell_ice_spear_control_aura : public SpellScriptLoader
+{
+public:
+ spell_ice_spear_control_aura() : SpellScriptLoader("spell_ice_spear_control_aura") { }
+
+ class spell_ice_spear_control_aura_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_ice_spear_control_aura_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ICE_SPEAR_TARGET_PICKER))
+ return false;
+ return true;
+ }
+
+ void PeriodicTick(AuraEffect const* /*aurEff*/)
+ {
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(caster, SPELL_ICE_SPEAR_TARGET_PICKER);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_ice_spear_control_aura_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_ice_spear_control_aura_AuraScript();
+ }
+};
+
+// 46372 - Ice Spear Target Picker
+class spell_ice_spear_target_picker : public SpellScriptLoader
+{
+public:
+ spell_ice_spear_target_picker() : SpellScriptLoader("spell_ice_spear_target_picker") { }
+
+ class spell_ice_spear_target_picker_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_ice_spear_target_picker_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_ICE_SPEAR_BUNNY))
+ return false;
+ return true;
+ }
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ if (targets.empty())
+ return;
+
+ WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
+ targets.clear();
+ targets.push_back(target);
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->CastSpell(GetHitUnit(), SPELL_SUMMON_ICE_SPEAR_BUNNY, true);
+ }
+
+ void Register() override
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ice_spear_target_picker_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
+ OnEffectHitTarget += SpellEffectFn(spell_ice_spear_target_picker_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_ice_spear_target_picker_SpellScript();
+ }
+};
+
+// 46320 - Spell Slippery Floor Periodic
+class spell_slippery_floor_periodic : public SpellScriptLoader
+{
+public:
+ spell_slippery_floor_periodic() : SpellScriptLoader("spell_slippery_floor_periodic") { }
+
+ class spell_slippery_floor_periodic_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_slippery_floor_periodic_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SLIPPERY_FLOOR_SLIP))
+ return false;
+ return true;
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ if (target->isMoving())
+ {
+ target->CastSpell(target, SPELL_SLIPPERY_FLOOR_SLIP, true);
+ target->CastSpell(target, SPELL_SLIPPERY_FLOOR_YOU_SLIPPED, true);
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_slippery_floor_periodic_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_slippery_floor_periodic_SpellScript();
+ }
+};
+
+// 46146 - Ahune Spanky Hands
+class spell_ahune_spanky_hands : public SpellScriptLoader
+{
+public:
+ spell_ahune_spanky_hands() : SpellScriptLoader("spell_ahune_spanky_hands") { }
+
+ class spell_ahune_spanky_hands_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_ahune_spanky_hands_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_COLD_SLAP))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_COLD_SLAP, true);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_ahune_spanky_hands_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_ahune_spanky_hands_AuraScript();
+ }
+};
+
+class spell_ahune_minion_despawner : public SpellScriptLoader
+{
+public:
+ spell_ahune_minion_despawner() : SpellScriptLoader("spell_ahune_minion_despawner") { }
+
+ class spell_ahune_minion_despawner_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_ahune_minion_despawner_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (GetHitCreature())
+ GetHitCreature()->DespawnOrUnsummon();
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_ahune_minion_despawner_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_ahune_minion_despawner_SpellScript();
+ }
+};
+
+// 46398 - Spell Ice Bombardment Dest Picker
+class spell_ice_bombardment_dest_picker : public SpellScriptLoader
+{
+public:
+ spell_ice_bombardment_dest_picker() : SpellScriptLoader("spell_ice_bombardment_dest_picker") { }
+
+ class spell_ice_bombardment_dest_picker_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_ice_bombardment_dest_picker_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ICE_BOMBARDMENT))
+ return false;
+ return true;
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->CastSpell(GetHitDest()->GetPositionX(), GetHitDest()->GetPositionY(), GetHitDest()->GetPositionZ(), SPELL_ICE_BOMBARDMENT, true);
+ }
+
+ void Register() override
+ {
+ OnEffectHit += SpellEffectFn(spell_ice_bombardment_dest_picker_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_ice_bombardment_dest_picker_SpellScript();
+ }
+};
+
+void AddSC_boss_ahune()
+{
+ new boss_ahune();
+ new npc_frozen_core();
+ new npc_earthen_ring_flamecaller();
+ new npc_ahune_bunny();
+ new go_ahune_ice_stone();
+ new spell_ahune_synch_health();
+ new spell_summoning_rhyme_aura();
+ new spell_summon_ice_spear_delayer();
+ new spell_ice_spear_control_aura();
+ new spell_slippery_floor_periodic();
+ new spell_ahune_spanky_hands();
+ new spell_ahune_minion_despawner();
+ new spell_ice_spear_target_picker();
+ new spell_ice_bombardment_dest_picker();
+}
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp
index 87a07cd1e5e..0fac7b5a39d 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp
@@ -31,15 +31,125 @@ class instance_the_slave_pens : public InstanceMapScript
public:
instance_the_slave_pens() : InstanceMapScript(SPScriptName, 547) { }
+ struct instance_the_slave_pens_InstanceMapScript : public InstanceScript
+ {
+ instance_the_slave_pens_InstanceMapScript(Map* map) : InstanceScript(map)
+ {
+ counter = DATA_FLAMECALLER_000;
+ }
+
+ void OnCreatureCreate(Creature* creature) override
+ {
+ switch (creature->GetEntry())
+ {
+ case NPC_AHUNE:
+ AhuneGUID = creature->GetGUID();
+ break;
+ case NPC_FROZEN_CORE:
+ FrozenCoreGUID = creature->GetGUID();
+ break;
+ case NPC_AHUNE_LOC_BUNNY:
+ AhuneBunnyGUID = creature->GetGUID();
+ break;
+ case NPC_SHAMAN_BONFIRE_BUNNY_000:
+ BonfireBunnyGUIDs[0] = creature->GetGUID();
+ break;
+ case NPC_SHAMAN_BONFIRE_BUNNY_001:
+ BonfireBunnyGUIDs[1] = creature->GetGUID();
+ break;
+ case NPC_SHAMAN_BONFIRE_BUNNY_002:
+ BonfireBunnyGUIDs[2] = creature->GetGUID();
+ break;
+ case NPC_SHAMAN_BEAM_BUNNY_000:
+ BeamBunnyGUIDs[0] = creature->GetGUID();
+ break;
+ case NPC_SHAMAN_BEAM_BUNNY_001:
+ BeamBunnyGUIDs[1] = creature->GetGUID();
+ break;
+ case NPC_SHAMAN_BEAM_BUNNY_002:
+ BeamBunnyGUIDs[2] = creature->GetGUID();
+ break;
+ case NPC_LUMA_SKYMOTHER:
+ LumaGUID = creature->GetGUID();
+ break;
+ case NPC_EARTHEN_RING_FLAMECALLER:
+ SetGuidData(counter, creature->GetGUID());
+ ++counter;
+ break;
+ default:
+ break;
+ }
+ }
+
+ void SetGuidData(uint32 data, ObjectGuid guid) override
+ {
+ switch (data)
+ {
+ case DATA_FLAMECALLER_000:
+ FlameCallerGUIDs[0] = guid;
+ break;
+ case DATA_FLAMECALLER_001:
+ FlameCallerGUIDs[1] = guid;
+ break;
+ case DATA_FLAMECALLER_002:
+ FlameCallerGUIDs[2] = guid;
+ break;
+ default:
+ break;
+ }
+ }
+
+ ObjectGuid GetGuidData(uint32 type) const override
+ {
+ switch (type)
+ {
+ case DATA_AHUNE:
+ return AhuneGUID;
+ case DATA_AHUNE_BUNNY:
+ return AhuneBunnyGUID;
+ case DATA_FROZEN_CORE:
+ return FrozenCoreGUID;
+ case DATA_FLAMECALLER_000:
+ return FlameCallerGUIDs[0];
+ case DATA_FLAMECALLER_001:
+ return FlameCallerGUIDs[1];
+ case DATA_FLAMECALLER_002:
+ return FlameCallerGUIDs[2];
+ case DATA_BONFIRE_BUNNY_000:
+ return BonfireBunnyGUIDs[0];
+ case DATA_BONFIRE_BUNNY_001:
+ return BonfireBunnyGUIDs[1];
+ case DATA_BONFIRE_BUNNY_002:
+ return BonfireBunnyGUIDs[2];
+ case DATA_BEAM_BUNNY_000:
+ return BeamBunnyGUIDs[0];
+ case DATA_BEAM_BUNNY_001:
+ return BeamBunnyGUIDs[1];
+ case DATA_BEAM_BUNNY_002:
+ return BeamBunnyGUIDs[2];
+ case DATA_LUMA_SKYMOTHER:
+ return LumaGUID;
+ default:
+ break;
+ }
+ return ObjectGuid::Empty;
+ }
+
+ protected:
+ ObjectGuid AhuneGUID;
+ ObjectGuid AhuneBunnyGUID;
+ ObjectGuid FrozenCoreGUID;
+ ObjectGuid LumaGUID;
+ ObjectGuid FlameCallerGUIDs[3];
+ ObjectGuid BonfireBunnyGUIDs[3];
+ ObjectGuid BeamBunnyGUIDs[3];
+ uint8 counter;
+ };
+
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
return new instance_the_slave_pens_InstanceMapScript(map);
}
-
- struct instance_the_slave_pens_InstanceMapScript : public InstanceScript
- {
- instance_the_slave_pens_InstanceMapScript(Map* map) : InstanceScript(map) { }
- };
};
void AddSC_instance_the_slave_pens()
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
index 95e6e44121e..544e98fd206 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h
@@ -27,7 +27,43 @@ enum DataTypes
{
DATA_MENNU_THE_BETRAYER = 1,
DATA_ROKMAR_THE_CRACKLER = 2,
- DATA_QUAGMIRRAN = 3
+ DATA_QUAGMIRRAN = 3,
+ DATA_AHUNE = 4,
+ DATA_AHUNE_BUNNY = 5,
+ DATA_FROZEN_CORE = 6,
+ DATA_FLAMECALLER_000 = 7,
+ DATA_FLAMECALLER_001 = 8,
+ DATA_FLAMECALLER_002 = 9,
+ DATA_BONFIRE_BUNNY_000 = 10,
+ DATA_BONFIRE_BUNNY_001 = 11,
+ DATA_BONFIRE_BUNNY_002 = 12,
+ DATA_BEAM_BUNNY_000 = 13,
+ DATA_BEAM_BUNNY_001 = 14,
+ DATA_BEAM_BUNNY_002 = 15,
+ DATA_LUMA_SKYMOTHER = 16
+};
+
+enum CreaturesIds
+{
+ NPC_AHUNE = 25740,
+ NPC_FROZEN_CORE = 25865,
+ NPC_LUMA_SKYMOTHER = 25697,
+ NPC_AHUNE_LOC_BUNNY = 25745,
+ NPC_EARTHEN_RING_FLAMECALLER = 25754,
+ NPC_SHAMAN_BONFIRE_BUNNY_000 = 25971,
+ NPC_SHAMAN_BONFIRE_BUNNY_001 = 25972,
+ NPC_SHAMAN_BONFIRE_BUNNY_002 = 25973,
+ NPC_SHAMAN_BEAM_BUNNY_000 = 25964,
+ NPC_SHAMAN_BEAM_BUNNY_001 = 25965,
+ NPC_SHAMAN_BEAM_BUNNY_002 = 25966,
+ NPC_WHISP_DEST_BUNNY = 26120,
+ NPC_WHISP_SOURCE_BUNNY = 26121
+};
+
+enum GameObjectIds
+{
+ GO_ICE_SPEAR = 188077,
+ GO_ICE_STONE = 187882
};
#endif // SLAVE_PENS_H
diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
index 4e20e6b0953..9b8220596c9 100644
--- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
@@ -372,7 +372,7 @@ class boss_vazruden_the_herald : public CreatureScript
if (summon->GetEntry() == NPC_NAZAN)
{
summon->SetDisableGravity(true);
- summon->SetSpeed(MOVE_FLIGHT, 2.5f);
+ summon->SetSpeedRate(MOVE_FLIGHT, 2.5f);
if (victim)
AttackStartNoMove(victim);
}
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
index 499550945c6..2592ed3b262 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
@@ -180,24 +180,23 @@ class boss_grand_warlock_nethekurse : public CreatureScript
}
void MoveInLineOfSight(Unit* who) override
-
{
if (!IntroOnce && me->IsWithinDistInMap(who, 30.0f))
- {
+ {
if (who->GetTypeId() != TYPEID_PLAYER)
return;
- Talk(SAY_INTRO);
- IntroOnce = true;
- IsIntroEvent = true;
+ Talk(SAY_INTRO);
+ IntroOnce = true;
+ IsIntroEvent = true;
- instance->SetBossState(DATA_NETHEKURSE, IN_PROGRESS);
- }
+ instance->SetBossState(DATA_NETHEKURSE, IN_PROGRESS);
+ }
- if (IsIntroEvent || !IsMainEvent)
- return;
+ if (IsIntroEvent || !IsMainEvent)
+ return;
- ScriptedAI::MoveInLineOfSight(who);
+ ScriptedAI::MoveInLineOfSight(who);
}
void EnterCombat(Unit* /*who*/) override
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
index 4faab709e16..c29d560529d 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
@@ -109,7 +109,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript
{
removeAdds();
_Reset();
- me->SetSpeed(MOVE_RUN, 2);
+ me->SetSpeedRate(MOVE_RUN, 2);
me->SetWalk(false);
Initialize();
@@ -231,7 +231,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript
{
// stop bladedance
InBlade = false;
- me->SetSpeed(MOVE_RUN, 2);
+ me->SetSpeedRate(MOVE_RUN, 2);
me->GetMotionMaster()->MoveChase(me->GetVictim());
Blade_Dance_Timer = 30000;
Wait_Timer = 0;
@@ -264,7 +264,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript
Wait_Timer = 1;
InBlade = true;
Blade_Dance_Timer = 0;
- me->SetSpeed(MOVE_RUN, 4);
+ me->SetSpeedRate(MOVE_RUN, 4);
return;
}
else
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
index 102d567e810..20d96ecd29c 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
@@ -130,7 +130,7 @@ class boss_alar : public CreatureScript
_Reset();
me->SetDisplayId(me->GetNativeDisplayId());
- me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
+ me->SetSpeedRate(MOVE_RUN, DefaultMoveSpeedRate);
//me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
//me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
@@ -178,7 +178,7 @@ class boss_alar : public CreatureScript
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->AttackStop();
me->SetTarget(ObjectGuid::Empty);
- me->SetSpeed(MOVE_RUN, 5.0f);
+ me->SetSpeedRate(MOVE_RUN, 5.0f);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]);
}
@@ -261,7 +261,7 @@ class boss_alar : public CreatureScript
case WE_REVIVE:
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
me->SetFullHealth();
- me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
+ me->SetSpeedRate(MOVE_RUN, DefaultMoveSpeedRate);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
DoZoneInCombat();
DoCast(me, SPELL_REBIRTH, true);
@@ -289,6 +289,7 @@ class boss_alar : public CreatureScript
me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f);
me->StopMoving();
WaitEvent = WE_LAND;
+ return;
}
else
{
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
index 9fd1c5c7388..30b3fd67687 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp
@@ -325,86 +325,85 @@ class boss_high_astromancer_solarian : public CreatureScript
else
Phase1_Timer-=diff;
}
- else
- if (Phase == 2)
+ else if (Phase == 2)
+ {
+ //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals.
+ me->AttackStop();
+ me->StopMoving();
+ if (Phase2_Timer <= diff)
{
- //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals.
- me->AttackStop();
- me->StopMoving();
- if (Phase2_Timer <= diff)
- {
- Phase = 3;
- for (int i=0; i <= 2; ++i)
- for (int j=1; j <= 4; j++)
- SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]);
+ Phase = 3;
+ for (int i=0; i <= 2; ++i)
+ for (int j=1; j <= 4; j++)
+ SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]);
- Talk(SAY_SUMMON1);
- Phase2_Timer = 10000;
- }
- else
- Phase2_Timer -= diff;
+ Talk(SAY_SUMMON1);
+ Phase2_Timer = 10000;
}
else
- if (Phase == 3)
- {
- me->AttackStop();
- me->StopMoving();
- //Check Phase3_Timer
- if (Phase3_Timer <= diff)
- {
- Phase = 1;
- //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals.
- int i = rand32() % 3;
- me->GetMotionMaster()->Clear();
- me->SetPosition(Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
-
- for (int j=0; j <= 2; j++)
- if (j != i)
- SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]);
-
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetVisible(true);
-
- Talk(SAY_SUMMON2);
- AppearDelay = true;
- Phase3_Timer = 15000;
- }
- else
- Phase3_Timer -= diff;
- }
- else
- if (Phase == 4)
- {
- //Fear_Timer
- if (Fear_Timer <= diff)
- {
- DoCast(me, SPELL_FEAR);
- Fear_Timer = 20000;
- }
- else
- Fear_Timer -= diff;
- //VoidBolt_Timer
- if (VoidBolt_Timer <= diff)
- {
- DoCastVictim(SPELL_VOID_BOLT);
- VoidBolt_Timer = 10000;
- }
- else
- VoidBolt_Timer -= diff;
- }
- //When Solarian reaches 20% she will transform into a huge void walker.
- if (Phase != 4 && me->HealthBelowPct(20))
- {
- Phase = 4;
- //To make sure she wont be invisible or not selecatble
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetVisible(true);
- Talk(SAY_VOIDA);
- Talk(SAY_VOIDB);
- me->SetArmor(WV_ARMOR);
- me->SetDisplayId(MODEL_VOIDWALKER);
- me->SetObjectScale(defaultsize*2.5f);
- }
+ Phase2_Timer -= diff;
+ }
+ else if (Phase == 3)
+ {
+ me->AttackStop();
+ me->StopMoving();
+ //Check Phase3_Timer
+ if (Phase3_Timer <= diff)
+ {
+ Phase = 1;
+ //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals.
+ int i = rand32() % 3;
+ me->GetMotionMaster()->Clear();
+ me->SetPosition(Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
+
+ for (int j=0; j <= 2; j++)
+ if (j != i)
+ SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]);
+
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisible(true);
+
+ Talk(SAY_SUMMON2);
+ AppearDelay = true;
+ Phase3_Timer = 15000;
+ }
+ else
+ Phase3_Timer -= diff;
+ }
+ else if (Phase == 4)
+ {
+ //Fear_Timer
+ if (Fear_Timer <= diff)
+ {
+ DoCast(me, SPELL_FEAR);
+ Fear_Timer = 20000;
+ }
+ else
+ Fear_Timer -= diff;
+ //VoidBolt_Timer
+ if (VoidBolt_Timer <= diff)
+ {
+ DoCastVictim(SPELL_VOID_BOLT);
+ VoidBolt_Timer = 10000;
+ }
+ else
+ VoidBolt_Timer -= diff;
+ }
+
+ //When Solarian reaches 20% she will transform into a huge void walker.
+ if (Phase != 4 && me->HealthBelowPct(20))
+ {
+ Phase = 4;
+ //To make sure she wont be invisible or not selecatble
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetVisible(true);
+ Talk(SAY_VOIDA);
+ Talk(SAY_VOIDB);
+ me->SetArmor(WV_ARMOR);
+ me->SetDisplayId(MODEL_VOIDWALKER);
+ me->SetObjectScale(defaultsize*2.5f);
+ }
+
DoMeleeAttackIfReady();
}
};
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
index e5812390bd2..be27932e6b4 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
@@ -144,6 +144,7 @@ enum Spells
// Thaladred the Darkener spells
SPELL_PSYCHIC_BLOW = 10689,
SPELL_SILENCE = 30225,
+ SPELL_REND = 36965,
// Lord Sanguinar spells
SPELL_BELLOWING_ROAR = 40636,
// Grand Astromancer Capernian spells
@@ -881,11 +882,13 @@ class boss_thaladred_the_darkener : public CreatureScript
{
Gaze_Timer = 100;
Silence_Timer = 20000;
+ Rend_Timer = 4000;
PsychicBlow_Timer = 10000;
}
uint32 Gaze_Timer;
uint32 Silence_Timer;
+ uint32 Rend_Timer;
uint32 PsychicBlow_Timer;
void Reset() override
@@ -939,6 +942,15 @@ class boss_thaladred_the_darkener : public CreatureScript
else
Silence_Timer -= diff;
+ //Rend_Timer
+ if (Rend_Timer <= diff)
+ {
+ DoCastVictim(SPELL_REND);
+ Rend_Timer = 4000;
+ }
+ else
+ Rend_Timer -= diff;
+
//PsychicBlow_Timer
if (PsychicBlow_Timer <= diff)
{
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
index 46388c3a185..edfa2aedf92 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -16,13 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Boss_Void_Reaver
-SD%Complete: 90
-SDComment: Should reset if raid are out of room.
-SDCategory: Tempest Keep, The Eye
-EndScriptData */
-
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "the_eye.h"
@@ -43,10 +35,17 @@ enum Spells
SPELL_BERSERK = 27680
};
+enum Events
+{
+ EVENT_POUNDING = 1,
+ EVENT_ARCANE_ORB,
+ EVENT_KNOCK_AWAY,
+ EVENT_BERSERK
+};
+
class boss_void_reaver : public CreatureScript
{
public:
-
boss_void_reaver() : CreatureScript("boss_void_reaver") { }
struct boss_void_reaverAI : public BossAI
@@ -58,21 +57,9 @@ class boss_void_reaver : public CreatureScript
void Initialize()
{
- Pounding_Timer = 15000;
- ArcaneOrb_Timer = 3000;
- KnockAway_Timer = 30000;
- Berserk_Timer = 600000;
-
Enraged = false;
}
- uint32 Pounding_Timer;
- uint32 ArcaneOrb_Timer;
- uint32 KnockAway_Timer;
- uint32 Berserk_Timer;
-
- bool Enraged;
-
void Reset() override
{
Initialize();
@@ -95,71 +82,84 @@ class boss_void_reaver : public CreatureScript
{
Talk(SAY_AGGRO);
_EnterCombat();
+
+ events.ScheduleEvent(EVENT_POUNDING, 15000);
+ events.ScheduleEvent(EVENT_ARCANE_ORB, 3000);
+ events.ScheduleEvent(EVENT_KNOCK_AWAY, 30000);
+ events.ScheduleEvent(EVENT_BERSERK, 600000);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
- // Pounding
- if (Pounding_Timer <= diff)
- {
- DoCastVictim(SPELL_POUNDING);
- Talk(SAY_POUNDING);
- Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000)
- }
- else
- Pounding_Timer -= diff;
- // Arcane Orb
- if (ArcaneOrb_Timer <= diff)
- {
- Unit* target = NULL;
- std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
- std::vector<Unit*> target_list;
- for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
- if (!target)
- continue;
- // exclude pets & totems, 18 yard radius minimum
- if (target->GetTypeId() == TYPEID_PLAYER && target->IsAlive() && !target->IsWithinDist(me, 18, false))
- target_list.push_back(target);
- target = NULL;
- }
- if (!target_list.empty())
- target = *(target_list.begin() + rand32() % target_list.size());
- else
- target = me->GetVictim();
+ events.Update(diff);
- if (target)
- me->CastSpell(target, SPELL_ARCANE_ORB, false, NULL, NULL);
- ArcaneOrb_Timer = 3000;
- }
- else
- ArcaneOrb_Timer -= diff;
- // Single Target knock back, reduces aggro
- if (KnockAway_Timer <= diff)
- {
- DoCastVictim(SPELL_KNOCK_AWAY);
- //Drop 25% aggro
- if (DoGetThreat(me->GetVictim()))
- DoModifyThreatPercent(me->GetVictim(), -25);
- KnockAway_Timer = 30000;
- }
- else
- KnockAway_Timer -= diff;
- //Berserk
- if (Berserk_Timer < diff && !Enraged)
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
{
- DoCast(me, SPELL_BERSERK);
- Enraged = true;
+ switch (eventId)
+ {
+ case EVENT_POUNDING:
+ DoCastVictim(SPELL_POUNDING);
+ Talk(SAY_POUNDING);
+ events.ScheduleEvent(EVENT_POUNDING, 15000);
+ break;
+ case EVENT_ARCANE_ORB:
+ {
+ Unit* target = NULL;
+ std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
+ std::vector<Unit*> target_list;
+ for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr != t_list.end(); ++itr)
+ {
+ target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
+ if (!target)
+ continue;
+ // exclude pets & totems, 18 yard radius minimum
+ if (target->GetTypeId() == TYPEID_PLAYER && target->IsAlive() && !target->IsWithinDist(me, 18, false))
+ target_list.push_back(target);
+ target = NULL;
+ }
+
+ if (!target_list.empty())
+ target = *(target_list.begin() + rand32() % target_list.size());
+ else
+ target = me->GetVictim();
+
+ if (target)
+ me->CastSpell(target, SPELL_ARCANE_ORB, false, NULL, NULL);
+
+ events.ScheduleEvent(EVENT_ARCANE_ORB, 3000);
+ break;
+ }
+ case EVENT_KNOCK_AWAY:
+ DoCastVictim(SPELL_KNOCK_AWAY);
+ // Drop 25% aggro
+ if (DoGetThreat(me->GetVictim()))
+ DoModifyThreatPercent(me->GetVictim(), -25);
+
+ events.ScheduleEvent(EVENT_KNOCK_AWAY, 30000);
+ break;
+ case EVENT_BERSERK:
+ if (!Enraged)
+ {
+ DoCast(me, SPELL_BERSERK);
+ Enraged = true;
+ }
+ break;
+ default:
+ break;
+ }
}
- else
- Berserk_Timer -= diff;
DoMeleeAttackIfReady();
}
+
+ private:
+ bool Enraged;
};
CreatureAI* GetAI(Creature* creature) const override
diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
index 3aa2674aec6..d45e17bd28d 100644
--- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
@@ -176,7 +176,7 @@ class npc_ragin_flames : public CreatureScript
Initialize();
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
- me->SetSpeed(MOVE_RUN, DUNGEON_MODE(0.5f, 0.7f));
+ me->SetSpeedRate(MOVE_RUN, DUNGEON_MODE(0.5f, 0.7f));
}
void EnterCombat(Unit* /*who*/) override
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
index cab5b9efbc3..f4ff9f7084c 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
@@ -537,7 +537,7 @@ class npc_zerekethvoidzone : public CreatureScript
void Reset() override
{
- me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
me->setFaction(16);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
index 856649c6c5e..b9e7fb0034d 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
@@ -103,7 +103,7 @@ class npc_warp_splinter_treant : public CreatureScript
{
if (Unit* Warp = ObjectAccessor::GetUnit(*me, WarpGuid))
{
- if (me->IsWithinMeleeRange(Warp, 2.5f))
+ if (me->IsWithinMeleeRange(Warp))
{
int32 CurrentHP_Treant = (int32)me->GetHealth();
Warp->CastCustomSpell(Warp, SPELL_HEAL_FATHER, &CurrentHP_Treant, 0, 0, true, 0, 0, me->GetGUID());
@@ -167,7 +167,7 @@ class boss_warp_splinter : public CreatureScript
{
Initialize();
- me->SetSpeed(MOVE_RUN, 0.7f, true);
+ me->SetSpeedRate(MOVE_RUN, 0.7f);
}
void EnterCombat(Unit* /*who*/) override
diff --git a/src/server/scripts/Outland/outland_script_loader.cpp b/src/server/scripts/Outland/outland_script_loader.cpp
new file mode 100644
index 00000000000..ed2c21da6c3
--- /dev/null
+++ b/src/server/scripts/Outland/outland_script_loader.cpp
@@ -0,0 +1,258 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+// Auchindoun - Auchenai Crypts
+void AddSC_boss_shirrak_the_dead_watcher();
+void AddSC_boss_exarch_maladaar();
+void AddSC_instance_auchenai_crypts();
+
+// Auchindoun - Mana Tombs
+void AddSC_boss_pandemonius();
+void AddSC_boss_nexusprince_shaffar();
+void AddSC_instance_mana_tombs();
+
+// Auchindoun - Sekketh Halls
+void AddSC_boss_darkweaver_syth();
+void AddSC_boss_talon_king_ikiss();
+void AddSC_boss_anzu();
+void AddSC_instance_sethekk_halls();
+
+// Auchindoun - Shadow Labyrinth
+void AddSC_boss_ambassador_hellmaw();
+void AddSC_boss_blackheart_the_inciter();
+void AddSC_boss_grandmaster_vorpil();
+void AddSC_boss_murmur();
+void AddSC_instance_shadow_labyrinth();
+
+// Black Temple
+void AddSC_black_temple();
+void AddSC_boss_illidan();
+void AddSC_boss_shade_of_akama();
+void AddSC_boss_supremus();
+void AddSC_boss_gurtogg_bloodboil();
+void AddSC_boss_mother_shahraz();
+void AddSC_boss_reliquary_of_souls();
+void AddSC_boss_teron_gorefiend();
+void AddSC_boss_najentus();
+void AddSC_boss_illidari_council();
+void AddSC_instance_black_temple();
+
+// Coilfang Reservoir - Serpent Shrine Cavern
+void AddSC_boss_fathomlord_karathress();
+void AddSC_boss_hydross_the_unstable();
+void AddSC_boss_lady_vashj();
+void AddSC_boss_leotheras_the_blind();
+void AddSC_boss_morogrim_tidewalker();
+void AddSC_instance_serpentshrine_cavern();
+void AddSC_boss_the_lurker_below();
+
+// Coilfang Reservoir - The Steam Vault
+void AddSC_boss_hydromancer_thespia();
+void AddSC_boss_mekgineer_steamrigger();
+void AddSC_boss_warlord_kalithresh();
+void AddSC_instance_steam_vault();
+
+// Coilfang Reservoir - The Slave Pens
+void AddSC_instance_the_slave_pens();
+void AddSC_boss_mennu_the_betrayer();
+void AddSC_boss_rokmar_the_crackler();
+void AddSC_boss_quagmirran();
+void AddSC_boss_ahune();
+
+// Coilfang Reservoir - The Underbog
+void AddSC_instance_the_underbog();
+void AddSC_boss_hungarfen();
+void AddSC_boss_the_black_stalker();
+
+// Gruul's Lair
+void AddSC_boss_gruul();
+void AddSC_boss_high_king_maulgar();
+void AddSC_instance_gruuls_lair();
+void AddSC_boss_broggok(); //HC Blood Furnace
+void AddSC_boss_kelidan_the_breaker();
+void AddSC_boss_the_maker();
+void AddSC_instance_blood_furnace();
+void AddSC_boss_magtheridon(); //HC Magtheridon's Lair
+void AddSC_instance_magtheridons_lair();
+void AddSC_boss_grand_warlock_nethekurse(); //HC Shattered Halls
+void AddSC_boss_warbringer_omrogg();
+void AddSC_boss_warchief_kargath_bladefist();
+void AddSC_shattered_halls();
+void AddSC_instance_shattered_halls();
+void AddSC_boss_watchkeeper_gargolmar(); //HC Ramparts
+void AddSC_boss_omor_the_unscarred();
+void AddSC_boss_vazruden_the_herald();
+void AddSC_instance_ramparts();
+void AddSC_arcatraz(); //TK Arcatraz
+void AddSC_boss_zereketh_the_unbound();
+void AddSC_boss_dalliah_the_doomsayer();
+void AddSC_boss_wrath_scryer_soccothrates();
+void AddSC_boss_harbinger_skyriss();
+void AddSC_instance_arcatraz();
+void AddSC_boss_high_botanist_freywinn(); //TK Botanica
+void AddSC_boss_laj();
+void AddSC_boss_warp_splinter();
+void AddSC_boss_thorngrin_the_tender();
+void AddSC_boss_commander_sarannis();
+void AddSC_instance_the_botanica();
+void AddSC_boss_alar(); //TK The Eye
+void AddSC_boss_kaelthas();
+void AddSC_boss_void_reaver();
+void AddSC_boss_high_astromancer_solarian();
+void AddSC_instance_the_eye();
+void AddSC_the_eye();
+void AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar
+void AddSC_boss_gatewatcher_gyrokill();
+void AddSC_boss_nethermancer_sepethrea();
+void AddSC_boss_pathaleon_the_calculator();
+void AddSC_boss_mechano_lord_capacitus();
+void AddSC_instance_mechanar();
+
+void AddSC_blades_edge_mountains();
+void AddSC_boss_doomlordkazzak();
+void AddSC_boss_doomwalker();
+void AddSC_hellfire_peninsula();
+void AddSC_nagrand();
+void AddSC_netherstorm();
+void AddSC_shadowmoon_valley();
+void AddSC_shattrath_city();
+void AddSC_terokkar_forest();
+void AddSC_zangarmarsh();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddOutlandScripts()
+{
+ // Auchindoun - Auchenai Crypts
+ AddSC_boss_shirrak_the_dead_watcher();
+ AddSC_boss_exarch_maladaar();
+ AddSC_instance_auchenai_crypts();
+
+ // Auchindoun - Mana Tombs
+ AddSC_boss_pandemonius();
+ AddSC_boss_nexusprince_shaffar();
+ AddSC_instance_mana_tombs();
+
+ // Auchindoun - Sekketh Halls
+ AddSC_boss_darkweaver_syth();
+ AddSC_boss_talon_king_ikiss();
+ AddSC_boss_anzu();
+ AddSC_instance_sethekk_halls();
+
+ // Auchindoun - Shadow Labyrinth
+ AddSC_boss_ambassador_hellmaw();
+ AddSC_boss_blackheart_the_inciter();
+ AddSC_boss_grandmaster_vorpil();
+ AddSC_boss_murmur();
+ AddSC_instance_shadow_labyrinth();
+
+ // Black Temple
+ AddSC_black_temple();
+ AddSC_boss_illidan();
+ AddSC_boss_shade_of_akama();
+ AddSC_boss_supremus();
+ AddSC_boss_gurtogg_bloodboil();
+ AddSC_boss_mother_shahraz();
+ AddSC_boss_reliquary_of_souls();
+ AddSC_boss_teron_gorefiend();
+ AddSC_boss_najentus();
+ AddSC_boss_illidari_council();
+ AddSC_instance_black_temple();
+
+ // Coilfang Reservoir - Serpent Shrine Cavern
+ AddSC_boss_fathomlord_karathress();
+ AddSC_boss_hydross_the_unstable();
+ AddSC_boss_lady_vashj();
+ AddSC_boss_leotheras_the_blind();
+ AddSC_boss_morogrim_tidewalker();
+ AddSC_instance_serpentshrine_cavern();
+ AddSC_boss_the_lurker_below();
+
+ // Coilfang Reservoir - The Steam Vault
+ AddSC_instance_steam_vault();
+ AddSC_boss_hydromancer_thespia();
+ AddSC_boss_mekgineer_steamrigger();
+ AddSC_boss_warlord_kalithresh();
+
+ // Coilfang Reservoir - The Slave Pens
+ AddSC_instance_the_slave_pens();
+ AddSC_boss_mennu_the_betrayer();
+ AddSC_boss_rokmar_the_crackler();
+ AddSC_boss_quagmirran();
+ AddSC_boss_ahune();
+
+ // Coilfang Reservoir - The Underbog
+ AddSC_instance_the_underbog();
+ AddSC_boss_hungarfen();
+ AddSC_boss_the_black_stalker();
+
+ // Gruul's Lair
+ AddSC_boss_gruul();
+ AddSC_boss_high_king_maulgar();
+ AddSC_instance_gruuls_lair();
+ AddSC_boss_broggok(); //HC Blood Furnace
+ AddSC_boss_kelidan_the_breaker();
+ AddSC_boss_the_maker();
+ AddSC_instance_blood_furnace();
+ AddSC_boss_magtheridon(); //HC Magtheridon's Lair
+ AddSC_instance_magtheridons_lair();
+ AddSC_boss_grand_warlock_nethekurse(); //HC Shattered Halls
+ AddSC_boss_warbringer_omrogg();
+ AddSC_boss_warchief_kargath_bladefist();
+ AddSC_shattered_halls();
+ AddSC_instance_shattered_halls();
+ AddSC_boss_watchkeeper_gargolmar(); //HC Ramparts
+ AddSC_boss_omor_the_unscarred();
+ AddSC_boss_vazruden_the_herald();
+ AddSC_instance_ramparts();
+ AddSC_arcatraz(); //TK Arcatraz
+ AddSC_boss_zereketh_the_unbound();
+ AddSC_boss_dalliah_the_doomsayer();
+ AddSC_boss_wrath_scryer_soccothrates();
+ AddSC_boss_harbinger_skyriss();
+ AddSC_instance_arcatraz();
+ AddSC_boss_high_botanist_freywinn(); //TK Botanica
+ AddSC_boss_laj();
+ AddSC_boss_warp_splinter();
+ AddSC_boss_thorngrin_the_tender();
+ AddSC_boss_commander_sarannis();
+ AddSC_instance_the_botanica();
+ AddSC_boss_alar(); //TK The Eye
+ AddSC_boss_kaelthas();
+ AddSC_boss_void_reaver();
+ AddSC_boss_high_astromancer_solarian();
+ AddSC_instance_the_eye();
+ AddSC_the_eye();
+ AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar
+ AddSC_boss_gatewatcher_gyrokill();
+ AddSC_boss_nethermancer_sepethrea();
+ AddSC_boss_pathaleon_the_calculator();
+ AddSC_boss_mechano_lord_capacitus();
+ AddSC_instance_mechanar();
+
+ AddSC_blades_edge_mountains();
+ AddSC_boss_doomlordkazzak();
+ AddSC_boss_doomwalker();
+ AddSC_hellfire_peninsula();
+ AddSC_nagrand();
+ AddSC_netherstorm();
+ AddSC_shadowmoon_valley();
+ AddSC_shattrath_city();
+ AddSC_terokkar_forest();
+ AddSC_zangarmarsh();
+}
diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
index 30bf085be43..9074f1ea373 100644
--- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
+++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
@@ -959,7 +959,7 @@ public:
{
// Spell 37392 does not exist in dbc, manually spawning
me->SummonCreature(NPC_OSCILLATING_FREQUENCY_SCANNER_TOP_BUNNY, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 0.5f, me->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 50000);
- me->SummonGameObject(GO_OSCILLATING_FREQUENCY_SCANNER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 50);
+ me->SummonGameObject(GO_OSCILLATING_FREQUENCY_SCANNER, *me, G3D::Quat(), 50);
me->DespawnOrUnsummon(50000);
}
diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
index 404cdc7ceb2..668c484dd63 100644
--- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
+++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
@@ -159,7 +159,7 @@ public:
else
TC_LOG_ERROR("scripts", "TRINITY: npc_ancestral_wolf can not obtain owner or owner is not a player.");
- creature->SetSpeed(MOVE_WALK, 1.5f);
+ creature->SetSpeedRate(MOVE_WALK, 1.5f);
Reset();
}
@@ -192,7 +192,7 @@ public:
if (ryga->IsAlive() && !ryga->IsInCombat())
{
ryga->SetWalk(true);
- ryga->SetSpeed(MOVE_WALK, 1.5f);
+ ryga->SetSpeedRate(MOVE_WALK, 1.5f);
ryga->GetMotionMaster()->MovePoint(0, 517.340698f, 3885.03975f, 190.455978f, true);
Reset();
}
@@ -778,7 +778,7 @@ public:
me->AddAura(SPELL_JULES_THREATENS_AURA, me);
me->SetCanFly(true);
- me->SetSpeed(MOVE_RUN, 0.2f);
+ me->SetSpeedRate(MOVE_RUN, 0.2f);
me->SetFacingTo(3.207566f);
me->GetMotionMaster()->MoveJump(exorcismPos[2], 2.0f, 2.0f);
@@ -798,7 +798,7 @@ public:
break;
case ACTION_JULES_MOVE_HOME:
wpreached = false;
- me->SetSpeed(MOVE_RUN, 1.0f);
+ me->SetSpeedRate(MOVE_RUN, 1.0f);
me->GetMotionMaster()->MovePoint(11, exorcismPos[2]);
events.CancelEvent(EVENT_SUMMON_SKULL);
diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp
index d35dedb5d27..8803ce9d9ed 100644
--- a/src/server/scripts/Outland/zone_netherstorm.cpp
+++ b/src/server/scripts/Outland/zone_netherstorm.cpp
@@ -19,7 +19,7 @@
/* ScriptData
SDName: Netherstorm
SD%Complete: 80
-SDComment: Quest support: 10337, 10438, 10652 (special flight paths), 10198, 10191
+SDComment: Quest support: 10337, 10652 (special flight paths), 10198, 10191
SDCategory: Netherstorm
EndScriptData */
@@ -335,56 +335,6 @@ public:
};
/*######
-## npc_professor_dabiri
-######*/
-enum ProfessorDabiriData
-{
- SPELL_PHASE_DISTRUPTOR = 35780,
-
- //WHISPER_DABIRI = 0, not existing in database
-
- QUEST_DIMENSIUS = 10439,
- QUEST_ON_NETHERY_WINGS = 10438,
-};
-
-#define GOSSIP_ITEM "I need a new phase distruptor, Professor"
-
-class npc_professor_dabiri : public CreatureScript
-{
-public:
- npc_professor_dabiri() : CreatureScript("npc_professor_dabiri") { }
-
- //OnQuestAccept:
- //if (quest->GetQuestId() == QUEST_DIMENSIUS)
- //creature->AI()->Talk(WHISPER_DABIRI, player);
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- creature->CastSpell(player, SPELL_PHASE_DISTRUPTOR, false);
- player->CLOSE_GOSSIP_MENU();
- }
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
-/*######
## npc_phase_hunter
######*/
@@ -752,7 +702,6 @@ void AddSC_netherstorm()
{
new npc_commander_dawnforge();
new at_commander_dawnforge();
- new npc_professor_dabiri();
new npc_phase_hunter();
new npc_bessy();
new npc_maxx_a_million_escort();
diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
index 7ea87a3c0c4..c91e5c94ca0 100644
--- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
@@ -19,7 +19,7 @@
/* ScriptData
SDName: Shadowmoon_Valley
SD%Complete: 100
-SDComment: Quest support: 10583, 10601, 10804, 10854, 10458, 10481, 10480, 10781, 10451. Vendor Drake Dealer Hurlunk.
+SDComment: Quest support: 10804, 10854, 10458, 10481, 10480, 10781, 10451.
SDCategory: Shadowmoon Valley
EndScriptData */
@@ -28,9 +28,6 @@ npc_invis_infernal_caster
npc_infernal_attacker
npc_mature_netherwing_drake
npc_enslaved_netherwing_drake
-npc_drake_dealer_hurlunk
-npcs_flanis_swiftwing_and_kagrosh
-npc_karynaku
npc_earthmender_wilda
npc_torloth_the_magnificent
npc_illidari_spawn
@@ -90,8 +87,10 @@ public:
void SummonInfernal()
{
- Creature* infernal = me->SummonCreature(NPC_INFERNAL_ATTACKER, me->GetPositionX(), me->GetPositionY(), ground + 0.05f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
- infernalGUID = infernal->GetGUID();
+ if (Creature* infernal = me->SummonCreature(NPC_INFERNAL_ATTACKER, me->GetPositionX(), me->GetPositionY(), ground + 0.05f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000))
+ infernalGUID = infernal->GetGUID();
+ else
+ infernalGUID = ObjectGuid::Empty;
}
void UpdateAI(uint32 diff) override
@@ -568,117 +567,6 @@ public:
};
};
-/*######
-## npc_drake_dealer_hurlunk
-######*/
-
-class npc_drake_dealer_hurlunk : public CreatureScript
-{
-public:
- npc_drake_dealer_hurlunk() : CreatureScript("npc_drake_dealer_hurlunk") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_TRADE)
- player->GetSession()->SendListInventory(creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsVendor() && player->GetReputationRank(1015) == REP_EXALTED)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
-/*######
-## npc_flanis_swiftwing_and_kagrosh
-######*/
-
-#define GOSSIP_HSK1 "Take Flanis's Pack"
-#define GOSSIP_HSK2 "Take Kagrosh's Pack"
-
-class npcs_flanis_swiftwing_and_kagrosh : public CreatureScript
-{
-public:
- npcs_flanis_swiftwing_and_kagrosh() : CreatureScript("npcs_flanis_swiftwing_and_kagrosh") { }
-
- bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30658, 1, NULL);
- if (msg == EQUIP_ERR_OK)
- {
- player->StoreNewItem(dest, 30658, true);
- player->PlayerTalkClass->ClearMenus();
- }
- }
- if (action == GOSSIP_ACTION_INFO_DEF+2)
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30659, 1, NULL);
- if (msg == EQUIP_ERR_OK)
- {
- player->StoreNewItem(dest, 30659, true);
- player->PlayerTalkClass->ClearMenus();
- }
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (player->GetQuestStatus(10583) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(30658, 1, true))
- player->ADD_GOSSIP_ITEM(0, GOSSIP_HSK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- if (player->GetQuestStatus(10601) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(30659, 1, true))
- player->ADD_GOSSIP_ITEM(0, GOSSIP_HSK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
-/*######
-# npc_karynaku
-####*/
-
-enum Karynaku
-{
- QUEST_ALLY_OF_NETHER = 10870,
- QUEST_ZUHULED_THE_WACK = 10866,
-
- NPC_ZUHULED_THE_WACKED = 11980,
-
- TAXI_PATH_ID = 649,
-};
-
-class npc_karynaku : public CreatureScript
-{
- public:
- npc_karynaku() : CreatureScript("npc_karynaku") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
- {
- if (quest->GetQuestId() == QUEST_ALLY_OF_NETHER)
- player->ActivateTaxiPathTo(TAXI_PATH_ID);
-
- if (quest->GetQuestId() == QUEST_ZUHULED_THE_WACK)
- creature->SummonCreature(NPC_ZUHULED_THE_WACKED, -4204.94f, 316.397f, 122.508f, 1.309f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
-
- return true;
- }
-};
-
/*####
# npc_earthmender_wilda
####*/
@@ -1701,9 +1589,6 @@ void AddSC_shadowmoon_valley()
new npc_mature_netherwing_drake();
new npc_enslaved_netherwing_drake();
new npc_dragonmaw_peon();
- new npc_drake_dealer_hurlunk();
- new npcs_flanis_swiftwing_and_kagrosh();
- new npc_karynaku();
new npc_earthmender_wilda();
new npc_lord_illidan_stormrage();
new go_crystal_prison();
diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp
index c734d000077..e4e51a98348 100644
--- a/src/server/scripts/Outland/zone_shattrath_city.cpp
+++ b/src/server/scripts/Outland/zone_shattrath_city.cpp
@@ -29,7 +29,6 @@ npc_salsalabim
npc_shattrathflaskvendors
npc_zephyr
npc_kservant
-npc_ishanah
EndContentData */
#include "ScriptMgr.h"
@@ -43,13 +42,15 @@ EndContentData */
## npc_raliq_the_drunk
######*/
-#define GOSSIP_RALIQ "You owe Sim'salabim money. Hand them over or die!"
-
-enum Raliq
+enum RaliqTheDrunk
{
- SPELL_UPPERCUT = 10966,
- QUEST_CRACK_SKULLS = 10009,
- FACTION_HOSTILE_RD = 45
+ SAY_RALIQ_ATTACK = 0,
+ OPTION_ID_COLLECT_A_DEBT = 0,
+ FACTION_OGRE_HOSTILE = 45,
+ MENU_ID_COLLECT_A_DEBT = 7729,
+ NPC_TEXT_WUT_YOU_WANT = 9440,
+ CRACKIN_SOME_SKULLS = 10009,
+ SPELL_UPPERCUT = 10966
};
class npc_raliq_the_drunk : public CreatureScript
@@ -63,7 +64,8 @@ public:
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
- creature->setFaction(FACTION_HOSTILE_RD);
+ creature->setFaction(FACTION_OGRE_HOSTILE);
+ creature->AI()->Talk(SAY_RALIQ_ATTACK, player);
creature->AI()->AttackStart(player);
}
return true;
@@ -71,10 +73,16 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
- if (player->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_RALIQ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(9440, creature->GetGUID());
+ if (player->GetQuestStatus(CRACKIN_SOME_SKULLS) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM_DB(MENU_ID_COLLECT_A_DEBT, OPTION_ID_COLLECT_A_DEBT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(NPC_TEXT_WUT_YOU_WANT, creature->GetGUID());
+ }
+ else
+ {
+ player->PlayerTalkClass->ClearMenus();
+ player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
+ }
return true;
}
@@ -125,16 +133,14 @@ public:
enum Salsalabim
{
- // Factions
- FACTION_HOSTILE_SA = 90,
- FACTION_FRIENDLY_SA = 35,
-
- // Quests
- QUEST_10004 = 10004,
-
- // Spells
- SPELL_MAGNETIC_PULL = 31705
-
+ SAY_DEMONIC_AGGRO = 0,
+ OPTION_ID_ALTRUIS_SENT_ME = 0,
+ FACTION_FRIENDLY = 35,
+ FACTION_DEMON_HOSTILE = 90,
+ MENU_ID_ALTRUIS_SENT_ME = 7725,
+ NPC_TEXT_SAL_GROWLS_AT_YOU = 9435,
+ PATIENCE_AND_UNDERSTANDING = 10004,
+ SPELL_MAGNETIC_PULL = 31705
};
class npc_salsalabim : public CreatureScript
@@ -142,13 +148,26 @@ class npc_salsalabim : public CreatureScript
public:
npc_salsalabim() : CreatureScript("npc_salsalabim") { }
- bool OnGossipHello(Player* player, Creature* creature) override
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
- if (player->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE)
+ player->PlayerTalkClass->ClearMenus();
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
{
- creature->setFaction(FACTION_HOSTILE_SA);
+ player->CLOSE_GOSSIP_MENU();
+ creature->setFaction(FACTION_DEMON_HOSTILE);
+ creature->AI()->Talk(SAY_DEMONIC_AGGRO, player);
creature->AI()->AttackStart(player);
}
+ return true;
+ }
+
+ bool OnGossipHello(Player* player, Creature* creature) override
+ {
+ if (player->GetQuestStatus(PATIENCE_AND_UNDERSTANDING) == QUEST_STATUS_INCOMPLETE)
+ {
+ player->ADD_GOSSIP_ITEM_DB(MENU_ID_ALTRUIS_SENT_ME, OPTION_ID_ALTRUIS_SENT_ME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(NPC_TEXT_SAL_GROWLS_AT_YOU, creature->GetGUID());
+ }
else
{
if (creature->IsQuestGiver())
@@ -187,7 +206,7 @@ public:
{
if (done_by->GetTypeId() == TYPEID_PLAYER && me->HealthBelowPctDamaged(20, damage))
{
- done_by->ToPlayer()->GroupEventHappens(QUEST_10004, me);
+ done_by->ToPlayer()->GroupEventHappens(PATIENCE_AND_UNDERSTANDING, me);
damage = 0;
EnterEvadeMode();
}
@@ -220,6 +239,19 @@ Purchase requires exalted reputation with Scryers/Aldor, Cenarion Expedition and
##################################################
*/
+enum FlaskVendors
+{
+ ALDOR_REPUTATION = 932,
+ SCRYERS_REPUTATION = 934,
+ THE_SHA_TAR_REPUTATION = 935,
+ CENARION_EXPEDITION_REP = 942,
+ NPC_TEXT_EXALTED_ALDOR = 11083, // (need to be exalted with Sha'tar, Cenarion Expedition and the Aldor)
+ NPC_TEXT_EXALTED_SCRYERS = 11084, // (need to be exalted with Sha'tar, Cenarion Expedition and the Scryers)
+ NPC_TEXT_WELCOME_NAME = 11085, // Access granted
+ ARCANIST_XORITH = 23483, // Scryer Apothecary
+ HALDOR_THE_COMPULSIVE = 23484 // Aldor Apothecary
+};
+
class npc_shattrathflaskvendors : public CreatureScript
{
public:
@@ -236,31 +268,31 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
- if (creature->GetEntry() == 23484)
+ if (creature->GetEntry() == HALDOR_THE_COMPULSIVE)
{
// Aldor vendor
- if (creature->IsVendor() && (player->GetReputationRank(932) == REP_EXALTED) && (player->GetReputationRank(935) == REP_EXALTED) && (player->GetReputationRank(942) == REP_EXALTED))
+ if (creature->IsVendor() && (player->GetReputationRank(ALDOR_REPUTATION) == REP_EXALTED) && (player->GetReputationRank(THE_SHA_TAR_REPUTATION) == REP_EXALTED) && (player->GetReputationRank(CENARION_EXPEDITION_REP) == REP_EXALTED))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(11085, creature->GetGUID());
+ player->SEND_GOSSIP_MENU(NPC_TEXT_WELCOME_NAME, creature->GetGUID());
}
else
{
- player->SEND_GOSSIP_MENU(11083, creature->GetGUID());
+ player->SEND_GOSSIP_MENU(NPC_TEXT_EXALTED_ALDOR, creature->GetGUID());
}
}
- if (creature->GetEntry() == 23483)
+ if (creature->GetEntry() == ARCANIST_XORITH)
{
// Scryers vendor
- if (creature->IsVendor() && (player->GetReputationRank(934) == REP_EXALTED) && (player->GetReputationRank(935) == REP_EXALTED) && (player->GetReputationRank(942) == REP_EXALTED))
+ if (creature->IsVendor() && (player->GetReputationRank(SCRYERS_REPUTATION) == REP_EXALTED) && (player->GetReputationRank(THE_SHA_TAR_REPUTATION) == REP_EXALTED) && (player->GetReputationRank(CENARION_EXPEDITION_REP) == REP_EXALTED))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(11085, creature->GetGUID());
+ player->SEND_GOSSIP_MENU(NPC_TEXT_WELCOME_NAME, creature->GetGUID());
}
else
{
- player->SEND_GOSSIP_MENU(11084, creature->GetGUID());
+ player->SEND_GOSSIP_MENU(NPC_TEXT_EXALTED_SCRYERS, creature->GetGUID());
}
}
@@ -272,7 +304,13 @@ public:
# npc_zephyr
######*/
-#define GOSSIP_HZ "Take me to the Caverns of Time."
+enum Zephyr
+{
+ OPTION_ID_TAKE_ME_TO_C_O_T = 0,
+ KEEPERS_OF_TIME_REPUTATION = 989,
+ MENU_ID_TAKE_ME_TO_C_O_T = 9205,
+ TELEPORT_CAVERNS_OF_TIME = 37778
+};
class npc_zephyr : public CreatureScript
{
@@ -283,15 +321,15 @@ public:
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF+1)
- player->CastSpell(player, 37778, false);
+ player->CastSpell(player, TELEPORT_CAVERNS_OF_TIME, false);
return true;
}
bool OnGossipHello(Player* player, Creature* creature) override
{
- if (player->GetReputationRank(989) >= REP_REVERED)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HZ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ if (player->GetReputationRank(KEEPERS_OF_TIME_REPUTATION) >= REP_REVERED)
+ player->ADD_GOSSIP_ITEM_DB(MENU_ID_TAKE_ME_TO_C_O_T, OPTION_ID_TAKE_ME_TO_C_O_T, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
@@ -305,28 +343,29 @@ public:
enum KServant
{
- SAY1 = 0,
- WHISP1 = 1,
- WHISP2 = 2,
- WHISP3 = 3,
- WHISP4 = 4,
- WHISP5 = 5,
- WHISP6 = 6,
- WHISP7 = 7,
- WHISP8 = 8,
- WHISP9 = 9,
- WHISP10 = 10,
- WHISP11 = 11,
- WHISP12 = 12,
- WHISP13 = 13,
- WHISP14 = 14,
- WHISP15 = 15,
- WHISP16 = 16,
- WHISP17 = 17,
- WHISP18 = 18,
- WHISP19 = 19,
- WHISP20 = 20,
- WHISP21 = 21
+ SAY1 = 0,
+ WHISP1 = 1,
+ WHISP2 = 2,
+ WHISP3 = 3,
+ WHISP4 = 4,
+ WHISP5 = 5,
+ WHISP6 = 6,
+ WHISP7 = 7,
+ WHISP8 = 8,
+ WHISP9 = 9,
+ WHISP10 = 10,
+ WHISP11 = 11,
+ WHISP12 = 12,
+ WHISP13 = 13,
+ WHISP14 = 14,
+ WHISP15 = 15,
+ WHISP16 = 16,
+ WHISP17 = 17,
+ WHISP18 = 18,
+ WHISP19 = 19,
+ WHISP20 = 20,
+ WHISP21 = 21,
+ CITY_OF_LIGHT = 10211
};
class npc_kservant : public CreatureScript
@@ -417,7 +456,7 @@ public:
break;
case 56:
Talk(WHISP21, player);
- player->GroupEventHappens(10211, me);
+ player->GroupEventHappens(CITY_OF_LIGHT, me);
break;
}
}
@@ -429,7 +468,7 @@ public:
return;
Player* player = who->ToPlayer();
- if (player && player->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE)
+ if (player && player->GetQuestStatus(CITY_OF_LIGHT) == QUEST_STATUS_INCOMPLETE)
{
float Radius = 10.0f;
if (me->IsWithinDistInMap(who, Radius))
@@ -443,43 +482,6 @@ public:
};
};
-/*######
-# npc_ishanah
-######*/
-
-#define ISANAH_GOSSIP_1 "Who are the Sha'tar?"
-#define ISANAH_GOSSIP_2 "Isn't Shattrath a draenei city? Why do you allow others here?"
-
-class npc_ishanah : public CreatureScript
-{
-public:
- npc_ishanah() : CreatureScript("npc_ishanah") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- player->SEND_GOSSIP_MENU(9458, creature->GetGUID());
- else if (action == GOSSIP_ACTION_INFO_DEF+2)
- player->SEND_GOSSIP_MENU(9459, creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
void AddSC_shattrath_city()
{
new npc_raliq_the_drunk();
@@ -487,5 +489,4 @@ void AddSC_shattrath_city()
new npc_shattrathflaskvendors();
new npc_zephyr();
new npc_kservant();
- new npc_ishanah();
}
diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp
index 06a8af947b7..4b757544d65 100644
--- a/src/server/scripts/Outland/zone_terokkar_forest.cpp
+++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp
@@ -27,7 +27,6 @@ EndScriptData */
npc_unkor_the_ruthless
npc_infested_root_walker
npc_rotting_forest_rager
-npc_netherweb_victim
npc_floon
npc_isla_starmane
npc_slim
@@ -47,13 +46,13 @@ EndContentData */
enum UnkorTheRuthless
{
- SAY_SUBMIT = 0,
-
- FACTION_HOSTILE = 45,
- FACTION_FRIENDLY = 35,
- QUEST_DONTKILLTHEFATONE = 9889,
-
- SPELL_PULVERIZE = 2676
+ SAY_SUBMIT = 0,
+ REQUIRED_KILL_COUNT = 10,
+ FACTION_FRIENDLY = 35,
+ FACTION_HOSTILE = 45,
+ SPELL_PULVERIZE = 2676,
+ QUEST_DONTKILLTHEFATONE = 9889,
+ NPC_BOULDERFIST_INVADER = 18260
};
class npc_unkor_the_ruthless : public CreatureScript
@@ -117,7 +116,7 @@ public:
Player* groupie = itr->GetSource();
if (groupie &&
groupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
- groupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
+ groupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, NPC_BOULDERFIST_INVADER) == REQUIRED_KILL_COUNT)
{
groupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
if (!CanDoQuest)
@@ -126,7 +125,7 @@ public:
}
}
else if (player->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
- player->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
+ player->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, NPC_BOULDERFIST_INVADER) == REQUIRED_KILL_COUNT)
{
player->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
CanDoQuest = true;
@@ -171,6 +170,11 @@ public:
## npc_infested_root_walker
######*/
+enum InfestedRootWalker
+{
+ SPELL_SUMMON_WOOD_MITES = 39130
+};
+
class npc_infested_root_walker : public CreatureScript
{
public:
@@ -194,7 +198,7 @@ public:
if (me->GetHealth() <= damage)
if (rand32() % 100 < 75)
//Summon Wood Mites
- DoCast(me, 39130, true);
+ DoCast(me, SPELL_SUMMON_WOOD_MITES, true);
}
};
};
@@ -202,6 +206,12 @@ public:
/*######
## npc_skywing
######*/
+
+enum Skywing
+{
+ QUEST_SKYWING = 10898
+};
+
class npc_skywing : public CreatureScript
{
public:
@@ -226,7 +236,7 @@ public:
switch (waypointId)
{
case 8:
- player->AreaExploredOrEventHappens(10898);
+ player->AreaExploredOrEventHappens(QUEST_SKYWING);
break;
}
}
@@ -240,7 +250,7 @@ public:
return;
Player* player = who->ToPlayer();
- if (player && player->GetQuestStatus(10898) == QUEST_STATUS_INCOMPLETE)
+ if (player && player->GetQuestStatus(QUEST_SKYWING) == QUEST_STATUS_INCOMPLETE)
if (me->IsWithinDistInMap(who, 10.0f))
Start(false, false, who->GetGUID());
}
@@ -258,6 +268,11 @@ public:
## npc_rotting_forest_rager
######*/
+enum RottingForestRager
+{
+ SPELL_SUMMON_LOTS_OF_WOOD_MITES = 39134
+};
+
class npc_rotting_forest_rager : public CreatureScript
{
public:
@@ -280,67 +295,8 @@ public:
if (done_by->GetTypeId() == TYPEID_PLAYER)
if (me->GetHealth() <= damage)
if (rand32() % 100 < 75)
- //Summon Lots of Wood Mights
- DoCast(me, 39134, true);
- }
- };
-};
-
-/*######
-## npc_netherweb_victim
-######*/
-
-enum NetherwebVictim
-{
- QUEST_TARGET = 22459
- //SPELL_FREE_WEBBED = 38950
-};
-
-const uint32 netherwebVictims[6] =
-{
- 18470, 16805, 21242, 18452, 22482, 21285
-};
-
-class npc_netherweb_victim : public CreatureScript
-{
-public:
- npc_netherweb_victim() : CreatureScript("npc_netherweb_victim") { }
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_netherweb_victimAI(creature);
- }
-
- struct npc_netherweb_victimAI : public ScriptedAI
- {
- npc_netherweb_victimAI(Creature* creature) : ScriptedAI(creature) { }
-
- void Reset() override { }
- void EnterCombat(Unit* /*who*/) override { }
- void MoveInLineOfSight(Unit* /*who*/) override { }
-
-
- void JustDied(Unit* killer) override
- {
- Player* player = killer->ToPlayer();
- if (!player)
- return;
-
- if (player->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE)
- {
- if (rand32() % 100 < 25)
- {
- me->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
- player->KilledMonsterCredit(QUEST_TARGET);
- }
- else
- me->SummonCreature(netherwebVictims[rand32() % 6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
-
- if (rand32() % 100 < 75)
- me->SummonCreature(netherwebVictims[rand32() % 6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
-
- me->SummonCreature(netherwebVictims[rand32() % 6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
- }
+ //Summon Lots of Wood Mites
+ DoCast(me, SPELL_SUMMON_LOTS_OF_WOOD_MITES, true);
}
};
};
@@ -349,19 +305,22 @@ public:
## npc_floon
######*/
-#define GOSSIP_FLOON1 "You owe Sim'salabim money. Hand them over or die!"
-#define GOSSIP_FLOON2 "Hand over the money or die...again!"
-
enum Floon
{
- SAY_FLOON_ATTACK = 0,
-
- SPELL_SILENCE = 6726,
- SPELL_FROSTBOLT = 9672,
- SPELL_FROST_NOVA = 11831,
-
- FACTION_HOSTILE_FL = 1738,
- QUEST_CRACK_SKULLS = 10009
+ SAY_FLOON_ATTACK = 0,
+ OPTION_ID_PAY_UP_OR_DIE = 0,
+ OPTION_ID_COLLECT_A_DEBT = 0,
+ FACTION_HOSTILE_FLOON = 1738,
+ MENU_ID_PAY_UP_OR_DIE = 7731,
+ MENU_ID_COLLECT_A_DEBT = 7732,
+ GOSSIP_FLOON_STRANGE_SOUNDS = 9442,
+ GOSSIP_HE_ALREADY_KILLED_ME = 9443,
+
+ SPELL_SILENCE = 6726,
+ SPELL_FROSTBOLT = 9672,
+ SPELL_FROST_NOVA = 11831,
+
+ QUEST_CRACKIN_SOME_SKULLS = 10009
};
class npc_floon : public CreatureScript
@@ -374,13 +333,13 @@ public:
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF)
{
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(9443, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(MENU_ID_PAY_UP_OR_DIE, OPTION_ID_PAY_UP_OR_DIE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->SEND_GOSSIP_MENU(GOSSIP_HE_ALREADY_KILLED_ME, creature->GetGUID());
}
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
- creature->setFaction(FACTION_HOSTILE_FL);
+ creature->setFaction(FACTION_HOSTILE_FLOON);
creature->AI()->Talk(SAY_FLOON_ATTACK, player);
creature->AI()->AttackStart(player);
}
@@ -389,10 +348,10 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
- if (player->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ if (player->GetQuestStatus(QUEST_CRACKIN_SOME_SKULLS) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM_DB(MENU_ID_COLLECT_A_DEBT, OPTION_ID_COLLECT_A_DEBT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(9442, creature->GetGUID());
+ player->SEND_GOSSIP_MENU(GOSSIP_FLOON_STRANGE_SOUNDS, creature->GetGUID());
return true;
}
@@ -463,15 +422,16 @@ public:
######*/
enum IslaStarmaneData
{
- SAY_PROGRESS_1 = 0,
- SAY_PROGRESS_2 = 1,
- SAY_PROGRESS_3 = 2,
- SAY_PROGRESS_4 = 3,
-
- QUEST_EFTW_H = 10052,
- QUEST_EFTW_A = 10051,
- GO_CAGE = 182794,
- SPELL_CAT = 32447,
+ SAY_PROGRESS_1 = 0,
+ SAY_PROGRESS_2 = 1,
+ SAY_PROGRESS_3 = 2,
+ SAY_PROGRESS_4 = 3,
+ GO_DISTANCE = 10,
+ FACTION_ESCORTEE = 113,
+ ESCAPE_FROM_FIREWING_POINT_A = 10051,
+ ESCAPE_FROM_FIREWING_POINT_H = 10052,
+ SPELL_TRAVEL_FORM_CAT = 32447,
+ GO_CAGE = 182794
};
class npc_isla_starmane : public CreatureScript
@@ -492,7 +452,7 @@ public:
switch (waypointId)
{
case 0:
- if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10))
+ if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, GO_DISTANCE))
Cage->SetGoState(GO_STATE_ACTIVE);
break;
case 2:
@@ -507,16 +467,16 @@ public:
case 29:
Talk(SAY_PROGRESS_4, player);
if (player->GetTeam() == ALLIANCE)
- player->GroupEventHappens(QUEST_EFTW_A, me);
+ player->GroupEventHappens(ESCAPE_FROM_FIREWING_POINT_A, me);
else if (player->GetTeam() == HORDE)
- player->GroupEventHappens(QUEST_EFTW_H, me);
+ player->GroupEventHappens(ESCAPE_FROM_FIREWING_POINT_H, me);
me->SetInFront(player);
break;
case 30:
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
break;
case 31:
- DoCast(me, SPELL_CAT);
+ DoCast(me, SPELL_TRAVEL_FORM_CAT);
me->SetWalk(false);
break;
}
@@ -532,19 +492,19 @@ public:
if (Player* player = GetPlayerForEscort())
{
if (player->GetTeam() == ALLIANCE)
- player->FailQuest(QUEST_EFTW_A);
+ player->FailQuest(ESCAPE_FROM_FIREWING_POINT_A);
else if (player->GetTeam() == HORDE)
- player->FailQuest(QUEST_EFTW_H);
+ player->FailQuest(ESCAPE_FROM_FIREWING_POINT_H);
}
}
};
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
{
- if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A)
+ if (quest->GetQuestId() == ESCAPE_FROM_FIREWING_POINT_H || quest->GetQuestId() == ESCAPE_FROM_FIREWING_POINT_A)
{
ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
- creature->setFaction(113);
+ creature->setFaction(FACTION_ESCORTEE);
}
return true;
}
@@ -558,10 +518,20 @@ public:
/*######
## go_skull_pile
######*/
-#define GOSSIP_S_DARKSCREECHER_AKKARAI "Summon Darkscreecher Akkarai"
-#define GOSSIP_S_KARROG "Summon Karrog"
-#define GOSSIP_S_GEZZARAK_THE_HUNTRESS "Summon Gezzarak the Huntress"
-#define GOSSIP_S_VAKKIZ_THE_WINDRAGER "Summon Vakkiz the Windrager"
+
+enum SkullPile
+{
+ OPTION_ID_GEZZARAK_THE_HUNTRESS = 0,
+ OPTION_ID_DARKSCREECHER_AKKARAI = 1,
+ OPTION_ID_KARROG = 2,
+ OPTION_ID_VAKKIZ_THE_WINDRAGER = 3,
+ GOSSIP_MENU_ID_SKULL_PILE = 8660,
+ ADVERSARIAL_BLOOD = 11885,
+ SUMMON_GEZZARAK_THE_HUNTRESS = 40632,
+ SUMMON_KARROG = 40640,
+ SUMMON_DARKSCREECHER_AKKARAI = 40642,
+ SUMMON_VAKKIZ_THE_WINDRAGER = 40644
+};
class go_skull_pile : public GameObjectScript
{
@@ -580,12 +550,12 @@ public:
bool OnGossipHello(Player* player, GameObject* go) override
{
- if ((player->GetQuestStatus(11885) == QUEST_STATUS_INCOMPLETE) || player->GetQuestRewardStatus(11885))
+ if ((player->GetQuestStatus(ADVERSARIAL_BLOOD) == QUEST_STATUS_INCOMPLETE) || player->GetQuestRewardStatus(ADVERSARIAL_BLOOD))
{
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_ID_SKULL_PILE, OPTION_ID_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_ID_SKULL_PILE, OPTION_ID_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_ID_SKULL_PILE, OPTION_ID_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_ID_SKULL_PILE, OPTION_ID_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
}
player->SEND_GOSSIP_MENU(go->GetGOInfo()->questgiver.gossipID, go->GetGUID());
@@ -597,16 +567,16 @@ public:
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1:
- player->CastSpell(player, 40642, false);
+ player->CastSpell(player, SUMMON_GEZZARAK_THE_HUNTRESS, false);
break;
case GOSSIP_ACTION_INFO_DEF + 2:
- player->CastSpell(player, 40640, false);
+ player->CastSpell(player, SUMMON_DARKSCREECHER_AKKARAI, false);
break;
case GOSSIP_ACTION_INFO_DEF + 3:
- player->CastSpell(player, 40632, false);
+ player->CastSpell(player, SUMMON_KARROG, false);
break;
case GOSSIP_ACTION_INFO_DEF + 4:
- player->CastSpell(player, 40644, false);
+ player->CastSpell(player, SUMMON_VAKKIZ_THE_WINDRAGER, false);
break;
}
}
@@ -618,7 +588,9 @@ public:
enum Slim
{
- FACTION_CONSORTIUM = 933
+ FACTION_CONSORTIUM = 933,
+ NPC_TEXT_NEITHER_SLIM_NOR_SHADY = 9895,
+ NPC_TEXT_I_SEE_YOU_ARE_A_FRIEND = 9896
};
class npc_slim : public CreatureScript
@@ -640,10 +612,10 @@ public:
if (creature->IsVendor() && player->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(9896, creature->GetGUID());
+ player->SEND_GOSSIP_MENU(NPC_TEXT_I_SEE_YOU_ARE_A_FRIEND, creature->GetGUID());
}
else
- player->SEND_GOSSIP_MENU(9895, creature->GetGUID());
+ player->SEND_GOSSIP_MENU(NPC_TEXT_NEITHER_SLIM_NOR_SHADY, creature->GetGUID());
return true;
}
@@ -719,7 +691,6 @@ void AddSC_terokkar_forest()
new npc_unkor_the_ruthless();
new npc_infested_root_walker();
new npc_rotting_forest_rager();
- new npc_netherweb_victim();
new npc_floon();
new npc_isla_starmane();
new go_skull_pile();
diff --git a/src/server/scripts/Pet/CMakeLists.txt b/src/server/scripts/Pet/CMakeLists.txt
deleted file mode 100644
index 9ca268a9a3f..00000000000
--- a/src/server/scripts/Pet/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
-#
-# This file is free software; as a special exception the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- Pet/pet_dk.cpp
- Pet/pet_generic.cpp
- Pet/pet_hunter.cpp
- Pet/pet_mage.cpp
- Pet/pet_priest.cpp
- Pet/pet_shaman.cpp
-)
-
-message(" -> Prepared: Pet")
diff --git a/src/server/scripts/Pet/pet_dk.cpp b/src/server/scripts/Pet/pet_dk.cpp
index 80b3a00774b..113b14a0d54 100644
--- a/src/server/scripts/Pet/pet_dk.cpp
+++ b/src/server/scripts/Pet/pet_dk.cpp
@@ -103,8 +103,8 @@ class npc_pet_dk_ebon_gargoyle : public CreatureScript
//! HACK: Creature's can't have MOVEMENTFLAG_FLYING
// Fly Away
me->SetCanFly(true);
- me->SetSpeed(MOVE_FLIGHT, 0.75f, true);
- me->SetSpeed(MOVE_RUN, 0.75f, true);
+ me->SetSpeedRate(MOVE_FLIGHT, 0.75f);
+ me->SetSpeedRate(MOVE_RUN, 0.75f);
float x = me->GetPositionX() + 20 * std::cos(me->GetOrientation());
float y = me->GetPositionY() + 20 * std::sin(me->GetOrientation());
float z = me->GetPositionZ() + 40;
diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp
index 35455bc474b..ff57bc0415c 100644
--- a/src/server/scripts/Pet/pet_generic.cpp
+++ b/src/server/scripts/Pet/pet_generic.cpp
@@ -20,10 +20,239 @@
* Scriptnames of files in this file should be prefixed with "npc_pet_gen_".
*/
+ /* ContentData
+ npc_pet_gen_baby_blizzard_bear 100% Baby Blizzard Bear sits down occasionally
+ npc_pet_gen_egbert 100% Egbert run's around
+ npc_pet_gen_pandaren_monk 100% Pandaren Monk drinks and bows with you
+ npc_pet_gen_mojo 100% Mojo follows you when you kiss it
+ EndContentData */
+
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "PassiveAI.h"
#include "Player.h"
+enum BabyBlizzardBearMisc
+{
+ SPELL_BBB_PET_SIT = 61853,
+ EVENT_BBB_PET_SIT = 1,
+ EVENT_BBB_PET_SIT_INTER = 2
+};
+
+class npc_pet_gen_baby_blizzard_bear : public CreatureScript
+{
+public:
+ npc_pet_gen_baby_blizzard_bear() : CreatureScript("npc_pet_gen_baby_blizzard_bear") {}
+
+ struct npc_pet_gen_baby_blizzard_bearAI : public NullCreatureAI
+ {
+ npc_pet_gen_baby_blizzard_bearAI(Creature* creature) : NullCreatureAI(creature)
+ {
+ if (Unit* owner = me->GetCharmerOrOwner())
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
+ _events.ScheduleEvent(EVENT_BBB_PET_SIT, urandms(10, 30));
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _events.Update(diff);
+
+ if (Unit* owner = me->GetCharmerOrOwner())
+ if (!me->IsWithinDist(owner, 25.f))
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_BBB_PET_SIT:
+ me->CastSpell(me, SPELL_BBB_PET_SIT, false);
+ _events.ScheduleEvent(EVENT_BBB_PET_SIT_INTER, urandms(15, 30));
+ break;
+ case EVENT_BBB_PET_SIT_INTER:
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ _events.ScheduleEvent(EVENT_BBB_PET_SIT, urandms(10, 30));
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ private:
+ EventMap _events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_pet_gen_baby_blizzard_bearAI(creature);
+ }
+};
+
+enum EgbertMisc
+{
+ SPELL_EGBERT = 40669,
+ EVENT_RETURN = 3
+};
+
+class npc_pet_gen_egbert : public CreatureScript
+{
+public:
+ npc_pet_gen_egbert() : CreatureScript("npc_pet_gen_egbert") {}
+
+ struct npc_pet_gen_egbertAI : public NullCreatureAI
+ {
+ npc_pet_gen_egbertAI(Creature* creature) : NullCreatureAI(creature)
+ {
+ if (Unit* owner = me->GetCharmerOrOwner())
+ if (owner->GetMap()->GetEntry()->addon > 1)
+ me->SetCanFly(true);
+ }
+
+ void Reset() override
+ {
+ _events.Reset();
+ if (Unit* owner = me->GetCharmerOrOwner())
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
+ }
+
+ void EnterEvadeMode(EvadeReason why) override
+ {
+ if (!_EnterEvadeMode(why))
+ return;
+
+ Reset();
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _events.Update(diff);
+
+ if (Unit* owner = me->GetCharmerOrOwner())
+ {
+ if (!me->IsWithinDist(owner, 40.f))
+ {
+ me->RemoveAura(SPELL_EGBERT);
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
+ }
+ }
+
+ if (me->HasAura(SPELL_EGBERT))
+ _events.ScheduleEvent(EVENT_RETURN, urandms(5, 20));
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_RETURN:
+ me->RemoveAura(SPELL_EGBERT);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ private:
+ EventMap _events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_pet_gen_egbertAI(creature);
+ }
+};
+
+enum PandarenMonkMisc
+{
+ SPELL_PANDAREN_MONK = 69800,
+ EVENT_FOCUS = 1,
+ EVENT_EMOTE = 2,
+ EVENT_FOLLOW = 3,
+ EVENT_DRINK = 4
+};
+
+class npc_pet_gen_pandaren_monk : public CreatureScript
+{
+public:
+ npc_pet_gen_pandaren_monk() : CreatureScript("npc_pet_gen_pandaren_monk") {}
+
+ struct npc_pet_gen_pandaren_monkAI : public NullCreatureAI
+ {
+ npc_pet_gen_pandaren_monkAI(Creature* creature) : NullCreatureAI(creature) { }
+
+ void Reset() override
+ {
+ _events.Reset();
+ _events.ScheduleEvent(EVENT_FOCUS, 1000);
+ }
+
+ void EnterEvadeMode(EvadeReason why) override
+ {
+ if (!_EnterEvadeMode(why))
+ return;
+
+ Reset();
+ }
+
+ void ReceiveEmote(Player* /*player*/, uint32 emote) override
+ {
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ me->StopMoving();
+
+ switch (emote)
+ {
+ case TEXT_EMOTE_BOW:
+ _events.ScheduleEvent(EVENT_FOCUS, 1000);
+ break;
+ case TEXT_EMOTE_DRINK:
+ _events.ScheduleEvent(EVENT_DRINK, 1000);
+ break;
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _events.Update(diff);
+
+ if (Unit* owner = me->GetCharmerOrOwner())
+ if (!me->IsWithinDist(owner, 30.f))
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_FOCUS:
+ if (Unit* owner = me->GetCharmerOrOwner())
+ me->SetFacingToObject(owner);
+ _events.ScheduleEvent(EVENT_EMOTE, 1000);
+ break;
+ case EVENT_EMOTE:
+ me->HandleEmoteCommand(EMOTE_ONESHOT_BOW);
+ _events.ScheduleEvent(EVENT_FOLLOW, 1000);
+ break;
+ case EVENT_FOLLOW:
+ if (Unit* owner = me->GetCharmerOrOwner())
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ break;
+ case EVENT_DRINK:
+ me->CastSpell(me, SPELL_PANDAREN_MONK, false);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ private:
+ EventMap _events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_pet_gen_pandaren_monkAI(creature);
+ }
+};
+
enum Mojo
{
SAY_MOJO = 0,
@@ -89,5 +318,8 @@ class npc_pet_gen_mojo : public CreatureScript
void AddSC_generic_pet_scripts()
{
+ new npc_pet_gen_baby_blizzard_bear();
+ new npc_pet_gen_egbert();
+ new npc_pet_gen_pandaren_monk();
new npc_pet_gen_mojo();
}
diff --git a/src/server/scripts/Pet/pet_script_loader.cpp b/src/server/scripts/Pet/pet_script_loader.cpp
new file mode 100644
index 00000000000..c3c0079fd46
--- /dev/null
+++ b/src/server/scripts/Pet/pet_script_loader.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+void AddSC_deathknight_pet_scripts();
+void AddSC_generic_pet_scripts();
+void AddSC_hunter_pet_scripts();
+void AddSC_mage_pet_scripts();
+void AddSC_priest_pet_scripts();
+void AddSC_shaman_pet_scripts();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddPetScripts()
+{
+ AddSC_deathknight_pet_scripts();
+ AddSC_generic_pet_scripts();
+ AddSC_hunter_pet_scripts();
+ AddSC_mage_pet_scripts();
+ AddSC_priest_pet_scripts();
+ AddSC_shaman_pet_scripts();
+}
diff --git a/src/server/scripts/ScriptLoader.cpp.in.cmake b/src/server/scripts/ScriptLoader.cpp.in.cmake
new file mode 100644
index 00000000000..33c336a9a93
--- /dev/null
+++ b/src/server/scripts/ScriptLoader.cpp.in.cmake
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This file was created automatically from your script configuration!
+// Use CMake to reconfigure this file, never change it on your own!
+
+#cmakedefine TRINITY_IS_DYNAMIC_SCRIPTLOADER
+
+#include "Define.h"
+#include <vector>
+#include <string>
+
+@TRINITY_SCRIPTS_FORWARD_DECL@
+#ifdef TRINITY_IS_DYNAMIC_SCRIPTLOADER
+# include "revision_data.h"
+# define TC_SCRIPT_API TC_API_EXPORT
+extern "C" {
+
+/// Exposed in script modules to return the script module revision hash.
+TC_SCRIPT_API char const* GetScriptModuleRevisionHash()
+{
+ return _HASH;
+}
+
+/// Exposed in script module to return the name of the script module
+/// contained in this shared library.
+TC_SCRIPT_API char const* GetScriptModule()
+{
+ return "@TRINITY_CURRENT_SCRIPT_PROJECT@";
+}
+
+#else
+# include "ScriptLoader.h"
+# define TC_SCRIPT_API
+#endif
+
+/// Exposed in script modules to register all scripts to the ScriptMgr.
+TC_SCRIPT_API void AddScripts()
+{
+@TRINITY_SCRIPTS_INVOKE@}
+
+/// Exposed in script modules to get the build directive of the module.
+TC_SCRIPT_API char const* GetBuildDirective()
+{
+ return _BUILD_DIRECTIVE;
+}
+
+#ifdef TRINITY_IS_DYNAMIC_SCRIPTLOADER
+} // extern "C"
+#endif
diff --git a/src/server/game/Scripting/ScriptLoader.h b/src/server/scripts/ScriptLoader.h
index 4adb215e130..57b62df22d1 100644
--- a/src/server/game/Scripting/ScriptLoader.h
+++ b/src/server/scripts/ScriptLoader.h
@@ -19,17 +19,5 @@
#define SC_SCRIPTLOADER_H
void AddScripts();
-void AddSpellScripts();
-void AddCommandScripts();
-void AddWorldScripts();
-void AddEasternKingdomsScripts();
-void AddKalimdorScripts();
-void AddOutlandScripts();
-void AddNorthrendScripts();
-void AddEventScripts();
-void AddPetScripts();
-void AddBattlegroundScripts();
-void AddOutdoorPvPScripts();
-void AddCustomScripts();
#endif
diff --git a/src/server/scripts/PrecompiledHeaders/ScriptPCH.cpp b/src/server/scripts/ScriptPCH.cpp
index 41fecf3c60d..41fecf3c60d 100644
--- a/src/server/scripts/PrecompiledHeaders/ScriptPCH.cpp
+++ b/src/server/scripts/ScriptPCH.cpp
diff --git a/src/server/scripts/PrecompiledHeaders/ScriptPCH.h b/src/server/scripts/ScriptPCH.h
index 1cd25309055..1cd25309055 100644
--- a/src/server/scripts/PrecompiledHeaders/ScriptPCH.h
+++ b/src/server/scripts/ScriptPCH.h
diff --git a/src/server/scripts/Spells/CMakeLists.txt b/src/server/scripts/Spells/CMakeLists.txt
deleted file mode 100644
index 7434d98cf49..00000000000
--- a/src/server/scripts/Spells/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
-#
-# This file is free software; as a special exception the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- Spells/spell_shaman.cpp
- Spells/spell_hunter.cpp
- Spells/spell_rogue.cpp
- Spells/spell_druid.cpp
- Spells/spell_dk.cpp
- Spells/spell_quest.cpp
- Spells/spell_warrior.cpp
- Spells/spell_generic.cpp
- Spells/spell_warlock.cpp
- Spells/spell_priest.cpp
- Spells/spell_mage.cpp
- Spells/spell_paladin.cpp
- Spells/spell_item.cpp
- Spells/spell_holiday.cpp
- Spells/spell_pet.cpp
-)
-
-message(" -> Prepared: Spells")
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 3cea620559a..980c0db19cc 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -22,7 +22,7 @@
*/
#include "Player.h"
-#include "UnitAI.h"
+#include "PlayerAI.h"
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
@@ -30,6 +30,13 @@
enum DeathKnightSpells
{
+ SPELL_DK_ACCLIMATION_HOLY = 50490,
+ SPELL_DK_ACCLIMATION_FIRE = 50362,
+ SPELL_DK_ACCLIMATION_FROST = 50485,
+ SPELL_DK_ACCLIMATION_ARCANE = 50486,
+ SPELL_DK_ACCLIMATION_SHADOW = 50489,
+ SPELL_DK_ACCLIMATION_NATURE = 50488,
+ SPELL_DK_ADVANTAGE_T10_4P_MELEE = 70657,
SPELL_DK_ANTI_MAGIC_SHELL_TALENT = 51052,
SPELL_DK_BLACK_ICE_R1 = 49140,
SPELL_DK_BLOOD_BOIL_TRIGGERED = 65658,
@@ -51,6 +58,7 @@ enum DeathKnightSpells
SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1 = 50365,
SPELL_DK_IMPROVED_FROST_PRESENCE_R1 = 50384,
SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1 = 50391,
+ SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL = 50475,
SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611,
SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622,
SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962,
@@ -65,8 +73,6 @@ enum DeathKnightSpells
SPELL_DK_UNHOLY_PRESENCE_TRIGGERED = 49772,
SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189,
SPELL_DK_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284,
- SPELL_DK_RAISE_ALLY_INITIAL = 61999,
- SPELL_DK_RAISE_ALLY = 46619,
SPELL_DK_GHOUL_THRASH = 47480
};
@@ -80,6 +86,141 @@ enum Misc
NPC_DK_GHOUL = 26125
};
+// -49200 - Acclimation
+class spell_dk_acclimation : public SpellScriptLoader
+{
+public:
+ spell_dk_acclimation() : SpellScriptLoader("spell_dk_acclimation") { }
+
+ class spell_dk_acclimation_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dk_acclimation_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_HOLY) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_FIRE) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_FROST) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_NATURE) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_SHADOW) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DK_ACCLIMATION_ARCANE))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ if (eventInfo.GetDamageInfo())
+ {
+ switch (GetFirstSchoolInMask(eventInfo.GetDamageInfo()->GetSchoolMask()))
+ {
+ case SPELL_SCHOOL_HOLY:
+ case SPELL_SCHOOL_FIRE:
+ case SPELL_SCHOOL_NATURE:
+ case SPELL_SCHOOL_FROST:
+ case SPELL_SCHOOL_SHADOW:
+ case SPELL_SCHOOL_ARCANE:
+ return true;
+ default:
+ break;
+ }
+ }
+
+ return false;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ uint32 triggerspell = 0;
+
+ switch (GetFirstSchoolInMask(eventInfo.GetDamageInfo()->GetSchoolMask()))
+ {
+ case SPELL_SCHOOL_HOLY:
+ triggerspell = SPELL_DK_ACCLIMATION_HOLY;
+ break;
+ case SPELL_SCHOOL_FIRE:
+ triggerspell = SPELL_DK_ACCLIMATION_FIRE;
+ break;
+ case SPELL_SCHOOL_NATURE:
+ triggerspell = SPELL_DK_ACCLIMATION_NATURE;
+ break;
+ case SPELL_SCHOOL_FROST:
+ triggerspell = SPELL_DK_ACCLIMATION_FROST;
+ break;
+ case SPELL_SCHOOL_SHADOW:
+ triggerspell = SPELL_DK_ACCLIMATION_SHADOW;
+ break;
+ case SPELL_SCHOOL_ARCANE:
+ triggerspell = SPELL_DK_ACCLIMATION_ARCANE;
+ break;
+ default:
+ return;
+ }
+
+ if (Unit* target = eventInfo.GetActionTarget())
+ target->CastSpell(target, triggerspell, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_dk_acclimation_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_dk_acclimation_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_dk_acclimation_AuraScript();
+ }
+};
+
+// 70656 - Advantage (T10 4P Melee Bonus)
+class spell_dk_advantage_t10_4p : public SpellScriptLoader
+{
+public:
+ spell_dk_advantage_t10_4p() : SpellScriptLoader("spell_dk_advantage_t10_4p") { }
+
+ class spell_dk_advantage_t10_4p_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dk_advantage_t10_4p_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DK_ADVANTAGE_T10_4P_MELEE))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ if (Unit* caster = eventInfo.GetActor())
+ {
+ if (caster->GetTypeId() != TYPEID_PLAYER || caster->getClass() != CLASS_DEATH_KNIGHT)
+ return false;
+
+ for (uint8 i = 0; i < MAX_RUNES; ++i)
+ if (caster->ToPlayer()->GetRuneCooldown(i) == 0)
+ return false;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_dk_advantage_t10_4p_AuraScript::CheckProc);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_dk_advantage_t10_4p_AuraScript();
+ }
+};
+
// 50462 - Anti-Magic Shell (on raid member)
class spell_dk_anti_magic_shell_raid : public SpellScriptLoader
{
@@ -228,7 +369,7 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
{
- SpellInfo const* talentSpell = sSpellMgr->EnsureSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT);
+ SpellInfo const* talentSpell = sSpellMgr->AssertSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT);
amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster());
if (Player* player = GetCaster()->ToPlayer())
amount += int32(2 * player->GetTotalAttackPowerValue(BASE_ATTACK));
@@ -921,6 +1062,52 @@ class spell_dk_improved_blood_presence : public SpellScriptLoader
}
};
+// 63611 - Improved Blood Presence Triggered
+class spell_dk_improved_blood_presence_triggered : public SpellScriptLoader
+{
+public:
+ spell_dk_improved_blood_presence_triggered() : SpellScriptLoader("spell_dk_improved_blood_presence_triggered") { }
+
+ class spell_dk_improved_blood_presence_triggered_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dk_improved_blood_presence_triggered_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ if (eventInfo.GetActor()->GetTypeId() == TYPEID_PLAYER)
+ return true;
+
+ return false;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo())
+ eventInfo.GetActor()->CastCustomSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL, SPELLVALUE_BASE_POINT0, CalculatePct(int32(dmgInfo->GetDamage()), aurEff->GetAmount()),
+ eventInfo.GetActor(), true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_dk_improved_blood_presence_triggered_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_dk_improved_blood_presence_triggered_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_dk_improved_blood_presence_triggered_AuraScript();
+ }
+};
+
// -50384 - Improved Frost Presence
class spell_dk_improved_frost_presence : public SpellScriptLoader
{
@@ -1636,7 +1823,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader
{
// min pct of hp is stored in effect 0 of talent spell
uint8 rank = GetSpellInfo()->GetRank();
- SpellInfo const* talentProto = sSpellMgr->EnsureSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));
+ SpellInfo const* talentProto = sSpellMgr->AssertSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));
int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage());
int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(talentProto->Effects[EFFECT_0].CalcValue(GetCaster())));
@@ -1733,36 +1920,39 @@ public:
{
PrepareSpellScript(spell_dk_raise_ally_initial_SpellScript);
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ bool Validate(SpellInfo const* spellInfo) override
{
- if (!sSpellMgr->GetSpellInfo(SPELL_DK_RAISE_ALLY_INITIAL))
+ if (!sSpellMgr->GetSpellInfo(uint32(spellInfo->Effects[EFFECT_0].CalcValue())))
return false;
return true;
}
+ bool Load() override
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
SpellCastResult CheckCast()
{
- // Raise Ally cannot be casted on alive players
Unit* target = GetExplTargetUnit();
if (!target)
return SPELL_FAILED_NO_VALID_TARGETS;
if (target->IsAlive())
return SPELL_FAILED_TARGET_NOT_DEAD;
- if (Player* playerCaster = GetCaster()->ToPlayer())
- if (playerCaster->InArena())
- return SPELL_FAILED_NOT_IN_ARENA;
if (target->IsGhouled())
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
-
return SPELL_CAST_OK;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- Player* caster = GetCaster()->ToPlayer();
- Player* target = GetHitPlayer();
- if (caster && target)
- caster->SendGhoulResurrectRequest(target);
+ if (Player* target = GetHitPlayer())
+ {
+ if (target->IsResurrectRequested()) // already have one active request
+ return;
+ target->SetResurrectRequestData(GetCaster(), 0, 0, uint32(GetEffectValue()));
+ GetSpell()->SendResurrectRequest(target);
+ }
}
void Register() override
@@ -1785,12 +1975,8 @@ class player_ghoulAI : public PlayerAI
void UpdateAI(uint32 /*diff*/) override
{
- if (Creature* ghoul = ObjectAccessor::GetCreature(*me, _ghoulGUID))
- {
- if (!ghoul->IsAlive())
- me->RemoveAura(SPELL_DK_RAISE_ALLY);
- }
- else
+ Creature* ghoul = ObjectAccessor::GetCreature(*me, _ghoulGUID);
+ if (!ghoul || !ghoul->IsAlive())
me->RemoveAura(SPELL_DK_RAISE_ALLY);
}
@@ -1799,28 +1985,25 @@ class player_ghoulAI : public PlayerAI
};
// 46619 - Raise Ally
+#define DkRaiseAllyScriptName "spell_dk_raise_ally"
class spell_dk_raise_ally : public SpellScriptLoader
{
public:
- spell_dk_raise_ally() : SpellScriptLoader("spell_dk_raise_ally") { }
+ spell_dk_raise_ally() : SpellScriptLoader(DkRaiseAllyScriptName) { }
class spell_dk_raise_ally_SpellScript : public SpellScript
{
PrepareSpellScript(spell_dk_raise_ally_SpellScript);
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ bool Load() override
{
- if (!sSpellMgr->GetSpellInfo(SPELL_DK_RAISE_ALLY))
- return false;
- return true;
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void SendText()
{
- Player* caster = GetCaster()->ToPlayer();
- Unit* original = GetOriginalCaster();
- if (caster && original)
- original->Whisper(TEXT_RISE_ALLY, caster, true);
+ if (Unit* original = GetOriginalCaster())
+ original->Whisper(TEXT_RISE_ALLY, GetCaster()->ToPlayer(), true);
}
void HandleSummon(SpellEffIndex effIndex)
@@ -1839,9 +2022,8 @@ public:
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(829);
uint32 duration = uint32(GetSpellInfo()->GetDuration());
- Position pos = caster->GetPosition();
- TempSummon* summon = originalCaster->GetMap()->SummonCreature(entry, pos, properties, duration, originalCaster, GetSpellInfo()->Id);
+ TempSummon* summon = originalCaster->GetMap()->SummonCreature(entry, *GetHitDest(), properties, duration, originalCaster, GetSpellInfo()->Id);
if (!summon)
return;
@@ -1868,15 +2050,25 @@ public:
// SMSG_POWER_UPDATE is sent
summon->SetMaxPower(POWER_ENERGY, 100);
- if (Player* player = GetCaster()->ToPlayer())
- player->SetGhoulResurrectGhoulGUID(summon->GetGUID());
+ _ghoulGuid = summon->GetGUID();
+ }
+
+ void SetGhoul(SpellEffIndex /*effIndex*/)
+ {
+ if (Aura* aura = GetHitAura())
+ if (spell_dk_raise_ally_AuraScript* script = dynamic_cast<spell_dk_raise_ally_AuraScript*>(aura->GetScriptByName(DkRaiseAllyScriptName)))
+ script->SetGhoulGuid(_ghoulGuid);
}
void Register() override
{
AfterHit += SpellHitFn(spell_dk_raise_ally_SpellScript::SendText);
OnEffectHit += SpellEffectFn(spell_dk_raise_ally_SpellScript::HandleSummon, EFFECT_0, SPELL_EFFECT_SUMMON);
+ OnEffectHitTarget += SpellEffectFn(spell_dk_raise_ally_SpellScript::SetGhoul, EFFECT_1, SPELL_EFFECT_APPLY_AURA);
}
+
+ private:
+ ObjectGuid _ghoulGuid;
};
SpellScript* GetSpellScript() const override
@@ -1895,45 +2087,45 @@ public:
oldAIState = false;
}
+ void SetGhoulGuid(ObjectGuid guid)
+ {
+ ghoulGuid = guid;
+ }
+
private:
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ bool Load() override
{
- if (!sSpellMgr->GetSpellInfo(SPELL_DK_RAISE_ALLY))
- return false;
- return true;
+ return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Player* player = GetTarget()->ToPlayer();
- if (!player || player->GetGhoulResurrectGhoulGUID().IsEmpty())
+ if (ghoulGuid.IsEmpty())
return;
- oldAI = player->GetAI();
+ oldAI = player->AI();
oldAIState = player->IsAIEnabled;
- player->SetAI(new player_ghoulAI(player, player->GetGhoulResurrectGhoulGUID()));
+ player->SetAI(new player_ghoulAI(player, ghoulGuid));
player->IsAIEnabled = true;
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Player* player = GetTarget()->ToPlayer();
- if (!player)
- return;
player->IsAIEnabled = oldAIState;
- UnitAI* thisAI = player->GetAI();
+ PlayerAI* thisAI = player->AI();
player->SetAI(oldAI);
delete thisAI;
// Dismiss ghoul if necessary
- if (Creature* ghoul = ObjectAccessor::GetCreature(*player, player->GetGhoulResurrectGhoulGUID()))
+ if (Creature* ghoul = ObjectAccessor::GetCreature(*player, ghoulGuid))
{
- ghoul->RemoveCharmedBy(nullptr);
+ ghoul->RemoveCharmedBy(player);
ghoul->DespawnOrUnsummon(1000);
}
- player->SetGhoulResurrectGhoulGUID(ObjectGuid::Empty);
player->RemoveAura(SPELL_GHOUL_FRENZY);
}
@@ -1943,7 +2135,8 @@ public:
AfterEffectRemove += AuraEffectRemoveFn(spell_dk_raise_ally_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
- UnitAI* oldAI;
+ ObjectGuid ghoulGuid;
+ PlayerAI* oldAI;
bool oldAIState;
};
@@ -1965,7 +2158,7 @@ public:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- if (!sSpellMgr->GetSpellInfo(SPELL_DK_GHOUL_THRASH))
+ if (!sSpellMgr->GetSpellInfo(SPELL_GHOUL_FRENZY))
return false;
return true;
}
@@ -2002,6 +2195,8 @@ public:
void AddSC_deathknight_spell_scripts()
{
+ new spell_dk_acclimation();
+ new spell_dk_advantage_t10_4p();
new spell_dk_anti_magic_shell_raid();
new spell_dk_anti_magic_shell_self();
new spell_dk_anti_magic_zone();
@@ -2018,6 +2213,7 @@ void AddSC_deathknight_spell_scripts()
new spell_dk_ghoul_explode();
new spell_dk_icebound_fortitude();
new spell_dk_improved_blood_presence();
+ new spell_dk_improved_blood_presence_triggered();
new spell_dk_improved_frost_presence();
new spell_dk_improved_unholy_presence();
new spell_dk_pestilence();
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 7b853c36075..0bf5ab01f45 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -31,6 +31,13 @@ enum DruidSpells
{
SPELL_DRUID_BEAR_FORM_PASSIVE = 1178,
SPELL_DRUID_DIRE_BEAR_FORM_PASSIVE = 9635,
+ SPELL_DRUID_ECLIPSE_LUNAR_PROC = 48518,
+ SPELL_DRUID_ECLIPSE_SOLAR_PROC = 48517,
+ SPELL_DRUID_FORMS_TRINKET_BEAR = 37340,
+ SPELL_DRUID_FORMS_TRINKET_CAT = 37341,
+ SPELL_DRUID_FORMS_TRINKET_MOONKIN = 37343,
+ SPELL_DRUID_FORMS_TRINKET_NONE = 37344,
+ SPELL_DRUID_FORMS_TRINKET_TREE = 37342,
SPELL_DRUID_ENRAGE = 5229,
SPELL_DRUID_ENRAGE_MOD_DAMAGE = 51185,
SPELL_DRUID_ENRAGED_DEFENSE = 70725,
@@ -48,6 +55,8 @@ enum DruidSpells
SPELL_DRUID_NATURES_SPLENDOR = 57865,
SPELL_DRUID_SURVIVAL_INSTINCTS = 50322,
SPELL_DRUID_SAVAGE_ROAR = 62071,
+ SPELL_DRUID_T9_FERAL_RELIC_BEAR = 67354,
+ SPELL_DRUID_T9_FERAL_RELIC_CAT = 67355,
SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178
};
@@ -131,6 +140,69 @@ class spell_dru_dash : public SpellScriptLoader
}
};
+class spell_dru_eclipse : public SpellScriptLoader
+{
+public:
+ spell_dru_eclipse() : SpellScriptLoader("spell_dru_eclipse") { }
+
+ class spell_dru_eclipse_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_eclipse_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_ECLIPSE_LUNAR_PROC))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_ECLIPSE_SOLAR_PROC))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ if (!eventInfo.GetSpellInfo())
+ return false;
+
+ if (eventInfo.GetActor()->HasAura(SPELL_DRUID_ECLIPSE_LUNAR_PROC) || eventInfo.GetActor()->HasAura(SPELL_DRUID_ECLIPSE_SOLAR_PROC))
+ return false;
+
+ // Triggered by Wrath?
+ if (eventInfo.GetSpellInfo()->SpellFamilyFlags[0] & 1)
+ return roll_chance_f(GetSpellInfo()->ProcChance * 0.6f) && _lunarProcCooldownEnd <= std::chrono::steady_clock::now();
+
+ return _solarProcCooldownEnd <= std::chrono::steady_clock::now();
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ if (eventInfo.GetSpellInfo()->SpellFamilyFlags[0] & 1)
+ {
+ _lunarProcCooldownEnd = std::chrono::steady_clock::now() + Seconds(aurEff->GetAmount());
+ eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_LUNAR_PROC, TRIGGERED_FULL_MASK, nullptr, aurEff);
+ }
+ else
+ {
+ _solarProcCooldownEnd = std::chrono::steady_clock::now() + Seconds(aurEff->GetAmount());
+ eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_SOLAR_PROC, TRIGGERED_FULL_MASK, nullptr, aurEff);
+ }
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_dru_eclipse_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_dru_eclipse_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+
+ std::chrono::steady_clock::time_point _lunarProcCooldownEnd = std::chrono::steady_clock::time_point::min();
+ std::chrono::steady_clock::time_point _solarProcCooldownEnd = std::chrono::steady_clock::time_point::min();
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_dru_eclipse_AuraScript();
+ }
+};
+
// 5229 - Enrage
class spell_dru_enrage : public SpellScriptLoader
{
@@ -197,6 +269,91 @@ class spell_dru_enrage : public SpellScriptLoader
}
};
+// 37336 - Druid Forms Trinket
+class spell_dru_forms_trinket : public SpellScriptLoader
+{
+public:
+ spell_dru_forms_trinket() : SpellScriptLoader("spell_dru_forms_trinket") { }
+
+ class spell_dru_forms_trinket_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_forms_trinket_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_FORMS_TRINKET_BEAR) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DRUID_FORMS_TRINKET_CAT) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DRUID_FORMS_TRINKET_MOONKIN) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DRUID_FORMS_TRINKET_NONE) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DRUID_FORMS_TRINKET_TREE))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ Unit* target = eventInfo.GetActor();
+
+ switch (target->GetShapeshiftForm())
+ {
+ case FORM_BEAR:
+ case FORM_DIREBEAR:
+ case FORM_CAT:
+ case FORM_MOONKIN:
+ case FORM_NONE:
+ case FORM_TREE:
+ return true;
+ default:
+ break;
+ }
+
+ return false;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ Unit* target = eventInfo.GetActor();
+ uint32 triggerspell = 0;
+
+ switch (target->GetShapeshiftForm())
+ {
+ case FORM_BEAR:
+ case FORM_DIREBEAR:
+ triggerspell = SPELL_DRUID_FORMS_TRINKET_BEAR;
+ break;
+ case FORM_CAT:
+ triggerspell = SPELL_DRUID_FORMS_TRINKET_CAT;
+ break;
+ case FORM_MOONKIN:
+ triggerspell = SPELL_DRUID_FORMS_TRINKET_MOONKIN;
+ break;
+ case FORM_NONE:
+ triggerspell = SPELL_DRUID_FORMS_TRINKET_NONE;
+ break;
+ case FORM_TREE:
+ triggerspell = SPELL_DRUID_FORMS_TRINKET_TREE;
+ break;
+ default:
+ return;
+ }
+
+ target->CastSpell(target, triggerspell, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_dru_forms_trinket_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_dru_forms_trinket_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_dru_forms_trinket_AuraScript();
+ }
+};
+
// 54846 - Glyph of Starfire
class spell_dru_glyph_of_starfire : public SpellScriptLoader
{
@@ -991,6 +1148,37 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
}
};
+// -33943 - Flight Form
+class spell_dru_flight_form : public SpellScriptLoader
+{
+ public:
+ spell_dru_flight_form() : SpellScriptLoader("spell_dru_flight_form") { }
+
+ class spell_dru_flight_form_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dru_flight_form_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (caster->IsInDisallowedMountForm())
+ return SPELL_FAILED_NOT_SHAPESHIFT;
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register() override
+ {
+ OnCheckCast += SpellCheckCastFn(spell_dru_flight_form_SpellScript::CheckCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_dru_flight_form_SpellScript();
+ }
+};
+
// -5217 - Tiger's Fury
class spell_dru_tiger_s_fury : public SpellScriptLoader
{
@@ -1048,6 +1236,77 @@ class spell_dru_typhoon : public SpellScriptLoader
}
};
+// 67353 - T9 Feral Relic (Idol of Mutilation)
+class spell_dru_t9_feral_relic : public SpellScriptLoader
+{
+public:
+ spell_dru_t9_feral_relic() : SpellScriptLoader("spell_dru_t9_feral_relic") { }
+
+ class spell_dru_t9_feral_relic_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_t9_feral_relic_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_T9_FERAL_RELIC_BEAR) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DRUID_T9_FERAL_RELIC_CAT))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ Unit* target = eventInfo.GetActor();
+
+ switch (target->GetShapeshiftForm())
+ {
+ case FORM_BEAR:
+ case FORM_DIREBEAR:
+ case FORM_CAT:
+ return true;
+ default:
+ break;
+ }
+
+ return false;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ uint32 triggerspell = 0;
+
+ Unit* target = eventInfo.GetActor();
+
+ switch (target->GetShapeshiftForm())
+ {
+ case FORM_BEAR:
+ case FORM_DIREBEAR:
+ triggerspell = SPELL_DRUID_T9_FERAL_RELIC_BEAR;
+ break;
+ case FORM_CAT:
+ triggerspell = SPELL_DRUID_T9_FERAL_RELIC_CAT;
+ break;
+ default:
+ return;
+ }
+
+ target->CastSpell(target, triggerspell, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_dru_t9_feral_relic_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_dru_t9_feral_relic_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_dru_t9_feral_relic_AuraScript();
+ }
+};
+
// 70691 - Item T10 Restoration 4P Bonus
class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader
{
@@ -1177,7 +1436,9 @@ void AddSC_druid_spell_scripts()
{
new spell_dru_bear_form_passive();
new spell_dru_dash();
+ new spell_dru_eclipse();
new spell_dru_enrage();
+ new spell_dru_forms_trinket();
new spell_dru_glyph_of_starfire();
new spell_dru_idol_lifebloom();
new spell_dru_innervate();
@@ -1196,8 +1457,10 @@ void AddSC_druid_spell_scripts()
new spell_dru_starfall_dummy();
new spell_dru_survival_instincts();
new spell_dru_swift_flight_passive();
+ new spell_dru_flight_form();
new spell_dru_tiger_s_fury();
new spell_dru_typhoon();
+ new spell_dru_t9_feral_relic();
new spell_dru_t10_restoration_4p_bonus();
new spell_dru_wild_growth();
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index abde43ef952..e8ad73ceadb 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -430,6 +430,61 @@ class spell_gen_bandage : public SpellScriptLoader
}
};
+// Blood Reserve - 64568
+enum BloodReserve
+{
+ SPELL_GEN_BLOOD_RESERVE_AURA = 64568,
+ SPELL_GEN_BLOOD_RESERVE_HEAL = 64569
+};
+
+class spell_gen_blood_reserve : public SpellScriptLoader
+{
+ public:
+ spell_gen_blood_reserve() : SpellScriptLoader("spell_gen_blood_reserve") { }
+
+ class spell_gen_blood_reserve_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_blood_reserve_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_GEN_BLOOD_RESERVE_HEAL))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo())
+ if (Unit* caster = eventInfo.GetActionTarget())
+ if (caster->HealthBelowPctDamaged(35, dmgInfo->GetDamage()))
+ return true;
+
+ return false;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ Unit* caster = eventInfo.GetActionTarget();
+ caster->CastCustomSpell(SPELL_GEN_BLOOD_RESERVE_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), caster, TRIGGERED_FULL_MASK, nullptr, aurEff);
+ caster->RemoveAura(SPELL_GEN_BLOOD_RESERVE_AURA);
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_gen_blood_reserve_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_gen_blood_reserve_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_gen_blood_reserve_AuraScript();
+ }
+};
+
enum Bonked
{
SPELL_BONKED = 62991,
@@ -1245,7 +1300,7 @@ class spell_gen_defend : public SpellScriptLoader
void Register() override
{
- SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(m_scriptSpellId);
+ SpellInfo const* spell = sSpellMgr->AssertSpellInfo(m_scriptSpellId);
// Defend spells cast by NPCs (add visuals)
if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
@@ -2085,7 +2140,7 @@ class spell_gen_mounted_charge: public SpellScriptLoader
}
// If target isn't a training dummy there's a chance of failing the charge
- if (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE) && roll_chance_f(12.5f))
+ if (!target->IsCharmedOwnedByPlayerOrPlayer() && roll_chance_f(12.5f))
spellId = SPELL_CHARGE_MISS_EFFECT;
if (Unit* vehicle = GetCaster()->GetVehicleBase())
@@ -2148,7 +2203,7 @@ class spell_gen_mounted_charge: public SpellScriptLoader
void Register() override
{
- SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(m_scriptSpellId);
+ SpellInfo const* spell = sSpellMgr->AssertSpellInfo(m_scriptSpellId);
if (spell->HasEffect(SPELL_EFFECT_SCRIPT_EFFECT))
OnEffectHitTarget += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT);
@@ -4155,6 +4210,40 @@ public:
}
};
+// 34098 - ClearAllDebuffs
+class spell_gen_clear_debuffs : public SpellScriptLoader
+{
+ public:
+ spell_gen_clear_debuffs() : SpellScriptLoader("spell_gen_clear_debuffs") { }
+
+ class spell_gen_clear_debuffs_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_clear_debuffs_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ {
+ target->RemoveOwnedAuras([](Aura const* aura)
+ {
+ SpellInfo const* spellInfo = aura->GetSpellInfo();
+ return !spellInfo->IsPositive() && !spellInfo->IsPassive();
+ });
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_clear_debuffs_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_gen_clear_debuffs_SpellScript();
+ }
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -4165,6 +4254,7 @@ void AddSC_generic_spell_scripts()
new spell_gen_aura_service_uniform();
new spell_gen_av_drekthar_presence();
new spell_gen_bandage();
+ new spell_gen_blood_reserve();
new spell_gen_bonked();
new spell_gen_break_shield("spell_gen_break_shield");
new spell_gen_break_shield("spell_gen_tournament_counterattack");
@@ -4241,4 +4331,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_stand();
new spell_gen_mixology_bonus();
new spell_gen_landmine_knockback_achievement();
+ new spell_gen_clear_debuffs();
}
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index 7fe1f54a594..bd36e3cb765 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -29,6 +29,7 @@
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
+#include "Vehicle.h"
// 45102 Romantic Picnic
enum SpellsPicnic
@@ -64,7 +65,7 @@ class spell_love_is_in_the_air_romantic_picnic : public SpellScriptLoader
Unit* caster = GetCaster();
// If our player is no longer sit, remove all auras
- if (target->getStandState() != UNIT_STAND_STATE_SIT)
+ if (target->GetStandState() != UNIT_STAND_STATE_SIT)
{
target->RemoveAura(SPELL_ROMANTIC_PICNIC_ACHIEV);
target->RemoveAura(GetAura());
@@ -83,7 +84,7 @@ class spell_love_is_in_the_air_romantic_picnic : public SpellScriptLoader
target->VisitNearbyWorldObject(INTERACTION_DISTANCE*2, searcher);
for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
{
- if ((*itr) != target && (*itr)->HasAura(GetId())) // && (*itr)->getStandState() == UNIT_STAND_STATE_SIT)
+ if ((*itr) != target && (*itr)->HasAura(GetId())) // && (*itr)->GetStandState() == UNIT_STAND_STATE_SIT)
{
if (caster)
{
@@ -112,6 +113,105 @@ class spell_love_is_in_the_air_romantic_picnic : public SpellScriptLoader
}
};
+enum HallowEndCandysSpells
+{
+ SPELL_HALLOWS_END_CANDY_ORANGE_GIANT = 24924, // Effect 1: Apply Aura: Mod Size, Value: 30%
+ SPELL_HALLOWS_END_CANDY_SKELETON = 24925, // Effect 1: Apply Aura: Change Model (Skeleton). Effect 2: Apply Aura: Underwater Breathing
+ SPELL_HALLOWS_END_CANDY_PIRATE = 24926, // Effect 1: Apply Aura: Increase Swim Speed, Value: 50%
+ SPELL_HALLOWS_END_CANDY_GHOST = 24927, // Effect 1: Apply Aura: Levitate / Hover. Effect 2: Apply Aura: Slow Fall, Effect 3: Apply Aura: Water Walking
+ SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE = 44742, // Effect 1: Apply Aura: Change Model (Defias Pirate, Female). Effect 2: Increase Swim Speed, Value: 50%
+ SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE = 44743 // Effect 1: Apply Aura: Change Model (Defias Pirate, Male). Effect 2: Increase Swim Speed, Value: 50%
+};
+
+// 24930 - Hallow's End Candy
+class spell_hallow_end_candy : public SpellScriptLoader
+{
+ public:
+ spell_hallow_end_candy() : SpellScriptLoader("spell_hallow_end_candy") { }
+
+ class spell_hallow_end_candy_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_hallow_end_candy_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ for (uint32 spellId : spells)
+ if (!sSpellMgr->GetSpellInfo(spellId))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->CastSpell(GetCaster(), spells[urand(0, 3)], true);
+ }
+
+ void Register() override
+ {
+ OnEffectHit += SpellEffectFn(spell_hallow_end_candy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+
+ private:
+ static uint32 const spells[4];
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_hallow_end_candy_SpellScript();
+ }
+};
+
+uint32 const spell_hallow_end_candy::spell_hallow_end_candy_SpellScript::spells[4] =
+{
+ SPELL_HALLOWS_END_CANDY_ORANGE_GIANT,
+ SPELL_HALLOWS_END_CANDY_SKELETON,
+ SPELL_HALLOWS_END_CANDY_PIRATE,
+ SPELL_HALLOWS_END_CANDY_GHOST
+};
+
+// 24926 - Hallow's End Candy
+class spell_hallow_end_candy_pirate : public SpellScriptLoader
+{
+ public:
+ spell_hallow_end_candy_pirate() : SpellScriptLoader("spell_hallow_end_candy_pirate") { }
+
+ class spell_hallow_end_candy_pirate_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hallow_end_candy_pirate_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE)
+ || !sSpellMgr->GetSpellInfo(SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE))
+ return false;
+ return true;
+ }
+
+ void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ uint32 spell = GetTarget()->getGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE;
+ GetTarget()->CastSpell(GetTarget(), spell, true);
+ }
+
+ void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ uint32 spell = GetTarget()->getGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE;
+ GetTarget()->RemoveAurasDueToSpell(spell);
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_hallow_end_candy_pirate_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_MOD_INCREASE_SWIM_SPEED, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_hallow_end_candy_pirate_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_MOD_INCREASE_SWIM_SPEED, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_hallow_end_candy_pirate_AuraScript();
+ }
+};
+
// 24750 Trick
enum TrickSpells
{
@@ -410,6 +510,84 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
}
};
+enum FeastOnSpells
+{
+ FEAST_ON_TURKEY = 61784,
+ FEAST_ON_CRANBERRIES = 61785,
+ FEAST_ON_SWEET_POTATOES = 61786,
+ FEAST_ON_PIE = 61787,
+ FEAST_ON_STUFFING = 61788,
+ SPELL_CRANBERRY_HELPINS = 61841,
+ SPELL_TURKEY_HELPINS = 61842,
+ SPELL_STUFFING_HELPINS = 61843,
+ SPELL_SWEET_POTATO_HELPINS = 61844,
+ SPELL_PIE_HELPINS = 61845,
+ SPELL_ON_PLATE_EAT_VISUAL = 61826
+};
+
+class spell_pilgrims_bounty_feast_on : public SpellScriptLoader
+{
+ public:
+ spell_pilgrims_bounty_feast_on() : SpellScriptLoader("spell_pilgrims_bounty_feast_on") { }
+
+ class spell_pilgrims_bounty_feast_on_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pilgrims_bounty_feast_on_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+
+ uint32 _spellId = 0;
+ switch (GetSpellInfo()->Id)
+ {
+ case FEAST_ON_TURKEY:
+ _spellId = SPELL_TURKEY_HELPINS;
+ break;
+ case FEAST_ON_CRANBERRIES:
+ _spellId = SPELL_CRANBERRY_HELPINS;
+ break;
+ case FEAST_ON_SWEET_POTATOES:
+ _spellId = SPELL_SWEET_POTATO_HELPINS;
+ break;
+ case FEAST_ON_PIE:
+ _spellId = SPELL_PIE_HELPINS;
+ break;
+ case FEAST_ON_STUFFING:
+ _spellId = SPELL_STUFFING_HELPINS;
+ break;
+ default:
+ return;
+ }
+
+ if (Vehicle* vehicle = caster->GetVehicleKit())
+ if (Unit* target = vehicle->GetPassenger(0))
+ if (Player* player = target->ToPlayer())
+ {
+ player->CastSpell(player, SPELL_ON_PLATE_EAT_VISUAL, true);
+ caster->CastSpell(player, _spellId, true, NULL, NULL, player->GetGUID());
+ }
+
+ if (Aura* aura = caster->GetAura(GetEffectValue()))
+ {
+ if (aura->GetStackAmount() == 1)
+ caster->RemoveAurasDueToSpell(aura->GetSpellInfo()->Effects[EFFECT_0].CalcValue());
+ aura->ModStackAmount(-1);
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_feast_on_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_pilgrims_bounty_feast_on_SpellScript();
+ }
+};
+
enum TheTurkinator
{
SPELL_KILL_COUNTER_VISUAL = 62015,
@@ -429,7 +607,7 @@ class spell_pilgrims_bounty_turkey_tracker : public SpellScriptLoader
{
PrepareSpellScript(spell_pilgrims_bounty_turkey_tracker_SpellScript);
- bool Validate(SpellInfo const* /*spell*/)
+ bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_KILL_COUNTER_VISUAL) || !sSpellMgr->GetSpellInfo(SPELL_KILL_COUNTER_VISUAL_MAX))
return false;
@@ -472,18 +650,90 @@ class spell_pilgrims_bounty_turkey_tracker : public SpellScriptLoader
}
}
- void Register()
+ void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_turkey_tracker_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
- SpellScript* GetSpellScript() const
+ SpellScript* GetSpellScript() const override
{
return new spell_pilgrims_bounty_turkey_tracker_SpellScript();
}
};
+enum SpiritOfSharing
+{
+ SPELL_THE_SPIRIT_OF_SHARING = 61849
+};
+
+class spell_pilgrims_bounty_well_fed : public SpellScriptLoader
+{
+ private:
+ uint32 _triggeredSpellId;
+
+ public:
+ spell_pilgrims_bounty_well_fed(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
+
+ class spell_pilgrims_bounty_well_fed_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pilgrims_bounty_well_fed_SpellScript);
+ private:
+ uint32 _triggeredSpellId;
+
+ public:
+ spell_pilgrims_bounty_well_fed_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(_triggeredSpellId))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+ Player* target = GetHitPlayer();
+ if (!target)
+ return;
+
+ if (Aura const* aura = target->GetAura(GetSpellInfo()->Id))
+ {
+ if (aura->GetStackAmount() == 5)
+ target->CastSpell(target, _triggeredSpellId, true);
+ }
+
+ Aura const* turkey = target->GetAura(SPELL_TURKEY_HELPINS);
+ Aura const* cranberies = target->GetAura(SPELL_CRANBERRY_HELPINS);
+ Aura const* stuffing = target->GetAura(SPELL_STUFFING_HELPINS);
+ Aura const* sweetPotatoes = target->GetAura(SPELL_SWEET_POTATO_HELPINS);
+ Aura const* pie = target->GetAura(SPELL_PIE_HELPINS);
+
+ if ((turkey && turkey->GetStackAmount() == 5) && (cranberies && cranberies->GetStackAmount() == 5) && (stuffing && stuffing->GetStackAmount() == 5)
+ && (sweetPotatoes && sweetPotatoes->GetStackAmount() == 5) && (pie && pie->GetStackAmount() == 5))
+ {
+ target->CastSpell(target, SPELL_THE_SPIRIT_OF_SHARING, true);
+ target->RemoveAurasDueToSpell(SPELL_TURKEY_HELPINS);
+ target->RemoveAurasDueToSpell(SPELL_CRANBERRY_HELPINS);
+ target->RemoveAurasDueToSpell(SPELL_STUFFING_HELPINS);
+ target->RemoveAurasDueToSpell(SPELL_SWEET_POTATO_HELPINS);
+ target->RemoveAurasDueToSpell(SPELL_PIE_HELPINS);
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_well_fed_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_pilgrims_bounty_well_fed_SpellScript(_triggeredSpellId);
+ }
+};
+
enum Mistletoe
{
SPELL_CREATE_MISTLETOE = 26206,
@@ -1032,11 +1282,79 @@ class spell_midsummer_braziers_hit : public SpellScriptLoader
}
};
+enum RibbonPoleData
+{
+ SPELL_HAS_FULL_MIDSUMMER_SET = 58933,
+ SPELL_BURNING_HOT_POLE_DANCE = 58934,
+ SPELL_RIBBON_DANCE_COSMETIC = 29726,
+ SPELL_RIBBON_DANCE = 29175,
+ GO_RIBBON_POLE = 181605,
+};
+
+class spell_gen_ribbon_pole_dancer_check : public SpellScriptLoader
+{
+ public:
+ spell_gen_ribbon_pole_dancer_check() : SpellScriptLoader("spell_gen_ribbon_pole_dancer_check") { }
+
+ class spell_gen_ribbon_pole_dancer_check_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_ribbon_pole_dancer_check_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_HAS_FULL_MIDSUMMER_SET)
+ || !sSpellMgr->GetSpellInfo(SPELL_RIBBON_DANCE)
+ || !sSpellMgr->GetSpellInfo(SPELL_BURNING_HOT_POLE_DANCE))
+ return false;
+ return true;
+ }
+
+ void PeriodicTick(AuraEffect const* /*aurEff*/)
+ {
+ Unit* target = GetTarget();
+
+ // check if aura needs to be removed
+ if (!target->FindNearestGameObject(GO_RIBBON_POLE, 8.0f) || !target->HasUnitState(UNIT_STATE_CASTING))
+ {
+ target->InterruptNonMeleeSpells(false);
+ target->RemoveAurasDueToSpell(GetId());
+ target->RemoveAura(SPELL_RIBBON_DANCE_COSMETIC);
+ return;
+ }
+
+ // set xp buff duration
+ if (Aura* aur = target->GetAura(SPELL_RIBBON_DANCE))
+ {
+ aur->SetMaxDuration(std::min(3600000, aur->GetMaxDuration() + 180000));
+ aur->RefreshDuration();
+
+ // reward achievement criteria
+ if (aur->GetMaxDuration() == 3600000 && target->HasAura(SPELL_HAS_FULL_MIDSUMMER_SET))
+ target->CastSpell(target, SPELL_BURNING_HOT_POLE_DANCE, true);
+ }
+ else
+ target->AddAura(SPELL_RIBBON_DANCE, target);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_ribbon_pole_dancer_check_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_gen_ribbon_pole_dancer_check_AuraScript();
+ }
+};
+
void AddSC_holiday_spell_scripts()
{
// Love is in the Air
new spell_love_is_in_the_air_romantic_picnic();
// Hallow's End
+ new spell_hallow_end_candy();
+ new spell_hallow_end_candy_pirate();
new spell_hallow_end_trick();
new spell_hallow_end_trick_or_treat();
new spell_hallow_end_tricky_treat();
@@ -1047,6 +1365,12 @@ void AddSC_holiday_spell_scripts()
new spell_pilgrims_bounty_buff_food("spell_gen_spice_bread_stuffing", SPELL_WELL_FED_HIT_TRIGGER);
new spell_pilgrims_bounty_buff_food("spell_gen_pumpkin_pie", SPELL_WELL_FED_SPIRIT_TRIGGER);
new spell_pilgrims_bounty_buff_food("spell_gen_candied_sweet_potato", SPELL_WELL_FED_HASTE_TRIGGER);
+ new spell_pilgrims_bounty_feast_on();
+ new spell_pilgrims_bounty_well_fed("spell_pilgrims_bounty_well_fed_turkey", SPELL_WELL_FED_AP_TRIGGER);
+ new spell_pilgrims_bounty_well_fed("spell_pilgrims_bounty_well_fed_cranberry", SPELL_WELL_FED_ZM_TRIGGER);
+ new spell_pilgrims_bounty_well_fed("spell_pilgrims_bounty_well_fed_stuffing", SPELL_WELL_FED_HIT_TRIGGER);
+ new spell_pilgrims_bounty_well_fed("spell_pilgrims_bounty_well_fed_sweet_potatoes", SPELL_WELL_FED_HASTE_TRIGGER);
+ new spell_pilgrims_bounty_well_fed("spell_pilgrims_bounty_well_fed_pie", SPELL_WELL_FED_SPIRIT_TRIGGER);
new spell_pilgrims_bounty_turkey_tracker();
// Winter Veil
new spell_winter_veil_mistletoe();
@@ -1062,4 +1386,5 @@ void AddSC_holiday_spell_scripts()
new spell_brewfest_barker_bunny();
// Midsummer Fire Festival
new spell_midsummer_braziers_hit();
+ new spell_gen_ribbon_pole_dancer_check();
}
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index abf4c6c1ad8..a75294ad6e0 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -40,6 +40,7 @@ enum HunterSpells
SPELL_HUNTER_CHIMERA_SHOT_SERPENT = 53353,
SPELL_HUNTER_CHIMERA_SHOT_VIPER = 53358,
SPELL_HUNTER_CHIMERA_SHOT_SCORPID = 53359,
+ SPELL_HUNTER_GLYPH_OF_ARCANE_SHOT = 61389,
SPELL_HUNTER_GLYPH_OF_ASPECT_OF_THE_VIPER = 56851,
SPELL_HUNTER_IMPROVED_MEND_PET = 24406,
SPELL_HUNTER_INVIGORATION_TRIGGERED = 53398,
@@ -50,12 +51,15 @@ enum HunterSpells
SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114,
SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711,
SPELL_HUNTER_PET_CARRION_FEEDER_TRIGGERED = 54045,
+ SPELL_HUNTER_PIERCING_SHOTS = 63468,
SPELL_HUNTER_READINESS = 23989,
SPELL_HUNTER_SNIPER_TRAINING_R1 = 53302,
SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 = 64418,
+ SPELL_HUNTER_T9_4P_GREATNESS = 68130,
SPELL_HUNTER_VICIOUS_VIPER = 61609,
SPELL_HUNTER_VIPER_ATTACK_SPEED = 60144,
- SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543
+ SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543,
+ SPELL_ROAR_OF_SACRIFICE_TRIGGERED = 67481
};
// 13161 - Aspect of the Beast
@@ -192,8 +196,8 @@ class spell_hun_chimera_shot : public SpellScriptLoader
{
uint32 spellId = 0;
int32 basePoint = 0;
- Unit::AuraApplicationMap& Auras = unitTarget->GetAppliedAuras();
- for (Unit::AuraApplicationMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
+ Unit::AuraApplicationMap const& auras = unitTarget->GetAppliedAuras();
+ for (Unit::AuraApplicationMap::const_iterator i = auras.begin(); i != auras.end(); ++i)
{
Aura* aura = i->second->GetBase();
if (aura->GetCasterGUID() != caster->GetGUID())
@@ -296,6 +300,68 @@ class spell_hun_disengage : public SpellScriptLoader
}
};
+// 56841 - Glyph of Arcane Shot
+class spell_hun_glyph_of_arcane_shot : public SpellScriptLoader
+{
+ public:
+ spell_hun_glyph_of_arcane_shot() : SpellScriptLoader("spell_hun_glyph_of_arcane_shot") { }
+
+ class spell_hun_glyph_of_arcane_shot_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_glyph_of_arcane_shot_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_GLYPH_OF_ARCANE_SHOT))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ if (Unit* procTarget = eventInfo.GetProcTarget())
+ {
+ Unit::AuraApplicationMap const& auras = procTarget->GetAppliedAuras();
+ for (Unit::AuraApplicationMap::const_iterator i = auras.begin(); i != auras.end(); ++i)
+ {
+ Aura const* aura = i->second->GetBase();
+ if (aura->GetCasterGUID() != GetTarget()->GetGUID())
+ continue;
+ // Search only Serpent Sting, Viper Sting, Scorpid Sting, Wyvern Sting
+ if (aura->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_HUNTER
+ && aura->GetSpellInfo()->SpellFamilyFlags.HasFlag(0xC000, 0x1080))
+ return true;
+ }
+ }
+ return false;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ SpellInfo const* procSpell = eventInfo.GetSpellInfo();
+ if (!procSpell)
+ return;
+
+ int32 mana = procSpell->CalcPowerCost(GetTarget(), procSpell->GetSchoolMask());
+ ApplyPct(mana, aurEff->GetAmount());
+
+ GetTarget()->CastCustomSpell(SPELL_HUNTER_GLYPH_OF_ARCANE_SHOT, SPELLVALUE_BASE_POINT0, mana, GetTarget());
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_hun_glyph_of_arcane_shot_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_hun_glyph_of_arcane_shot_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_hun_glyph_of_arcane_shot_AuraScript();
+ }
+};
+
// -19572 - Improved Mend Pet
class spell_hun_improved_mend_pet : public SpellScriptLoader
{
@@ -336,6 +402,7 @@ class spell_hun_improved_mend_pet : public SpellScriptLoader
return new spell_hun_improved_mend_pet_AuraScript();
}
};
+
// 53412 - Invigoration
class spell_hun_invigoration : public SpellScriptLoader
{
@@ -640,6 +707,63 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader
}
};
+// -53234 - Piercing Shots
+class spell_hun_piercing_shots : public SpellScriptLoader
+{
+public:
+ spell_hun_piercing_shots() : SpellScriptLoader("spell_hun_piercing_shots") { }
+
+ class spell_hun_piercing_shots_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_piercing_shots_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_PIERCING_SHOTS))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ if (eventInfo.GetActionTarget())
+ return true;
+ return false;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ Unit* caster = eventInfo.GetActor();
+ Unit* target = eventInfo.GetActionTarget();
+
+ if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo())
+ {
+ SpellInfo const* piercingShots = sSpellMgr->AssertSpellInfo(SPELL_HUNTER_PIERCING_SHOTS);
+ int32 duration = piercingShots->GetMaxDuration();
+ uint32 amplitude = piercingShots->Effects[EFFECT_0].Amplitude;
+ uint32 dmg = dmgInfo->GetDamage();
+
+ uint32 bp = CalculatePct(int32(dmg), aurEff->GetAmount()) / (duration / int32(amplitude));
+ bp += target->GetRemainingPeriodicAmount(target->GetGUID(), SPELL_HUNTER_PIERCING_SHOTS, SPELL_AURA_PERIODIC_DAMAGE);
+
+ caster->CastCustomSpell(SPELL_HUNTER_PIERCING_SHOTS, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff);
+ }
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_hun_piercing_shots_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_hun_piercing_shots_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_hun_piercing_shots_AuraScript();
+ }
+};
+
// 56654, 58882 - Rapid Recuperation
class spell_hun_rapid_recuperation : public SpellScriptLoader
{
@@ -699,7 +823,7 @@ class spell_hun_readiness : public SpellScriptLoader
// immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath
GetCaster()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
///! If spellId in cooldown map isn't valid, the above will return a null pointer.
if (spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER &&
@@ -724,6 +848,49 @@ class spell_hun_readiness : public SpellScriptLoader
}
};
+// 53480 - Roar of Sacrifice
+class spell_hun_roar_of_sacrifice : public SpellScriptLoader
+{
+ public:
+ spell_hun_roar_of_sacrifice() : SpellScriptLoader("spell_hun_roar_of_sacrifice") { }
+
+ class spell_hun_roar_of_sacrifice_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_roar_of_sacrifice_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ROAR_OF_SACRIFICE_TRIGGERED))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ return GetCaster() && (eventInfo.GetDamageInfo()->GetSchoolMask() & GetEffect(EFFECT_1)->GetMiscValue()) != 0;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ uint32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount());
+ eventInfo.GetActor()->CastCustomSpell(SPELL_ROAR_OF_SACRIFICE_TRIGGERED, SPELLVALUE_BASE_POINT0, damage, GetCaster(), TRIGGERED_FULL_MASK, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_hun_roar_of_sacrifice_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_hun_roar_of_sacrifice_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_hun_roar_of_sacrifice_AuraScript();
+ }
+};
+
// 37506 - Scatter Shot
class spell_hun_scatter_shot : public SpellScriptLoader
{
@@ -903,6 +1070,51 @@ class spell_hun_target_only_pet_and_owner : public SpellScriptLoader
}
};
+// 67151 - T9 4P Bonus
+class spell_hun_t9_4p_bonus : public SpellScriptLoader
+{
+public:
+ spell_hun_t9_4p_bonus() : SpellScriptLoader("spell_hun_t9_4p_bonus") { }
+
+ class spell_hun_t9_4p_bonus_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_t9_4p_bonus_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_T9_4P_GREATNESS))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ if (eventInfo.GetActor()->GetTypeId() == TYPEID_PLAYER && eventInfo.GetActor()->ToPlayer()->GetPet())
+ return true;
+ return false;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ Unit* caster = eventInfo.GetActor();
+
+ caster->CastSpell(caster->ToPlayer()->GetPet(), SPELL_HUNTER_T9_4P_GREATNESS, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_hun_t9_4p_bonus_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_hun_t9_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_hun_t9_4p_bonus_AuraScript();
+ }
+};
+
// 60144 - Viper Attack Speed
class spell_hun_viper_attack_speed : public SpellScriptLoader
{
@@ -952,6 +1164,7 @@ void AddSC_hunter_spell_scripts()
new spell_hun_ascpect_of_the_viper();
new spell_hun_chimera_shot();
new spell_hun_disengage();
+ new spell_hun_glyph_of_arcane_shot();
new spell_hun_improved_mend_pet();
new spell_hun_invigoration();
new spell_hun_last_stand_pet();
@@ -960,11 +1173,14 @@ void AddSC_hunter_spell_scripts()
new spell_hun_misdirection_proc();
new spell_hun_pet_carrion_feeder();
new spell_hun_pet_heart_of_the_phoenix();
+ new spell_hun_piercing_shots();
new spell_hun_rapid_recuperation();
new spell_hun_readiness();
+ new spell_hun_roar_of_sacrifice();
new spell_hun_scatter_shot();
new spell_hun_sniper_training();
new spell_hun_tame_beast();
new spell_hun_target_only_pet_and_owner();
+ new spell_hun_t9_4p_bonus();
new spell_hun_viper_attack_speed();
}
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 0abff255e4b..5a6bb78eb10 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -201,6 +201,55 @@ class spell_item_blessing_of_ancient_kings : public SpellScriptLoader
}
};
+// 47770 - Roll Dice
+class spell_item_decahedral_dwarven_dice : public SpellScriptLoader
+{
+ public:
+ spell_item_decahedral_dwarven_dice() : SpellScriptLoader("spell_item_decahedral_dwarven_dice") { }
+
+ class spell_item_decahedral_dwarven_dice_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_decahedral_dwarven_dice_SpellScript);
+
+ enum
+ {
+ TEXT_DECAHEDRAL_DWARVEN_DICE = 26147
+ };
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sObjectMgr->GetBroadcastText(TEXT_DECAHEDRAL_DWARVEN_DICE))
+ return false;
+ return true;
+ }
+
+ bool Load() override
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->TextEmote(TEXT_DECAHEDRAL_DWARVEN_DICE, GetHitUnit());
+
+ static uint32 const minimum = 1;
+ static uint32 const maximum = 100;
+
+ GetCaster()->ToPlayer()->DoRandomRoll(minimum, maximum);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_decahedral_dwarven_dice_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_item_decahedral_dwarven_dice_SpellScript();
+ }
+};
+
// 8342 - Defibrillate (Goblin Jumper Cables) have 33% chance on success
// 22999 - Defibrillate (Goblin Jumper Cables XL) have 50% chance on success
// 54732 - Defibrillate (Gnomish Army Knife) have 67% chance on success
@@ -1319,6 +1368,57 @@ class spell_item_underbelly_elixir : public SpellScriptLoader
}
};
+// 47776 - Roll 'dem Bones
+class spell_item_worn_troll_dice : public SpellScriptLoader
+{
+ public:
+ spell_item_worn_troll_dice() : SpellScriptLoader("spell_item_worn_troll_dice") { }
+
+ class spell_item_worn_troll_dice_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_worn_troll_dice_SpellScript);
+
+ enum
+ {
+ TEXT_WORN_TROLL_DICE = 26152
+ };
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sObjectMgr->GetBroadcastText(TEXT_WORN_TROLL_DICE))
+ return false;
+ return true;
+ }
+
+ bool Load() override
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->TextEmote(TEXT_WORN_TROLL_DICE, GetHitUnit());
+
+ static uint32 const minimum = 1;
+ static uint32 const maximum = 6;
+
+ // roll twice
+ GetCaster()->ToPlayer()->DoRandomRoll(minimum, maximum);
+ GetCaster()->ToPlayer()->DoRandomRoll(minimum, maximum);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_worn_troll_dice_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_item_worn_troll_dice_SpellScript();
+ }
+};
+
enum AirRifleSpells
{
SPELL_AIR_RIFLE_HOLD_VISUAL = 65582,
@@ -1803,7 +1903,7 @@ class spell_item_crystal_prison_dummy_dnd : public SpellScriptLoader
if (Creature* target = GetHitCreature())
if (target->isDead() && !target->IsPet())
{
- GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0, 0, 0, 0, uint32(target->GetRespawnTime()-time(NULL)));
+ GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, *target, G3D::Quat(), uint32(target->GetRespawnTime()-time(NULL)));
target->DespawnOrUnsummon();
}
}
@@ -2631,6 +2731,70 @@ public:
}
};
+enum SoulPreserver
+{
+ SPELL_SOUL_PRESERVER_DRUID = 60512,
+ SPELL_SOUL_PRESERVER_PALADIN = 60513,
+ SPELL_SOUL_PRESERVER_PRIEST = 60514,
+ SPELL_SOUL_PRESERVER_SHAMAN = 60515,
+};
+
+class spell_item_soul_preserver : public SpellScriptLoader
+{
+public:
+ spell_item_soul_preserver() : SpellScriptLoader("spell_item_soul_preserver") { }
+
+ class spell_item_soul_preserver_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_item_soul_preserver_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_DRUID) ||
+ !sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_PALADIN) ||
+ !sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_PRIEST) ||
+ !sSpellMgr->GetSpellInfo(SPELL_SOUL_PRESERVER_SHAMAN))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ Unit* caster = eventInfo.GetActor();
+
+ switch (caster->getClass())
+ {
+ case CLASS_DRUID:
+ caster->CastSpell(caster, SPELL_SOUL_PRESERVER_DRUID, true, nullptr, aurEff);
+ break;
+ case CLASS_PALADIN:
+ caster->CastSpell(caster, SPELL_SOUL_PRESERVER_PALADIN, true, nullptr, aurEff);
+ break;
+ case CLASS_PRIEST:
+ caster->CastSpell(caster, SPELL_SOUL_PRESERVER_PRIEST, true, nullptr, aurEff);
+ break;
+ case CLASS_SHAMAN:
+ caster->CastSpell(caster, SPELL_SOUL_PRESERVER_SHAMAN, true, nullptr, aurEff);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_item_soul_preserver_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_item_soul_preserver_AuraScript();
+ }
+};
+
class spell_item_toy_train_set_pulse : public SpellScriptLoader
{
public:
@@ -2668,6 +2832,336 @@ public:
}
};
+enum DeathChoiceSpells
+{
+ SPELL_DEATH_CHOICE_NORMAL_AURA = 67702,
+ SPELL_DEATH_CHOICE_NORMAL_AGILITY = 67703,
+ SPELL_DEATH_CHOICE_NORMAL_STRENGTH = 67708,
+ SPELL_DEATH_CHOICE_HEROIC_AURA = 67771,
+ SPELL_DEATH_CHOICE_HEROIC_AGILITY = 67772,
+ SPELL_DEATH_CHOICE_HEROIC_STRENGTH = 67773
+};
+
+class spell_item_death_choice : public SpellScriptLoader
+{
+public:
+ spell_item_death_choice() : SpellScriptLoader("spell_item_death_choice") { }
+
+ class spell_item_death_choice_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_item_death_choice_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_NORMAL_STRENGTH) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_NORMAL_AGILITY) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_HEROIC_STRENGTH) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DEATH_CHOICE_HEROIC_AGILITY))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ Unit* caster = eventInfo.GetActor();
+ float str = caster->GetStat(STAT_STRENGTH);
+ float agi = caster->GetStat(STAT_AGILITY);
+
+ switch (aurEff->GetId())
+ {
+ case SPELL_DEATH_CHOICE_NORMAL_AURA:
+ {
+ if (str > agi)
+ caster->CastSpell(caster, SPELL_DEATH_CHOICE_NORMAL_STRENGTH, true, nullptr, aurEff);
+ else
+ caster->CastSpell(caster, SPELL_DEATH_CHOICE_NORMAL_AGILITY, true, nullptr, aurEff);
+ break;
+ }
+ case SPELL_DEATH_CHOICE_HEROIC_AURA:
+ {
+ if (str > agi)
+ caster->CastSpell(caster, SPELL_DEATH_CHOICE_HEROIC_STRENGTH, true, nullptr, aurEff);
+ else
+ caster->CastSpell(caster, SPELL_DEATH_CHOICE_HEROIC_AGILITY, true, nullptr, aurEff);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_item_death_choice_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_item_death_choice_AuraScript();
+ }
+};
+
+enum TrinketStackSpells
+{
+ SPELL_LIGHTNING_CAPACITOR_AURA = 37657, // Lightning Capacitor
+ SPELL_LIGHTNING_CAPACITOR_STACK = 37658,
+ SPELL_LIGHTNING_CAPACITOR_TRIGGER = 37661,
+ SPELL_THUNDER_CAPACITOR_AURA = 54841, // Thunder Capacitor
+ SPELL_THUNDER_CAPACITOR_STACK = 54842,
+ SPELL_THUNDER_CAPACITOR_TRIGGER = 54843,
+ SPELL_TOC25_CASTER_TRINKET_NORMAL_AURA = 67712, // Item - Coliseum 25 Normal Caster Trinket
+ SPELL_TOC25_CASTER_TRINKET_NORMAL_STACK = 67713,
+ SPELL_TOC25_CASTER_TRINKET_NORMAL_TRIGGER = 67714,
+ SPELL_TOC25_CASTER_TRINKET_HEROIC_AURA = 67758, // Item - Coliseum 25 Heroic Caster Trinket
+ SPELL_TOC25_CASTER_TRINKET_HEROIC_STACK = 67759,
+ SPELL_TOC25_CASTER_TRINKET_HEROIC_TRIGGER = 67760,
+};
+
+class spell_item_trinket_stack : public SpellScriptLoader
+{
+public:
+ spell_item_trinket_stack(char const* scriptName, uint32 stackSpell, uint32 triggerSpell) : SpellScriptLoader(scriptName),
+ _stackSpell(stackSpell), _triggerSpell(triggerSpell)
+ {
+ }
+
+ class spell_item_trinket_stack_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_item_trinket_stack_AuraScript);
+
+ public:
+ spell_item_trinket_stack_AuraScript(uint32 stackSpell, uint32 triggerSpell) : _stackSpell(stackSpell), _triggerSpell(triggerSpell)
+ {
+ }
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(_stackSpell) || !sSpellMgr->GetSpellInfo(_triggerSpell))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ Unit* caster = eventInfo.GetActor();
+
+ caster->CastSpell(caster, _stackSpell, true, nullptr, aurEff); // cast the stack
+
+ Aura* dummy = caster->GetAura(_stackSpell); // retrieve aura
+
+ //dont do anything if it's not the right amount of stacks;
+ if (!dummy || dummy->GetStackAmount() < aurEff->GetAmount())
+ return;
+
+ // if right amount, remove the aura and cast real trigger
+ caster->RemoveAurasDueToSpell(_stackSpell);
+ if (Unit* target = eventInfo.GetActionTarget())
+ caster->CastSpell(target, _triggerSpell, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_item_trinket_stack_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+
+ private:
+ uint32 _stackSpell;
+ uint32 _triggerSpell;
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_item_trinket_stack_AuraScript(_stackSpell, _triggerSpell);
+ }
+
+private:
+ uint32 _stackSpell;
+ uint32 _triggerSpell;
+};
+
+// 57345 - Darkmoon Card: Greatness
+enum DarkmoonCardSpells
+{
+ SPELL_DARKMOON_CARD_STRENGHT = 60229,
+ SPELL_DARKMOON_CARD_AGILITY = 60233,
+ SPELL_DARKMOON_CARD_INTELLECT = 60234,
+ SPELL_DARKMOON_CARD_SPIRIT = 60235,
+};
+
+class spell_item_darkmoon_card_greatness : public SpellScriptLoader
+{
+public:
+ spell_item_darkmoon_card_greatness() : SpellScriptLoader("spell_item_darkmoon_card_greatness") { }
+
+ class spell_item_darkmoon_card_greatness_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_item_darkmoon_card_greatness_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_STRENGHT) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_AGILITY) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_INTELLECT) ||
+ !sSpellMgr->GetSpellInfo(SPELL_DARKMOON_CARD_SPIRIT))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ Unit* caster = eventInfo.GetActor();
+ float str = caster->GetStat(STAT_STRENGTH);
+ float agi = caster->GetStat(STAT_AGILITY);
+ float intl = caster->GetStat(STAT_INTELLECT);
+ float spi = caster->GetStat(STAT_SPIRIT);
+ float stat = 0.0f;
+
+ uint32 spellTrigger = SPELL_DARKMOON_CARD_STRENGHT;
+
+ if (str > stat)
+ {
+ spellTrigger = SPELL_DARKMOON_CARD_STRENGHT;
+ stat = str;
+ }
+
+ if (agi > stat)
+ {
+ spellTrigger = SPELL_DARKMOON_CARD_AGILITY;
+ stat = agi;
+ }
+
+ if (intl > stat)
+ {
+ spellTrigger = SPELL_DARKMOON_CARD_INTELLECT;
+ stat = intl;
+ }
+
+ if (spi > stat)
+ {
+ spellTrigger = SPELL_DARKMOON_CARD_SPIRIT;
+ stat = spi;
+ }
+
+ caster->CastSpell(caster, spellTrigger, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_item_darkmoon_card_greatness_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_item_darkmoon_card_greatness_AuraScript();
+ }
+};
+
+// 43820 - Amani Charm of the Witch Doctor
+enum CharmWitchDoctor
+{
+ SPELL_CHARM_WITCH_DOCTOR_PROC = 43821
+};
+
+class spell_item_charm_witch_doctor : public SpellScriptLoader
+{
+public:
+ spell_item_charm_witch_doctor() : SpellScriptLoader("spell_item_charm_witch_doctor") { }
+
+ class spell_item_charm_witch_doctor_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_item_charm_witch_doctor_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_CHARM_WITCH_DOCTOR_PROC))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ Unit* caster = eventInfo.GetActor();
+ Unit* target = eventInfo.GetActionTarget();
+
+ if (target)
+ {
+ int32 bp = CalculatePct(target->GetCreateHealth(),aurEff->GetSpellInfo()->Effects[1].CalcValue());
+ caster->CastCustomSpell(target, SPELL_CHARM_WITCH_DOCTOR_PROC, &bp, nullptr, nullptr, true, nullptr, aurEff);
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_item_charm_witch_doctor_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_item_charm_witch_doctor_AuraScript();
+ }
+};
+
+// 27522,40336 - Mana Drain
+enum ManaDrainSpells
+{
+ SPELL_MANA_DRAIN_ENERGIZE = 29471,
+ SPELL_MANA_DRAIN_LEECH = 27526
+};
+
+class spell_item_mana_drain : public SpellScriptLoader
+{
+public:
+ spell_item_mana_drain() : SpellScriptLoader("spell_item_mana_drain") { }
+
+ class spell_item_mana_drain_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_item_mana_drain_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MANA_DRAIN_ENERGIZE)
+ || !sSpellMgr->GetSpellInfo(SPELL_MANA_DRAIN_LEECH))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ Unit* caster = eventInfo.GetActor();
+ Unit* target = eventInfo.GetActionTarget();
+
+ if (caster->IsAlive())
+ caster->CastSpell(caster, SPELL_MANA_DRAIN_ENERGIZE, true, nullptr, aurEff);
+
+ if (target && target->IsAlive())
+ caster->CastSpell(target, SPELL_MANA_DRAIN_LEECH, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_item_mana_drain_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_item_mana_drain_AuraScript();
+ }
+};
+
void AddSC_item_spell_scripts()
{
// 23074 Arcanite Dragonling
@@ -2682,6 +3176,7 @@ void AddSC_item_spell_scripts()
new spell_item_aegis_of_preservation();
new spell_item_arcane_shroud();
new spell_item_blessing_of_ancient_kings();
+ new spell_item_decahedral_dwarven_dice();
new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL);
new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL);
new spell_item_defibrillate("spell_item_gnomish_army_knife", 33);
@@ -2706,6 +3201,7 @@ void AddSC_item_spell_scripts()
new spell_item_six_demon_bag();
new spell_item_the_eye_of_diminution();
new spell_item_underbelly_elixir();
+ new spell_item_worn_troll_dice();
new spell_item_red_rider_air_rifle();
new spell_item_create_heart_candy();
@@ -2736,5 +3232,14 @@ void AddSC_item_spell_scripts()
new spell_item_chicken_cover();
new spell_item_muisek_vessel();
new spell_item_greatmothers_soulcatcher();
+ new spell_item_soul_preserver();
new spell_item_toy_train_set_pulse();
+ new spell_item_death_choice();
+ new spell_item_trinket_stack("spell_item_lightning_capacitor", SPELL_LIGHTNING_CAPACITOR_STACK, SPELL_LIGHTNING_CAPACITOR_TRIGGER);
+ new spell_item_trinket_stack("spell_item_thunder_capacitor", SPELL_THUNDER_CAPACITOR_STACK, SPELL_THUNDER_CAPACITOR_TRIGGER);
+ new spell_item_trinket_stack("spell_item_toc25_normal_caster_trinket", SPELL_TOC25_CASTER_TRINKET_NORMAL_STACK, SPELL_TOC25_CASTER_TRINKET_NORMAL_TRIGGER);
+ new spell_item_trinket_stack("spell_item_toc25_heroic_caster_trinket", SPELL_TOC25_CASTER_TRINKET_HEROIC_STACK, SPELL_TOC25_CASTER_TRINKET_HEROIC_TRIGGER);
+ new spell_item_darkmoon_card_greatness();
+ new spell_item_charm_witch_doctor();
+ new spell_item_mana_drain();
}
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index d08968fbf55..bacbe31630c 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -29,6 +29,7 @@
enum MageSpells
{
+ SPELL_MAGE_BLAZING_SPEED = 31643,
SPELL_MAGE_BURNOUT = 29077,
SPELL_MAGE_COLD_SNAP = 11958,
SPELL_MAGE_FOCUS_MAGIC_PROC = 54648,
@@ -116,6 +117,42 @@ class spell_mage_blast_wave : public SpellScriptLoader
}
};
+// -31641 - Blazing Speed
+class spell_mage_blazing_speed : public SpellScriptLoader
+{
+public:
+ spell_mage_blazing_speed() : SpellScriptLoader("spell_mage_blazing_speed") { }
+
+ class spell_mage_blazing_speed_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_mage_blazing_speed_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_BLAZING_SPEED))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ if (Unit* target = eventInfo.GetActionTarget())
+ target->CastSpell(target, SPELL_MAGE_BLAZING_SPEED, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_mage_blazing_speed_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_mage_blazing_speed_AuraScript();
+ }
+};
+
// -44449 - Burnout
class spell_mage_burnout : public SpellScriptLoader
{
@@ -180,7 +217,7 @@ class spell_mage_cold_snap : public SpellScriptLoader
{
GetCaster()->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
return spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) &&
spellInfo->Id != SPELL_MAGE_COLD_SNAP && spellInfo->GetRecoveryTime() > 0;
}, true);
@@ -405,7 +442,7 @@ class spell_mage_ignite : public SpellScriptLoader
{
PreventDefaultAction();
- SpellInfo const* igniteDot = sSpellMgr->EnsureSpellInfo(SPELL_MAGE_IGNITE);
+ SpellInfo const* igniteDot = sSpellMgr->AssertSpellInfo(SPELL_MAGE_IGNITE);
int32 pct = 8 * GetSpellInfo()->GetRank();
int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks());
@@ -647,6 +684,7 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader
void AddSC_mage_spell_scripts()
{
new spell_mage_blast_wave();
+ new spell_mage_blazing_speed();
new spell_mage_burnout();
new spell_mage_cold_snap();
new spell_mage_fire_frost_ward();
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 8bd4b3eb070..6de95af8d8f 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -37,6 +37,7 @@ enum PaladinSpells
SPELL_PALADIN_HOLY_SHOCK_R1 = 20473,
SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE = 25912,
SPELL_PALADIN_HOLY_SHOCK_R1_HEALING = 25914,
+ SPELL_PALADIN_ILLUMINATION_ENERGIZE = 20272,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID = 37878,
SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN = 37879,
@@ -871,6 +872,61 @@ class spell_pal_holy_shock : public SpellScriptLoader
}
};
+// -20210 - Illumination
+class spell_pal_illumination : public SpellScriptLoader
+{
+public:
+ spell_pal_illumination() : SpellScriptLoader("spell_pal_illumination") { }
+
+ class spell_pal_illumination_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pal_illumination_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING) ||
+ !sSpellMgr->GetSpellInfo(SPELL_PALADIN_ILLUMINATION_ENERGIZE) ||
+ !sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ // this script is valid only for the Holy Shock procs of illumination
+ if (eventInfo.GetHealInfo() && eventInfo.GetHealInfo()->GetSpellInfo())
+ {
+ SpellInfo const* originalSpell = nullptr;
+
+ // if proc comes from the Holy Shock heal, need to get mana cost of original spell - else it's the original heal itself
+ if (eventInfo.GetHealInfo()->GetSpellInfo()->SpellFamilyFlags[1] & 0x00010000)
+ originalSpell = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1, eventInfo.GetHealInfo()->GetSpellInfo()->GetRank()));
+ else
+ originalSpell = eventInfo.GetHealInfo()->GetSpellInfo();
+
+ if (originalSpell && aurEff->GetSpellInfo())
+ {
+ Unit* target = eventInfo.GetActor(); // Paladin is the target of the energize
+ uint32 bp = CalculatePct(originalSpell->CalcPowerCost(target, originalSpell->GetSchoolMask()), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue());
+ target->CastCustomSpell(SPELL_PALADIN_ILLUMINATION_ENERGIZE, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff);
+ }
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_pal_illumination_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_pal_illumination_AuraScript();
+ }
+};
+
// Maybe this is incorrect
// These spells should always be cast on login, regardless of whether the player has the talent or not
@@ -1195,7 +1251,7 @@ class spell_pal_light_s_beacon : public SpellScriptLoader
if (!procSpell)
return;
- uint32 healSpellId = procSpell->IsRankOf(sSpellMgr->EnsureSpellInfo(SPELL_PALADIN_HOLY_LIGHT)) ? SPELL_PALADIN_BEACON_OF_LIGHT_HEAL_1 : SPELL_PALADIN_BEACON_OF_LIGHT_HEAL_3;
+ uint32 healSpellId = procSpell->IsRankOf(sSpellMgr->AssertSpellInfo(SPELL_PALADIN_HOLY_LIGHT)) ? SPELL_PALADIN_BEACON_OF_LIGHT_HEAL_1 : SPELL_PALADIN_BEACON_OF_LIGHT_HEAL_3;
uint32 heal = CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount());
Unit* beaconTarget = GetCaster();
@@ -1393,6 +1449,7 @@ void AddSC_paladin_spell_scripts()
new spell_pal_hand_of_sacrifice();
new spell_pal_hand_of_salvation();
new spell_pal_holy_shock();
+ new spell_pal_illumination();
new spell_pal_improved_aura("spell_pal_improved_concentraction_aura", SPELL_PALADIN_IMPROVED_CONCENTRACTION_AURA);
new spell_pal_improved_aura("spell_pal_improved_devotion_aura", SPELL_PALADIN_IMPROVED_DEVOTION_AURA);
new spell_pal_improved_aura("spell_pal_sanctified_retribution", SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA);
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index 7393a7d3bcb..cde291cd82b 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -916,7 +916,7 @@ public:
if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
AddPct(mod, spellInfo->Effects[EFFECT_0].CalcValue());
}
@@ -959,7 +959,7 @@ public:
if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
mod += CalculatePct(1.0f, spellInfo->Effects[EFFECT_1].CalcValue());
}
@@ -989,7 +989,7 @@ public:
if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
mod += CalculatePct(1.0f, spellInfo->Effects[EFFECT_1].CalcValue());
}
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index ecf5b7b5acf..9e2d265aa9c 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -29,6 +29,7 @@
enum PriestSpells
{
+ SPELL_PRIEST_BLESSED_RECOVERY_R1 = 27813,
SPELL_PRIEST_DIVINE_AEGIS = 47753,
SPELL_PRIEST_EMPOWERED_RENEW = 63544,
SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING = 55675,
@@ -88,6 +89,50 @@ class RaidCheck
Unit const* _caster;
};
+// -27811 - Blessed Recovery
+class spell_pri_blessed_recovery : public SpellScriptLoader
+{
+public:
+ spell_pri_blessed_recovery() : SpellScriptLoader("spell_pri_blessed_recovery") { }
+
+ class spell_pri_blessed_recovery_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pri_blessed_recovery_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_BLESSED_RECOVERY_R1))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo())
+ {
+ if (Unit* target = eventInfo.GetActionTarget())
+ {
+ uint32 triggerSpell = sSpellMgr->GetSpellWithRank(SPELL_PRIEST_BLESSED_RECOVERY_R1, aurEff->GetSpellInfo()->GetRank());
+ uint32 bp = CalculatePct(int32(dmgInfo->GetDamage()), aurEff->GetAmount()) / 3;
+ bp += target->GetRemainingPeriodicAmount(target->GetGUID(), triggerSpell, SPELL_AURA_PERIODIC_HEAL);
+ target->CastCustomSpell(triggerSpell, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff);
+ }
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_pri_blessed_recovery_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_pri_blessed_recovery_AuraScript();
+ }
+};
+
// -34861 - Circle of Healing
class spell_pri_circle_of_healing : public SpellScriptLoader
{
@@ -236,7 +281,7 @@ class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader
{
PreventDefaultAction();
- SpellInfo const* triggeredSpellInfo = sSpellMgr->EnsureSpellInfo(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL);
+ SpellInfo const* triggeredSpellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL);
int32 heal = int32(CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks());
GetTarget()->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL, SPELLVALUE_BASE_POINT0, heal, eventInfo.GetProcTarget(), true, NULL, aurEff);
}
@@ -869,6 +914,7 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
void AddSC_priest_spell_scripts()
{
+ new spell_pri_blessed_recovery();
new spell_pri_circle_of_healing();
new spell_pri_divine_aegis();
new spell_pri_divine_hymn();
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 3121a18734d..715e4d4ed2d 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -1080,9 +1080,7 @@ enum RedSnapperVeryTasty
ITEM_RED_SNAPPER = 23614,
SPELL_CAST_NET = 29866,
- SPELL_NEW_SUMMON_TEST = 49214,
-
- GO_SCHOOL_OF_RED_SNAPPER = 181616
+ SPELL_NEW_SUMMON_TEST = 49214
};
class spell_q9452_cast_net: public SpellScriptLoader
@@ -1099,15 +1097,6 @@ class spell_q9452_cast_net: public SpellScriptLoader
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
- SpellCastResult CheckCast()
- {
- GameObject* go = GetCaster()->FindNearestGameObject(GO_SCHOOL_OF_RED_SNAPPER, 3.0f);
- if (!go || go->GetRespawnTime())
- return SPELL_FAILED_REQUIRES_SPELL_FOCUS;
-
- return SPELL_CAST_OK;
- }
-
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
@@ -1127,7 +1116,6 @@ class spell_q9452_cast_net: public SpellScriptLoader
void Register() override
{
- OnCheckCast += SpellCheckCastFn(spell_q9452_cast_net_SpellScript::CheckCast);
OnEffectHit += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleActiveObject, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT);
}
@@ -1707,7 +1695,7 @@ enum Quest13291_13292_13239_13261Data
NPC_SKYTALON = 31583,
NPC_DECOY = 31578,
// Spells
- SPELL_RIDE = 56687
+ SPELL_RIDE = 59319
};
class spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy : public SpellScriptLoader
@@ -2482,6 +2470,33 @@ class spell_q13665_q13790_bested_trigger : public SpellScriptLoader
}
};
+// herald of war and life without regret portal spells
+class spell_59064_59439_portals : public SpellScriptLoader
+{
+public:
+ spell_59064_59439_portals() : SpellScriptLoader("spell_59064_59439_portals") { }
+
+ class spell_59064_59439_portals_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_59064_59439_portals_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ GetHitUnit()->CastSpell(GetHitUnit(), uint32(GetEffectValue()));
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_59064_59439_portals_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_59064_59439_portals_SpellScript();
+ }
+};
+
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -2542,4 +2557,5 @@ void AddSC_quest_spell_scripts()
new spell_q10929_fumping();
new spell_q12414_hand_over_reins();
new spell_q13665_q13790_bested_trigger();
+ new spell_59064_59439_portals();
}
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index 9b577d4e140..1abb6741e0d 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -43,7 +43,8 @@ enum RogueSpells
SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC = 59628,
SPELL_ROGUE_HONOR_AMONG_THIEVES = 51698,
SPELL_ROGUE_HONOR_AMONG_THIEVES_PROC = 52916,
- SPELL_ROGUE_HONOR_AMONG_THIEVES_2 = 51699
+ SPELL_ROGUE_HONOR_AMONG_THIEVES_2 = 51699,
+ SPELL_ROGUE_T10_2P_BONUS = 70804,
};
// 13877, 33735, (check 51211, 65956) - Blade Flurry
@@ -450,7 +451,7 @@ class spell_rog_preparation : public SpellScriptLoader
Unit* caster = GetCaster();
caster->GetSpellHistory()->ResetCooldowns([caster](SpellHistory::CooldownStorageType::iterator itr) -> bool
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE)
return false;
@@ -843,6 +844,40 @@ public:
}
};
+// 70805 - Rogue T10 2P Bonus -- THIS SHOULD BE REMOVED WITH NEW PROC SYSTEM.
+class spell_rog_t10_2p_bonus : public SpellScriptLoader
+{
+public:
+ spell_rog_t10_2p_bonus() : SpellScriptLoader("spell_rog_t10_2p_bonus") { }
+
+ class spell_rog_t10_2p_bonus_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_rog_t10_2p_bonus_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_T10_2P_BONUS))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ return eventInfo.GetActor() == eventInfo.GetActionTarget();
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_rog_t10_2p_bonus_AuraScript::CheckProc);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_rog_t10_2p_bonus_AuraScript();
+ }
+};
+
void AddSC_rogue_spell_scripts()
{
new spell_rog_blade_flurry();
@@ -858,4 +893,5 @@ void AddSC_rogue_spell_scripts()
new spell_rog_tricks_of_the_trade_proc();
new spell_rog_honor_among_thieves();
new spell_rog_honor_among_thieves_proc();
+ new spell_rog_t10_2p_bonus();
}
diff --git a/src/server/scripts/Spells/spell_script_loader.cpp b/src/server/scripts/Spells/spell_script_loader.cpp
new file mode 100644
index 00000000000..b2c8d6663fa
--- /dev/null
+++ b/src/server/scripts/Spells/spell_script_loader.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+void AddSC_deathknight_spell_scripts();
+void AddSC_druid_spell_scripts();
+void AddSC_generic_spell_scripts();
+void AddSC_hunter_spell_scripts();
+void AddSC_mage_spell_scripts();
+void AddSC_paladin_spell_scripts();
+void AddSC_priest_spell_scripts();
+void AddSC_rogue_spell_scripts();
+void AddSC_shaman_spell_scripts();
+void AddSC_warlock_spell_scripts();
+void AddSC_warrior_spell_scripts();
+void AddSC_quest_spell_scripts();
+void AddSC_item_spell_scripts();
+void AddSC_holiday_spell_scripts();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddSpellsScripts()
+{
+ AddSC_deathknight_spell_scripts();
+ AddSC_druid_spell_scripts();
+ AddSC_generic_spell_scripts();
+ AddSC_hunter_spell_scripts();
+ AddSC_mage_spell_scripts();
+ AddSC_paladin_spell_scripts();
+ AddSC_priest_spell_scripts();
+ AddSC_rogue_spell_scripts();
+ AddSC_shaman_spell_scripts();
+ AddSC_warlock_spell_scripts();
+ AddSC_warrior_spell_scripts();
+ AddSC_quest_spell_scripts();
+ AddSC_item_spell_scripts();
+ AddSC_holiday_spell_scripts();
+}
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index 41e72b1388b..ad65c7c6ec7 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -48,8 +48,10 @@ enum ShamanSpells
SPELL_SHAMAN_ITEM_MANA_SURGE = 23571,
SPELL_SHAMAN_LAVA_FLOWS_R1 = 51480,
SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694,
+ SPELL_SHAMAN_LIGHTNING_SHIELD_R1 = 26364,
SPELL_SHAMAN_MANA_SPRING_TOTEM_ENERGIZE = 52032,
SPELL_SHAMAN_MANA_TIDE_TOTEM = 39609,
+ SPELL_SHAMAN_NATURE_GUARDIAN = 31616,
SPELL_SHAMAN_SATED = 57724,
SPELL_SHAMAN_STORM_EARTH_AND_FIRE = 51483,
SPELL_SHAMAN_TOTEM_EARTHBIND_EARTHGRAB = 64695,
@@ -671,7 +673,7 @@ class spell_sha_heroism : public SpellScriptLoader
}
};
-// 23551 - Lightning Shield
+// 23551 - Lightning Shield T2 Bonus
class spell_sha_item_lightning_shield : public SpellScriptLoader
{
public:
@@ -706,7 +708,7 @@ class spell_sha_item_lightning_shield : public SpellScriptLoader
}
};
-// 23552 - Lightning Shield
+// 23552 - Lightning Shield T2 Bonus
class spell_sha_item_lightning_shield_trigger : public SpellScriptLoader
{
public:
@@ -718,7 +720,7 @@ class spell_sha_item_lightning_shield_trigger : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_MANA_SURGE))
+ if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE))
return false;
return true;
}
@@ -753,7 +755,7 @@ class spell_sha_item_mana_surge : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE))
+ if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ITEM_MANA_SURGE))
return false;
return true;
}
@@ -865,6 +867,51 @@ class spell_sha_lava_lash : public SpellScriptLoader
}
};
+// -324 - Lightning Shield
+class spell_sha_lightning_shield : public SpellScriptLoader
+{
+public:
+ spell_sha_lightning_shield() : SpellScriptLoader("spell_sha_lightning_shield") { }
+
+ class spell_sha_lightning_shield_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_sha_lightning_shield_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LIGHTNING_SHIELD_R1))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ if (eventInfo.GetActionTarget())
+ return true;
+ return false;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ uint32 triggerSpell = sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_LIGHTNING_SHIELD_R1, aurEff->GetSpellInfo()->GetRank());
+
+ eventInfo.GetActionTarget()->CastSpell(eventInfo.GetActor(), triggerSpell, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_sha_lightning_shield_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_sha_lightning_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_sha_lightning_shield_AuraScript();
+ }
+};
+
// 52031, 52033, 52034, 52035, 52036, 58778, 58779, 58780 - Mana Spring Totem
class spell_sha_mana_spring_totem : public SpellScriptLoader
{
@@ -924,6 +971,7 @@ class spell_sha_mana_tide_totem : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
+ {
if (Unit* unitTarget = GetHitUnit())
{
if (unitTarget->getPowerType() == POWER_MANA)
@@ -938,6 +986,7 @@ class spell_sha_mana_tide_totem : public SpellScriptLoader
caster->CastCustomSpell(unitTarget, SPELL_SHAMAN_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
}
}
+ }
}
void Register() override
@@ -952,6 +1001,56 @@ class spell_sha_mana_tide_totem : public SpellScriptLoader
}
};
+// -30881 - Nature's Guardian
+class spell_sha_nature_guardian : public SpellScriptLoader
+{
+public:
+ spell_sha_nature_guardian() : SpellScriptLoader("spell_sha_nature_guardian") { }
+
+ class spell_sha_nature_guardian_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_sha_nature_guardian_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_NATURE_GUARDIAN))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ int32 healthpct = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); // %s2 - the 30% threshold for health
+
+ if (Unit* target = eventInfo.GetActionTarget())
+ {
+ if (target->HealthBelowPctDamaged(healthpct, eventInfo.GetDamageInfo()->GetDamage()))
+ {
+
+ uint32 bp = CalculatePct(target->GetMaxHealth(), aurEff->GetAmount());
+ target->CastCustomSpell(SPELL_SHAMAN_NATURE_GUARDIAN, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff);
+
+ // Threat reduction is around 10% confirmed in retail and from wiki
+ Unit* attacker = eventInfo.GetActor();
+ if (attacker->IsAlive())
+ attacker->getThreatManager().modifyThreatPercent(target, -10);
+ }
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_sha_nature_guardian_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_sha_nature_guardian_AuraScript();
+ }
+};
+
// 6495 - Sentry Totem
class spell_sha_sentry_totem : public SpellScriptLoader
{
@@ -1085,8 +1184,10 @@ void AddSC_shaman_spell_scripts()
new spell_sha_item_mana_surge();
new spell_sha_item_t10_elemental_2p_bonus();
new spell_sha_lava_lash();
+ new spell_sha_lightning_shield();
new spell_sha_mana_spring_totem();
new spell_sha_mana_tide_totem();
+ new spell_sha_nature_guardian();
new spell_sha_sentry_totem();
new spell_sha_thunderstorm();
new spell_sha_totemic_mastery();
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 7cc6fe888e9..5e0074bf9f7 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -50,6 +50,12 @@ enum WarlockSpells
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956,
SPELL_WARLOCK_LIFE_TAP_ENERGIZE = 31818,
SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553,
+ SPELL_WARLOCK_NETHER_PROTECTION_HOLY = 54370,
+ SPELL_WARLOCK_NETHER_PROTECTION_FIRE = 54371,
+ SPELL_WARLOCK_NETHER_PROTECTION_FROST = 54372,
+ SPELL_WARLOCK_NETHER_PROTECTION_ARCANE = 54373,
+ SPELL_WARLOCK_NETHER_PROTECTION_SHADOW = 54374,
+ SPELL_WARLOCK_NETHER_PROTECTION_NATURE = 54375,
SPELL_WARLOCK_SOULSHATTER = 32835,
SPELL_WARLOCK_SIPHON_LIFE_HEAL = 63106,
SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117
@@ -271,7 +277,7 @@ class spell_warl_demonic_circle_summon : public SpellScriptLoader
// WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT.
// If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST.
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT);
if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true)))
{
@@ -362,7 +368,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader
break;
case CREATURE_FAMILY_VOIDWALKER:
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
targetCreature->CastCustomSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true);
//unitTarget->CastSpell(unitTarget, 54441, true);
@@ -377,6 +383,8 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader
case CREATURE_FAMILY_IMP:
targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
break;
+ default:
+ break;
}
}
}
@@ -682,6 +690,95 @@ class spell_warl_life_tap : public SpellScriptLoader
}
};
+// -30299 - Nether Protection
+class spell_warl_nether_protection : public SpellScriptLoader
+{
+public:
+ spell_warl_nether_protection() : SpellScriptLoader("spell_warl_nether_protection") { }
+
+ class spell_warl_nether_protection_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_nether_protection_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_NETHER_PROTECTION_HOLY) ||
+ !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_NETHER_PROTECTION_FIRE) ||
+ !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_NETHER_PROTECTION_FROST) ||
+ !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_NETHER_PROTECTION_ARCANE) ||
+ !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_NETHER_PROTECTION_SHADOW) ||
+ !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_NETHER_PROTECTION_NATURE))
+ return false;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ if (eventInfo.GetDamageInfo())
+ {
+ switch (GetFirstSchoolInMask(eventInfo.GetDamageInfo()->GetSchoolMask()))
+ {
+ case SPELL_SCHOOL_HOLY:
+ case SPELL_SCHOOL_FIRE:
+ case SPELL_SCHOOL_NATURE:
+ case SPELL_SCHOOL_FROST:
+ case SPELL_SCHOOL_SHADOW:
+ case SPELL_SCHOOL_ARCANE:
+ return true;
+ default:
+ break;
+ }
+ }
+
+ return false;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ uint32 triggerspell = 0;
+
+ switch (GetFirstSchoolInMask(eventInfo.GetDamageInfo()->GetSchoolMask()))
+ {
+ case SPELL_SCHOOL_HOLY:
+ triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_HOLY;
+ break;
+ case SPELL_SCHOOL_FIRE:
+ triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_FIRE;
+ break;
+ case SPELL_SCHOOL_NATURE:
+ triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_NATURE;
+ break;
+ case SPELL_SCHOOL_FROST:
+ triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_FROST;
+ break;
+ case SPELL_SCHOOL_SHADOW:
+ triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_SHADOW;
+ break;
+ case SPELL_SCHOOL_ARCANE:
+ triggerspell = SPELL_WARLOCK_NETHER_PROTECTION_ARCANE;
+ break;
+ default:
+ return;
+ }
+
+ if (Unit* target = eventInfo.GetActionTarget())
+ target->CastSpell(target, triggerspell, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ DoCheckProc += AuraCheckProcFn(spell_warl_nether_protection_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_warl_nether_protection_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_warl_nether_protection_AuraScript();
+ }
+};
+
// 18541 - Ritual of Doom Effect
class spell_warl_ritual_of_doom_effect : public SpellScriptLoader
{
@@ -917,6 +1014,7 @@ void AddSC_warlock_spell_scripts()
new spell_warl_haunt();
new spell_warl_health_funnel();
new spell_warl_life_tap();
+ new spell_warl_nether_protection();
new spell_warl_ritual_of_doom_effect();
new spell_warl_seed_of_corruption();
new spell_warl_shadow_ward();
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index d224c234cb4..ea9ccc956e5 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -271,7 +271,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader
{
ApplyPct(damage, 16 * GetSpellInfo()->GetRank());
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC);
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC);
uint32 ticks = uint32(spellInfo->GetDuration()) / spellInfo->Effects[EFFECT_0].Amplitude;
// Add remaining ticks to damage done
diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp
index 1f89720803d..65dec74414b 100644
--- a/src/server/scripts/World/boss_emerald_dragons.cpp
+++ b/src/server/scripts/World/boss_emerald_dragons.cpp
@@ -205,7 +205,7 @@ class npc_dream_fog : public CreatureScript
}
// Seeping fog movement is slow enough for a player to be able to walk backwards and still outpace it
me->SetWalk(true);
- me->SetSpeed(MOVE_WALK, 0.75f);
+ me->SetSpeedRate(MOVE_WALK, 0.75f);
}
else
_roamTimer -= diff;
diff --git a/src/server/scripts/World/duel_reset.cpp b/src/server/scripts/World/duel_reset.cpp
index 3c46255a1bf..b04f3ec0aa7 100644
--- a/src/server/scripts/World/duel_reset.cpp
+++ b/src/server/scripts/World/duel_reset.cpp
@@ -98,16 +98,16 @@ class DuelResetScript : public PlayerScript
static void ResetSpellCooldowns(Player* player, bool onStartDuel)
{
- if (onStartDuel)
+ if (onStartDuel)
{
// remove cooldowns on spells that have < 10 min CD > 30 sec and has no onHold
player->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
{
SpellHistory::Clock::time_point now = SpellHistory::Clock::now();
uint32 cooldownDuration = itr->second.CooldownEnd > now ? std::chrono::duration_cast<std::chrono::milliseconds>(itr->second.CooldownEnd - now).count() : 0;
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
- return spellInfo->RecoveryTime < 10 * MINUTE * IN_MILLISECONDS
- && spellInfo->CategoryRecoveryTime < 10 * MINUTE * IN_MILLISECONDS
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
+ return spellInfo->RecoveryTime < 10 * MINUTE * IN_MILLISECONDS
+ && spellInfo->CategoryRecoveryTime < 10 * MINUTE * IN_MILLISECONDS
&& !itr->second.OnHold
&& cooldownDuration > 0
&& ( spellInfo->RecoveryTime - cooldownDuration ) > (MINUTE / 2) * IN_MILLISECONDS
@@ -119,11 +119,11 @@ class DuelResetScript : public PlayerScript
// remove cooldowns on spells that have < 10 min CD and has no onHold
player->GetSpellHistory()->ResetCooldowns([](SpellHistory::CooldownStorageType::iterator itr) -> bool
{
- SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first);
- return spellInfo->RecoveryTime < 10 * MINUTE * IN_MILLISECONDS
- && spellInfo->CategoryRecoveryTime < 10 * MINUTE * IN_MILLISECONDS
+ SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
+ return spellInfo->RecoveryTime < 10 * MINUTE * IN_MILLISECONDS
+ && spellInfo->CategoryRecoveryTime < 10 * MINUTE * IN_MILLISECONDS
&& !itr->second.OnHold;
- }, true);
+ }, true);
}
// pet cooldowns
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index b90839f50c5..3db4f41706d 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -1171,7 +1171,7 @@ public:
player->CastSpell(player, SPELL_CLEANSING_SOUL);
player->SetStandState(UNIT_STAND_STATE_SIT);
}
- return true;
+ return true;
}
};
@@ -1197,6 +1197,29 @@ public:
}
};
+enum MidsummerPoleRibbon
+{
+ SPELL_POLE_DANCE = 29726,
+ SPELL_BLUE_FIRE_RING = 46842,
+ NPC_POLE_RIBBON_BUNNY = 17066,
+ ACTION_COSMETIC_FIRES = 0
+};
+
+class go_midsummer_ribbon_pole : public GameObjectScript
+{
+public:
+ go_midsummer_ribbon_pole() : GameObjectScript("go_midsummer_ribbon_pole") { }
+
+ bool OnGossipHello(Player* player, GameObject* go) override
+ {
+ if (Creature* creature = go->FindNearestCreature(NPC_POLE_RIBBON_BUNNY, 10.0f))
+ {
+ creature->GetAI()->DoAction(ACTION_COSMETIC_FIRES);
+ player->CastSpell(creature, SPELL_POLE_DANCE, true);
+ }
+ return true;
+ }
+};
enum ToyTrainSpells
{
@@ -1211,7 +1234,7 @@ class go_toy_train_set : public GameObjectScript
struct go_toy_train_setAI : public GameObjectAI
{
go_toy_train_setAI(GameObject* go) : GameObjectAI(go), _pulseTimer(3 * IN_MILLISECONDS) { }
-
+
void UpdateAI(uint32 diff) override
{
if (diff < _pulseTimer)
@@ -1274,5 +1297,6 @@ void AddSC_go_scripts()
new go_veil_skith_cage();
new go_frostblade_shrine();
new go_midsummer_bonfire();
+ new go_midsummer_ribbon_pole();
new go_toy_train_set();
}
diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp
index f4241ba0819..ff15698e579 100644
--- a/src/server/scripts/World/item_scripts.cpp
+++ b/src/server/scripts/World/item_scripts.cpp
@@ -57,18 +57,18 @@ public:
//for special scripts
switch (itemId)
{
- case 24538:
+ case 24538:
if (player->GetAreaId() != 3628)
disabled = true;
- break;
- case 34489:
+ break;
+ case 34489:
if (player->GetZoneId() != 4080)
disabled = true;
- break;
- case 34475:
- if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_ARCANE_CHARGES))
+ break;
+ case 34475:
+ if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_ARCANE_CHARGES))
Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_ON_GROUND);
- break;
+ break;
}
// allow use in flight only
@@ -241,7 +241,7 @@ public:
float x, y, z;
go->GetClosePoint(x, y, z, go->GetObjectSize() / 3, 7.0f);
- go->SummonGameObject(GO_HIGH_QUALITY_FUR, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, 0, 0, 0, 0, 1);
+ go->SummonGameObject(GO_HIGH_QUALITY_FUR, *go, G3D::Quat(), 1);
if (TempSummon* summon = player->SummonCreature(NPC_NESINGWARY_TRAPPER, x, y, z, go->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1000))
{
summon->SetVisible(false);
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 56d48949fac..277bc9ac804 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -36,7 +36,6 @@ npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622
npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given
npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap
npc_shadowfiend 100% restore 5% of owner's mana when shadowfiend die from damage
-npc_locksmith 75% list of keys needs to be confirmed
npc_firework 100% NPC's summoned by rockets and rocket clusters, for making them cast visual
npc_train_wrecker 100% Wind-Up Train Wrecker that kills train set
EndContentData */
@@ -57,7 +56,6 @@ EndContentData */
#include "SpellHistory.h"
#include "SpellAuras.h"
#include "Pet.h"
-#include "PetAI.h"
#include "CreatureTextMgr.h"
#include "SmartAI.h"
@@ -582,6 +580,115 @@ public:
};
/*######
+## npc_midsummer_bunny_pole
+######*/
+
+enum RibbonPoleData
+{
+ GO_RIBBON_POLE = 181605,
+ SPELL_RIBBON_DANCE_COSMETIC = 29726,
+ SPELL_RED_FIRE_RING = 46836,
+ SPELL_BLUE_FIRE_RING = 46842,
+ EVENT_CAST_RED_FIRE_RING = 1,
+ EVENT_CAST_BLUE_FIRE_RING = 2
+};
+
+class npc_midsummer_bunny_pole : public CreatureScript
+{
+public:
+ npc_midsummer_bunny_pole() : CreatureScript("npc_midsummer_bunny_pole") { }
+
+ struct npc_midsummer_bunny_poleAI : public ScriptedAI
+ {
+ npc_midsummer_bunny_poleAI(Creature* creature) : ScriptedAI(creature)
+ {
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ events.Reset();
+ running = false;
+ }
+
+ void Reset() override
+ {
+ Initialize();
+ }
+
+ void DoAction(int32 /*action*/) override
+ {
+ // Don't start event if it's already running.
+ if (running)
+ return;
+
+ running = true;
+ events.ScheduleEvent(EVENT_CAST_RED_FIRE_RING, 1);
+ }
+
+ bool checkNearbyPlayers()
+ {
+ // Returns true if no nearby player has aura "Test Ribbon Pole Channel".
+ std::list<Player*> players;
+ Trinity::UnitAuraCheck check(true, SPELL_RIBBON_DANCE_COSMETIC);
+ Trinity::PlayerListSearcher<Trinity::UnitAuraCheck> searcher(me, players, check);
+ me->VisitNearbyWorldObject(10.0f, searcher);
+
+ return players.empty();
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!running)
+ return;
+
+ events.Update(diff);
+
+ switch (events.ExecuteEvent())
+ {
+ case EVENT_CAST_RED_FIRE_RING:
+ {
+ if (checkNearbyPlayers())
+ {
+ Reset();
+ return;
+ }
+
+ if (GameObject* go = me->FindNearestGameObject(GO_RIBBON_POLE, 10.0f))
+ me->CastSpell(go, SPELL_RED_FIRE_RING, true);
+
+ events.ScheduleEvent(EVENT_CAST_BLUE_FIRE_RING, Seconds(5));
+ }
+ break;
+ case EVENT_CAST_BLUE_FIRE_RING:
+ {
+ if (checkNearbyPlayers())
+ {
+ Reset();
+ return;
+ }
+
+ if (GameObject* go = me->FindNearestGameObject(GO_RIBBON_POLE, 10.0f))
+ me->CastSpell(go, SPELL_BLUE_FIRE_RING, true);
+
+ events.ScheduleEvent(EVENT_CAST_RED_FIRE_RING, Seconds(5));
+ }
+ break;
+ }
+ }
+
+ private:
+ EventMap events;
+ bool running;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new npc_midsummer_bunny_poleAI(creature);
+ }
+};
+
+/*######
## Triage quest
######*/
@@ -1189,36 +1296,49 @@ public:
enum Sayge
{
- SPELL_DMG = 23768, // dmg
- SPELL_RES = 23769, // res
- SPELL_ARM = 23767, // arm
- SPELL_SPI = 23738, // spi
- SPELL_INT = 23766, // int
- SPELL_STM = 23737, // stm
- SPELL_STR = 23735, // str
- SPELL_AGI = 23736, // agi
- SPELL_FORTUNE = 23765 // faire fortune
+ GOSSIP_MENU_OPTION_ID_ANSWER_1 = 0,
+ GOSSIP_MENU_OPTION_ID_ANSWER_2 = 1,
+ GOSSIP_MENU_OPTION_ID_ANSWER_3 = 2,
+ GOSSIP_MENU_OPTION_ID_ANSWER_4 = 3,
+ GOSSIP_I_AM_READY_TO_DISCOVER = 6186,
+ GOSSIP_MENU_OPTION_SAYGE1 = 6185,
+ GOSSIP_MENU_OPTION_SAYGE2 = 6185,
+ GOSSIP_MENU_OPTION_SAYGE3 = 6185,
+ GOSSIP_MENU_OPTION_SAYGE4 = 6185,
+ GOSSIP_MENU_OPTION_SAYGE5 = 6187,
+ GOSSIP_MENU_OPTION_SAYGE6 = 6187,
+ GOSSIP_MENU_OPTION_SAYGE7 = 6187,
+ GOSSIP_MENU_OPTION_SAYGE8 = 6208,
+ GOSSIP_MENU_OPTION_SAYGE9 = 6208,
+ GOSSIP_MENU_OPTION_SAYGE10 = 6208,
+ GOSSIP_MENU_OPTION_SAYGE11 = 6209,
+ GOSSIP_MENU_OPTION_SAYGE12 = 6209,
+ GOSSIP_MENU_OPTION_SAYGE13 = 6209,
+ GOSSIP_MENU_OPTION_SAYGE14 = 6210,
+ GOSSIP_MENU_OPTION_SAYGE15 = 6210,
+ GOSSIP_MENU_OPTION_SAYGE16 = 6210,
+ GOSSIP_MENU_OPTION_SAYGE17 = 6211,
+ GOSSIP_MENU_I_HAVE_LONG_KNOWN = 7339,
+ GOSSIP_MENU_YOU_HAVE_BEEN_TASKED = 7340,
+ GOSSIP_MENU_SWORN_EXECUTIONER = 7341,
+ GOSSIP_MENU_DIPLOMATIC_MISSION = 7361,
+ GOSSIP_MENU_YOUR_BROTHER_SEEKS = 7362,
+ GOSSIP_MENU_A_TERRIBLE_BEAST = 7363,
+ GOSSIP_MENU_YOUR_FORTUNE_IS_CAST = 7364,
+ GOSSIP_MENU_HERE_IS_YOUR_FORTUNE = 7365,
+ GOSSIP_MENU_CANT_GIVE_YOU_YOUR = 7393,
+
+ SPELL_STRENGTH = 23735, // +10% Strength
+ SPELL_AGILITY = 23736, // +10% Agility
+ SPELL_STAMINA = 23737, // +10% Stamina
+ SPELL_SPIRIT = 23738, // +10% Spirit
+ SPELL_INTELLECT = 23766, // +10% Intellect
+ SPELL_ARMOR = 23767, // +10% Armor
+ SPELL_DAMAGE = 23768, // +10% Damage
+ SPELL_RESISTANCE = 23769, // +25 Magic Resistance (All)
+ SPELL_FORTUNE = 23765 // Darkmoon Faire Fortune
};
-#define GOSSIP_HELLO_SAYGE "Yes"
-#define GOSSIP_SENDACTION_SAYGE1 "Slay the Man"
-#define GOSSIP_SENDACTION_SAYGE2 "Turn him over to liege"
-#define GOSSIP_SENDACTION_SAYGE3 "Confiscate the corn"
-#define GOSSIP_SENDACTION_SAYGE4 "Let him go and have the corn"
-#define GOSSIP_SENDACTION_SAYGE5 "Execute your friend painfully"
-#define GOSSIP_SENDACTION_SAYGE6 "Execute your friend painlessly"
-#define GOSSIP_SENDACTION_SAYGE7 "Let your friend go"
-#define GOSSIP_SENDACTION_SAYGE8 "Confront the diplomat"
-#define GOSSIP_SENDACTION_SAYGE9 "Show not so quiet defiance"
-#define GOSSIP_SENDACTION_SAYGE10 "Remain quiet"
-#define GOSSIP_SENDACTION_SAYGE11 "Speak against your brother openly"
-#define GOSSIP_SENDACTION_SAYGE12 "Help your brother in"
-#define GOSSIP_SENDACTION_SAYGE13 "Keep your brother out without letting him know"
-#define GOSSIP_SENDACTION_SAYGE14 "Take credit, keep gold"
-#define GOSSIP_SENDACTION_SAYGE15 "Take credit, share the gold"
-#define GOSSIP_SENDACTION_SAYGE16 "Let the knight take credit"
-#define GOSSIP_SENDACTION_SAYGE17 "Thanks"
-
class npc_sayge : public CreatureScript
{
public:
@@ -1229,19 +1349,19 @@ public:
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
- if (player->GetSpellHistory()->HasCooldown(SPELL_INT) ||
- player->GetSpellHistory()->HasCooldown(SPELL_ARM) ||
- player->GetSpellHistory()->HasCooldown(SPELL_DMG) ||
- player->GetSpellHistory()->HasCooldown(SPELL_RES) ||
- player->GetSpellHistory()->HasCooldown(SPELL_STR) ||
- player->GetSpellHistory()->HasCooldown(SPELL_AGI) ||
- player->GetSpellHistory()->HasCooldown(SPELL_STM) ||
- player->GetSpellHistory()->HasCooldown(SPELL_SPI))
- player->SEND_GOSSIP_MENU(7393, creature->GetGUID());
+ if (player->GetSpellHistory()->HasCooldown(SPELL_STRENGTH) ||
+ player->GetSpellHistory()->HasCooldown(SPELL_AGILITY) ||
+ player->GetSpellHistory()->HasCooldown(SPELL_STAMINA) ||
+ player->GetSpellHistory()->HasCooldown(SPELL_SPIRIT) ||
+ player->GetSpellHistory()->HasCooldown(SPELL_INTELLECT) ||
+ player->GetSpellHistory()->HasCooldown(SPELL_ARMOR) ||
+ player->GetSpellHistory()->HasCooldown(SPELL_DAMAGE) ||
+ player->GetSpellHistory()->HasCooldown(SPELL_RESISTANCE))
+ player->SEND_GOSSIP_MENU(GOSSIP_MENU_CANT_GIVE_YOU_YOUR, creature->GetGUID());
else
{
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_SAYGE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(7339, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_I_AM_READY_TO_DISCOVER, GOSSIP_MENU_OPTION_ID_ANSWER_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(GOSSIP_MENU_I_HAVE_LONG_KNOWN, creature->GetGUID());
}
return true;
@@ -1252,43 +1372,43 @@ public:
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(7340, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE1, GOSSIP_MENU_OPTION_ID_ANSWER_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE2, GOSSIP_MENU_OPTION_ID_ANSWER_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE3, GOSSIP_MENU_OPTION_ID_ANSWER_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE4, GOSSIP_MENU_OPTION_ID_ANSWER_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ player->SEND_GOSSIP_MENU(GOSSIP_MENU_YOU_HAVE_BEEN_TASKED, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE5, GOSSIP_SENDER_MAIN + 1, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE6, GOSSIP_SENDER_MAIN + 2, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE7, GOSSIP_SENDER_MAIN + 3, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7341, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE5, GOSSIP_MENU_OPTION_ID_ANSWER_1, GOSSIP_SENDER_MAIN + 1, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE6, GOSSIP_MENU_OPTION_ID_ANSWER_2, GOSSIP_SENDER_MAIN + 2, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE7, GOSSIP_MENU_OPTION_ID_ANSWER_3, GOSSIP_SENDER_MAIN + 3, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(GOSSIP_MENU_SWORN_EXECUTIONER, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE8, GOSSIP_SENDER_MAIN + 4, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE9, GOSSIP_SENDER_MAIN + 5, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE10, GOSSIP_SENDER_MAIN + 2, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7361, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE8, GOSSIP_MENU_OPTION_ID_ANSWER_1, GOSSIP_SENDER_MAIN + 4, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE9, GOSSIP_MENU_OPTION_ID_ANSWER_2, GOSSIP_SENDER_MAIN + 5, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE10,GOSSIP_MENU_OPTION_ID_ANSWER_3, GOSSIP_SENDER_MAIN + 2, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(GOSSIP_MENU_DIPLOMATIC_MISSION, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE11, GOSSIP_SENDER_MAIN + 6, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE12, GOSSIP_SENDER_MAIN + 7, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE13, GOSSIP_SENDER_MAIN + 8, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7362, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE11, GOSSIP_MENU_OPTION_ID_ANSWER_1, GOSSIP_SENDER_MAIN + 6, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE12, GOSSIP_MENU_OPTION_ID_ANSWER_2, GOSSIP_SENDER_MAIN + 7, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE13, GOSSIP_MENU_OPTION_ID_ANSWER_3, GOSSIP_SENDER_MAIN + 8, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(GOSSIP_MENU_YOUR_BROTHER_SEEKS, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE14, GOSSIP_SENDER_MAIN + 5, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE15, GOSSIP_SENDER_MAIN + 4, GOSSIP_ACTION_INFO_DEF);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE16, GOSSIP_SENDER_MAIN + 3, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(7363, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE14, GOSSIP_MENU_OPTION_ID_ANSWER_1, GOSSIP_SENDER_MAIN + 5, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE15, GOSSIP_MENU_OPTION_ID_ANSWER_2, GOSSIP_SENDER_MAIN + 4, GOSSIP_ACTION_INFO_DEF);
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE16, GOSSIP_MENU_OPTION_ID_ANSWER_3, GOSSIP_SENDER_MAIN + 3, GOSSIP_ACTION_INFO_DEF);
+ player->SEND_GOSSIP_MENU(GOSSIP_MENU_A_TERRIBLE_BEAST, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SENDACTION_SAYGE17, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(7364, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_OPTION_SAYGE17, GOSSIP_MENU_OPTION_ID_ANSWER_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ player->SEND_GOSSIP_MENU(GOSSIP_MENU_YOUR_FORTUNE_IS_CAST, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6:
creature->CastSpell(player, SPELL_FORTUNE, false);
- player->SEND_GOSSIP_MENU(7365, creature->GetGUID());
+ player->SEND_GOSSIP_MENU(GOSSIP_MENU_HERE_IS_YOUR_FORTUNE, creature->GetGUID());
break;
}
}
@@ -1303,28 +1423,28 @@ public:
SendAction(player, creature, action);
break;
case GOSSIP_SENDER_MAIN + 1:
- spellId = SPELL_DMG;
+ spellId = SPELL_DAMAGE;
break;
case GOSSIP_SENDER_MAIN + 2:
- spellId = SPELL_RES;
+ spellId = SPELL_RESISTANCE;
break;
case GOSSIP_SENDER_MAIN + 3:
- spellId = SPELL_ARM;
+ spellId = SPELL_ARMOR;
break;
case GOSSIP_SENDER_MAIN + 4:
- spellId = SPELL_SPI;
+ spellId = SPELL_SPIRIT;
break;
case GOSSIP_SENDER_MAIN + 5:
- spellId = SPELL_INT;
+ spellId = SPELL_INTELLECT;
break;
case GOSSIP_SENDER_MAIN + 6:
- spellId = SPELL_STM;
+ spellId = SPELL_STAMINA;
break;
case GOSSIP_SENDER_MAIN + 7:
- spellId = SPELL_STR;
+ spellId = SPELL_STRENGTH;
break;
case GOSSIP_SENDER_MAIN + 8:
- spellId = SPELL_AGI;
+ spellId = SPELL_AGILITY;
break;
}
@@ -1744,149 +1864,6 @@ public:
};
/*######
-## npc_locksmith
-######*/
-
-enum LockSmith
-{
- QUEST_HOW_TO_BRAKE_IN_TO_THE_ARCATRAZ = 10704,
- QUEST_DARK_IRON_LEGACY = 3802,
- QUEST_THE_KEY_TO_SCHOLOMANCE_A = 5505,
- QUEST_THE_KEY_TO_SCHOLOMANCE_H = 5511,
- QUEST_HOTTER_THAN_HELL_A = 10758,
- QUEST_HOTTER_THAN_HELL_H = 10764,
- QUEST_RETURN_TO_KHAGDAR = 9837,
- QUEST_CONTAINMENT = 13159,
- QUEST_ETERNAL_VIGILANCE = 11011,
- QUEST_KEY_TO_THE_FOCUSING_IRIS = 13372,
- QUEST_HC_KEY_TO_THE_FOCUSING_IRIS = 13375,
-
- ITEM_ARCATRAZ_KEY = 31084,
- ITEM_SHADOWFORGE_KEY = 11000,
- ITEM_SKELETON_KEY = 13704,
- ITEM_SHATTERED_HALLS_KEY = 28395,
- ITEM_THE_MASTERS_KEY = 24490,
- ITEM_VIOLET_HOLD_KEY = 42482,
- ITEM_ESSENCE_INFUSED_MOONSTONE = 32449,
- ITEM_KEY_TO_THE_FOCUSING_IRIS = 44582,
- ITEM_HC_KEY_TO_THE_FOCUSING_IRIS = 44581,
-
- SPELL_ARCATRAZ_KEY = 54881,
- SPELL_SHADOWFORGE_KEY = 54882,
- SPELL_SKELETON_KEY = 54883,
- SPELL_SHATTERED_HALLS_KEY = 54884,
- SPELL_THE_MASTERS_KEY = 54885,
- SPELL_VIOLET_HOLD_KEY = 67253,
- SPELL_ESSENCE_INFUSED_MOONSTONE = 40173,
-};
-
-#define GOSSIP_LOST_ARCATRAZ_KEY "I've lost my key to the Arcatraz."
-#define GOSSIP_LOST_SHADOWFORGE_KEY "I've lost my key to the Blackrock Depths."
-#define GOSSIP_LOST_SKELETON_KEY "I've lost my key to the Scholomance."
-#define GOSSIP_LOST_SHATTERED_HALLS_KEY "I've lost my key to the Shattered Halls."
-#define GOSSIP_LOST_THE_MASTERS_KEY "I've lost my key to the Karazhan."
-#define GOSSIP_LOST_VIOLET_HOLD_KEY "I've lost my key to the Violet Hold."
-#define GOSSIP_LOST_ESSENCE_INFUSED_MOONSTONE "I've lost my Essence-Infused Moonstone."
-#define GOSSIP_LOST_KEY_TO_THE_FOCUSING_IRIS "I've lost my Key to the Focusing Iris."
-#define GOSSIP_LOST_HC_KEY_TO_THE_FOCUSING_IRIS "I've lost my Heroic Key to the Focusing Iris."
-
-class npc_locksmith : public CreatureScript
-{
-public:
- npc_locksmith() : CreatureScript("npc_locksmith") { }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- // Arcatraz Key
- if (player->GetQuestRewardStatus(QUEST_HOW_TO_BRAKE_IN_TO_THE_ARCATRAZ) && !player->HasItemCount(ITEM_ARCATRAZ_KEY, 1, true))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_ARCATRAZ_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- // Shadowforge Key
- if (player->GetQuestRewardStatus(QUEST_DARK_IRON_LEGACY) && !player->HasItemCount(ITEM_SHADOWFORGE_KEY, 1, true))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_SHADOWFORGE_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- // Skeleton Key
- if ((player->GetQuestRewardStatus(QUEST_THE_KEY_TO_SCHOLOMANCE_A) || player->GetQuestRewardStatus(QUEST_THE_KEY_TO_SCHOLOMANCE_H)) &&
- !player->HasItemCount(ITEM_SKELETON_KEY, 1, true))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_SKELETON_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- // Shatered Halls Key
- if ((player->GetQuestRewardStatus(QUEST_HOTTER_THAN_HELL_A) || player->GetQuestRewardStatus(QUEST_HOTTER_THAN_HELL_H)) &&
- !player->HasItemCount(ITEM_SHATTERED_HALLS_KEY, 1, true))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_SHATTERED_HALLS_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
-
- // Master's Key
- if (player->GetQuestRewardStatus(QUEST_RETURN_TO_KHAGDAR) && !player->HasItemCount(ITEM_THE_MASTERS_KEY, 1, true))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_THE_MASTERS_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
-
- // Violet Hold Key
- if (player->GetQuestRewardStatus(QUEST_CONTAINMENT) && !player->HasItemCount(ITEM_VIOLET_HOLD_KEY, 1, true))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_VIOLET_HOLD_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
-
- // Essence-Infused Moonstone
- if (player->GetQuestRewardStatus(QUEST_ETERNAL_VIGILANCE) && !player->HasItemCount(ITEM_ESSENCE_INFUSED_MOONSTONE, 1, true))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_ESSENCE_INFUSED_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
-
- // Key to the Focusing Iris
- if (player->GetQuestRewardStatus(QUEST_KEY_TO_THE_FOCUSING_IRIS) && !player->HasItemCount(ITEM_KEY_TO_THE_FOCUSING_IRIS, 1, true))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_KEY_TO_THE_FOCUSING_IRIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
-
- // Heroic Key to the Focusing Iris
- if (player->GetQuestRewardStatus(QUEST_HC_KEY_TO_THE_FOCUSING_IRIS) && !player->HasItemCount(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS, 1, true))
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_HC_KEY_TO_THE_FOCUSING_IRIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) override
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_ARCATRAZ_KEY, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_SHADOWFORGE_KEY, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_SKELETON_KEY, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_SHATTERED_HALLS_KEY, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_THE_MASTERS_KEY, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 6:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_VIOLET_HOLD_KEY, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 7:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_ESSENCE_INFUSED_MOONSTONE, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 8:
- player->CLOSE_GOSSIP_MENU();
- player->AddItem(ITEM_KEY_TO_THE_FOCUSING_IRIS, 1);
- break;
- case GOSSIP_ACTION_INFO_DEF + 9:
- player->CLOSE_GOSSIP_MENU();
- player->AddItem(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS, 1);
- break;
- }
- return true;
- }
-};
-
-/*######
## npc_experience
######*/
@@ -2192,7 +2169,7 @@ public:
// Check if we are near Elune'ara lake south, if so try to summon Omen or a minion
if (me->GetZoneId() == ZONE_MOONGLADE)
{
- if (!me->FindNearestCreature(NPC_OMEN, 100.0f, false) && me->GetDistance2d(omenSummonPos.GetPositionX(), omenSummonPos.GetPositionY()) <= 100.0f)
+ if (!me->FindNearestCreature(NPC_OMEN, 100.0f) && me->GetDistance2d(omenSummonPos.GetPositionX(), omenSummonPos.GetPositionY()) <= 100.0f)
{
switch (urand(0, 9))
{
@@ -2214,7 +2191,7 @@ public:
float displacement = 0.7f;
for (uint8 i = 0; i < 4; i++)
- me->SummonGameObject(GetFireworkGameObjectId(), me->GetPositionX() + (i%2 == 0 ? displacement : -displacement), me->GetPositionY() + (i > 1 ? displacement : -displacement), me->GetPositionZ() + 4.0f, me->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 1);
+ me->SummonGameObject(GetFireworkGameObjectId(), me->GetPositionX() + (i % 2 == 0 ? displacement : -displacement), me->GetPositionY() + (i > 1 ? displacement : -displacement), me->GetPositionZ() + 4.0f, me->GetOrientation(), G3D::Quat(), 1);
}
else
//me->CastSpell(me, GetFireworkSpell(me->GetEntry()), true);
@@ -2572,159 +2549,6 @@ class npc_train_wrecker : public CreatureScript
}
};
-enum EgbertMisc
-{
- EVENT_MOVE_POS = 1,
- EVENT_RETURN = 2
-};
-
-class npc_egbert : public CreatureScript
-{
-public:
- npc_egbert() : CreatureScript("npc_egbert") {}
-
- struct npc_egbertAI : public PetAI
- {
- npc_egbertAI(Creature* creature) : PetAI(creature)
- {
- if (Unit* owner = me->GetCharmerOrOwner())
- if (owner->GetMap()->GetEntry()->addon > 1)
- me->SetCanFly(true);
- }
-
- void Reset() override
- {
- _events.Reset();
- _events.ScheduleEvent(EVENT_MOVE_POS, urandms(1, 20));
- }
-
- void UpdateAI(uint32 diff) override
- {
- _events.Update(diff);
-
- while (uint32 eventId = _events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_MOVE_POS:
- if (Unit* owner = me->GetCharmerOrOwner())
- {
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MovePoint(0, owner->GetPositionX() + frand(-30.0f, 30.0f), owner->GetPositionY() + frand(-30.0f, 30.0f), owner->GetPositionZ());
- }
- _events.ScheduleEvent(EVENT_RETURN, urandms(3, 4));
- break;
- case EVENT_RETURN:
- if (Unit* owner = me->GetCharmerOrOwner())
- me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
- _events.ScheduleEvent(EVENT_MOVE_POS, urandms(1, 20));
- break;
- default:
- break;
- }
- }
- }
- private:
- EventMap _events;
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_egbertAI(creature);
- }
-};
-
-enum PandarenMonkMisc
-{
- SPELL_PANDAREN_MONK = 69800,
- EVENT_FOCUS = 1,
- EVENT_EMOTE = 2,
- EVENT_FOLLOW = 3,
- EVENT_DRINK = 4
-};
-
-class npc_pandaren_monk : public CreatureScript
-{
-public:
- npc_pandaren_monk() : CreatureScript("npc_pandaren_monk") {}
-
- struct npc_pandaren_monkAI : public NullCreatureAI
- {
- npc_pandaren_monkAI(Creature* creature) : NullCreatureAI(creature) { }
-
- void Reset() override
- {
- _events.Reset();
- _events.ScheduleEvent(EVENT_FOCUS, 1000);
- }
-
- void EnterEvadeMode(EvadeReason why) override
- {
- if (!_EnterEvadeMode(why))
- return;
-
- Reset();
- }
-
- void ReceiveEmote(Player* /*player*/, uint32 emote) override
- {
- me->InterruptSpell(CURRENT_CHANNELED_SPELL);
- me->StopMoving();
-
- switch (emote)
- {
- case TEXT_EMOTE_BOW:
- _events.ScheduleEvent(EVENT_FOCUS, 1000);
- break;
- case TEXT_EMOTE_DRINK:
- _events.ScheduleEvent(EVENT_DRINK, 1000);
- break;
- }
- }
-
- void UpdateAI(uint32 diff) override
- {
- _events.Update(diff);
-
- if (Unit* owner = me->GetCharmerOrOwner())
- if (!me->IsWithinDist(owner, 30.f))
- me->InterruptSpell(CURRENT_CHANNELED_SPELL);
-
- while (uint32 eventId = _events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_FOCUS:
- if (Unit* owner = me->GetCharmerOrOwner())
- me->SetFacingToObject(owner);
- _events.ScheduleEvent(EVENT_EMOTE, 1000);
- break;
- case EVENT_EMOTE:
- me->HandleEmoteCommand(EMOTE_ONESHOT_BOW);
- _events.ScheduleEvent(EVENT_FOLLOW, 1000);
- break;
- case EVENT_FOLLOW:
- if (Unit* owner = me->GetCharmerOrOwner())
- me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
- break;
- case EVENT_DRINK:
- me->CastSpell(me, SPELL_PANDAREN_MONK, false);
- break;
- default:
- break;
- }
- }
- }
- private:
- EventMap _events;
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_pandaren_monkAI(creature);
- }
-};
-
void AddSC_npcs_special()
{
new npc_air_force_bots();
@@ -2732,6 +2556,7 @@ void AddSC_npcs_special()
new npc_chicken_cluck();
new npc_dancing_flames();
new npc_torch_tossing_target_bunny_controller();
+ new npc_midsummer_bunny_pole();
new npc_doctor();
new npc_injured_patient();
new npc_garments_of_quests();
@@ -2743,13 +2568,10 @@ void AddSC_npcs_special()
new npc_training_dummy();
new npc_wormhole();
new npc_pet_trainer();
- new npc_locksmith();
new npc_experience();
new npc_firework();
new npc_spring_rabbit();
new npc_imp_in_a_ball();
new npc_stable_master();
new npc_train_wrecker();
- new npc_egbert();
- new npc_pandaren_monk();
}
diff --git a/src/server/scripts/World/world_script_loader.cpp b/src/server/scripts/World/world_script_loader.cpp
new file mode 100644
index 00000000000..0167024799f
--- /dev/null
+++ b/src/server/scripts/World/world_script_loader.cpp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "World.h"
+
+// This is where scripts' loading functions should be declared:
+// world
+void AddSC_areatrigger_scripts();
+void AddSC_emerald_dragons();
+void AddSC_generic_creature();
+void AddSC_go_scripts();
+void AddSC_guards();
+void AddSC_item_scripts();
+void AddSC_npc_professions();
+void AddSC_npc_innkeeper();
+void AddSC_npcs_special();
+void AddSC_achievement_scripts();
+void AddSC_action_ip_logger();
+void AddSC_duel_reset();
+// player
+void AddSC_chat_log();
+void AddSC_action_ip_logger();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddWorldScripts()
+{
+ AddSC_areatrigger_scripts();
+ AddSC_emerald_dragons();
+ AddSC_generic_creature();
+ AddSC_go_scripts();
+ AddSC_guards();
+ AddSC_item_scripts();
+ AddSC_npc_professions();
+ AddSC_npc_innkeeper();
+ AddSC_npcs_special();
+ AddSC_achievement_scripts();
+ AddSC_chat_log(); // location: scripts\World\chat_log.cpp
+
+ // FIXME: This should be moved in a script validation hook.
+ // To avoid duplicate code, we check once /*ONLY*/ if logging is permitted or not.
+ if (sWorld->getBoolConfig(CONFIG_IP_BASED_ACTION_LOGGING))
+ AddSC_action_ip_logger(); // location: scripts\World\action_ip_logger.cpp
+ AddSC_duel_reset();
+}
diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt
index b6e5c8b1c6f..e99a81a084b 100644
--- a/src/server/shared/CMakeLists.txt
+++ b/src/server/shared/CMakeLists.txt
@@ -8,62 +8,60 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-if( USE_COREPCH )
- include_directories(${CMAKE_CURRENT_BINARY_DIR})
-endif()
-
-file(GLOB_RECURSE sources_DataStores DataStores/*.cpp DataStores/*.h)
-file(GLOB_RECURSE sources_Dynamic Dynamic/*.cpp Dynamic/*.h)
-file(GLOB_RECURSE sources_Networking Networking/*.cpp Networking/*.h)
-file(GLOB_RECURSE sources_Packets Packets/*.cpp Packets/*.h)
-if( WIN32 )
- file(GLOB_RECURSE sources_Service Service/*.cpp Service/*.h)
-endif( WIN32 )
-file(GLOB sources_localdir *.cpp *.h)
-
-#
-# Build shared sourcelist
-#
+CollectSourceFiles(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE_SOURCES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if (USE_COREPCH)
- set(shared_STAT_PCH_HDR PrecompiledHeaders/sharedPCH.h)
- set(shared_STAT_PCH_SRC PrecompiledHeaders/sharedPCH.cpp)
+ set(PRIVATE_PCH_HEADER PrecompiledHeaders/sharedPCH.h)
+ set(PRIVATE_PCH_SOURCE PrecompiledHeaders/sharedPCH.cpp)
endif()
-set(shared_STAT_SRCS
- ${shared_STAT_SRCS}
- ${sources_DataStores}
- ${sources_Dynamic}
- ${sources_Networking}
- ${sources_Packets}
- ${sources_Utilities}
- ${sources_Service}
- ${sources_localdir}
-)
+GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}/Dynamic
- ${CMAKE_CURRENT_SOURCE_DIR}/Networking
- ${CMAKE_SOURCE_DIR}/dep/cppformat
- ${CMAKE_SOURCE_DIR}/src/common/
- ${CMAKE_SOURCE_DIR}/src/common/Debugging
- ${CMAKE_SOURCE_DIR}/src/common/Logging
- ${CMAKE_SOURCE_DIR}/src/common/Utilities
- ${MYSQL_INCLUDE_DIR}
- ${OPENSSL_INCLUDE_DIR}
- ${VALGRIND_INCLUDE_DIR}
+add_definitions(-DTRINITY_API_EXPORT_SHARED)
+
+add_library(shared
+ ${PRIVATE_PCH_SOURCE}
+ ${PRIVATE_SOURCES}
)
-GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
+CollectIncludeDirectories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC_INCLUDES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
-add_library(shared STATIC
- ${shared_STAT_SRCS}
- ${shared_STAT_PCH_SRC}
-)
+target_include_directories(shared
+ PUBLIC
+ ${PUBLIC_INCLUDES}
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR})
-add_dependencies(shared revision_data.h)
+target_link_libraries(shared
+ PUBLIC
+ database)
+
+set_target_properties(shared
+ PROPERTIES
+ FOLDER
+ "server")
+
+if( BUILD_SHARED_LIBS )
+ if( UNIX )
+ install(TARGETS shared
+ LIBRARY
+ DESTINATION lib)
+ elseif( WIN32 )
+ install(TARGETS shared
+ RUNTIME
+ DESTINATION "${CMAKE_INSTALL_PREFIX}")
+ endif()
+endif()
# Generate precompiled header
if (USE_COREPCH)
- add_cxx_pch(shared ${shared_STAT_PCH_HDR} ${shared_STAT_PCH_SRC})
+ add_cxx_pch(shared ${PRIVATE_PCH_HEADER} ${PRIVATE_PCH_SOURCE})
endif ()
diff --git a/src/server/shared/DataStores/DBCFileLoader.h b/src/server/shared/DataStores/DBCFileLoader.h
index 00b1ee54a4a..abe18d1425e 100644
--- a/src/server/shared/DataStores/DBCFileLoader.h
+++ b/src/server/shared/DataStores/DBCFileLoader.h
@@ -37,7 +37,7 @@ enum DbcFieldFormat
FT_SQL_ABSENT='a' //Used in sql format to mark column absent in sql dbc
};
-class DBCFileLoader
+class TC_SHARED_API DBCFileLoader
{
public:
DBCFileLoader();
diff --git a/src/server/shared/Networking/AsyncAcceptor.h b/src/server/shared/Networking/AsyncAcceptor.h
index 260e1c8ea11..f68da230553 100644
--- a/src/server/shared/Networking/AsyncAcceptor.h
+++ b/src/server/shared/Networking/AsyncAcceptor.h
@@ -20,34 +20,40 @@
#include "Log.h"
#include <boost/asio.hpp>
+#include <functional>
+#include <atomic>
using boost::asio::ip::tcp;
class AsyncAcceptor
{
public:
- typedef void(*ManagerAcceptHandler)(tcp::socket&& newSocket);
+ typedef void(*AcceptCallback)(tcp::socket&& newSocket, uint32 threadIndex);
AsyncAcceptor(boost::asio::io_service& ioService, std::string const& bindIp, uint16 port) :
_acceptor(ioService, tcp::endpoint(boost::asio::ip::address::from_string(bindIp), port)),
- _socket(ioService)
+ _socket(ioService), _closed(false), _socketFactory(std::bind(&AsyncAcceptor::DefeaultSocketFactory, this))
{
}
- template <class T>
+ template<class T>
void AsyncAccept();
- void AsyncAcceptManaged(ManagerAcceptHandler mgrHandler)
+ template<AcceptCallback acceptCallback>
+ void AsyncAcceptWithCallback()
{
- _acceptor.async_accept(_socket, [this, mgrHandler](boost::system::error_code error)
+ tcp::socket* socket;
+ uint32 threadIndex;
+ std::tie(socket, threadIndex) = _socketFactory();
+ _acceptor.async_accept(*socket, [this, socket, threadIndex](boost::system::error_code error)
{
if (!error)
{
try
{
- _socket.non_blocking(true);
+ socket->non_blocking(true);
- mgrHandler(std::move(_socket));
+ acceptCallback(std::move(*socket), threadIndex);
}
catch (boost::system::system_error const& err)
{
@@ -55,13 +61,29 @@ public:
}
}
- AsyncAcceptManaged(mgrHandler);
+ if (!_closed)
+ this->AsyncAcceptWithCallback<acceptCallback>();
});
}
+ void Close()
+ {
+ if (_closed.exchange(true))
+ return;
+
+ boost::system::error_code err;
+ _acceptor.close(err);
+ }
+
+ void SetSocketFactory(std::function<std::pair<tcp::socket*, uint32>()> func) { _socketFactory = func; }
+
private:
+ std::pair<tcp::socket*, uint32> DefeaultSocketFactory() { return std::make_pair(&_socket, 0); }
+
tcp::acceptor _acceptor;
tcp::socket _socket;
+ std::atomic<bool> _closed;
+ std::function<std::pair<tcp::socket*, uint32>()> _socketFactory;
};
template<class T>
@@ -83,7 +105,8 @@ void AsyncAcceptor::AsyncAccept()
}
// lets slap some more this-> on this so we can fix this bug with gcc 4.7.2 throwing internals in yo face
- this->AsyncAccept<T>();
+ if (!_closed)
+ this->AsyncAccept<T>();
});
}
diff --git a/src/server/shared/Networking/NetworkThread.h b/src/server/shared/Networking/NetworkThread.h
index ac216838bce..be0e9f10176 100644
--- a/src/server/shared/Networking/NetworkThread.h
+++ b/src/server/shared/Networking/NetworkThread.h
@@ -22,6 +22,8 @@
#include "Errors.h"
#include "Log.h"
#include "Timer.h"
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/deadline_timer.hpp>
#include <atomic>
#include <chrono>
#include <memory>
@@ -29,11 +31,14 @@
#include <set>
#include <thread>
+using boost::asio::ip::tcp;
+
template<class SocketType>
class NetworkThread
{
public:
- NetworkThread() : _connections(0), _stopped(false), _thread(nullptr)
+ NetworkThread() : _connections(0), _stopped(false), _thread(nullptr),
+ _acceptSocket(_io_service), _updateTimer(_io_service)
{
}
@@ -50,6 +55,7 @@ public:
void Stop()
{
_stopped = true;
+ _io_service.stop();
}
bool Start()
@@ -80,10 +86,12 @@ public:
std::lock_guard<std::mutex> lock(_newSocketsLock);
++_connections;
- _newSockets.insert(sock);
+ _newSockets.push_back(sock);
SocketAdded(sock);
}
+ tcp::socket* GetSocketForAccept() { return &_acceptSocket; }
+
protected:
virtual void SocketAdded(std::shared_ptr<SocketType> /*sock*/) { }
virtual void SocketRemoved(std::shared_ptr<SocketType> /*sock*/) { }
@@ -95,16 +103,15 @@ protected:
if (_newSockets.empty())
return;
- for (typename SocketSet::const_iterator i = _newSockets.begin(); i != _newSockets.end(); ++i)
+ for (std::shared_ptr<SocketType> sock : _newSockets)
{
- if (!(*i)->IsOpen())
+ if (!sock->IsOpen())
{
- SocketRemoved(*i);
-
+ SocketRemoved(sock);
--_connections;
}
else
- _Sockets.insert(*i);
+ _sockets.push_back(sock);
}
_newSockets.clear();
@@ -114,53 +121,58 @@ protected:
{
TC_LOG_DEBUG("misc", "Network Thread Starting");
- typename SocketSet::iterator i, t;
+ _updateTimer.expires_from_now(boost::posix_time::milliseconds(10));
+ _updateTimer.async_wait(std::bind(&NetworkThread<SocketType>::Update, this));
+ _io_service.run();
- uint32 sleepTime = 10;
- uint32 tickStart = 0, diff = 0;
- while (!_stopped)
- {
- std::this_thread::sleep_for(std::chrono::milliseconds(sleepTime));
+ TC_LOG_DEBUG("misc", "Network Thread exits");
+ _newSockets.clear();
+ _sockets.clear();
+ }
+
+ void Update()
+ {
+ if (_stopped)
+ return;
- tickStart = getMSTime();
+ _updateTimer.expires_from_now(boost::posix_time::milliseconds(10));
+ _updateTimer.async_wait(std::bind(&NetworkThread<SocketType>::Update, this));
- AddNewSockets();
+ AddNewSockets();
- for (i = _Sockets.begin(); i != _Sockets.end();)
+ _sockets.erase(std::remove_if(_sockets.begin(), _sockets.end(), [this](std::shared_ptr<SocketType> sock)
+ {
+ if (!sock->Update())
{
- if (!(*i)->Update())
- {
- if ((*i)->IsOpen())
- (*i)->CloseSocket();
-
- SocketRemoved(*i);
-
- --_connections;
- _Sockets.erase(i++);
- }
- else
- ++i;
- }
+ if (sock->IsOpen())
+ sock->CloseSocket();
- diff = GetMSTimeDiffToNow(tickStart);
- sleepTime = diff > 10 ? 0 : 10 - diff;
- }
+ this->SocketRemoved(sock);
- TC_LOG_DEBUG("misc", "Network Thread exits");
+ --this->_connections;
+ return true;
+ }
+
+ return false;
+ }), _sockets.end());
}
private:
- typedef std::set<std::shared_ptr<SocketType> > SocketSet;
+ typedef std::vector<std::shared_ptr<SocketType>> SocketContainer;
std::atomic<int32> _connections;
std::atomic<bool> _stopped;
std::thread* _thread;
- SocketSet _Sockets;
+ SocketContainer _sockets;
std::mutex _newSocketsLock;
- SocketSet _newSockets;
+ SocketContainer _newSockets;
+
+ boost::asio::io_service _io_service;
+ tcp::socket _acceptSocket;
+ boost::asio::deadline_timer _updateTimer;
};
#endif // NetworkThread_h__
diff --git a/src/server/shared/Networking/Socket.h b/src/server/shared/Networking/Socket.h
index a2f57b5029e..0674ede57d8 100644
--- a/src/server/shared/Networking/Socket.h
+++ b/src/server/shared/Networking/Socket.h
@@ -21,15 +21,11 @@
#include "MessageBuffer.h"
#include "Log.h"
#include <atomic>
-#include <vector>
-#include <mutex>
#include <queue>
#include <memory>
#include <functional>
#include <type_traits>
#include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/write.hpp>
-#include <boost/asio/read.hpp>
using boost::asio::ip::tcp;
@@ -59,18 +55,14 @@ public:
virtual bool Update()
{
- if (!IsOpen())
+ if (_closed)
return false;
#ifndef TC_SOCKET_USE_IOCP
- std::unique_lock<std::mutex> guard(_writeLock);
- if (!guard)
- return true;
-
- if (_isWritingAsync || (!_writeBuffer.GetActiveSize() && _writeQueue.empty()))
+ if (_isWritingAsync || (_writeQueue.empty() && !_closing))
return true;
- for (; WriteHandler(guard);)
+ for (; HandleQueue();)
;
#endif
@@ -98,14 +90,23 @@ public:
std::bind(&Socket<T>::ReadHandlerInternal, this->shared_from_this(), std::placeholders::_1, std::placeholders::_2));
}
- void QueuePacket(MessageBuffer&& buffer, std::unique_lock<std::mutex>& guard)
+ void AsyncReadWithCallback(void (T::*callback)(boost::system::error_code, std::size_t))
+ {
+ if (!IsOpen())
+ return;
+
+ _readBuffer.Normalize();
+ _readBuffer.EnsureFreeSpace();
+ _socket.async_read_some(boost::asio::buffer(_readBuffer.GetWritePointer(), _readBuffer.GetRemainingSpace()),
+ std::bind(callback, this->shared_from_this(), std::placeholders::_1, std::placeholders::_2));
+ }
+
+ void QueuePacket(MessageBuffer&& buffer)
{
_writeQueue.push(std::move(buffer));
#ifdef TC_SOCKET_USE_IOCP
- AsyncProcessQueue(guard);
-#else
- (void)guard;
+ AsyncProcessQueue();
#endif
}
@@ -135,7 +136,7 @@ protected:
virtual void ReadHandler() = 0;
- bool AsyncProcessQueue(std::unique_lock<std::mutex>&)
+ bool AsyncProcessQueue()
{
if (_isWritingAsync)
return false;
@@ -154,13 +155,14 @@ protected:
return false;
}
- std::mutex _writeLock;
- std::queue<MessageBuffer> _writeQueue;
-#ifndef TC_SOCKET_USE_IOCP
- MessageBuffer _writeBuffer;
-#endif
-
- boost::asio::io_service& io_service() { return _socket.get_io_service(); }
+ void SetNoDelay(bool enable)
+ {
+ boost::system::error_code err;
+ _socket.set_option(tcp::no_delay(enable), err);
+ if (err)
+ TC_LOG_DEBUG("network", "Socket::SetNoDelay: failed to set_option(boost::asio::ip::tcp::no_delay) for %s - %d (%s)",
+ GetRemoteIpAddress().to_string().c_str(), err.value(), err.message().c_str());
+ }
private:
void ReadHandlerInternal(boost::system::error_code error, size_t transferredBytes)
@@ -181,15 +183,13 @@ private:
{
if (!error)
{
- std::unique_lock<std::mutex> deleteGuard(_writeLock);
-
_isWritingAsync = false;
_writeQueue.front().ReadCompleted(transferedBytes);
if (!_writeQueue.front().GetActiveSize())
_writeQueue.pop();
if (!_writeQueue.empty())
- AsyncProcessQueue(deleteGuard);
+ AsyncProcessQueue();
else if (_closing)
CloseSocket();
}
@@ -201,47 +201,11 @@ private:
void WriteHandlerWrapper(boost::system::error_code /*error*/, std::size_t /*transferedBytes*/)
{
- std::unique_lock<std::mutex> guard(_writeLock);
_isWritingAsync = false;
- WriteHandler(guard);
+ HandleQueue();
}
- bool WriteHandler(std::unique_lock<std::mutex>& guard)
- {
- if (!IsOpen())
- return false;
-
- std::size_t bytesToSend = _writeBuffer.GetActiveSize();
-
- if (bytesToSend == 0)
- return HandleQueue(guard);
-
- boost::system::error_code error;
- std::size_t bytesWritten = _socket.write_some(boost::asio::buffer(_writeBuffer.GetReadPointer(), bytesToSend), error);
-
- if (error)
- {
- if (error == boost::asio::error::would_block || error == boost::asio::error::try_again)
- return AsyncProcessQueue(guard);
-
- return false;
- }
- else if (bytesWritten == 0)
- return false;
- else if (bytesWritten < bytesToSend)
- {
- _writeBuffer.ReadCompleted(bytesWritten);
- _writeBuffer.Normalize();
- return AsyncProcessQueue(guard);
- }
-
- // now bytesWritten == bytesToSend
- _writeBuffer.Reset();
-
- return HandleQueue(guard);
- }
-
- bool HandleQueue(std::unique_lock<std::mutex>& guard)
+ bool HandleQueue()
{
if (_writeQueue.empty())
return false;
@@ -256,23 +220,29 @@ private:
if (error)
{
if (error == boost::asio::error::would_block || error == boost::asio::error::try_again)
- return AsyncProcessQueue(guard);
+ return AsyncProcessQueue();
_writeQueue.pop();
+ if (_closing && _writeQueue.empty())
+ CloseSocket();
return false;
}
else if (bytesSent == 0)
{
_writeQueue.pop();
+ if (_closing && _writeQueue.empty())
+ CloseSocket();
return false;
}
else if (bytesSent < bytesToSend) // now n > 0
{
queuedMessage.ReadCompleted(bytesSent);
- return AsyncProcessQueue(guard);
+ return AsyncProcessQueue();
}
_writeQueue.pop();
+ if (_closing && _writeQueue.empty())
+ CloseSocket();
return !_writeQueue.empty();
}
@@ -284,6 +254,7 @@ private:
uint16 _remotePort;
MessageBuffer _readBuffer;
+ std::queue<MessageBuffer> _writeQueue;
std::atomic<bool> _closed;
std::atomic<bool> _closing;
diff --git a/src/server/shared/Networking/SocketMgr.h b/src/server/shared/Networking/SocketMgr.h
index ce5bc2d8fc2..e479cd2450d 100644
--- a/src/server/shared/Networking/SocketMgr.h
+++ b/src/server/shared/Networking/SocketMgr.h
@@ -19,7 +19,6 @@
#define SocketMgr_h__
#include "AsyncAcceptor.h"
-#include "Config.h"
#include "Errors.h"
#include "NetworkThread.h"
#include <boost/asio/ip/tcp.hpp>
@@ -33,18 +32,12 @@ class SocketMgr
public:
virtual ~SocketMgr()
{
- delete[] _threads;
+ ASSERT(!_threads && !_acceptor && !_threadCount, "StopNetwork must be called prior to SocketMgr destruction");
}
- virtual bool StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port)
+ virtual bool StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port, int threadCount)
{
- _threadCount = sConfigMgr->GetIntDefault("Network.Threads", 1);
-
- if (_threadCount <= 0)
- {
- TC_LOG_ERROR("misc", "Network.Threads is wrong in your config file");
- return false;
- }
+ ASSERT(threadCount > 0);
try
{
@@ -56,6 +49,7 @@ public:
return false;
}
+ _threadCount = threadCount;
_threads = CreateThreads();
ASSERT(_threads);
@@ -68,11 +62,19 @@ public:
virtual void StopNetwork()
{
+ _acceptor->Close();
+
if (_threadCount != 0)
for (int32 i = 0; i < _threadCount; ++i)
_threads[i].Stop();
Wait();
+
+ delete _acceptor;
+ _acceptor = nullptr;
+ delete[] _threads;
+ _threads = nullptr;
+ _threadCount = 0;
}
void Wait()
@@ -82,20 +84,14 @@ public:
_threads[i].Wait();
}
- virtual void OnSocketOpen(tcp::socket&& sock)
+ virtual void OnSocketOpen(tcp::socket&& sock, uint32 threadIndex)
{
- size_t min = 0;
-
- for (int32 i = 1; i < _threadCount; ++i)
- if (_threads[i].GetConnectionCount() < _threads[min].GetConnectionCount())
- min = i;
-
try
{
std::shared_ptr<SocketType> newSocket = std::make_shared<SocketType>(std::move(sock));
newSocket->Start();
- _threads[min].AddSocket(newSocket);
+ _threads[threadIndex].AddSocket(newSocket);
}
catch (boost::system::system_error const& err)
{
@@ -105,6 +101,23 @@ public:
int32 GetNetworkThreadCount() const { return _threadCount; }
+ uint32 SelectThreadWithMinConnections() const
+ {
+ uint32 min = 0;
+
+ for (int32 i = 1; i < _threadCount; ++i)
+ if (_threads[i].GetConnectionCount() < _threads[min].GetConnectionCount())
+ min = i;
+
+ return min;
+ }
+
+ std::pair<tcp::socket*, uint32> GetSocketForAccept()
+ {
+ uint32 threadIndex = SelectThreadWithMinConnections();
+ return std::make_pair(_threads[threadIndex].GetSocketForAccept(), threadIndex);
+ }
+
protected:
SocketMgr() : _acceptor(nullptr), _threads(nullptr), _threadCount(1)
{
diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h
index 5ebe5258a44..d24a91ed458 100644
--- a/src/server/shared/Packets/ByteBuffer.h
+++ b/src/server/shared/Packets/ByteBuffer.h
@@ -23,22 +23,12 @@
#include "Errors.h"
#include "ByteConverter.h"
#include "Util.h"
-
-#include <exception>
-#include <list>
-#include <map>
-#include <string>
-#include <vector>
#include <cstring>
-#include <time.h>
-#include <cmath>
-#include <type_traits>
-#include <boost/asio/buffer.hpp>
class MessageBuffer;
// Root of ByteBuffer exception hierarchy
-class ByteBufferException : public std::exception
+class TC_SHARED_API ByteBufferException : public std::exception
{
public:
~ByteBufferException() throw() { }
@@ -52,7 +42,7 @@ private:
std::string msg_;
};
-class ByteBufferPositionException : public ByteBufferException
+class TC_SHARED_API ByteBufferPositionException : public ByteBufferException
{
public:
ByteBufferPositionException(bool add, size_t pos, size_t size, size_t valueSize);
@@ -60,7 +50,7 @@ public:
~ByteBufferPositionException() throw() { }
};
-class ByteBufferSourceException : public ByteBufferException
+class TC_SHARED_API ByteBufferSourceException : public ByteBufferException
{
public:
ByteBufferSourceException(size_t pos, size_t size, size_t valueSize);
@@ -68,7 +58,7 @@ public:
~ByteBufferSourceException() throw() { }
};
-class ByteBuffer
+class TC_SHARED_API ByteBuffer
{
public:
const static size_t DEFAULT_SIZE = 0x1000;
@@ -628,15 +618,4 @@ inline void ByteBuffer::read_skip<std::string>()
read_skip<char*>();
}
-namespace boost
-{
- namespace asio
- {
- inline const_buffers_1 buffer(ByteBuffer const& packet)
- {
- return buffer(packet.contents(), packet.size());
- }
- }
-}
-
#endif
diff --git a/src/server/shared/Realm/Realm.cpp b/src/server/shared/Realm/Realm.cpp
new file mode 100644
index 00000000000..11c52f281a9
--- /dev/null
+++ b/src/server/shared/Realm/Realm.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Realm.h"
+
+ip::tcp::endpoint Realm::GetAddressForClient(ip::address const& clientAddr) const
+{
+ ip::address realmIp;
+
+ // Attempt to send best address for client
+ if (clientAddr.is_loopback())
+ {
+ // Try guessing if realm is also connected locally
+ if (LocalAddress.is_loopback() || ExternalAddress.is_loopback())
+ realmIp = clientAddr;
+ else
+ {
+ // Assume that user connecting from the machine that bnetserver is located on
+ // has all realms available in his local network
+ realmIp = LocalAddress;
+ }
+ }
+ else
+ {
+ if (clientAddr.is_v4() &&
+ (clientAddr.to_v4().to_ulong() & LocalSubnetMask.to_v4().to_ulong()) ==
+ (LocalAddress.to_v4().to_ulong() & LocalSubnetMask.to_v4().to_ulong()))
+ {
+ realmIp = LocalAddress;
+ }
+ else
+ realmIp = ExternalAddress;
+ }
+
+ ip::tcp::endpoint endpoint(realmIp, Port);
+
+ // Return external IP
+ return endpoint;
+}
diff --git a/src/server/shared/Realm/Realm.h b/src/server/shared/Realm/Realm.h
new file mode 100644
index 00000000000..241ccd2bca8
--- /dev/null
+++ b/src/server/shared/Realm/Realm.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef Realm_h__
+#define Realm_h__
+
+#include "Common.h"
+#include <boost/asio/ip/address.hpp>
+#include <boost/asio/ip/tcp.hpp>
+
+using namespace boost::asio;
+
+enum RealmFlags
+{
+ REALM_FLAG_NONE = 0x00,
+ REALM_FLAG_VERSION_MISMATCH = 0x01,
+ REALM_FLAG_OFFLINE = 0x02,
+ REALM_FLAG_SPECIFYBUILD = 0x04,
+ REALM_FLAG_UNK1 = 0x08,
+ REALM_FLAG_UNK2 = 0x10,
+ REALM_FLAG_RECOMMENDED = 0x20,
+ REALM_FLAG_NEW = 0x40,
+ REALM_FLAG_FULL = 0x80
+};
+
+struct TC_SHARED_API RealmHandle
+{
+ RealmHandle() : Realm(0) { }
+ RealmHandle(uint32 index) : Realm(index) { }
+
+ uint32 Realm; // primary key in `realmlist` table
+
+ bool operator<(RealmHandle const& r) const
+ {
+ return Realm < r.Realm;
+ }
+};
+
+/// Type of server, this is values from second column of Cfg_Configs.dbc
+enum RealmType
+{
+ REALM_TYPE_NORMAL = 0,
+ REALM_TYPE_PVP = 1,
+ REALM_TYPE_NORMAL2 = 4,
+ REALM_TYPE_RP = 6,
+ REALM_TYPE_RPPVP = 8,
+
+ MAX_CLIENT_REALM_TYPE = 14,
+
+ REALM_TYPE_FFA_PVP = 16 // custom, free for all pvp mode like arena PvP in all zones except rest activated places and sanctuaries
+ // replaced by REALM_PVP in realm list
+};
+
+// Storage object for a realm
+struct TC_SHARED_API Realm
+{
+ RealmHandle Id;
+ uint32 Build;
+ ip::address ExternalAddress;
+ ip::address LocalAddress;
+ ip::address LocalSubnetMask;
+ uint16 Port;
+ std::string Name;
+ uint8 Type;
+ RealmFlags Flags;
+ uint8 Timezone;
+ AccountTypes AllowedSecurityLevel;
+ float PopulationLevel;
+
+ ip::tcp::endpoint GetAddressForClient(ip::address const& clientAddr) const;
+};
+
+#endif // Realm_h__
diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/shared/Realm/RealmList.cpp
index 53aeff6133b..e941800cd76 100644
--- a/src/server/authserver/Realms/RealmList.cpp
+++ b/src/server/shared/Realm/RealmList.cpp
@@ -16,74 +16,78 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <boost/asio/ip/tcp.hpp>
-#include "Common.h"
#include "RealmList.h"
#include "Database/DatabaseEnv.h"
+#include "Util.h"
-namespace boost { namespace asio { namespace ip { class address; } } }
+RealmList::RealmList() : _updateInterval(0), _updateTimer(nullptr), _resolver(nullptr)
+{
+}
-RealmList::RealmList() : m_UpdateInterval(0), m_NextUpdateTime(time(NULL)), _resolver(nullptr) { }
RealmList::~RealmList()
{
- delete _resolver;
+ delete _updateTimer;
+}
+
+RealmList* RealmList::Instance()
+{
+ static RealmList instance;
+ return &instance;
}
// Load the realm list from the database
void RealmList::Initialize(boost::asio::io_service& ioService, uint32 updateInterval)
{
+ _updateInterval = updateInterval;
+ _updateTimer = new boost::asio::deadline_timer(ioService);
_resolver = new boost::asio::ip::tcp::resolver(ioService);
- m_UpdateInterval = updateInterval;
// Get the content of the realmlist table in the database
- UpdateRealms(true);
+ UpdateRealms(boost::system::error_code());
}
-void RealmList::UpdateRealm(uint32 id, const std::string& name, ip::address const& address, ip::address const& localAddr,
- ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population, uint32 build)
+void RealmList::Close()
{
- // Create new if not exist or update existed
- Realm& realm = m_realms[name];
-
- realm.m_ID = id;
- realm.name = name;
- realm.icon = icon;
- realm.flag = flag;
- realm.timezone = timezone;
- realm.allowedSecurityLevel = allowedSecurityLevel;
- realm.populationLevel = population;
-
- // Append port to IP address.
+ _updateTimer->cancel();
+}
+void RealmList::UpdateRealm(RealmHandle const& id, uint32 build, const std::string& name, ip::address const& address, ip::address const& localAddr,
+ ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel,
+ float population)
+{
+ // Create new if not exist or update existed
+ Realm& realm = _realms[id];
+
+ realm.Id = id;
+ realm.Build = build;
+ realm.Name = name;
+ realm.Type = icon;
+ realm.Flags = flag;
+ realm.Timezone = timezone;
+ realm.AllowedSecurityLevel = allowedSecurityLevel;
+ realm.PopulationLevel = population;
realm.ExternalAddress = address;
realm.LocalAddress = localAddr;
realm.LocalSubnetMask = localSubmask;
- realm.port = port;
- realm.gamebuild = build;
+ realm.Port = port;
}
-void RealmList::UpdateIfNeed()
+void RealmList::UpdateRealms(boost::system::error_code const& error)
{
- // maybe disabled or updated recently
- if (!m_UpdateInterval || m_NextUpdateTime > time(NULL))
+ if (error)
return;
- m_NextUpdateTime = time(NULL) + m_UpdateInterval;
-
- // Clears Realm list
- m_realms.clear();
-
- // Get the content of the realmlist table in the database
- UpdateRealms();
-}
-
-void RealmList::UpdateRealms(bool init)
-{
- TC_LOG_INFO("server.authserver", "Updating Realm List...");
+ TC_LOG_DEBUG("server.authserver", "Updating Realm List...");
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST);
PreparedQueryResult result = LoginDatabase.Query(stmt);
+ std::map<RealmHandle, std::string> existingRealms;
+ for (auto const& p : _realms)
+ existingRealms[p.first] = p.second.Name;
+
+ _realms.clear();
+
// Circle through results and add them to the realm map
if (result)
{
@@ -102,8 +106,8 @@ void RealmList::UpdateRealms(bool init)
boost::asio::ip::tcp::resolver::iterator endPoint = _resolver->resolve(externalAddressQuery, ec);
if (endPoint == end || ec)
{
- TC_LOG_ERROR("server.authserver", "Could not resolve address %s", fields[2].GetString().c_str());
- return;
+ TC_LOG_ERROR("server.authserver", "Could not resolve address %s for realm \"%s\" id %u", fields[2].GetString().c_str(), name.c_str(), realmId);
+ continue;
}
ip::address externalAddress = (*endPoint).endpoint().address();
@@ -112,8 +116,8 @@ void RealmList::UpdateRealms(bool init)
endPoint = _resolver->resolve(localAddressQuery, ec);
if (endPoint == end || ec)
{
- TC_LOG_ERROR("server.authserver", "Could not resolve address %s", fields[3].GetString().c_str());
- return;
+ TC_LOG_ERROR("server.authserver", "Could not resolve localAddress %s for realm \"%s\" id %u", fields[3].GetString().c_str(), name.c_str(), realmId);
+ continue;
}
ip::address localAddress = (*endPoint).endpoint().address();
@@ -122,25 +126,35 @@ void RealmList::UpdateRealms(bool init)
endPoint = _resolver->resolve(localSubmaskQuery, ec);
if (endPoint == end || ec)
{
- TC_LOG_ERROR("server.authserver", "Could not resolve address %s", fields[4].GetString().c_str());
- return;
+ TC_LOG_ERROR("server.authserver", "Could not resolve localSubnetMask %s for realm \"%s\" id %u", fields[4].GetString().c_str(), name.c_str(), realmId);
+ continue;
}
ip::address localSubmask = (*endPoint).endpoint().address();
uint16 port = fields[5].GetUInt16();
uint8 icon = fields[6].GetUInt8();
+ if (icon == REALM_TYPE_FFA_PVP)
+ icon = REALM_TYPE_PVP;
+ if (icon >= MAX_CLIENT_REALM_TYPE)
+ icon = REALM_TYPE_NORMAL;
RealmFlags flag = RealmFlags(fields[7].GetUInt8());
uint8 timezone = fields[8].GetUInt8();
uint8 allowedSecurityLevel = fields[9].GetUInt8();
float pop = fields[10].GetFloat();
uint32 build = fields[11].GetUInt32();
- UpdateRealm(realmId, name, externalAddress, localAddress, localSubmask, port, icon, flag, timezone,
- (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build);
+ RealmHandle id{ realmId };
- if (init)
- TC_LOG_INFO("server.authserver", "Added realm \"%s\" at %s:%u.", name.c_str(), m_realms[name].ExternalAddress.to_string().c_str(), port);
+ UpdateRealm(id, build, name, externalAddress, localAddress, localSubmask, port, icon, flag,
+ timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop);
+
+ if (!existingRealms.count(id))
+ TC_LOG_INFO("server.authserver", "Added realm \"%s\" at %s:%u.", name.c_str(), externalAddress.to_string().c_str(), port);
+ else
+ TC_LOG_DEBUG("server.authserver", "Updating realm \"%s\" at %s:%u.", name.c_str(), externalAddress.to_string().c_str(), port);
+
+ existingRealms.erase(id);
}
catch (std::exception& ex)
{
@@ -150,4 +164,22 @@ void RealmList::UpdateRealms(bool init)
}
while (result->NextRow());
}
+
+ for (auto itr = existingRealms.begin(); itr != existingRealms.end(); ++itr)
+ TC_LOG_INFO("server.authserver", "Removed realm \"%s\".", itr->second.c_str());
+
+ if (_updateInterval)
+ {
+ _updateTimer->expires_from_now(boost::posix_time::seconds(_updateInterval));
+ _updateTimer->async_wait(std::bind(&RealmList::UpdateRealms, this, std::placeholders::_1));
+ }
+}
+
+Realm const* RealmList::GetRealm(RealmHandle const& id) const
+{
+ auto itr = _realms.find(id);
+ if (itr != _realms.end())
+ return &itr->second;
+
+ return NULL;
}
diff --git a/src/server/shared/Realm/RealmList.h b/src/server/shared/Realm/RealmList.h
new file mode 100644
index 00000000000..3b81337e762
--- /dev/null
+++ b/src/server/shared/Realm/RealmList.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _REALMLIST_H
+#define _REALMLIST_H
+
+#include "Common.h"
+#include "Realm/Realm.h"
+#include <boost/asio/ip/address.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/deadline_timer.hpp>
+
+using namespace boost::asio;
+
+/// Storage object for the list of realms on the server
+class TC_SHARED_API RealmList
+{
+public:
+ typedef std::map<RealmHandle, Realm> RealmMap;
+
+ static RealmList* Instance();
+
+ ~RealmList();
+
+ void Initialize(boost::asio::io_service& ioService, uint32 updateInterval);
+ void Close();
+
+ RealmMap const& GetRealms() const { return _realms; }
+ Realm const* GetRealm(RealmHandle const& id) const;
+
+private:
+ RealmList();
+
+ void UpdateRealms(boost::system::error_code const& error);
+ void UpdateRealm(RealmHandle const& id, uint32 build, const std::string& name, ip::address const& address, ip::address const& localAddr,
+ ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population);
+
+ RealmMap _realms;
+ uint32 _updateInterval;
+ boost::asio::deadline_timer* _updateTimer;
+ boost::asio::ip::tcp::resolver* _resolver;
+};
+
+#define sRealmList RealmList::Instance()
+#endif
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index 535383ac605..0de8d6054f3 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -8,113 +8,29 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-file(GLOB_RECURSE sources_CommandLine CommandLine/*.cpp CommandLine/*.h)
-file(GLOB_RECURSE sources_RemoteAccess RemoteAccess/*.cpp RemoteAccess/*.h)
-file(GLOB_RECURSE sources_TCSoap TCSoap/*.cpp TCSoap/*.h)
-file(GLOB sources_localdir *.cpp *.h)
-
-if (USE_COREPCH)
- set(worldserver_PCH_HDR PrecompiledHeaders/worldPCH.h)
- set(worldserver_PCH_SRC PrecompiledHeaders/worldPCH.cpp)
-endif()
-
-set(worldserver_SRCS
- ${worldserver_SRCS}
- ${sources_CommandLine}
- ${sources_RemoteAccess}
- ${sources_TCSoap}
- ${sources_localdir}
-)
+CollectSourceFiles(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE_SOURCES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if( WIN32 )
- set(worldserver_SRCS
- ${worldserver_SRCS}
- ${sources_windows_Debugging}
- )
+ list(APPEND PRIVATE_SOURCES ${sources_windows})
if ( MSVC )
- set(worldserver_SRCS
- ${worldserver_SRCS}
- worldserver.rc
- )
+ list(APPEND PRIVATE_SOURCES worldserver.rc)
endif()
endif()
-include_directories(
- ${CMAKE_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/CommandLine
- ${CMAKE_CURRENT_SOURCE_DIR}/RemoteAccess
- ${CMAKE_CURRENT_SOURCE_DIR}/TCSoap
- ${CMAKE_SOURCE_DIR}/dep/cppformat
- ${CMAKE_SOURCE_DIR}/dep/g3dlite/include
- ${CMAKE_SOURCE_DIR}/dep/gsoap
- ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour/Include
- ${CMAKE_SOURCE_DIR}/src/common/
- ${CMAKE_SOURCE_DIR}/src/common/Collision
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Models
- ${CMAKE_SOURCE_DIR}/src/common/Configuration
- ${CMAKE_SOURCE_DIR}/src/common/Cryptography
- ${CMAKE_SOURCE_DIR}/src/common/Cryptography/Authentication
- ${CMAKE_SOURCE_DIR}/src/common/Debugging
- ${CMAKE_SOURCE_DIR}/src/common/Logging
- ${CMAKE_SOURCE_DIR}/src/common/Threading
- ${CMAKE_SOURCE_DIR}/src/common/Utilities
- ${CMAKE_SOURCE_DIR}/src/server/authserver/Realms
- ${CMAKE_SOURCE_DIR}/src/server/database/
- ${CMAKE_SOURCE_DIR}/src/server/database/Database
- ${CMAKE_SOURCE_DIR}/src/server/database/Logging
- ${CMAKE_SOURCE_DIR}/src/server/game
- ${CMAKE_SOURCE_DIR}/src/server/game/Accounts
- ${CMAKE_SOURCE_DIR}/src/server/game/Addons
- ${CMAKE_SOURCE_DIR}/src/server/game/Battlegrounds
- ${CMAKE_SOURCE_DIR}/src/server/game/Chat
- ${CMAKE_SOURCE_DIR}/src/server/game/Combat
- ${CMAKE_SOURCE_DIR}/src/server/game/Conditions
- ${CMAKE_SOURCE_DIR}/src/server/game/DataStores
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Corpse
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Creature
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/DynamicObject
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/GameObject
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Item/Container
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Object/Updates
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Unit
- ${CMAKE_SOURCE_DIR}/src/server/game/Entities/Vehicle
- ${CMAKE_SOURCE_DIR}/src/server/game/Globals
- ${CMAKE_SOURCE_DIR}/src/server/game/Grids
- ${CMAKE_SOURCE_DIR}/src/server/game/Grids/Cells
- ${CMAKE_SOURCE_DIR}/src/server/game/Handlers
- ${CMAKE_SOURCE_DIR}/src/server/game/Instances
- ${CMAKE_SOURCE_DIR}/src/server/game/Loot
- ${CMAKE_SOURCE_DIR}/src/server/game/Mails
- ${CMAKE_SOURCE_DIR}/src/server/game/Maps
- ${CMAKE_SOURCE_DIR}/src/server/game/Miscellaneous
- ${CMAKE_SOURCE_DIR}/src/server/game/Movement
- ${CMAKE_SOURCE_DIR}/src/server/game/Movement/Waypoints
- ${CMAKE_SOURCE_DIR}/src/server/game/Quests
- ${CMAKE_SOURCE_DIR}/src/server/game/Scripting
- ${CMAKE_SOURCE_DIR}/src/server/game/Server
- ${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol
- ${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras
- ${CMAKE_SOURCE_DIR}/src/server/game/Weather
- ${CMAKE_SOURCE_DIR}/src/server/game/World
- ${CMAKE_SOURCE_DIR}/src/server/shared
- ${CMAKE_SOURCE_DIR}/src/server/shared/DataStores
- ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic
- ${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference
- ${CMAKE_SOURCE_DIR}/src/server/shared/Networking
- ${CMAKE_SOURCE_DIR}/src/server/shared/Packets
- ${CMAKE_SOURCE_DIR}/src/server/shared/Service
- ${MYSQL_INCLUDE_DIR}
- ${OPENSSL_INCLUDE_DIR}
- ${VALGRIND_INCLUDE_DIR}
-)
+if (USE_COREPCH)
+ set(PRIVATE_PCH_HEADER PrecompiledHeaders/worldPCH.h)
+ set(PRIVATE_PCH_SOURCE PrecompiledHeaders/worldPCH.cpp)
+endif()
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(worldserver
- ${worldserver_SRCS}
- ${worldserver_PCH_SRC}
+ ${PRIVATE_PCH_SOURCE}
+ ${PRIVATE_SOURCES}
)
if( NOT WIN32 )
@@ -130,24 +46,33 @@ endif()
set_target_properties(worldserver PROPERTIES LINK_FLAGS "${worldserver_LINK_FLAGS}")
target_link_libraries(worldserver
- game
- common
- shared
- database
- scripts
- g3dlib
- gsoap
- Detour
- format
- ${JEMALLOC_LIBRARY}
- ${READLINE_LIBRARY}
- ${TERMCAP_LIBRARY}
- ${MYSQL_LIBRARY}
- ${OPENSSL_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
- ${Boost_LIBRARIES}
-)
+ PUBLIC
+ scripts
+ game
+ gsoap
+ readline)
+
+CollectIncludeDirectories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC_INCLUDES
+ # Exclude
+ ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
+
+target_include_directories(worldserver
+ PUBLIC
+ ${PUBLIC_INCLUDES}
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR})
+
+set_target_properties(worldserver
+ PROPERTIES
+ FOLDER
+ "server")
+
+# Add all dynamic projects as dependency to the worldserver
+if (WORLDSERVER_DYNAMIC_SCRIPT_MODULES_DEPENDENCIES)
+ add_dependencies(worldserver ${WORLDSERVER_DYNAMIC_SCRIPT_MODULES_DEPENDENCIES})
+endif()
if( WIN32 )
if ( MSVC )
@@ -173,5 +98,5 @@ endif()
# Generate precompiled header
if( USE_COREPCH )
- add_cxx_pch(worldserver ${worldserver_PCH_HDR} ${worldserver_PCH_SRC})
+ add_cxx_pch(worldserver ${PRIVATE_PCH_HEADER} ${PRIVATE_PCH_SOURCE})
endif()
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index 53c5f250851..0241221a2ac 100644
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -24,6 +24,7 @@
#include <openssl/crypto.h>
#include <boost/asio/io_service.hpp>
#include <boost/asio/deadline_timer.hpp>
+#include <boost/filesystem/path.hpp>
#include <boost/program_options.hpp>
#include "Common.h"
@@ -34,12 +35,13 @@
#include "OpenSSLCrypto.h"
#include "ProcessPriority.h"
#include "BigNumber.h"
-#include "RealmList.h"
#include "World.h"
#include "MapManager.h"
#include "InstanceSaveMgr.h"
#include "ObjectAccessor.h"
#include "ScriptMgr.h"
+#include "ScriptReloadMgr.h"
+#include "ScriptLoader.h"
#include "OutdoorPvP/OutdoorPvPMgr.h"
#include "BattlegroundMgr.h"
#include "TCSoap.h"
@@ -47,10 +49,13 @@
#include "GitRevision.h"
#include "WorldSocket.h"
#include "WorldSocketMgr.h"
+#include "Realm/Realm.h"
#include "DatabaseLoader.h"
#include "AppenderDB.h"
+#include "Metric.h"
using namespace boost::program_options;
+namespace fs = boost::filesystem;
#ifndef _TRINITY_CORE_CONFIG
#define _TRINITY_CORE_CONFIG "worldserver.conf"
@@ -78,11 +83,6 @@ uint32 _worldLoopCounter(0);
uint32 _lastChangeMsTime(0);
uint32 _maxCoreStuckTimeInMs(0);
-WorldDatabaseWorkerPool WorldDatabase; ///< Accessor to the world database
-CharacterDatabaseWorkerPool CharacterDatabase; ///< Accessor to the character database
-LoginDatabaseWorkerPool LoginDatabase; ///< Accessor to the realm/login database
-uint32 realmID; ///< Id of the realm
-
void SignalHandler(const boost::system::error_code& error, int signalNumber);
void FreezeDetectorHandler(const boost::system::error_code& error);
AsyncAcceptor* StartRaSocketAcceptor(boost::asio::io_service& ioService);
@@ -92,12 +92,15 @@ void WorldUpdateLoop();
void ClearOnlineAccounts();
void ShutdownCLIThread(std::thread* cliThread);
void ShutdownThreadPool(std::vector<std::thread>& threadPool);
-variables_map GetConsoleArguments(int argc, char** argv, std::string& cfg_file, std::string& cfg_service);
+bool LoadRealmInfo();
+variables_map GetConsoleArguments(int argc, char** argv, fs::path& configFile, std::string& cfg_service);
/// Launch the Trinity server
extern int main(int argc, char** argv)
{
- std::string configFile = _TRINITY_CORE_CONFIG;
+ signal(SIGABRT, &Trinity::AbortHandler);
+
+ auto configFile = fs::absolute(_TRINITY_CORE_CONFIG);
std::string configService;
auto vm = GetConsoleArguments(argc, argv, configFile, configService);
@@ -115,7 +118,9 @@ extern int main(int argc, char** argv)
#endif
std::string configError;
- if (!sConfigMgr->LoadInitial(configFile, configError))
+ if (!sConfigMgr->LoadInitial(configFile.generic_string(),
+ std::vector<std::string>(argv, argv + argc),
+ configError))
{
printf("Error in config file: %s\n", configError.c_str());
return 1;
@@ -136,7 +141,7 @@ extern int main(int argc, char** argv)
TC_LOG_INFO("server.worldserver", " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
TC_LOG_INFO("server.worldserver", " C O R E /\\___/");
TC_LOG_INFO("server.worldserver", "http://TrinityCore.org \\/__/\n");
- TC_LOG_INFO("server.worldserver", "Using configuration file %s.", configFile.c_str());
+ TC_LOG_INFO("server.worldserver", "Using configuration file %s.", sConfigMgr->GetFilename().c_str());
TC_LOG_INFO("server.worldserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
TC_LOG_INFO("server.worldserver", "Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
@@ -188,9 +193,19 @@ extern int main(int argc, char** argv)
}
// Set server offline (not connectable)
- LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = (flag & ~%u) | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, REALM_FLAG_INVALID, realmID);
+ LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realm.Id.Realm);
+
+ LoadRealmInfo();
+
+ sMetric->Initialize(realm.Name, _ioService, []()
+ {
+ TC_METRIC_VALUE("online_players", sWorld->GetPlayerCount());
+ });
+
+ TC_METRIC_EVENT("events", "Worldserver started", "");
// Initialize the World
+ sScriptMgr->SetScriptLoader(AddScripts);
sWorld->SetInitialWorldSettings();
// Launch CliRunnable thread
@@ -220,10 +235,20 @@ extern int main(int argc, char** argv)
uint16 worldPort = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD));
std::string worldListener = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
- sWorldSocketMgr.StartNetwork(_ioService, worldListener, worldPort);
+ int networkThreads = sConfigMgr->GetIntDefault("Network.Threads", 1);
+
+ if (networkThreads <= 0)
+ {
+ TC_LOG_ERROR("server.worldserver", "Network.Threads must be greater than 0");
+ return false;
+ }
+
+ sWorldSocketMgr.StartNetwork(_ioService, worldListener, worldPort, networkThreads);
// Set server online (allow connecting now)
- LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmID);
+ LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_OFFLINE, realm.Id.Realm);
+ realm.PopulationLevel = 0.0f;
+ realm.Flags = RealmFlags(realm.Flags & ~uint32(REALM_FLAG_OFFLINE));
// Start the freeze check callback cycle in 5 seconds (cycle itself is 1 sec)
if (int coreStuckTime = sConfigMgr->GetIntDefault("MaxCoreStuckTime", 0))
@@ -243,6 +268,8 @@ extern int main(int argc, char** argv)
// Shutdown starts here
ShutdownThreadPool(threadPool);
+ sLog->SetSynchronous();
+
sScriptMgr->OnShutdown();
sWorld->KickAll(); // save and kick all players
@@ -257,9 +284,10 @@ extern int main(int argc, char** argv)
sOutdoorPvPMgr->Die();
sMapMgr->UnloadAll(); // unload all grids (including locked in memory)
sScriptMgr->Unload();
+ sScriptReloadMgr->Unload();
// set server offline
- LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID);
+ LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realm.Id.Realm);
// Clean up threads if any
if (soapThread != nullptr)
@@ -275,6 +303,9 @@ extern int main(int argc, char** argv)
StopDB();
+ TC_METRIC_EVENT("events", "Worldserver shutdown", "");
+ sMetric->ForceSend();
+
TC_LOG_INFO("server.worldserver", "Halting process...");
ShutdownCLIThread(cliThread);
@@ -441,6 +472,59 @@ AsyncAcceptor* StartRaSocketAcceptor(boost::asio::io_service& ioService)
return acceptor;
}
+bool LoadRealmInfo()
+{
+ boost::asio::ip::tcp::resolver resolver(_ioService);
+ boost::asio::ip::tcp::resolver::iterator end;
+
+ QueryResult result = LoginDatabase.PQuery("SELECT id, name, address, localAddress, localSubnetMask, port, icon, flag, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE id = %u", realm.Id.Realm);
+ if (!result)
+ return false;
+
+ Field* fields = result->Fetch();
+ realm.Name = fields[1].GetString();
+ boost::asio::ip::tcp::resolver::query externalAddressQuery(ip::tcp::v4(), fields[2].GetString(), "");
+
+ boost::system::error_code ec;
+ boost::asio::ip::tcp::resolver::iterator endPoint = resolver.resolve(externalAddressQuery, ec);
+ if (endPoint == end || ec)
+ {
+ TC_LOG_ERROR("server.worldserver", "Could not resolve address %s", fields[2].GetString().c_str());
+ return false;
+ }
+
+ realm.ExternalAddress = (*endPoint).endpoint().address();
+
+ boost::asio::ip::tcp::resolver::query localAddressQuery(ip::tcp::v4(), fields[3].GetString(), "");
+ endPoint = resolver.resolve(localAddressQuery, ec);
+ if (endPoint == end || ec)
+ {
+ TC_LOG_ERROR("server.worldserver", "Could not resolve address %s", fields[3].GetString().c_str());
+ return false;
+ }
+
+ realm.LocalAddress = (*endPoint).endpoint().address();
+
+ boost::asio::ip::tcp::resolver::query localSubmaskQuery(ip::tcp::v4(), fields[4].GetString(), "");
+ endPoint = resolver.resolve(localSubmaskQuery, ec);
+ if (endPoint == end || ec)
+ {
+ TC_LOG_ERROR("server.worldserver", "Could not resolve address %s", fields[4].GetString().c_str());
+ return false;
+ }
+
+ realm.LocalSubnetMask = (*endPoint).endpoint().address();
+
+ realm.Port = fields[5].GetUInt16();
+ realm.Type = fields[6].GetUInt8();
+ realm.Flags = RealmFlags(fields[7].GetUInt8());
+ realm.Timezone = fields[8].GetUInt8();
+ realm.AllowedSecurityLevel = AccountTypes(fields[9].GetUInt8());
+ realm.PopulationLevel = fields[10].GetFloat();
+ realm.Build = fields[11].GetUInt32();
+ return true;
+}
+
/// Initialize connection to the databases
bool StartDB()
{
@@ -449,21 +533,22 @@ bool StartDB()
// Load databases
DatabaseLoader loader("server.worldserver", DatabaseLoader::DATABASE_NONE);
loader
- .AddDatabase(WorldDatabase, "World")
+ .AddDatabase(LoginDatabase, "Login")
.AddDatabase(CharacterDatabase, "Character")
- .AddDatabase(LoginDatabase, "Login");
+ .AddDatabase(WorldDatabase, "World");
if (!loader.Load())
return false;
///- Get the realm Id from the configuration file
- realmID = sConfigMgr->GetIntDefault("RealmID", 0);
- if (!realmID)
+ realm.Id.Realm = sConfigMgr->GetIntDefault("RealmID", 0);
+ if (!realm.Id.Realm)
{
TC_LOG_ERROR("server.worldserver", "Realm ID not defined in configuration file");
return false;
}
- TC_LOG_INFO("server.worldserver", "Realm running as realm ID %d", realmID);
+
+ TC_LOG_INFO("server.worldserver", "Realm running as realm ID %d", realm.Id.Realm);
///- Clean the database before starting
ClearOnlineAccounts();
@@ -490,7 +575,7 @@ void StopDB()
void ClearOnlineAccounts()
{
// Reset online status for all accounts with characters on the current realm
- LoginDatabase.DirectPExecute("UPDATE account SET online = 0 WHERE online > 0 AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = %d)", realmID);
+ LoginDatabase.DirectPExecute("UPDATE account SET online = 0 WHERE online > 0 AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = %d)", realm.Id.Realm);
// Reset online status for all characters
CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online <> 0");
@@ -501,7 +586,7 @@ void ClearOnlineAccounts()
/// @}
-variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile, std::string& configService)
+variables_map GetConsoleArguments(int argc, char** argv, fs::path& configFile, std::string& configService)
{
// Silences warning about configService not be used if the OS is not Windows
(void)configService;
@@ -510,7 +595,8 @@ variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile
all.add_options()
("help,h", "print usage message")
("version,v", "print version build info")
- ("config,c", value<std::string>(&configFile)->default_value(_TRINITY_CORE_CONFIG), "use <arg> as configuration file")
+ ("config,c", value<fs::path>(&configFile)->default_value(fs::absolute(_TRINITY_CORE_CONFIG)),
+ "use <arg> as configuration file")
;
#ifdef _WIN32
options_description win("Windows platform specific options");
diff --git a/src/server/worldserver/RemoteAccess/RASession.cpp b/src/server/worldserver/RemoteAccess/RASession.cpp
index 59e7b138c48..1ad1ac1dc6c 100644
--- a/src/server/worldserver/RemoteAccess/RASession.cpp
+++ b/src/server/worldserver/RemoteAccess/RASession.cpp
@@ -121,7 +121,7 @@ bool RASession::CheckAccessLevel(const std::string& user)
{
std::string safeUser = user;
- AccountMgr::normalizeString(safeUser);
+ Utf8ToUpperOnlyLatin(safeUser);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS);
stmt->setString(0, safeUser);
@@ -153,10 +153,10 @@ bool RASession::CheckPassword(const std::string& user, const std::string& pass)
{
std::string safe_user = user;
std::transform(safe_user.begin(), safe_user.end(), safe_user.begin(), ::toupper);
- AccountMgr::normalizeString(safe_user);
+ Utf8ToUpperOnlyLatin(safe_user);
std::string safe_pass = pass;
- AccountMgr::normalizeString(safe_pass);
+ Utf8ToUpperOnlyLatin(safe_pass);
std::transform(safe_pass.begin(), safe_pass.end(), safe_pass.begin(), ::toupper);
std::string hash = AccountMgr::CalculateShaPassHash(safe_user, safe_pass);
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 217995cb88a..0513f2b0ab4 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -12,6 +12,7 @@
# SERVER LOGGING
# SERVER SETTINGS
# UPDATE SETTINGS
+# HOTSWAP SETTINGS
# WARDEN SETTINGS
# PLAYER INTERACTION
# CREATURE SETTINGS
@@ -33,6 +34,7 @@
# AUCTION HOUSE BOT BUYER CONFIG
# LOGGING SYSTEM SETTINGS
# PACKET SPOOF PROTECTION SETTINGS
+# METRIC SETTINGS
#
###################################################################################################
@@ -93,6 +95,12 @@ LogsDir = ""
# Default: "127.0.0.1;3306;trinity;trinity;auth" - (LoginDatabaseInfo)
# "127.0.0.1;3306;trinity;trinity;world" - (WorldDatabaseInfo)
# "127.0.0.1;3306;trinity;trinity;characters" - (CharacterDatabaseInfo)
+#
+# Don't change hostname unless you are hosting mysql on a different machine, if you need help
+# with configuration allowing to connect from diferent machine than the one running server
+# search for TCE00016 on forum.
+# Don't open port on firewall to external connections (it belongs to mysql, not to wow server).
+# The username you choose must have permisions to create/alter/rename tables.
LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth"
WorldDatabaseInfo = "127.0.0.1;3306;trinity;trinity;world"
@@ -161,6 +169,45 @@ BindIP = "0.0.0.0"
ThreadPool = 2
#
+# CMakeCommand
+# Description: The path to your CMake binary.
+# If the path is left empty, the built-in CMAKE_COMMAND is used.
+# Example: "C:/Program Files (x86)/CMake/bin/cmake.exe"
+# "/usr/bin/cmake"
+# Default: ""
+
+CMakeCommand = ""
+
+#
+# BuildDirectory
+# Description: The path to your build directory.
+# If the path is left empty, the built-in CMAKE_BINARY_DIR is used.
+# Example: "../TrinityCore"
+# Default: ""
+
+BuildDirectory = ""
+
+#
+# SourceDirectory
+# Description: The path to your TrinityCore source directory.
+# If the path is left empty, the built-in CMAKE_SOURCE_DIR is used.
+# Example: "../TrinityCore"
+# Default: ""
+
+SourceDirectory = ""
+
+#
+# MySQLExecutable
+# Description: The path to your mysql cli binary.
+# If the path is left empty, built-in path from cmake is used.
+# Example: "C:/Program Files/MySQL/MySQL Server 5.6/bin/mysql.exe"
+# "mysql.exe"
+# "/usr/bin/mysql"
+# Default: ""
+
+MySQLExecutable = ""
+
+#
###################################################################################################
###################################################################################################
@@ -231,6 +278,25 @@ MaxOverspeedPings = 2
GridUnload = 1
#
+# BaseMapLoadAllGrids
+# Description: Load all grids for base maps upon load. Requires GridUnload to be 0.
+# This will take around 5GB of ram upon server load, and will take some time
+# to initially load the server.
+# Default: 0 - (Don't pre-load all base maps, dynamically load as used)
+# 1 - (Preload all grids in all base maps upon load)
+
+BaseMapLoadAllGrids = 0
+
+#
+# InstanceMapLoadAllGrids
+# Description: Load all grids for instance maps upon load. Requires GridUnload to be 0.
+# Upon loading an instance map, all creatures/objects in the map will be pre-loaded
+# Default: 0 - (Don't pre-load all base maps, dynamically load as used)
+# 1 - (Preload all grids in the instance upon load)
+
+InstanceMapLoadAllGrids = 0
+
+#
# SocketTimeOutTime
# Description: Time (in milliseconds) after which a connection being idle on the character
# selection screen is disconnected.
@@ -291,6 +357,13 @@ PlayerSave.Stats.MinLevel = 0
PlayerSave.Stats.SaveOnlyOnLogout = 1
#
+# DisconnectToleranceInterval
+# Description: Tolerance (in seconds) for disconnected players before reentering the queue.
+# Default: 0 (disabled)
+
+DisconnectToleranceInterval = 0
+
+#
# mmap.enablePathFinding
# Description: Enable/Disable pathfinding using mmaps - recommended.
# Default: 0 - (Disabled)
@@ -659,7 +732,7 @@ CharacterCreating.Disabled.RaceMask = 0
# 2 - (Disabled, Paladin)
# 4 - (Disabled, Hunter)
# 8 - (Disabled, Rogue)
-# 16 - (Disabled, Undead)
+# 16 - (Disabled, Priest)
# 32 - (Disabled, Death Knight)
# 64 - (Disabled, Shaman)
# 128 - (Disabled, Mage)
@@ -1061,9 +1134,8 @@ BeepAtStart = 1
#
# Motd
-# Description: Message of the Day, displayed at login.
-# Use '@' for a newline and be sure to escape special characters.
-# Example: "Welcome to John\'s Server@This server runs on Trinity Core."
+# Description: Message of the Day, displayed at login. Use '@' for a newline.
+# Example: "Welcome to John's Server!@This server is proud to be powered by Trinity Core."
# Default: "Welcome to a Trinity Core server."
Motd = "Welcome to a Trinity Core server."
@@ -1167,26 +1239,6 @@ BirthdayTime = 1222964635
Updates.EnableDatabases = 7
#
-# Updates.SourcePath
-# Description: The path to your TrinityCore source directory.
-# If the path is left empty, built-in CMAKE_SOURCE_DIR is used.
-# Example: "../TrinityCore"
-# Default: ""
-
-Updates.SourcePath = ""
-
-#
-# Updates.MySqlCLIPath
-# Description: The path to your mysql cli binary.
-# If the path is left empty, built-in path from cmake is used.
-# Example: "C:/Program Files/MySQL/MySQL Server 5.6/bin/mysql.exe"
-# "mysql.exe"
-# "/usr/bin/mysql"
-# Default: ""
-
-Updates.MySqlCLIPath = ""
-
-#
# Updates.AutoSetup
# Description: Auto populate empty databases.
# Default: 1 - (Enabled)
@@ -1236,6 +1288,78 @@ Updates.CleanDeadRefMaxCount = 3
###################################################################################################
###################################################################################################
+# HOTSWAP SETTINGS
+#
+# HotSwap.Enabled (Requires compilation with DYNAMIC_LINKING=1)
+# Description: Enables dynamic script hotswapping.
+# Reloads scripts on changes.
+# Default: 1 - (Enabled)
+# 0 - (Disabled)
+
+HotSwap.Enabled = 1
+
+#
+# HotSwap.ScriptDir
+# Description: Directory containing the script shared libraries (.dll/.so).
+# Example: "/usr/local/scripts"
+# Default: "scripts"
+
+HotSwap.ScriptDir = "scripts"
+
+# HotSwap.EnableReCompiler
+# Description: Enables the dynamic script recompiler.
+# Watches your script source directories and recompiles the
+# script modules on changes.
+# Default: 1 - (Enabled)
+# 0 - (Disabled)
+
+HotSwap.EnableReCompiler = 1
+
+# HotSwap.EnableEarlyTermination
+# Description: Terminate the build of a module when an associated
+# source file was changed meanwhile.
+# Default: 1 - (Enabled)
+# 0 - (Disabled)
+
+HotSwap.EnableEarlyTermination = 1
+
+# HotSwap.EnableBuildFileRecreation
+# Description: Recreate build files when sources to a module
+# were added or removed.
+# Default: 1 - (Enabled)
+# 0 - (Disabled)
+
+HotSwap.EnableBuildFileRecreation = 1
+
+#
+# HotSwap.EnableInstall
+# Description: Enables cmake install after automatic builds have finished
+# Default: 1 - (Enabled)
+# 0 - (Disabled)
+
+HotSwap.EnableInstall = 1
+
+#
+# HotSwap.EnablePrefixCorrection
+# Description: Allows the core to automatic set the CMAKE_INSTALL_PREFIX
+# to it's current location in the filesystem.
+# Default: 1 - (Enabled)
+# 0 - (Disabled)
+
+HotSwap.EnablePrefixCorrection = 1
+
+# HotSwap.ReCompilerBuildType
+# Description: Defines the build type of the builds invoked by the recompiler.
+# Default: "" - Built-in build type of the module is used.
+# "Release" - Release builds only
+# "Debug" - Debug builds only
+
+HotSwap.ReCompilerBuildType = ""
+
+#
+###################################################################################################
+
+###################################################################################################
# WARDEN SETTINGS
#
# Warden.Enabled
@@ -1354,10 +1478,11 @@ AllowTwoSide.Trade = 0
#
# TalentsInspecting
-# Description: Allow inspecting characters from the opposing faction.
-# Doesn't affect characters in gamemaster mode.
-# Default: 1 - (Enabled)
-# 0 - (Disabled)
+# Description: Allow/disallow inspecting other characters' talents.
+# Doesn't affect game master accounts.
+# 2 - (Enabled for all characters)
+# Default: 1 - (Enabled for characters of the same faction)
+# 0 - (Talent inspecting is disabled)
TalentsInspecting = 1
@@ -1540,6 +1665,14 @@ ListenRange.TextEmote = 40
ListenRange.Yell = 300
#
+# Creature.MovingStopTimeForPlayer
+# Description: Time (in milliseconds) during which creature will not move after
+# interaction with player.
+# Default: 180000
+
+Creature.MovingStopTimeForPlayer = 180000
+
+#
###################################################################################################
###################################################################################################
@@ -1608,24 +1741,27 @@ Channel.RestrictedLfg = 1
#
# ChatLevelReq.Channel
-# Description: Level requirement for characters to be able to write in chat channels.
-# Default: 1
-
-ChatLevelReq.Channel = 1
-
-#
# ChatLevelReq.Whisper
-# Description: Level requirement for characters to be able to whisper other characters.
+# ChatLevelReq.Emote
+# ChatLevelReq.Say
+# ChatLevelReq.Yell
+# Description: Level requirement for characters to be able to use chats.
# Default: 1
+ChatLevelReq.Channel = 1
ChatLevelReq.Whisper = 1
+ChatLevelReq.Emote = 1
+ChatLevelReq.Say = 1
+ChatLevelReq.Yell = 1
#
-# ChatLevelReq.Say
-# Description: Level requirement for characters to be able to use say/yell/emote.
+# PartyLevelReq
+# Description: Minimum level at which players can invite to group, even if they aren't on
+# the invitee friends list. (Players who are on that friend list can always
+# invite despite having lower level)
# Default: 1
-ChatLevelReq.Say = 1
+PartyLevelReq = 1
#
# PreserveCustomChannels
@@ -1751,6 +1887,13 @@ GM.LowerSecurity = 0
GM.TicketSystem.ChanceOfGMSurvey = 50
#
+# GM.ForceShutdownThreshold
+# Description: Minimum shutdown time in seconds before 'force' is required if other players are connected.
+# Default: 30
+
+GM.ForceShutdownThreshold = 30
+
+#
###################################################################################################
###################################################################################################
@@ -2259,16 +2402,16 @@ Battleground.InvitationType = 0
# Default: 300000 - (Enabled, 5 minutes)
# 0 - (Disabled, Not recommended)
-BattleGround.PrematureFinishTimer = 300000
+Battleground.PrematureFinishTimer = 300000
#
-# BattleGround.PremadeGroupWaitForMatch
+# Battleground.PremadeGroupWaitForMatch
# Description: Time (in milliseconds) a pre-made group has to wait for matching group of the
# other faction.
# Default: 1800000 - (Enabled, 30 minutes)
# 0 - (Disabled, Not recommended)
-BattleGround.PremadeGroupWaitForMatch = 1800000
+Battleground.PremadeGroupWaitForMatch = 1800000
#
# Battleground.GiveXPForKills
@@ -2311,6 +2454,14 @@ Battleground.RewardLoserHonorFirst = 5
Battleground.RewardLoserHonorLast = 5
#
+# Battleground.ReportAFK
+# Description: Number of reports needed to kick someone AFK from Battleground.
+# Range: 1-9
+# Default: 3
+
+Battleground.ReportAFK = 3
+
+#
###################################################################################################
###################################################################################################
@@ -2895,6 +3046,16 @@ NoGrayAggro.Above = 0
NoGrayAggro.Below = 0
#
+# PreventRenameCharacterOnCustomization
+# Description: If option is set to 1, player can not rename the character in character customization.
+# Applies to all character customization commands.
+# Default: 0 - (Disabled, character can be renamed in Character Customization)
+# 1 - (Enabled, character can not be renamed in Character Customization)
+#
+
+PreventRenameCharacterOnCustomization = 0
+
+#
###################################################################################################
###################################################################################################
@@ -2951,6 +3112,27 @@ AuctionHouseBot.MinTime = 1
AuctionHouseBot.MaxTime = 72
#
+# AuctionHouseBot.Class.CLASS.Allow.Zero = 0
+# Description: Include items without a sell or buy price.
+# Default: 0 - (Disabled)
+# 1 - (Enabled)
+
+AuctionHouseBot.Class.Consumable.Allow.Zero = 0
+AuctionHouseBot.Class.Container.Allow.Zero = 0
+AuctionHouseBot.Class.Weapon.Allow.Zero = 0
+AuctionHouseBot.Class.Gem.Allow.Zero = 0
+AuctionHouseBot.Class.Armor.Allow.Zero = 0
+AuctionHouseBot.Class.Reagent.Allow.Zero = 0
+AuctionHouseBot.Class.Projectile.Allow.Zero = 0
+AuctionHouseBot.Class.TradeGood.Allow.Zero = 0
+AuctionHouseBot.Class.Recipe.Allow.Zero = 0
+AuctionHouseBot.Class.Quiver.Allow.Zero = 0
+AuctionHouseBot.Class.Quest.Allow.Zero = 0
+AuctionHouseBot.Class.Key.Allow.Zero = 0
+AuctionHouseBot.Class.Misc.Allow.Zero = 0
+AuctionHouseBot.Class.Glyph.Allow.Zero = 0
+
+#
# AuctionHouseBot.Items.Vendor
# Description: Include items that can be bought from vendors.
# Default: 0 - (Disabled)
@@ -3058,6 +3240,27 @@ AuctionHouseBot.Items.Orange.Price.Ratio = 100
AuctionHouseBot.Items.Yellow.Price.Ratio = 100
#
+# AuctionHouseBot.Class.CLASS.Price.Ratio
+# Description: Percentage by which the price of items sold of each class is incremented / decreased (for all houses)
+# Default: 100 - (No change)
+
+AuctionHouseBot.Class.Consumable.Price.Ratio = 100
+AuctionHouseBot.Class.Container.Price.Ratio = 100
+AuctionHouseBot.Class.Weapon.Price.Ratio = 100
+AuctionHouseBot.Class.Gem.Price.Ratio = 100
+AuctionHouseBot.Class.Armor.Price.Ratio = 100
+AuctionHouseBot.Class.Reagent.Price.Ratio = 100
+AuctionHouseBot.Class.Projectile.Price.Ratio = 100
+AuctionHouseBot.Class.TradeGood.Price.Ratio = 100
+AuctionHouseBot.Class.Generic.Price.Ratio = 100
+AuctionHouseBot.Class.Recipe.Price.Ratio = 100
+AuctionHouseBot.Class.Quiver.Price.Ratio = 100
+AuctionHouseBot.Class.Quest.Price.Ratio = 100
+AuctionHouseBot.Class.Key.Price.Ratio = 100
+AuctionHouseBot.Class.Misc.Price.Ratio = 100
+AuctionHouseBot.Class.Glyph.Price.Ratio = 100
+
+#
# AuctionHouseBot.Items.ItemLevel.*
# Description: Prevent seller from listing items below/above this item level
# Default: 0 - (Disabled)
@@ -3108,7 +3311,7 @@ AuctionHouseBot.Items.Amount.Yellow = 0
# Armor: 8
# Reagent: 1
# Projectile: 2
-# TradeGod: 10
+# TradeGood: 10
# Generic: 1
# Recipe: 6
# Quiver: 1
@@ -3421,8 +3624,10 @@ Appender.DBErrors=2,2,0,DBErrors.log
Logger.root=5,Console Server
Logger.server=3,Console Server
Logger.commands.gm=3,Console GM
+Logger.scripts.hotswap=3,Console Server
Logger.sql.sql=5,Console DBErrors
Logger.sql.updates=3,Console Server
+Logger.mmaps=3,Server
#Logger.achievement=3,Console Server
#Logger.addon=3,Console Server
@@ -3431,6 +3636,7 @@ Logger.sql.updates=3,Console Server
#Logger.bg.arena=3,Console Server
#Logger.bg.battlefield=3,Console Server
#Logger.bg.battleground=3,Console Server
+#Logger.bg.reportpvpafk=3,Console Server
#Logger.chat.log=3,Console Server
#Logger.calendar=3,Console Server
#Logger.chat.system=3,Console Server
@@ -3523,3 +3729,42 @@ PacketSpoof.BanDuration = 86400
#
###################################################################################################
+
+###################################################################################################
+# METRIC SETTINGS
+#
+# These settings control the statistics sent to the metric database (currently InfluxDB)
+#
+# Metric.Enable
+# Description: Enables statistics sent to the metric database.
+# Default: 0 - (Disabled)
+# 1 - (Enabled)
+
+Metric.Enable = 0
+
+#
+# Metric.Interval
+# Description: Interval between every batch of data sent in seconds
+# Default: 10 seconds
+#
+
+Metric.Interval = 10
+
+#
+# Metric.ConnectionInfo
+# Description: Connection settings for metric database (currently InfluxDB).
+# Example: "hostname;port;database"
+# Default: "127.0.0.1;8086;worldserver"
+
+Metric.ConnectionInfo = "127.0.0.1;8086;worldserver"
+
+#
+# Metric.OverallStatusInterval
+# Description: Interval between every gathering of overall worldserver status data in seconds
+# Default: 1 second
+#
+
+Metric.OverallStatusInterval = 1
+
+#
+###################################################################################################
diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt
index d0f3e42cef8..c0bd102f8e6 100644
--- a/src/tools/map_extractor/CMakeLists.txt
+++ b/src/tools/map_extractor/CMakeLists.txt
@@ -9,41 +9,38 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-file(GLOB_RECURSE mapextractor_SRCS *.cpp *.h)
-
-set(include_Dirs
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_SOURCE_DIR}/dep/cppformat
- ${CMAKE_SOURCE_DIR}/dep/g3dlite/include
- ${CMAKE_SOURCE_DIR}/dep/libmpq
- ${CMAKE_SOURCE_DIR}/src/common
- ${CMAKE_SOURCE_DIR}/src/common/Utilities
- ${CMAKE_SOURCE_DIR}/src/server/shared
- ${CMAKE_CURRENT_SOURCE_DIR}/loadlib
-)
-
-if( WIN32 )
- set(include_Dirs
- ${include_Dirs}
- ${CMAKE_SOURCE_DIR}/dep/libmpq/win
- )
-endif()
-
-include_directories(${include_Dirs})
+CollectSourceFiles(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE_SOURCES)
add_executable(mapextractor
- ${mapextractor_SRCS}
+ ${PRIVATE_SOURCES}
)
+target_include_directories(mapextractor
+ PUBLIC
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/loadlib)
+
target_link_libraries(mapextractor
- common
- format
- g3dlib
- mpq
- ${BZIP2_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${Boost_LIBRARIES}
-)
+ PUBLIC
+ common
+ mpq)
+
+CollectIncludeDirectories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC_INCLUDES)
+
+target_include_directories(mapextractor
+ PUBLIC
+ ${PUBLIC_INCLUDES}
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR})
+
+set_target_properties(mapextractor
+ PROPERTIES
+ FOLDER
+ "tools")
if( UNIX )
install(TARGETS mapextractor DESTINATION bin)
diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp
index f3a761fd437..9d3dc47bce0 100644
--- a/src/tools/map_extractor/System.cpp
+++ b/src/tools/map_extractor/System.cpp
@@ -53,12 +53,13 @@ char input_path[MAX_PATH_LENGTH] = ".";
// **************************************************
enum Extract
{
- EXTRACT_MAP = 1,
- EXTRACT_DBC = 2
+ EXTRACT_MAP = 1,
+ EXTRACT_DBC = 2,
+ EXTRACT_CAMERA = 4
};
// Select data for extract
-int CONF_extract = EXTRACT_MAP | EXTRACT_DBC;
+int CONF_extract = EXTRACT_MAP | EXTRACT_DBC | EXTRACT_CAMERA;
// This option allow limit minimum height to some value (Allow save some memory)
bool CONF_allow_height_limit = true;
float CONF_use_minHeight = -500.0f;
@@ -103,7 +104,7 @@ void Usage(char* prg)
"%s -[var] [value]\n"\
"-i set input path (max %d characters)\n"\
"-o set output path (max %d characters)\n"\
- "-e extract only MAP(1)/DBC(2) - standard: both(3)\n"\
+ "-e extract only MAP(1)/DBC(2)/Camera(4) - standard: all(7)\n"\
"-f height stored as int (less map size but lost some accuracy) 1 by default\n"\
"Example: %s -f 0 -i \"c:\\games\\game\"", prg, MAX_PATH_LENGTH - 1, MAX_PATH_LENGTH - 1, prg);
exit(1);
@@ -151,7 +152,7 @@ void HandleArgs(int argc, char * arg[])
if(c + 1 < argc) // all ok
{
CONF_extract=atoi(arg[(c++) + 1]);
- if(!(CONF_extract > 0 && CONF_extract < 4))
+ if(!(CONF_extract > 0 && CONF_extract < 8))
Usage(arg[0]);
}
else
@@ -1025,6 +1026,56 @@ void ExtractDBCFiles(int locale, bool basicLocale)
printf("Extracted %u DBC files\n\n", count);
}
+void ExtractCameraFiles(int locale, bool basicLocale)
+{
+ printf("Extracting camera files...\n");
+ DBCFile camdbc("DBFilesClient\\CinematicCamera.dbc");
+
+ if (!camdbc.open())
+ {
+ printf("Unable to open CinematicCamera.dbc. Camera extract aborted.\n");
+ return;
+ }
+
+ // get camera file list from DBC
+ std::vector<std::string> camerafiles;
+ size_t cam_count = camdbc.getRecordCount();
+
+ for (size_t i = 0; i < cam_count; ++i)
+ {
+ std::string camFile(camdbc.getRecord(i).getString(1));
+ size_t loc = camFile.find(".mdx");
+ if (loc != std::string::npos)
+ camFile.replace(loc, 4, ".m2");
+ camerafiles.push_back(std::string(camFile));
+ }
+
+ std::string path = output_path;
+ path += "/Cameras/";
+ CreateDir(path);
+ if (!basicLocale)
+ {
+ path += langs[locale];
+ path += "/";
+ CreateDir(path);
+ }
+
+ // extract M2s
+ uint32 count = 0;
+ for (std::string thisFile : camerafiles)
+ {
+ std::string filename = path;
+ filename += (thisFile.c_str() + strlen("Cameras\\"));
+
+ if (boost::filesystem::exists(filename))
+ continue;
+
+ if (ExtractFile(thisFile.c_str(), filename))
+ ++count;
+ }
+ printf("Extracted %u camera files\n", count);
+}
+
void LoadLocaleMPQFiles(int const locale)
{
std::string fileName = Trinity::StringFormat("%s/Data/%s/locale-%s.MPQ", input_path, langs[locale], langs[locale]);
@@ -1111,6 +1162,19 @@ int main(int argc, char * arg[])
return 0;
}
+ if (CONF_extract & EXTRACT_CAMERA)
+ {
+ printf("Using locale: %s\n", langs[FirstLocale]);
+
+ // Open MPQs
+ LoadLocaleMPQFiles(FirstLocale);
+ LoadCommonMPQFiles();
+
+ ExtractCameraFiles(FirstLocale, true);
+ // Close MPQs
+ CloseMPQFiles();
+ }
+
if (CONF_extract & EXTRACT_MAP)
{
printf("Using locale: %s\n", langs[FirstLocale]);
diff --git a/src/tools/mmaps_generator/CMakeLists.txt b/src/tools/mmaps_generator/CMakeLists.txt
index 4eb416a106b..64c82101f61 100644
--- a/src/tools/mmaps_generator/CMakeLists.txt
+++ b/src/tools/mmaps_generator/CMakeLists.txt
@@ -8,51 +8,33 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-file(GLOB_RECURSE mmap_gen_sources *.cpp *.h)
+CollectSourceFiles(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE_SOURCES)
-set(mmap_gen_Includes
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/dep/libmpq
- ${CMAKE_SOURCE_DIR}/dep/zlib
- ${CMAKE_SOURCE_DIR}/dep/bzip2
- ${CMAKE_SOURCE_DIR}/dep/g3dlite/include
- ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast
- ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast/Include
- ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour
- ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour/Include
- ${CMAKE_SOURCE_DIR}/src/server/shared
- ${CMAKE_SOURCE_DIR}/src/server/game/Conditions
- ${CMAKE_SOURCE_DIR}/src/common
- ${CMAKE_SOURCE_DIR}/src/common/Collision
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Management
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Maps
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Models
- ${CMAKE_SOURCE_DIR}/src/common/Debugging
- ${CMAKE_SOURCE_DIR}/src/common/Threading
- ${CMAKE_SOURCE_DIR}/src/common/Utilities
-)
+add_executable(mmaps_generator ${PRIVATE_SOURCES})
-if( WIN32 )
- set(mmap_gen_Includes
- ${mmap_gen_Includes}
- ${CMAKE_SOURCE_DIR}/dep/libmpq/win
- )
-endif()
+target_link_libraries(mmaps_generator
+ PUBLIC
+ common
+ Recast
+ Detour
+ mpq)
-include_directories(${mmap_gen_Includes})
+CollectIncludeDirectories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC_INCLUDES)
-add_executable(mmaps_generator ${mmap_gen_sources})
+target_include_directories(mmaps_generator
+ PUBLIC
+ ${PUBLIC_INCLUDES}
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR})
-target_link_libraries(mmaps_generator
- common
- g3dlib
- Recast
- Detour
- ${BZIP2_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
- ${Boost_LIBRARIES}
-)
+set_target_properties(mmaps_generator
+ PROPERTIES
+ FOLDER
+ "tools")
if( UNIX )
install(TARGETS mmaps_generator DESTINATION bin)
diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp
index 3a63f9718db..80b7b266f27 100644
--- a/src/tools/mmaps_generator/MapBuilder.cpp
+++ b/src/tools/mmaps_generator/MapBuilder.cpp
@@ -699,7 +699,7 @@ namespace MMAP
iv.polyMesh = rcAllocPolyMesh();
if (!iv.polyMesh)
{
- printf("%s alloc iv.polyMesh FIALED!\n", tileString);
+ printf("%s alloc iv.polyMesh FAILED!\n", tileString);
delete[] pmmerge;
delete[] dmmerge;
delete[] tiles;
@@ -710,7 +710,7 @@ namespace MMAP
iv.polyMeshDetail = rcAllocPolyMeshDetail();
if (!iv.polyMeshDetail)
{
- printf("%s alloc m_dmesh FIALED!\n", tileString);
+ printf("%s alloc m_dmesh FAILED!\n", tileString);
delete[] pmmerge;
delete[] dmmerge;
delete[] tiles;
diff --git a/src/tools/vmap4_assembler/CMakeLists.txt b/src/tools/vmap4_assembler/CMakeLists.txt
index c33b2996685..58cb066f75b 100644
--- a/src/tools/vmap4_assembler/CMakeLists.txt
+++ b/src/tools/vmap4_assembler/CMakeLists.txt
@@ -9,17 +9,6 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-include_directories(
- ${CMAKE_SOURCE_DIR}/dep/g3dlite/include
- ${CMAKE_SOURCE_DIR}/src/server/shared
- ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
- ${CMAKE_SOURCE_DIR}/src/common
- ${CMAKE_SOURCE_DIR}/src/common/Collision
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Maps
- ${CMAKE_SOURCE_DIR}/src/common/Collision/Models
- ${ZLIB_INCLUDE_DIR}
-)
-
add_executable(vmap4assembler VMapAssembler.cpp)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
@@ -28,9 +17,12 @@ endif()
target_link_libraries(vmap4assembler
common
- g3dlib
- ${ZLIB_LIBRARIES}
-)
+ zlib)
+
+set_target_properties(vmap4assembler
+ PROPERTIES
+ FOLDER
+ "tools")
if( UNIX )
install(TARGETS vmap4assembler DESTINATION bin)
diff --git a/src/tools/vmap4_extractor/CMakeLists.txt b/src/tools/vmap4_extractor/CMakeLists.txt
index 55e66b32ea8..f13aaec15b2 100644
--- a/src/tools/vmap4_extractor/CMakeLists.txt
+++ b/src/tools/vmap4_extractor/CMakeLists.txt
@@ -9,28 +9,30 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-file(GLOB_RECURSE sources *.cpp *.h)
+CollectSourceFiles(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE_SOURCES)
-set(include_Dirs
- ${CMAKE_SOURCE_DIR}/dep/libmpq
-)
+add_executable(vmap4extractor ${PRIVATE_SOURCES})
-if( WIN32 )
- set(include_Dirs
- ${include_Dirs}
- ${CMAKE_SOURCE_DIR}/dep/libmpq/win
- )
-endif()
+target_link_libraries(vmap4extractor
+ PUBLIC
+ mpq)
-include_directories(${include_Dirs})
+CollectIncludeDirectories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC_INCLUDES)
-add_executable(vmap4extractor ${sources})
+target_include_directories(vmap4extractor
+ PUBLIC
+ ${PUBLIC_INCLUDES}
+ PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR})
-target_link_libraries(vmap4extractor
- mpq
- ${BZIP2_LIBRARIES}
- ${ZLIB_LIBRARIES}
-)
+set_target_properties(vmap4extractor
+ PROPERTIES
+ FOLDER
+ "tools")
if( UNIX )
install(TARGETS vmap4extractor DESTINATION bin)